LMI.Reporting=(function(){var E=LMI.MinEvents,C,J=/\brepkey_([^\s]+)/,A=/\brepname_([^\s]+)/,G=/(?:^|\s)track(?:\s|$)/,B;function I(M){C=M}function K(M,N){C(B.getValues("event",M,N))}function D(M){return J.test(M.className)?RegExp.$1:null}function F(O){var M,P,N=O.className;M=J.test(N)?RegExp.$1:null;P=A.test(N)?RegExp.$1:null;if(P){C(B.getValues(O,P,M),O)}}function L(M){F(this)}LMI.LinkBehavior.add("track",L);function H(N){var M=E.findTarget(N||window.event,"a");if(M&&!G.test(M.getAttribute("rel"))){F(M)}}LMI.Init.addFunction(function(){B=LMI.Reporting.Templates;if(C&&B){E.addEvent(document.body,"click",H)}});return{trackEvent:K,clickHandler:H,setReporter:I}})();LMI.Reporting.Templates=function(){var B=LMI.Lang,D=B.getObject,F=B.mergeObjects,C=B.isArray,H=/\{([^{}]+)\}/g,E=/\{|\}/g;function G(K,J){var I;for(I in K){if(K.hasOwnProperty(I)){J(K[I],I)}}}function A(P,L,V){var K={},M=typeof (P)==="string"?P:"link",R,O,N,Q,J,U,T={},W=LMI.Reporting,I=W.dataSources,S={repname:L,repkey:V,type:M};G(W.templates[M],function(Y,X){if((("applysTo" in Y)&&B.indexOf(Y.applysTo,L)>=0)||X===L){if("base" in Y){baseTemplates=(C(Y.base))?Y.base:[Y.base];B.forEach(baseTemplates,function(Z){if(U=D("LMI.Reporting.templates.common."+Z)){F(T,U)}})}F(T,Y.values);G(T,function(Z,a){O=Z.match(H);if(O){B.forEach(O,function(c,b){R=c.replace(E,"");N=null;J=I[R]||"custom";switch(J){case"listing":Q=LMI.Listings.getListingsByProperty("id",V)[0];N=D(R,false,Q);break;case"object":if(M==="link"){R=R.replace("DOM","");N=P[R]}break;case"reporting":N=S[R];break;default:N=D(R,false,W.data)}if(N||N===""){Z=Z.replace(new RegExp(c,"g"),N)}})}K[a]=Z})}});return K}return{getValues:A}}();LMI.Reporting.setReporter(function(B,F){var C,D,G,A=[],E=s_gi(s_account),H=false;for(D in B){if(B.hasOwnProperty(D)){G=B[D];if("linkName"===D){C=G}else{E[D]=G;A.push(D);if("events"===D){E.linkTrackEvents=G}}}}E.linkTrackVars=A.join(",");if(!F){F=document.createElement("a");F.href="#";document.body.appendChild(F);H=true}E.tl(F,"o",C);if(H){document.body.removeChild(F)}});LMI.Reporting.dataSources={repkey:"reporting",id:"listing",DOMrel:"object",omnitureProducts:"listing"};LMI.Reporting.templates={common:{listingaction:{products:"{omnitureProducts}",events:"event13",linkName:"listing action"},listingactionthirdparty:{products:"{omnitureProducts}",events:"event17",linkName:"3rd party website"},productlistingaction:{products:"{omnitureProducts}",events:"event20",linkName:"product action"},realestatelistingaction:{products:"{etuoviId}",events:"event31",linkName:"real estate actions"}},link:{savelisting:{values:{linkName:"listing action",events:"event18",products:"{omnitureProducts}"}},emaillisting:{base:"listingaction",values:{eVar25:"send to email"}},threesixty:{base:"listingaction",values:{eVar25:"360"}},photo:{base:"listingaction",values:{eVar25:"photo"}},video:{base:"listingaction",values:{eVar25:"video"}},thirdpartywebsite:{base:"listingactionthirdparty",values:{eVar27:"{DOMrel}"}},rating:{base:"listingaction",values:{eVar25:"rate"}},route:{values:{linkName:"route detail view link"}},printdirs:{values:{events:"event13",products:"{directionsProductIds}",eVar25:"view print directions"}},emaildirections:{values:{events:"event13",products:"{directionsProductIds}",eVar25:"email directions"}},clicktocall:{base:"listingaction",values:{eVar25:"call"}},justeat:{base:"listingactionthirdparty",values:{eVar27:"just eat"}},website:{base:"listingaction",values:{eVar25:"click website"}},email:{base:"listingaction",values:{eVar25:"click email"}},slideshow:{base:"listingaction",values:{eVar25:"slideshow"}},products:{base:"listingaction",values:{eVar25:"products"}},mobile:{base:"listingaction",values:{eVar25:"send to mobile"}},vcard:{base:"listingaction",values:{eVar25:"send to outlook"}},findnearby:{base:"listingaction",values:{eVar25:"find nearby"}},regetdirs:{base:"realestatelistingaction",values:{eVar32:"get directions"}},regetpt:{base:"realestatelistingaction",values:{eVar32:"get public transportation directions"}},remoreinfo:{base:"realestatelistingaction",values:{eVar32:"more information",products:"{etuoviId}"}}},event:{clicktocall:{base:"listingaction",values:{eVar25:"call"}},flyoutyp:{values:{linkName:"map flyout",events:"event2",products:"{omnitureProducts}",eVar37:"map flyout",prop37:"map flyout"}},flyoutwp:{values:{linkName:"map flyout"}},flyoutre:{values:{linkName:"map flyout",events:"event30",products:"{etuoviId}",eVar37:"map flyout",prop37:"map flyout"}},addtoroute:{values:{linkName:"listing action",events:"event31",products:"{omnitureProducts}",eVar25:"add to route"}},customloc:{values:{linkName:"listing action",events:"event18"}},showonmap:{values:{linkName:"listing action",events:"event18",products:"{omnitureProducts}"}},showonmaploc:{values:{linkName:"listing action",events:"event18"}},mobile:{values:{linkName:"listing action",events:"event13",eVar25:"send to mobile"}},mapoptions:{values:{prop23:"{options}",prop24:"{options}",events:"event12",products:";pi:{optionId}",linkName:"map options"}},mapoptionsmenu:{values:{linkName:"activate map options"}},publictransport:{values:{linkName:"listing action",events:"event31",products:"{omnitureProducts}",eVar25:"add to public transportation"}}}};