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 b="",c=0;c<a.length;c++){if((a.length-c)%3==0&&c>0)b+=",";b+=a.charAt(c)}return b},
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 b=navigator.userAgent.toLowerCase();return/mozilla/.test(b)&&!/(compatible|webkit)/.test(b)?(new DOMParser).parseFromString(a.responseText,"text/xml"):a.responseXML},FormatBaths:function(a,b){a=parseFloat(String(a));if(isFinite(a)){var c=Math.round((a-Math.floor(a))*
100),d=Math.round(Math.floor(a)-c);return d+(c==0?"":" full "+c+" part")+(typeof b=="undefined"||b?d+c>1?" baths":" bath":"")}else return"0"+(typeof b=="undefined"||b?" 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,b,c){if(c){var d=new Date;d.setTime(d.getTime()+c*24*60*60*1E3);c="; expires="+d.toGMTString()}else c="";document.cookie=a+"="+b+c+"; path=/"},readCookie:function(a){a=a+"=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];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,b){var c=this.slice((b||a)+1||this.length);this.length=a<0?this.length+a:a;return this.push.apply(this,c)};
Featured_Slider={currentPropertyIndex:-1,Settings:{MasterAccountID:0,SearchSetupID:0,LinkID:0,Width:200,Height:188,DomID:"",SlidePause:4E3},BaseUrl:"",Stage:null,HomeURL:"http://"+window.location.host,Slide:true,TransitionDirection:"side",InnerHeight:0,InnerWidth:0,BuildLinkUrl:function(a,b){var c=this.BaseUrl;c+=typeof b!="undefined"&&String(b)!="0"?(this.BaseUrl.indexOf("?")>=0||this.BaseUrl.toLowerCase().indexOf(".aspx/")>=0?"&":this.BaseUrl.indexOf("#")>=0?"&":"#")+"PropertyID="+b+"&PerformSearch":
(this.BaseUrl.indexOf("?")>=0||this.BaseUrl.toLowerCase().indexOf(".aspx/")>=0?"&":this.BaseUrl.indexOf("#")>=0?"&":"#")+"PerformSearch";return c},Init:function(){if(this.Stage=document.getElementById(this.Settings.DomID)){arguments="MasterAccountID="+this.Settings.MasterAccountID+"&SearchSetupID="+this.Settings.SearchSetupID+"&LinkID="+this.Settings.LinkID+"&sessid="+Global.sessid;YAHOO.util.Connect.asyncRequest("POST","/webservice/QueryPropertiesForModules.asmx/Module_PerformFeaturedSearch",{success:this.PropertySuccess,
failure:this.PropertyFailure,scope:this},arguments)}},InitStage:function(){this.TransitionDirection=this.Settings.Width<this.Settings.Height?"side":"top";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";var a=$E({tag:"div",className:"Navigation",children:[{tag:"img",className:"Navigation_Button",src:"http://cdn3.diverse-cdn.com/idx-v2/assets-images/newicons/resultset_previous.png/7d9b8f"},
{tag:"img",id:"ds_PlayPausecontrol",className:"Navigation_Button",src:"http://cdn4.diverse-cdn.com/idx-v2/assets-images/newicons/control_pause_blue.png/a3d841"},{tag:"img",className:"Navigation_Button",src:"http://cdn3.diverse-cdn.com/idx-v2/assets-images/newicons/resultset_next.png/d9b56b"}]});a.style.width=this.InnerWidth+"px";a.style.top=this.InnerHeight-18+"px";a.firstChild.style.left="0px";a.firstChild.onclick=this.BackPop.bind(this);a.childNodes[1].style.left=this.InnerWidth/2-8+"px";a.childNodes[1].onclick=
this.PausePop.bind(this);a.lastChild.style.left=this.InnerWidth-16+"px";a.lastChild.onclick=this.ForwardPop.bind(this);this.Stage.appendChild(a)},BackPop:function(){this.PausePop();this.DropProperty();if(this.currentPropertyIndex==0)this.currentPropertyIndex=this.properties.length-2;else this.currentPropertyIndex-=2;this.PopProperty()},PausePop:function(){this.Slide=false;this.Timeout&&window.clearTimeout(this.Timeout);var a=document.getElementById("ds_PlayPausecontrol");a.src="http://cdn4.diverse-cdn.com/idx-v2/assets-images/newicons/control_play_blue.png/7e8ab0";
a.onclick=this.PlayPop.bind(this)},PlayPop:function(){this.DropProperty();this.Slide=true;this.Timeout&&window.clearTimeout(this.Timeout);var a=document.getElementById("ds_PlayPausecontrol");a.src="http://cdn4.diverse-cdn.com/idx-v2/assets-images/newicons/control_pause_blue.png/a3d841";a.onclick=this.PausePop.bind(this);this.PopProperty()},ForwardPop:function(){this.PausePop();this.DropProperty();if(this.currentPropertyIndex==this.properties.length-1)this.currentPropertyIndex=-1;this.PopProperty()},
PropertySuccess:function(a){try{this.properties=this.XmlToObjects(a.responseXML)}catch(b){typeof console!="undefined"&&console.log(b)}if(this.properties.length>0){this.InitStage();this.PopProperty()}else this.ShowNoListings()},PropertyFailure:function(){this.ShowNoListings()},ShowNoListings:function(){var a=$E({tag:"div",className:"NoProperties",children:["Unfortunately there are no listings available at this time, please click ",{tag:"a",href:"javascript:void(0);",onclick:this.GoToMainSearch.bind(this),
children:["here"]}," to search more listings"]});a.style.textAlign="center";this.Stage.appendChild(a)},GoToMainSearch:function(){var a=this.BuildLinkUrl();if(this.FramedPage)top.location.href=a;else window.open(a,"_blank","")},ClickPropertyPreview:function(a){a=this.BuildLinkUrl(this.Settings.LinkID,a.PropertyID);if(this.FramedPage)top.location.href=a;else window.open(a,"_blank","")},XmlToObjects:function(a){this._isQueryActive=false;var b={},c=[];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"&&c.push(a.childNodes[d].childNodes[e]);break;case "savedsearchid":break}b.results=[];for(d=0;d<c.length;d++)if(c[d].nodeType!=3){b.results.push({});for(e=0;e<c[d].childNodes.length;e++)if(!(c[d].childNodes[e].nodeType==3||!c[d].childNodes[e].firstChild))b.results[d][c[d].childNodes[e].tagName]=
c[d].childNodes[e].firstChild.nodeValue}return b.results},PopProperty:function(){this.currentPropertyIndex++;if(this.currentPropertyIndex==this.properties.length)this.currentPropertyIndex=0;var a=this.properties[this.currentPropertyIndex];if(a.dom){a.dom.style.top=this.InnerHeight*-1-10+"px";a.dom.style.left="4px"}else{var b="http://cdn1.diverse-cdn.com/idx-v2/assets-images/beast/nophotoavailable.gif/33c1dc";if(a.PhotoCount>0)b=this.InnerWidth>=270?"http://mls-photos.diversesolutions.com/"+a.FeedID+
"/"+a.MlsNumber.toLowerCase()+"/0-medium.jpg":"http://mls-photos.diversesolutions.com/"+a.FeedID+"/"+a.MlsNumber.toLowerCase()+"/0-thumb.jpg";a.dom=$E({tag:"div",className:"Property",children:[{tag:"a",href:"javascript:void(0);",onclick:this.ClickPropertyPreview.bind(this,a),children:[{tag:"div",className:"Property_Info",children:[{tag:"div",className:"Property_Price",children:["$"+Formatters.formatNumber(a.Price)]},{tag:"div",className:"Property_Info_Item",children:[a.Address]},{tag:"div",className:"Property_Info_Item",
children:[a.City+(a.Zip!=""&&typeof a.Zip!="undefined"?", "+a.Zip:"")]},{tag:"div",className:"Property_Info_Item",children:[{tag:"b",children:["Beds: "]},a.Beds!="0"?a.Beds:"n/a"," ",{tag:"b",children:["Baths: "]},a.Baths!="0.00"?Global.FormatBaths(a.Baths,false):"n/a"]},{tag:"div",className:"Property_Info_Item",children:a.ImprovedSqFt!="0"&&a.ImprovedSqFt!=undefined?[{tag:"b",children:["Size: "]},a.ImprovedSqFt+" sqft"]:[]},{tag:"div",className:"Property_Info_Item",children:a.LotSqFt!="0"?[{tag:"b",
children:["Lot Size: "]},a.LotSqFt+" sqft"]:[]},!this.ShowMLSNumOnModules?{}:{tag:"div",className:"Property_Info_Item",children:["MLS# "+a.MlsNumber]},typeof a.ListingAgentOffice!="undefined"&&a.ListingAgentOffice!=""?{tag:"div",className:"Property_Info_Item",children:["Listed With: "+a.ListingAgentOffice]}:{}]},{tag:"div",className:"Property_ClickToView",children:["click to view"]},{tag:"div",className:"Property_Fade"},{tag:"div",className:"Property_Photo",children:[a.IconPath?{tag:"img",src:"/images/MlsIcons/"+
a.IconPath,className:"MlsIcon"}:{}]}]}]});a.dom.style.width=this.InnerWidth-18+"px";a.dom.style.height=this.InnerHeight-34+"px";a.dom.style.top=this.InnerHeight*-1-10+"px";a.dom.firstChild.lastChild.style.background="transparent url("+b+") no-repeat bottom center";a.dom.firstChild.lastChild.style.width=this.InnerWidth-18+"px";a.dom.firstChild.lastChild.style.height=this.InnerHeight-48+"px";a.dom.firstChild.firstChild.style.width=this.InnerWidth-18+"px";if(window.XMLHttpRequest){a.dom.firstChild.childNodes[2].style.background=
"transparent url(Fade.png) repeat-x left top";a.dom.firstChild.childNodes[2].style.width=this.InnerWidth+"px"}this.Stage.firstChild?this.Stage.insertBefore(a.dom,this.Stage.firstChild):this.Stage.appendChild(a.dom)}b=null;if(this.TransitionDirection=="side")b={left:{from:this.InnerWidth*-1,to:4},top:{from:4,to:4},opacity:{from:0,to:1}};else if(this.TransitionDirection=="top")b={top:{from:this.InnerHeight*-1,to:4},left:{from:4,to:4},opacity:{from:0,to:1}};a.effect=new YAHOO.util.Anim(a.dom,b,0.5,YAHOO.util.Easing.easeIn);
a.effect.animate();if(this.Slide)this.Timeout=window.setTimeout(this.DropProperty.bind(this),this.Settings.SlidePause)},CheckPhotoLoad:function(a){var b=a.dom.firstChild.lastChild.firstChild;b.width>0||b.offsetWidth>0?this.PhotoLoad(a,b.width>0?b.width:b.offsetWidth,b.height>0?b.height:b.offsetHeight):setTimeout(this.CheckPhotoLoad.bind(this,a),250)},PhotoLoad:function(a,b,c){var d=a.dom.firstChild.lastChild.firstChild;c=this.InnerHeight-34-c-4;d.style.left=(this.InnerWidth-13)/2-b/2+"px";d.style.top=
c+"px";d.style.visibility="visible";if(!window.XMLHttpRequest&&c<a.dom.firstChild.firstChild.offsetTop+a.dom.firstChild.firstChild.offsetHeight){a.dom.firstChild.firstChild.style.width=this.InnerWidth+"px";a.dom.firstChild.firstChild.style.background="white"}},DropProperty:function(){if(this.currentPropertyIndex>=0){var a=this.properties[this.currentPropertyIndex],b={top:{to:this.InnerHeight+10},opacity:{to:0}};b=null;if(this.TransitionDirection=="side")b={left:{to:this.InnerWidth+10},top:{from:4,
to:4},opacity:{to:0}};else if(this.TransitionDirection=="top")b={top:{to:this.InnerHeight+10},left:{from:4,to:4},opacity:{to:0}};a.effect=new YAHOO.util.Anim(a.dom,b,0.5,YAHOO.util.Easing.easeIn);a.effect.animate();this.Slide&&window.setTimeout(this.PopProperty.bind(this),250)}}};
function $E(a){var b;if("string"==typeof a)b=document.createTextNode(a);else{b=document.createElement(a.tag);delete a.tag;if("undefined"!=typeof a.children){if("string"==typeof a.children||"undefined"==typeof a.children.length)b.appendChild($E(a.children));else for(var c=0,d=null;"undefined"!=typeof(d=a.children[c]);c++)b.appendChild($E(d));delete a.children}for(attr in a)b[attr]=a[attr]}return b}
var Formatters={formatNumber:function(a){var b="";a=String(a);for(var c=a.length-3;c>=0;c-=3)b=","+a.substring(c,c+3)+b;if(a.length%3>0)b=a.substring(0,a.length%3)+b;if(b.charAt(0)==",")b=b.substring(1);return b}};if(typeof Function.prototype.bind=="undefined")Function.prototype.bind=function(){var a=this,b=$A(arguments),c=b.shift();return function(){return a.apply(c,b.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 b=[],c=0;c<a.length;c++)b.push(a[c]);return b}};

