LMI.Reporting=(function(){var D=LMI.MinEvents,C,I=/\brepkey_([^\s]+)/,A=/\brepname_([^\s]+)/,F=/(?:^|\s)track(?:\s|$)/,B;function H(L){C=L}function J(L,M){C(B.getValues("event",L,M))}function E(N){var L,O,M=N.className;L=I.test(M)?RegExp.$1:null;O=A.test(M)?RegExp.$1:null;if(O){C(B.getValues(N,O,L),N)}}function K(L){E(this)}LMI.LinkBehavior.add("track",K);function G(M){var L=D.findTarget(M||window.event,"a");if(L&&!F.test(L.getAttribute("rel"))){E(L)}}LMI.Init.addFunction(function(){B=LMI.Reporting.Templates;if(C&&B){D.addEvent(document.body,"click",G)}});return{trackEvent:J,clickHandler:G,setReporter:H}})();LMI.Reporting.Templates=function(){var B=LMI.Lang,D=B.getObject,F=B.mergeObjects,C=B.isArray,G=B.forObject,H=/\{([^{}]+)\}/g,E=/\{|\}/g;function A(Q,L,W){var K={},M=typeof (Q)==="string"?Q:"link",S,O,N,R,J,P,V,U={},X=LMI.Reporting,I=X.dataSources,T={repname:L,repkey:W,type:M};G(X.templates[M],function(Z,Y){if((("applysTo" in Z)&&B.indexOf(Z.applysTo,L)>=0)||Y===L){if("base" in Z){P=(C(Z.base))?Z.base:[Z.base];B.forEach(P,function(a){if((V=D("LMI.Reporting.templates.common."+a))){F(U,V)}})}F(U,Z.values);G(U,function(a,b){O=a.match(H);if(O){B.forEach(O,function(d,c){S=d.replace(E,"");N=null;J=I[S]||"custom";switch(J){case"listing":R=LMI.Listings.getListingsByProperty("id",W)[0];N=D(S,false,R);break;case"object":if(M==="link"){S=S.replace("DOM","");N=Q.getAttribute(S)}break;case"reporting":N=T[S];break;case"template":S=S.replace("TEMPLATE","");N=X.templates[M][L].values[S];break;default:N=D(S,false,X.data)}if(N||N===""){a=a.replace(new RegExp(d,"g"),N)}})}K[b]=a})}});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].toLowerCase();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","DOMdata-type":"object",DOMrel:"object",omnitureProducts:"listing",category:"listing",TEMPLATEeVar25:"template",TEMPLATEeVar27:"template",categoryId:"listing"};LMI.Reporting.templates={common:{listingaction:{products:"{omnitureProducts};;;event13=1;eVar25={TEMPLATEeVar25}",events:"event13",linkName:"listing action"},listingactionthirdparty:{products:"{omnitureProducts};;;event17=1;eVar27={DOMdata-type}",events:"event17",linkName:"3rd party website"},productlistingaction:{products:"{omnitureProducts}",events:"event20",linkName:"listing action"},socialnetwork:{products:"{omnitureProducts};;;;",events:"event4,event35",eVar41:"{category}",linkName:"social networking share action"},otheraction:{products:"{omnitureProducts};;;event13=1;eVar27={TEMPLATEeVar27}",events:"event13",linkName:"listing action"}},link:{savelisting:{values:{linkName:"location saves",events:"event18",products:"{omnitureProducts}"}},emaillisting:{base:"listingaction",values:{eVar25:"send to email"}},threesixty:{base:"listingaction",values:{eVar25:"360 photo"}},photo:{base:"listingaction",values:{eVar25:"photo"}},video:{base:"listingaction",values:{eVar25:"video"}},thirdpartywebsite:{base:"listingactionthirdparty",values:{eVar27:"{DOMdata-type}"}},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"}},saveproduct:{base:"productlistingaction",values:{eVar24:"saved"}},rateproduct:{base:"productlistingaction",values:{eVar24:"reviewed"}},reportabuse:{values:{linkName:"flag as inappropriate action",prop28:"{id}"}},emailproduct:{base:"productlistingaction",values:{eVar24:"send to email"}},moreinfo:{base:"listingaction",values:{eVar25:"more information"}},backlink:{values:{linkName:"back link",products:"{omnitureProducts}"}},sendvcard:{base:"listingaction",values:{eVar25:"send to outlook"}},updatelisting:{values:{linkName:"update your listing link",products:"{omnitureProducts}"}},deeplink:{base:"otheraction",values:{eVar27:"deep link"}},directions:{base:"listingaction",values:{eVar25:"directions"}},map:{base:"listingaction",values:{eVar25:"map"}},logo:{base:"listingaction",values:{eVar25:"logo"}},viewad:{base:"listingaction",values:{eVar25:"view ad"}},hyves:{base:"socialnetwork",values:{prop41:"hyves"}},facebook:{base:"socialnetwork",values:{prop41:"facebook"}},locatedinfilter:{values:{eVar42:"Located in this Area",events:"event38"}},servingfilter:{values:{eVar42:"Serving this Area",events:"event38"}},categoryfilter:{values:{eVar42:"Category",events:"event38"}},locationfilter:{values:{eVar42:"Location",events:"event38"}},connectionbox:{base:"listingaction",values:{eVar25:"connection box"}}},event:{flyoutyp:{values:{linkName:"map flyout",events:"event2",products:"{omnitureProducts};;;event2=1;eVar37=map flyout",eVar37:"map flyout",prop37:"map flyout"}},flyoutwp:{values:{linkName:"map flyout"}},addtoroute:{base:"listingaction",values:{eVar25:"add to route"}},customloc:{values:{linkName:"listing action",events:"event18"}},showonmap:{values:{linkName:"listing action",events:"event18",products:"{omnitureProducts}"}},linkroute:{values:{linkName:"route detail view link"}},mapoptions:{values:{prop23:"{options}",prop24:"{options}",events:"event12",products:";{optionsId}",linkName:"map options"}},mapoptionsmenu:{values:{linkName:"activate map options"}},tomtom:{base:"listingaction",values:{eVar25:"send to tomtom"}},categoryfilter:{values:{eVar42:"category",events:"event38"}},locationfilter:{values:{eVar42:"location",events:"event38"}}}};
