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",DOMrel:"object",omnitureProducts:"listing",category:"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:"listing action"},socialnetwork:{products:"{omnitureProducts}",events:"event4,event35",linkName:"social networking share action"}},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"}},photo:{base:"listingaction",values:{eVar25:"photo"}},video:{base:"listingaction",values:{eVar25:"video"}},photoVideo:{base:"listingaction",values:{eVar25:"photo/video"}},thirdpartywebsite:{base:"listingactionthirdparty",values:{eVar27:"{DOMrel}"}},flowers:{base:"listingactionthirdparty",values:{eVar27:"flowers"}},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"}},coupon:{values:{events:"event13",products:"{omnitureProducts}",eVar25:"coupons"}},clicktocall:{base:"listingaction",values:{eVar25:"call"}},justeat:{base:"listingactionthirdparty",values:{eVar27:"just eat"}},livebooking:{values:{events:"event17",products:"{omnitureProducts}",eVar27:"livebooking"}},directbooking:{values:{events:"event17",products:"{omnitureProducts}",eVar27:"directbooking"}},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"}},saveproduct:{base:"productlistingaction",values:{eVar24:"saved"}},rateproduct:{base:"productlistingaction",values:{eVar24:"reviewed"}},emailproduct:{base:"productlistingaction",values:{eVar24:"send to email"}},myspace:{base:"socialnetwork",values:{prop41:"myspace",eVar41:"myspace"}},facebook:{base:"socialnetwork",values:{prop41:"facebook",eVar41:"facebook"}}},event:{flyoutyp:{values:{linkName:"map flyout",events:"event2",products:"{omnitureProducts}",eVar37:"map flyout"}},flyoutwp:{values:{linkName:"map flyout"}},mapoptions:{values:{prop23:"{options}",prop24:"{options}",events:"event12",products:";{optionId}",linkName:"map options"}},mapoptionsmenu:{values:{linkName:"activate map options"}},addtoroute:{base:"listingaction",values:{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"}}}};
