if(!window.Beast)window.Beast={};var Session={};
Global={Source:"",OnLoad:function(){AccountVars.allowVisitorRegistration&&typeof LoginStatus!="undefined"&&LoginStatus.init(this.OnVisitorCallback.bind(this))},OnVisitorCallback:function(){YAHOO.util.Event.onAvailable("login_form",LoginDialog.init.bind(LoginDialog));YAHOO.util.Event.onAvailable("newuser_form",NewUserDialog.init.bind(NewUserDialog));LoginStatus.showStatus($("LoginDialog"))},FormatPrice:function(a){a=a+"";for(var c="",b=0;b<a.length;b++){if((a.length-b)%3==0&&b>0)c+=",";c+=a.charAt(b)}return c},
ValidateEmailAddress:function(a){return a.indexOf(".")>0&&a.indexOf("@")>0&&a!=""},GetScrollY:function(){return(window.scrollY?window.scrollY:document.documentElement.scrollTop)+Beast.FrameCommunicator.GetParentScroll()},FixXmlDoc:function(a){var c=navigator.userAgent.toLowerCase();return/mozilla/.test(c)&&!/(compatible|webkit)/.test(c)?(new DOMParser).parseFromString(a.responseText,"text/xml"):a.responseXML},FormatBaths:function(a,c){a=parseFloat(String(a));if(isFinite(a)){var b=Math.round((a-Math.floor(a))*
100),d=Math.round(Math.floor(a)-b);return d+(b==0?"":" full "+b+" part")+(typeof c=="undefined"||c?d+b>1?" baths":" bath":"")}else return"0"+(typeof c=="undefined"||c?" baths":"")},showAgentChat:function(){var a="";if(Session.CurrentVisitor&&Session.CurrentVisitor.Email)a="&Name="+Session.CurrentVisitor.FirstName+" "+Session.CurrentVisitor.LastName+"&Email="+Session.CurrentVisitor.Email;window.open("http://chat.dsagentchat.com/?PublicId="+AccountVars.agentChatTargetPublicId+a,"","width=444,height=444")},
createCookie:function(a,c,b){if(b){var d=new Date;d.setTime(d.getTime()+b*24*60*60*1E3);b="; expires="+d.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"},readCookie:function(a){a=a+"=";for(var c=document.cookie.split(";"),b=0;b<c.length;b++){for(var d=c[b];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)==0)return d.substring(a.length,d.length)}return null},eraseCookie:function(a){Global.createCookie(a,"",-1)},thirdPartyFrame:function(a){if($("ThirdPartyFrame"))a();else{$("ThirdPartyFrameContainer").update("<iframe id='ThirdPartyFrame' name='ThirdPartyFrame' src='/ThirdPartyFrame.aspx?MasterAccountID="+
AccountVars.aid+"&SearchSetupID="+AccountVars.sid+"' style='width:0px;height:0px;'></iframe>");Event.observe($("ThirdPartyFrame").contentWindow,"load",a)}}};document.observe("dom:loaded",Global.OnLoad.bind(Global));Array.prototype.remove=function(a,c){var b=this.slice((c||a)+1||this.length);this.length=a<0?this.length+a:a;return this.push.apply(this,b)};
Featured_Map={Settings:{MasterAccountID:0,SearchSetupID:0,LinkID:0,Width:500,Height:350,DomID:"",Sort:"",SortDir:""},BaseUrl:"",Stage:null,HomeURL:"http://"+location.host,BuildLinkUrl:function(a,c){var b=this.BaseUrl;b+=typeof c!="undefined"&&String(c)!="0"?(this.BaseUrl.indexOf("?")>=0||this.BaseUrl.toLowerCase().indexOf(".aspx/")>=0?"&":this.BaseUrl.indexOf("#")>=0?"&":"#")+"PropertyID="+c+"&PerformSearch":(this.BaseUrl.indexOf("?")>=0||this.BaseUrl.toLowerCase().indexOf(".aspx/")>=0?"&":this.BaseUrl.indexOf("#")>=
0?"&":"#")+"PerformSearch";return b},Init:function(){if(this.Stage=document.getElementById(this.Settings.DomID)){arguments="minPrice=-1&maxPrice=-1&minImprovedSqFt=-1&maxImprovedSqFt=-1&minLotSqFt=-1&maxLotSqFt=-1&minDaysOnMarket=-1&maxDaysOnMarket=-1&cities=&zipCodes=&mlsNumbers=&minBeds=-1&maxBeds=-1&minBaths=-1&maxBaths=-1&propertyTypes=&propertyFeatures=&listingAgentNameID=&listingAgentOfficeID=&minLatitude=-1&minLongitude=-1&maxLatitude=-1&maxLongitude=-1&orderColumn="+this.Settings.Sort+"&orderDirection="+
this.Settings.SortDir+"&resultPage=1&minYearBuilt=-1&maxYearBuilt=-1&communities=&tracts=&MasterAccountID="+this.Settings.MasterAccountID+"&SearchSetupID="+this.Settings.SearchSetupID+"&LinkID="+this.Settings.LinkID+"&sessid="+Global.sessid;YAHOO.util.Connect.asyncRequest("POST","/webservice/QueryPropertiesForModules.asmx/PerformMapSearch_Module",{success:this.PropertySuccess,failure:this.PropertyFailure,scope:this},arguments)}},InitStage:function(){this.InnerHeight=this.Settings.Height-2;this.InnerWidth=
this.Settings.Width-2;this.Stage.className="Stage";this.Stage.style.width=this.InnerWidth+"px";this.Stage.style.height=this.InnerHeight+"px";new GLatLngBounds;this.map=new GMap2(this.Stage);this.map.disableDragging();this.map.setCenter(new GLatLng(0,0),0);this.icon=new GIcon;this.icon.image="http://cdn1.diverse-cdn.com/idx-v2/assets-images/newicons/house_map_marker.png/fa357c";this.icon.shadow="http://cdn3.diverse-cdn.com/idx-v2/assets-images/newicons/house_map_marker_shadow.png/d4aee1";this.icon.iconSize=
new GSize(28,44);this.icon.shadowSize=new GSize(51,45);this.icon.iconAnchor=new GPoint(14,44);this.icon.infoWindowAnchor=new GPoint(14,44)},PropertySuccess:function(a){var c=new GLatLngBounds;this.properties=this.XmlToObjects(a.responseXML);this.InitStage();var b=0,d=0;for(a=0;a<this.properties.length;a++){b=parseFloat(this.properties[a].Latitude);d=parseFloat(this.properties[a].Longitude);c.extend(new GLatLng(b,d));b=new GLatLng(b,d);b=new GMarker(b,this.icon);this.properties[a].marker=b;GEvent.addListener(b,
"click",this.ClickPropertyPreview.bind(this,this.properties[a]));GEvent.addListener(b,"mouseover",this.ShowPropertyPreview.bind(this,this.properties[a]));GEvent.addListener(b,"mouseout",this.HidePropertyPreview.bind(this,this.properties[a]));this.map.addOverlay(b)}this.map.checkResize();this.map.setZoom(this.map.getBoundsZoomLevel(c));this.map.setCenter(c.getCenter())},ClickPropertyPreview:function(a){a=this.BuildLinkUrl(this.Settings.LinkID,a.PropertyID);if(this.FramedPage)top.location.href=a;else window.open(a,
"_blank","")},ShowPropertyPreview:function(a){var c=this.map.fromLatLngToDivPixel(a.marker.getPoint());if(a.dom)a.dom.style.display="block";else{a.dom=$E({tag:"div",className:"Property",children:[{tag:"div",className:"Property_Inner",children:[{tag:"div",className:"Property_Photo",children:[{tag:"img",src:parseInt(a.PhotoCount+"")==0?"http://cdn1.diverse-cdn.com/idx-v2/assets-images/beast/nophotoavailable.gif/33c1dc":"http://mls-photos.diversesolutions.com/"+a.FeedID+"/"+a.MlsNumber.toLowerCase()+
"/0-thumb.jpg",className:"MlsImage"},a.IconPath?{tag:"img",src:"/images/MlsIcons/"+a.IconPath,className:"MlsIcon"}:{}]},{tag:"div",className:"Property_Price",children:["$"+Formatters.formatNumber(a.Price)]},{tag:"div",className:"Property_BedBath",children:[a.Beds+(a.Beds==1?" Bedroom":" Bedrooms")]},{tag:"div",className:"Property_BedBath",children:[Global.FormatBaths(a.Baths)]},{tag:"div",className:"Property_SQFT",children:a.ImprovedSqFt!="0"&&a.ImprovedSqFt!=undefined?[a.ImprovedSqFt+" Sqft"]:[]},
!this.ShowMLSNumOnModules?{}:{tag:"div",className:"Property_MLSNumber",children:["MLS# "+a.MlsNumber]},typeof a.ListingAgentOffice!="undefined"&&a.ListingAgentOffice!=""?{tag:"div",className:"Property_Office",children:["Listed With: "+a.ListingAgentOffice]}:{}]}]});a.dom.style.left="0px";a.dom.style.top="0px";a.dom.style.visibility="hidden";document.body.appendChild(a.dom);var b=false;if(a.dom.offsetWidth+c.x+20>this.Settings.Width)if(c.x-20-a.dom.offsetWidth>0)a.dom.style.left=c.x-20-a.dom.offsetWidth+
"px";else{a.dom.style.left="4px";a.dom.style.top=c.y+4+"px";b=true}else a.dom.style.left=c.x+20+"px";a.dom.style.top=a.dom.offsetHeight+c.y-44>this.Settings.Height?b?c.y-44-4-a.dom.offsetHeight+"px":this.Settings.Height-4-a.dom.offsetHeight+"px":b?c.y+4+"px":c.y-44+"px";a.dom.style.visibility="visible"}},HidePropertyPreview:function(a){if(a.dom)a.dom.style.display="none"},PropertyFailure:function(){},XmlToObjects:function(a){this._isQueryActive=false;var c={},b=[];a=a.lastChild;for(var d=0;d<a.childNodes.length;d++)if(typeof a.childNodes[d].tagName!=
"undefined")switch(a.childNodes[d].tagName.toLowerCase()){case "totalcount":break;case "properties":for(var e=0;e<a.childNodes[d].childNodes.length;e++)typeof a.childNodes[d].childNodes[e].tagName!="undefined"&&b.push(a.childNodes[d].childNodes[e]);break;case "savedsearchid":break}c.results=[];for(d=0;d<b.length;d++)if(b[d].nodeType!=3){c.results.push({});for(e=0;e<b[d].childNodes.length;e++)if(!(b[d].childNodes[e].nodeType==3||!b[d].childNodes[e].firstChild))c.results[d][b[d].childNodes[e].tagName]=
b[d].childNodes[e].firstChild.nodeValue}return c.results}};function $E(a){var c;if("string"==typeof a)c=document.createTextNode(a);else{c=document.createElement(a.tag);delete a.tag;if("undefined"!=typeof a.children){if("string"==typeof a.children||"undefined"==typeof a.children.length)c.appendChild($E(a.children));else for(var b=0,d=null;"undefined"!=typeof(d=a.children[b]);b++)c.appendChild($E(d));delete a.children}for(attr in a)c[attr]=a[attr]}return c}
var Formatters={formatNumber:function(a){var c="";a=String(a);for(var b=a.length-3;b>=0;b-=3)c=","+a.substring(b,b+3)+c;if(a.length%3>0)c=a.substring(0,a.length%3)+c;if(c.charAt(0)==",")c=c.substring(1);return c}};if(typeof Function.prototype.bind=="undefined")Function.prototype.bind=function(){var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}};
if(typeof $A=="undefined")var $A=Array.from=function(a){if(!a)return[];if(a.toArray)return a.toArray();else{for(var c=[],b=0;b<a.length;b++)c.push(a[b]);return c}};

