function OpenLogin(){var a=new PopUp();a.openPopupWindow("newLogin.aspx","Milevo",700,344)}function SearchEnter(c,a,b){}function SearchFocus(a){if(a.value=="Nome do destino, restaurante, atração, hospedagem ..."){a.value=""}}function SearchBlur(a){if(a.value==""){a.value="Nome do destino, restaurante, atração, hospedagem ..."}}function ShowVersion(){var b=document.getElementById(ctrlMPhfVersion);var d=document.getElementById(ctrlMPhfServerName);var a=document.getElementById("spanVersion");var c=document.getElementById("spanServer");if(a.style.display=="inline"){a.style.display="none";c.style.display="none"}else{if(b!=null&&b!=undefined){a.innerHTML=" - "+b.value;a.style.display="inline"}if(d!=null&&d!=undefined){c.innerHTML=" - "+d.value;c.style.display="inline"}}}function OpenCreateUser(){var a=new Utilities();a.Redirect("SubscribeUser.aspx")}function OpenPopUpLB(a,b){myLytebox.start(document.getElementById("hfLinkLB"),false,true,a,b)}function OpenServices(a){myLytebox.start(document.getElementById("hfLinkLB"),false,true,"PopUp/"+a)}function fncValidar(){var a={ok:function(){$("#dialog").dialog("destroy")}};oUtilities=new Utilities();var b=document.getElementById(ctrlMPtxtSearch);if(b){if((b.value.length<3)||(b.value==null)){oUtilities.Dialog.Show("Entre com pelo menos 3 caracteres para realizar a pesquisa.",2,a);return false}}_gaq.push(["_trackEvent","Busca Geral","Busca Acessada"]);return true}function SMasterPage(a){var b=this;this.OpenProfile=function(){var c=a.LoggedUser().value;if(c==null){var d=new Dialog();var e={sim:function(){oPopUp.openPopupWindow("newLogin.aspx?redirectUrlOpener=perfil","Milevo",700,344);d.Hide()},nao:function(){d.Hide()}};d.Show("Para acessar essa página é necessário estar logado.</br> Deseja se logar agora ?",3,e)}else{oUtilities.Redirect("perfil/"+c.GetFullLink)}};this.ShowLoggedUser=function(c){$("#ctl00_liFazerLogin").html("Olá "+c);$("#ctl00_liCadastrese").html("<a href='javascript:;' onclick='javascript:oSMasterPage.Logout();'>Logout</a>")};this.Logout=function(){if(a.Logout().value){window.location.reload()}};$("#txtSearch").keydown(function(c){$("#btnOk").focus()});this.KeyDownHandler=function(m,i,c){var o=document.getElementById(m);var d=document.getElementById(i);var f=0;try{f=event.keyCode}catch(k){f=c.which}if(f==13){if(o.value.length>=3){d.click();return false}else{var g={ok:function(){$("#dialog").dialog("destroy")}};var n=$("#ctl00_ctl00_ctl00_ContentPlaceHolder1_Content_Content_txtCities");var j=$("#ctl00_ctl00_ctl00_ContentPlaceHolder1_Content_Content_txtRestaurants");var l=$("#ctl00_ctl00_ctl00_ContentPlaceHolder1_Content_Content_txtAttractions");var h=$("#ctl00_ctl00_ctl00_ContentPlaceHolder1_Content_Content_txtHotels");try{if(n!=null&&n.val().length>=3){return false}}catch(k){}try{if(j!=null&&j.val().length>=3){return false}}catch(k){}try{if(l!=null&&l.val().length>=3){return false}}catch(k){}try{if(h!=null&&h.val().length>=3){return false}}catch(k){}oUtilities=new Utilities();oUtilities.Dialog.Show("Entre com pelo menos 3 caracteres para realizar a pesquisa.",2,g);return false}}}}var oSMasterPage;var oPopUp;var oUtilities;var oDialog;var ctrlMPtxtSearch;$(function(){oPopUp=new PopUp();oSMasterPage=new SMasterPage(MasterPage);oUtilities=new Utilities();oDialog=new Dialog();$("#aPolicy").click(function(){oPopUp.openPopupWindow("Policy.htm","Política de Privacidade",800,600)});$("#aTerms").click(function(){oPopUp.openPopupWindow("Terms.htm","Termos de Uso",800,500)})});

