function valcusWrongPassword(b,a){PageMethods.valcusWrongPassword(document.getElementById(b).value,document.getElementById(a).value,OnSucceeded,OnFailed)}function vlcusWrongPassword(b,a){PageMethods.valcusWrongPassword(document.getElementById(b).value,document.getElementById(a).value,OnSucceeded1,OnFailed)}function valcusNoPermision(b,a){PageMethods.valcusNoPermision(document.getElementById(b).value,document.getElementById(a).value,OnSucceeded,OnFailed)}function vlcusNoPermision(b,a){PageMethods.valcusNoPermision(document.getElementById(b).value,document.getElementById(a).value,OnSucceeded1,OnFailed)}function OnSucceeded(a,d,b){if(a=="0"){if(b=="valcusNoPermision"){LoginInvalid()}}if(a=="1"){try{_gaq.push(["_trackEvent","Authentication","Login","Succes"])}catch(c){}try{if(window.location.href.indexOf("requireloginforstat=true")>-1){window.location.href="Default.aspx?Action=ListAdsStatistic"}else{window.location.href="Default.aspx?Action=LandingPage"}}catch(c){window.location.href="Default.aspx?Action=LandingPage"}}}function OnSucceeded1(a,c,b){if(a=="0"){Page_ClientValidate("vlLogin")}if(a=="1"){window.location.href="Default.aspx?Action=PlaceAdStep5"}if(a!="0"&a!="1"){document.getElementById("ctl00_ContentPlaceHolder1_ctl01_ctl00_vlcusWrongPassword").innerHTML=a}}function OnFailed(b,d,a){try{_gaq.push(["_trackEvent","Authentication","Login","Failed"])}catch(c){}}function InsertFavorite(a){PageMethods.InsertFavorite(a,OnSucceeded2,OnFailed)}function InsertAgent(b,a){PageMethods.InsertSearchAgent(b,a,OnSucceededSA,OnFailedSA)}function OnSucceededSA(a,c,b){if(a==true){$("#showpanel1").hide();$("#showpanel2").hide();$("#showpanel3").show()}else{location.reload(true)}}function OnFailedSA(b,c,a){}function OnSucceeded2(j,c,g){if(j=="1"){var d=document.getElementById("forshortlist").innerHTML;var a=d.indexOf("(");var e=d.indexOf(")");var f=d.substring(a+1,e);if(f==0){d=d.substring(0,a);d=d+"(1)"}else{var b=parseInt(f)+1;d=d.replace(f,b)}document.getElementById("forshortlist").innerHTML=d;if(document.getElementById("SavedAds")!=null){var h=document.getElementById("SavedAds").innerHTML;if(f==0){var a=h.indexOf("(");h=h.substring(0,a);h=h+"(1)";document.getElementById("SavedAds").innerHTML=h}else{h=h.replace(f,b);document.getElementById("SavedAds").innerHTML=h}}}}function RemoveFavorite(a){PageMethods.RemoveFavorite(a,OnSucceeded3,OnFailed)}function OnSucceeded3(j,c,g){var d=document.getElementById("forshortlist").innerHTML;var a=d.indexOf("(");var e=d.indexOf(")");var f=d.substring(a+1,e);var b=parseInt(f)-1;d=d.replace(f,b);document.getElementById("forshortlist").innerHTML=d;if(document.getElementById("SavedAds")!=null){var h=document.getElementById("SavedAds").innerHTML;h=h.replace(f,b);document.getElementById("SavedAds").innerHTML=h}}function valcusWrongPasswordSearchAgent(b,a){PageMethods.valcusWrongPassword(document.getElementById(b).value,document.getElementById(a).value,OnSucceededSearchAgent,OnFailed)}function valcusNoPermisionLogin(b,a){PageMethods.valcusNoPermision(document.getElementById(b).value,document.getElementById(a).value,OnSucceededSearchAgent,OnFailed)}function OnSucceededSearchAgent(a,c,b){if(a=="0"){Page_ClientValidate("LoginPage")}if(a=="1"){window.location.href="Default.aspx?Action=CommentSearchAgent"}if(a!="0"&a!="1"){document.getElementById("ctl00_ContentPlaceHolder1_ctl01_ctl00_valcusWrongPassword").innerHTML=a}}function RedirectToAdContactEmail(a){PageMethods.RedirectToAdContactEmail(a,OnSucceededRedirect,OnFailed)}function OnSucceededRedirect(a,c,b){window.location.href="Default.aspx?Action=AdContactEmail"}function RedirectToProjectContactEmail(a){PageMethods.RedirectToProjectContactEmail(a,OnSucceededRedirectPrj,OnFailed)}function OnSucceededRedirectPrj(a,c,b){window.location.href="Default.aspx?Action=ProjectContactEmail"}function RedirectToProjectSendMail(a){PageMethods.RedirectToProjectSendMail(a,OnSucceededRedirectPrjSendMail,OnFailed)}function OnSucceededRedirectPrjSendMail(a,c,b){window.location.href="Default.aspx?Action=ProjectSendMail"}function InsertUserLink(b,c){var b=document.getElementById("url-link").value;var a=document.getElementById("link-name").value;document.getElementById("collapse").style.display=="none";document.getElementById("collapse").style.visibility="hidden";if(document.getElementById("EditLink").value!=""){PageMethods.EditUserLink(b,a,document.getElementById("EditLink").value,OnSucceededLink,OnFailedLink)}else{PageMethods.InsertUserLink(b,a,OnSucceededLink,OnFailedLink)}}function OnSucceededLink(a,c,b){window.location.href="Default.aspx?Action=LandingPage"}function OnFailedLink(b,c,a){}function DeleteUserLink(a){PageMethods.DeleteUserLink(a,OnSucceededLink,OnFailedLink)}function CallRenewAd(a,b){PageMethods.RenewAd(a,b,OnSucceededRenewAd,OnFailedRenewAd)}function OnSucceededRenewAd(a,c,b){$("#renewad_smscode").val(a);$("#renewad_activate").removeAttr("disabled");$("#renewad_smscode").removeAttr("disabled");if(a==RenewAdSuccessMsg){$("#renewad_smscode").attr("errorcode","1")}document.getElementById("renewad_activate").style.cursor="pointer";document.getElementById("divSpinner").style.display="none";document.getElementById("divSpinner").style.visibility="hidden";_gaq.push(["_trackEvent","UpSelling","RenewAd",a])}function OnFailedRenewAd(a,c,b){$("#renewad_smscode").val(a);_gaq.push(["_trackEvent","UpSelling","RenewAd","Failed"])}function CallShowPhoneNumber(a){PageMethods.ShowPhoneNumber(a,OnSucceededShowPhoneNumber,OnFailedShowPhoneNumber)}function OnSucceededShowPhoneNumber(a,c,b){}function OnFailedShowPhoneNumber(a,c,b){}function GetSearchContactData(a){PageMethods.GetSearchContactData(a,OnSucceededGetSearchContactData,OnFailedGetSearchContactData)}function OnSucceededGetSearchContactData(a,e,b){var d=a.split(";");for(i=0;i<d.length;i++){if(d[i].indexOf("adid")!=-1){var c=d[i].split("=");$("#AdID").val(c[1])}if(d[i].indexOf("CntImageVisible")!=-1){var c=d[i].split("=");if(c[1]=="false"){$("#Contact_person_image").hide();$("#Contacts_name").hide()}}if(d[i].indexOf("src")!=-1){var c=d[i].split("=");$("#Contact_person_image").attr("src",c[1])}if(d[i].indexOf("CntName")!=-1){var c=d[i].split("=");$("#Contacts_name").text(c[1])}}document.getElementById("div_contact").style.top="154px";document.getElementById("div_contact").style.left=document.body.clientWidth/2-230+"px";document.getElementById("div_contact").style.display="block";document.getElementById("div_contact").style.visibility="visible";this.blur();return false}function OnFailedGetSearchContactData(a,c,b){}function ContactOwnerSearchResult(d,a,g,b,c,j,f,h,e){$("#divSpinner").show();PageMethods.ContactOwnerSearchResult(d,a,g,b,c,j,f,h,e,OnSucceededContactOwnerSearchResult,OnFailedContactOwnerSearchResult)}function OnSucceededContactOwnerSearchResult(a,c,b){$("#divSpinner").hide();$("#CntTable").hide();$("#EmailSent").show();setTimeout(function(){$("#div_contact").hide()},3000)}function OnFailedContactOwnerSearchResult(a,c,b){};
