var notify=null;function initResults(){var _f99=navigator.userAgent.indexOf("Firefox")>-1;$("#boxController").toggle(function(){if(_f99){$("#search-box").hide();}else{$("#search-box").slideUp("slow");}this.innerHTML="Show Search";},function(){if(_f99){$("#search-box").show();}else{$("#search-box").slideDown("slow");}this.innerHTML="Hide Search";});var _f9a=$("#lnkSaveSearch");if(_f9a){notify=new AutoNotification();}}function initSearch(){$(document).ready(function(){$("#propertyType").bind("change",function(){if(this.value=="All"||this.value=="Condominium"){$("#condosRow").show();}else{$("#condosRow").hide();}});var _f9b=$("#propertyType").get(0).value;if(_f9b=="All"||_f9b=="Condominium"){$("#condosRow").show();}else{$("#condosRow").hide();}});}var MAIN_IMG=null;var MAIN_IMG_SRC=null;var MAIN_WIDTH=-1;var imageCache=new Array();function initListing(){$(document).ready(function(){MAIN_IMG=$("#mainImg").get(0);if(MAIN_IMG){MAIN_IMG_SRC=MAIN_IMG.src;MAIN_WIDTH=MAIN_IMG.width;}$(".thickbox").each(function(){if(this.rel=="house-pics"){var img=this.firstChild;if(img.getAttribute("id")!="mainImg"){var _f9d=new Image();_f9d.src=this.href;imageCache[this.href]=_f9d;}}});});}function isEmpty(_f9e){if(_f9e==null){return true;}if(_f9e.length==undefined){return true;}_f9e=trim(_f9e);if(_f9e.length==0){return true;}return false;}function trim(_f9f){while(_f9f.substring(0,1)==" "){_f9f=_f9f.substring(1,_f9f.length);}while(_f9f.substring(_f9f.length-1,_f9f.length)==" "){_f9f=_f9f.substring(0,_f9f.length-1);}return _f9f;}function warnInvalid(_fa0,s){alert(s);if(_fa0.focus){_fa0.focus();}return false;}function checkReq(_fa2,_fa3){if(isEmpty(_fa2.val())){return warnInvalid(_fa2,_fa3);}return true;}function isValidEmail(_fa4,_fa5){var _fa6=_fa4.val();if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/i.test(_fa6)){return warnInvalid(_fa4,_fa5);}return true;}function changeImages(link,_fa8){var temp=imageCache[link.href];var _faa=$("#mainImg").get(0);_faa.width=_fa8;_faa.src=temp.src;_faa.height=300;}function clearImages(){MAIN_IMG.src=MAIN_IMG_SRC;MAIN_IMG.width=MAIN_WIDTH;}function AutoNotification(){var _fab=null;var _fac=false;var _fad=[$("#fname"),$("#lname"),$("#email"),$("#confirm")];var _fae="display";var _faf=function(){$("#notifyBox").hide();$("#defaultBox").show();if(_fae=="none"){$("#search-box").hide();}};var _fb0=function(){var _fb1="<p class=\"auto\">A confirmation email has been sent to the email address you provided.&nbsp;&nbsp;Please activate your notification by clicking on the activation link contained in the email.</p><p style=\"text-align:center;\"><a href=\"javascript:notify.close();\">Close</a></p>";$("#notifyForm").hide();$("#notifyStatus").html(_fb1).show();};var _fb2=function(){var _fb3=["Please enter your first name.","Please enter your last name.","Please enter your email address.","Please confirm your email address."];var _fb4={};for(var i=0;i<_fad.length;i++){if(!checkReq(_fad[i],_fb3[i])){return;}var key=_fad[i].attr("name");_fb4[key]=_fad[i].val();}if(!isValidEmail(_fad[2],"Invalid email address.")){return;}if(_fad[2].val()!=_fad[3].val()){warnInvalid(_fad[2],"The email addresses entered do not match.");return;}_fb4["phone"]=$("#phone").val();_fb4["handler"]="mauisales_notifications:CreateNotification";$.post($("#contextPath").html()+"springboard/client.php",_fb4,_fb0);};var _fb7=function(){for(var i=0;i<_fad.length;i++){_fad[i].val("");}$("#phone").val("");};var _fb9=function(){_fae=$("#search-box").css("display");if(_fae=="none"){$("#search-box").show();}$("#defaultBox").hide();$("#notifyForm").show();_fb7();$("#notifyStatus").hide();$("#notifyBox").show();_fad[0].focus();};var _fba=function(){alert("We're sorry. You can only save a search criteria with 50 current properties or less. Please go back and narrow your search. You can save multiple searches if you choose.");};this.close=function(){_faf();};var _fbb=$("#totalResults").html();if(_fbb>500){$("#lnkSaveSearch").click(_fba);}else{$("#lnkSaveSearch").click(_fb9);}$("#btnCancel").click(_faf);$("#btnSave").click(_fb2);}function UserSearchesListing(_fbc){var _fbd=_fbc;var _fbe=function(_fbf){alert("delete");};$("p.del a").click(function(){if(confirm("Are you sure you want to remove this search?")){var _fc0={"handler":"mauisales_notifications:DeleteNotification","h":this.id};$.getJSON(_fbd+"springboard/client.php",_fc0,function(data){$("#wrap-"+data.h).fadeOut("slow");});}});}