function MoxiechatVariables() { MoxiechatVariables.INSTANCE; this.tracking_info = new Array(); } MoxiechatVariables.getInstance = function() { if(typeof(MoxiechatVariables.INSTANCE) == 'undefined' || MoxiechatVariables.INSTANCE == null){ MoxiechatVariables.INSTANCE = new MoxiechatVariables(); } return MoxiechatVariables.INSTANCE; } MoxiechatVariables.prototype.setTrackingInfo = function(position, value){ this.tracking_info[position] = value; } MoxiechatVariables.prototype.getTrackingInfoQS = function(position, value) { var qs = ""; for(var i = 1; i < this.tracking_info.length; i++){ qs = qs + "&trackingInfo"+ i +"="+ encodeURIComponent(this.tracking_info[i]); } return qs; } var grayScreen = 6;var skinFilename = "7/null";var search_engine_suppress = 0;var y_based_suppress = 1;var new_usi_chat_session_id ="05178EFD3E201A314255DDDDE9AD608C"; window.onerror = stopError; function stopError(){ return true; } var properClickThrough = false; var USItimerID = ''; var USIdone = false; if(typeof(grayScreen) == 'undefined'){ grayScreen = 0; } if(typeof(skinFilename) == 'undefined'){ skinFilename = 0; } if(typeof(noChatPlease) != "undefined") { USIdone = true; properClickThrough = true; } if(typeof(search_engine_suppress) != "undefined" && search_engine_suppress == 1) { if((document.referrer.indexOf("google.com") != -1) || (document.referrer.indexOf("yahoo.com") != -1) || (document.referrer.indexOf("bing.com") != -1)) { USIdone = true; properClickThrough = true; } } var isFox = false; var isIE7 = false; var isIE6 = false; var isXPSP2 = false; if(typeof(navigator.appMinorVersion) != 'undefined'){ isXPSP2 = (navigator.appMinorVersion.toLowerCase().indexOf("sp2") != -1); } var requiredVersion = 6; var hasFlash = false; if(navigator.plugins && navigator.plugins.length) { for (x = 0; x < navigator.plugins.length; x++) { if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) { hasFlash = true; break; } } } else if(window.ActiveXObject) { try { oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + requiredVersion + "');"); if(oFlash){ hasFlash = true; } } catch(e) {} } if(hasFlash) { var onPage = false; function testYPos(e) { Y_pos = document.all? event.clientY: e.pageY - document.body.scrollTop - document.documentElement.scrollTop; if (Y_pos < 20 && onPage) { onPage = false; } if (Y_pos > 20 && !onPage) { onPage = true; } } if(typeof(y_based_suppress) != "undefined" && y_based_suppress == 1) { if (document.attachEvent) { document.attachEvent("onmousemove", testYPos); } if (document.addEventListener) { document.addEventListener("mousemove", testYPos, true); } } function regularChatDisplay() { USIdone = true; if(USItimerID != ''){ clearTimeout(USItimerID); } if(!properClickThrough && !onPage) { if(grayScreen != 0) { moxieShowShadow(); } window.onbeforeunload = null; showChat(); alert("Wait! Richard Johnston with RE/MAX Grand Central would like to chat with you now! Please hit 'Cancel' on the next window to remain on this page."); return "\n\nPress 'Cancel' below to begin your chat with Richard Johnston, RE/MAX Grand Central...\n\n"; } } function showChat() { var e = document.createElement("script"); e.src = "https://www.upsellit.com/LaunchRules/chat/chatWindowObjectInclude.jsp?qs=227253233247344306295289301&siteID=4591&sess="+ new_usi_chat_session_id + MoxiechatVariables.getInstance().getTrackingInfoQS(); e.type = "text/javascript"; document.getElementsByTagName("body")[0].appendChild(e); } window.onbeforeunload = regularChatDisplay; function Browser() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } } var browser = new Browser(); var dragObj = new Object(); dragObj.zIndex = 0; function dragStart(event, id) { var el; var x, y; if (id) dragObj.elNode = document.getElementById(id); else { if (browser.isIE) dragObj.elNode = window.event.srcElement; if (browser.isNS) dragObj.elNode = event.target; if (dragObj.elNode.nodeType == 3) dragObj.elNode = dragObj.elNode.parentNode; } if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } dragObj.cursorStartX = x; dragObj.cursorStartY = y; dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10); dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10); if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; dragObj.elNode.style.zIndex = ++dragObj.zIndex; if (browser.isIE) { document.attachEvent("onmousemove", dragGo); document.attachEvent("onmouseup", dragStop); window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) { document.addEventListener("mousemove", dragGo, true); document.addEventListener("mouseup",dragStop, true); event.preventDefault(); } } function dragGo(event) { var x, y; if (browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } if (browser.isNS) { x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px"; if (browser.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; } if (browser.isNS) event.preventDefault(); } function dragStop(event) { if (browser.isIE) { document.detachEvent("onmousemove", dragGo); document.detachEvent("onmouseup", dragStop); } if (browser.isNS) { document.removeEventListener("mousemove", dragGo, true); document.removeEventListener("mouseup", dragStop, true); } } newWidth = 450; newHeight = 275; function doResize() { if (window.outerHeight==null) { toolbar_height = document.documentElement.scrollHeight; toolbar_width = document.documentElement.scrollWidth; } else { toolbar_height = window.innerHeight; toolbar_width = window.innerWidth; } if (toolbar_width != 425 && toolbar_width != 348) { resizeTo(newWidth, newHeight); if (window.outerHeight==null) { toolbar_height = document.documentElement.scrollHeight; } else { toolbar_height = window.innerHeight; } if (newHeight + newHeight-toolbar_height > 0) { resizeTo(newWidth, newHeight + newHeight-toolbar_height); } } window.moveTo(screen.width/2-230,screen.height/2-450); window.scrollTo(xPos,yPos+29); } function TestClick() { properClickThrough = true; USItimerID = setTimeout("usiInterval();", 1000); } function usiInterval() { if(!USIdone){ properClickThrough = false; } } document.documentElement.onclick = TestClick; document.documentElement.onkeypress = TestClick; } if(skinFilename == 0 || skinFilename.indexOf("null") != -1 || (skinFilename.indexOf("/") == (skinFilename.length - 1))) { document.write(''); } else { var skinPreload = new Image(); skinPreload.src = "https://www.upsellit.com/LaunchRules/images/skins/"+ skinFilename +".gif"; document.write(''); } document.write(''); function moxieShowShadow() { var page_width; var page_height; page_width = document.body.scrollWidth; page_height = document.body.scrollHeight; if(page_height < document.body.clientHeight){ page_height = document.body.clientHeight; } var overlay_object = document.getElementById('moxieOverlayDiv'); overlay_object.style.width = page_width; overlay_object.style.height = page_height; overlay_object.style.display = 'inline'; overlay_object.onclick = function() { } } function moxieHideShadow() { var overlay_object = document.getElementById('moxieOverlayDiv'); overlay_object.style.display = 'none'; overlay_object.onclick = function() { } } function sendUSIChatDetails(session_id){ var e = document.createElement("script"); e.src = "https://www.upsellit.com/hybrid/visitor?page=null&qs=227253233247344306295289301&siteID=4591&sess="+ session_id + MoxiechatVariables.getInstance().getTrackingInfoQS(); e.type = "text/javascript"; document.getElementsByTagName("body")[0].appendChild(e); } var usi_chat_session_id = ""; if(false){ sendUSIChatDetails(new_usi_chat_session_id); }