if(typeof hotpads=="undefined"){var hotpads={};}var fullViewShowing;var fullViewType="";var openFullViewId;var iframe=false;var openFullViewsNewWindow=false;hotpads.base={resizeIframe:function(b){if($("#fullviewIframe").length){$("#fullviewIframe").css("height",b+"px");}},resizeParentIframe:function(){if(parent&&parent.hotpads.base.resizeIframe&&$("#all").height()){var b=$("#all").height()+40;
if(b<850){b=850;}parent.hotpads.base.resizeIframe(b);}},makeSpaceForRightSection:function(){var d=$.browser.msie&&$.browser.version=="8.0";if(!d){scroll(0,0);}if(typeof(fullViewShowing)!="undefined"&&fullViewShowing){document.title="HotPads - Search for Real Estate, Apartments & Houses for Rent, Foreclosures and Homes for Sale";
}if($(".leftContainer").css("width")!="38%"){var c=($.browser.msie&&$.browser.version=="6.0")?"61.5%":"62%";$(".rightContainer").width(c);$(".leftContainer").width("38%");}hotpads.base.hideFooter();},loadIframe:function(b){$.log("loading iframe");hotpads.base.makeSpaceForRightSection();hotpads.advancedFilterView.close();
if($("#fullview").length>0&&$("#fullview").css("display")!="none"){$("#fullview").hide().html("");}$(frames["fullviewIframe"].document).find("#squaread").css("visibility","hidden");$(frames["fullviewIframe"].document).find("#all").css("opacity","0.3");$(frames["fullviewIframe"].document).find(".realAds").css("display","none");
$("#loading").show();fullViewShowing=true;frames["fullviewIframe"].location.replace(b);},setFullViewShowing:function(b){openFullViewId=b;$(function(){hotpads.base.loadResources(fullViewType,openFullViewId);hotpads.base.loadFooter(fullViewType,openFullViewId);});},showIframe:function(){iframe=true;if($("#fullviewIframe").css("display")=="none"){$("#fullviewIframe").show();
}$("#loading").hide();$("#fullviewIframe").focus().log("Iframe loading finished");},updateFullView:function(f){if(typeof(f)!="undefined"){var g=$.deserialize(f);if(typeof(g.detailsOpen)!="undefined"&&g.detailsOpen=="true"){var h=(typeof(g.previewType)!="undefined")?g.previewType:"";var e=(typeof(g.previewId)!="undefined")?g.previewId:"";
if(h!=""&&e!=""&&(typeof(openFullViewId)=="undefined"||e!=openFullViewId)){if(h=="advancedFilter"){$.log("opening advanced filter full view");hotpads.advancedFilterView.open();return;}else{hotpads.advancedFilterView.close();}if(h=="area"){if(e.search(/\D/)==-1){$.log("opening area full view");loadAreaFullView(e);
}else{$.log("opening custom full view");loadCustomFullView(e);}}else{$.log("opening listing full view");loadFullView(e);}}}else{hotpads.base.closeFullView();}}},closeRightHalf:function(){openFullViewId="";hotpads.base.hideFooter();hotpads.base.hideResources();hotpads.advancedFilterView.close();if($("#fullview").length&&$("#fullview").css("display")!="none"){$.log("closing non-iframed fullview");
$("#fullview").hide().html("");}else{$.log("closing iframe");if($.browser.safari){$("#fullviewIframe").height("1px");}else{$("#fullviewIframe").hide();}frames["fullviewIframe"].location.replace("about:blank");}},closeFullView:function(){hotpads.base.closeRightHalf();$(".leftContainer").css("width","100%");
if(rightAd){$("#rightAd").show();$("#mapperWrapper").css("margin-right","161px");hotpads.base.loadRightAd();}hotpads.map.resize();fullViewShowing=false;document.title="HotPads - Search for Real Estate, Apartments & Houses for Rent, Foreclosures and Homes for Sale";$("#mapper").focus();},popoutFV:function(b){hotpads.base.closeFullView();
$("#openFullViewsNewWindow").attr("checked",true);hotpads.filter.updateFilter();if(fullViewType=="listing"){loadFullView(b);}else{if(fullViewType=="area"){loadAreaFullView(b);}else{if(fullViewType=="areaListings"){loadAreaFullView(b);}else{loadCustomFullView(b);}}}},popinFV:function(c){var d=window.opener;
if(d!=null&&typeof(d!="undefined")&&!d.closed){$(d.document).find("#openFullViewsNewWindow").attr("checked",false);d.hotpads.filter.updateFilter();if(fullViewType=="listing"){d.loadFullView(c);}else{if(fullViewType=="area"||fullViewType=="areaListings"){d.loadAreaFullView(c);}else{d.loadCustomFullView(c);
}}d.hotpads.map.getMapper().setFullViewShowing(true);window.close();}else{if(fullViewType=="listing"){window.location.pathname=LISTING_FULL_VIEW_BASE+c;}else{if(fullViewType=="area"||fullViewType=="areaListings"){window.location.pathname=AREA_FULL_VIEW_BASE+c;}else{window.location.pathname=CUSTOM_FULL_VIEW_BASE+c;
}}}},hideFooter:function(){$("#footerSurround").hide();},loadFooter:function(d,c){if(typeof frames["footerAdIframe"]=="undefined"){return;}if($("#footerAd").css("display")!="none"){$("#footerAd").hide().html("");$("#footerAdIframe").show();}$.log("updating footerAdIframe");if(d=="listing"){if(frames["footerAdIframe"]!=null){frames["footerAdIframe"].location.replace("/search/footerAd?listingId="+c);
}}else{if(d=="area"&&c){frames["footerAdIframe"].location.replace("/search/footerAd?areaId="+c);}else{frames["footerAdIframe"].location.replace("/search/footerAd");}}$("#footerSurround").show();},loadRightAd:function(){$("#rightAdIframe").show();$.log("updating rightAdIframe");frames["rightAdIframe"].location.replace("/search/rightAd");
},hideResources:function(){if($("#resources").length){$("#resources").hide();}},loadResources:function(d,c){if($("#resources").length){if(d=="listing"&&typeof c!="undefined"){requestUrl="/search/recommendedListings"+"?listingId="+c+"&maxResults=3"+"&offset=2"+"&includeHtml=true";$("#resources").show();
frames["resourcesIframe"].location.replace(requestUrl);}else{$("#resources").show();$.log("showing resources");frames["resourcesIframe"].location.replace("/search/resources");}}},loadingDiv:'<div style="padding: 50px 0; text-align:center; font-size: 12px;"><img src="/images/ajax-loader.gif" />loading results...</div>'};
hotpads.map={loaded:false,insertMap:function(j,n,k,l){$.log("inserting map: "+j);if($.browser.msie&&!l){window.location.hash=window.location.hash;}$("#mapDiv").mousewheel(function(a){return false;});$("#mapDiv").css("height","");$(window).resize(function(){hotpads.map.resize();});hotpads.map.resize();
j=j.replace(/\n/g,"");j=j.replace(/\"/g,"'");var m="varsXml="+j+"&dev="+k;var o=new SWFObject(mapper_location,"mapper","100%","100%","9","#000");o.addParam("quality","high");o.addParam("menu","false");o.addParam("scale","noscale");o.addParam("allowScriptAccess","always");o.addParam("swLiveConnect","true");
if(hotpads.map.api&&hotpads.map.api.fullViewsAbove==true){o.addParam("wmode","opaque");}o.addParam("FlashVars",m);o.useExpressInstall("http://hotpads.com/FlashJavascriptIntegration/expressInstall.swf");o.write("mapDiv");$.log("flash code written");if($("#noflash").length){$("#flashLoading").hide();var h="In order to use the map-based real estate search on Hotpads.com, you need to have Adobe Flash Player installed.<br/><br/>"+"<a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'>download Flash Player now</a><br/>"+'or <br/><a href="#" onclick="hotpads.filter.setSearcher(\'text\',$.param($.deserialize(initialSearchStateVars, hotpads.filter.LOCATION_PARAMS)));">switch to text search</a>.';
$("#noflash").html(h);$("#noflash").css("display","block");return;}$("#mapper").focus();mapDWR.mapLoaded();},resize:function(){if($("#mapperWrapper").length){var d=($("#resources").length&&$("#resources").css("display")!="none")?315:0;var c=hotpads.map.getTargetMapDimensions().height;$("#mapperWrapper").height(c);
hotpads.advancedFilterView.resize();}},getTargetMapDimensions:function(){var c=$("#searchWindow").offset().top+2;var d={width:$("#searchWindow").width(),height:$(window).height()-c};return d;},recenter:function(){hotpads.map.moveMapCenter(mapLat,mapLon,mapZoom);},moveMapToCity:function(b){arr=b.split("_");
lat=arr[0];lon=arr[1];zoom=Number(arr[2])-1;id=arr[3];hotpads.map.moveMapCenter(lat,lon,zoom);},moveMapCenter:function(h,g,e,f){if(typeof f=="undefined"){f=true;}hotpads.map.getMapper().moveMapCenter(Number(h),Number(g),Number(e),f);},setAsFavorite:function(c,d){$.log("setAsFavorite: "+c+", "+d);if(typeof(hotpads.map.getMapper())!="undefined"){hotpads.map.getMapper().setAsFavorite(c,d);
}},getMapper:function(){return hotpads.map.getFlashMovie("mapper");},getFlashMovie:function(b){if(navigator.appName.indexOf("Microsoft")!=-1){return window[b];}else{return document[b];}},moveMapToAndPreview:function(e,d,f){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){hotpads.map.getMapper().moveMapToAndPreview(e,d,f);
}loadFullView(e);},moveMapToAndPreviewArea:function(g,e,h,f){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){hotpads.map.moveMapCenter(e,h,f);}loadAreaFullView(g);},locationParams:"",fullViewParams:"",load:function(g,l,j,h,k){$.log("loading map: "+g+"\n"+l+"\n"+j+"\n"+h);scroll(0,0);
$("#searchWindow").html(hotpads.base.loadingDiv);var m="http://"+window.location.host+"/search?mapFragment=true";m+="&"+g;m+=isEmpty(l)?"":"&"+l;m+=isEmpty(j)?"":"&"+j;m+=isEmpty(h)?"":"&"+h;$.ajax({url:m,success:function(a){if(hotpads.filter.currentSearcher=="map"){$("#searchWindow").html(a);hotpads.map.loaded=true;
}}});hotpads.base.updateFullView(j);},unload:function(){hotpads.map.loaded=false;},update:function(p,l,j,q,k){$.log("updating map: "+p+"\n"+l+"\n"+j+"\n"+q);hotpads.map.fullViewParams=j;hotpads.map.locationParams=l;hotpads.base.updateFullView(j);if(hotpads.map.loaded){var m=(!isEmpty(l))?$.deserialize(l):{};
var n="";n+=isEmpty(j)?"":j;n+=isEmpty(q)?"":"&"+q;n=n.replace(/&{1,}/g,"&");k=typeof(k)=="undefined"||k;if(typeof(hotpads.map.getMapper())!="undefined"){if(!isEmpty(m.lat)&&!isEmpty(m.lon)&&!isEmpty(m.zoom)){hotpads.map.moveMapCenter(m.lat,m.lon,m.zoom,k);}if(n!=""){hotpads.map.getMapper().setMapConfig(n,k);
}var o=hotpads.map.getMapper();o.setListingFilter(p,k);}}},changeLocation:function(b){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){hotpads.map.getMapper().setLocation(b);}},getLocation:function(){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){return $.param($.deserialize(hotpads.map.getMapper().getMapConfig(),hotpads.filter.LOCATION_PARAMS));
}else{return hotpads.map.locationParams;}},getOrderParams:function(){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){return $.param($.deserialize(hotpads.map.getMapper().getListingFilter(),hotpads.filter.ORDER_PARAMS));}else{return"";}},getFullViewParams:function(){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){return $.param($.deserialize(hotpads.map.getMapper().getMapConfig(),hotpads.filter.FULL_VIEW_PARAMS));
}else{return hotpads.map.fullViewParams;}},closeFullView:function(){if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){hotpads.map.getMapper().setFullViewShowing(false);}hotpads.base.closeFullView();}};isEmpty=function(b){return typeof(b)=="undefined"||b=="";};loadNewWindowFullView=function(f){if(!hotpads.filter.advancedFilterOpen){hotpads.base.closeFullView();
}var e=window.open(f);var d=e==null||typeof(e)=="undefined";if(typeof(hotpads.map.getMapper())!="undefined"&&hotpads.map.loaded){hotpads.map.getMapper().setFullViewShowing(false);}};var LISTING_FULL_VIEW_BASE="/search/listing/";var AREA_FULL_VIEW_BASE="/search/area/";var CUSTOM_FULL_VIEW_BASE="/search/";
var OPFVNW_VARS="?emptyType=true";var FV_VARS="?header=false&emptyType=true&iframe=true";loadFullView=function(b){$.log("loading fullview: "+b);openFullViewId=b;fullViewType="listing";if(openFullViewsNewWindow){loadNewWindowFullView(LISTING_FULL_VIEW_BASE+b+OPFVNW_VARS);}else{hotpads.base.loadIframe(LISTING_FULL_VIEW_BASE+b+FV_VARS);
}};loadAreaFullView=function(b){openFullViewId=b;fullViewType="area";if(openFullViewsNewWindow){loadNewWindowFullView(AREA_FULL_VIEW_BASE+b+OPFVNW_VARS);}else{hotpads.base.loadIframe(AREA_FULL_VIEW_BASE+b+FV_VARS);}};loadCustomFullView=function(b){openFullViewId=b;fullViewType="custom";if(openFullViewsNewWindow){loadNewWindowFullView(CUSTOM_FULL_VIEW_BASE+b+OPFVNW_VARS);
}else{hotpads.base.loadIframe(CUSTOM_FULL_VIEW_BASE+b+FV_VARS);}};setPermalink=function(b){if(_plstring!=b){_plstring=b;_plstringChanged=true;}};setLinkVars=function(b){if(b.substr(0,1)=="&"){b=b.substr(1,b.length);}if($("#saveSearchLink").length){$("#saveSearchLink").attr("href","/users/editSearch.htm?"+b);
}if($("#feedSearchLink").length){$("#feedSearchLink").attr("href","/searchRSS.xml?"+b);}if($("#kmlSearchLink").length){$("#kmlSearchLink").attr("href","/syndicate/search.kml?"+b);}};_plstring="";_plstringChanged=false;historyChange=function(d,c){if(historyInitialized){hotpads.filter.init(initialSearchStateVars,d,false);
}};updatePermalink=function(b){if(_plstringChanged==true){_plstringChanged=false;if(b.substr(0,1)=="&"){b=b.substr(1,b.length);}dhtmlHistory.add(b,null);}};flashEvent=function(b){};addToFavorites=function(b){$.log("adding favorite to dwr");mapDWR.toggleFavorite(b,addToFavoritesCallback);};addToHidden=function(b){$.log("adding hidden to dwr");
mapDWR.toggleHidden(b,addToHiddenCallback);};addToHiddenCallback=function(b){$.log("addToHiddenCallback, adding to map");hotpads.map.getMapper().addToHiddenCallBack(b=="true"?true:false);};addToFavoritesCallback=function(b){$.log("addToFavoritesCallback, adding to map");hotpads.map.getMapper().addToFavoritesCallBack(b=="true"?true:false);
};setFullViewShowing=function(b){if(b==false){hotpads.base.closeFullView();}else{}};hotpads.listing={photosWidth:72+6,init:function(c){searchViewDWR.registerRealFullViewEvent(c);$.log("fullViewInit called");if(window.location.hash=="#notes"){hotpads.listing.showAddNote();}hotpads.listing.getRecommendedListings(c);
var d=Math.floor($("#photosUL").width()/hotpads.listing.photosWidth);if((numPhotos-d)>0){$("#showPhotosLink").show();$("#numberPhotos").text((numPhotos-d)+" more");}hotpads.listing.placeAds();$(window).resize(function(){hotpads.listing.placeAds();});},currentTab:"information",openTabWithScoll:function(f,g,h){hotpads.listing.openTab(f,g);
try{window.scrollTo(0,$(h).offset().top-75);}catch(e){}},openTab:function(d,c){$.log("opening tab "+d);if(d!=hotpads.listing.currentTab){$("#"+hotpads.listing.currentTab+"-li").removeClass("selected");$("#"+hotpads.listing.currentTab+"-tab").hide();$("#"+d+"-tab").show();hotpads.listing.currentTab=d;
$("#"+hotpads.listing.currentTab+"-li").addClass("selected");$("#"+hotpads.listing.currentTab+"-li a").blur();if(typeof(hs)!="undefined"){hs.close();}}if(d=="information"){hotpads.listing.placeAds();$(".realAds").css("display","block");}else{$(".realAds").css("display","none");}if(d=="mortgage-calculator"){parent.hotpads.base.resizeIframe(1600);
}else{hotpads.listing.resizeParentIframe();}if(d=="floorplans"){$.get("/search/analytics?action=searchSwitchListingTabFloorplans&listingId="+c+"&seed="+Math.random());}else{if(d=="similar"){$.get("/search/analytics?action=searchSwitchListingTabSimilar&listingId="+c+"&seed="+Math.random());}else{if(d=="statistics"){$.get("/search/analytics?action=searchSwitchListingTabStatistics&listingId="+c+"&seed="+Math.random());
}else{if(d=="mortgage-calculator"){$.get("/search/analytics?action=searchSwitchListingTabMortgageCalculator&listingId="+c+"&seed="+Math.random());}}}}},resizeParentIframe:function(){hotpads.base.resizeParentIframe();},largest:function(c){var d=0;for(i in c){if(c[i]>d){d=c[i];}}return d;},moveMapToAndView:function(e,d,f){if(parent&&parent.hotpads.map.moveMapToAndPreview){$.log("moveMapToAndViewing");
parent.hotpads.map.moveMapToAndPreview(e,d,f);}},moveMapToAndViewArea:function(g,e,h,f){if(parent&&parent.hotpads.map.moveMapToAndPreviewArea){$.log("moveMapToAndViewingArea");parent.hotpads.map.moveMapToAndPreviewArea(g,e,h,f);}else{hotpads.map.moveMapToAndPreviewArea(g,e,h,f);}},moveMapToAndViewCustom:function(m,l,j,n,k){var o="?header=false&emptyType=true&iframe=true";
var h=m.split("?");if(h.length>1){o=o+"&"+h[1];}if(parent){if(typeof(parent.hotpads.map.getMapper())!="undefined"&&parent.hotpads.map.loaded){parent.hotpads.map.moveMapCenter(j,n,k);}parent.openFullViewId=m;parent.fullViewType=l;parent.hotpads.base.loadIframe("/search/"+h[0]+o);}else{openFullViewId=m;
fullViewType=l;hotpads.base.loadIframe("/search/"+h[0]+o);}},validateEmail:function(d){var c=/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i;
return c.test(d);},showEmailFriend:function(b){if($("#emailFriendSurround:hidden").length){if($("#addNoteSurround").attr("display")!="block"){hotpads.listing.hideAddNote(b);}if(b=="true"){$("#realSquaread").css("visibility","hidden");}$("#emailFriendSurround").slideDown("fast");}else{hotpads.listing.hideEmailFriend(b);
}},hideEmailFriend:function(b){$(".emailFriendItem").slideUp("fast");if(b){$("#realSquaread").css("visibility","visible");}},trim:function(b){return b.replace(/^\s+|\s+$/g,"");},sendEmailFriend:function(e){var f={"from":null,"to":null,"message":null,"emailFriendUser":false};f.from=$("#fromEmailFriend").val();
if(hotpads.listing.validateEmail(f.from)==false){alert('Oops.. it looks like the email address you entered for "your email" is not valid!');return;}f.to=$("#toEmailFriend").val();f.emailFriendUser=$("#emailFriendUser").attr("checked");if(hotpads.listing.validateEmail(f.to)==false){var d=false;splitSemicolon=f.to.split(";");
if(splitSemicolon.length>1){for(i=0;i<splitSemicolon.length;i++){if(hotpads.listing.validateEmail(trim(splitSemicolon[i]))==false){d=true;}}}splitComma=f.to.split(",");if(splitComma.length>1){for(i=0;i<splitComma.length;i++){if(hotpads.listing.validateEmail(hotpads.listing.trim(splitComma[i]))==false){d=true;
}}}if(d==true){alert('Oops.. it looks like the email address(es) you entered for "friend\'s email" is not valid!');return;}}f.message=$("#messageEmailFriend").val();f.listingId=e;searchViewDWR.sendEmailFriend(f,hotpads.listing.emailFriendCallback);hotpads.listing.toggleLoadingEmailFriend();},toggleLoadingEmailFriend:function(){$("#emailFriendTable").toggle();
$("#emailFriendDidYouKnow").toggle();$("#emailFriendLoading").toggle();},emailFriendCallback:function(b){$("#emailFriendSurround").fadeOut("fast");hotpads.listing.toggleLoadingEmailFriend();if(b==true){$("#successEmailFriendMsg").html("We emailed your message and a link to this listing.<br/><br/>Thanks for using HotPads!");
$("#successEmailFriend").fadeIn("fast");}else{$("#failureEmailFriend").fadeIn("fast");}},showAddNote:function(b){if($("#addNoteSurround:hidden").length){if($("#emailFriendSurround").attr("display")!="block"){hotpads.listing.hideEmailFriend(b);}if(b=="true"){$("#realSquaread").css("visibility","hidden");
}$("#addNoteSurround").slideDown("fast");}else{hotpads.listing.hideAddNote(b);}},hideAddNote:function(b){$(".addNoteItem").slideUp("fast");if(b=="true"){$("#realSquaread").css("visibility","visible");}},addNote:function(c){var d=$("#messageAddNote").val();searchViewDWR.saveNote(c,d,hotpads.listing.addNoteCallback);
hotpads.listing.toggleLoadingAddNote();},toggleLoadingAddNote:function(){$("#addNoteTable").toggle();$("#addNoteDidYouKnow").toggle();$("#addNoteLoading").toggle();},addNoteCallback:function(b){$("#addNoteSurround").fadeOut("fast");hotpads.listing.toggleLoadingAddNote();if(b==true){$("#successAddNoteMsg").html("Your note has been added.  You can find it again later on the <a href='/userSearch/note/list' target='_blank'>Notes</a> section of your <a href='/userSearch/favorite/list'>Favorites</a>");
$("#successAddNote").fadeIn("fast");}else{$("#failureAddNote").fadeIn("fast");}},contactBoxTransfer:function(b){$(b).effect("transfer",{to:"#contact"},1000);setTimeout(function(){$("#contact").css("border","solid 1px #055C8A");},1000);},showContactInfo:function(c){var d=$(".showContactInfo");d.html('<span id="contactLoader"><img src="/images/ajax-loader.gif" /> Loading...</span>');
hotpads.listing.getContactInfoByListingId(c,d);},getContactInfoByListingId:function(c,d){searchViewDWR.getContactInfoByListingId(c,function(a){d.html(a);});},toggleFavorites:function(b){$("#favoritesCaption").html("<img src='/images/ajax-loader.gif' />");searchViewDWR.toggleFavorite(b,hotpads.listing.toggleFavoritesCallback);
},toggleHidden:function(b){$("#hiddenCaption").html("<img src='/images/ajax-loader.gif' />");searchViewDWR.toggleHidden(b,hotpads.listing.toggleHiddenCallback);},toggleFavoritesCallback:function(b){if(b=="true"){$("#favoritesCaption").html("unfavorite");$("#addToFavoritesIcon").removeClass("sprite-favoriteOff").addClass("sprite-favoriteOn");
if(hotpads.fb&&hotpads.fb.fbUID!=null){hotpads.fb.shareFavorite(listingType,listingName,listingLink);}}else{$("#favoritesCaption").html("add to favorites");$("#addToFavoritesIcon").removeClass("sprite-favoriteOn").addClass("sprite-favoriteOff");}if(parent){parent.hotpads.searcher.setAsFavorite(listingId,b);
}else{hotpads.searcher.setAsFavorite(listingId,b);}},toggleHiddenCallback:function(b){if(b=="true"){$("#hiddenCaption").html("unhide");$("#addToHiddenIcon").removeClass("sprite-hiddenOff").addClass("sprite-hiddenOn");}else{$("#hiddenCaption").html("hide");$("#addToHiddenIcon").removeClass("sprite-hiddenOn").addClass("sprite-hiddenOff");
}if(parent){parent.hotpads.searcher.setAsHidden(listingId,b);}else{hotpads.searcher.setAsHidden(listingId,b);}},showInquiryBox:function(d,e,f){hotpads.listing.openTab("information",e);if(d){hotpads.listing.contactBoxTransfer(d);}if(f){$("#messageEmailManager").val(f);}},submitInquiry:function(k,l){if(inqs>=4){alert("Sorry, you've sent too many inquiries for the moment.  If you need to contact the manager again, please try again later.  If you feel you have received this message in error, please contact us at info@hotpads.com");
return;}var o=/^\w+\s\w+/;var h=/^\d{2}\W\d{2}\W\d{2,4}$/;var m=/^\W*\d{0,1}\W*\d{3}\W*\d{3}\W*\d{4}.*$/;var j={"listingId":null,"name":null,"email":null,"phone":null,"moveDate":null,"beds":null,"baths":null,"text":null,"numAdults":null,"numChildren":null,"checkInDate":null,"checkOutDate":null,"emailUser":null};
j.listingId=$("#hiddenListingId").val();j.name=$("#nameEmailManager").val();if(j.name=="your name*"||j.name==""){alert("Oops.. it looks like you didn't put your name in.");return;}if(k&&!o.test(j.name)){alert("Please enter your first and last name.");return;}j.email=$("#emailEmailManager").val();if(j.name=="your email*"){alert("Oops.. it looks you didn't put in an email address.");
return;}if(j.email==""||hotpads.listing.validateEmail(j.email)==false){alert("Oops.. it looks like the email address you entered is invalid! It must be a valid email address in order to contact the manager.");return;}j.phone=$("#phoneEmailManager").val();if(!k&&j.phone=="your phone number"){j.phone="";
}else{if((k||j.phone!="")&&!m.test(j.phone)){alert("Please enter your entire phone number, including area code.");return;}}j.moveDate=$("#movingDateEmailManager").val();if(j.moveDate=="moving date"){j.moveDate="";}if(l&&!h.test(j.moveDate)){alert("Please enter approximate moving date in the form mm/dd/yyyy");
return;}if($("#bedsEmailManager").length){j.beds=$("#bedsEmailManager").val();if(j.beds=="# beds"){j.beds="";}}if($("#bathsEmailManager").length){j.baths=$("#bathsEmailManager").val();if(j.baths=="# baths"){j.baths="";}}var n=/\d{1,2}\/\d{1,2}\/\d{4}/;if($("#arriveDate").length){j.checkInDate=$("#arriveDate").val();
if(j.checkInDate=="check-in date"){j.checkInDate="";}if(!n.test(j.checkInDate)){alert("Oops.. it looks your check-in date is in the wrong format. Please use MM/DD/YYYY.");return;}}if($("#departDate").length){j.checkOutDate=$("#departDate").val();if(j.checkOutDate=="check-out date"){j.checkOutDate="";
}if(!n.test(j.checkOutDate)){alert("Oops.. it looks your check-out date is in the wrong format. Please use MM/DD/YYYY.");return;}}if($("#numAdults").length){j.numAdults=$("#numAdults").val();if(j.numAdults=="# adults"){j.numAdults="";}}if($("#numChildren").length){j.numChildren=$("#numChildren").val();
if(j.numChildren=="# children"){j.numChildren="";}}j.text=$("#messageEmailManager").val();if(j.text=="your questions go here!"){j.text="I'm interested - please contact me!";}j.emailUser=$("#emailUser").attr("checked");$("#inqForm").hide();$("#loadingEmailManager").show();searchViewDWR.submitInquiry(j,hotpads.listing.inquiryCallback);
},inquiryCallback:function(b){$("#loadingEmailManager").hide();if(b){$("#afterInquiryDiv").height(30);$("#afterInquiryDiv").width("auto");frames["afterInquiry"].location.href="/inquiry/completed.htm?id="+b;inqs++;if($("#similar-li".length)&&$("#similar-li").is(":visible")){$("#recommendedListings").slideUp();
}$("#successEmailManager").slideDown("normal",hotpads.listing.placeAds);}else{$("#failureEmailManager").show("normal",hotpads.listing.placeAds);}},closeSuccessEmailManager:function(){$("#successEmailManager").hide();$("#inqForm").show();},closeFailureEmailManager:function(){$("#failureEmailManager").hide();
$("#inqForm").show();},saveNote:function(b){$("#saving-note").toggle();searchViewDWR.addNote(b,$("#noteTextArea").val(),function(){$("#saving-note").toggle();$("#note-saved").show();});},showModel:function(c){var d=false;if($("#"+c+"-info").css("display")!="none"){d=true;}$(".modelshowing").hide().removeClass("modelshowing");
if(!d){$("#"+c+"-info").toggle().addClass("modelshowing");}hotpads.listing.resizeParentIframe();},sharePosting:function(l,h,k){var m=$("#hpfbComments").val();var j=$("#hpfbPrivacy").val();var g=$("#hpfbPostToProfile").val();$("#savingFBPost").show();fbShareListing.shareListing(l,m,j,g,h,k,sharePostingCallback);
},sharePostingCallback:function(b){$("#savingFBPost").hide();if(b==true){$("#failureFBPost").hide();$("#successFBPost").show();}else{$("#successFBPost").hide();$("#failureFBPost").show();}},getRecommendedListings:function(c){if($("#recommendedListings").length&&typeof c!="undefined"){requestUrl="/search/recommendedListings"+"?listingId="+c+"&maxResults=2";
var d=window.location.href;if(d.indexOf("emptyType=true")!=-1&&d.indexOf("iframe=true")==-1){requestUrl+="&emptyType=true";}$.ajax({async:false,url:requestUrl,success:function(a){$("#recommendedListings").fadeOut("fast",function(){$("#recommendedListings").html(a);$("#recommendedListings").fadeIn("fast",function(){hotpads.listing.placeAds();
});});}});}},placeAds:function(){if($("#squaread").length!=0){var d=$("#squaread").offset().top+9;if(iframe){$("#realSquaread").css("top",d);}else{if(header&&emptyType){$("#realSquaread").css("top",d-69);}else{$("#realSquaread").css("top",d-120);}}$("#realSquaread").css("left",($("#squaread").offset().left+8)+"px");
$("#realSquaread").css("right","auto");}if($("#belowContactBoxAd").length!=0){var c=$("#belowContactBoxAd").offset().top;if(iframe){$("#realBelowContactBoxAd").css("top",c);}else{if(header&&emptyType){$("#realBelowContactBoxAd").css("top",c-50);}else{$("#realBelowContactBoxAd").css("top",c-115);}}$("#realBelowContactBoxAd").css("left",$("#belowContactBoxAd").offset().left+"px");
$("#realBelowContactBoxAd").css("right","auto");}}};hotpads.customView={resizeParentIframe:function(){hotpads.base.resizeParentIframe();}};hotpads.advancedFilterView={isOpen:false,open:function(){if(hotpads.filter.currentSearcher=="map"){}fullViewType="advancedFilter";fullViewShowing=true;hotpads.base.closeRightHalf();
hotpads.base.makeSpaceForRightSection();$("#advancedFilterDiv").show();$("#minBedrooms").focus();$("#toggleAdvancedLink").html("less&laquo;");$("#toggleAdvancedLink2").html("less&laquo;");$("#filterBasic").hide();hotpads.advancedFilterView.resize();hotpads.filter.advancedFilterOpen=true;$("#loading").hide();
},close:function(){$("#toggleAdvancedLink").html("advanced&raquo;");$("#toggleAdvancedLink2").html("advanced&raquo;");$("#advancedFilterDiv").hide();$("#filterBasic").show();hotpads.filter.advancedFilterOpen=false;},resize:function(){if(!hotpads.filter.advancedFilterOpen){return;}if($("#mapperWrapper").length){$("#advancedFilter").css("height","");
var l=0;$(".filterFieldGroup").each(function(a){if($(this).height()>l){l=$(this).height();}});l+=30;var m=$("#mapperWrapper").height();$("#advancedFilter").css("height",m<l?l:m+"px");var h=0;$(".filterFieldGroup").each(function(a){h+=$(this).width();});h+=20;var k=$("#container").width();var j=Math.ceil(h/k*100);
var g=Math.floor((k-h)/k*100);$(".leftContainer").css("width",g+"%");$(".rightContainer").css("width",j+"%");}}};hotpads.areaView={resizeParentIframe:function(){hotpads.base.resizeParentIframe();},openTab:function(b){$.log("opening tab to "+b);if(b!=currentTab){$("#"+currentTab+"-li").removeClass("selected");
$("#"+currentTab).hide();$("#"+b).show();currentTab=b;$("#"+currentTab+"-li").addClass("selected");$("#"+currentTab+"-li a").blur();hotpads.areaView.resizeParentIframe();}if(currentTab=="info"){hotpads.areaView.loadWikiArticle();}},wikiArticleLoaded:false,loadWikiArticle:function(){$.log("loadWikiArticle called");
if(hotpads.areaView.wikiArticleLoaded==false){$.log("loading wikipedia article");searchViewDWR.getWikipedia(areaId,function(b){$("#wikiarticle").log("adding wikipedia article").html(b);$("#wikiarticle a").attr("target","_wiki");$("#wikiarticle a[href^=#]").click(function(g){var a=$(this).attr("href");
a=a.substring(1,a.length);var h=$("#wikiarticle a[name="+a+"]");var f=h.offset();window.scrollTo(0,f.top);return false;});hotpads.areaView.resizeParentIframe();});hotpads.areaView.wikiArticleLoaded=true;}},MAX_BIRDSEYE_TIMEOUT:4000,currentBirdsEyeTimeout:500,map:"",loadBirdsEye:function(){if($("#birdseye").css("display")!="none"&&areaLabelLat!=0&&areaLabelLon!=0){map=new VEMap("myMap");
map.LoadMap(new VELatLong(areaLabelLat,areaLabelLon),1,"o",false);setTimeout("hotpads.areaView.checkBirdsEyeAvailable()",500);}},checkBirdsEyeAvailable:function(){if(map.IsBirdseyeAvailable()){$("#birdseye-loading").css("display","none");map.SetCenter(new VELatLong(areaLabelLat,areaLabelLon));$("#myMap").css("width","100%");
$("#myMap").css("margin","0 0 0 5px");$("#myMap").css("visibility","visible");}else{if(hotpads.areaView.currentBirdsEyeTimeout>hotpads.areaView.MAX_BIRDSEYE_TIMEOUT){$("#birdseye-loading").css("display","none");$("#myMap").css("display","none");$("#noBirdseye").css("display","block");}else{hotpads.areaView.currentBirdsEyeTimeout+=500;
setTimeout("hotpads.areaView.checkBirdsEyeAvailable()",500);}}}};if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(s,p,r,c,v,u,x,y,h,t){if(!document.getElementById){return;
}this.DETECT_KEY=t?t:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(s){this.setAttribute("swf",s);}if(p){this.setAttribute("id",p);}if(r){this.setAttribute("width",r);}if(c){this.setAttribute("height",c);
}if(v){this.setAttribute("version",new deconcept.PlayerVersion(v.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(u){this.addParam("bgcolor",u);}var q=x?x:"high";this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var w=(y)?y:window.location;this.setAttribute("xiRedirectUrl",w);this.setAttribute("redirectUrl","");if(h){this.setAttribute("redirectUrl",h);}};deconcept.SWFObject.prototype={useExpressInstall:function(b){this.xiSWFPath=!b?"expressinstall.swf":b;
this.setAttribute("useExpressInstall",true);},setAttribute:function(d,c){this.attributes[d]=c;},getAttribute:function(b){return this.attributes[b];},addParam:function(c,d){this.params[c]=d;},getParams:function(){return this.params;},addVariable:function(c,d){this.variables[c]=d;},getVariable:function(b){return this.variables[b];
},getVariables:function(){return this.variables;},getVariablePairs:function(){var e=new Array();var f;var d=this.getVariables();for(f in d){e[e.length]=f+"="+d[f];}return e;},getSWFHTML:function(){var j="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);}j='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';j+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';
var l=this.getParams();for(var m in l){j+=[m]+'="'+l[m]+'" ';}var g=this.getVariablePairs().join("&");if(g.length>0){j+='flashvars="'+g+'"';}j+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}j='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';
j+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var h=this.getParams();for(var m in h){j+='<param name="'+m+'" value="'+h[m]+'" />';}var k=this.getVariablePairs().join("&");if(k.length>0){j+='<param name="flashvars" value="'+k+'" />';}j+="</object>";}return j;},write:function(f){if(this.getAttribute("useExpressInstall")){var d=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(d)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);
}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var e=(typeof f=="string")?document.getElementById(f):f;e.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));
}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var e=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var k=navigator.plugins["Shockwave Flash"];if(k&&k.description){e=new deconcept.PlayerVersion(k.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var j=1;var h=3;while(j){try{h++;j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+h);e=new deconcept.PlayerVersion([h,0,0]);}catch(g){j=null;}}}else{try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(g){try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
e=new deconcept.PlayerVersion([6,0,21]);j.AllowScriptAccess="always";}catch(g){if(e.major==6){return e;}}try{j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(g){}}if(j!=null){e=new deconcept.PlayerVersion(j.GetVariable("$version").split(" ")[1].split(","));}}}return e;};deconcept.PlayerVersion=function(b){this.major=b[0]!=null?parseInt(b[0]):0;
this.minor=b[1]!=null?parseInt(b[1]):0;this.rev=b[2]!=null?parseInt(b[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(b){if(this.major<b.major){return false;}if(this.major>b.major){return true;}if(this.minor<b.minor){return false;}if(this.minor>b.minor){return true;}if(this.rev<b.rev){return false;
}return true;};deconcept.util={getRequestParameter:function(h){var g=document.location.search||document.location.hash;if(h==null){return g;}if(g){var e=g.substring(1).split("&");for(var f=0;f<e.length;f++){if(e[f].substring(0,e[f].indexOf("="))==h){return e[f].substring((e[f].indexOf("=")+1));}}}return"";
}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var f=document.getElementsByTagName("OBJECT");for(var e=f.length-1;e>=0;e--){f[e].style.display="none";for(var d in f[e]){if(typeof f[e][d]=="function"){f[e][d]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(b){return document.all[b];
};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;