var Tracking_isEnabled = true;
var Tracking_channel = "A";
var Tracking_serviceUrl = "http://tracking.realtor.com/EventLogWS/EventLogWSController?";
var Tracking_curQuery="";
var Tracking_profileId="";
var Tracking_refDomain="";
var Tracking_refPath="";
var Tracking_refQuery="";
var Tracking_uuid="";
var Tracking_post=new Array();
EventLog.ActionType={PageView:0,Click:1,AdClick:2,AdImpression:3,AdvertiserClick:4,AdvertiserImpression:5,Lead:6,ListingClick:7,ListingImpression:8,Profile:9,Registration:10,Search:11,SpecialLinkClick:12,Submit:13,FCMA:14,FeaturedMortgage:15};EventLog.ObjectType={Page:0,Button:1,Link:2,Ad:3,AdvertiserListing:4,PropertyListing:5,Tab:6,Image:7};function enumToStringHash(C,B){for(var A in C){B[C[A]]=A}}function Event_Ad(E,C,A,D,B){this.parent=Event;this.parent();this.a=E;this.eA=encodeURIComponent("adid="+A+"&adtype="+D+"&seq="+B);this.l=encodeURIComponent(C);this.o=EventLog.ObjectType.Ad}function Event_Advertiser(E,B,F,A,C,G,D){this.parent=Event;this.parent();this.a=E;this.eA=encodeURIComponent("typ="+C+"&loc="+G+"&aid="+D);this.l=encodeURIComponent(B);this.o=F;if((EventLog.ActionType.AdvertiserClick==E)&&(EventLog.ObjectType.Link==F)){this.setDestinationUri(A)}}function Event_Click(B,C,A){this.parent=Event;this.parent();this.a=EventLog.ActionType.Click;this.l=encodeURIComponent(B);this.o=C;if(EventLog.ObjectType.Link==C){this.setDestinationUri(A)}}function Event_FCMA(A,C,B){this.parent=Event;this.parent();this.a=EventLog.ActionType.FCMA;this.eA=encodeURIComponent("typ="+B);this.l=encodeURIComponent(A);this.o=C}function Event_FeaturedMortgage(A,C,B){this.parent=Event;this.parent();this.listings=new Array();this.a=EventLog.ActionType.FeaturedMortgage;this.eA=encodeURIComponent("typ="+B);this.l=encodeURIComponent(A);this.o=C;this.addListing=new Function("listing","this.listings.push(listing)")}function Event_Lead(H,E,K,C,B,I,A,D,G,F,J){this.parent=Event;this.parent();this.listings=new Array();this.a=EventLog.ActionType.Lead;this.eA=encodeURIComponent("s="+K+"&typ="+C+"&advid="+B+"&mth="+I+"&form="+A+"&rec="+D+"&bus="+G+"&leads="+F+"&wstyp="+J);this.l=encodeURIComponent(H);this.o=E;this.addListing=new Function("listing","this.listings.push(listing)")}function Event_Listing(C,A,B){this.id=C;this.p=A;this.t=B}function Event_ListingClick(C,E,B,D,A){this.parent=Event;this.parent();this.listings=new Array();this.a=EventLog.ActionType.ListingClick;this.eA=encodeURIComponent("lbl="+D+"&seq="+A);this.l=encodeURIComponent(C);this.o=E;this.addListing=new Function("listing","this.listings.push(listing)");if(EventLog.ObjectType.Link==E){this.setDestinationUri(B)}}function Event_ListingImpression(A,B){this.parent=Event;this.parent();this.listings=new Array();this.a=EventLog.ActionType.ListingImpression;this.eA="";this.l=encodeURIComponent(A);this.o=B;this.addListing=new Function("listing","this.listings.push(listing)")}function Event_PageView(A){this.parent=Event;this.parent();this.listings=new Array();this.a=EventLog.ActionType.PageView;this.eA="";this.l=encodeURIComponent(A);this.o=EventLog.ObjectType.Page;this.addListing=new Function("listing","this.listings.push(listing)")}function Event_Profile(C,E,D,B,A){this.parent=Event;this.parent();this.a=EventLog.ActionType.Profile;this.eA=encodeURIComponent("typ="+D+"&l="+B+"&bus="+A);this.l=encodeURIComponent(C);this.o=E}function Event_Registration(A,C,B){this.parent=Event;this.parent();this.a=EventLog.ActionType.Registration;this.eA=encodeURIComponent("typ="+B);this.l=encodeURIComponent(A);this.o=C}function Event_Search(A,B){this.parent=Event;this.parent();this.a=EventLog.ActionType.Search;this.eA=encodeURIComponent("typ="+B);this.l=encodeURIComponent(A);this.o=EventLog.ObjectType.Button}function Event_SpecialLinkClick(B,A,C){this.parent=Event;this.parent();this.a=EventLog.ActionType.SpecialLinkClick;this.eA=encodeURIComponent("value="+C);this.l=encodeURIComponent(B);this.o=EventLog.ObjectType.Link;this.setDestinationUri(A)}function Event(){this.a="";this.c=encodeURIComponent(Tracking_channel);this.cA=encodeURIComponent(Tracking_curQuery);this.d=encodeURIComponent(document.location.host);this.dD="";this.dU="";this.eA="";this.l="";this.o="";this.rA=encodeURIComponent(decodeURIComponent(Tracking_refQuery));this.rD=encodeURIComponent(Tracking_refDomain);this.rU=encodeURIComponent(Tracking_refPath);this.u=encodeURIComponent(document.location.pathname);this.uA="reg="+encodeURIComponent(Tracking_profileId);this.uI=Tracking_uuid;this.setDestinationUri=function(A){this.dD=parseUri(A).host;this.dU=parseUri(A).path};this.setUserAttribute=function(A){this.uA=encodeURIComponent(A)};this.post=function(){if(!Tracking_isEnabled){return }var A=new Image();A.src=Tracking_serviceUrl+"eventLog="+JSON.stringify(this)+"&timestamp="+(new Date()).getTime()}}function EventLog(){this.events=new Array(arguments.length);for(var A=0;A<arguments.length;A++){this.events[A]=arguments[A]}this.addEvent=new Function("event","this.events.push(event)");var B=new Array();enumToStringHash(EventLog.ActionType,B);var C=new Array();enumToStringHash(EventLog.ObjectType,C);this.debug=function(){var F=(window.location.search.match("trackdebugwindow=self"))?window.document:window.open("",(new Date()).getTime()).document;F.open();F.write("<html><head><title>Event Objects</title></head><style>");F.write("body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } span { color: #555; }");F.write("a { color: #00f; font-size: 12px; text-decoration: none; } .hdr { border-bottom: solid 1px; font-size: 16px; }");F.write(".jsonObject { margin-left: 20px; } .txtMulti { height: 60px; width: 750px; }");F.write('</style><body><div class="hdr">Event Objects</div>');for(var D=0;D<this.events.length;D++){var E=this.events[D];F.write("<p/><u>Event Object "+(D+1)+" of "+this.events.length+"</u><p/><ul>");F.write("<li>userId = <span>"+E.uI+"</span></li>");F.write("<li>channel = <span>"+E.c+"</span></li>");F.write("<li>domain = <span>"+E.d+"</span></li>");F.write("<li>uriStem = <span>"+E.u+"</span></li>");F.write("<li>curAttributes = <span>"+E.cA+"</span></li>");F.write("<li>label = <span>"+E.l+"</span></li>");F.write("<li>action = <span>"+E.a+"  ["+B[E.a]+"]</span></li>");F.write("<li>object = <span>"+E.o+"  ["+C[E.o]+"]</span></li>");F.write("<li>eventAttributes = <span>"+E.eA+"</span></li>");F.write("<li>userAttributes = <span>"+E.uA+"</span></li>");F.write("<li>refDomain = <span>"+E.rD+"</span></li>");F.write("<li>refUriStem = <span>"+E.rU+"</span></li>");F.write("<li>refAttributes = <span>"+E.rA+"</span></li>");F.write("<li>destinationDomain = <span>"+E.dD+"</span></li>");F.write("<li>destinationUriStem = <span>"+E.dU+"</span></li>");if(E.listings){if(E.listings.length>0){F.write("<li><p/><u>Listings</u><ul>");for(var D=0;D<E.listings.length;D++){F.write("<li>id = <span>"+E.listings[D].id+"</span>, product = <span>"+E.listings[D].p+"</span>, type = <span>"+E.listings[D].t+"</span></li>")}F.write("</ul></li>")}}F.write('</ul><div class="jsonObject">JSON Object: Length = '+JSON.stringify(E).length+'<br/><textarea id="txtJSONObject" name="txtJSONObject" class="txtMulti" onfocus="this.select();">'+JSON.stringify(E)+"</textarea></div>")}F.write("</body></html>");F.close()};this.post=function(){if(window.location.search.match("trackdebug=true")){this.debug()}else{if(Tracking_isEnabled){var E="";for(var D=0;D<this.events.length;D++){if(D>0){E+="&"}E+="eventLog="+JSON.stringify(this.events[D])}if(E.length<2000){Tracking_post[Tracking_post.length]=new Image();Tracking_post[Tracking_post.length-1].src=Tracking_serviceUrl+E+"&timestamp="+(new Date()).getTime()}else{for(var D=0;D<this.events.length;D++){this.events[D].post()}}}}}}function CookieHandler(){this.deleteCookie=function(A){this.setCookie(A,"",-1)};this.getCookie=function(B){var A=document.cookie.split(";");B=B+"=";for(var C=0;C<A.length;C++){var D=A[C];while(D.charAt(0)==" "){D=D.substring(1,D.length)}if(D.indexOf(B)==0){return D.substring(B.length,D.length)}}return null};this.setCookie=function(C,D,E){if(typeof (E)!="undefined"){var B=new Date();B.setTime(B.getTime()+(E*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}}if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;function quote(string){return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+string+'"'}function stringify(key,holder,replacer){var i,k,v,length,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof replacer==="function"){value=replacer.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}partial=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){length=value.length;for(i=0;i<length;i+=1){partial[i]=stringify(i,value,replacer)||"null"}return"["+partial.join(",")+"]"}if(typeof replacer==="object"){length=replacer.length;for(i=0;i<length;i+=1){k=replacer[i];if(typeof k==="string"){v=stringify(k,value,replacer);if(v){partial.push(quote(k)+":"+v)}}}}else{for(k in value){v=stringify(k,value,replacer);if(v){partial.push(quote(k)+":"+v)}}}return"{"+partial.join(",")+"}"}}return{stringify:function(value,replacer){if(typeof replacer!=="function"){if(!replacer){replacer=function(key,value){if(!Object.hasOwnProperty.call(this,key)){return undefined}return value}}else{if(typeof replacer!=="object"||typeof replacer.length!=="number"){throw new Error("JSON.stringify")}}}return stringify("",{"":value},replacer)},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")},quote:quote}}()}function JSONscriptRequest(A){this.fullUrl=A;this.noCacheIE="&noCacheIE="+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId="JscriptId"+JSONscriptRequest.scriptCounter++}JSONscriptRequest.scriptCounter=1;JSONscriptRequest.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("charset","utf-8");this.scriptObj.setAttribute("src",this.fullUrl+this.noCacheIE);this.scriptObj.setAttribute("id",this.scriptId)};JSONscriptRequest.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj)};JSONscriptRequest.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj)};function parseUri(E){var D=parseUri.options,A=D.parser[D.strictMode?"strict":"loose"].exec(E),C={},B=14;while(B--){C[D.key[B]]=A[B]||""}C[D.q.name]={};C[D.key[12]].replace(D.q.parser,function(G,F,H){if(F){C[D.q.name][F]=H}});return C}parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var ch;var jsr;initTracking();function initTracking(){if(!Tracking_isEnabled){return }ch=new CookieHandler();var A=ch.getCookie("Move_UUID");if(A){Tracking_uuid=ch.getCookie("Move_UUID");ch.setCookie("Move_UUID",Tracking_uuid,60*60*24*365*10)}else{jsr=new JSONscriptRequest(Tracking_serviceUrl+"onLoad=getUUID");jsr.buildScriptTag();jsr.addScriptTag()}if(document.location.search.length>0){Tracking_curQuery=document.location.search.substring(1)}Tracking_refDomain=parseUri(document.referrer).host;Tracking_refPath=parseUri(document.referrer).path;Tracking_refQuery=parseUri(document.referrer).query}function callback(A){if(A.uuid){Tracking_uuid=A.uuid;ch.setCookie("Move_UUID",A.uuid,60*60*24*365*10)}jsr.removeScriptTag()};