DiverseSolutions.Beast.Syndication={SearchID:0,UpdateAutoDiscovery:function(F){try{if(typeof (F)!="undefined"){this.SearchID=parseInt(F)}var B=$("lnkSyndicate");if(B){var C=B.nextSibling;var E=$E({tag:"link",rel:"alternate",type:"application/rss+xml",href:this.GetSyndicationURL()});if(C){B.parentNode.removeChild(B);C.insertBefore(E)}else{B.insertBefore(E);B.parentNode.removeChild(B)}}else{var D=$("dvSyndicate");if(this.SearchID>0){D.update('<link rel="alternate" type="application/rss+xml" href="'+this.GetSyndicationURL()+'" />')}else{D.update()}}}catch(A){}},ClearSyndication:function(){this.SearchID=0;this.UpdateAutoDiscovery()},GetSyndicationURL:function(A){if(typeof (A)!="undefined"){this.SearchID=parseInt(A);this.UpdateAutoDiscovery()}if(this.SearchID==0){return""}else{return"http://"+window.location.host+"/feed/rss/"+this.SearchID}},GetSyndicationDom:function(A){if(typeof (A)!="undefined"){this.SearchID=parseInt(A);this.UpdateAutoDiscovery()}if(this.SearchID==0){return null}else{return $E({tag:"a",target:"_blank",href:this.GetSyndicationURL(),children:[{tag:"div",className:"syndication_image"}]})}}};
var PropertyQuery={webserviceProperties:["minPrice","maxPrice","minImprovedSqFt","maxImprovedSqFt","minLotSqFt","maxLotSqFt","minDaysOnMarket","maxDaysOnMarket","cities","zipCodes","mlsNumbers","onlyFavorites","minBeds","maxBeds","minBaths","maxBaths","minYearBuilt","maxYearBuilt","communities","tracts","propertyTypes","propertyFeatures","listingAgentNameID","listingAgentOfficeID","minLatitude","maxLatitude","minLongitude","maxLongitude","orderColumn","orderDirection","resultPage"],MapSpecific:{minLatitude:-1,maxLatitude:-1,minLongitude:-1,maxLongitude:-1,resultPage:1,queryUrl:"/Webservice/QueryProperties.asmx/PerformMapSearch",onSuccess:null,onFailure:null,onError:null},minPrice:-1,maxPrice:-1,minImprovedSqFt:-1,maxImprovedSqFt:-1,minLotSqFt:-1,minLotAcres:-1,maxLotSqFt:-1,maxLotAcres:-1,minDaysOnMarket:-1,maxDaysOnMarket:-1,minBeds:-1,maxBeds:-1,minBaths:-1,maxBaths:-1,minYearBuilt:-1,maxYearBuilt:-1,minLatitude:-1,maxLatitude:-1,minLongitude:-1,maxLongitude:-1,communities:"",tracts:"",propertyTypes:"",propertyFeatures:"",listingAgentNameID:"",listingAgentOfficeID:"",cities:"",zipCodes:"",mlsNumbers:"",onlyFavorites:"false",orderColumn:"Price",orderDirection:"ASC",resultPage:1,onSuccess:null,onFailure:null,onError:null,baseRequestUrl:"",queryUrl:"/Webservice/QueryProperties.asmx/PerformResultsSearch",_isQueryActive:false,sendRequest:function(A){var C=new Array();this._isQueryActive=true;if(this.minLotAcres!=-1){this.minLotSqFt=parseInt(this.minLotAcres*43560)}if(this.maxLotAcres!=-1){this.maxLotSqFt=parseInt(this.maxLotAcres*43560)}for(var B=0;B<this.webserviceProperties.length;B++){if(typeof this.MapSpecific[this.webserviceProperties[B]]!="undefined"&&A){C.push(this.webserviceProperties[B]+"="+encodeURIComponent(this.MapSpecific[this.webserviceProperties[B]]))}else{C.push(this.webserviceProperties[B]+"="+encodeURIComponent(this[this.webserviceProperties[B]]))}}if(A){this.lastMapRequest=C.join("&")}new Ajax.Request(this.baseRequestUrl+((A)?this.MapSpecific.queryUrl:this.queryUrl),{parameters:C.join("&"),onSuccess:this.requestSuccessCallback.bind(this,((A)?this.MapSpecific.onSuccess:this.onSuccess)),onFailure:this.requestSuccessCallback.bind(this,((A)?this.MapSpecific.onFailure:this.onFailure)),onException:function(E,D){throw D}})},requestSuccessCallback:function(B,D,C){var I=Global.FixXmlDoc(D);if(!I||I.childNodes.length==0){window.location.reload()}var K=D.getResponseHeader("X-Requested-Url");if(K&&Prototype.Browser.WebKit){K=K.replace("&_=","")}if(K&&this.lastMapRequest.toLowerCase()!=K.toLowerCase()){return }this._isQueryActive=false;var L={},G,J,H,A;G=I.lastChild;if(!(Browser.IE6||Browser.IE7)){Element.cleanWhitespace(G);Element.cleanWhitespace(G.childNodes[2])}J=G.childNodes[2].childNodes;if(G.childNodes.length>3){L.savedSearchID=G.childNodes[3].firstChild.nodeValue}if(G.firstChild.childNodes.length!=0){L.totalCount=G.firstChild.firstChild.nodeValue;L.totalReturned=G.childNodes[1].firstChild.nodeValue}L.results=new Array();for(var F=0;F<J.length;F++){if(J[F].nodeType==3){continue}L.results.push({});for(var E=0;E<J[F].childNodes.length;E++){if(J[F].childNodes[E].nodeType==3){continue}H=J[F].childNodes[E].tagName;if(J[F].childNodes[E].firstChild!=null){A=J[F].childNodes[E].firstChild.nodeValue}else{A=""}if(String(A).toLowerCase()=="true"||String(A).toLowerCase()=="false"){L.results[F][H]=(String(A).toLowerCase()=="true")?true:false}else{L.results[F][H]=A}}}if(C){Object.extend(L,C)}B(L)},requestFailureCallback:function(A,B){this._isQueryActive=false;A(B)}};
/*
 * dsHistory, v1-beta1 $Rev: 67 $
 * Revision date: $Date: 2008-05-02 09:50:11 -0700 (Fri, 02 May 2008) $
 * Project URL: http://code.google.com/p/dshistory/
 * 
 * Copyright (c) Andrew Mattie (http://www.akmattie.net)
 * Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
 * THIS IS FREE SOFTWARE, BUT DO NOT REMOVE THIS COMMENT BLOCK
 */
var dsHistory=function(){var j=(function(){var k=window.navigator.userAgent;var e=!!(window.attachEvent&&!window.opera);return{IE:e,IE6:e&&k.indexOf("MSIE 6")!=-1,IE7:e&&k.indexOf("MSIE 7")!=-1,Opera:!!window.opera,WebKit:k.indexOf("AppleWebKit/")>-1,Gecko:k.indexOf("Gecko")>-1&&k.indexOf("KHTML")==-1}})();var T=j.IE||j.Gecko;var I=j.Gecko;var E=j.IE||j.WebKit;var C=15;var a=0;var Z=lastRawHash="";var A=window.encodeURIComponent;var h=initialHash=c(true);var U=[];var F=[];var R=[];var B=[];var g=false;var H;var S;var L=[];var M=0;var W,V;var O=false;var Q;var K=(top!=self||location.protocol=="https:")&&location.host!="idx.diversesolutions.com";function X(){window.clearInterval(M);H=null;R=null}function f(l,k,e){if(typeof e!="undefined"){return function(m){l.call(k||window,e,m)}}else{return function(m){l.call(k||window,m)}}}function N(){if(!T){N=function(){return 0}}else{if(I){N=function(){return H.document.body?parseInt(H.document.body.textContent):0}}else{N=function(){return parseInt(H.document.body.innerText)}}}return N()}function G(e){if(I){G=function(k){H.document.body.textContent=String(k)}}else{G=function(k){H.document.body.innerText=String(k)}}G(e)}function b(k){if(E){var e=window.decodeURIComponent;b=function(l){return e(l)}}else{b=function(l){return l}}return b(k)}function c(m){var l=window.location.hash;if(!m&&l==lastRawHash){return Z}lastRawHash=l;var e=l.substring(1).split("&");var k;if(e.length>9){var n=[];for(i=0,len=e.length;i<len;++i){hashSplit=e[i].split("=");n.push((i==0?"":"&")+A(b(hashSplit[0]))+(hashSplit.length==2?"="+A(b(hashSplit[1])):""))}k=n.join("&")}else{k="";for(i=0,len=e.length;i<len;++i){hashSplit=e[i].split("=");k+=(i==0?"":"&")+A(b(hashSplit[0]))+(hashSplit.length==2?"="+A(b(hashSplit[1])):"")}}return k}function J(){Q.QueryElements={};if(window.location.hash==""||window.location.hash=="#"){return }var e=window.location.hash.substring(1).split("&");var k;for(i=0,len=e.length;i<len;++i){k=e[i].split("=");Q.QueryElements[b(k[0])]=k.length==2?b(k[1]):""}Z=c(true)}function D(l){var k=T?N():0;var e,m;if((U.length>0&&j.Gecko)||j.WebKit||(!T&&N()>0)){if(Z==""&&U.length>1){window.location.hash="_";Z=c(true);U.push(Z)}else{if(Z!=""){e=R.splice(R.length-1,1)[0];window.location.hash=Z+String(U.length);U.push(Z+String(U.length));window.location.hash=Z;U.push(Z);R.push(function(n){if(O?n:n.direction=="back"){W=true;window.history.back()}else{V=true;window.history.forward()}});R.push(e)}}return }if(k==0&&((U.length==(l?1:0)&&!j.IE)||(U.length==2&&j.IE))&&R.length<=1){G(1)}else{if(K){document.getElementById("dsHistoryFrame").src=Q.crossFrameHistoryPage+"?h="+String(k+1)}else{if(I){document.getElementById("dsHistoryFrame").src="data:,"+String(k+1)}else{H.document.open();H.document.write(String(k+1));H.document.close()}}}}function Y(){var e=T?N():0;var k=c();if(!V&&(e<a||(Z!=k&&U[U.length-2]==k&&!j.IE))){g=true;W=false;if((Z!=k&&U[U.length-2]==k)||j.IE){F=F.concat(U.splice(U.length-1,1));if(j.IE){if(Q.deferProcessing){window.setTimeout(function(){window.location.hash=U[U.length-1]},10)}else{window.location.hash=U[U.length-1]}}Z=c(true);h=Z}if(R.length>1){R[R.length-2](O?"back":{calledFromHistory:true,direction:"back"});B=B.concat(R.splice(R.length-1,1))}}else{if(g&&!W&&(e>a||(Z!=k&&F[F.length-1]==k&&!j.IE))){V=false;if((Z!=k&&F[F.length-1]==k)||j.IE){if(j.IE){window.location.hash=F[F.length-1]}Z=c(true);h=Z;U=U.concat(F.splice(F.length-1,1))}B[B.length-1](O?"forward":{calledFromHistory:true,direction:"forward"});R=R.concat(B.splice(B.length-1,1))}}a=e}Q={QueryElements:{},deferProcessing:false,crossFrameHistoryPage:"/HistoryFrame.htm",initialize:function(e){if(typeof e=="function"){e()}},addFunction:function(l,k,e){if(T&&(!H||!H.document||!H.document.body)){L.push({type:arguments.callee,fnc:l,scope:k,objectArg:e});return }g=false;B=[];F=[];if(j.IE){U.push(c())}R.push(f(l,k,e));D()},setQueryVar:function(k,m){var l,e;k=String(k);m=String(typeof m=="undefined"?"":m);l=A(k);e=A(m);if(h=="#"||h==""||h.indexOf("#_serial")==0){if(e!=""){h="#"+l+"="+e}else{h="#"+l}}else{if(typeof this.QueryElements[k]!="undefined"&&m!=""){h=h.substr(0,h.indexOf(l)+l.length+1)+e+h.substr(h.indexOf(l)+l.length+1+String(A(this.QueryElements[k])).length)}else{if(typeof this.QueryElements[k]=="undefined"){if(m==""){h+="&"+l}else{h+="&"+l+"="+e}}}}this.QueryElements[k]=m;if(U>1&&U[U.length-2]==h){h+="&_serial="+U.length}else{if(h.indexOf("_serial")!=-1){this.removeQueryVar("_serial")}}},removeQueryVar:function(l){if(!this.QueryElements[l]&&l!="_serial"){return }var m,e,k;if(this.QueryElements[l]==""){m=A(l)}else{m=A(l)+"="+A(this.QueryElements[l])}e=h.indexOf(m);k=(h!=""&&e!=0)||(h!="#"&&e!=-1);h=h.substr(0,e-(k?1:0))+h.substr(e+m.length);delete this.QueryElements[l];if(h=="#"||h==""){h="_serial="+U.length}},bindQueryVars:function(n,l,e,m){if(T&&(!H||!H.document||!H.document.body)){L.push({type:arguments.callee,fnc:n,scope:l,objectArg:e});return }if(c()==h.replace("#","")&&R.length>0){return false}if(this.deferProcessing&&!m){var k=arguments.callee;window.setTimeout(function(){k(n,l,e,true)},10);return }g=false;B=[];F=[];if(U.length==0&&R.length>0&&!j.IE){U.push(c())}window.location.hash=h;Z=c(true);U.push(Z);R.push(f(n,l,e));if(j.IE){D(true)}J()},setFirstEvent:function(l,k,e){if(R.length>0){R[0]=f(l,k,e)}},setUsingStringIndicators:function(){O=true}};if(T){if(K){document.write('<iframe id="dsHistoryFrame" name="dsHistoryFrame" style="display:none" src="'+Q.crossFrameHistoryPage+'?h=0"></iframe>')}else{if(I){document.write('<iframe id="dsHistoryFrame" name="dsHistoryFrame" style="display:none" src="data:,0"></iframe>')}else{document.write('<iframe id="dsHistoryFrame" name="dsHistoryFrame" style="display:none" src="javascript:document.open();document.write(\'0\');document.close();"></iframe>')}}try{H=window.frames.dsHistoryFrame;var P=H.document}catch(d){H=null}if(!H||!H.document||!H.document.body){S=window.setInterval(function(){try{H=window.frames.dsHistoryFrame;var k=H.document}catch(m){H=null}if(H&&H.document&&H.document.body){window.clearInterval(S);M=window.setInterval(Y,C);for(i=0,len=L.length;i<len;++i){var l=L[i];l.type(l.fnc,l.scope,l.objectArg)}delete L}},50)}else{M=window.setInterval(Y,C)}}else{M=window.setInterval(Y,C)}if(j.IE||j.WebKit){U.push(initialHash)}J();if(window.addEventListener){window.addEventListener("unload",X,false)}else{if(window.attachEvent){window.attachEvent("onunload",X)}}return Q}();
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(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam("bgcolor",c);}var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a);}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16.push(key+"="+_18[key]);}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!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 n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}return _23;};deconcept.PlayerVersion=function(_27){this.major=_27[0]!=null?parseInt(_27[0]):0;this.minor=_27[1]!=null?parseInt(_27[1]):0;this.rev=_27[2]!=null?parseInt(_27[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_29){var q=document.location.search||document.location.hash;if(q){var _2b=q.substring(1).split("&");for(var i=0;i<_2b.length;i++){if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){return _2b[i].substring((_2b[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}var _2d=document.getElementsByTagName("OBJECT");for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload=="function"){var _30=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();_30();};}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};if(typeof window.onbeforeunload=="function"){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload();};}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}if(Array.prototype.push==null){Array.prototype.push=function(_31){this[this.length]=_31;return this.length;};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
var Resizr={bodyPanelPadding:5,bodyContentPadding:5,scrollbarWidth:15,minWidth:695,initialMapContainerWidth:null,currentMapContainerWidth:null,hasResized:false,resizeRightPanelWrapper:false,resizeMapContainer:false,fns:[],subscribe:function(A){this.fns.push(A);if(this.hasResized){A.call(window,null)}},unsubscribe:function(A){this.fns=this.fns.filter(function(B){if(B!==A){return B}})},fire:function(C,B){var A=B||window;this.fns.each(function(D){D.call(A,C)})},initialize:function(){var A=$("RightPanelWrapper");var B=$("map-container");this.resizeRightPanelWrapper=A!=null;this.resizeMapContainer=B!=null;this.initialBodyPanelWidth=$("BodyContent").offsetWidth;if(this.resizeRightPanelWrapper){this.initialRightWrapperWidth=A.offsetWidth-this.bodyPanelPadding*2}if(this.resizeMapContainer){this.initialMapContainerWidth=B.getWidth();this.currentMapContainerWidth=this.initialMapContainerWidth}this.update();Event.observe(window,"resize",Resizr.onResize.bind(Resizr,true))},update:function(){if(this.resizeMapContainer){var A=$("map-slider-container");if(Browser.IE6){A.setStyle({display:"none"})}}if(this.resizeRightPanelWrapper){this.rightWrapperWidth=$("RightPanelWrapper").offsetWidth-this.bodyPanelPadding*2}this.onResize();if(this.resizeMapContainer){if(Browser.IE6){setTimeout(function(){A.setStyle({display:""})},150)}}},onResize:function(B){var D=((Browser.IE6||Browser.IE7)||document.viewport.getScrollOffsets().top>0)?this.scrollbarWidth:0;var A=document.viewport.getWidth()-D;if(A<this.minWidth){A=this.minWidth}var C=((A>this.initialBodyPanelWidth)?this.initialBodyPanelWidth:A)-(this.bodyContentPadding*2);var E=0;if(this.resizeRightPanelWrapper){E=C-(this.bodyPanelPadding*2)-$("LeftPanelWrapper").offsetWidth+((Browser.IE6)?2:0)}if(B&&A==this.oldBodyWidth){return }this.oldBodyWidth=A;window.clearTimeout(this.resizeRequestTimeout);this.resizeRequestTimeout=window.setTimeout(this.onResizeCallback.bind(this,C,A,E),150)},onResizeCallback:function(C,A,G){this.hasResized=true;var B=$("dsSearchAgentLogo");if(this.resizeRightPanelWrapper){var H=$("RightPanelWrapper");var F=0;if(!H){return }var F=((G>this.initialRightWrapperWidth)?this.initialRightWrapperWidth:G);H.style.width=F+"px";this.rightWrapperWidth=H.offsetWidth-this.bodyPanelPadding*2}if(B){var E=$("agent-info-image");var D=C-(E?E.getWidth():0)-$("AgentInfo_Left").getWidth()-$("AgentInfo_Right").getWidth()-40;if(D>=230){B.addClassName("LargeLogo").removeClassName("SmallLogo").show()}else{if(D>=130){B.addClassName("SmallLogo").removeClassName("LargeLogo").show()}else{B.hide()}}}$("ctl00_pnlCustomHeader","HeaderContent","BodyContent","footer-content").each(function(I){if(I){I.style.width=C+"px";if(Browser.IE6&&this.initialBodyPanelWidth-(this.bodyContentPadding*2)>C){I.setStyle({marginLeft:(this.scrollbarWidth/2)+"px"})}else{I.setStyle({marginLeft:""})}}}.bind(this));if(this.resizeMapContainer){this.currentMapContainerWidth=$("map-container").offsetWidth}if(typeof Panels!="undefined"){Panels.DetailResizer.resize()}if(typeof HelpPanel!="undefined"){HelpPanel.reposition()}if(typeof Mapper!="undefined"&&Mapper.isInitialized&&Tabs.isMapActive){Mapper.checkResize();Mapper.updateSearchBounds();if(Mapper.properties.length==0){CityMarkers.show()}}if(typeof AutoCompleter!="undefined"){AutoCompleter.reposition()}if(typeof FindBox!="undefined"){FindBox.checkResize()}if(typeof HelpTips!="undefined"){HelpTips.checkResize()}if(typeof ModuleController!="undefined"){ModuleController.checkResize()}this.fire()}};
if(typeof Beast=="undefined"){Beast={}}Beast.FrameCommunicator={HasParent:false,ParentBeastFrame:null,LastWindowHeight:0,MainBodyDom:null,Dom:YAHOO.util.Dom,Event:YAHOO.util.Event,Init:function(){if(typeof parent!="undefined"){try{var B=parent.Beast}catch(A){return }if(typeof parent.Beast!="undefined"&&typeof parent.Beast.Frame!="undefined"){this.HasParent=true;this.ParentBeastFrame=parent.Beast.Frame}}this.MainBodyDom=$("MainBody");this.CheckResize()},CheckResize:function(){var A=this.GetHeight();if(this.LastWindowHeight!=A){this.LastWindowHeight=A;this.OnDocumentResize()}setTimeout(this.CheckResize.bind(this),100)},GetHeight:function(){return this.MainBodyDom.getHeight()},GetParentScroll:function(){if(this.HasParent){return this.ParentBeastFrame.GetViewportScroll()}else{return 0}},OnDocumentResize:function(){if(this.HasParent){this.ParentBeastFrame.DocumentResized(this.GetHeight(),this.Dom.getDocumentScrollTop())}},ScrollTo:function(A){if(this.HasParent){this.ParentBeastFrame.ScrollTo(this.Dom.getY(A))}},ParentScrolled:function(){HighlightStatus.scrollWatcher()}};YAHOO.util.Event.onAvailable("MainBody",Beast.FrameCommunicator.Init,Beast.FrameCommunicator,true);
ConfigVars.maxPropertiesToMap=250;ConfigVars.resultChunkCacheSize=15;ConfigVars.mapLazyLoadDelay=0;ConfigVars.resultsLazyLoadDelay=0;ConfigVars.sessionTimeoutSeconds=60*120;if((Browser.IE6||Browser.IE7)){document.execCommand("BackgroundImageCache",false,true)}Event.observe(window,"load",function(){var B=new Date();var A=ConfigVars.sessionTimeoutSeconds*0.9;(function(){new Ajax.Request("/Webservice/HeartBeat.asmx/Beat",{parameters:"sessid="+Global.sessid,evalJSON:"force",onSuccess:function(C){if(C.responseJSON.success){B=new Date()}}});arguments.callee.delay(A)}).delay(A);(function(){if((new Date()).getTime()-B.getTime()>ConfigVars.sessionTimeoutSeconds*1000*0.98){window.location.reload(true)}arguments.callee.delay(2)}).delay(2)});var Scroller={initialize:function(){if(this.scrollFx){return }this.scrollFx=new Fx.ScrollWindow();Event.observe(window,"unload",this.unload.bind(this))},unload:function(){this.scrollFx=null},toBodyContent:function(){if(!this.scrollFx){this.initialize()}if(Beast.FrameCommunicator.HasParent){Beast.FrameCommunicator.ScrollTo("HeaderContent")}else{try{this.scrollFx.scrollTo("HeaderContent")}catch(A){}}},toAdvanced:function(){if(!this.scrollFx){this.initialize()}if(Beast.FrameCommunicator.HasParent){Beast.FrameCommunicator.ScrollTo("AdvancedQuery")}else{try{this.scrollFx.scrollTo("AdvancedQuery")}catch(A){}}}};var ReferralDomains={hideHeaderIfMatch:function(){if(TrustedReferralDomains.length==0){return }var A=document.referrer;var C=/https?:\/\/(?:\w+\.)*([^.\/]*\.[^.\/]*)/.exec(A);var B=!!C?C[1]:"";if(!A.empty()&&TrustedReferralDomains.include(B)){$$("body > .CustomHeader").invoke("hide")}}};var AutoCompleter=function(){var A,C;var J;var L;var I;function D(){if(C){C.destroy();C=null}L=true}function G(N,R){var M=N[0];var O=N[2];var Q,P;Q=M.substring(0,R.length);P=M.substring(R.length)+" ("+O+")";return'<div id="ysearchresult"><span style="font-weight: bold;">'+Q+"</span>"+P+"</div>"}function H(M,N){I.rememberLocationItem(N[2][0],N[2][1])}function F(){if(J){return }var N=$("locations").value;var M=I.locationItems.pluck("name");I.locationItems=I.locationItems.findAll(function(P){var O=new RegExp(P.name+"(?:, )?","i");return O.test(N)});J=true}function B(Q){var S={};var M={};var O=[];var N=[];var R=$("locations").value;var P=/^\d{5}(?:-\d{4})?$/;I.locationItems.each(function(U){U.name=U.name.strip();var T=U.name.toLowerCase();S[T]=true;if(Q&&(U.type!=Q||M[T])){return }if(!Q){O.push(U.name)}else{O.push(U.name.gsub(/,/,",,"))}M[T]=true});for(key in S){R=R.gsub(new RegExp(key+"\\s*,?\\s*","i"),"")}R.gsub(/,,/,"||").split(/,\s*/).each(function(T){T=T.replace(/\|\|/g,",");var U=T.toLowerCase();if(!S[U]&&!T.blank()&&(!Q||Q=="Zip"&&P.match(T)||Q!="Zip"&&!P.match(T))){N.push(T);S[U]=true}});return O.concat(N).join(",")}function E(){var M=$$("#PropertyTypes input:checked").inject([],function(N,O){N.push(O.value);return N}).join(",");A.scriptQueryAppend="method=location&PropertyTypes="+encodeURIComponent(M);C.flushCache()}function K(){var M=$("location-autocompleter");M.setStyle({width:"0px"}).setStyle({width:String(M.down().scrollWidth+10)+"px"})}I={locationItems:[],unload:D,initialize:function(){if(L){return }A=new YAHOO.widget.DS_XHR("/Webservice/AutoCompleter.aspx",["ResultSet","location","type","supportingInfo"]);C=new YAHOO.widget.AutoComplete("locations","location-autocompleter",A);$("locations").observe("focus",function(){J=false;$("cbxConstrainToMap").checked=false});C.textboxFocusEvent.subscribe(E);C.itemSelectEvent.subscribe(H);C.containerExpandEvent.subscribe(K);C.formatResult=G;C.delimChar=[","];C.queryDelay=0.1;C.minQueryLength=1;C.maxCacheEntries=50;C.animVert=false;this.reposition();Event.observe(window,"unload",D)},reposition:function(){if(!(Browser.IE6||Browser.IE7)){return }var N=$("location-autocompleter");var M=$("locations").cumulativeOffset();if(N.parentNode!=document.body){document.body.appendChild(N)}N.setStyle({left:String(M[0]-3)+"px",top:String(M[1]+20)+"px"})},rememberLocationItem:function(N,O,P){var M;this.locationItems=this.locationItems.findAll(function(Q){return !(Q.name==N&&Q.type==O)});this.locationItems.push({name:N,type:O});if(P){M=$("locations");if(M.value.length>0){M.value=M.value.replace(/, ?$/,"")+", "+N}else{M.value=N}}},syncTextBoxToLocationItems:function(){if(this.locationItems.length==0){return }$("locations").value=B()},getCities:function(){F();return B("City")},getTracts:function(){F();return B("Tract")},getCommunities:function(){F();return B("Community")},getZips:function(){F();return B("Zip")}};return I}();var Sliders={largeSliderWidth:179,smallSliderWidth:62,isInitialized:false,showSliderHovers:false,initialize:function(){SearchBoxes.hide();this.show();if(!this.isInitialized){this.FormattedMinPrice=$("FormattedMinPrice");this.FormattedMaxPrice=$("FormattedMaxPrice");if(AccountVars.showImprovedSizes){this.FormattedMinHomeSize=$("FormattedMinHomeSize")}this.FormattedMinBeds=$("FormattedMinBeds");this.FormattedMinBaths=$("FormattedMinBaths");if(AccountVars.showLotSizes){this.FormattedMinLotSize=$("FormattedMinLotSize")}this.FormattedMinDaysOnMarket=$("FormattedMinDaysOnMarket");this.FormattedMinYearBuilt=$("FormattedMinYearBuilt");this.FormattedMaxYearBuilt=$("FormattedMaxYearBuilt");this.minPriceSlider=YAHOO.widget.Slider.getHorizSlider("MinPriceSlider","MinPriceSliderImg",0,this.largeSliderWidth);this.maxPriceSlider=YAHOO.widget.Slider.getHorizSlider("MaxPriceSlider","MaxPriceSliderImg",0,this.largeSliderWidth);if(AccountVars.showImprovedSizes){this.minHomeSizeSlider=YAHOO.widget.Slider.getHorizSlider("MinHomeSizeSlider","MinHomeSizeSliderImg",0,this.largeSliderWidth)}this.minBedsSlider=YAHOO.widget.Slider.getHorizSlider("MinBedsSlider","MinBedsSliderImg",0,this.smallSliderWidth);this.minBathsSlider=YAHOO.widget.Slider.getHorizSlider("MinBathsSlider","MinBathsSliderImg",0,this.smallSliderWidth);if(AccountVars.showLotSizes){this.minLotSizeSlider=YAHOO.widget.Slider.getHorizSlider("MinLotSizeSlider","MinLotSizeSliderImg",0,this.largeSliderWidth)}this.minDaysOnMarketSlider=YAHOO.widget.Slider.getHorizSlider("MinDaysOnMarketSlider","MinDaysOnMarketSliderImg",0,this.largeSliderWidth);this.minYearBuiltSlider=YAHOO.widget.Slider.getHorizSlider("MinYearBuiltSlider","MinYearBuiltSliderImg",0,this.largeSliderWidth);this.maxYearBuiltSlider=YAHOO.widget.Slider.getHorizSlider("MaxYearBuiltSlider","MaxYearBuiltSliderImg",0,this.largeSliderWidth);this.minPriceSlider.setValue(0,true,true);this.maxPriceSlider.setValue(this.largeSliderWidth,true,true);if(AccountVars.showImprovedSizes){this.minHomeSizeSlider.setValue(0,true,true)}this.minBedsSlider.setValue(0,true,true);this.minBathsSlider.setValue(0,true,true);if(AccountVars.showLotSizes){this.minLotSizeSlider.setValue(0,true,true)}this.minDaysOnMarketSlider.setValue(0,true,true);this.minYearBuiltSlider.setValue(0,true,true);this.maxYearBuiltSlider.setValue(this.largeSliderWidth,true,true);this.minPriceSlider.subscribe("change",this.updateMinPrice.bind(this,this.minPriceSlider));this.maxPriceSlider.subscribe("change",this.updateMaxPrice.bind(this,this.maxPriceSlider));if(AccountVars.showImprovedSizes){this.minHomeSizeSlider.subscribe("change",this.updateHomeSize.bind(this,this.minHomeSizeSlider))}this.minBedsSlider.subscribe("change",this.updateBeds.bind(this,this.minBedsSlider));this.minBathsSlider.subscribe("change",this.updateBaths.bind(this,this.minBathsSlider));if(AccountVars.showLotSizes){this.minLotSizeSlider.subscribe("change",this.updateLotSize.bind(this,this.minLotSizeSlider))}this.minDaysOnMarketSlider.subscribe("change",this.updateDaysOnMarket.bind(this,this.minDaysOnMarketSlider));this.minYearBuiltSlider.subscribe("change",this.updateMinYearBuilt.bind(this,this.minYearBuiltSlider));this.maxYearBuiltSlider.subscribe("change",this.updateMaxYearBuilt.bind(this,this.maxYearBuiltSlider));this.floatingSliderValue=$("FloatingSliderValue");this.floatingSliderFx=new Fx.Style(this.floatingSliderValue,"opacity",{duration:400,transition:Fx.Transitions.linear});document.body.appendChild(this.floatingSliderValue);Event.observe(window,"unload",this.unload.bind(this))}},show:function(A,B){if(!A&&this.isEnabled&&!B){return }if(!(Browser.IE6||Browser.IE7)){this.isEnabled=true;$("SearchSliderInputWrapper","SearchSliderInputWrapperAdvanced").each(function(C){C.style.display="block"});return }if(!B){this.isEnabled=true;$("SearchSliderInputWrapper").style.display="block";$("SearchSliderInputWrapperAdvanced").style.display="block";window.setTimeout(this.show.bind(this,A,true),15);return }this.minPriceSlider.thumb.setInitPosition();this.minPriceSlider.thumb.setXConstraint($("MinPriceSliderImg").style.posLeft,this.largeSliderWidth-$("MinPriceSliderImg").style.posLeft);this.minPriceSlider.thumb.setYConstraint(0,0);this.maxPriceSlider.thumb.setInitPosition();this.maxPriceSlider.thumb.setXConstraint($("MaxPriceSliderImg").style.posLeft,this.largeSliderWidth-$("MaxPriceSliderImg").style.posLeft);this.maxPriceSlider.thumb.setYConstraint(0,0);if(AccountVars.showImprovedSizes){this.minHomeSizeSlider.thumb.setInitPosition();this.minHomeSizeSlider.thumb.setXConstraint($("MinHomeSizeSliderImg").style.posLeft,this.largeSliderWidth-$("MinHomeSizeSliderImg").style.posLeft);this.minHomeSizeSlider.thumb.setYConstraint(0,0)}this.minBedsSlider.thumb.setInitPosition();this.minBedsSlider.thumb.setXConstraint($("MinBedsSliderImg").style.posLeft,this.smallSliderWidth-$("MinBedsSliderImg").style.posLeft);this.minBedsSlider.thumb.setYConstraint(0,0);this.minBathsSlider.thumb.setInitPosition();this.minBathsSlider.thumb.setXConstraint($("MinBathsSliderImg").style.posLeft,this.smallSliderWidth-$("MinBathsSliderImg").style.posLeft);this.minBathsSlider.thumb.setYConstraint(0,0);this.minLotSizeSlider.thumb.setInitPosition();this.minLotSizeSlider.thumb.setXConstraint($("MinLotSizeSliderImg").style.posLeft,this.largeSliderWidth-$("MinLotSizeSliderImg").style.posLeft);this.minLotSizeSlider.thumb.setYConstraint(0,0);if(AdvancedQuery.toggled){this.minDaysOnMarketSlider.thumb.setInitPosition();this.minDaysOnMarketSlider.thumb.setXConstraint($("MinDaysOnMarketSliderImg").style.posLeft,this.largeSliderWidth-$("MinDaysOnMarketSliderImg").style.posLeft);this.minDaysOnMarketSlider.thumb.setYConstraint(0,0);this.minYearBuiltSlider.thumb.setInitPosition();this.minYearBuiltSlider.thumb.setXConstraint($("MinYearBuiltSliderImg").style.posLeft,this.largeSliderWidth-$("MinYearBuiltSliderImg").style.posLeft);this.minYearBuiltSlider.thumb.setYConstraint(0,0);this.maxYearBuiltSlider.thumb.setInitPosition();this.maxYearBuiltSlider.thumb.setXConstraint($("MaxYearBuiltSliderImg").style.posLeft,this.largeSliderWidth-$("MaxYearBuiltSliderImg").style.posLeft);this.maxYearBuiltSlider.thumb.setYConstraint(0,0)}},hide:function(){$("SearchSliderInputWrapper","SearchSliderInputWrapperAdvanced").reverse().each(function(A){A.style.display="none"});this.isEnabled=false},showFloatingValue:function(A){if(!this.floatingSliderFx){return }this.hideFloatingValueInterval=window.setInterval(this.hideFloatingValue.bind(this),1000);this.floatingSliderFx.clearTimer()},positionFloatingValue:function(A){A=$(A);var B=Position.cumulativeOffset(A);if(!this.hideFloatingValueInterval){this.showFloatingValue(A)}this.floatingSliderFx.set(0.94);this.floatingSliderValue.setStyle({top:String(B[1]-this.floatingSliderValue.getHeight()-2)+"px",left:String(B[0]-((Browser.IE6||Browser.IE7)?A.offsetWidth:0)+2)+"px",display:"block"})},hideFloatingValue:function(){if(!this.floatingSliderValue){return }if(this.floatingSliderValue.innerHTML==this.lastFloatingSliderValue){window.clearInterval(this.hideFloatingValueInterval);this.floatingSliderFx.clearTimer();this.floatingSliderFx.custom(parseFloat(this.floatingSliderValue.getStyle("opacity")),0);this.hideFloatingValueInterval=null}this.lastFloatingSliderValue=this.floatingSliderValue.innerHTML},unload:function(){this.FormattedMinPrice=null;this.FormattedMaxPrice=null;this.FormattedMinHomeSize=null;this.FormattedMinBeds=null;this.FormattedMinBaths=null;this.FormattedMinLotSize=null;this.FormattedMinDaysOnMarket=null;this.FormattedMinYearBuilt=null;this.FormattedMaxYearBuilt=null;this.minPriceSlider=null;this.maxPriceSlider=null;this.minHomeSizeSlider=null;this.minBedsSlider=null;this.minBathsSlider=null;this.minLotSizeSlider=null;this.minDaysOnMarketSlider=null;this.floatingSliderValue=null},easePrice:function(B){var A=-(Math.sqrt(1-Math.pow(B/this.largeSliderWidth,2))-1)*(AccountVars.maxPrice-AccountVars.minPrice)+AccountVars.minPrice;return A-(A%10000)},reverseEasePrice:function(A){var B=Math.sqrt(-1*Math.pow((-A+AccountVars.minPrice)/(AccountVars.maxPrice-AccountVars.minPrice)+1,2)+1)*this.largeSliderWidth;return Math.ceil(B)},scaleLinear:function(E,A,C,D,F){var B=(E/A)*(D-C)+C;return B-(B%F)},reverseScaleLinear:function(C,A,B,D){var E=(C-B)/(D-B)*A;return Math.ceil(E)},formatNumber:function(A){var C="";for(var B=String(A).length-3;B>=0;B-=3){C=","+String(A).substring(B,B+3)+C}if(String(A).length%3>0){C=String(A).substring(0,String(A).length%3)+C}if(C.charAt(0)==","){C=C.substring(1)}return C},updateMinPrice:function(B,A){if(A==0){this.FormattedMinPrice.innerHTML="$0 ";PropertyQuery.minPrice=0;return }PropertyQuery.minPrice=this.easePrice(A);if(PropertyQuery.maxPrice<PropertyQuery.minPrice&&PropertyQuery.maxPrice!=-1){this.maxPriceSlider.setValue(A,true,true)}this.FormattedMinPrice.innerHTML="$"+Formatters.formatNumber(PropertyQuery.minPrice)+" ";if(this.showSliderHovers){this.floatingSliderValue.update("$"+Formatters.formatNumber(PropertyQuery.minPrice));this.positionFloatingValue(B.getThumb().id)}},setMinPrice:function(A){if(this.isInitialized){this.minPriceSlider.setValue(this.reverseEasePrice(A),true,true)}},updateMaxPrice:function(B,A){PropertyQuery.maxPrice=this.easePrice(A);if(PropertyQuery.maxPrice<PropertyQuery.minPrice||A==0){this.minPriceSlider.setValue(A,true,true)}this.FormattedMaxPrice.innerHTML="to $"+Formatters.formatNumber(PropertyQuery.maxPrice);if(this.showSliderHovers){this.floatingSliderValue.update("$"+Formatters.formatNumber(PropertyQuery.maxPrice));this.positionFloatingValue(B.getThumb().id)}if(A==this.largeSliderWidth){this.FormattedMaxPrice.innerHTML+="+";PropertyQuery.maxPrice=-1}},setMaxPrice:function(A){if(this.isInitialized){this.maxPriceSlider.setValue(this.reverseEasePrice(A),true,true)}},updateHomeSize:function(B,A){PropertyQuery.minImprovedSqFt=this.scaleLinear(A,this.largeSliderWidth,0,AccountVars.maxSqft,50);this.FormattedMinHomeSize.innerHTML=Formatters.formatNumber(PropertyQuery.minImprovedSqFt)+"+ sq ft";if(this.showSliderHovers){this.floatingSliderValue.update(Formatters.formatNumber(PropertyQuery.minImprovedSqFt)+"+ sq ft");if(AccountVars.showImprovedSizeDisclaimer){this.floatingSliderValue.update('<img src="http://'+ConfigVars.assetsHost+'/images/newicons/error.png" onload="DiverseSolutions.Beast.Global.FixPng(this);" height="16" width="16" /> Many agents put in 0 for the home size<br />'+this.floatingSliderValue.innerHTML)}this.positionFloatingValue(B.getThumb().id)}},setMinHomeSize:function(A){if(AccountVars.showImprovedSizes&&this.isInitialized){this.minHomeSizeSlider.setValue(this.reverseScaleLinear(A,this.largeSliderWidth,0,AccountVars.maxSqft,10),true,true)}},updateBeds:function(B,A){PropertyQuery.minBeds=this.scaleLinear(A,this.smallSliderWidth,0,10,1);this.FormattedMinBeds.innerHTML=Formatters.formatNumber(PropertyQuery.minBeds)+"+";if(this.showSliderHovers){this.floatingSliderValue.update(Formatters.formatNumber(PropertyQuery.minBeds)+"+");this.positionFloatingValue(B.getThumb().id)}},setMinBeds:function(A){if(this.isInitialized){this.minBedsSlider.setValue(this.reverseScaleLinear(A,this.smallSliderWidth,0,10,1),true,true)}},updateBaths:function(B,A){PropertyQuery.minBaths=this.scaleLinear(A,this.smallSliderWidth,0,10,1);this.FormattedMinBaths.innerHTML=Formatters.formatNumber(PropertyQuery.minBaths)+"+";if(this.showSliderHovers){this.floatingSliderValue.update(Formatters.formatNumber(PropertyQuery.minBaths)+"+");this.positionFloatingValue(B.getThumb().id)}},setMinBaths:function(A){if(this.isInitialized){this.minBathsSlider.setValue(this.reverseScaleLinear(A,this.smallSliderWidth,0,10,1),true,true)}},updateLotSize:function(C,A){var B;PropertyQuery.minLotSqFt=this.scaleLinear(A,this.largeSliderWidth,0,AccountVars.maxLotSqft,100);this.FormattedMinLotSize.innerHTML=Formatters.formatLotSize(PropertyQuery.minLotSqFt,true);if(this.showSliderHovers){this.floatingSliderValue.update(Formatters.formatLotSize(PropertyQuery.minLotSqFt,true));if(AccountVars.showLotSizeDisclaimer){this.floatingSliderValue.update('<img src="http://'+ConfigVars.assetsHost+'/images/newicons/error.png" onload="DiverseSolutions.Beast.Global.FixPng(this);" height="16" width="16" /> Many agents put in 0 for the lot size<br />'+this.floatingSliderValue.innerHTML)}this.positionFloatingValue(C.getThumb().id)}},setMinLotSize:function(A){if(AccountVars.showLotSizes&&this.isInitialized){this.minLotSizeSlider.setValue(this.reverseScaleLinear(A,this.largeSliderWidth,0,AccountVars.maxLotSqft,10),true,true)}},updateDaysOnMarket:function(B,A){PropertyQuery.minDaysOnMarket=this.scaleLinear(A,this.smallSliderWidth,0,20,1);this.FormattedMinDaysOnMarket.innerHTML=Formatters.formatNumber(PropertyQuery.minDaysOnMarket)+"+ weeks";if(this.showSliderHovers){this.floatingSliderValue.update(Formatters.formatNumber(PropertyQuery.minDaysOnMarket)+"+ weeks");if(AccountVars.showDaysOnMarketDisclaimer){this.floatingSliderValue.update('<img src="http://'+ConfigVars.assetsHost+'/images/newicons/error.png" onload="DiverseSolutions.Beast.Global.FixPng(this);" height="16" width="16" /> The MLS does not provide days-on-market data<br />'+this.floatingSliderValue.innerHTML)}this.positionFloatingValue(B.getThumb().id)}},setMinDaysOnMarket:function(A){if(this.isInitialized){this.minDaysOnMarketSlider.setValue(this.reverseScaleLinear(A,this.smallSliderWidth,0,20,1),true,true)}},updateMinYearBuilt:function(B,A){if(A==0){this.FormattedMinYearBuilt.innerHTML=AccountVars.minYearBuilt;PropertyQuery.minYearBuilt=-1;return }PropertyQuery.minYearBuilt=this.scaleLinear(A,this.largeSliderWidth,AccountVars.minYearBuilt,ConfigVars.currentYear,1);if(PropertyQuery.maxYearBuilt<PropertyQuery.minYearBuilt&&PropertyQuery.maxYearBuilt!=-1){this.maxYearBuiltSlider.setValue(A,true,true)}this.FormattedMinYearBuilt.innerHTML=String(PropertyQuery.minYearBuilt)+" ";if(this.showSliderHovers){this.floatingSliderValue.update(String(PropertyQuery.minYearBuilt));this.positionFloatingValue(B.getThumb().id)}},setMinYearBuilt:function(A){if(this.isInitialized){if(A<AccountVars.minYearBuilt){AccountVars.minYearBuilt=A}this.minYearBuiltSlider.setValue(this.reverseScaleLinear(A,this.largeSliderWidth,AccountVars.minYearBuilt,ConfigVars.currentYear,1),true,true)}},updateMaxYearBuilt:function(B,A){PropertyQuery.maxYearBuilt=this.scaleLinear(A,this.largeSliderWidth,AccountVars.minYearBuilt,ConfigVars.currentYear,1);if(PropertyQuery.maxYearBuilt<PropertyQuery.minYearBuilt||A==0){this.minYearBuiltSlider.setValue(A,true,true)}this.FormattedMaxYearBuilt.innerHTML="to "+String(PropertyQuery.maxYearBuilt);if(this.showSliderHovers){this.floatingSliderValue.update(String(PropertyQuery.maxYearBuilt));this.positionFloatingValue(B.getThumb().id)}if(A==this.largeSliderWidth){this.FormattedMaxYearBuilt.innerHTML+="+";PropertyQuery.maxYearBuilt=-1}if(!this.isInitialized){this.isInitialized=true;this.showSliderHovers=true;document.fire("sliders:loaded")}},setMaxYearBuilt:function(A){if(this.isInitialized){this.maxYearBuiltSlider.setValue(this.reverseScaleLinear(A,this.largeSliderWidth,AccountVars.minYearBuilt,ConfigVars.currentYear,1),true,true)}}};var SearchBoxes={EventListeners:{"#txtMinHomeSize:focus,#txtMinLotSize:focus,#txtMinDaysOnMarket:focus":function(B){var A;var C=Position.cumulativeOffset(B);switch(B.id){case"txtMinHomeSize":if(AccountVars.showImprovedSizeDisclaimer){A=$("SearchBoxesHomeSizeDisclaimer")}break;case"txtMinLotSize":if(AccountVars.showLotSizeDisclaimer){A=$("SearchBoxesLotSizeDisclaimer")}break;case"txtMinDaysOnMarket":if(AccountVars.showDaysOnMarketDisclaimer){A=$("SearchBoxesDomDisclaimer")}break}if(!A){return }if(A.up()!=document.body){document.body.appendChild(A)}A.show().setStyle({left:(C[0]+((Browser.IE6||Browser.IE7)?-9:2))+"px",top:(C[1]-30)+"px"})},"#txtMinHomeSize:blur,#txtMinLotSize:blur,#txtMinDaysOnMarket:blur":function(A){switch(A.id){case"txtMinHomeSize":$("SearchBoxesHomeSizeDisclaimer").hide();break;case"txtMinLotSize":$("SearchBoxesLotSizeDisclaimer").hide();break;case"txtMinDaysOnMarket":$("SearchBoxesDomDisclaimer").hide();break}}},initialize:function(){Sliders.hide();this.show()},show:function(){$("SearchBoxesInputWrapper","SearchBoxesInputWrapperAdvanced").each(function(A){A.style.display="block"});this.isEnabled=true},hide:function(){$("SearchBoxesInputWrapper","SearchBoxesInputWrapperAdvanced").each(function(A){A.style.display="none"});this.isEnabled=false}};Object.extend(EventListeners,SearchBoxes.EventListeners);var Mapper={Elements:{},Icons:{normalOut:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_green_medium.png",normalOver:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_yellow_light.png",normalVisited:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_green_dark.png",featuredOut:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_red_medium.png",featuredOver:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_yellow_light.png",featuredVisited:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_red_dark.png",active:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_purple.png",favorite:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_favorite.png",sold:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/sold-marker.png",soldActive:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/sold-marker-active.png",city:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/city.png",cityHover:"http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/city-hover.png"},IconStatuses:{normal:"normal",hover:"hover",active:"active",visited:"visited"},properties:[],markerMouseOutFunctionQueue:[],allowLazyLoading:true,currentViewResultCount:0,mapMovementIterations:0,searchCount:0,initialize:function(){this.mapContainer=$("map");this.Elements.propertySummary=$("listing-map-hover-container");this.Elements.propertySummaryPrice=$("PropertySummaryPrice");this.Elements.propertySummaryAddress=$("PropertySummaryAddress");this.Elements.propertySummaryBedsBaths=$("PropertySummaryBedsBaths");this.Elements.propertySummaryImprovedSqFt=$("PropertySummaryImprovedSqFt");this.Elements.propertySummaryDataContainer=$("PropertySummaryDataContainer");this.Elements.propertySummaryListingInfo=$("PropertySummaryListingInfo");this.Elements.propertySummaryDiscretionaryField1=$("PropertySummaryDiscretionaryField1");this.Elements.propertySummaryIcon=$("PropertySummaryIcon");this.Elements.cityMarkerHover=$("city-map-hover-container");this.Elements.cityMarkerHoverName=$("CityMarkerHoverName");this.Elements.cityMarkerHoverTotalListings=$("CityMarkerHoverTotalListings");this.isInitialized=true;this.Proprietary.initialize();this.updateSearchBounds();Event.observe(window,"unload",this.unload.bind(this));if(!Browser.IE6){this.mapZoomSlider=YAHOO.widget.Slider.getHorizSlider("map-zoom-slider","map-zoom-highlighter",0,139,10);this.mapZoomSlider.subscribe("slideEnd",this.handleZoomSlider.bind(this));this.mapZoomSlider.tickPause=5;this.mapZoomSlider.animate=false;this.mapZoomSlider.setValue(this.getZoom()<=(this.getMaxZoom()-13)?0:(this.getZoom()-(this.getMaxZoom()-13))*10,true,true,true)}else{setTimeout(function(){this.mapZoomSlider=YAHOO.widget.Slider.getHorizSlider("map-zoom-slider","map-zoom-highlighter",0,139,10);this.mapZoomSlider.subscribe("slideEnd",this.handleZoomSlider.bind(this));this.mapZoomSlider.tickPause=5;this.mapZoomSlider.animate=false;this.mapZoomSlider.setValue(this.getZoom()<=(this.getMaxZoom()-13)?0:(this.getZoom()-(this.getMaxZoom()-13))*10,true,true,true)}.bind(this),500)}},initializeStyles:function(){$("map-controls").setStyle({backgroundImage:"url(/DynamicImages/MapControl-Background.aspx?fill="+DynamicColors["Map control top shade"]+"&overlay="+DynamicColors["Map control bottom shade"]+")",visibility:"visible"});$("map-slider-container").setStyle({backgroundImage:"url(/DynamicImages/MapControl-ZoomBackground.aspx?background="+DynamicColors["Map control bottom shade"]+"&fill="+DynamicColors["Map control bottom shade"]+"&overlay="+DynamicColors["Map control top shade"]+"&text="+DynamicColors["Map control foreground"]+")"});$("status-message").setStyle({backgroundImage:"url(/DynamicImages/MapControl-Background.aspx?fill="+DynamicColors["Map control top shade"]+"&overlay="+DynamicColors["Map control bottom shade"]+")"})},unload:function(){this.mapContainer=null;this.properties=null;this.Elements=null;this.Proprietary.unload()},reset:function(){this.currentViewResultCount=0;this.Elements.propertySummary._mlsNumber="";this.Elements.propertySummary.hide()},checkResize:function(){if(this.cancelBubble){return }this.Proprietary.checkResize();AreaStatisticPanel.checkResize()},updateSearchBounds:function(){var A=this.getSwCornerBounds();var B=this.getNeCornerBounds();PropertyQuery.MapSpecific.maxLatitude=B[0];PropertyQuery.MapSpecific.maxLongitude=B[1];PropertyQuery.MapSpecific.minLatitude=A[0];PropertyQuery.MapSpecific.minLongitude=A[1]},prepareMapForResults:function(B,A){this.Proprietary.removePropertyMarkers();this.properties=[];this.Proprietary.prepareMapForResults(B);this.mapMovementIterations++;if(B){CityMarkers.hide();HelpTips.hideZoomIn();if(Tabs.isSearchActive){HelpTips.showRefineSearch()}}else{FeaturedProperties.show();CityMarkers.show();HelpTips.hideRefineSearch();if(Tabs.isMapActive&&A){HelpTips.showZoomIn()}}if(this.mapMovementIterations>=7){HelpTips.showFindBox()}},plotAvailableProperties:function(){if(window.location.hash.indexOf("LogMapCoords")!=-1){this.Proprietary.logMapCoords();return }if(this.cancelBubble){return }if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID&&AccountVars.registrationLevel<=1&&this.searchCount==((typeof AccountVars.allowedSearchesBeforeRegistration=="undefined")?this.searchCount:AccountVars.allowedSearchesBeforeRegistration)){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:this.plotAvailableProperties.bind(this)},true);return }var B=$$("#PropertyTypes input[type=checkbox]");var C=[];for(var A=0;A<B.length;A++){if(B[A].checked){C.push(B[A].value)}}this.updateSearchBounds();this.reset();PropertyQuery.propertyTypes=C.join(",");PropertyQuery.MapSpecific.resultPage=1;PropertyQuery.MapSpecific.onSuccess=Mapper.plotAvailablePropertiesCallback.bind(Mapper);this.allowLazyLoading=true;if(PropertyQuery.cities.blank()){$("cbxConstrainToMap").checked=true}else{$("cbxConstrainToMap").checked=false}PropertyQuery.sendRequest(true)},stopLazyLoading:function(){this.allowLazyLoading=false;if(this.lazyLoadCallbackTimeout){clearTimeout(this.lazyLoadCallbackTimeout)}},plotAvailablePropertiesCallback:function(A){if(!this.allowLazyLoading){return }if(A.totalCount){this.currentViewResultCount=A.totalCount;if(this.currentViewResultCount>ConfigVars.maxPropertiesToMap){if(!Results.totalCount){StatusMessage.setText(Formatters.formatNumber(A.totalCount)+" properties within map view")}else{StatusMessage.setText(Formatters.formatNumber(Results.totalCount)+" properties found; "+Formatters.formatNumber(A.totalCount)+" within map")}this.prepareMapForResults(false,true);this.checkForAdditionalZoomLevels();SoldProperties.hide();return }if(this.currentViewResultCount==0){if(!Results.totalCount){StatusMessage.setText("0 properties matched your search")}else{StatusMessage.setText(Formatters.formatNumber(Results.totalCount)+" properties found; 0 within map")}this.prepareMapForResults(false);SoldProperties.hide();return }this.checkForAdditionalZoomLevels();this.prepareMapForResults(true);if(!Results.totalCount){if(this.currentViewResultCount==1){StatusMessage.setText("1 property within map view.")}else{StatusMessage.setText(this.currentViewResultCount+" properties within map view.")}}else{if(Results.totalCount==1){StatusMessage.setText(Formatters.formatNumber(Results.totalCount)+" properties found; 1 on map")}else{StatusMessage.setText(Formatters.formatNumber(Results.totalCount)+" properties found; "+Formatters.formatNumber(this.currentViewResultCount)+" on map")}}SoldProperties.reset();SoldProperties.loadWithinMapBounds.bind(SoldProperties).defer()}A.results.each(function(B){Mapper.mapResult(B)});if(this.properties.length==0){PropertyQuery.MapSpecific.resultPage=1;this.lazyLoadCallbackTimeout=setTimeout(PropertyQuery.sendRequest.bind(PropertyQuery,true),ConfigVars.mapLazyLoadDelay)}else{if(this.properties.length<ConfigVars.maxPropertiesToMap-1&&this.properties.length<this.currentViewResultCount){PropertyQuery.MapSpecific.resultPage++;this.lazyLoadCallbackTimeout=setTimeout(PropertyQuery.sendRequest.bind(PropertyQuery,true),ConfigVars.mapLazyLoadDelay)}else{this.searchCount++}}},removeMarker:function(B,A){this.Proprietary.removeMarker(A);this.properties=this.properties.reject(function(C){return(C.PropertyID==B)})},getIcon:function(C,A){var B;switch(A){case"normal":if(C.IsFeatured){B=this.Icons.featuredOut}else{B=this.Icons.normalOut}break;case"hover":if(C.IsFeatured){B=this.Icons.featuredOver}else{B=this.Icons.normalOver}break;case"active":this.properties.each(function(E,D){if(E.IsActive){E.IsActive=false;E.IsVisited=true;Mapper.changeIconIfMapped(E,Mapper.IconStatuses.visited,true)}if(E.PropertyID==C.PropertyID){E.IsActive=true;E.IsVisited=true}});B=this.Icons.active;break;case"visited":if(C.IsFeatured){B=this.Icons.featuredVisited}else{B=this.Icons.normalVisited}break}return B},changeIconIfMapped:function(D,A,B){var C;if(D.marker){C=D}else{C=this.properties.find(function(E){return(E.PropertyID==D.PropertyID)})}if(!C||C.IsActive){return }this.Proprietary.changeIcon(C,this.getIcon(C,A),B)},handleZoomSlider:function(){var B=164;var C=this.mapZoomSlider.getXValue();var A=(C==B?this.getMaxZoom()-13:(C-B))/10+this.getMaxZoom()-13;this.setZoomLevel(A+(Browser.IE6?1:0))},handleZoomEvent:function(B,A){if(!!this.mapZoomSlider){this.mapZoomSlider.setValue(this.getZoom()<=(this.getMaxZoom()-13)?0:(this.getZoom()-(this.getMaxZoom()-13))*10,true,true,true)}},checkForAdditionalZoomLevels:function(){var A=this.additionalZoomLevelsAvailable();if(this.getZoom()==this.getMaxZoom()&&A){$("additional-zoom-text").update($("additional-zoom-base-text").innerHTML.interpolate(A));HelpTips.hideZoomIn(true);HelpTips.showAdditionalZoom()}},toggleMapTypeSelector:function(){var B=$("map-type-selector-container");var C=$("map-type-selected").cumulativeOffset();var A=[(Browser.IE6||Browser.IE7)?-4:1,(Browser.IE6||Browser.IE7)?1:0];if(!this.mapTypeSelectorInitialized){document.body.appendChild(B);this.mapTypeSelectorInitialized=true}$("map-type-selector-container").setStyle({display:!!this.isMapTypeSelectorOpen?"none":"block",left:String(C[0]+A[0])+"px",top:String(C[1]+A[1])+"px"});this.isMapTypeSelectorOpen=!this.isMapTypeSelectorOpen},setMapType:function(B,A){this.toggleMapTypeSelector();$("map-type-selected").className=A.className;HelpTips.hideAdditionalZoom();(function(){this.Proprietary.setMapType(B);if(!!this.mapZoomSlider){this.mapZoomSlider.setValue(this.getZoom()<=(this.getMaxZoom()-13)?0:(this.getZoom()-(this.getMaxZoom()-13))*10,true,true,true)}}).bind(this).defer()}};var CityMarkers={initialize:function(){if(!this.displayCount||(AccountVars.useSlidersByDefault&&!Sliders.isInitialized)||!Mapper.isInitialized){return }if(!!FeaturedProperties.properties&&FeaturedProperties.properties.length>15){return }this.show()},zoomToCity:function(B){var A=(this.cities)?this.cities.find(function(C){return(C.City==B&&C.swCorner)}):null;if(A){if(B==this.lastCityCentered){Mapper.setCenter(A.swCorner,A.neCorner,false,Mapper.getZoom()+1)}else{Mapper.setCenter(A.swCorner,A.neCorner)}}else{new Ajax.Request("/Webservice/Statistics.asmx/GetCityBounds",{parameters:"city="+encodeURIComponent(B),onSuccess:this.zoomToCityCallback.bind(this,B)})}this.lastCityCentered=B},zoomToCityCallback:function(C,B,A){if(this.cities){this.cities.each(function(D){if(D.City==C){D.swCorner=A.swCorner;D.neCorner=A.neCorner}})}Mapper.setCenter(A.swCorner,A.neCorner)},show:function(){if(!this.displayCount){return }var A=0;var B=this.displayCount*(Resizr.currentMapContainerWidth/Resizr.initialMapContainerWidth);this.cities.each(function(D,C){if(PropertyQuery.MapSpecific.minLatitude<D.Lat&&PropertyQuery.MapSpecific.maxLatitude>D.Lat&&PropertyQuery.MapSpecific.minLongitude<D.Lng&&PropertyQuery.MapSpecific.maxLongitude>D.Lng&&A<B){if(!D.marker){Mapper.plotCityMarker(D)}else{if(D.marker.isHidden()){D.marker.show()}}A++}else{if(D.marker){D.marker.hide()}}})},hide:function(){if(!this.cities){return }this.cities.each(function(A){if(A.marker){A.marker.hide()}})}};var AreaStatisticPanel={initialized:false,initialize:function(){if(!AccountVars.enableMapStatistics){return }var A=$("AreaStatisticPanelWrapper");this.closedPanelWidth=parseInt(A.getStyle("width").sub("px",""));this.closedPanelHeight=parseInt($("AreaStatisticsOverHit").getStyle("height").sub("px",""));this.toggleFx=new Fx.Styles(A,{transition:Fx.Transitions.quartIn,duration:400});A.show();$("map").appendChild(A);this.checkResize();$("AreaStatisticsOverHit").observe("mouseover",this.showPanel.bindAsEventListener(this));$("AreaStatisticsData").observe("mouseover",this.showPanel.bindAsEventListener(this));Event.observe(A,"mouseout",this.hidePanel.bindAsEventListener(this));Event.observe(window,"unload",this.unload.bind(this));this.initialized=true},checkResize:function(B){if(!AccountVars.enableMapStatistics||!this.initialized){return }var A=$("AreaStatisticPanelWrapper");this.mapContainerWidth=(B||$("map")).getDimensions().width;A.setStyle({left:String(this.mapContainerWidth-A.offsetWidth)+"px"})},showPanel:function(C){var A=$(C.relatedTarget||C.fromElement);var B=$("AreaStatisticPanelWrapper");if((A&&A.up("#AreaStatisticPanelWrapper")&&A.id!="AreaStatisticPanel")||(A&&A.id=="AreaStatisticPanel"&&this.toggleFx.timer)||Event.element(C).id=="AreaStatisticPanel"){return }this.queryAreaStatistics();this.toggleFx.clearTimer();this.toggleFx.custom({width:[B.offsetWidth,B.scrollWidth],left:[parseInt(B.getStyle("left").sub("px","")),this.mapContainerWidth-B.scrollWidth],height:[parseInt(B.getStyle("height").sub("px","")),B.scrollHeight]})},hidePanel:function(C){var A=$(C.relatedTarget||C.toElement);var B=$("AreaStatisticPanelWrapper");if(!A){return }if((A&&A.up("#AreaStatisticPanelWrapper")&&A.id!="AreaStatisticPanel")||(A&&A.id=="AreaStatisticPanel"&&this.toggleFx.timer)){return }this.toggleFx.clearTimer();this.toggleFx.custom({width:[B.offsetWidth,this.closedPanelWidth],left:[parseInt(B.getStyle("left").sub("px","")),this.mapContainerWidth-this.closedPanelWidth],height:[parseInt(B.getStyle("height").sub("px","")),this.closedPanelHeight]})},unload:function(){this.toggleFx=null},resetToLoading:function(){if(!AccountVars.enableMapStatistics){return }$("AreaStatMeanPrice").innerHTML="Loading ...";$("AreaStatMedianPricePerSqFt").innerHTML="Loading ...";$("AreaStatMedianPrice").innerHTML="Loading ...";$("AreaStatLowestPrice").innerHTML="Loading ...";$("AreaStatHighestPrice").innerHTML="Loading ...";$("AreaStatMeanLotSize").innerHTML="Loading ...";$("AreaStatMedianLotSize").innerHTML="Loading ...";$("AreaStatSmallestLotSize").innerHTML="Loading ...";$("AreaStatLargestLotSize").innerHTML="Loading ...";$("AreaStatMeanImprovedSize").innerHTML="Loading ...";$("AreaStatMedianImprovedSize").innerHTML="Loading ...";$("AreaStatSmallestImprovedSize").innerHTML="Loading ...";$("AreaStatLargestImprovedSize").innerHTML="Loading ..."},queryAreaStatistics:function(){if(!AccountVars.enableMapStatistics){return }var D="";var B=$$("#PropertyTypes input[type=checkbox]");var C=[];for(var A=0;A<B.length;A++){if(B[A].checked){C.push(B[A].value)}}D+="minLatitude="+PropertyQuery.MapSpecific.minLatitude;D+="&minLongitude="+PropertyQuery.MapSpecific.minLongitude;D+="&maxLatitude="+PropertyQuery.MapSpecific.maxLatitude;D+="&maxLongitude="+PropertyQuery.MapSpecific.maxLongitude;D+="&propertyTypes="+encodeURIComponent(C.join(","));if(this.lastSentParams&&this.lastSentParams==D){return }this.resetToLoading();this.lastSentParams=D;new Ajax.Request("/Webservice/Statistics.asmx/GatherAreaStatistics",{parameters:D,onSuccess:this.queryAreaStatisticsCallback.bind(this)})},queryAreaStatisticsCallback:function(B,A){if(A){$("AreaStatMeanPrice").innerHTML="$"+Formatters.formatNumber(A.meanPrice);if(AccountVars.showImprovedSizes){$("AreaStatMedianPricePerSqFt").innerHTML="$"+Formatters.formatNumber(A.medPricePerSqFt)+" / sq ft"}else{$("AreaStatMedianPricePerSqFt").innerHTML="n/a"}$("AreaStatMedianPrice").innerHTML="$"+Formatters.formatNumber(A.medPrice);$("AreaStatLowestPrice").innerHTML="$"+Formatters.formatNumber(A.minPrice);$("AreaStatHighestPrice").innerHTML="$"+Formatters.formatNumber(A.maxPrice)}else{$("AreaStatMeanPrice").innerHTML="n/a";$("AreaStatMedianPricePerSqFt").innerHTML="n/a";$("AreaStatMedianPrice").innerHTML="n/a";$("AreaStatLowestPrice").innerHTML="n/a";$("AreaStatHighestPrice").innerHTML="n/a"}if(AccountVars.showLotSizes&&A){$("AreaStatMeanLotSize").innerHTML=Formatters.formatLotSize(A.meanLotSqFt);$("AreaStatMedianLotSize").innerHTML=Formatters.formatLotSize(A.medLotSqFt);$("AreaStatSmallestLotSize").innerHTML=Formatters.formatLotSize(A.smallestLotSqFt);$("AreaStatLargestLotSize").innerHTML=Formatters.formatLotSize(A.largestLotSqFt)}else{$("AreaStatMeanLotSize").innerHTML="n/a";$("AreaStatMedianLotSize").innerHTML="n/a";$("AreaStatSmallestLotSize").innerHTML="n/a";$("AreaStatLargestLotSize").innerHTML="n/a"}if(!AccountVars.showImprovedSizes||!A){$("AreaStatMeanImprovedSize").innerHTML="n/a";$("AreaStatMedianImprovedSize").innerHTML="n/a";$("AreaStatSmallestImprovedSize").innerHTML="n/a";$("AreaStatLargestImprovedSize").innerHTML="n/a"}else{$("AreaStatMeanImprovedSize").innerHTML=Formatters.formatNumber(A.meanImprovedSqFt)+" sq ft";$("AreaStatMedianImprovedSize").innerHTML=Formatters.formatNumber(A.medImprovedSqFt)+" sq ft";$("AreaStatSmallestImprovedSize").innerHTML=Formatters.formatNumber(A.smallestImprovedSqFt)+" sq ft";$("AreaStatLargestImprovedSize").innerHTML=Formatters.formatNumber(A.largestImprovedSqFt)+" sq ft"}}};var SoldProperties=function(){var J=6,L=133;var F=[];var E;var G;var M;var D="";var I;var B;function H(){if(E){return }G=$$("#sold-properties-data thead tr.main-headers th");if(!(Browser.IE6||Browser.IE7)){$("sold-properties-table-body").addClassName("sold-properties-scroller")}Event.observe(window,"unload",C);E=true}function C(){G=null;B=null}function K(P){if(!E){arguments.callee.delay(0.05,P);return }var O=$("sold-properties-table-head");var N="";F=P.responseJSON;if(F.length==0){O.hide();N='<tr><th colspan="#{columnCount}" class="not-available">No sold properties are available to display within the map area. Try zooming out a bit.</th></tr>'.interpolate({columnCount:O.select("th").length})}else{O.show();F.each(function(R,Q){N+='<tr id="SoldPropertyRow_#{id}" style="background-color: ##{backgroundColor};" onclick="SoldProperties.toggleRow(this, #{id})" onmouseover="SoldProperties.showMarker(this, #{id})" onmouseout="SoldProperties.destroyMarkers(this)">'.interpolate({backgroundColor:Q%2==0?"FFFFFF":"FAFAFA",id:R.ID});N+='<td class="column-#{columnPosition}">#{Price}</td>'.interpolate(Object.extend(R,{columnPosition:Q}));N+='<td class="column-#{columnPosition}">#{Beds} bd, #{Baths} ba, #{Size} sq ft</td>'.interpolate(Object.extend(R,{columnPosition:Q}));N+='<td class="column-#{columnPosition}">#{YrBlt}</td>'.interpolate(Object.extend(R,{columnPosition:Q}));N+='<td class="column-#{columnPosition}">#{Type}</td>'.interpolate(Object.extend(R,{columnPosition:Q}));N+='<td class="column-#{columnPosition}">#{Clsed}</td>'.interpolate(Object.extend(R,{columnPosition:Q}));N+="</tr>"})}$("sold-properties-table-body").update(N);$("sold-properties-data-container").show();A()}function A(){if(!(Browser.IE6||Browser.IE7)||F.length<=J){return }var N=$("sold-properties-table-body");N.select("tr:first-child td").each(function(P,O){G[O].setStyle({width:String(P.offsetWidth-10)+"px"});P.setStyle({width:String(P.offsetWidth-10)+"px"})});N.update('<tr><td colspan="#{columnCount}" class="no-padding-row"><div class="sold-properties-scroller"><table>#{data}</table></div></td></tr>'.interpolate({columnCount:G.length,data:N.innerHTML}))}return{loadWithinMapBounds:function(){if(!AccountVars.showSoldProperties||AccountVars.packageType==1||!this.hasSoldListings){return }var N=Mapper.getSwCornerBounds();var O=Mapper.getNeCornerBounds();H.defer();new Ajax.Request("/Webservice/QuerySoldProperties.asmx/LoadWithinBounds",{parameters:{minLatitude:N[0],minLongitude:N[1],maxLatitude:O[0],maxLongitude:O[1]},onSuccess:K})},showMarker:function(N,P){var O;$(N).addClassName("hover");if(M){return }O=F.find(function(Q){return Q.ID==P});if(!O.marker){Mapper.plotSoldMarker(O)}},toggleAllMarkers:function(N){M=N.checked;if(M){F.each(function(O){if(!O.marker){Mapper.plotSoldMarker(O)}})}else{this.destroyMarkers()}},destroyMarkers:function(N){if(N){N=$(N);N.removeClassName("hover");if(N.hasClassName("active")){return }}if(!M){F.each(function(O){if(O.marker&&O.ID!=I){Mapper.destroySoldMarker(O.marker);delete O.marker}})}},toggleRow:function(N,P){var O;N=$(N);if(N.hasClassName("active")){N.removeClassName("active");Mapper.hideSoldPreview();D="";I=null;if(M){F.find(function(Q){return Q.ID==P}).marker.DiverseSolutions.setImage(Mapper.Icons.sold)}this.destroyMarkers()}else{N.addClassName("active").removeClassName("hover");this.showMarker(N,P);if(!D.blank()){$(D).removeClassName("active").removeClassName("hover");F.find(function(Q){return Q.ID==I}).marker.DiverseSolutions.setImage(Mapper.Icons.sold)}D=N.identify();I=P;this.destroyMarkers();O=F.find(function(Q){return Q.ID==P});O.marker.DiverseSolutions.setImage(Mapper.Icons.soldActive);Mapper.showSoldPreview(O)}},setActiveFromMarker:function(N){var O=$("SoldPropertyRow_"+String(N.ID));this.toggleRow(O,N.ID);if(!B){B=new Fx.Scroll((Browser.IE6||Browser.IE7)?O.offsetParent.parentNode:O.parentNode,{duration:400,transition:Fx.Transitions.expoOut})}B.clearTimer();B.custom(B.element.scrollTop,O.offsetTop)},hide:function(){if(!AccountVars.showSoldProperties||!this.hasSoldListings){return }$("sold-properties-data-container").hide();$("show-for-sale-properties").checked="checked";$("show-sold-properties").checked=""},show:function(){if(!AccountVars.showSoldProperties||!this.hasSoldListings){return }$("sold-properties-data-container").show()},reset:function(){if(!AccountVars.showSoldProperties||AccountVars.packageType==1||!this.hasSoldListings){return }$("show-for-sale-properties").checked="checked";$("show-sold-properties").checked="";if(!D.blank()){this.toggleRow(D)}this.destroyMarkers();D="";I=null}}}();var AdvancedQuery={toggleFx:null,toggled:false,initialize:function(){if(this.initialized){return }this.toggleFx=new Fx.Styles("AdvancedQuery",{transition:Fx.Transitions.quartIn,duration:300});this.initiailized=true;Event.observe(window,"unload",this.unload.bind(this))},unload:function(){this.toggleFx=null},toggle:function(B,A){this.initialize();if(Browser.IE7){$("AdvancedQuery").setStyle({position:"relative"})}B=$(B);this.toggleAdvancedQuery(A);if(this.toggled){B.update("Advanced >>");this.toggled=false}else{B.update("<< Simple");this.toggled=true}},toggleAdvancedQuery:function(A){var B=$("AdvancedQuery");if(this.toggled){this.toggleFx.custom({height:[B.offsetHeight,0],opacity:[1,0]});if(!A){Scroller.toBodyContent()}}else{this.toggleFx.custom({height:[B.offsetHeight,B.scrollHeight],opacity:[0,1]});if(!A){setTimeout(function(){if((Sliders.isEnabled&&!SearchBoxes.isEnabled&&AccountVars.useSlidersByDefault)||Sliders.isEnabled){Sliders.show(true)}Scroller.toAdvanced()},400)}}}};var HelpPanel={initialize:function(){this.helpPanel=new YAHOO.widget.Panel("HelpPanel",{modal:false,visible:false,width:"320px",fixedcenter:false,constrainviewport:true,underlay:"none",context:["map","tr","tr"],zIndex:10});var A=[new YAHOO.util.KeyListener(document,{keys:27},{fn:this.toggle.bind(this)})];this.helpPanel.cfg.queueProperty("keylisteners",A);this.helpPanel.hideEvent.subscribe(function(){this.isVisible=false}.bind(this),HelpPanel);$("HelpPanel").setStyle({position:"relative"});this.helpPanel.render(document.body);Event.observe(window,"unload",this.unload.bind(this))},unload:function(){this.helpPanel=null},toggle:function(){if(!this.isVisible){this.helpPanel.show();this.isVisible=true;this.reposition()}else{this.helpPanel.hide();this.isVisible=false}},reposition:function(){if(this.helpPanel&&this.isVisible){this.helpPanel.align(YAHOO.widget.Overlay.TOP_RIGHT,YAHOO.widget.Overlay.TOP_RIGHT)}}};var HelpTips={initialize:function(){setTimeout(function(){var F=new Image();var B=new Image();var H=new Image();var A=new Image();var D=new Image();var G=new Image();var E=new Image();var C=new Image();F.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_RefineSearch.png";B.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_ZoomIn.png";H.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_QuickFind.png";A.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_FavoriteMe.png";D.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_SaveSearch.png";G.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_SortResults.png";E.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_RegisterToday.png";C.src="http://"+ConfigVars.assetsHost+"/images/Beast/Tip_AdditionalZoom.png"},2500);if(!document.cookie){return }$A(document.cookie.split(";")).each(function(A){if(A.strip().indexOf("Tip_DisableRefineSearch")==0){this.refineSearchDisabled=true}else{if(A.strip().indexOf("Tip_DisableZoomIn")==0){this.zoomInDisabled=true}else{if(A.strip().indexOf("Tip_DisableFindBox")==0){this.findBoxDisabled=true}else{if(A.strip().indexOf("Tip_DisableFavoriteMe")==0){this.favoriteMeDisabled=true}else{if(A.strip().indexOf("Tip_DisableSaveSearch")==0){this.saveSearchDisabled=true}else{if(A.strip().indexOf("Tip_DisableSortResults")==0){this.sortResultsDisabled=true}else{if(A.strip().indexOf("Tip_DisableRegisterToday")==0){this.registerTodayDisabled=true}else{if(A.strip().indexOf("Tip_DisableAdditionalZoom")==0){this.additionalZoomDisabled=true}}}}}}}}}.bind(this))},checkResize:function(){if(this.isShowingRefineSearch){this.showRefineSearch()}if(this.isShowingZoomIn){this.showZoomIn()}if(this.isShowingFindBox){this.showFindBox()}if(this.isShowingFavoriteMe){this.showFavoriteMe()}if(this.isShowingInvalidEmail){this.showInvalidEmail()}if(this.isShowingSaveSearch){this.showSaveSearch()}if(this.isShowingSortResults){this.showSortResults()}if(this.isShowingRegisterToday){this.showRegisterToday()}if(this.isShowingAdditionalZoom){this.showAdditionalZoom()}},reset:function(){document.cookie="Tip_DisableRefineSearch=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableZoomIn=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableFindBox=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableFavoriteMe=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableSaveSearch=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableSortResults=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableRegisterToday=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";document.cookie="Tip_DisableAdditionalZoom=true; expires=Wed, Jan 2 1980 00:00:00 UTC; path=/";this.refineSearchDisabled=false;this.zoomInDisabled=false;this.findBoxDisabled=false;this.favoriteMeDisabled=false;this.saveSearchDisabled=false;this.sortResultsDisabled=false;this.registerTodayDisabled=false;this.registerAdditionalZoom=false},showRefineSearch:function(){if(this.refineSearchDisabled||(this.isShowingAnyTip&&!this.isShowingRefineSearch)){return }var B=$("RefineSearchTip");var A=$("submit-query-button").cumulativeOffset();this.isShowingRefineSearch=true;this.isShowingAnyTip=true;A[0]+=90;A[1]-=310;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[210,17],this.hideRefineSearch)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideRefineSearch:function(){if(this.isShowingRefineSearch){this.disableRefineSearch()}},disableRefineSearch:function(){if(this.isShowingRefineSearch){$("RefineSearchTip").hide()}this.isShowingRefineSearch=false;this.refineSearchDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableRefineSearch=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showZoomIn:function(){if(this.zoomInDisabled||(this.isShowingAnyTip&&!this.isShowingZoomIn)){return }var B=$("ZoomInTip");var A=Position.cumulativeOffset($("map-slider-container"));this.isShowingZoomIn=true;this.isShowingAnyTip=true;A[0]+=227;A[1]+=-23;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[210,17],this.hideZoomIn)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideZoomIn:function(A){if(this.isShowingZoomIn){this.disableZoomIn(A)}},disableZoomIn:function(A){if(this.isShowingZoomIn){$("ZoomInTip").hide()}this.isShowingZoomIn=false;if(!A){this.zoomInDisabled=true}this.isShowingAnyTip=false;if(!A){document.cookie="Tip_DisableZoomIn=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"}},showFindBox:function(){if(this.findBoxDisabled||(this.isShowingAnyTip&&!this.isShowingFindBox)){return }var B=$("FindBoxTip");var A;if(!(Browser.IE6||Browser.IE7)){A=Position.cumulativeOffset($("FindBox"))}else{A=YAHOO.util.Dom.getXY($("FindBox"))}this.isShowingFindBox=true;this.isShowingAnyTip=true;A[0]-=90;A[1]+=25;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[171,49],this.hideFindBox)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideFindBox:function(){if(this.isShowingFindBox){this.disableFindBox()}},disableFindBox:function(){if(this.isShowingFindBox){$("FindBoxTip").hide()}this.isShowingFindBox=false;this.findBoxDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableFindBox=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showFavoriteMe:function(){if(this.favoriteMeDisabled||(this.isShowingAnyTip&&!this.isShowingFavoriteMe)){return }var B=$("FavoriteMeTip");var A=Position.cumulativeOffset($("DetailPanelFavoriteStatus"));this.isShowingFavoriteMe=true;this.isShowingAnyTip=true;A[0]-=245;A[1]-=143;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[171,24],this.hideFavoriteMe)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideFavoriteMe:function(){if(this.isShowingFavoriteMe){this.disableFavoriteMe()}},disableFavoriteMe:function(){if(this.isShowingFavoriteMe){$("FavoriteMeTip").hide()}this.isShowingFavoriteMe=false;this.favoriteMeDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableFavoriteMe=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showInvalidEmail:function(B){var A=$("InvalidEmailTip");if(B){this.placementPosition=Position.cumulativeOffset($(B))}else{if(!this.placementPosition){return }}this.isShowingAnyTip=true;this.isShowingInvalidEmail=true;this.placementPosition[0]-=245;this.placementPosition[1]-=73;if(A.up()!=document.body){document.body.appendChild(A);this.appendClose(A,[172,17],this.hideInvalidEmail)}A.setStyle({left:this.placementPosition[0]+"px",top:this.placementPosition[1]+"px",display:"block"})},hideInvalidEmail:function(){if(this.isShowingInvalidEmail){$("InvalidEmailTip").hide();this.isShowingAnyTip=false;this.isShowingInvalidEmail=false}},showSaveSearch:function(){if(this.saveSearchDisabled||(this.isShowingAnyTip&&!this.isShowingSaveSearch)){return }var B=$("SaveSearchTip");var A=Position.cumulativeOffset($("top-result-actions"));this.isShowingSaveSearch=true;this.isShowingAnyTip=true;A[0]+=265;A[1]-=19;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[200,17],this.hideSaveSearch)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideSaveSearch:function(){if(this.isShowingSaveSearch){this.disableSaveSearch()}},disableSaveSearch:function(){if(this.isShowingSaveSearch){$("SaveSearchTip").hide()}this.isShowingSaveSearch=false;this.saveSearchDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableSaveSearch=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showSortResults:function(){if(this.sortResultsDisabled||(this.isShowingAnyTip&&!this.isShowingSortResults)){return }var B=$("SortResultsTip");var A=Position.cumulativeOffset($("ResultSorterContainer"));this.isShowingSortResults=true;this.isShowingAnyTip=true;A[0]+=284;A[1]-=(((Browser.IE6||Browser.IE7))?32:24);if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[200,17],this.hideSortResults)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideSortResults:function(){if(this.isShowingSortResults){this.disableSortResults()}},disableSortResults:function(){if(this.isShowingSortResults){$("SortResultsTip").hide()}this.isShowingSortResults=false;this.sortResultsDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableSortResults=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showRegisterToday:function(){if(this.registerTodayDisabled||(this.isShowingAnyTip&&!this.isShowingRegisterToday)){return }var B=$("RegisterTodayTip");var A=Position.cumulativeOffset($("LoginDialog"));this.isShowingRegisterToday=true;this.isShowingAnyTip=true;A[0]-=67;A[1]+=23;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[235,46],this.hideRegisterToday)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideRegisterToday:function(){if(this.isShowingRegisterToday){this.disableRegisterToday()}},disableRegisterToday:function(){if(this.isShowingRegisterToday){$("RegisterTodayTip").hide()}this.isShowingRegisterToday=false;this.registerTodayDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableRegisterToday=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showAdditionalZoom:function(){if(this.additionalZoomDisabled||(this.isShowingAnyTip&&!this.isShowingAdditionalZoom)){return }var B=$("AdditionalZoomTip");var A=$("map-buttons-container").cumulativeOffset();this.isShowingAdditionalZoom=true;this.isShowingAnyTip=true;A[0]-=317;A[1]-=71;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[235,17],this.hideAdditionalZoom)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideAdditionalZoom:function(){if(this.isShowingAdditionalZoom){this.disableAdditionalZoom()}},disableAdditionalZoom:function(){if(this.isShowingAdditionalZoom){$("AdditionalZoomTip").hide()}this.isShowingAdditionalZoom=false;this.additionalZoomDisabled=true;this.isShowingAnyTip=false;document.cookie="Tip_DisableAdditionalZoom=true; expires=Wed, Jan 1 2020 00:00:00 UTC; path=/"},showYourRebate:function(){if(this.yourRebateDisabled||(this.isShowingAnyTip&&!this.isShowingYourRebate)){return }var B=$("YourRebateTip");var A=$("detail-panel-rebate-amount").cumulativeOffset();this.isShowingYourRebate=true;this.isShowingAnyTip=true;A[0]+=-50;A[1]+=30;if(B.up()!=document.body){document.body.appendChild(B);this.appendClose(B,[172,31],this.hideYourRebate)}B.setStyle({left:A[0]+"px",top:A[1]+"px",display:"block"})},hideYourRebate:function(){if(this.isShowingYourRebate){$("YourRebateTip").hide()}},appendClose:function(C,D,E){var B=$($E({tag:"img",src:"http://"+ConfigVars.assetsHost+"/images/Beast/Tip_CloseIcon.png"}));var A=C.getDimensions();B.observe("click",E.bind(this));B.setStyle({position:"absolute",left:D[0]+"px",top:D[1]+"px",cursor:(((Browser.IE6||Browser.IE7))?"hand":"pointer"),display:"block"});C.appendChild(B)}};var Tabs={EventListeners:{"#LeftPanelTabs li:click,#RightPanelTabs li:click":function(A){if(A.hasClassName("ActiveTab")||(A.hasClassName("DisabledTab")&&A.id!="ResultsTab")){return }switch(A.id){case"SearchTab":Tabs.toggleSearch(false,true);break;case"ResultsTab":Searcher.submitQuery();break;case"MapTab":Tabs.toggleMap(false,true);break;case"DetailsTab":Tabs.toggleDetails(false,true);break}}},resultsPanelWidth:300,isSearchActive:true,isMapActive:true,initialize:function(){if(this.isInitialized){return }this.leftPanelWidth=$("LeftPanelWrapper").offsetWidth-(Resizr.bodyPanelPadding*2);this.rightPanelWidth=$("RightPanelWrapper").offsetWidth-(Resizr.bodyPanelPadding*2);this.isInitialized=true},toggleSearch:function(A,C){var B=$("map-slider-container");this.initialize();$("SearchPanel").show();$("ResultsPanel").hide();if((Sliders.isEnabled&&!SearchBoxes.isEnabled&&AccountVars.useSlidersByDefault)||Sliders.isEnabled){Sliders.show(true)}$("SearchTab").addClassName("ActiveTab");$("ResultsTab").removeClassName("ActiveTab");$("LeftPanelWrapper").setStyle({width:String(this.leftPanelWidth)+"px"});$("RightPanelWrapper").setStyle({width:String(this.rightPanelWidth)+"px"});this.isSearchActive=true;this.isResultsActive=false;Resizr.update();HelpTips.hideSortResults();HelpTips.checkResize();if(!A&&C){dsHistory.addFunction(this.toggleSearch.bind(this))}},toggleResults:function(A,C){var B=$("map-zoom-slider");this.initialize();$("SearchPanel").hide();$("ResultsPanel").show();$("SearchTab").removeClassName("ActiveTab");$("ResultsTab").removeClassName("DisabledTab").addClassName("ActiveTab");$("LeftPanelWrapper").setStyle({width:String(this.resultsPanelWidth)+"px"});$("RightPanelWrapper").setStyle({width:String(this.rightPanelWidth-(this.resultsPanelWidth-this.leftPanelWidth))+"px"});this.isResultsActive=true;this.isSearchActive=false;Resizr.update();HelpTips.hideRefineSearch();HelpTips.checkResize();if(!A&&C){dsHistory.addFunction(this.toggleResults.bind(this),true)}},toggleMap:function(A,B){this.initialize();$("MappingPanel").show();$("DetailsPanel").hide();$("MapTab").addClassName("ActiveTab");$("DetailsTab").removeClassName("ActiveTab");this.isMapActive=true;this.isDetailsActive=false;Mapper.checkResize();HelpTips.hideFavoriteMe();if(!A&&B){dsHistory.addFunction(this.toggleMap.bind(this),true)}},toggleDetails:function(A,B){this.initialize();$("MappingPanel").hide();$("DetailsPanel").show();$("MapTab").removeClassName("ActiveTab");$("DetailsTab").removeClassName("DisabledTab").addClassName("ActiveTab");this.isMapActive=false;this.isDetailsActive=true;HelpTips.hideZoomIn();if(!A&&B){dsHistory.addFunction(this.toggleDetails.bind(this),true)}}};Object.extend(EventListeners,Tabs.EventListeners);var FindBox={Elements:{},tooltipErrorBgColor:"#D50000",initialize:function(){this.Elements.findBox=$("FindBox");this.Elements.findBoxAC=$("FindBox_AutoComplete");this.Elements.tooltip=$("FindBoxTooltip");if(Browser.IE6){this.Elements.findBox.setStyle({backgroundImage:"url(/DynamicImages/FindBox.aspx?background="+DynamicColors["Content background"]+"&fill=000000)"})}document.body.appendChild(this.Elements.findBoxAC);this.findBoxDataSource=new YAHOO.widget.DS_XHR("/Webservice/AutoCompleter.aspx",["ResultSet","data"]);this.findBoxAutoCompleter=new YAHOO.widget.AutoComplete(this.Elements.findBox.id,this.Elements.findBoxAC.id,this.findBoxDataSource);this.findBoxAutoCompleter.formatResult=this.formatResult.bind(this,this.Elements.findBox);this.findBoxAutoCompleter.forceSelection=true;this.findBoxAutoCompleter.queryDelay=0.1;this.findBoxAutoCompleter.minQueryLength=1;this.findBoxAutoCompleter.maxCacheEntries=50;this.findBoxAutoCompleter.animVert=false;this.findBoxAutoCompleter.textboxKeyEvent.subscribe(this.checkInput.bind(this));this.findBoxAutoCompleter.containerExpandEvent.subscribe(this.positionAutoCompleter.bind(this));this.findBoxAutoCompleter.dataReturnEvent.subscribe(this.checkForResults.bind(this));this.findBoxAutoCompleter.itemSelectEvent.subscribe(this.setValue.bind(this));this.findBoxAutoCompleter.selectionEnforceEvent.subscribe(this.setBlur.bind(this));this.Elements.findBox.observe("focus",this.setFocus.bind(this));if((Browser.IE6||Browser.IE7)){this.Elements.findBox.observe("blur",this.setBlur.bind(this))}window.JSON=null;this.checkResize();Event.observe(window,"unload",this.unload.bind(this))},unload:function(){if(this.findBoxAutoCompleter){this.findBoxAutoCompleter.destroy();this.findBoxAutoCompleter=null}this.Elements=null},checkResize:function(){if(!this.Elements.findBox){return }if(!(Browser.IE6||Browser.IE7)){this.findBoxPosition=Position.cumulativeOffset(this.Elements.findBox)}else{this.findBoxPosition=YAHOO.util.Dom.getXY(this.Elements.findBox)}this.findBoxSize=this.Elements.findBox.getDimensions();this.Elements.findBoxAC.setStyle({top:this.findBoxPosition[1]+this.findBoxSize.height+"px"})},positionAutoCompleter:function(){var A;this.Elements.findBoxAC.setStyle({width:"0px"});A=this.Elements.findBoxAC.down().scrollWidth;if(A>this.findBoxSize.width){this.Elements.findBoxAC.setStyle({left:this.findBoxPosition[0]+this.findBoxSize.width-A+"px",width:A+(((Browser.IE6||Browser.IE7))?0:15)+"px"})}else{this.Elements.findBoxAC.setStyle({left:this.findBoxPosition[0]+"px",width:A+(((Browser.IE6||Browser.IE7))?0:15)+"px"})}},formatResult:function(C,B,E){var A=B[1].data+" ("+B[1].supportingInfo+")";var D;var F;D=A.substr(0,E.length);itemRemainder=A.substr(E.length);return'<div id="ysearchresult"><span style="font-weight: bold;">'+D+"</span>"+itemRemainder+"</div>"},setFocus:function(){HelpTips.disableFindBox();if(this.Elements.findBox.value==this.Elements.findBox.defaultValue){this.Elements.findBox.value="";this.Elements.findBox.setStyle({color:"black"});this.showTooltip()}},setBlur:function(){if(this.Elements.findBox.value==""){this.Elements.findBox.setStyle({color:""});this.Elements.findBox.value=this.Elements.findBox.defaultValue;this.hideTooltip()}},checkForResults:function(B,A,D){var C=A[2];if(C.length==0){this.Elements.tooltip.setStyle({backgroundColor:this.tooltipErrorBgColor,color:"white",borderColor:"#CA1D04"});this.Elements.tooltip.update("Sorry, can't find any info")}else{this.Elements.tooltip.setStyle({backgroundColor:"",color:"",borderColor:""});this.Elements.tooltip.update("Press enter when finished")}},checkInput:function(B,A,C){if(this.Elements.findBox.value==""){this.showTooltip()}this.findBoxDataSource.scriptQueryAppend="method=findbox&sid="+AccountVars.sid+"&pt="+encodeURIComponent($$("#PropertyTypes input").inject([],function(D,E){D.push(E.value);return D}).join(","))},setValue:function(C,B,E){var D=B[2][1];var A=$("locations");this.Elements.findBox.value=this.Elements.findBox.defaultValue;this.Elements.findBox.setStyle({color:""});this.Elements.findBox.blur();this.hideTooltip();switch(D.type){case"Listing":Details.showDetailByProperty({PropertyID:D.supportingData,loadLevel:3});break;case"City":if(!Tabs.isMapActive){Tabs.toggleMap()}if(!Tabs.isSearchActive){Tabs.toggleSearch()}StatusMessage.autoHideNextMessage=false;if(!A.readOnly){A.value="";AutoCompleter.locationItems=[];AutoCompleter.rememberLocationItem(D.data,"City",true);PropertyQuery.cities=D.data;PropertyQuery.communities="";PropertyQuery.tracts="";PropertyQuery.zipCodes=""}CityMarkers.zoomToCity(D.data);break;case"Zip":if(!Tabs.isMapActive){Tabs.toggleMap()}if(!Tabs.isSearchActive){Tabs.toggleSearch()}StatusMessage.autoHideNextMessage=false;if(!A.readOnly){A.value="";AutoCompleter.locationItems=[];PropertyQuery.cities="";PropertyQuery.communities="";PropertyQuery.tracts="";PropertyQuery.zipCodes=""}new Ajax.Request("/Webservice/Statistics.asmx/GetZipBounds",{parameters:"zip="+encodeURIComponent(D.data),onSuccess:this.zoomToZipCallback.bind(this)});break}},zoomToZipCallback:function(B,A){Mapper.setCenter(A.swCorner,A.neCorner)},showTooltip:function(){var A=Position.positionedOffset(this.Elements.findBox);this.Elements.tooltip.update("Press enter when finished");this.Elements.tooltip.setStyle({backgroundColor:"",color:"",borderColor:"",left:A[0]+5+"px",top:(A[1]-this.Elements.tooltip.getHeight()-2)+"px"}).show()},hideTooltip:function(){this.Elements.tooltip.hide()}};var HighlightStatus=function(){var B;var I;var C=false;var E;var J,G;var F;var H;function D(){if(B){return }E=parseInt(H.getStyle("height").replace(/px/,""));Event.observe(window,"scroll",I.scrollWatcher);Event.observe(window,"unload",A);B=true}function A(){H=null}I={show:function(N,K){var M;var L=document.viewport.getScrollOffsets()[1];var O=Beast.FrameCommunicator.GetParentScroll();H=$("highlighted-status-message");D();if(!!K){window.setTimeout(this.hide.bind(this),K)}C=false;if(!!J){window.clearInterval(J)}M=new Fx.Styles(H,{duration:400,transition:Fx.Transitions.quartOut});if(Browser.IE6){H.update("<span>"+N+"</span>").setStyle({display:"block",top:String(L-E+O)+"px"});M.custom({top:[L-E,L+O]})}else{if(Browser.IE7){H.update("<span>"+N+"</span>").setStyle({display:"block"});M.custom({top:[-1*E,0+O]})}else{H.update("<span>"+N+"</span>").setStyle({display:"block",top:String(-1*E)+"px",opacity:"0"});M.custom({top:[-1*E,0+O],opacity:[0,1]})}}J=M.timer;F=true},hide:function(){var L;var K=document.viewport.getScrollOffsets()[1];if(!!J){window.clearInterval(J);J=null}L=new Fx.Styles($("highlighted-status-message"),{duration:400,transition:Fx.Transitions.quartOut});if(Browser.IE6){L.options.onComplete=function(){$("highlighted-status-message").hide()};L.custom({top:[K,K-E]})}else{if(Browser.IE7){L.options.onComplete=function(){$("highlighted-status-message").hide()};L.custom({top:[0,-1*E]})}else{L.custom({top:[0,-1*E],opacity:[1,0]})}}J=L.timer;F=false;H=null},setBeginLoading:function(){if(!!G){return }G=window.setTimeout(function(){this.show("Loading...");C=true;G=null}.bind(this),1000)},setFinishedLoading:function(){if(!!G){window.clearTimeout(G);G=null}if(C){this.hide();C=false}},scrollWatcher:function(){if(!F||(!Beast.FrameCommunicator.HasParent&&!Browser.IE6)){return }var L=document.viewport.getScrollOffsets()[1];var M=Beast.FrameCommunicator.GetParentScroll();var K=$("highlighted-status-message");if(!!this.fxTimer){window.clearInterval(this.fxTimer);this.fxTimer=null}K.setStyle({opacity:"1",top:String(L+M)+"px"})}};return I}();var StatusMessage={isVisible:false,forceShow:false,autoHideNextMessage:true,initialize:function(){this.statusMessage=$("status-message");this.statusMessageWrapper=$("status-message-wrapper");this.showFx=new Fx.Styles(this.statusMessageWrapper,{duration:200,transition:Fx.Transitions.quartOut});var A=$("map");A.appendChild(this.statusMessageWrapper);this.statusMessageWrapper.style.display="block";A.observe("mouseover",this.hide.bindAsEventListener(this));A.observe("mouseout",this.show.bindAsEventListener(this));this.statusMessageWrapper.observe("mouseout",this.show.bindAsEventListener(this));this.statusMessageWrapper.observe("mouseover",this.hide.bindAsEventListener(this,true));Event.observe(window,"unload",StatusMessage.unload.bind(StatusMessage))},unload:function(){this.statusMessageWrapper=null;this.statusMessage=null;this.showFx=null},show:function(B){if(this.isVisible||this.statusMessage.innerHTML==""){return }var A;if(B){this.hideWhenAllowed=false;A=B.relatedTarget||B.toElement;A=$(A)}if(A&&A.up&&A.up("#map")&&A.id!="status-message-wrapper"){return }this.isVisible=true;this.showFx.clearTimer();this.showFx.custom({marginTop:[parseInt(this.statusMessageWrapper.getStyle("margin-top").sub("px","")),23]})},hide:function(C,B){if(!this.isVisible){return }var A;if(C){A=C.relatedTarget||C.fromElement;Element.extend(A)}if(A&&A.up&&A.up("#map")&&A.id!="status-message-wrapper"){return }if(this.forceShow&&!B){this.hideWhenAllowed=true;return }this.isVisible=false;this.showFx.clearTimer();this.showFx.custom({marginTop:[parseInt(this.statusMessageWrapper.getStyle("margin-top").sub("px","")),0]})},setText:function(A){if(!this.statusMessage){return }this.statusMessage.update(A);this.show();if(!this.autoHideNextMessage){autoHideNextMessage=true}else{this.forceShow=true;this.hideWhenAllowed=true;window.clearTimeout(this.hideTimeout);this.hideTimeout=window.setTimeout(function(){this.forceShow=false;if(this.hideWhenAllowed){this.hide()}}.bind(this),3000)}}};document.observe("dom:loaded",Resizr.initialize.bind(Resizr));if(AccountVars.useSlidersByDefault){if((Browser.IE6||Browser.IE7)){Event.observe(window,"load",function(){window.setTimeout(Sliders.initialize.bind(Sliders),1500)})}else{document.observe("dom:loaded",Sliders.initialize.bind(Sliders))}}else{Event.observe(window,"load",SearchBoxes.initialize.bind(SearchBoxes))}document.observe("dom:loaded",ReferralDomains.hideHeaderIfMatch);document.observe("dom:loaded",Mapper.initialize.bind(Mapper));document.observe("dom:loaded",HelpTips.initialize.bind(HelpTips));document.observe("dom:loaded",AutoCompleter.initialize.bind(AutoCompleter));document.observe("dom:loaded",FindBox.initialize.bind(FindBox));document.observe("mapper:loaded",StatusMessage.initialize.bind(StatusMessage));document.observe("mapper:loaded",AreaStatisticPanel.initialize.bind(AreaStatisticPanel));if(Browser.IE6){Event.observe(window,"load",Mapper.initializeStyles)}var Formatters={formatNumber:function(B){var C="";B=String(B);for(var A=B.length-3;A>=0;A-=3){C=","+B.substring(A,A+3)+C}if(B.length%3>0){C=B.substring(0,B.length%3)+C}if(C.charAt(0)==","){C=C.substring(1)}return C},formatLotSize:function(D,C){var A=C?"+ ":"";if(parseInt(D)>43560){var B=String(parseInt(D)/43560);if(B.indexOf(".")==-1){return B+A+".00 acres"}else{if(B.substr(B.indexOf(".")).length==1){return B.substr(0,B.indexOf(".")+2)+A+".0 acres"}else{return B.substr(0,B.indexOf(".")+3)+A+" acres"}}}else{return this.formatNumber(D)+A+" sq ft"}},formatShortPrice:function(A){if(A.length==6){return String(parseInt(A)/1000)+"k"}else{if(A.length>6&&A.substr(A.length-3)=="000"){return String(parseInt(A)/1000000)+"M"}else{return this.formatNumber(A)}}}};var FeaturedProperties={initialize:function(){if(!this.properties||(AccountVars.useSlidersByDefault&&!Sliders.isInitialized)||!Mapper.isInitialized){return }this.properties.each(function(A){if(!Mapper.properties.find(function(B){return(A.PropertyID==B.PropertyID)})){Mapper.mapResult.bind(Mapper,A).defer()}})},show:function(){this.initialize()}};var QueryVars={dispatchEvents:function(){if((AccountVars.useSlidersByDefault&&!Sliders.isInitialized)||!Mapper.isInitialized){return }var B,A;if(LinkConsumer.searchData&&LinkConsumer.searchData.orderColumn){B=LinkConsumer.searchData.orderColumn;A=LinkConsumer.searchData.orderDirection.toUpperCase()}else{if(AccountVars.defaultSort){B=AccountVars.defaultSort.split("_")[0];A=AccountVars.defaultSort.split("_")[1].toUpperCase()}}if(B){PropertyQuery.orderColumn=B;PropertyQuery.orderDirection=A;$A($("ResultSorter").childNodes).each(function(C){if(!C.onclick){return }var D=C.onclick.toString();if(D.indexOf(B)!=-1&&D.indexOf(A)!=-1){$("ResultCurrentSort").innerHTML=C.innerHTML}})}if(AccountVars.packageTypeID==1&&typeof dsHistory.QueryElements.PropertyID!="undefined"&&dsHistory.QueryElements.FromDwellicious=="true"){dsHistory.addFunction(Tabs.toggleDetails.bind(Tabs));Details.showDetailByProperty({PropertyID:dsHistory.QueryElements.PropertyID,loadLevel:3});return }else{if(AccountVars.packageTypeID==1){dsHistory.addFunction(function(){Tabs.toggleSearch();Tabs.toggleMap()});return }}if(typeof dsHistory.QueryElements.MaxLatitude!="undefined"){PropertyQuery.maxLatitude=dsHistory.QueryElements.MaxLatitude;PropertyQuery.maxLongitude=dsHistory.QueryElements.MaxLongitude;PropertyQuery.minLatitude=dsHistory.QueryElements.MinLatitude;PropertyQuery.minLongitude=dsHistory.QueryElements.MinLongitude;Mapper.setCenter([dsHistory.QueryElements.MinLatitude,dsHistory.QueryElements.MinLongitude],[dsHistory.QueryElements.MaxLatitude,dsHistory.QueryElements.MaxLongitude],true);$("cbxConstrainToMap").checked=true}Sliders.showSliderHovers=false;if(typeof dsHistory.QueryElements.MinPrice!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMinPrice").value=dsHistory.QueryElements.MinPrice}else{Sliders.setMinPrice(dsHistory.QueryElements.MinPrice)}}if(typeof dsHistory.QueryElements.MaxPrice!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMaxPrice").value=dsHistory.QueryElements.MaxPrice}else{Sliders.setMaxPrice(dsHistory.QueryElements.MaxPrice)}}if(typeof dsHistory.QueryElements.MinImprovedSqFt!="undefined"&&AccountVars.showImprovedSizes){if(!AccountVars.useSlidersByDefault){$("txtMinHomeSize").value=dsHistory.QueryElements.MinImprovedSqFt}else{Sliders.setMinHomeSize(dsHistory.QueryElements.MinImprovedSqFt)}}if(typeof dsHistory.QueryElements.MinBeds!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMinBeds").value=dsHistory.QueryElements.MinBeds}else{Sliders.setMinBeds(dsHistory.QueryElements.MinBeds)}}if(typeof dsHistory.QueryElements.MinBaths!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMinBaths").value=dsHistory.QueryElements.MinBaths}else{Sliders.setMinBaths(dsHistory.QueryElements.MinBaths)}}if(typeof dsHistory.QueryElements.MinLotSqFt!="undefined"&&AccountVars.showLotSizes){if(!AccountVars.useSlidersByDefault){$("txtMinLotSize").value=dsHistory.QueryElements.MinLotSqFt}else{Sliders.setMinLotSize(dsHistory.QueryElements.MinLotSqFt)}}if(typeof dsHistory.QueryElements.MinDaysOnMarket!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMinDaysOnMarket").value=dsHistory.QueryElements.MinDaysOnMarket}else{Sliders.setMinDaysOnMarket(dsHistory.QueryElements.MinDaysOnMarket)}}if(typeof dsHistory.QueryElements.MinYearBuilt!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMinYearBuilt").value=dsHistory.QueryElements.MinYearBuilt}else{Sliders.setMinYearBuilt(dsHistory.QueryElements.MinYearBuilt)}}if(typeof dsHistory.QueryElements.MaxYearBuilt!="undefined"){if(!AccountVars.useSlidersByDefault){$("txtMaxYearBuilt").value=dsHistory.QueryElements.MaxYearBuilt}else{Sliders.setMaxYearBuilt(dsHistory.QueryElements.MaxYearBuilt)}}Sliders.showSliderHovers=true;if(!!dsHistory.QueryElements.Cities){dsHistory.QueryElements.Cities.gsub(/,,/,"||").split(/,\s*/).each(function(C){AutoCompleter.locationItems.push({name:C.replace(/\|\|/g,","),type:"City"})})}if(!!dsHistory.QueryElements.Communities){dsHistory.QueryElements.Communities.gsub(/,,/,"||").split(/,\s*/).each(function(C){AutoCompleter.locationItems.push({name:C.replace(/\|\|/g,","),type:"Community"})})}if(!!dsHistory.QueryElements.Tracts){dsHistory.QueryElements.Tracts.gsub(/,,/,"||").split(/,\s*/).each(function(C){AutoCompleter.locationItems.push({name:C.replace(/\|\|/g,","),type:"Tract"})})}if(!!dsHistory.QueryElements.ZipCodes){dsHistory.QueryElements.ZipCodes.split(",").each(function(C){AutoCompleter.locationItems.push({name:C,type:"Zip"})})}AutoCompleter.syncTextBoxToLocationItems();if(typeof dsHistory.QueryElements.MlsNumbers!="undefined"){$("mlsNumbers").value=dsHistory.QueryElements.MlsNumbers}if(typeof dsHistory.QueryElements.PropertyTypes!="undefined"){$$("#PropertyTypes input[type=checkbox]").each(function(C){C.checked=false});dsHistory.QueryElements.PropertyTypes.split(",").each(function(C){$("SearchSetupPropertyTypeID_"+C).checked=true})}if(typeof dsHistory.QueryElements.Features!="undefined"){$$("#PropertyFeatures input[type=checkbox]").each(function(C){C.checked=false});dsHistory.QueryElements.Features.split(",").each(function(C){$("SearchSetupFeatureID_"+C).checked=true})}if(this.propertyIdToLoadByDefault!=-1&&typeof dsHistory.QueryElements.PropertyID=="undefined"){dsHistory.setQueryVar("PropertyID",this.propertyIdToLoadByDefault)}if(typeof dsHistory.QueryElements.ShowAdvanced!="undefined"){AdvancedQuery.toggle("search-advanced-link",true)}if(typeof dsHistory.QueryElements.PerformSearch=="undefined"&&typeof dsHistory.QueryElements.PropertyID=="undefined"){dsHistory.addFunction(function(){Tabs.toggleSearch();Tabs.toggleMap()})}else{if(typeof dsHistory.QueryElements.PerformSearch=="undefined"&&typeof dsHistory.QueryElements.PropertyID!="undefined"){dsHistory.addFunction(Tabs.toggleDetails.bind(Tabs))}else{if(typeof dsHistory.QueryElements.PerformSearch!="undefined"&&typeof dsHistory.QueryElements.PropertyID=="undefined"){dsHistory.addFunction(Tabs.toggleResults.bind(Tabs))}else{if(typeof dsHistory.QueryElements.PerformSearch!="undefined"&&typeof dsHistory.QueryElements.PropertyID!="undefined"){dsHistory.addFunction(function(){Tabs.toggleResults();Tabs.toggleDetails()})}}}}if(typeof dsHistory.QueryElements.PerformSearch!="undefined"&&typeof dsHistory.QueryElements.PropertyID=="undefined"){Searcher.submitQuery(true)}else{if(typeof dsHistory.QueryElements.PerformSearch!="undefined"&&typeof dsHistory.QueryElements.PropertyID!="undefined"){PropertyQuery.onSuccess=function(C){Results.load(C);Details.showDetailByProperty({PropertyID:dsHistory.QueryElements.PropertyID,loadLevel:3})};Searcher.submitQuery(true,true)}else{if(typeof dsHistory.QueryElements.PerformSearch=="undefined"&&typeof dsHistory.QueryElements.PropertyID!="undefined"){Details.showDetailByProperty({PropertyID:dsHistory.QueryElements.PropertyID,loadLevel:3})}}}}};var LinkConsumer={initialize:function(){if((AccountVars.useSlidersByDefault&&!Sliders.isInitialized)||!Mapper.isInitialized){return }if(this.searchData){Sliders.showSliderHovers=false;for(key in this.searchData.queryData){var K=this.searchData.queryData[key];if(key=="cities"||key=="community"||key=="tractIdentifier"||key=="zips"){K.split(",").each(function(M){switch(key){case"cities":AutoCompleter.locationItems.push({name:M.strip(),type:"City"});break;case"community":AutoCompleter.locationItems.push({name:M.strip(),type:"Community"});break;case"tractIdentifier":AutoCompleter.locationItems.push({name:M.strip(),type:"Tract"});break;case"zips":AutoCompleter.locationItems.push({name:M.strip(),type:"Zip"});break}});if(LinkConsumer.linkData){var I=$("locations");I.readOnly=true;I.title="The locations are locked for this search";I.style.cursor="default";new YAHOO.widget.Tooltip("locations_Tip",{context:I,showDelay:100});AutoCompleter.unload()}}else{if(key=="mlsNumber"){var D=$("mlsNumbers");D.value=K;if(LinkConsumer.linkData){D.readOnly=true;D.title="The MLS numbers are locked for this search";D.style.cursor="default";new YAHOO.widget.Tooltip("mlsNumbers_Tip",{context:D,showDelay:100})}PropertyQuery.mlsNumbers=K}else{if(key=="propertyTypes"){$$("#PropertyTypes input[type=checkbox]").each(function(M){M.checked=false;M.disabled=true});for(var F=0;F<K.length;F++){$("SearchSetupPropertyTypeID_"+K[F]).checked=true;$("SearchSetupPropertyTypeID_"+K[F]).disabled=false}}else{if(key=="features"){$$("#PropertyFeatures input[type=checkbox]").each(function(M){M.checked=false;M.disabled=false});for(var F=0;F<K.length;F++){$("SearchSetupFeatureID_"+K[F]).checked=true;$("SearchSetupFeatureID_"+K[F]).disabled=true}}else{if(key=="minPrice"&&K>0){if(!AccountVars.useSlidersByDefault){var G=$("txtMinPrice");G.value=K;if(LinkConsumer.linkData){G.title="The minimum price for this search must be at least $"+Formatters.formatNumber(K);new YAHOO.widget.Tooltip("minPrice_Tip",{context:G,showDelay:100})}}else{Sliders.setMinPrice(K);PropertyQuery.minPrice=K}}else{if(key=="maxPrice"&&K>0){if(!AccountVars.useSlidersByDefault&&K!=-1){var C=$("txtMaxPrice");C.value=K;if(LinkConsumer.linkData){C.title="The maximum price for this search must be $"+Formatters.formatNumber(K)+" or less";new YAHOO.widget.Tooltip("minPrice_Tip",{context:C,showDelay:100})}}else{if(K!=-1){Sliders.setMaxPrice(K);PropertyQuery.maxPrice=K}}}else{if(key.toLowerCase()=="minimprovedsqft"&&AccountVars.showImprovedSizes&&K>0){var H=$("txtMinHomeSize");if(!AccountVars.useSlidersByDefault){H.value=K;if(LinkConsumer.linkData){H.title="The minimum home size for this search must be at least "+Formatters.formatNumber(K);new YAHOO.widget.Tooltip("minPrice_Tip",{context:H,showDelay:100})}}else{Sliders.setMinHomeSize(K)}}else{if(key=="minBeds"&&K>0){var J=$("txtMinBeds");if(!AccountVars.useSlidersByDefault){J.value=K;if(LinkConsumer.linkData){J.title="The minimum number of beds for this search must be at least "+String(K);new YAHOO.widget.Tooltip("minPrice_Tip",{context:J,showDelay:100})}}else{Sliders.setMinBeds(K)}}else{if(key=="minBaths"&&K>0){var B=$("txtMinBaths");if(!AccountVars.useSlidersByDefault){B.value=K;if(LinkConsumer.linkData){B.title="The minimum number of baths for this search must be at least "+String(K);new YAHOO.widget.Tooltip("minPrice_Tip",{context:B,showDelay:100})}}else{Sliders.setMinBaths(K)}}else{if(key.toLowerCase()=="minlotqft"&&AccountVars.showLotSizes&&K>0){var L=$("txtMinLotSize");if(!AccountVars.useSlidersByDefault){L.value=K;if(LinkConsumer.linkData){L.title="The minimum lot size for this search must be at least "+Formatters.formatLotSize(K);new YAHOO.widget.Tooltip("minPrice_Tip",{context:L,showDelay:100})}}else{Sliders.setMinLotSize(K)}}else{if(key=="minYearBuilt"&&K>0){if(!AccountVars.useSlidersByDefault){var A=$("txtMinYearBuilt");A.value=K;if(LinkConsumer.linkData){A.title="The minimum year built for this search must be at least "+String(K);new YAHOO.widget.Tooltip("minYearBuilt_Tip",{context:A,showDelay:100})}}else{Sliders.setMinYearBuilt(K)}}else{if(key=="maxYearBuilt"&&K>0){if(!AccountVars.useSlidersByDefault){var E=$("txtMinYearBuilt");E.value=K;if(LinkConsumer.linkData){E.title="The maximum year built for this search must be at least "+String(K);new YAHOO.widget.Tooltip("maxYearBuilt_Tip",{context:E,showDelay:100})}}else{Sliders.setMaxYearBuilt(K)}}else{if(key=="minLatitude"||key=="minLongitude"||key=="maxLatitude"||key=="maxLongitude"){$("cbxConstrainToMap").checked="checked";PropertyQuery[key]=K}}}}}}}}}}}}}}Sliders.showSliderHovers=true;AutoCompleter.syncTextBoxToLocationItems();if((this.linkData&&this.linkData.landingPage==1)||!!dsHistory.QueryElements.PerformSearch){return }if(typeof dsHistory.QueryElements.PropertyID!="undefined"){PropertyQuery.onSuccess=function(M){Results.load(M);Details.showDetailByProperty({PropertyID:dsHistory.QueryElements.PropertyID,loadLevel:3})};Searcher.submitQuery(true,true)}else{Searcher.submitQuery(true)}}}};var LoginManager={initialize:function(){DiverseSolutions.Beast.Authentication.LoginStatus.subscribeStatus(this.updateFavoriteControls);DiverseSolutions.Beast.Authentication.LoginStatus.subscribeStatus(this.updateSyndicationLink)},updateFavoriteControls:function(A){var B=[];Results.properties.each(function(C){if($("ResultsFavoriteStatus_"+C.PropertyID)){B.push(C.PropertyID)}});if(Details.property){B.push(Details.property.PropertyID)}new Ajax.Request("/Webservice/QueryProperties.asmx/RetrieveFavorites",{parameters:"propertyIds="+encodeURIComponent(B.join(",")),onSuccess:this.updateFavoriteControlsCallback.bind(this)})},updateFavoriteControlsCallback:function(C){var A=C.responseJSON;var B=[];A.each(function(F){var D=$("ResultsFavoriteStatus_"+F);var E=$("DetailsFavoriteStatus_"+F);if(favElement){favElement.innerHTML=Favorites.checkedHTML}if(E){E.innerHTML=Favorites.checkedHTML}})},updateSyndicationLink:function(A){Results.initializeRssLink()}};if(AccountVars.useSlidersByDefault){document.observe("sliders:loaded",LinkConsumer.initialize.bind(LinkConsumer));document.observe("sliders:loaded",QueryVars.dispatchEvents.bind(QueryVars));document.observe("sliders:loaded",FeaturedProperties.initialize.bind(FeaturedProperties));document.observe("sliders:loaded",CityMarkers.initialize.bind(CityMarkers))}document.observe("mapper:loaded",LinkConsumer.initialize.bind(LinkConsumer));document.observe("mapper:loaded",QueryVars.dispatchEvents.bind(QueryVars));document.observe("mapper:loaded",FeaturedProperties.initialize.bind(FeaturedProperties));document.observe("mapper:loaded",CityMarkers.initialize.bind(CityMarkers));Event.observe(window,"load",HelpPanel.initialize.bind(HelpPanel));var Searcher={searchCount:0,initialize:function(){var B,A;if(this.isInitialized){return }if(LinkConsumer.searchData&&LinkConsumer.searchData.orderColumn){B=LinkConsumer.searchData.orderColumn;A=LinkConsumer.searchData.orderDirection}else{if(AccountVars.defaultSort){B=AccountVars.defaultSort.split("_")[0];A=AccountVars.defaultSort.split("_")[1].toUpperCase()}}if(A){PropertyQuery.orderColumn=B;PropertyQuery.orderDirection=A;$A($("ResultSorter").childNodes).each(function(C){if(!C.onclick){return }if(C.onclick.toString().indexOf(B)!=-1&&C.onclick.toString().indexOf(A)!=-1){$("ResultCurrentSort").innerHTML=C.innerHTML}})}if(!this.isInitialized){this.isInitialized=true}},submitQuery:function(D,I){if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID&&AccountVars.registrationLevel<=1&&this.searchCount==((typeof AccountVars.allowedSearchesBeforeRegistration=="undefined")?this.searchCount:AccountVars.allowedSearchesBeforeRegistration)){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:Searcher.submitQuery.bind(Searcher,D)},true);return }this.initialize();var C=$("mlsNumbers");var G=$$("#PropertyTypes input[type=checkbox]");var A=$$("#PropertyFeatures input[type=checkbox]");var B=[],H=[];var F;var K=Mapper.getSwCornerBounds();var J=Mapper.getNeCornerBounds();if($("cbxConstrainToMap").checked){if(J[0]!=K[0]){PropertyQuery.maxLatitude=J[0];PropertyQuery.maxLongitude=J[1];PropertyQuery.minLatitude=K[0];PropertyQuery.minLongitude=K[1]}else{PropertyQuery.maxLatitude=PropertyQuery.MapSpecific.maxLatitude;PropertyQuery.maxLongitude=PropertyQuery.MapSpecific.maxLongitude;PropertyQuery.minLatitude=PropertyQuery.MapSpecific.minLatitude;PropertyQuery.minLongitude=PropertyQuery.MapSpecific.minLongitude}}else{PropertyQuery.maxLatitude=-1;PropertyQuery.maxLongitude=-1;PropertyQuery.minLatitude=-1;PropertyQuery.minLongitude=-1}for(var E=0;E<G.length;E++){if(G[E].checked){B.push(G[E].value)}}for(var E=0;E<A.length;E++){if(A[E].checked){H.push(A[E].value)}}if(!Sliders.isEnabled){if(!isNaN(parseInt($("txtMinPrice").value.gsub(",","")))){PropertyQuery.minPrice=$("txtMinPrice").value.gsub(",","")}else{PropertyQuery.minPrice=-1}if(!isNaN(parseInt($("txtMaxPrice").value.gsub(",","")))){PropertyQuery.maxPrice=$("txtMaxPrice").value.gsub(",","")}else{PropertyQuery.maxPrice=-1}if(AccountVars.showImprovedSizes&&!isNaN(parseInt($("txtMinHomeSize").value.gsub(",","")))){PropertyQuery.minImprovedSqFt=$("txtMinHomeSize").value.gsub(",","")}else{PropertyQuery.minImprovedSqFt=-1}if(!isNaN(parseInt($("txtMinBeds").value.gsub(",","")))){PropertyQuery.minBeds=$("txtMinBeds").value.gsub(",","")}else{PropertyQuery.minBeds=-1}if(!isNaN(parseInt($("txtMinBaths").value.gsub(",","")))){PropertyQuery.minBaths=$("txtMinBaths").value.gsub(",","")}else{PropertyQuery.minBaths=-1}if(AccountVars.showLotSizes&&!isNaN(parseInt($("txtMinLotSize").value.gsub(",","")))){PropertyQuery.minLotSqFt=parseInt($("txtMinLotSize").value.gsub(",",""),10)*(AccountVars.useAcresInsteadOfSqFt?43560:1)}else{PropertyQuery.minLotSqFt=-1}if(!isNaN(parseInt($("txtMinDaysOnMarket").value.gsub(",","")))){PropertyQuery.minDaysOnMarket=$("txtMinDaysOnMarket").value.gsub(",","")}else{PropertyQuery.minDaysOnMarket=-1}if(!isNaN(parseInt($("txtMinYearBuilt").value.gsub(",","")))){PropertyQuery.minYearBuilt=$("txtMinYearBuilt").value.gsub(",","")}else{PropertyQuery.minYearBuilt=-1}if(!isNaN(parseInt($("txtMaxYearBuilt").value.gsub(",","")))){PropertyQuery.maxYearBuilt=$("txtMaxYearBuilt").value.gsub(",","")}else{PropertyQuery.maxYearBuilt=-1}}PropertyQuery.cities=AutoCompleter.getCities();PropertyQuery.tracts=AutoCompleter.getTracts();PropertyQuery.communities=AutoCompleter.getCommunities();PropertyQuery.zipCodes=AutoCompleter.getZips();PropertyQuery.mlsNumbers=C.value.replace(/, *$/,"");PropertyQuery.propertyTypes=B.join(",");PropertyQuery.propertyFeatures=H.join(",");if(!D){if(PropertyQuery.maxLatitude!=-1){dsHistory.setQueryVar("MaxLatitude",PropertyQuery.maxLatitude);dsHistory.setQueryVar("MaxLongitude",PropertyQuery.maxLongitude);dsHistory.setQueryVar("MinLatitude",PropertyQuery.minLatitude);dsHistory.setQueryVar("MinLongitude",PropertyQuery.minLongitude)}else{dsHistory.removeQueryVar("MaxLatitude");dsHistory.removeQueryVar("MaxLongitude");dsHistory.removeQueryVar("MinLatitude");dsHistory.removeQueryVar("MinLongitude")}if(PropertyQuery.minPrice>0){dsHistory.setQueryVar("MinPrice",PropertyQuery.minPrice)}else{dsHistory.removeQueryVar("MinPrice")}if(PropertyQuery.maxPrice>0){dsHistory.setQueryVar("MaxPrice",PropertyQuery.maxPrice)}else{dsHistory.removeQueryVar("MaxPrice")}if(PropertyQuery.minImprovedSqFt>0){dsHistory.setQueryVar("MinImprovedSqFt",PropertyQuery.minImprovedSqFt)}else{dsHistory.removeQueryVar("MinImprovedSqFt")}if(PropertyQuery.minBeds>0){dsHistory.setQueryVar("MinBeds",PropertyQuery.minBeds)}else{dsHistory.removeQueryVar("MinBeds")}if(PropertyQuery.minBaths>0){dsHistory.setQueryVar("MinBaths",PropertyQuery.minBaths)}else{dsHistory.removeQueryVar("MinBaths")}if(PropertyQuery.minLotSqFt>0){dsHistory.setQueryVar("MinLotSqFt",PropertyQuery.minLotSqFt)}else{dsHistory.removeQueryVar("MinLotSqFt")}if(PropertyQuery.minDaysOnMarket>0){dsHistory.setQueryVar("MinDaysOnMarket",PropertyQuery.minDaysOnMarket)}else{dsHistory.removeQueryVar("MinDaysOnMarket")}if(PropertyQuery.minYearBuilt>0){dsHistory.setQueryVar("MinYearBuilt",PropertyQuery.minYearBuilt)}else{dsHistory.removeQueryVar("MinYearBuilt")}if(PropertyQuery.maxYearBuilt>0){dsHistory.setQueryVar("MaxYearBuilt",PropertyQuery.maxYearBuilt)}else{dsHistory.removeQueryVar("MaxYearBuilt")}if(!PropertyQuery.cities.blank()){dsHistory.setQueryVar("Cities",PropertyQuery.cities)}else{dsHistory.removeQueryVar("Cities")}if(!PropertyQuery.communities.blank()){dsHistory.setQueryVar("Communities",PropertyQuery.communities)}else{dsHistory.removeQueryVar("Communities")}if(!PropertyQuery.tracts.blank()){dsHistory.setQueryVar("Tracts",PropertyQuery.tracts)}else{dsHistory.removeQueryVar("Tracts")}if(!PropertyQuery.zipCodes.blank()){dsHistory.setQueryVar("ZipCodes",PropertyQuery.zipCodes)}else{dsHistory.removeQueryVar("ZipCodes")}if(C.value!=""){dsHistory.setQueryVar("MlsNumbers",PropertyQuery.mlsNumbers)}else{dsHistory.removeQueryVar("MlsNumbers")}if(B.length>0){dsHistory.setQueryVar("PropertyTypes",B.join(","))}else{dsHistory.removeQueryVar("PropertyTypes")}if(H.length>0){dsHistory.setQueryVar("Features",H.join(","))}else{dsHistory.removeQueryVar("Features")}dsHistory.setQueryVar("PerformSearch");dsHistory.bindQueryVars(function(){Tabs.toggleResults();Tabs.toggleMap()})}else{dsHistory.addFunction(function(){Tabs.toggleResults();Tabs.toggleMap()})}HelpTips.disableRefineSearch();if(!I){PropertyQuery.onSuccess=Results.load.bind(Results)}PropertyQuery.resultPage=1;PropertyQuery.onlyFavorites=false;HighlightStatus.setBeginLoading();Scroller.toBodyContent();Mapper.stopLazyLoading();PropertyQuery.sendRequest();this.searchCount++;Analytics.trackPageview("/Default/PropertySearch");Analytics.trackPageviewForClient("/IDX/Search")}};var Results=function(){var B;var J;var I=[];var C="http://"+ConfigVars.assetsHost+"/images/Beast/NoPhotoAvailable.gif";var K=0;function H(N){var M=[];var L=[];var O;var P=new YAHOO.util.ImageLoader.group(null,null);N.each(function(b){var a;var S,X,W,U,Z;var R,Q,T;var V,Y;a=new Element("div",{id:"Property_"+b.PropertyID,"class":"result-item"});if(b.IsFavorite){a.addClassName("result-item-favorite")}else{if(b.IsFeatured){a.addClassName("result-item-featured")}else{a.addClassName("result-item-normal")}}S=b.Address.empty()?b.City:b.Address+", "+b.City;a.appendChild(new Element("div",{title:S,"class":"address title-item"}).update(S));X="$"+(!!b.BottomRangePrice?Formatters.formatShortPrice(b.BottomRangePrice)+" - "+Formatters.formatShortPrice(b.Price)+" V*":Formatters.formatNumber(b.Price));a.appendChild(new Element("div",{title:X,"class":"price title-item"}).update(X));R=a.appendChild(new Element("div",{"class":"additional-data"}));W=String(b.Beds)+(b.Beds==1?" bed, ":" beds, ")+Global.FormatBaths(b.Baths).toLowerCase();R.appendChild(new Element("div",{"class":"beds-baths"}).update(W));U="Size: "+(AccountVars.showImprovedSizes&&b.ImprovedSqFt>0?Formatters.formatNumber(b.ImprovedSqFt)+" sq ft":"n/a");R.appendChild(new Element("div",{"class":"improved-size"}).update(U));Z="Lot size: "+(AccountVars.showLotSizes&&b.LotSqFt>0?Formatters.formatLotSize(b.LotSqFt):"n/a");R.appendChild(new Element("div",{"class":"lot-size"}).update(Z));if(AccountVars.packageTypeID!=1){T=a.appendChild(new Element("div",{id:"ResultsFavoriteStatus_"+b.PropertyID,"class":"favorite-status"}).update(b.IsFavorite?Favorites.checkedHTML:Favorites.uncheckedHTML));L.push({node:T,handler:"click",fireEvent:Favorites.toggle.bind(Favorites,b.PropertyID)})}else{a.insert({bottom:'<div class="favorite-status">&nbsp;</div>'})}if(AccountVars.showListingInfoInMapPreview&&!!b.ListingAgentOffice){a.appendChild(new Element("div",{"class":"listing-info",title:"Listed with "+b.ListingAgentOffice}).update("Listed with "+b.ListingAgentOffice))}if(!!AccountVars.summaryDiscretionaryField1&&!b.SummaryDiscretionaryField1.blank()){a.appendChild(new Element("div",{"class":"summary-discretionary-field1",title:b.SummaryDiscretionaryField1}).update(b.SummaryDiscretionaryField1))}if(!!b.AwsPhotoDomain&&b.PhotoCount>0){V="http://#{AwsPhotoDomain}/#{FeedID}/#{MlsNumber}/0-thumb.jpg".interpolate({AwsPhotoDomain:b.AwsPhotoDomain,FeedID:b.FeedID,MlsNumber:b.MlsNumber.toLowerCase()})}else{if(b.PhotoCount>0){V="/photos/"+b.FeedID+"/"+b.MlsNumber+"/0/thumb.aspx"}else{V=C}}if(Browser.IE6){a.insert({bottom:'<div class="photo"><div style="float: right; border: 1px solid white;"><div id="property-'+String(b.PropertyID)+'-main-photo" style="height: 75px; visibility: hidden;"></div></div></div>'});Y=P.registerPngBgImage("property-"+String(b.PropertyID)+"-main-photo",V,{sizingMethod:"image"})}else{a.insert({bottom:'<div class="photo"><img class="Photo" height="75" id="property-'+String(b.PropertyID)+'-main-photo" style="visibility: hidden;" /></div>'});Y=P.registerSrcImage("property-"+String(b.PropertyID)+"-main-photo",V)}Y.setVisible=true;if(!!b.IconPath){Q=a.appendChild(new Element("div",{"class":"feed-icon"}));if(!Browser.IE6){Q.setStyle({backgroundImage:"url(http://"+ConfigVars.idxAssetsHost+"/MlsIcons/"+b.IconPath+")"})}else{Q.setStyle({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://"+ConfigVars.idxAssetsHost+"/MlsIcons/"+b.IconPath+"',sizingMethod='image')"})}}if(b.Latitude==-1){a.insert({bottom:'<div class="unmappable"></div>'})}L.push({node:a.id,handler:"click",fireEvent:Details.showDetailByProperty.bind(Details,b)});L.push({node:a.id,handler:"click",fireEvent:Results.mouseOut.bindAsEventListener(Results,b)});L.push({node:a.id,handler:"mouseover",fireEvent:Results.mouseOver.bindAsEventListener(Results,b)});L.push({node:a.id,handler:"mouseout",fireEvent:Results.mouseOut.bindAsEventListener(Results,b)});if(AccountVars.showListingInfoInMapPreview||!Object.isUndefined(AccountVars.summaryDiscretionaryField1)){if(K==0){K=parseInt($("result-item-dummy").getStyle("height").sub("px",""))}O=K;O+=AccountVars.showListingInfoInMapPreview?15:0;O+=!Object.isUndefined(AccountVars.summaryDiscretionaryField1)?15:0;a.setStyle({height:String(O)+"px"})}M.push(a)});this.imageLoaderGroups.push(P);if(!!M[0].outerHTML){$("ResultData").insert({bottom:M.pluck("outerHTML").join("")})}else{M.each(function(Q){$("ResultData").appendChild(Q)})}L.each(function(Q){$(Q.node).observe(Q.handler,Q.fireEvent)});I=I.concat(L)}function D(){if(B){return }var M=parseInt($("ResultData").getStyle("height").sub("px",""));var L=new Image();var N=new Image();L.src="http://"+ConfigVars.assetsHost+"/images/newicons/accept.png";N.src="http://"+ConfigVars.assetsHost+"/images/newicons/delete.png";if(AccountVars.showListingInfoInMapPreview){M+=15*5}if(typeof AccountVars.summaryDiscretionaryField1!="undefined"&&!AccountVars.summaryDiscretionaryField1.blank()){M+=15*5}$("ResultData").setStyle({height:String(M)+"px"});if(AccountVars.packageTypeID==1){$$("#ResultsPanel .save-search-link,#ResultsPanel .subscribe-to-rss-link").invoke("hide")}Event.observe(window,"unload",A.bind(this));B=true}function E(M,N,O){var L=DiverseSolutions.Beast.Syndication;PropertyQuery.resultsPage=M;PropertyQuery.onSuccess=N;J.invoke("writeAttribute",{href:L.GetSyndicationURL(O.savedSearchID)});L.UpdateAutoDiscovery(O.savedSearchID)}function G(){I.each(function(L){$(L.node).stopObserving(L.handler,L.fireEvent)});I=[];this.imageLoaderGroups=[];$("ResultData").update()}function F(M){var L;M.results.each(function(N){N.loadLevel=2});this.properties=this.properties.concat(M.results);L=M.results.clone();while(L.length>0){if(Browser.WebKit){H.call(this,L.splice(0,5))}else{H.bind(this,L.splice(0,5)).defer()}}this.loading=false;if(this.properties.length%ConfigVars.resultChunkCacheSize!=0&&this.properties.length<this.totalCount){this.tryLazyLoad()}else{ResultPager.updateStatus()}}function A(){J=null}Object.extend(EventListeners,{"#ResultSorter li:mouseover":function(L){L.style.fontWeight="bold"},"#ResultSorter li:mouseout":function(L){L.style.fontWeight=""}});return{properties:[],imageLoaderGroups:[],totalCount:null,loading:false,load:function(N){var M;HighlightStatus.setFinishedLoading();if(!N.totalCount){window.location.reload()}else{if(N.totalCount==0){StatusMessage.setText("");StatusMessage.hide();HighlightStatus.show("No results were found. Please try a different search.",3000);Mapper.prepareMapForResults(false);return }}D.call(this);StatusMessage.autoHideNextMessage=false;Mapper.cancelBubble=true;Tabs.toggleMap();Tabs.toggleResults();if(AccountVars.packageTypeID==2&&Searcher.searchCount>=3){HelpTips.showSaveSearch()}if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID&&AccountVars.packageTypeID==2&&Searcher.searchCount+Details.cachedProperties.length>=8){HelpTips.showRegisterToday()}HelpTips.showSortResults();N.results.each(function(O){O.loadLevel=2});this.totalCount=N.totalCount;this.totalReturned=N.totalReturned;this.properties=N.results;if(AccountVars.packageTypeID==2){var L=DiverseSolutions.Beast.Syndication;if(!J){J=$$("#ResultsPanel .subscribe-to-rss-link")}if(N.savedSearchID){J.invoke("writeAttribute",{href:L.GetSyndicationURL(N.savedSearchID)});L.UpdateAutoDiscovery(N.savedSearchID)}else{if(LinkConsumer&&LinkConsumer.searchData){J.invoke("writeAttribute",{href:L.GetSyndicationURL(LinkConsumer.searchData.id)});L.UpdateAutoDiscovery(LinkConsumer.searchData.id)}else{J.invoke("writeAttribute",{href:"javascript:Results.initializeRssLink()"})}}}G.call(this);M=this.properties.clone();while(M.length>0){if(M.length!=this.properties.length){H.bind(this,M.splice(0,5)).defer();(function(){if(!!this.imageLoaderGroups[1]&&!this.imageLoaderGroups[1]._fetched){this.imageLoaderGroups[1].fetch();this.imageLoaderGroups[1]._fetched=true}}).bind(this).defer()}else{H.call(this,M.splice(0,5));this.imageLoaderGroups[0].fetch.bind(this.imageLoaderGroups[0]).defer()}}this.tryLazyLoad.bind(this).defer();if(!Browser.IE6){ResultSorter.initialize()}else{ResultSorter.initialize.bind(ResultSorter).defer()}ResultPager.reset();Mapper.cancelBubble=false;if(PropertyQuery.maxLatitude==-1&&!Object.isUndefined(N.swCorner)&&Mapper.getBoundsZoom(N.swCorner,N.neCorner)>=9){Mapper.setCenter(N.swCorner,N.neCorner)}else{Mapper.plotAvailableProperties()}},mouseOut:function(N,R){var Q=$("Property_"+R.PropertyID);var P,L,O;var M;if(!N){Q.removeClassName("result-item-over");return }else{M=$(N.relatedTarget||N.toElement);if(M&&(M.id==Q.id||M.up("#Property_"+R.PropertyID))){return }}Q.removeClassName("result-item-over");if(!Tabs.isDetailsActive){Mapper.properties.each(function(S){if(S.PropertyID==R.PropertyID){if(!R.highlightMarkers){Mapper.hidePropertyPreview(S)}P=true;throw $break}})}if(R.highlightMarkers){R.highlightMarkers.each(function(S){Mapper.removeMarker(R.PropertyID,S)});R.highlightMarkers=[];delete R.marker;Mapper.hidePropertyPreview(null,true)}},mouseOver:function(N,R){var Q=$("Property_"+R.PropertyID);var P,L,O;var M;if(!N){Q.addClassName("result-item-over");return }else{M=$(N.relatedTarget||N.fromElement);if(M&&(M.id==Q.id||M.up("#Property_"+R.PropertyID))){return }}Q.addClassName("result-item-over");if(!Tabs.isDetailsActive){Mapper.properties.each(function(S){if(S.PropertyID==R.PropertyID){Mapper.showPropertyPreview(S,true);P=true;throw $break}});if(!P){L=Mapper.getSwCornerBounds();O=Mapper.getNeCornerBounds();if(R.Latitude<L[0]||R.Latitude>O[0]||R.Longitude<L[1]||R.Longitude>O[1]){return }if(!R.highlightMarkers){R.highlightMarkers=[]}R.highlightMarkers.push(Mapper.mapResult(R,true));Mapper.showPropertyPreview(R,true)}}},toggleSaveSearch:function(N){if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:Results.toggleSaveSearch.bind(Results,N)},true);return }var M=$("SavedSearchNameContainer");var L=new Fx.Styles(M,{transition:Fx.Transitions.quadOut,duration:300});var O=$(N).cumulativeOffset();if(M.parentNode!=document.body){document.body.appendChild(M)}M.setStyle({left:String(O[0]-6)+"px",top:String(O[1]+21)+"px"});if(M.offsetHeight==0){L.custom({height:[0,M.scrollHeight],opacity:[0,1]})}else{L.custom({height:[M.scrollHeight,0],opacity:[1,0]})}},tryLazyLoad:function(L){if(this.properties.length==this.totalCount||this.loading||(this.properties.length%ConfigVars.resultChunkCacheSize==0&&!L)){return }this.loading=true;PropertyQuery.onSuccess=F.bind(this);PropertyQuery.resultPage++;PropertyQuery.sendRequest()},saveSearch:function(M){var L=$("SavedSearchName");this.toggleSaveSearch(M);if(L.value==""){return }new Ajax.Request("/Webservice/QueryProperties.asmx/SaveSearch",{parameters:"searchName="+encodeURIComponent(L.value)})},initializeRssLink:function(){if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:Results.initializeRssLink.bind(Results)},true)}var L=PropertyQuery.resultsPage;var M=PropertyQuery.onSuccess;PropertyQuery.resultPage=1;PropertyQuery.onSuccess=E.curry(L,M);PropertyQuery.sendRequest()}}}();var ResultPager={currentPosition:0,resultsPerPage:5,itemTopMargin:5,initialize:function(){this.reset();Event.observe(window,"unload",this.unload.bind(this))},reset:function(){var A=$("ResultData");A.scrollTop=0;this.currentPosition=0;this.pagerScrollFx=new Fx.Scroll(A,{duration:250,transition:Fx.Transitions.expoOut});if(Results.properties.length<=this.resultsPerPage){this.disableNext()}else{this.enableNext()}},updateStatus:function(){if(Results.properties.length<=this.resultsPerPage){this.disableNext()}else{this.enableNext()}if(this.currentPosition==0){this.disablePrevious()}else{this.enablePrevious()}this.awaitingLoad=false},unload:function(){this.pagerScrollFx=null},disablePrevious:function(){},disableNext:function(){},enablePrevious:function(){},enableNext:function(){},pageNext:function(){var A;if(this.pagerScrollFx.timer!=null){return }if(this.currentPosition+this.resultsPerPage<Results.totalReturned&&!Results.loading){if(this.currentPosition==0){this.enablePrevious()}A=$("Property_"+String(Results.properties[this.currentPosition+this.resultsPerPage].PropertyID));this.currentPosition+=this.resultsPerPage;this.pagerScrollFx.options.onComplete=function(){var B=this.currentPosition/this.resultsPerPage;Results.imageLoaderGroups[B].fetch.bind(Results.imageLoaderGroups[B]);if(!!Results.imageLoaderGroups[B+1]){Results.imageLoaderGroups[B+1].fetch.bind(Results.imageLoaderGroups[B+1]).delay(1)}}.bind(this);this.pagerScrollFx.custom(this.pagerScrollFx.element.scrollTop,A.offsetTop-this.itemTopMargin);if(this.currentPosition+(this.resultsPerPage*2)>=Results.properties.length&&!this.awaitingLoad){this.awaitingLoad=true;Results.tryLazyLoad.bind(Results,true).defer()}}else{if(this.awaitingLoad){if(!this.queuedNextPage){this.queuedNextPage=true;HighlightStatus.setBeginLoading();this.pageNextCallback.bind(this).defer()}}}if(this.currentPosition+this.resultsPerPage>=Results.totalReturnedProperties){this.disableNext();return }},pageNextCallback:function(){if(Results.loading){arguments.callee.bind(this).defer()}else{HighlightStatus.setFinishedLoading();this.awaitingLoad=false;this.queuedNextPage=false;this.pageNext()}},pagePrevious:function(){var A;if(this.currentPosition==0||this.pagerScrollFx.timer!=null){return }if((this.currentPosition-this.resultsPerPage)<=0){A=$("Property_"+String(Results.properties[0].PropertyID));this.currentPosition=0;this.disablePrevious()}else{A=$("Property_"+String(Results.properties[this.currentPosition-this.resultsPerPage].PropertyID));this.currentPosition-=this.resultsPerPage;this.enableNext()}this.pagerScrollFx.custom(this.pagerScrollFx.element.scrollTop,A.offsetTop-this.itemTopMargin)}};document.observe("dom:loaded",ResultPager.initialize.bind(ResultPager));var ResultSorter={isOpen:false,initialize:function(){if(this.isInitialized){return }var A=$("ResultCurrentSort");var C=A.cumulativeOffset();var B=$("ResultSorter");this.showFx=new Fx.Styles(B,{transition:Fx.Transitions.expoOut,duration:200});this.finalHeight=B.offsetHeight;B.cleanWhitespace();document.body.appendChild(B);B.setStyle({height:"0px",visibility:"visible",left:String(C[0]-(Browser.IE6?11:0))+"px",top:String(C[1]+A.offsetHeight+1)+"px"});Event.observe(window,"unload",this.unload.bind(this));this.isInitialized=true},reset:function(){if(!this.isInitialized){return }this.isOpen=false},unload:function(){this.showFx=null},toggle:function(){if(this.isOpen){this.isOpen=false;this.showFx.custom({height:[this.finalHeight,0],opacity:[0.94,0]})}else{this.isOpen=true;this.showFx.custom({height:[0,this.finalHeight],opacity:[0,0.94]})}HelpTips.disableSortResults()},reorder:function(A,C,B){if(!this.isOpen){this.toggle();return }this.toggle();if(PropertyQuery.orderColumn==A&&PropertyQuery.orderDirection==C){return }$("ResultCurrentSort").innerHTML=B.innerHTML;this.showFx.options.onComplete=function(){HighlightStatus.setBeginLoading();Mapper.stopLazyLoading();PropertyQuery.onSuccess=Results.load.bind(Results);PropertyQuery.resultPage=1;PropertyQuery.orderColumn=A;PropertyQuery.orderDirection=C;PropertyQuery.sendRequest()}}};var Details={cachedProperties:[],unload:function(){this.cachedProperties=null;this.property=null;this.topScroll=null},showDetailByProperty:function(D,E){if(E&&E.target){var C=$(E.target);if(C.hasClassName("favorite-status-link")||C.hasClassName("UncheckedFavorite")||C.hasClassName("CheckedFavorite")){if((Browser.IE6||Browser.IE7)){Favorites.toggle(D.PropertyID)}return }Results.mouseOut(null,D)}if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID&&AccountVars.registrationLevel<=2&&this.cachedProperties.length==((typeof AccountVars.allowedDetailViewsBeforeRegistration=="undefined")?this.cachedProperties.length:AccountVars.allowedDetailViewsBeforeRegistration)){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:Details.showDetailByProperty.bind(Details,D)},true);return }var B=this.cachedProperties.find(function(F){return(F.PropertyID==D.PropertyID)});var A;if(this.property&&D.PropertyID==this.property.PropertyID){Tabs.toggleDetails();return }if(B){this.property=B;this.showDetail(null,E===true);return }HighlightStatus.setBeginLoading();this.property=D;new Ajax.Request("/Webservice/QueryProperty.asmx/LoadProperty",{parameters:"propertyID="+this.property.PropertyID+"&loadLevel="+this.property.loadLevel,onSuccess:this.showDetail.bind(this)})},showDetail:function(C,B){HighlightStatus.setFinishedLoading();if(C){var A=C.responseJSON;if(!A){return }this.property=Object.extend(this.property,A);this.cachedProperties.push(this.property)}HighlightStatus.setFinishedLoading();Mapper.changeIconIfMapped(this.property,Mapper.IconStatuses.active);Tabs.toggleDetails();Mapper.hidePropertyPreview(null,true);Panels.DetailResizer.resize();if(Browser.IE6&&!this.actionWrapperInitialized){$("detail-panel-action-wrapper").setStyle({backgroundImage:"url(/DynamicImages/MapControl-Background.aspx?fill="+DynamicColors["Map control top shade"]+"&overlay="+DynamicColors["Map control bottom shade"]+")"});this.actionWrapperInitialized=true}if(!B){dsHistory.setQueryVar("PropertyID",this.property.PropertyID);dsHistory.bindQueryVars(this.showDetailByProperty.bind(this,{PropertyID:this.property.PropertyID},true))}if(this.property.Latitude==-1){$("maps-module-controller").hide()}else{$("maps-module-controller").show()}ModuleController.checkResize();setTimeout(Scroller.toBodyContent.bind(Scroller),300);Panels.loadedPanels.each(function(D){if(D=="Panels.SmallMap"||D=="Panels.VirtualEarth"||D=="Panels.Zillow"||D=="Panels.StreetView"){return }D.evalJSON().initialize(this.property)}.bind(this));ModuleController.reset();if(AccountVars.packageTypeID==2&&this.cachedProperties.length>=3){HelpTips.showFavoriteMe()}if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID&&AccountVars.packageTypeID==2&&Searcher.searchCount+Details.cachedProperties.length>=8){HelpTips.showRegisterToday()}Analytics.trackPageview("/Default/PropertyDetails");Analytics.trackPageviewForClient("/IDX/View Property Details")}};var ModuleController=function(){var B,F="module-details-panel",E="module-ie-stretcher";var G=false;var D=false;function A(){if(G){return }if(Browser.IE6){$("module-controller-item-container").setStyle({backgroundImage:"url(/DynamicImages/ModuleTabBackground.aspx?background="+DynamicColors["Panel background"]+"&fill="+DynamicColors["Interior panel background"]+"&border="+DynamicColors["Interior panel border"]+"&overlay=FFFFFF)"})}highlighter=$("module-controller-highlighter");highlighter.fx=new Fx.Style(highlighter,"left",{transition:Fx.Transitions.quartOut,duration:200});G=true;Event.observe(window,"unload",C)}function C(){highlighter=null;E=null}return{reset:function(){this.switchTo($("module-controller-detail-item"),true);highlighter.fx.set(0)},switchTo:function(K,J){if(D){return }D=true;A();var I=$(K).previous(".module-controller-item-separator");var H=function(){F=$("module-"+K.innerHTML.toLowerCase()+"-panel");E=(Browser.IE6||Browser.IE7)?$(E):null;$$("#DetailsPanel .module-container").invoke("hide");F.show();this.checkResize();if(F.id=="module-maps-panel"){Panels.SmallMap.initialize();if(Panels.loadedPanels.include("Panels.VirtualEarth")){Panels.VirtualEarth.initialize(Details.property)}if(Panels.loadedPanels.include("Panels.StreetView")){Panels.StreetView.initialize(Details.property)}}else{if(F.id=="module-tools-panel"){if(Panels.loadedPanels.include("Panels.Zillow")){Panels.Zillow.initialize(Details.property)}}}D=false}.bind(this);if(!J){highlighter.fx.options.onComplete=H;highlighter.fx.custom(parseInt(highlighter.getStyle("left").replace("px","")),K.offsetLeft)}else{H()}$$("#module-controller-item-container .module-controller-item-separator").invoke("setStyle",{borderRightColor:"",borderRightWidth:"",marginRight:""});if(I&&!Browser.IE6){I.setStyle({borderRightColor:"transparent"})}else{if(I&&Browser.IE6){I.setStyle({borderRightWidth:"0px",marginRight:"1px"})}}},checkResize:function(){if(!(Browser.IE6||Browser.IE7)||!Tabs.isDetailsActive){return }F=$(F);E=$(E);F.setStyle({width:($("DetailsPanel").offsetWidth-60)+"px",height:"","overflow-y":"hidden"});E.setStyle({height:F.offsetHeight+"px"})}}}();var Favorites={checkedHTML:'<a href="javascript:void(0);" class="favorite-status-link"><div class="CheckedFavorite"></div>Remove favorite</a>',uncheckedHTML:'<a href="javascript:void(0);" class="favorite-status-link"><div class="UncheckedFavorite"></div>Add as favorite</a>',toggle:function(E){if(!DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){DiverseSolutions.Beast.Authentication.NewUserDialog.show({success:Favorites.toggle.bind(Favorites,E)},true);return }var B=$("ResultsFavoriteStatus_"+E);var D=$("DetailsFavoriteStatus_"+E);var C,A;Results.properties.each(function(F){if(F.PropertyID==E){F.IsFavorite=true;throw $break}});new Ajax.Request("/Webservice/profile.asmx/ToggleFavorite",{parameters:"propertyID="+E});if(B){if(B.down().down().hasClassName("UncheckedFavorite")){C=false}else{C=true}}else{if(D.down().down().hasClassName("UncheckedFavorite")){C=false}else{C=true}}Mapper.properties.each(function(F){if(F.PropertyID==E){F.IsFavorite=!C;Mapper.changeIconIfMapped(F);throw $break}});A=(C)?this.uncheckedHTML:this.checkedHTML;if(B){B.update(A)}if(D){D.update(A)}},showAll:function(){if(!Tabs.isMapActive){Tabs.toggleMap()}PropertyQuery.onlyFavorites=true;PropertyQuery.onSuccess=function(A){Results.load(A);$$("#ResultsPanel .save-search-link").style.visibility="hidden"};PropertyQuery.resultPage=1;HighlightStatus.setBeginLoading();Scroller.toBodyContent();Mapper.stopLazyLoading();PropertyQuery.sendRequest()}};
Mapper.Proprietary=function(){var S;var N;var L,Q;var P,M,C,G;var R,D;var K,T,H;var B;var F=function(){L=new GOverviewMapControl();S.addControl(L);S.enableDragging();S.enableDoubleClickZoom();GEvent.addListener(S,"movestart",Mapper.stopLazyLoading.bind(Mapper));GEvent.addListener(S,"moveend",Mapper.plotAvailableProperties.bind(Mapper));GEvent.addListener(S,"zoomend",Mapper.handleZoomEvent.bind(Mapper))}.bind(Mapper);var O=function(){P=new GIcon();P.image=this.Icons.normalOut;P.shadow="http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_shadow.png";P.iconSize=new GSize(21,28);P.shadowSize=new GSize(35,28);P.iconAnchor=new GPoint(10,28);M=new GIcon();M.image=this.Icons.favorite;M.shadow="http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_favorite_shadow.png";M.iconSize=new GSize(27,25);M.shadowSize=new GSize(40,26);M.iconAnchor=new GPoint(13,13);C=new GIcon();C.image=this.Icons.city;C.iconSize=new GSize(27,20);C.iconAnchor=new GPoint(13,7);if(AccountVars.showSoldProperties){G=new GIcon();G.image=this.Icons.sold;G.shadow="http://"+ConfigVars.assetsHost+"/images/Beast/Markers-2/house_map_marker_shadow.png";G.iconSize=new GSize(21,28);G.shadowSize=new GSize(35,28);G.iconAnchor=new GPoint(10,28)}}.bind(Mapper);var I=function(U){try{if(this.markerFnc){return this.markerFnc(U)}if(!this.markerFnc){$H(U).each(function(W){if(W[1]&&W[1].nodeType&&W[1].nodeType==1){this.markerFnc=function(X){return $(X[W[0]])};throw $break}}.bind(this))}if(this.markerFnc){return this.markerFnc(U)}if(window.console&&!this.markerFnc){console.log("marker key not found, trying fallback method")}if(!this.markerFnc){$H(U).each(function(W){if(W[1]&&W[1].length&&W[1].length==2&&W[1][0]&&W[1][0].nodeType==1&&W[1][1]&&W[1][1].nodeType==1){this.markerFnc=function(X){return $(X[W[0]][1])};throw $break}}.bind(this))}if(this.markerFnc){return this.markerFnc(U)}}catch(V){}}.bind(Mapper);var J=function(a,c,V,Y,W){c=I(c);if(c==null){return }var h=this.mapContainer.getDimensions();var f=Position.cumulativeOffset(this.mapContainer);var b=Position.cumulativeOffset(c);var U=c.getDimensions();var i;var d=[];var e={};var g,X;var Z;if(a.parentNode!=document.body){}document.body.appendChild(a);a.setStyle({display:"block",top:"0px",left:"0px",visibility:"hidden"});if(a._rightShadow){a._rightShadow.hide()}if(a._bottomShadow){a._bottomShadow.hide()}i={width:a.clientWidth+2,height:a.clientHeight};if(i.width<W){i.width=W}if((Browser.IE6||Browser.IE7)){b[0]-=5}X=a.id.substr(0,a.id.indexOf("-"));if(b[0]+U.width+i.width+V[0]<h.width+f[0]||b[0]-i.width-V[0]>f[0]){if(b[0]+U.width+i.width+V[0]<h.width+f[0]){e.left=String(b[0]+V[0]+U.width)+"px";d[0]="l"}else{e.left=String(b[0]-i.width-V[0])+"px";d[0]="r"}if(b[1]+V[1]+i.height>=f[1]+h.height){e.top=String(f[1]+h.height-i.height-6)+"px";d[1]="b"}else{e.top=String(b[1]+V[1])+"px";d[1]="t"}if(d[0]=="l"){g=$(X+"-map-hover-left-pointer");$(X+"-map-hover-right-pointer").hide()}else{if(d[0]=="r"){g=$(X+"-map-hover-right-pointer");$(X+"-map-hover-left-pointer").hide()}}if(d[1]=="t"){g.setStyle({top:"5px",bottom:""}).removeClassName("bottom").show()}else{g.setStyle({top:"",bottom:"22px"}).addClassName("bottom").show()}}else{e.left=String(b[0]+U.width/2-i.width/2)+"px";if(b[1]+U.height+i.height+Y[0]<f[1]+h.height-4){e.top=String(b[1]+U.height+Y[0])+"px"}else{e.top=String(b[1]+Y[1]-i.height)+"px"}$(X+"-map-hover-right-pointer").hide();$(X+"-map-hover-left-pointer").hide()}if((Browser.IE6||Browser.IE7)){a._bottomShadow=a._bottomShadow||a.down(".map-hover-bottom-shadow");a._bottomShadow.setStyle({width:String(a.offsetWidth-28)+"px",display:"block"});if(Browser.IE6){a._rightShadow=a._rightShadow||a.down(".map-hover-right-shadow");a._rightShadow.setStyle({height:String(a.offsetHeight)+"px",display:"block"})}}e.visibility="visible";a.setStyle(e)}.bind(Mapper);var A=function(){this.properties.pluck("marker").invoke("hide")}.bind(Mapper);var E=function(){this.properties.pluck("marker").invoke("show")}.bind(Mapper);N={setImage:function(U,V){U.setImage(V)}};D={initialize:function(){S=new GMap2(this.mapContainer);GEvent.addListener(S,"load",document.fire.bind(document,"mapper:loaded"));if(LinkConsumer.linkData){S.setCenter(new GLatLng(LinkConsumer.linkData.mapCoords[0],LinkConsumer.linkData.mapCoords[1]),LinkConsumer.linkData.mapZoom)}else{if(LinkConsumer.searchData&&LinkConsumer.searchData.queryData&&LinkConsumer.searchData.queryData.minLatitude){var U=LinkConsumer.searchData.queryData;var V=new GLatLngBounds();V.extend(new GLatLng(U.minLatitude,U.minLongitude));V.extend(new GLatLng(U.maxLatitude,U.maxLongitude));S.setCenter(V.getCenter(),S.getBoundsZoomLevel(V))}else{if(FeaturedProperties.properties&&FeaturedProperties.properties.length>0&&FeaturedProperties.allowCentering!=false){var V=new GLatLngBounds();FeaturedProperties.properties.each(function(W){V.extend(new GLatLng(W.Latitude,W.Longitude))});S.setCenter(V.getCenter(),(S.getBoundsZoomLevel(V)>12)?12:S.getBoundsZoomLevel(V))}else{S.setCenter(new GLatLng(DefaultMapStart.latitude,DefaultMapStart.longitude),DefaultMapStart.zoom)}}}if(!!AccountVars.mapType){switch(AccountVars.mapType){case"Terrain":S.setMapType(G_PHYSICAL_MAP);break;case"Satellite":S.setMapType(G_SATELLITE_MAP);break;case"Hybrid":S.setMapType(G_HYBRID_MAP);break;default:S.setMapType(G_NORMAL_MAP);break}$("map-type-selected").className="map-button-"+AccountVars.mapType.toLowerCase()}B=S.getZoom();O();F()},unload:function(){mapBottomShadow=null;GUnload();S=null},changeIcon:function(W,V,U){if(V!=this.Icons.active&&W.IsFavorite&&!U){return }else{if(U||W.IsFavorite){this.Proprietary.removeProperty(W);this.mapResult(W)}else{W.marker.setImage(V)}}},checkResize:function(){S.checkResize()},hideCityPreview:function(U){U.marker.setImage(this.Icons.city);this.Elements.cityMarkerHover.hide()},logMapCoords:function(){var U=S.getCenter();console.log("latitude: "+U.lat());console.log("longitude: "+U.lng());console.log("zoom: "+S.getZoom())},prepareMapForResults:function(U){if(!Q&&U){L.hide();Q=true}else{if(Q&&!U){L.show();Q=false}}},removeProperty:function(U){var V;S.removeOverlay(U.marker);this.properties.each(function(X,W){if(X.PropertyID==U.PropertyID){V=W;throw $break}});this.properties.splice(V,1)},removePropertyMarkers:function(){this.properties.each(function(U){S.removeOverlay(U.marker)})},removeMarker:function(U){S.removeOverlay(U)},showCityPreview:function(U){if(Browser.IE6&&!T){$("city-map-hover").setStyle({backgroundImage:"url(/DynamicImages/CityMapBox.aspx?fill="+DynamicColors["Panel secondary background"]+"&overlay=000000)"});T=true}this.Elements.cityMarkerHoverName.update(U.City);this.Elements.cityMarkerHoverTotalListings.update(Formatters.formatNumber(U.Count));$("city-map-hover-mean-price").update(Formatters.formatNumber(U.MeanPrice));$("city-map-hover-median-price").update(Formatters.formatNumber(U.MedianPrice));U.marker.setImage(this.Icons.cityHover);J(this.Elements.cityMarkerHover,U.marker,[0,-5],[5,-5],0)},setMapType:function(U){switch(U){case"map":S.setMapType(G_NORMAL_MAP);break;case"terrain":S.setMapType(G_PHYSICAL_MAP);break;case"satellite":S.setMapType(G_SATELLITE_MAP);break;case"hybrid":S.setMapType(G_HYBRID_MAP);break}}};R={additionalZoomLevelsAvailable:function(){var W=S.getCurrentMapType().getMaximumResolution();var V=G_PHYSICAL_MAP.getMaximumResolution();var Y=G_NORMAL_MAP.getMaximumResolution();var X=G_HYBRID_MAP.getMaximumResolution();var U=G_SATELLITE_MAP.getMaximumResolution();if(V>W){return{suggestedType:"Terrain",additionalLevels:V-W}}else{if(Y>W){return{suggestedType:"Normal",additionalLevels:Y-W}}else{if(X>W){return{suggestedType:"Hybrid",additionalLevels:X-W}}else{if(U>W){return{suggestedType:"Satellite",additionalLevels:U-W}}else{return false}}}}},destroySoldMarker:function(U){S.removeOverlay(U)},extendMarker:function(U){if(!Object.isUndefined(U.DiverseSolutions)){return }U.DiverseSolutions={};for(var V in N){U.DiverseSolutions[V]=N[V].curry(U)}return U},getBoundsZoom:function(U,V){U=new GLatLng(U[0],U[1]);V=new GLatLng(V[0],V[1]);var W=new GLatLngBounds(U,V);return S.getBoundsZoomLevel(W)},getInitialZoom:function(){return B},getMaxZoom:function(){return S.getCurrentMapType().getMaximumResolution()},getNeCornerBounds:function(){var U=S.getBounds().getNorthEast();return[U.lat(),U.lng()]},getSwCornerBounds:function(){var U=S.getBounds().getSouthWest();return[U.lat(),U.lng()]},getZoom:function(){return S.getZoom()},hidePropertyPreview:function(W,U){var V=this.markerMouseOutFunctionQueue.clone();this.markerMouseOutFunctionQueue=[];if(U!==true){if(W.IsVisited){this.changeIconIfMapped(W,this.IconStatuses.visited)}else{this.changeIconIfMapped(W,this.IconStatuses.normal)}}this.Elements.propertySummary.hide();V.each(function(X){X()})},hideSoldPreview:function(){$("sold-map-hover-container").hide()},initializeSmallMap:function(Y,W,X){var U=new GLatLng(X.Latitude,X.Longitude);var V=new GMarker(U,P);if(Y){Y.checkResize();Y.clearOverlays()}else{Y=new GMap2(W);Y.addControl(new GSmallMapControl());Y.addControl(new GMapTypeControl());Y.addControl(new GScaleControl());if(AccountVars.packageTypeID==2){Y.addControl(new google.maps.LocalSearch({searchFormHint:"search for pizza, coffee, etc",onIdleCallback:this.returnToSavedPosition.bind(this,Y),suppressInitialResultSelection:true}))}Y.enableContinuousZoom();Y.enableDoubleClickZoom()}Y.setCenter(U,17,G_HYBRID_MAP);Y.savePosition();Y.addOverlay(V);return Y},mapResult:function(X,W){var U=new GLatLng(X.Latitude,X.Longitude);var V;if(W){V=new GMarker(U,new GIcon(P,this.getIcon(X,this.IconStatuses.hover)))}else{if(Details.property&&Details.property.PropertyID==X.PropertyID){V=new GMarker(U,new GIcon(P,this.getIcon(X,this.IconStatuses.active)));X.IsActive=true}else{if(X.IsFavorite){V=new GMarker(U,new GIcon(M))}else{if(X.IsVisited){V=new GMarker(U,new GIcon(P,this.getIcon(X,this.IconStatuses.visited)))}else{V=new GMarker(U,new GIcon(P,this.getIcon(X,this.IconStatuses.normal)))}}}}X.marker=V;X.loadLevel=1;this.properties.push(X);GEvent.addListener(V,"click",Details.showDetailByProperty.bind(Details,X));GEvent.addListener(V,"click",this.hidePropertyPreview.bind(this,X,true));GEvent.addListener(V,"mouseover",this.showPropertyPreview.bind(this,X));GEvent.addListener(V,"mouseout",this.hidePropertyPreview.bind(this,X));S.addOverlay(V);return V},plotCityMarker:function(W){var U=new GLatLng(W.Lat,W.Lng);var V=new GMarker(U,C);S.addOverlay(V);W.marker=V;GEvent.addListener(V,"click",CityMarkers.zoomToCity.bind(CityMarkers,W.City));GEvent.addListener(V,"click",this.Proprietary.hideCityPreview.bind(this,W));GEvent.addListener(V,"mouseover",this.Proprietary.showCityPreview.bind(this,W));GEvent.addListener(V,"mouseout",this.Proprietary.hideCityPreview.bind(this,W))},plotSoldMarker:function(V){var U=new GMarker(new GLatLng(V.Lat,V.Lng),G);V.marker=this.extendMarker(U);S.addOverlay(U);GEvent.addListener(U,"mouseover",this.showSoldPreview.bind(this,V));GEvent.addListener(U,"mouseout",this.hideSoldPreview.bind(this,V));GEvent.addListener(U,"click",SoldProperties.setActiveFromMarker.bind(SoldProperties,V))},returnToSavedPosition:function(U){U.returnToSavedPosition()},setCenter:function(U,V,Y,X){if(Y){this.cancelBubble=true}U=new GLatLng(U[0],U[1]);V=new GLatLng(V[0],V[1]);var W=new GLatLngBounds(U,V);S.setCenter(W.getCenter(),!!X?X:S.getBoundsZoomLevel(W))},setZoomLevel:function(U){S.setZoom(U)},showPropertyPreview:function(V,U){if(!Tabs.isMapActive){return }this.changeIconIfMapped(V,this.IconStatuses.hover);if(Browser.IE6&&!K){$("listing-map-hover").setStyle({backgroundImage:"url(/DynamicImages/ListingMapBox.aspx?fill="+DynamicColors["Panel secondary background"]+"&overlay=000000)"});K=true}this.Elements.propertySummary.setAttribute("_mlsNumber",V.MlsNumber);this.Elements.propertySummaryPrice.innerHTML="$"+Formatters.formatNumber(V.Price);this.Elements.propertySummaryAddress.innerHTML=V.Address;if(AccountVars.showImprovedSizes&&V.ImprovedSqFt>0){this.Elements.propertySummaryImprovedSqFt.innerHTML=Formatters.formatNumber(V.ImprovedSqFt)+" sq ft"}else{this.Elements.propertySummaryImprovedSqFt.innerHTML="n/a"}this.Elements.propertySummaryBedsBaths.innerHTML=V.Beds+((V.Beds==1)?" bed, ":" beds, ")+Global.FormatBaths(V.Baths).toLowerCase();if(!!V.ListingAgentOffice&&AccountVars.showListingInfoInMapPreview){this.Elements.propertySummaryListingInfo.innerHTML="Listed with "+V.ListingAgentOffice;this.Elements.propertySummaryListingInfo.title="Listed with "+V.ListingAgentOffice;this.Elements.propertySummaryListingInfo.show()}if(typeof AccountVars.summaryDiscretionaryField1!="undefined"&&!AccountVars.summaryDiscretionaryField1.blank()&&!V.SummaryDiscretionaryField1.blank()){this.Elements.propertySummaryDiscretionaryField1.update(V.SummaryDiscretionaryField1).show().title=V.SummaryDiscretionaryField1}if(V.IconPath){this.Elements.propertySummaryIcon.show();this.Elements.propertySummaryIcon.src="http://"+ConfigVars.idxAssetsHost+"/MlsIcons/"+V.IconPath}else{this.Elements.propertySummaryIcon.hide()}if(!!V.AwsPhotoDomain&&V.PhotoCount>0){$("listing-map-hover-photo-container").update('<img src="http://#{AwsPhotoDomain}/#{FeedID}/#{MlsNumber}/0-thumb.jpg" />'.interpolate({AwsPhotoDomain:V.AwsPhotoDomain,FeedID:V.FeedID,MlsNumber:V.MlsNumber.toLowerCase()}))}else{if(V.PhotoCount>0){$("listing-map-hover-photo-container").update('<img src="/photos/#{FeedID}/#{MlsNumber}/0/thumb.aspx" />'.interpolate(V))}else{$("listing-map-hover-photo-container").update('<img src="http://'+ConfigVars.assetsHost+'/images/Beast/NoPhotoAvailable.gif" />')}}J(this.Elements.propertySummary,V.marker,[5,-2],[5,-5],170);if(Results.properties.length>0&&!U){var W=Results.properties.find(function(X){return(X.PropertyID==V.PropertyID)});if(W){Results.mouseOver(null,W);this.markerMouseOutFunctionQueue.push(Results.mouseOut.bind(Results,null,W))}}},showSoldPreview:function(U){if(Browser.IE6&&!H){$("sold-map-hover").setStyle({backgroundImage:"url(/DynamicImages/ListingMapBox.aspx?fill="+DynamicColors["Panel secondary background"]+"&overlay=000000)"});H=true}$("sold-marker-hover-address").update(U.Addr);$("sold-marker-hover-price").update(U.Price);$("sold-marker-hover-property-type").update(U.Type);$("sold-marker-hover-listing-agent").update(U.ListAgent);if(!U.ListOffice.blank()){$("sold-marker-hover-listing-office").update("&nbsp;w/&nbsp;"+U.ListOffice)}$("sold-marker-hover-selling-agent").update(U.SellAgent);if(!U.SellOffice.blank()){$("sold-marker-hover-selling-office").update("&nbsp;w/&nbsp;"+U.SellOffice)}J($("sold-map-hover-container"),U.marker,[0,-5],[5,-5],0)},toggleAllForSaleMarkers:function(U){if(U.checked){E()}else{A()}},zoomIn:function(){S.zoomIn()},zoomOut:function(){S.zoomOut()}};for(obj in R){if(R.hasOwnProperty(obj)){Mapper[obj]=R[obj].bind(Mapper)}}for(obj in D){if(D.hasOwnProperty(obj)){D[obj]=D[obj].bind(Mapper)}}return D}();
Panels.DetailResizer={maxDescContainerWidth:373,minDescContainerWidth:280,resize:function(){var C=$("DetailPanelSlideshowContainer");var A=$("DetailPanelTitleDescription");var D=$$("#DetailsPanel .module-container .PartialPanel");var B=this.maxDescContainerWidth-(Resizr.initialRightWrapperWidth-Resizr.rightWrapperWidth)-16;if(B>=this.minDescContainerWidth){A.setStyle({width:String(B)+"px",clear:"none"});C.setStyle({width:"","float":""})}else{A.setStyle({width:"100%",clear:"both"});C.setStyle({width:"auto","float":"none"})}D.each(function(F,E){var I=Resizr.rightWrapperWidth>=570;var H=I?"left":"none";var G=I?"":"99%";if(I&&F.id=="ZillowPanel"){H="right"}Element.setStyle(F,{"float":H,width:G})});Panels.StreetView.checkResize()}};Panels.BasicInfo={validateEmail:function(R){var P=1;var N=/^(com|net|org|edu|tv|int|mil|mobi|gov|arpa|biz|aero|name|coop|info|pro|museum|us|vi|pr)$/;var L=/^(.+)@(.+)$/;var I='\\(\\)><@,;:\\\\\\"\\.\\[\\]';var G="[^\\s"+I+"]";var E='("[^"]*")';var C=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var A=G+"+";var Q="("+A+"|"+E+")";var O=new RegExp("^"+Q+"(\\."+Q+")*$");var M=new RegExp("^"+A+"(\\."+A+")*$");var J=R.match(L);if(J==null){return false}var H=J[1];var F=J[2];for(S=0;S<H.length;S++){if(H.charCodeAt(S)>127){return false}}for(S=0;S<F.length;S++){if(F.charCodeAt(S)>127){return false}}if(H.match(O)==null){return false}var K=F.match(C);if(K!=null){for(var S=1;S<=4;S++){if(K[S]>255){return false}}return true}var D=new RegExp("^"+A+"$");var B=F.split(".");var T=B.length;for(S=0;S<T;S++){if(B[S].search(D)==-1){return false}}if(P&&B[B.length-1].length!=2&&B[B.length-1].search(N)==-1){return false}if(T<2){return false}return true},EmailFriend:{isCaptchaValid:false,initializeRecaptcha:function(){Recaptcha.create("6Le0PQAAAAAAAC4ybGNGlyuP0qiq7F78eEoCvOpb","email-friend-popup-reCaptcha-container",{theme:"blackglass",tabindex:0})},show:function(){if(!this.panel){this.panel=new YAHOO.widget.Panel("email-friend-popup-panel",{width:"520px",underlay:"shadow",close:true,draggable:false,visible:true,modal:false,y:80+(window.scrollY?window.scrollY:document.documentElement.scrollTop),x:(YAHOO.util.Dom.getClientWidth()/2)-(480/2),zIndex:10,iframe:true})}$("email-friend-popup-reCaptcha-error").hide();if(!this.isCaptchaValid){this.initializeRecaptcha()}this.panel.render();if(DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){$("email-friend-popup-panel-from-name").value=DiverseSolutions.Beast.Session.CurrentVisitor.FirstName+" "+DiverseSolutions.Beast.Session.CurrentVisitor.LastName;$("email-friend-popup-panel-from-email").value=DiverseSolutions.Beast.Session.CurrentVisitor.Email}else{$("email-friend-popup-panel-from-name").value="";$("email-friend-popup-panel-from-email").value=""}this.panel.show()},send:function(){if(!Panels.BasicInfo.validateEmail($("email-friend-popup-panel-from-email").value)){HelpTips.showInvalidEmail("email-friend-popup-panel-from-email");return }else{if(!Panels.BasicInfo.validateEmail($("email-friend-popup-panel-to-email").value)){HelpTips.showInvalidEmail("email-friend-popup-panel-to-email");return }else{HelpTips.hideInvalidEmail()}}if(this.isProcessing){return }this.isProcessing=true;parameters={propertyID:Details.property.PropertyID,fromName:$("email-friend-popup-panel-from-name").value,fromEmail:$("email-friend-popup-panel-from-email").value,toName:$("email-friend-popup-panel-to-name").value,toEmail:$("email-friend-popup-panel-to-email").value,subject:$("email-friend-popup-panel-subject").value,notes:$("email-friend-popup-panel-notes").value,originalLink:"http://"+window.location.host+window.location.pathname,linkToPdf:"http://"+window.location.host+window.location.pathname+"/Listings/"+Details.property.PropertyID+"/PDF",captchaChallenge:this.isCaptchaValid?"":Recaptcha.get_challenge(),captchaResponse:this.isCaptchaValid?"":Recaptcha.get_response()};new Ajax.Request("/Webservice/Email.asmx/SendPropertyToFriend",{parameters:parameters,onSuccess:this.sendCallback.bind(this)});Analytics.trackPageview("/EmailFriend");Analytics.trackPageviewForClient("/IDX/Email a Friend")},sendCallback:function(B,A){if(A){this.panel.hide();$("email-friend-captcha-container").hide();this.isCaptchaValid=true}else{$("email-friend-popup-reCaptcha-error").show();this.initializeRecaptcha()}this.isProcessing=false}},initialize:function(A){this.initializeSlideshow(A);this.initializeBasicInfo(A);this.initializeEnhancedVirtualTours(A);this.initializeAdditionalFeatures(A);this.initializeAdditionalDetails(A);if(/^\/mls\/./i.test(window.location.pathname)){$("DetailPanelPrintListing").hide();$("DetailPanelGetPdf").hide();$("email-friend-popup-panel-link").hide();$("detail-panel-actions-get-link").hide();$("detail-panel-actions-set-bookmark").hide()}else{if(!AccountVars.allowQueryInitOnPageLoad){$("detail-panel-actions-get-link").hide();$("detail-panel-actions-set-bookmark").hide()}}},unload:function(){this.contactPanel=null},initializeSlideshow:function(B){var C=$("DetailPanelSlideshow");C.innerHTML="";if(B.PhotoCount==0){C.appendChild($E({tag:"img",src:"http://"+ConfigVars.assetsHost+"/images/beast/no-photo-available-250.jpg",alt:B.Address+", "+B.City+", "+B.State,width:"250"}))}else{if(!!B.AwsPhotoDomain&&(B.PhotoCount==1||(B.PhotoCount>1&&deconcept.SWFObjectUtil.getPlayerVersion().major<6))){C.appendChild($E({tag:"img",src:"http://#{AwsPhotoDomain}/#{FeedID}/#{MlsNumber}/0-medium.jpg".interpolate({AwsPhotoDomain:B.AwsPhotoDomain,FeedID:B.FeedID,MlsNumber:B.MlsNumber.toLowerCase()}),alt:B.Address+", "+B.City+", "+B.State,width:"250"}));if(B.PhotoCount>1&&deconcept.SWFObjectUtil.getPlayerVersion().major<6){C.innerHTML+='<div style="padding: 5px;">There are more photos for this property, but you need to install <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW">Adobe Flash</a> to view them.</div>'}}else{if(B.PhotoCount==1||(B.PhotoCount>1&&deconcept.SWFObjectUtil.getPlayerVersion().major<6)){C.appendChild($E({tag:"img",src:"/photos/"+B.FeedID+"/"+B.MlsNumber+"/0/medium.aspx",alt:B.Address+", "+B.City+", "+B.State,width:"250"}));if(B.PhotoCount>1&&deconcept.SWFObjectUtil.getPlayerVersion().major<6){C.innerHTML+='<div style="padding: 5px;">There are more photos for this property, but you need to install <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW">Adobe Flash</a> to view them.</div>'}}else{var A=new SWFObject("/Assets/Slideshow.swf","DetailPanelSlideshowObject","250","225","7","#FFFFFF");A.addVariable("propertySlideshowXml","/SlideshowXML/"+B.PropertyID+".aspx");if(!Browser.GeckoMac){A.addParam("wmode","transparent")}A.write(C.id)}}}},initializeBasicInfo:function(D){var C=$("DetailPanelFavoriteStatus");var A=((D.IsFavorite)?Favorites.checkedHTML:Favorites.uncheckedHTML);if(D.Address!=""){$("detail-panel-title-container").innerHTML='<span id="detail-panel-title">'+D.Address+"<br />"+D.City+", "+D.State+" "+D.Zip+"</span>";$("contact-popup-panel-address").innerHTML=D.Address+"<br />"+D.City+", "+D.State+" "+D.Zip}else{$("detail-panel-title-container").innerHTML='<span id="detail-panel-title">'+D.City+", "+D.State+" "+D.Zip+"</span>";$("contact-popup-panel-address").innerHTML=D.City+", "+D.State+" "+D.Zip}if(!(Browser.IE6||Browser.IE7)){sIFR.replace.bind(sIFR,sIFR._dsFonts.verdanaSwf,{elements:[$("detail-panel-title")],wmode:Browser.GeckoMac?"opaque":"transparent",css:{".sIFR-root":{color:"#"+DynamicColors["Panel secondary title"]}}}).delay(this.hasSifrExecuted?0.1:0.6);this.hasSifrExecuted=true}else{sIFR.replace(sIFR._dsFonts.verdanaSwf,{elements:[$("detail-panel-title")],wmode:"transparent",css:{".sIFR-root":{color:"#"+DynamicColors["Panel secondary title"]}}})}if(D.BottomRangePrice){$("detail-panel-price").innerHTML="$"+Formatters.formatNumber(D.BottomRangePrice)+" - "+Formatters.formatNumber(D.Price)+" V*"}else{$("detail-panel-price").innerHTML="$"+Formatters.formatNumber(D.Price)}if(AccountVars.rebatePercentage||AccountVars.rebateDollarAmount){$("detail-panel-rebate-container").show();$("detail-panel-rebate-container").writeAttribute("onclick","HelpTips.showYourRebate()");if(AccountVars.rebatePercentage){$("detail-panel-rebate-text").update("Your #{rebatePercentage}% rebate".interpolate(AccountVars));$("detail-panel-rebate-amount").update("$"+Formatters.formatNumber(D.Price*0.01)+" (when buying with us)")}else{if(AccountVars.rebateDollarAmount){$("detail-panel-rebate-text").update("Your rebate");$("detail-panel-rebate-amount").update("$#{rebateDollarAmount} (when buying with us)".interpolate(AccountVars))}}$("your-rebate-tip-text").update(AccountVars.rebatePopupText)}$("contact-popup-panel-mls-number").update(D.MlsNumber);$("detail-panel-beds").update(D.Beds);$("detail-panel-baths").update(Global.FormatBaths(D.Baths,false).toLowerCase());if(AccountVars.showImprovedSizes&&D.ImprovedSqFt>0){$("detail-panel-size").update(Formatters.formatNumber(D.ImprovedSqFt)+" sq ft")}else{$("detail-panel-size").update("n/a")}if(AccountVars.showLotSizes&&D.LotSqFt>0){$("detail-panel-lot-size").update(Formatters.formatLotSize(D.LotSqFt))}else{$("detail-panel-lot-size").update("n/a")}if(AccountVars.showDaysOnMarket){$("detail-panel-days-on-market").update(D.DOM);$("detail-panel-days-on-market-container").show()}else{$("detail-panel-days-on-market-container").hide()}if(AccountVars.showListingUpdatedDate){$("detail-panel-property-last-updated").update(D.LastUpdated);$("detail-panel-property-last-updated-container").show()}else{$("detail-panel-property-last-updated-container").hide()}$("detail-panel-mls-number").update(D.MlsNumber);$("detail-panel-description").update(D.Description);$("detail-panel-property-types").update(D.PropertyTypes);if(!!D.TractIdentifier){$("detail-panel-tract").update(D.TractIdentifier);$("detail-panel-tract-container").show()}else{$("detail-panel-tract-container").hide()}if(!!D.Community){$("detail-panel-community").update(D.Community);$("detail-panel-community-container").show()}else{$("detail-panel-community-container").hide()}if(!!D.YearBuilt){$("detail-panel-year-built").update(D.YearBuilt);$("detail-panel-year-built-container").show()}else{$("detail-panel-year-built-container").hide()}var E=0,B=0;$$("#detail-panel-general-info-table tr").each(function(G,F){if(G.style.display!="none"&&E++%2==0){G.setStyle({backgroundColor:"#"+DynamicColors["Interior panel background"]})}else{G.setStyle({backgroundColor:""})}});if(AccountVars.packageTypeID==1){C.update("")}else{C.update('<span id="DetailsFavoriteStatus_'+D.PropertyID+'" href="javascript:void(0)" onclick="Favorites.toggle('+D.PropertyID+');" style="position: relative;">'+A+"</span>")}if(!!window.location.search){$("DetailPanelPrintListing").href="http://"+window.location.host+"/DisplayListing.aspx"+window.location.search+"&PropertyID="+D.PropertyID;$("DetailPanelGetPdf").href="http://"+window.location.host+"/DisplayListing.aspx"+window.location.search+"&PropertyID="+D.PropertyID+"&ExportPdf=true"}else{$("DetailPanelPrintListing").href="http://"+window.location.host+window.location.pathname+"/Listings/"+D.PropertyID;$("DetailPanelGetPdf").href="http://"+window.location.host+window.location.pathname+"/Listings/"+D.PropertyID+"/PDF"}},initializeAdditionalDetails:function(C){var A=$("DetailPanelAdditionalDetailsList");var B;B=C.AdditionalDetails.inject([],function(E,D){if(D.Value.indexOf("http://")==0){E.push('<li><div class="FieldName">'+D.Field+'</div><a href="'+D.Value+'" target="_blank">'+D.Value+"</a></li>")}else{E.push('<li><div class="FieldName">'+D.Field+"</div><div>"+D.Value+"</div></li>")}return E});A.update(B.join(""))},initializeAdditionalFeatures:function(F){var A=$("DetailPanelAdditionalFeaturesList");if(!AccountVars.splitFeaturesIntoGroupsBySlash){var E=F.Features.inject([],function(J,I,H){J.push("<li>"+I+"</li>");return J});A.update(E.join(""))}else{var G="",B=false;var D=[];var C=0;F.Features.each(function(J,I){var H=J.indexOf(" / ");var K;if(H==-1){K={category:J,value:""}}else{K={category:J.substr(0,H),value:J.substr(H+3,J.length-H+3)}}if(K.category!=G){C++;if(G!=""){D.push('</div><div class="clear"></div></li>')}D.push('<li class="'+((C%2==0)?"primary":"")+'"><div class="details-feature-category">#{category}</div><div class="details-feature-value">#{value}'.interpolate(K))}else{if(B){D.push("#{value}".interpolate(K))}else{D.push(", #{value}".interpolate(K))}}if(H==-1){B=true}else{B=false}G=K.category});D.push('</div><div style="clear:both"></div></li>');A.hide();$("details-features-grouped").update(D.join(""))}},initializeEnhancedVirtualTours:function(A){if(!A.VirtualTours){$("detail-panel-show-virtual-tours-container").hide();return }else{$("detail-panel-show-virtual-tours-container").show()}this.virtualTours=A.VirtualTours},activateVirtualTour:function(){this.virtualTours.each(function(B,A){window.open(B,"VirtualTour"+String(A),Panels.AreaInfo.windowOpenParams)}.bind(this))},getLink:function(){void (window.prompt("You may copy the link below if you would like to return to this property later",window.location.href))},setBookmark:function(B){var A;var D=Details.property;var C=window.encodeURIComponent;if(!D.Address||D.Address==D.City){A="MLS #"+D.MlsNumber;if(D.City){A+=" in "+D.City}}else{A=D.Address;if(D.City){A+=", "+D.City}A+=" (MLS #"+D.MlsNumber+")"}switch(B){case"dwellicious":var E=/\/mls\/([0-9a-zA-Z]+\/?){3}/i.exec(window.location.href);if(E!=null){E=E[0]}else{E=AccountVars.aid}window.open("http://dwellicious.com/addbookmark?popup=true&desc="+C(A)+"&uri="+C(window.location.pathname+"#PropertyID="+Details.property.PropertyID+"&FromDwellicious=true&MasterAccountID="+E)+"&src=dsSearchAgent","addtodwellicious","width=550,height=550,location=0,menubar=0,toolbar=0").focus();break;default:if(!(Browser.IE6||Browser.IE7)){void (window.prompt("Your browser doesn't support automatic bookmarking. Please copy the link below and add it to your bookmarks manually.",window.location.href))}else{window.external.AddFavorite(window.location.href,A)}break}},showContactForm:function(){if(!this.contactPanel){this.contactPanel=new YAHOO.widget.Panel("contact-popup-panel",{width:"310px",underlay:"shadow",close:true,draggable:false,visible:true,modal:true,y:80+Global.GetScrollY(),x:(YAHOO.util.Dom.getClientWidth()/2)-(310/2),zIndex:10});this.contactPanel.hideEvent.subscribe(this.contactPopupPanel_Hiding.bind(this));Event.observe(window,"unload",this.unload.bind(this));this.contactPanel.render(document.body)}else{this.contactPanel.cfg.setProperty("x",(YAHOO.util.Dom.getClientWidth()/2)-(310/2));this.contactPanel.cfg.setProperty("y",80+Global.GetScrollY());this.contactPanel.render()}if(DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){$("contact-popup-panel-visitor-name").value=DiverseSolutions.Beast.Session.CurrentVisitor.FirstName+" "+DiverseSolutions.Beast.Session.CurrentVisitor.LastName;$("contact-popup-panel-visitor-email").value=DiverseSolutions.Beast.Session.CurrentVisitor.Email}else{$("contact-popup-panel-visitor-name").value="";$("contact-popup-panel-visitor-email").value=""}this.contactPanel.show()},contactPopupPanel_Hiding:function(){Panels.Contact.calendar.hide()},sendContactInformation:function(){if(!Panels.BasicInfo.validateEmail($("contact-popup-panel-visitor-email").value)){HelpTips.showInvalidEmail("contact-popup-panel-visitor-email");return }else{HelpTips.hideInvalidEmail()}this.contactPanel.hide();parameters={propertyID:Details.property.PropertyID,mlsNumber:$("contact-popup-panel-mls-number").innerHTML,address:$("contact-popup-panel-address").innerHTML,fromName:$("contact-popup-panel-visitor-name").value,fromEmail:$("contact-popup-panel-visitor-email").value,phoneNumber:$("contact-popup-panel-visitor-phone").value,showingDate:$("contact-popup-panel-show-date").value,comments:$("contact-popup-panel-comments").value,rootPath:"http://"+window.location.host+window.location.pathname};new Ajax.Request("/Webservice/Email.asmx/SendContactForm",{parameters:parameters});Analytics.trackPageview("/Contact");Analytics.trackPageviewForClient("/IDX/Send Contact Form")},showFullSizePhotos:function(){if(!this.fullSizePhotosPanel){this.fullSizePhotosPanel=new YAHOO.widget.Panel("full-size-photos-popup-panel",{width:"700px",height:"620px",underlay:"shadow",close:true,draggable:false,visible:true,modal:true,iframe:true,y:80+Global.GetScrollY(),x:(YAHOO.util.Dom.getClientWidth()/2)-(700/2),zIndex:10});this.fullSizePhotosPanel.render(document.body);Event.observe(window,"unload",this.unload.bind(this))}else{this.fullSizePhotosPanel.cfg.setProperty("x",(YAHOO.util.Dom.getClientWidth()/2)-(700/2));this.fullSizePhotosPanel.cfg.setProperty("y",80+Global.GetScrollY());this.fullSizePhotosPanel.render()}var A=new SWFObject("/Assets/SlideshowFull.swf","full-size-photos-flash","700","600","7","#FFFFFF");A.addVariable("propertySlideshowXml","/SlideshowXML/"+Details.property.PropertyID+".aspx?Full=1");A.write("full-size-photos");this.fullSizePhotosPanel.show()}};Panels.MortgageCalculator={initialize:function(C){var A=parseFloat(C.Price.gsub("[,$]",""))*0.2;var B=parseInt(C.Price.gsub("[,$]",""));if(String(A).indexOf(".")!=-1){A=parseInt(String(A).substr(0,String(A).indexOf(".")+2))}$("MortCalcLoanAmount").value="$"+Formatters.formatNumber(B);$("MortCalcDownPayment").value="$"+Formatters.formatNumber(A);$("MortCalcInterestRate").value=String(AccountVars.defaultInterestRate)+"%";this.calculate()},calculate:function(){var D=parseInt($("MortCalcLoanAmount").value.replace(/[^0-9.]/g,""));var B=parseInt($("MortCalcDownPayment").value.replace(/[^0-9.]/g,""));var C=parseFloat($("MortCalcInterestRate").value.replace(/[^0-9.]/g,""))/100;var F=parseInt($("MortCalcTerm").value)*12;var E=C/12;var A;if(isNaN(B)){B=0}if(isNaN(D)||isNaN(E)||isNaN(F)){return }A=(E*(D-B))/(1-Math.pow(1+E,-F));$("MortCalcMonthlyPayment").innerHTML="$"+Formatters.formatNumber(String(A).replace(/\..*/,""))}};Panels.AreaInfo={windowOpenParams:"width=780,height=500,left=100,top=100,menubar=no,toolbar=yes,location=yes,directories=no,status=no,resizable=yes,scrollbars=yes,dependent=yes",initialize:function(A){this.state=A.State;this.zip=A.Zip},openSchoolInfo:function(){Analytics.trackPageview("/Default/AjaxEvents/School Info");void (window.open("http://framed.greatschools.net/cgi-bin/byaddr/"+this.state+"?stateselect="+this.state+"&zip="+this.zip,"AreaInfo",this.windowOpenParams))},openNeighborhoodInfo:function(){Analytics.trackPageview("/Default/AjaxEvents/Neighborhood Info");void (window.open("http://p01.bestplaces.net/diverse/nhood1.asp?qryMsa=5945&qryZip="+this.zip,"AreaInfo",this.windowOpenParams))},openNearestInfo:function(){Analytics.trackPageview("/Default/AjaxEvents/Nearest Places Info");void (window.open("http://p01.bestplaces.net/diverse/nearest.asp?qryMsa=5945&qryZip="+this.zip,"AreaInfo",this.windowOpenParams))}};Panels.ListingAgentInfo={showingListingInfoUnderPhotos:false,initialize:function(A){var B="";if(AccountVars.showListingInfoUnderPhotos&&!this.showingListingInfoUnderPhotos){$("DetailPanelTitleDescription").insert({after:$("ListingAgentInfoPanel")});this.showingListingInfoUnderPhotos=true}if(typeof A.ListingAgentName!="undefined"){B="Listing provided courtesy of #{ListingAgentName}, #{ListingAgentOffice}".interpolate(A)}else{if(typeof A.ListingAgentOffice!="undefined"){B="Listing provided courtesy of #{ListingAgentOffice}".interpolate(A)}}if(!!A.IconPath){B+='<br /><img src="/MlsIcons/#{IconPath}" style="margin-left: -60px;" />'.interpolate(A)}$("ListingAgentInfoPanel").update(B)}};Panels.Contact={initialize:function(A){$("ContactPanelContentReplacement").hide();$("ContactPanelContent").show();$("ContactListingMlsNumber").innerHTML=A.MlsNumber;if(A.Address.blank()){$("ContactListingAddress").innerHTML=A.City+", "+A.State+" "+A.Zip}else{$("ContactListingAddress").innerHTML=A.Address+"<br />"+A.City+", "+A.State+" "+A.Zip}if($("ContactListingMlsNumberSellersName")){$("ContactListingMlsNumberSellersName").innerHTML=A.ListingAgentName}if($("ContactListingMlsNumberSellersContact")){$("ContactListingMlsNumberSellersContact").innerHTML=A.ListingAgentOffice}if(DiverseSolutions.Beast.Session.CurrentVisitor.VisitorID){$("ContactVisitorName").value=DiverseSolutions.Beast.Session.CurrentVisitor.FirstName+" "+DiverseSolutions.Beast.Session.CurrentVisitor.LastName;$("ContactVisitorEmail").value=DiverseSolutions.Beast.Session.CurrentVisitor.Email}if(typeof AccountVars.agentChatTargetPublicId!="undefined"&&!AccountVars.agentChatTargetPublicId.blank()){$("details-panel-agentchat").show()}this.isProcessing=false},showAgentChat:function(A){var B="";if(DiverseSolutions.Beast.Session.CurrentVisitor&&DiverseSolutions.Beast.Session.CurrentVisitor.Email){B="&Name="+DiverseSolutions.Beast.Session.CurrentVisitor.FirstName+" "+DiverseSolutions.Beast.Session.CurrentVisitor.LastName+"&Email="+DiverseSolutions.Beast.Session.CurrentVisitor.Email}window.open("http://chat.dsagentchat.com/?PublicId="+AccountVars.agentChatTargetPublicId+B,"","width=444,height=444")},sendInformation:function(){if(!Panels.BasicInfo.validateEmail($("ContactVisitorEmail").value)){HelpTips.showInvalidEmail("ContactVisitorEmail");return }else{HelpTips.hideInvalidEmail()}if(this.isProcessing){return }this.isProcessing=true;var B,A=$("ContactPanel");this.wipeFx=new fx.Style("ContactPanelContent","opacity",{duration:400,onComplete:this.fxCallback.bind(this)});A.style.height=A.offsetHeight-30+"px";if(this.calendar!=null){this.calendar.hide()}B={propertyID:Details.property.PropertyID,mlsNumber:$("ContactListingMlsNumber").innerHTML,address:$("ContactListingAddress").innerHTML,fromName:$("ContactVisitorName").value,fromEmail:$("ContactVisitorEmail").value,phoneNumber:$("ContactVisitorPhone").value,showingDate:$("ContactShowingDate").value,comments:$("ContactQuestionsComments").value,rootPath:"http://"+window.location.host+window.location.pathname};new Ajax.Request("/Webservice/Email.asmx/SendContactForm",{parameters:B});Analytics.trackPageview("/Contact");Analytics.trackPageviewForClient("/IDX/Send Contact Form");this.isProcessing=false;this.wipeFx.custom(1,0)},fxCallback:function(){var A=$("ContactPanelContentReplacement");$("ContactPanelContent").hide();A.show();this.wipeFx.set(1);this.wipeFx.options.onComplete=this.fxDispose.bind(this);this.wipeFx.element=A;this.wipeFx.custom(0,1)},fxDispose:function(){this.wipeFx=null},openCalendar:function(B,C,D){var A=new YAHOO.util.YUILoader({require:["calendar"],loadOptional:false,onSuccess:function(){var E=$(C);var G=Position.cumulativeOffset(E);var H=$("RequestedShowDateCalendarContainer");if(this.calendar==null){var F=new Date();var I=new Date();I.setTime(F.getTime()+1000*60*60*24*21);this.calendar=new YAHOO.widget.Calendar("RequestedShowDateCalendar","RequestedShowDateCalendarContainer",{mindate:F,maxdate:I,close:true});this.calendar.selectEvent.subscribe(function(K,J,L){E.value=J[0][0][1]+"/"+J[0][0][2];L.hide()},this.calendar);this.calendar.render()}if(H.parentNode!=document.body){document.body.appendChild(H)}H.setStyle({left:G[0]+"px",top:G[1]+E.offsetHeight+1+"px",zIndex:D});this.calendar.show()}.bind(Panels.Contact)});A.insert()}};Panels.VirtualEarth={initialize:function(C){var A=$("VirtualEarthMapIframe");var B={width:A.up().getDimensions().width,height:A.getDimensions().height};$("VirtualEarthMapBirdsEyeNotAvailable").hide();$("VirtualEarthMapIframe").hide();$("VirtualEarthLoader").show();A.contentWindow.VirtualEarth.loadProperty(C,this.callback.bind(this),B)},callback:function(A){$("VirtualEarthLoader").hide();if(A){$("VirtualEarthMapIframe").show();$("VirtualEarthMapBirdsEyeNotAvailable").hide()}else{$("VirtualEarthMapIframe").hide();$("VirtualEarthMapBirdsEyeNotAvailable").show()}}};Panels.SmallMap={initialize:function(){var A=$("SmallMapPanelMapContainer");A.setStyle({width:"",height:""});this.map=Mapper.initializeSmallMap(this.map,A,Details.property);if(!this.initialized){this.initialized=true;Event.observe(window,"unload",this.unload.bind(this))}},unload:function(){this.map=null}};Panels.StreetView=(function(){var F,B;var E;var H;function D(J){F.hide();$("street-view-container").hide();if(J==600){G("Sorry, but Google doesn't have any Street View imagery available for this location.")}else{if(J==603){G('It seems that you don\'t have a version of Adobe Flash that works with Google Street View. Try downloading the latest version <a href="http://www.adobe.com/go/EN_US-H-GET-FLASH">here</a> (completely free) and then coming back.')}}}function C(){F=new GStreetviewPanorama($("street-view-container"));B=new GStreetviewClient();GEvent.addListener(F,"error",D);Event.observe(window,"unload",A)}function I(J){if(!J){D(600)}else{$("street-view-error").hide();$("street-view-container").show();if(F.isHidden()){F.show()}F.setLocationAndPOV.bind(F,J).defer();H.checkResize()}}function G(J){$("street-view-error").show().update(J)}function A(){F.remove()}H={initialize:function(J){if(F){F.remove()}C();B.getNearestPanoramaLatLng(new GLatLng(J.Latitude,J.Longitude),I)},checkResize:function(){if(F){var J=$("street-view-container");J.setStyle({width:""}).setStyle({width:String(J.offsetWidth)+"px"});F.checkResize()}}};return H})();Panels.Zillow={initialize:function(A){new Ajax.Request("/Webservice/QueryProperty.asmx/LoadZillowData",{parameters:"propertyID="+A.PropertyID,onSuccess:this.dataCallback.bind(this)})},dataCallback:function(A){var B=String("("+Global.FixXmlDoc(A).lastChild.firstChild.nodeValue+")").evalJSON();if(B.error){$("ZillowPanelContent").hide();$("ZillowPanelError").show();$("ZillowPanelError").innerHTML=B.error}else{$("ZillowPanelContent").show();$("ZillowPanelError").hide();$("ZillowPanelZestimate").innerHTML='<a href="'+B.detailsLink+'" target="_blank">'+B.zestimate+"</a>";$("ZillowPanelValuationRange").innerHTML=B.lowRangeValue+" - "+B.highRangeValue;$("ZillowPanelValueChange").innerHTML=B.valueChange;$("ZillowPanelZestimateLastUpdated").innerHTML=B.lastUpdated;$("ZestimateGraph").src=B.priceGraph;$("ZestimateGraphLink").href=B.graphsLink}Analytics.trackPageview("/Default/AjaxEvents/Zillow")}};
var CorporateContact=function(){var B=false;var A=function(){var D=$("corporate-contact-thanks");var E=new Fx.Style(D,"marginTop",{duration:400,transition:Fx.Transitions.quartOut});var C;D.setStyle({height:"0",display:"block"});C="-"+D.scrollHeight+"px";D.setStyle({marginTop:C,height:""});E.custom(-D.scrollHeight,$("corporate-contact-container").offsetHeight/2-D.scrollHeight/2)};return{sendInformation:function(){if(!Panels.BasicInfo.validateEmail($("corporate-contact-email").value)){HelpTips.showInvalidEmail("corporate-contact-email");return }else{HelpTips.hideInvalidEmail()}if(B){return }B=true;var C=$("corporate-contact-form");var D=new Fx.Style(C,"height",{duration:400,transition:Fx.Transitions.quartOut,onComplete:A});D.custom(C.offsetHeight,0);new Ajax.Request("/Webservice/Email.asmx/SendCorporateContactForm",{parameters:{name:$("corporate-contact-name").value,email:$("corporate-contact-email").value,phone:$("corporate-contact-phone").value,comments:$("corporate-contact-comments").value,referrer:!!document.referrer?document.referrer:"n/a"}});Analytics.trackPageview("/CorporateInfoRequest")}}}();
Profile={OnLoad:function(){if(!this.IsInitialized){this.Init()}this.IsInitialized=true},Init:function(){this.Dialog=$("profile_form");this.Form=$("profile_form_form");this.LightBox=new YAHOO.widget.Panel(this.Dialog,{modal:true,visible:false,width:"450px",y:50+Global.GetScrollY(),x:(YAHOO.util.Dom.getClientWidth()/2)-(450/2),constrainviewport:true,draggable:false,underlay:"none",zIndex:10});var A=[new YAHOO.util.KeyListener(document,{keys:27},{fn:this.HandleCancel.bind(this)}),new YAHOO.util.KeyListener(document,{keys:13},{fn:this.HandleSubmit.bind(this)})];this.LightBox.cfg.queueProperty("keylisteners",A);this.Dialog.setStyle({display:"block"});this.LightBox.render()},Load:function(){var B=$("profile_form_form");var A=B.getElements();for(key in DiverseSolutions.Beast.Session.CurrentVisitor){var C=$("profile_"+key.toLowerCase());if(C){C.value=DiverseSolutions.Beast.Session.CurrentVisitor[key]}}},Show:function(){this.OnLoad();this.Load();this.LightBox.cfg.setProperty("x",(YAHOO.util.Dom.getClientWidth()/2)-(450/2),true);this.LightBox.cfg.setProperty("y",50+Global.GetScrollY());this.LightBox.show()},HandleCancel:function(){this.LightBox.hide()},HandleSubmit:function(){var A={success:this.SaveSuccess,failure:this.SaveFailure,scope:this};YAHOO.util.Connect.setForm(this.Form);YAHOO.util.Connect.asyncRequest("POST",this.Form.action,A)},SaveSuccess:function(o){var user=eval(o.responseText);var Profile_Error=$("Profile_Error");while(Profile_Error.firstChild){Profile_Error.removeNode(Profile_Error.firstChild)}if(user){if(typeof user.Email=="undefined"){Profile_Error.style.color="red";if(typeof user.error!="undefined"){Profile_Error.innerHTML=user.error}else{Profile_Error.innerHTML=user}}else{Profile_Error.style.color="#333333";DiverseSolutions.Beast.Session.CurrentVisitor=user;DiverseSolutions.Beast.Authentication.LoginStatus.update();this.LightBox.hide()}}},SaveFailure:function(A){}};
Searches={SearchTypes:{Saved:"saved",Recent:"recent"},CurrentPage:1,CurrentType:"",OnLoad:function(){if(!this.IsInitialized){this.Init()}this.IsInitialized=true},Init:function(B){this.CurrentType=(typeof B=="undefined"?this.SearchTypes.Saved:B);this.CurrentPage=1;if(this.LightBox){this.LightBox.hide()}if(!this.SavedLightBox){this.SavedLightBox=new YAHOO.widget.Panel($("Searches_Dialog"),{modal:true,visible:false,width:"450px",y:50+Global.GetScrollY(),x:(YAHOO.util.Dom.getClientWidth()/2)-(450/2),constrainviewport:true,draggable:false,zIndex:1000,underlay:"none"})}if(!this.RecentLightBox){this.RecentLightBox=new YAHOO.widget.Panel($("RecentSearches_Dialog"),{modal:true,visible:false,width:"450px",y:50+Global.GetScrollY(),x:(YAHOO.util.Dom.getClientWidth()/2)-(450/2),constrainviewport:true,draggable:false,zIndex:1000,underlay:"none"})}if(this.CurrentType==this.SearchTypes.Saved){this.Dialog=$("Searches_Dialog");this.Dashboard=$("Searches_Dialog_Items");this.LightBox=this.SavedLightBox}else{if(this.CurrentType==this.SearchTypes.Recent){this.Dialog=$("RecentSearches_Dialog");this.Dashboard=$("RecentSearches_Dialog_Items");this.LightBox=this.RecentLightBox}}var A=[new YAHOO.util.KeyListener(document,{keys:27},{fn:this.LightBox.hide.bind(this.LightBox)})];this.Dialog.setStyle({display:"block"});this.LightBox.cfg.queueProperty("keylisteners",A);this.LightBox.render()},Load:function(){this.Dashboard.appendChild($E({tag:"div",className:"Search_Info",children:["Loading..."]}));YAHOO.util.Connect.asyncRequest("POST","/webservice/profile.asmx/GetSearches",{success:this.Load_Success.bind(this)},$H({Page:this.CurrentPage,Type:this.CurrentType}).toQueryString())},LoadPage:function(A){this.CurrentPage=A;this.Load()},Show:function(){this.OnLoad();this.Load();this.LightBox.cfg.setProperty("x",(YAHOO.util.Dom.getClientWidth()/2)-(450/2),true);this.LightBox.cfg.setProperty("y",50+Global.GetScrollY());this.LightBox.show()},Load_Paging:function(F){var B=$E({tag:"div",className:"Searches_Paging"});while(B.firstChild){B.removeChild(B.firstChild)}var A=Math.ceil(F.Total/F.PageLength);if(A>1){var E=null;if(this.CurrentPage>1){E=$E({tag:"div",className:"Searches_Page",onclick:this.LoadPage.bind(this,1),children:["<<"]});B.appendChild(E);E=$E({tag:"div",className:"Searches_Page",onclick:this.LoadPage.bind(this,this.CurrentPage-1),children:["<"]});B.appendChild(E)}for(var C=this.CurrentPage-2;C<this.CurrentPage+2;C++){var D=C+1;if(D>=1&&D<=A){E=$E({tag:"div",className:"Searches_Page"+(D==this.CurrentPage?" Searches_Page_Selected":""),onclick:this.LoadPage.bind(this,D),children:[D+""]});B.appendChild(E)}}if(this.CurrentPage<A){E=$E({tag:"div",className:"Searches_Page",onclick:this.LoadPage.bind(this,this.CurrentPage+1),children:[">"]});B.appendChild(E);E=$E({tag:"div",className:"Searches_Page",onclick:this.LoadPage.bind(this,A),children:[">>"]});B.appendChild(E)}}this.Dashboard.appendChild(B)},Load_Success:function(o){var Result=eval(o.responseText);while(this.Dashboard.firstChild){this.Dashboard.removeChild(this.Dashboard.firstChild)}if(Result.Searches.length==0){var DOM=$E({className:"Search_Info",children:["No "+(this.CurrentType==this.SearchTypes.Saved?"Saved":"Recent")+" Searches Found"]});DOM.style.marginTop="20px";DOM.style.marginBottom="20px";this.Dashboard.appendChild(DOM)}else{var InfoDOM=$E({tag:"div",className:"Search_Info",children:[(this.CurrentType==this.SearchTypes.Saved?"The searches you have saved.":"The recent searches you have made.")]});this.Dashboard.appendChild(InfoDOM);this.Load_Paging(Result);for(var i=0;i<Result.Searches.length;i++){var Search=Result.Searches[i];var DOM=$E({tag:"div",className:"Search_Item",children:[{tag:"div",className:"Search_Item_Title",id:"Search_Item_Title_"+Search.PropertySearchID,onclick:this.ViewSearch.bind(this,Search),tile:"Click to view this search.",children:[Search.Title]},{tag:"div",className:"Search_Item_Date",children:[Search.CreateDate]},{tag:"div",className:"Search_Item_Info",children:[(Search.PriceFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Title",children:["Price"]}):""),(Search.PriceFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Value",children:[Search.PriceFrom,(Search.PriceTo+""!="0"?" - "+Search.PriceTo:"")]}):""),(Search.BedsFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Title",children:["Beds"]}):""),(Search.BedsFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Value",children:[Search.BedsFrom]}):""),(Search.BathsFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Title",children:["Baths"]}):""),(Search.BathsFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Value",children:[Search.BathsFrom]}):""),(Search.ImprovedSQFTFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Title",children:["SQFT"]}):""),(Search.ImprovedSQFTFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Value",children:[Search.ImprovedSQFTFrom]}):""),(Search.LotSQFTFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Title",children:["Lot Size"]}):""),(Search.LotSQFTFrom+""!="0"?({tag:"div",className:"Search_Item_Info_Value",children:[Search.LotSQFTFrom]}):""),(Search.Cities+""!=""?({tag:"div",className:"Search_Item_Info_Title",children:["Cities"]}):""),(Search.Cities+""!=""?({tag:"div",className:"Search_Item_Info_Value",children:[Search.Cities]}):""),(Search.Zips+""!=""?({tag:"div",className:"Search_Item_Info_Title",children:["Zips"]}):""),(Search.Zips+""!=""?({tag:"div",className:"Search_Item_Info_Value",children:[Search.Zips]}):""),(Search.PropertyTypes+""!=""?({tag:"div",className:"Search_Item_Info_Title",children:["Property Types"]}):""),(Search.PropertyTypes+""!=""?({tag:"div",className:"Search_Item_Info_Value",children:[Search.PropertyTypes]}):"")]},{tag:"div",className:"Search_Item_Buttons",children:[(this.CurrentType==this.SearchTypes.Saved?({tag:"div",className:"Search_Item_Button",children:[{tag:"img",className:"PNG",src:"http://"+ConfigVars.assetsHost+"/images/newicons/textfield_rename.png",title:"Edit Search Title",onclick:this.EditTitle.bindAsEventListener(this,Search.PropertySearchID)}]}):""),(this.CurrentType==this.SearchTypes.Saved?({tag:"div",className:"Search_Item_Button",children:[{tag:"img",className:"PNG",src:"http://"+ConfigVars.assetsHost+"/images/newicons/feed.png",title:"Search RSS",onclick:this.ViewRss.bind(this,Search.PropertySearchID)}]}):""),(this.CurrentType==this.SearchTypes.Saved?({tag:"div",className:"Search_Item_Button",children:[{tag:"img",className:"PNG",src:"http://"+ConfigVars.assetsHost+"/images/newicons/delete.png",title:"Un-Save Search",onclick:this.UnSaveSearch.bind(this,Search.PropertySearchID)}]}):""),(this.CurrentType==this.SearchTypes.Recent?({tag:"div",className:"Search_Item_Button",children:[{tag:"img",className:"PNG",src:"http://"+ConfigVars.assetsHost+"/images/newicons/disk.png",title:"Save Search",onclick:this.EditTitle.bindAsEventListener(this,Search.PropertySearchID)}]}):"")]}]});this.Dashboard.appendChild(DOM)}}},ChangeType:function(A){this.Init(A);this.Show()},ViewSearch:function(A){location.href="/search/"+AccountVars.aid+"/"+AccountVars.sid+"/"+A.PropertySearchID},ViewRss:function(A){location.href="/Feed/RSS/"+A},UnSaveSearch:function(A){if(confirm("Are you sure you want to un-save this search? You will no longer receive property updates.")){YAHOO.util.Connect.asyncRequest("POST","/webservice/profile.asmx/UnSaveSearch",{success:this.UnSaveSearch_Success.bind(this)},$H({PropertySearchID:A}).toQueryString())}},UnSaveSearch_Success:function(A){this.Load()},SaveSearch:function(A){YAHOO.util.Connect.asyncRequest("POST","/webservice/profile.asmx/SaveSearch",{success:this.SaveSearch_Success.bind(this)},$H({PropertySearchID:A}).toQueryString())},SaveSearch_Success:function(A){this.Load()},EditTitle:function(B,A){var C=(typeof B.target!="undefined"?B.target:B.srcElement);var H=null,G=null,E=null,F=null;if(!this.SavedEditTitleDialog){$("Search_EditTitle_Dialog").style.display="block";this.SavedEditTitleDialog=new YAHOO.widget.Panel($("Search_EditTitle_Dialog"),{modal:false,visible:false,width:"250px",constrainviewport:true,draggable:false,underlay:"none",zIndex:1001,context:[C,"tr","br"]})}if(!this.RecentEditTitleDialog){$("RecentSearch_EditTitle_Dialog").style.display="block";this.RecentEditTitleDialog=new YAHOO.widget.Panel($("RecentSearch_EditTitle_Dialog"),{modal:false,visible:false,width:"250px",constrainviewport:true,draggable:false,underlay:"none",zIndex:1001,context:[C,"tr","br"]})}if(this.CurrentType==this.SearchTypes.Saved){this.EditTitleDialog=this.SavedEditTitleDialog;H=$("Search_EditTitle_Dialog");G=$("Search_EditTitle_Button");E=$("Search_EditTitle_Title");F=$("Search_Item_Title_"+A)}else{this.EditTitleDialog=this.RecentEditTitleDialog;H=$("RecentSearch_EditTitle_Dialog");G=$("RecentSearch_EditTitle_Button");E=$("RecentSearch_EditTitle_Title");F=$("Search_Item_Title_"+A)}var D=[new YAHOO.util.KeyListener(document,{keys:27},{fn:this.EditTitleDialog.hide.bind(this.EditTitleDialog)})];this.EditTitleDialog.cfg.setProperty("keylisteners",D);this.EditTitleDialog.render();E.value=F.innerHTML;this.EditTitleDialog.cfg.setProperty("context",[C,"br","tr"]);this.EditTitleDialog.show();E.focus();E.select();G.onclick=this.EditTitle_Save.bind(this,A)},EditTitle_Save:function(A){var B=null;var C=null;if(this.CurrentType==this.SearchTypes.Saved){B=$("Search_EditTitle_Title");C=$("Search_Item_Title_"+A)}else{B=$("RecentSearch_EditTitle_Title");C=$("Search_Item_Title_"+A)}this.EditTitleDialog.hide();YAHOO.util.Connect.asyncRequest("POST","/webservice/profile.asmx/SaveSearchInfo",{success:this.EditTitle_Save_Success.bind(this)},$H({PropertySearchID:A,Title:B.value}).toQueryString())},EditTitle_Save_Success:function(A){if(this.CurrentType!=this.SearchTypes.Saved){this.ChangeType(this.SearchTypes.Saved)}this.Load()}};
var RecaptchaTemplates={VertHtml:'<table id="recaptcha_table" class="recaptchatable" >\n<tr>\n<td colspan="6" class=\'recaptcha_r1_c1\'></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r2_c1\'></td>\n<td colspan="4" class=\'recaptcha_image_cell\'><div id="recaptcha_image"></div></td>\n<td class=\'recaptcha_r2_c2\'></td>\n</tr>\n<tr>\n<td rowspan="6" class=\'recaptcha_r3_c1\'></td>\n<td colspan="4" class=\'recaptcha_r3_c2\'></td>\n<td rowspan="6" class=\'recaptcha_r3_c3\'></td>\n</tr>\n<tr>\n<td rowspan="3" class=\'recaptcha_r4_c1\' height="49">\n<div class="recaptcha_input_area">\n<label for="recaptcha_response_field" class="recaptcha_input_area_text"><span id="recaptcha_instructions_image" class="recaptcha_only_if_image recaptcha_only_if_no_incorrect_sol"></span><span id="recaptcha_instructions_audio" class="recaptcha_only_if_no_incorrect_sol recaptcha_only_if_audio"></span><span id="recaptcha_instructions_error" class="recaptcha_only_if_incorrect_sol"></span></label><br/>\n<input name="recaptcha_response_field" id="recaptcha_response_field" type="text" />\n</div>\n</td>\n<td rowspan="4" class=\'recaptcha_r4_c2\'></td>\n<td><a id=\'recaptcha_reload_btn\' tabindex=\'-1\'><img id=\'recaptcha_reload\' width="25" height="17" /></a></td>\n<td rowspan="4" class=\'recaptcha_r4_c4\'></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_switch_audio_btn\' tabindex=\'-1\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="16" alt="" /></a><a id=\'recaptcha_switch_img_btn\' tabindex=\'-1\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="16" alt=""/></a></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_whatsthis_btn\' tabindex=\'-1\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r7_c1\'></td>\n<td class=\'recaptcha_r8_c1\'></td>\n</tr>\n</table>\n',VertCss:".recaptchatable td img {\n/* see http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps */\ndisplay: block;\n}\n.recaptchatable .recaptcha_r1_c1 { background: url(IMGROOT/sprite.png) -0px -63px no-repeat; width: 318px; height: 9px; }\n.recaptchatable .recaptcha_r2_c1 { background: url(IMGROOT/sprite.png) -18px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r2_c2 { background: url(IMGROOT/sprite.png) -27px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r3_c1 { background: url(IMGROOT/sprite.png) -0px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r3_c2 { background: url(IMGROOT/sprite.png) -18px -57px no-repeat; width: 300px; height: 6px; }\n.recaptchatable .recaptcha_r3_c3 { background: url(IMGROOT/sprite.png) -9px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r4_c1 { background: url(IMGROOT/sprite.png) -43px -0px no-repeat; width: 171px; height: 49px; }\n.recaptchatable .recaptcha_r4_c2 { background: url(IMGROOT/sprite.png) -36px -0px no-repeat; width: 7px; height: 57px; }\n.recaptchatable .recaptcha_r4_c4 { background: url(IMGROOT/sprite.png) -214px -0px no-repeat; width: 97px; height: 57px; }\n.recaptchatable .recaptcha_r7_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 171px; height: 8px; }\n.recaptchatable .recaptcha_r8_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 25px; height: 8px; }\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px;\n}\n/* some people break their style sheet, we need to clean up after them */\n#recaptcha_area, #recaptcha_table {\nwidth: 318px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\npadding:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\nfont-family:helvetica,sans-serif;\nfont-size:8pt;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\n}\n.recaptchatable img {\nborder:0px !important;\nmargin:0px !important;\npadding:0px !important;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nwidth:146px !important;\nheight:45px !important;\nmargin-left:20px !important;\nmargin-right:5px !important;\nmargin-top:4px !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\nbackground:none !important;\nheight:auto !important;\nwidth:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #recaptcha_response_field  {\nwidth:145px !important;\nposition:absolute !important;\nbottom:7px !important;\npadding:0px !important;\nmargin:0px !important;\nfont-size:10pt;\n}\n.recaptcha_theme_blackglass #recaptcha_response_field,\n.recaptcha_theme_white #recaptcha_response_field {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #recaptcha_response_field {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\n}\n#recaptcha_instructions_error {\ncolor:red !important;\n}\n",CleanHtml:'<table id="recaptcha_table" class="recaptchatable">\n<tr height="73">\n<td class=\'recaptcha_image_cell\' width="302"><center><div id="recaptcha_image"></div></center></td>\n<td style="padding: 10px 7px 7px 7px;">\n<a id=\'recaptcha_reload_btn\' tabindex=\'-1\'><img id=\'recaptcha_reload\' width="25" height="18" alt="" /></a>\n<a id=\'recaptcha_switch_audio_btn\' tabindex=\'-1\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="15" alt="" /></a><a id=\'recaptcha_switch_img_btn\' tabindex=\'-1\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="15" alt=""/></a>\n<a id=\'recaptcha_whatsthis_btn\' tabindex=\'-1\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a>\n</td>\n<td style="padding: 18px 7px 18px 7px;">\n<img id=\'recaptcha_logo\' alt="" width="71" height="36" />\n</td>\n</tr>\n<tr>\n<td style="padding-left: 7px;">\n<div class="recaptcha_input_area" style="padding-top: 2px; padding-bottom: 7px;">\n<input style="border: 1px solid #3c3c3c; width: 302px;" name="recaptcha_response_field" id="recaptcha_response_field" type="text" />\n</div>\n</td>\n<td></td>\n<td style="padding: 4px 7px 12px 7px;">\n<img id="recaptcha_tagline" width="71" height="17" />\n</td>\n</tr>\n</table>\n',CleanCss:".recaptchatable td img {\ndisplay: block;\n}\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px; \npadding: 7px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptchatable a img {\nborder:0px;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nborder:1px solid #dfdfdf !important;\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #recaptcha_response_field  {\nfont-size:11pt;\n}\n.recaptcha_theme_blackglass #recaptcha_response_field,\n.recaptcha_theme_white #recaptcha_response_field {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #recaptcha_response_field {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptcha_error_text {\ncolor:red;\n}\n"};var RecaptchaStr_en={visual_challenge:"Get a visual challenge",audio_challenge:"Get an audio challenge",refresh_btn:"Get a new challenge",instructions_visual:"Type the two words:",instructions_audio:"Type the eight numbers:",help_btn:"Help",cant_hear_this:"Can't hear the sound?",incorrect_try_again:"Incorrect. Try again."};var RecaptchaStr_de={visual_challenge:"Visuelle Aufgabe generieren",audio_challenge:"Audio-Aufgabe generieren",refresh_btn:"Neue Aufgabe generieren",instructions_visual:"Gib die 2 W\u00f6rter ein:",instructions_audio:"Gib die 8 Ziffern ein:",help_btn:"Hilfe",cant_hear_this:"Kannst du nichts h\u00f6ren?",incorrect_try_again:"Falsch. Nochmals versuchen!"};var RecaptchaStr_es={visual_challenge:"Obt\u00e9n un reto visual",audio_challenge:"Obt\u00e9n un reto audible",refresh_btn:"Obt\u00e9n un nuevo reto",instructions_visual:"Escribe las 2 palabras:",instructions_audio:"Escribe los 8 n\u00fameros:",help_btn:"Ayuda",cant_hear_this:"\u00bfNo puedes o\u00edrel audio?",incorrect_try_again:"Incorrecto. Otro intento."};var RecaptchaStr_fr={visual_challenge:"D\u00e9fi visuel",audio_challenge:"D\u00e9fi audio",refresh_btn:"Nouveau d\u00e9fi",instructions_visual:"Entrez les deux mots:",instructions_audio:"Entrez les huit chiffres:",help_btn:"Aide",cant_hear_this:"Vous n'entendez pas de son?",incorrect_try_again:"Incorrect."};var RecaptchaStr_nl={visual_challenge:"Test me via een afbeelding",audio_challenge:"Test me via een geluidsfragment",refresh_btn:"Nieuwe uitdaging",instructions_visual:"Type de twee woorden:",instructions_audio:"Type de acht cijfers:",help_btn:"Help",cant_hear_this:"Kun je het geluid niet horen?",incorrect_try_again:"Foute invoer."};var RecaptchaStr_pt={visual_challenge:"Obter um desafio visual",audio_challenge:"Obter um desafio sonoro",refresh_btn:"Obter um novo desafio",instructions_visual:"Escreva as 2 palavras:",instructions_audio:"Escreva os 8 numeros:",help_btn:"Ajuda",cant_hear_this:"N\u00e3o consegue ouvir o som?",incorrect_try_again:"Incorrecto. Tenta outra vez."};var RecaptchaStr_ru={visual_challenge:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",audio_challenge:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",refresh_btn:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",instructions_visual:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430:",instructions_audio:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u043e\u0441\u0435\u043c\u044c \u0447\u0438\u0441\u0435\u043b:",help_btn:"\u041f\u043e\u043c\u043e\u0449\u044c",cant_hear_this:"\u041d\u0435 \u0441\u043b\u044b\u0448\u0438\u0442\u0435 \u0437\u0432\u0443\u043a\u0430?",incorrect_try_again:"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e."};var RecaptchaStr_tr={visual_challenge:"G\u00f6rsel deneme",audio_challenge:"\u0130\u015Fitsel deneme",refresh_btn:"Yeni deneme",instructions_visual:"\u0130ki kelimeyi yaz\u0131n:",instructions_audio:"Sekiz numaray\u0131 yaz\u0131n:",help_btn:"Yard\u0131m (\u0130ngilizce)",cant_hear_this:"Duyamad\u0131n\u0131z m\u0131?",incorrect_try_again:"Yanl\u0131\u015f. Bir daha deneyin."};var RecaptchaLangMap={en:RecaptchaStr_en,de:RecaptchaStr_de,es:RecaptchaStr_es,fr:RecaptchaStr_fr,nl:RecaptchaStr_nl,pt:RecaptchaStr_pt,ru:RecaptchaStr_ru,tr:RecaptchaStr_tr};var RecaptchaStr=RecaptchaStr_en;var RecaptchaOptions;var RecaptchaDefaultOptions={tabindex:0,theme:"red",callback:null,lang:"en",custom_theme_widget:null};var Recaptcha={widget:null,timer_id:-1,style_set:false,theme:null,type:"image",ajax_verify_cb:null,$:function(A){if(typeof (A)=="string"){return document.getElementById(A)}else{return A}},create:function(C,B,A){Recaptcha.destroy();if(B){Recaptcha.widget=Recaptcha.$(B)}Recaptcha._init_options(A);Recaptcha._call_challenge(C)},destroy:function(){var B=Recaptcha.$("recaptcha_challenge_field");if(B){B.parentNode.removeChild(B)}if(Recaptcha.timer_id!=-1){clearInterval(Recaptcha.timer_id)}Recaptcha.timer_id=-1;var A=Recaptcha.$("recaptcha_image");if(A){A.innerHTML=""}if(Recaptcha.widget){if(Recaptcha.theme!="custom"){Recaptcha.widget.innerHTML=""}else{Recaptcha.widget.style.display="none"}Recaptcha.widget=null}},focus_response_field:function(){var A=Recaptcha.$;var B=A("recaptcha_response_field");B.focus()},get_challenge:function(){if(typeof (RecaptchaState)=="undefined"){return null}return RecaptchaState.challenge},get_response:function(){var A=Recaptcha.$;var B=A("recaptcha_response_field");if(!B){return null}return B.value},ajax_verify:function(B){Recaptcha.ajax_verify_cb=B;var A=Recaptcha._get_api_server()+"/ajaxverify?c="+encodeURIComponent(Recaptcha.get_challenge())+"&response="+encodeURIComponent(Recaptcha.get_response());Recaptcha._add_script(A)},_ajax_verify_callback:function(A){Recaptcha.ajax_verify_cb(A)},_get_api_server:function(){var B=window.location.protocol;var A;if(typeof (_RecaptchaOverrideApiServer)!="undefined"){A=_RecaptchaOverrideApiServer}else{if(B=="https:"){A="api-secure.recaptcha.net"}else{A="api.recaptcha.net"}}return B+"//"+A},_call_challenge:function(A){var B=Recaptcha._get_api_server()+"/challenge?k="+A+"&ajax=1&cachestop="+Math.random();if(typeof (RecaptchaOptions.extra_challenge_params)!="undefined"){B+="&"+RecaptchaOptions.extra_challenge_params}Recaptcha._add_script(B)},_add_script:function(B){var A=document.createElement("script");A.type="text/javascript";A.src=B;Recaptcha._get_script_area().appendChild(A)},_get_script_area:function(){var A=document.getElementsByTagName("head");if(!A||A.length<1){A=document.body}else{A=A[0]}return A},_init_options:function(C){var B=RecaptchaDefaultOptions;var A=C||{};for(var D in A){B[D]=A[D]}RecaptchaOptions=B},challenge_callback:function(){var A=Recaptcha.widget;Recaptcha._reset_timer();var D=RecaptchaLangMap[RecaptchaOptions.lang];if(typeof (D)!="undefined"){RecaptchaStr=D}if(window.addEventListener){window.addEventListener("unload",function(E){Recaptcha.destroy()},false)}if(Recaptcha._is_ie()&&window.attachEvent){window.attachEvent("onbeforeunload",function(){})}if(navigator.userAgent.indexOf("KHTML")>0){var B=document.createElement("iframe");B.src="about:blank";B.style.height="0px";B.style.width="0px";B.style.visibility="hidden";B.style.border="none";var C=document.createTextNode("This frame prevents back/forward cache problems in Safari.");B.appendChild(C);document.body.appendChild(B)}Recaptcha._finish_widget()},_add_css:function(B){var A=document.createElement("style");A.type="text/css";if(A.styleSheet){if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+B+"</style>")}else{A.styleSheet.cssText=B}}else{if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+B+"</style>")}else{var C=document.createTextNode(B);A.appendChild(C)}}Recaptcha._get_script_area().appendChild(A)},_set_style:function(A){if(Recaptcha.style_set){return }Recaptcha.style_set=true;Recaptcha._add_css(A+"\n\n.recaptcha_is_showing_audio .recaptcha_only_if_image,.recaptcha_isnot_showing_audio .recaptcha_only_if_audio,.recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol,.recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol{display:none !important}")},_init_builtin_theme:function(){var F=Recaptcha.$;var H=RecaptchaStr;var C=RecaptchaState;var E,D,A;var G=C.server;if(G[G.length-1]=="/"){G=G.substring(0,G.length-1)}var B=G+"/img/"+Recaptcha.theme;if(Recaptcha.theme=="clean"){E=RecaptchaTemplates.CleanCss;D=RecaptchaTemplates.CleanHtml;A="png"}else{E=RecaptchaTemplates.VertCss;D=RecaptchaTemplates.VertHtml;A="gif"}E=E.replace(/IMGROOT/g,B);Recaptcha._set_style(E);Recaptcha.widget.innerHTML="<div id='recaptcha_area'>"+D+"</div>";F("recaptcha_reload").src=B+"/refresh."+A;F("recaptcha_switch_audio").src=B+"/audio."+A;F("recaptcha_switch_img").src=B+"/text."+A;F("recaptcha_whatsthis").src=B+"/help."+A;if(Recaptcha.theme=="clean"){F("recaptcha_logo").src=B+"/logo."+A;F("recaptcha_tagline").src=B+"/tagline."+A}F("recaptcha_reload").alt=H.refresh_btn;F("recaptcha_switch_audio").alt=H.audio_challenge;F("recaptcha_switch_img").alt=H.visual_challenge;F("recaptcha_whatsthis").alt=H.help_btn;F("recaptcha_reload_btn").href="javascript:Recaptcha.reload ();";F("recaptcha_reload_btn").title=H.refresh_btn;F("recaptcha_switch_audio_btn").href="javascript:Recaptcha.switch_type('audio');";F("recaptcha_switch_audio_btn").title=H.audio_challenge;F("recaptcha_switch_img_btn").href="javascript:Recaptcha.switch_type('image');";F("recaptcha_switch_img_btn").title=H.visual_challenge;F("recaptcha_whatsthis_btn").href=Recaptcha._get_help_link();F("recaptcha_whatsthis_btn").target="_blank";F("recaptcha_whatsthis_btn").title=H.help_btn;F("recaptcha_whatsthis_btn").onclick=function(){Recaptcha.showhelp();return false};F("recaptcha_table").className="recaptchatable recaptcha_theme_"+Recaptcha.theme;if(F("recaptcha_instructions_image")){F("recaptcha_instructions_image").appendChild(document.createTextNode(H.instructions_visual))}if(F("recaptcha_instructions_audio")){F("recaptcha_instructions_audio").appendChild(document.createTextNode(H.instructions_audio))}if(F("recaptcha_instructions_error")){F("recaptcha_instructions_error").appendChild(document.createTextNode(H.incorrect_try_again))}},_finish_widget:function(){var D=Recaptcha.$;var F=RecaptchaStr;var B=RecaptchaState;var A=RecaptchaOptions;var E=A.theme;switch(E){case"red":case"white":case"blackglass":case"clean":case"custom":break;default:E="red";break}if(!Recaptcha.theme){Recaptcha.theme=E}if(Recaptcha.theme!="custom"){Recaptcha._init_builtin_theme()}else{Recaptcha._set_style("")}var C=document.createElement("span");C.id="recaptcha_challenge_field_holder";C.style.display="none";D("recaptcha_response_field").parentNode.insertBefore(C,D("recaptcha_response_field"));D("recaptcha_response_field").setAttribute("autocomplete","off");D("recaptcha_image").style.width="300px";D("recaptcha_image").style.height="57px";Recaptcha.should_focus=false;Recaptcha._set_challenge(B.challenge,"image");if(A.tabindex){D("recaptcha_response_field").tabIndex=A.tabindex}if(Recaptcha.widget){Recaptcha.widget.style.display=""}if(A.callback){A.callback()}},switch_type:function(B){var A=Recaptcha;A.type=B;A.reload(A.type=="audio"?"a":"v")},reload:function(D){var B=Recaptcha;var C=B.$;var A=RecaptchaState;if(typeof (D)=="undefined"){D="r"}var E=A.server+"reload?c="+A.challenge+"&k="+A.site+"&reason="+D+"&type="+B.type;if(typeof (RecaptchaOptions.extra_challenge_params)!="undefined"){E+="&"+RecaptchaOptions.extra_challenge_params}B.should_focus=D!="t";B._add_script(E)},finish_reload:function(B,A){RecaptchaState.is_incorrect=false;Recaptcha._set_challenge(B,A)},_set_challenge:function(J,G){var F=Recaptcha;var C=RecaptchaState;var E=F.$;C.challenge=J;F.type=G;E("recaptcha_challenge_field_holder").innerHTML="<input type='hidden' name='recaptcha_challenge_field' id='recaptcha_challenge_field' value='"+C.challenge+"'/>";if(G=="audio"){var D=C.server+"image?c="+C.challenge;var B=D;if(B.indexOf("https://")==0){B="http://"+B.substring(8)}var A;if(F._is_ie()){A='<object height="40" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" src="'+B+'" ><param name="URL" value="'+B+'"><param name="autoStart" value="true"><param name="uimode" value="mini"></object>'}else{A='<EMBED SRC="'+D+'" height="40" bgcolor="white" AUTOSTART="true"/>'}var I='<br/><a class="recaptcha_audio_cant_hear_link" target="_blank" href="'+B+'">'+RecaptchaStr.cant_hear_this+"</a>";E("recaptcha_image").innerHTML=A+I}else{if(G=="image"){var H=C.server+"image?c="+C.challenge;E("recaptcha_image").innerHTML="<img style='display:block;' height='57' width='300' src='"+H+"'/>"}}Recaptcha._css_toggle("recaptcha_had_incorrect_sol","recaptcha_nothad_incorrect_sol",C.is_incorrect);Recaptcha._css_toggle("recaptcha_is_showing_audio","recaptcha_isnot_showing_audio",G=="audio");F._clear_input();if(F.should_focus){F.focus_response_field()}F._reset_timer()},_reset_timer:function(){var A=RecaptchaState;clearInterval(Recaptcha.timer_id);Recaptcha.timer_id=setInterval("Recaptcha.reload('t');",(A.timeout-60*5)*1000)},showhelp:function(){window.open(Recaptcha._get_help_link(),"recaptcha_popup","width=460,height=570,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes")},_clear_input:function(){var A=Recaptcha.$("recaptcha_response_field");A.value=""},_displayerror:function(B){var A=Recaptcha.$;A("recaptcha_image").innerHTML="";A("recaptcha_image").appendChild(document.createTextNode(B))},reloaderror:function(A){Recaptcha._displayerror(A)},_is_ie:function(){return(navigator.userAgent.indexOf("MSIE")>0)&&!window.opera},_css_toggle:function(A,B,E){var C=Recaptcha.widget;if(!C){C=document.body}var D=C.className;D=D.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ");D=D.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ");D+=" "+(E?A:B);C.className=D},_get_help_link:function(){var A=RecaptchaOptions.lang;return"http://recaptcha.net/popuphelp/"+(A=="en"?"":(A+".html"))}};
