var webroot="/",areaCheck="",areaArray=[],locationCheck="",locationArray=[],imageWidth,imageHeight,Idx=0,countStr="";$(document).ready(function(){var c=980;$(".main").width()>c&&$(".main").width(c);$(".footer").width()>c&&$(".footer").width(c);var p=980;$(".main").width()<p&&$(".main").width(p);$(".footer").width()>c&&$(".footer").width(c);$("input.bhs-search").Watermark("Search by ID, address, building, neighborhood, or agent","#a7a7a7");$(".navigation ul li").hoverIntent(function(){$("div",this).slideDown("fast");$.browser.msie&&$.browser.version.substr(0,1)==6&&$("#search .select").css({visibility:"hidden"})},function(){$("div",this).fadeOut("fast");$.browser.msie&&$.browser.version.substr(0,1)==6&&$("#search .select").css({visibility:"visible"})});$(".navigation ul li .properties-subnav",this).hover(function(){$(".navigation-bar ul li a.properties").addClass("properties-hover");$.browser.msie&&$.browser.version.substr(0,1)==6&&$("#search .select").css({visibility:"hidden"})},function(){$(".navigation-bar ul li a.properties").removeClass("properties-hover");$.browser.msie&&$.browser.version.substr(0,1)==6&&$("#search .select").css({visibility:"visible"})});$(".navigation ul li .agents-subnav",this).hover(function(){$(".navigation-bar ul li a.agents").addClass("agents-hover")},function(){$(".navigation-bar ul li a.agents").removeClass("agents-hover")});$(".navigation ul li .aboutus-subnav",this).hover(function(){$(".navigation-bar ul li a.aboutus").addClass("aboutus-hover")},function(){$(".navigation-bar ul li a.aboutus").removeClass("aboutus-hover")});$(".bhs-search").autocomplete(data,{matchContains:true,minChars:2,max:50,formatItem:function(a){return a.text}}).result(function(b,a){location.href=a.url});NumberOfImagesToRotate=3;var e=Math.ceil(Math.random()*NumberOfImagesToRotate);$(".home-newyork").css("backgroundImage","url('img/home_slide0"+e+".jpg')");$(".home-hamptons").css("backgroundImage","url('img/home_slide0"+e+".jpg')");$(".home-palmbeach").css("backgroundImage","url('img/home_slide0"+e+".jpg')");$(".pb-home-newyork").css("backgroundImage","url('img/pb_home_slide0"+e+".jpg')");$(".pb-home-hamptons").css("backgroundImage","url('img/pb_home_slide0"+e+".jpg')");$(".pb-home-palmbeach").css("backgroundImage","url('img/pb_home_slide0"+e+".jpg')");g();function g(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_1){setTimeout(g,250);return}else if(b<0){b=$("#thumbnail-1").width();d=$("#thumbnail-1").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-1").width();c=75}$("#thumbnail-1").width(Math.round(a));$("#thumbnail-1").height(75)}h();function h(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_2){setTimeout(h,250);return}else if(b<0){b=$("#thumbnail-2").width();d=$("#thumbnail-2").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-2").width();c=75}$("#thumbnail-2").width(Math.round(a));$("#thumbnail-2").height(75)}i();function i(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_3){setTimeout(i,250);return}else if(b<0){b=$("#thumbnail-3").width();d=$("#thumbnail-3").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-3").width();c=75}$("#thumbnail-3").width(Math.round(a));$("#thumbnail-3").height(75)}j();function j(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_4){setTimeout(j,250);return}else if(b<0){b=$("#thumbnail-4").width();d=$("#thumbnail-4").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-4").width();c=75}$("#thumbnail-4").width(Math.round(a));$("#thumbnail-4").height(75)}k();function k(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_5){setTimeout(k,250);return}else if(b<0){b=$("#thumbnail-5").width();d=$("#thumbnail-5").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-5").width();c=75}$("#thumbnail-5").width(Math.round(a));$("#thumbnail-5").height(75)}l();function l(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_6){setTimeout(l,250);return}else if(b<0){b=$("#thumbnail-6").width();d=$("#thumbnail-6").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-6").width();c=75}$("#thumbnail-6").width(Math.round(a));$("#thumbnail-6").height(75)}m();function m(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_7){setTimeout(m,250);return}else if(b<0){b=$("#thumbnail-7").width();d=$("#thumbnail-7").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-7").width();c=75}$("#thumbnail-7").width(Math.round(a));$("#thumbnail-7").height(75)}n();function n(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_8){setTimeout(n,250);return}else if(b<0){b=$("#thumbnail-8").width();d=$("#thumbnail-8").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-8").width();c=75}$("#thumbnail-8").width(Math.round(a));$("#thumbnail-8").height(75)}o();function o(){var a=0,c=0,b=-1,d=-1;if(!thumbLoad_9){setTimeout(o,250);return}else if(b<0){b=$("#thumbnail-9").width();d=$("#thumbnail-9").height();a=0}if(b>120){a=120;c=75}else{a=$("#thumbnail-9").width();c=75}$("#thumbnail-9").width(Math.round(a));$("#thumbnail-9").height(75)}navigator.platform!="iPad"&&$("img").lazyload({placeholder:webroot+"img/grey.gif",effect:"fadeIn"});$("div.agent-nameface").hoverIntent(function(){$("img.face",this).fadeIn("fast")},function(){$("img.face",this).fadeOut("fast")});$(".agent-list").hoverIntent(function(){$("div.agent-bio-preview",this).fadeIn("fast")},function(){$("div.agent-bio-preview",this).fadeOut("fast")});$("li.agent-preview").hoverIntent(function(){$("div.agent-bio-preview",this).fadeIn("fast")},function(){$("div.agent-bio-preview",this).fadeOut("fast")});$("a.language-tu").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-tu").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-ja").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-ja").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-cr").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-cr").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-ru").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-ru").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-se").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-se").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-hu").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-hu").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-ko").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-ko").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-fr").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-fr").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-ge").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-ge").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-it").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-it").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-po").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-po").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-sp").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-sp").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-he").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-he").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-du").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-du").fadeIn("fast");$(".hide-english").fadeIn("fast")});$("a.language-en").click(function(){$("[class*=lang-]:visible").fadeOut("fast");$("div.lang-en").css({height:"auto"});$("div.lang-en-more").css({display:"none"});$("div.lang-en").fadeIn("fast")});var f=window.location.pathname,s=f.substring(f.lastIndexOf("/")+1);f.indexOf("florida",1)>0&&$(".primary-photo").aeImageResize({width:700,height:460});var d=1,q=function(){$(".content .primary-photo").ImageStop(true,true);$(".content .primary-photo").ImageSwitch({Type:"FadeIn",NewImage:$("a.thumb img").eq(d).attr("src").replace("_s","_l"),speed:100});d++;$("a.thumb img").eq(d).attr("src")!=undefined&&$.ImagePreload($("a.thumb img").eq(d).attr("src").replace("_s","_l"))};$("a.thumb img").click(function(){$(".content .details-left .map-container").css({display:"none"});$("#map_canvas").css({display:"none"});$(".content .primary-photo").css({display:"block"});d=$("a.thumb img").index(this);q();var a=window.location.pathname,b=a.substring(a.lastIndexOf("/")+1);a.indexOf("florida",1)>0&&$(".primary-photo").aeImageResize({width:700,height:460})});$("a.map img").click(function(){$(".content .primary-photo").css({display:"none"});$(".content .details-left .map-container").css({display:"block"});$("#map_canvas").css({display:"block",position:"relative",width:"700px",height:"450px"});initialize(window.latitude,window.longitude,window.address,window.price,window.office)});$("a.thumb-floorplan img").click(function(){$(".content .details-left .map-container").css({display:"none"});$("#map_canvas").css({display:"none"});$(".content .primary-photo").css({display:"block"});d=$("a.thumb img").index(this);var a=window.location.pathname,b=a.substring(a.lastIndexOf("/")+1);a.indexOf("florida",1)>0&&$(".primary-photo").aeImageResize({width:700,height:460})});var r;$(".section-wrap .check").click(function(){if($(this).attr("checked")){$(this).parent(".section-wrap").find(".choose-locations .check").each(function(){$(this).attr("checked",true);var a="url('"+webroot+"img/button_expand.gif')";$(this).parent(".choose-locations").parent(".section-wrap").find("a.expand-area").css("background-image",a)});var a=window.location.pathname;if($.browser.mozilla)a=decodeURIComponent(a);if(a==webroot+"for-rent/new-york-city/"||a==webroot+"for-rent/palm-beach/")searchForm("search-listings-rentals","preview");else searchForm("search-listings","preview")}else{var a=window.location.pathname;if($.browser.mozilla)a=decodeURIComponent(a);$(this).parent(".section-wrap").find(".choose-locations .check").each(function(){$(this).removeAttr("checked");var a="url('"+webroot+"img/button_expand_grey.gif')";$(this).parent(".choose-locations").parent(".section-wrap").find("a.expand-area").css("background-image",a)});if(a==webroot+"for-rent/new-york-city/"||a==webroot+"for-rent/palm-beach/")searchForm("search-listings-rentals","preview");else searchForm("search-listings","preview")}});var b,a="";$("a.expand-area").click(function(){b=$(this).parent(".section-wrap").find(".choose-locations");$(".choose-locations .check").each(function(){if($(this).attr("checked")){var a="url('"+webroot+"img/button_expand.gif')";$(this).parent(".choose-locations").parent(".section-wrap").find("a.expand-area").css("background-image",a)}});if(b.css("display")!="block"){a="url('"+webroot+"img/button_expand_minus.gif')";$(this).css("background-image",a);b.slideDown("fast");b.css({display:"block"})}else{b.slideUp("fast");b.css({display:"none"});a="url('"+webroot+"img/button_expand_grey.gif')";$(this).css("background-image",a);$(this).parent(".section-wrap").find(".choose-locations .check").each(function(){if($(this).attr("checked")){var a="url('"+webroot+"img/button_expand.gif')";$(this).parent(".choose-locations").parent(".section-wrap").find("a.expand-area").css("background-image",a)}})}});$("a.expand-all").click(function(){b=$(".choose-locations");if(b.css("display")!="block"){$("a.expand-area").css("display","block");$(".choose-locations").slideDown("fast");a="url('"+webroot+"img/button_expand_minus.gif')";$("a.expand-area").css("background-image",a);$("a.expand-areas-all").css("background-image",a)}else{$(".choose-locations").slideUp("fast");a="url('"+webroot+"img/button_expand_grey.gif')";$("a.expand-area").css("background-image",a);$("a.expand-areas-all").css("background-image",a)}});$("a.expand-areas-all").click(function(){b=$(".choose-locations");if(b.css("display")!="block"){$("a.expand-area").css("display","block");$(".choose-locations").slideDown("fast");a="url('"+webroot+"img/button_expand_minus.gif')";$("a.expand-area").css("background-image",a);$("a.expand-areas-all").css("background-image",a)}else{$(".choose-locations").slideUp("fast");a="url('"+webroot+"img/button_expand_grey.gif')";$("a.expand-area").css("background-image",a);$("a.expand-areas-all").css("background-image",a)}});$(".agent-modal").click(function(){$("form.modal").fadeIn("fast");$("form.modal-on").fadeIn("fast")});$(".details-modal-share").click(function(){$("#modal-share").fadeIn("fast");$("#modal-purchase").fadeOut("fast");$("#modal-contact").fadeOut("fast");$("form.mortgage").fadeOut("fast")});$(".details-modal").click(function(){$("#modal-contact").fadeIn("fast");$("#modal-share").fadeOut("fast");$("#modal-purchase").fadeOut("fast");$("form.mortgage").fadeOut("fast")});$(".details-modal-purchase").click(function(){$("#modal-purchase").fadeIn("fast");$("#modal-share").fadeOut("fast");$("#modal-contact").fadeOut("fast");$("form.mortgage").fadeOut("fast")});$(".mortgage-calculator").click(function(){$("form.mortgage").fadeIn("fast");$("#modal-share").fadeOut("fast");$("#modal-contact").fadeOut("fast");$("#modal-purchase").fadeOut("fast")});$(".close-modal").click(function(){$("form.modal").fadeOut("fast");$("form.modal-on").fadeOut("fast");$("form.mortgage").fadeOut("fast")});$(".close-modal-icon").click(function(){$("form.modal").fadeOut("fast");$("form.modal-on").fadeOut("fast");$("form.mortgage").fadeOut("fast")});$("a.neighborhood-expand").click(function(){$("#neighborhood-details").slideDown("fast");$(this).hide()})});$().ready(function(){var a=window.location.pathname,c=a.substring(a.lastIndexOf("/")+1);if(a.indexOf("palm-beach",1)>0)a.indexOf("for-rent",1)>0;$(".search-string").click(function(){if(a.indexOf("for-rent",1)>0)searchForm("search-listings-rentals","submit");else searchForm("search-listings","submit")});var b="";b=$(".count").html()});function floorplan(a){$(".content .details-left .map-container").css({display:"none"});$.ImagePreload(a);$(".content .primary-photo").ImageStop(true,true);$(".content .primary-photo").ImageSwitch({Type:"FadeIn",NewImage:a,speed:100})}function mapFocus(b,a,c,e,d){window.latitude=parseFloat(b);window.longitude=parseFloat(a);window.address=c;window.price=e;window.office=d}function initAreas(a){window.areaCheck=a}function initLocations(a){window.locationCheck=a}function closeLabel(){$("div.map-label-click").css({display:"none"})}function searchForm(g,n){var t="",c="",f="",j="",i="",d="",m="",q="",k="",e="",r="",s="",u=0,o="",b=document.getElementById("search").elements;switch(g){case"new-listings":case"recently-updated-listings":case"managed-properties":case"open-houses":case"open-housesall":case"my-account":for(var a=0;a<b.length;a++)if(b[a].name!=undefined&&b[a].value!="")if(b[a].type=="select-one")c=c+b[a].value+"/";window.location=webroot+g+"/"+c;break;case"for-sale/results":case"for-rent/results":case"for-sale/new-york-city/results":case"for-rent/new-york-city/results":case"for-sale/palm-beach/results":case"for-rent/palm-beach/results":for(var a=0;a<b.length;a++)if(b[a].name!=undefined&&b[a].value!=""){if(b[a].type=="select-one")c=c+b[a].value+"/";if(b[a].type=="hidden")if(b[a].name=="crit")c=c+b[a].value+"/"}window.location=webroot+g+"/"+c;break;case"neighborhood":for(var a=0;a<b.length;a++)if(b[a].name!=undefined&&b[a].value!=""){if(b[a].type=="select-one")c=c+b[a].value+"/";if(b[a].type=="hidden"){if(b[a].name=="crit")c=c+b[a].value+"/";if(b[a].name=="neighborhood")o=b[a].value}}window.location=webroot+o+"/"+c;break;case"search-listings":case"search-listings-rentals":if(window.areaCheck!="")areaArray=areaCheck.split(",");if(window.locationCheck!="")locationArray=locationCheck.split(",");for(var a=0;a<b.length;a++)if(b[a].name!=undefined&&b[a].value!=""){if(b[a].type=="select-one")if(b[a].name=="price-low")f=f+b[a].value+"-";if(b[a].type=="select-one")if(b[a].name=="price-high")f=f+b[a].value+"/";if(b[a].type=="select-one")if(b[a].name=="beds")j=j+b[a].value+"/";if(b[a].type=="select-one")if(b[a].name=="baths")i=i+b[a].value+"/";if(b[a].type=="text")if(b[a].name=="keyword")k=k+b[a].value;if(b[a].type=="checkbox"){if(b[a].checked&&b[a].name=="condos")d=d+"condos-";if(b[a].checked&&b[a].name=="coops")d=d+"coops-";if(b[a].checked&&b[a].name=="condops")d=d+"condops-";if(b[a].checked&&b[a].name=="houses")d=d+"houses-";if(b[a].checked&&b[a].name=="townhouses")d=d+"townhouses-";if(b[a].checked&&b[a].name=="land")d=d+"land-";if(b[a].checked&&b[a].name=="commercial")d=d+"commercial-";if(b[a].checked&&(b[a].name=="attended-lobby"||b[a].name=="concierge"||b[a].name=="fireplace"||b[a].name=="outdoor-space"||b[a].name=="parking"||b[a].name=="pet-friendly"||b[a].name=="views"||b[a].name=="washer-dryer"||b[a].name=="just-listed"||b[a].name=="featured-properties"||b[a].name=="open-houses"||b[a].name=="new-development"||b[a].name=="managed-by-bhs"||b[a].name=="penthouse"||b[a].name=="loft"||b[a].name=="duplex-triplex"||b[a].name=="single-family"||b[a].name=="investment"||b[a].name=="multi-family"||b[a].name=="not-in-contract"||b[a].name=="dock"||b[a].name=="golf"||b[a].name=="oceanfront"||b[a].name=="tennis"||b[a].name=="gated-community"||b[a].name=="lakefront"||b[a].name=="pool"||b[a].name=="waterfront"))m=m+b[a].name+"/";for(var l=0;l<areaArray.length;l++)if(b[a].checked&&b[a].name==areaArray[l])e=e+b[a].name+",";for(var l=0;l<locationArray.length;l++)if(b[a].checked&&b[a].name==locationArray[l])e=e+b[a].name+","}}if(e!=""){e=e.substring(0,e.length-1)+"/";e="areas:"+e}if(f=="0-no-limit/")f="";else f="price:"+f;if(j=="0/")j="";else j=j;if(i=="0/")i="";else i=i;if(d!="")d=d.substring(0,d.length-1)+"/";if(k!="")k="keyword:"+trimAll(k)+"/";c=e+f+j+i+d+m+k;var p=window.location.pathname,h=p;if($.browser.mozilla){h=decodeURIComponent(h);g=decodeURIComponent(g)}if(h.indexOf("palm-beach",1)>0)h="palm-beach";if(h.indexOf("new-york-city",1)>0)h="new-york-city";switch(h){case"new-york-city":if(n=="preview")if(g=="search-listings-rentals")$(".search-string").load(webroot+"search_count_rentals_nyc/"+c).fadeIn("fast");else $(".search-string").load(webroot+"search_count_sales_nyc/"+c).fadeIn("fast");else if(g=="search-listings-rentals")window.location=webroot+"for-rent/new-york-city/results/"+c;else window.location=webroot+"for-sale/new-york-city/results/"+c;break;case"palm-beach":if(n=="preview")if(g=="search-listings-rentals")$(".search-string").fadeOut("fast").load(webroot+"search_count_rentals_palmbeach/"+c).fadeIn("fast");else $(".search-string").load(webroot+"search_count_sales_palmbeach/"+c).fadeIn("fast");else if(g=="search-listings-rentals")window.location=webroot+"for-rent/palm-beach/results/"+c;else window.location=webroot+"for-sale/palm-beach/results/"+c}}}function trimAll(a){while(a.substring(0,1)==" ")a=a.substring(1,a.length);while(a.substring(a.length-1,a.length)==" ")a=a.substring(0,a.length-1);return a}function detailsPN(a){document.results.action=a;document.results.submit()}function agentLetterSort(a){document.agents.action=a;document.agents.submit()}function checkForZero(a){if(a.value==0||a.value.length==0){alert("This field can't be 0!");a.focus()}else calculatePayment(a.form)}function formatCurrency(a){a=a.toString().replace(/\$|\,/g,"");if(isNaN(a))a="0";sign=a==(a=Math.abs(a));a=Math.floor(a*100+.50000000001);cents=a%100;a=Math.floor(a/100).toString();if(cents<10)cents="0"+cents;for(var b=0;b<Math.floor((a.length-(1+b))/3);b++)a=a.substring(0,a.length-(4*b+3))+","+a.substring(a.length-(4*b+3));return(sign?"":"-")+"$"+a+"."+cents}function cmdCalc_Click(a){var d,b,c;d=parseFloat(a.price.value);b=parseFloat(a.interest_rate.value);c=parseFloat(a.loan_term.value);if(d==0||d.length==0){alert("The Price field can't be 0!");a.price.focus()}else if(b==0||b.length==0){alert("The Interest Rate field can't be 0!");a.interest_rate.focus()}else if(c==0||c.length==0){alert("The Term field can't be 0!");a.loan_term.focus()}else calculatePayment(a)}function calculatePayment(a){var f,k,h,e,b,d=0,c=0,i,j,g=0;b=a.price.value;b=b.replace("$","");b=b.replace(/,/gi,"");b=parseFloat(b);f=a.percent_down.value;f=f.replace("%","");f=parseFloat(f);k=f*.01;h=b*k;h=parseFloat(h);g=a.principle.value;g=parseFloat(g);e=a.interest_rate.value;e=e.replace("%","");e=parseFloat(e);if(a.real_estate_tax.value!=""){d=a.real_estate_tax.value;d=d.replace("$","");d=d.replace(",","");d=parseFloat(d)}if(a.maint_cc.value!=""){c=a.maint_cc.value;c=c.replace("$","");c=c.replace(",","");c=parseFloat(c)}g=b-h;intRate=e/100/12;months=a.loan_term.value*12;i=Math.floor(g*intRate/(1-Math.pow(1+intRate,-1*months))*100)/100;a.mortgage_payment.value=formatCurrency(i);j=i+d+c;a.total_monthly_payment.value=formatCurrency(j);a.principle.value=formatCurrency(g)}var isPhotoLoaded=false,thumbLoad_1=false,thumbLoad_2=false,thumbLoad_3=false,thumbLoad_4=false,thumbLoad_5=false,thumbLoad_6=false,thumbLoad_7=false,thumbLoad_8=false,thumbLoad_9=false;function photoLoaded(a){switch(a){case 1:thumbLoad_1=true;break;case 2:thumbLoad_2=true;break;case 3:thumbLoad_3=true;break;case 4:thumbLoad_4=true;break;case 5:thumbLoad_5=true;break;case 6:thumbLoad_6=true;break;case 7:thumbLoad_7=true;break;case 8:thumbLoad_8=true;break;case 9:thumbLoad_9=true}isPhotoLoaded=true}function SavedSearchRemoval(){return confirm("Are you sure you want to remove this saved search?")}function SavedListingRemoval(){return confirm("Are you sure you want to remove this saved listing?")}function PrintListing(b,a){a=a.replace("http://media.bhsusa.com/pictures/","");a=a.replace("http://media.bhsusa.com/floorplans/","");a=a.replace(b,"");a=a.replace("_l.jpg","");a=a.replace(".jpg","");a=a.replace("-","");window.open(webroot+"print/"+b+"/photo-"+a,"","width=800,height=600,status=yes,toolbar=no,menubar=yes, scrollbars=yes")}function disableEnterKey(b){var a;if(window.event)a=window.event.keyCode;else a=b.which;if(a==13){searchForm("search-listings","submit");return false}else return true}function disableEnterKeyR(b){var a;if(window.event)a=window.event.keyCode;else a=b.which;if(a==13){searchForm("search-listings-rentals","submit");return false}else return true}var g_imagesContainer=null;function handleImageMoved(c,a,b){$("#current").html(a.toString());$(".count").html(b.toString())}function handleResize(c,b,a){alert("New size is "+b.toString()+"x"+a.toString())}function initSwiper(a){g_imagesContainer=$("#main-images-controller").asketicSwipe({cycle:a,scale:1,tolerance:.25,time:300,touchSensitivity:10,fitContainer:false,fitContainerMargin:20,fitContainerUpscale:true})}(function(a){a.fn.aeImageResize=function(b){var c=0,d=a.browser.msie&&6==~~a.browser.version;if(!b.height&&!b.width)return this;if(b.height&&b.width)c=b.width/b.height;return this.one("load",function(){this.removeAttribute("height");this.removeAttribute("width");this.style.height=this.style.width="";var f=this.height,g=this.width,h=g/f,a=b.height,d=b.width,e=c;if(!e)if(a)e=h+1;else e=h-1;if(a&&f>a||d&&g>d){if(h>e)a=~~(f/g*d);else d=~~(g/f*a);this.height=a;this.width=d}}).each(function(){(this.complete||d)&&a(this).trigger("load")})}})(jQuery)
