if (typeof Beast == "undefined") Beast = {};
/* SWFObject v2.2
is released under the MIT License
*/
Beast.swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab 0) return Beast.Frames[0].GetViewportScroll();
else return 0;
},
DocumentResized: function(Height, ScrollY) {
if (Beast.Frames.length > 0) return Beast.Frames[0].DocumentResized(Height, ScrollY);
else return 0;
},
ScrollTo: function(Y) {
if (Beast.Frames.length > 0) return Beast.Frames[0].ScrollTo(Y);
else return 0;
},
FlashReceiveMessage: function(e) {
if (Beast.Frames.length > 0) return Beast.Frames[0].FlashReceiveMessage(e);
else return 0;
}
};
Beast.FrameConstructor = function(id) {
Beast.FrameCount++;
this.DomId = '_dsSearchAgent_Idx_Frame_' + id;
this.BaseUrl = 'https://idx.diversesolutions.com/link/303518';
this.Query = '';
this.IdxDomain = 'local.idx.diversesolutions.com';
this.ColorSchemeID = 0;
this.GoogleAnalyticsTrackingCode = '';
this.FirstResize = false;
this.WindowLoaded = false;
this.HasPostMessage = window['postMessage'];
this.HasSetScrollStyle = false;
this.LastHash = "";
this.HasSentReferringUrl = false;
this.HasAnalytics = false;
this.JSON = typeof JSON != "undefined" && typeof JSON.parse != "undefined" ? JSON : Beast.JSON;
this.GetViewportScroll = function() {
var FrameDom = document.getElementById(this.DomId);
var XY = this.cumulativeOffset(FrameDom);
var ScrollTop = document.documentElement.scrollTop ?
document.documentElement.scrollTop :
document.body.scrollTop;
if (ScrollTop > XY[1]) return ScrollTop - XY[1];
else return 0
};
this.GetViewportScrollBottom = function() {
var FrameDom = document.getElementById(this.DomId);
var XY = this.cumulativeOffset(FrameDom);
var ScrollBottom = document.documentElement.scrollTop ?
document.documentElement.scrollTop :
document.body.scrollTop;
ScrollBottom += window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
if (ScrollBottom < XY[1]) return 0;
else if(ScrollBottom > XY[1] + FrameDom.offsetHeight) return FrameDom.offsetHeight;
else return ScrollBottom - XY[1];
};
this.BuildFrame = function() {
var BeastFrameProxy = this;
var hash = '', query = '';
// Handle nested iframes (some clients use websites like websitebox.com which includes an iframe on top of custom script!)
// We want to get the hash values from topmost window
var location;
try
{
var search = window.top.location.search;
location = window.top.location;
}
catch (err)
{
location = window.location;
}
// hack to transfer marketing urls to
var linkIdMatch = /linkid=(\d+)/i.exec(location.search);
if (linkIdMatch == null) linkIdMatch = /linkid=(\d+)/i.exec(location.hash);
if (linkIdMatch != null) {
if (this.BaseUrl.indexOf("/link/") == -1) {
if (this.BaseUrl.lastIndexOf("/") == this.BaseUrl.length - 1) this.BaseUrl = this.BaseUrl.substring(0, this.BaseUrl.length - 1)
this.BaseUrl += "/link/" + linkIdMatch[1];
} else {
this.BaseUrl = this.BaseUrl.replace(/\/link\/(\d+)/i, "/link/" + linkIdMatch[1]);
}
}
var urlhash = location.hash != undefined ? location.hash.replace(/\+/g,' ') : '';
var search = location.search != undefined ? location.search.replace(/\+/g,' ') : '';
if(urlhash.match(/(%3d|%26)/gi)) urlhash = decodeURIComponent(urlhash);
if(search.match(/(%3d|%26)/gi)) search = decodeURIComponent(search);
if (this.BaseUrl.substring(0, 1) == "#") this.BaseUrl = this.BaseUrl.substring(1);
if (this.BaseUrl.substring(0, 1) == "/") this.BaseUrl = this.BaseUrl.substring(1);
if (urlhash.substring(0, 1) == "#") urlhash = urlhash.substring(1);
if (urlhash.substring(0, 1) == "&") urlhash = urlhash.substring(1);
if (search.substring(0, 1) == "?") search = search.substring(1);
if (search.substring(0, 1) == "&") search = search.substring(1);
//Remove parameter that Facebook sends back to us: Case 15515
if (search.indexOf('fb_ref=Default') != -1)
search = "";
if (search != "") {
hash = "#" + search + this.Query;
} else if (urlhash != "") {
hash = "#" + urlhash + this.Query;
} else {
hash = '#' + this.Query;
}
var preFeatureMatch = /\/featured$|\?\//.exec(this.BaseUrl);
if (preFeatureMatch)
this.BaseUrl = this.BaseUrl.replace("/featured", "");
var propertySearchMatch = /PropertySearchID=([0-9]+)/.exec(location.hash);
if (propertySearchMatch == null) { propertySearchMatch = /PropertySearchID=([0-9]+)/.exec(location.search); }
if (propertySearchMatch) {
this.BaseUrl += "/" + propertySearchMatch[1];
}
var mlsnumberMatch = /mlsnumber=([\w\d\-]+)/i.exec(location.search);
if (mlsnumberMatch == null) { mlsnumberMatch = /mlsnumber=([\w\d\-]+)/i.exec(location.hash); }
if (mlsnumberMatch) {
this.BaseUrl += "/mlsnumber/" + mlsnumberMatch[1];
}
var featuredMatch = /featured/i.exec(location.search);
if (featuredMatch == null) { featuredMatch = /featured/i.exec(location.hash); }
if (featuredMatch) {
this.BaseUrl += "/featured";
}
var featuredOfficeMatch = /featuredoffice/i.exec(location.search);
if (featuredOfficeMatch == null) { featuredOfficeMatch = /featuredoffice/i.exec(location.hash); }
if (featuredOfficeMatch) {
this.BaseUrl += "/featuredoffice";
}
var referralMatch = /ref=([a-zA-Z0-9]+)/i.exec(location.search);
if (referralMatch == null) { referralMatch = /ref=([a-zA-Z0-9]+)/i.exec(location.hash); }
if (referralMatch) {
this.BaseUrl += "/ref/" + referralMatch[1];
}
if (this.ColorSchemeID != 0)
this.BaseUrl += "/colorscheme/" + this.ColorSchemeID;
if (preFeatureMatch) {
this.BaseUrl += "/featured";
}
var uid = this.createUUID();
if (!this.HasPostMessage) {
hash += "&uid=" + uid;
}
if(this.GoogleAnalyticsTrackingCode && typeof _gaq != "undefined"){
this.gaid = '';
if(Object.prototype.toString.call(_gaq) == "[object Array]") {
for(var i=0,j=_gaq.length;i";
if (DivDom == null) {
document.write("")
DivDom = document.getElementById(this.DomId + "_div");
}
DivDom.innerHTML = FrameSrc;
this.LastHash = location.hash;
var FrameDom = document.getElementById(this.DomId);
if (FrameDom.parentNode.offsetWidth != 0)
FrameDom.style.width = (FrameDom.parentNode.offsetWidth < 720 ? 720 : FrameDom.parentNode.offsetWidth) + "px";
this.CheckReady();
this.ThisWindowScrolledProxy = function() { BeastFrameProxy.ThisWindowScrolled(); };
this.WindowLoadProxy = function() { BeastFrameProxy.WindowLoad(); };
this.UnLoadProxy = function() { BeastFrameProxy.UnLoad(); };
this.ReceiveMessageProxy = function(e) { BeastFrameProxy.ReceiveMessage(e); };
if (window.addEventListener) window.addEventListener("scroll", this.ThisWindowScrolledProxy, false);
else if (document.addEventListener) document.addEventListener("scroll", this.ThisWindowScrolledProxy, false);
else if (window.attachEvent) window.attachEvent("onscroll", this.ThisWindowScrolledProxy);
if (window.addEventListener) window.addEventListener("load", this.WindowLoadProxy, false);
else if (document.addEventListener) document.addEventListener("load", this.WindowLoadProxy, false);
else if (window.attachEvent) window.attachEvent("onload", this.WindowLoadProxy);
if (window.addEventListener) window.addEventListener("unload", this.UnLoadProxy, false);
else if (document.addEventListener) document.addEventListener("unload", this.UnLoadProxy, false);
else if (window.attachEvent) window.attachEvent("onunload", this.UnLoadProxy);
if (window.addEventListener) window.addEventListener("message", this.ReceiveMessageProxy, false);
else if (document.addEventListener) document.addEventListener("message", this.ReceiveMessageProxy, false);
else if (window.attachEvent) window.attachEvent("message", this.ReceiveMessageProxy);
if (window.addEventListener) window.addEventListener("onmessage", this.ReceiveMessageProxy, false);
else if (document.addEventListener) document.addEventListener("onmessage", this.ReceiveMessageProxy, false);
else if (window.attachEvent) window.attachEvent("onmessage", this.ReceiveMessageProxy);
if (!this.HasPostMessage) {
var flashvars = { uid: uid };
var params = { allowScriptAccess: "always" };
var attributes = { name: "BeastFrameCommunicatorParent" };
var BeastFrameCommunicatorDiv = document.createElement("div");
BeastFrameCommunicatorDiv.id = "BeastFrameCommunicatorParent";
FrameDom.parentNode.appendChild(BeastFrameCommunicatorDiv);
Beast.swfobject.embedSWF("//cdn.diversesolutions.com/idx-v2/scripts/controls/framecommunicator-parent.swf/aa20a9", "BeastFrameCommunicatorParent", "0", "0", "9.0.0", "", flashvars, params, attributes);
}
};
this.FlashReceiveMessage = function(data) {
this.ReceiveMessage({ data: data });
};
this.ReceiveMessage = function(e) {
var payload = null;
try {
payload = this.JSON.parse(e.data);
} catch (err) { }
if(payload && payload.command){
switch (payload.command.toLowerCase()) {
case "documentresized":
this.DocumentResized(payload.data);
this.ThisWindowScrolled(); // send back the scroll data to the child when we get child-resize message, this is because of iframe reload issues
break;
case "scrollto":
this.ScrollTo(payload.data);
break;
case "hashchange":
this.HashChange(payload.data);
break;
case "testanalytics":
this.SendMessage("testanalytics", { AccountID: this.gaid });
break;
case "analyticscommand":
_gaq.push(payload.data);
break;
case "enablefullscreen":
frame = document.getElementById(this.DomId);
frame.setAttribute('scrolling', 'yes');
frame.style.overflow = "auto";
frame.style.background = "white";
break;
case "disablefullscreen":
frame = document.getElementById(this.DomId);
frame.setAttribute('scrolling', 'no');
frame.style.overflow = "hidden";
frame.style.background = "transparent";
break;
case "navigateto":
window.top.location.assign(payload.data);
break;
}
this.SendMessage("referringurl", document.referrer);
try {
e.preventDefault();
} catch (err) { }
}
};
this.SendMessage = function(command, data) {
var FrameDom = document.getElementById(this.DomId);
var payload = {
command: command,
data: data
};
try {
if (!this.HasPostMessage) {
var movie = navigator.appName.indexOf("Microsoft") != -1 ? window["BeastFrameCommunicatorParent"] : document["BeastFrameCommunicatorParent"];
movie.callPostMessageParent(this.JSON.stringify(e.data));
} else {
FrameDom.contentWindow.postMessage(this.JSON.stringify(payload), "*");
}
} catch (e) { return false; }
};
this.HashChange = function(newhash) {
location.hash = newhash;
};
this.CheckReady = function() {
var BeastFrameProxy = this;
var FrameDom = document.getElementById(this.DomId);
if (!FrameDom.parentNode.nextSibling && !this.WindowLoaded) {
FrameDom.style.width = (FrameDom.parentNode.offsetWidth < 720 ? 720 : FrameDom.parentNode.offsetWidth) + "px";
setTimeout(function() { BeastFrameProxy.CheckReady(); }, 250);
} else {
FrameDom.style.width = (FrameDom.parentNode.offsetWidth < 720 ? 720 : FrameDom.parentNode.offsetWidth) + "px";
}
};
this.UnLoad = function() {
var BeastFrameProxy = this;
if (window.addEventListener) window.removeEventListener("scroll", this.ThisWindowScrolledProxy, false);
else if (document.addEventListener) document.removeEventListener("scroll", this.ThisWindowScrolledProxy, false);
else if (window.attachEvent) window.detachEvent("onscroll", this.ThisWindowScrolledProxy);
if (window.addEventListener) window.removeEventListener("load", this.WindowLoadProxy, false);
else if (document.addEventListener) document.removeEventListener("load", this.WindowLoadProxy, false);
else if (window.attachEvent) window.detachEvent("onload", this.WindowLoadProxy);
if (window.addEventListener) window.removeEventListener("unload", this.UnLoadProxy, false);
else if (document.addEventListener) document.removeEventListener("unload", this.UnLoadProxy, false);
else if (window.attachEvent) window.detachEvent("onunload", this.UnLoadProxy);
};
this.ThisWindowScrolled = function() {
this.SendMessage("parentscrolled", {
top: this.GetViewportScroll(),
bottom: this.GetViewportScrollBottom()
});
};
this.WindowLoad = function() {
this.WindowLoaded = true;
this.FixWidth();
this.SendMessage("parentscrolled", {
top: this.GetViewportScroll(),
bottom: this.GetViewportScrollBottom()
});
};
this.FixWidth = function() {
var FrameDom = document.getElementById(this.DomId);
FrameDom.style.width = (FrameDom.parentNode.offsetWidth < 720 ? 720 : FrameDom.parentNode.offsetWidth) + "px";
};
this.DocumentResized = function(Height) {
var FrameDom = document.getElementById(this.DomId);
if (typeof Height != "number") Height = 2000;
FrameDom.style.height = Height + "px";
if (FrameDom.parentNode.offsetWidth < 720) {
FrameDom.style.width = "720px";
} else if (FrameDom.parentNode.offsetWidth > 720 && FrameDom.style.width == '720') {
FrameDom.style.width = FrameDom.parentNode.offsetWidth + 'px';
}
if (!this.HasSetScrollStyle) {
FrameDom.style.overflow = "hidden";
FrameDom.scrolling = "no";
this.HasSetScrollStyle = true;
}
};
this.ScrollTo = function(Y) {
if (Y === undefined || isNaN(Y)) //DIV-15302 If 'Y' is not valid then return
return;
var BeastFrameProxy = this;
var FrameDom = document.getElementById(this.DomId);
var XY = this.cumulativeOffset(FrameDom);
var ScrollToY = XY[1] + Y;
var StartY = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
var DistanceY = ScrollToY - StartY;
var ViewportHieght = document.documentElement.clientHeight;
if (ScrollToY === undefined || isNaN(ScrollToY) || (StartY < ScrollToY)) //DIV-15302 If 'ScrollToY' is not valid then return
return;
window.scroll(0, StartY + DistanceY);
var AfterY = (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop);
if (AfterY != 0 && AfterY != StartY + DistanceY)
window.setTimeout(function () { BeastFrameProxy.ScrollTo(Y); }, 250);
};
/* from prototype 1.6 */
this.cumulativeOffset = function(element) {
var valueT = 0, valueL = 0;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
} while (element);
return this._returnOffset(valueL, valueT);
};
/* from prototype 1.6 */
this._returnOffset = function(l, t) {
var result = [l, t];
result.left = l;
result.top = t;
return result;
};
this.createUUID = function() {
// http://www.ietf.org/rfc/rfc4122.txt
var s = [];
var hexDigits = "0123456789ABCDEF";
for (var i = 0; i < 32; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[12] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
var uuid = s.join("");
return uuid;
};
this.StartHashSentry = function() {
var FrameProxy = this;
if (this.LastHash != window.top.location.hash) this.BuildFrame();
setTimeout(function() { FrameProxy.StartHashSentry() }, 500);
};
this.BuildFrame();
this.StartHashSentry();
};
}
Beast.Frames[Beast.FrameCount] = new Beast.FrameConstructor(Beast.FrameCount);