diff options
author | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:37:45 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:37:45 +0300 |
commit | 37f49aef8fe2f48e817b8e60f43d49a3e4c49673 (patch) | |
tree | 0e675ee7a26fe45e548d56e455e0b67e1f435469 | |
parent | 0913140d1ff894f0e942a71ecd2cd2c7c3db7d7d (diff) |
Fix the JS tests on Chrome
-rw-r--r-- | js/piwik.js | 9 | ||||
-rw-r--r-- | piwik.js | 52 | ||||
-rw-r--r-- | tests/javascript/index.php | 36 |
3 files changed, 58 insertions, 39 deletions
diff --git a/js/piwik.js b/js/piwik.js index 2f7af0ba4c..07c921b1bb 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -2807,7 +2807,7 @@ if (typeof window.Piwik !== 'object') { configCustomUrl, // Document title - configTitle = documentAlias.title, + configTitle = '', // Extensions to be treated as download links configDownloadExtensions = ['7z','aac','apk','arc','arj','asf','asx','avi','azw3','bin','csv','deb','dmg','doc','docx','epub','exe','flv','gif','gz','gzip','hqx','ibooks','jar','jpg','jpeg','js','mobi','mp2','mp3','mp4','mpg','mpeg','mov','movie','msi','msp','odb','odf','odg','ods','odt','ogg','ogv','pdf','phps','png','ppt','pptx','qt','qtm','ra','ram','rar','rpm','sea','sit','tar','tbz','tbz2','bz','bz2','tgz','torrent','txt','wav','wma','wmv','wpd','xls','xlsx','xml','z','zip'], @@ -2949,6 +2949,13 @@ if (typeof window.Piwik !== 'object') { // Domain hash value domainHash; + // Document title + try { + configTitle = documentAlias.title; + } catch(e) { + configTitle = ''; + } + /* * Set cookie value */ @@ -36,32 +36,32 @@ var ac=this.findMediaUrlInNode(aa);if(ac){return this.toAbsoluteUrl(ac)}},findCo }var ab=ad.clientWidth;if(K.innerWidth&&ab>K.innerWidth){ab=K.innerWidth}var aa=ad.clientHeight;if(K.innerHeight&&aa>K.innerHeight){aa=K.innerHeight}return((ae.bottom>0||ac)&&ae.right>0&&ae.left<ab&&((ae.top<aa)||ac))},isNodeVisible:function(ab){var aa=h(ab);var ac=this.isOrWasNodeInViewport(ab);return aa&&ac},buildInteractionRequestParams:function(aa,ab,ac,ad){var ae="";if(aa){ae+="c_i="+n(aa)}if(ab){if(ae){ae+="&"}ae+="c_n="+n(ab)}if(ac){if(ae){ae+="&"}ae+="c_p="+n(ac)}if(ad){if(ae){ae+="&"}ae+="c_t="+n(ad)}return ae},buildImpressionRequestParams:function(aa,ab,ac){var ad="c_n="+n(aa)+"&c_p="+n(ab);if(ac){ad+="&c_t="+n(ac)}return ad},buildContentBlock:function(ac){if(!ac){return}var aa=this.findContentName(ac);var ab=this.findContentPiece(ac);var ad=this.findContentTarget(ac);aa=this.trim(aa);ab=this.trim(ab);ad=this.trim(ad);return{name:aa||"Unknown",piece:ab||"Unknown",target:ad||""}},collectContent:function(ad){if(!ad||!ad.length){return[]}var ac=[];var aa,ab;for(aa=0;aa<ad.length; aa++){ab=this.buildContentBlock(ad[aa]);if(A(ab)){ac.push(ab)}}return ac},setLocation:function(aa){this.location=aa},getLocation:function(){var aa=this.location||K.location;if(!aa.origin){aa.origin=aa.protocol+"//"+aa.hostname+(aa.port?":"+aa.port:"")}return aa},toAbsoluteUrl:function(ab){if((!ab||String(ab)!==ab)&&ab!==""){return ab}if(""===ab){return this.getLocation().href}if(ab.search(/^\/\//)!==-1){return this.getLocation().protocol+ab}if(ab.search(/:\/\//)!==-1){return ab}if(0===ab.indexOf("#")){return this.getLocation().origin+this.getLocation().pathname+ab}if(0===ab.indexOf("?")){return this.getLocation().origin+this.getLocation().pathname+ab}if(0===ab.search("^[a-zA-Z]{2,11}:")){return ab}if(ab.search(/^\//)!==-1){return this.getLocation().origin+ab}var aa="(.*/)";var ac=this.getLocation().origin+this.getLocation().pathname.match(new RegExp(aa))[0];return ac+ab},isUrlToCurrentDomain:function(ab){var ac=this.toAbsoluteUrl(ab);if(!ac){return false}var aa=this.getLocation().origin; if(aa===ac){return true}if(0===String(ac).indexOf(aa)){if(":"===String(ac).substr(aa.length,1)){return false}return true}return false},setHrefAttribute:function(ab,aa){if(!ab||!aa){return}S.setAnyAttribute(ab,"href",aa)},shouldIgnoreInteraction:function(ac){var ab=S.hasNodeAttribute(ac,this.CONTENT_IGNOREINTERACTION_ATTR);var aa=S.hasNodeCssClass(ac,this.CONTENT_IGNOREINTERACTION_CLASS);return ab||aa}};function F(ab,ae){if(ae){return ae}if(r(ab,"?")){var ad=ab.indexOf("?");ab=ab.slice(0,ad)}if(I(ab,"piwik.php")){ab=e(ab,"piwik.php".length)}else{if(I(ab,".php")){var aa=ab.lastIndexOf("/");var ac=1;ab=ab.slice(0,aa+ac)}}if(I(ab,"/js/")){ab=e(ab,"js/".length)}return ab}function E(ag){var ai="Piwik_Overlay";var ab=new RegExp("index\\.php\\?module=Overlay&action=startOverlaySession&idSite=([0-9]+)&period=([^&]+)&date=([^&]+)(&segment=.*)?$");var ac=ab.exec(x.referrer);if(ac){var ae=ac[1];if(ae!==String(ag)){return false}var af=ac[2],aa=ac[3],ad=ac[4];if(!ad){ad=""}else{if(ad.indexOf("&segment=")===0){ad=ad.substr("&segment=".length) -}}K.name=ai+"###"+af+"###"+aa+"###"+ad}var ah=K.name.split("###");return ah.length===4&&ah[0]===ai}function P(ab,ah,ad){var ag=K.name.split("###"),af=ag[1],aa=ag[2],ae=ag[3],ac=F(ab,ah);j(ac+"plugins/Overlay/client/client.js?v=1",function(){Piwik_Overlay_Client.initialize(ac,ad,af,aa,ae)})}function o(){if(A(K.frameElement)){return(K.frameElement&&String(K.frameElement.nodeName).toLowerCase()==="iframe")?true:false}try{return K.self!==K.top}catch(aa){return true}}function H(bI,bC){var by=Q(x.domain,K.location.href,B()),cg=C(by[0]),bi=k(by[1]),aX=k(by[2]),ce=false,bM="GET",cs=bM,ao="application/x-www-form-urlencoded; charset=UTF-8",bY=ao,ak=bI||"",bd="",ck="",bA=bC||"",a6="",bj="",aI,aT=x.title,cp=["7z","aac","apk","arc","arj","asf","asx","avi","azw3","bin","csv","deb","dmg","doc","docx","epub","exe","flv","gif","gz","gzip","hqx","ibooks","jar","jpg","jpeg","js","mobi","mp2","mp3","mp4","mpg","mpeg","mov","movie","msi","msp","odb","odf","odg","ods","odt","ogg","ogv","pdf","phps","png","ppt","pptx","qt","qtm","ra","ram","rar","rpm","sea","sit","tar","tbz","tbz2","bz","bz2","tgz","torrent","txt","wav","wma","wmv","wpd","xls","xlsx","xml","z","zip"],ag=[cg],a7=[],bg=[],aL=[],be=500,b7,aJ,bm,bk,aa,bU=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],bc=["pk_kwd","piwik_kwd","utm_term"],aU="_pk_",ci,aZ,aV=false,cc,aR,a3,b8=33955200000,bS=1800000,co=15768000000,aG=true,bQ=0,bl=false,av=false,bF,bq={},bP={},aW={},a2=200,cl={},cq={},bE=[],bJ=false,b1=false,ab=false,cr=false,at=false,aQ=o(),cj=null,bG,aw,a8,bB=X,aY; -function cv(cF,cC,cB,cE,cA,cD){if(aV){return}var cz;if(cB){cz=new Date();cz.setTime(cz.getTime()+cB)}x.cookie=cF+"="+n(cC)+(cB?";expires="+cz.toGMTString():"")+";path="+(cE||"/")+(cA?";domain="+cA:"")+(cD?";secure":"")}function aj(cB){if(aV){return 0}var cz=new RegExp("(^|;)[ ]*"+cB+"=([^;]*)"),cA=cz.exec(x.cookie);return cA?J(cA[2]):0}function bw(cz){var cA;if(bk){cA=new RegExp("#.*");return cz.replace(cA,"")}return cz}function bp(cB,cz){var cC=m(cz),cA;if(cC){return cz}if(cz.slice(0,1)==="/"){return m(cB)+"://"+c(cB)+cz}cB=bw(cB);cA=cB.indexOf("?");if(cA>=0){cB=cB.slice(0,cA)}cA=cB.lastIndexOf("/");if(cA!==cB.length-1){cB=cB.slice(0,cA+1)}return cB+cz}function b5(cB,cz){var cA;cB=String(cB).toLowerCase();cz=String(cz).toLowerCase();if(cB===cz){return true}if(cz.slice(0,1)==="."){if(cB===cz.slice(1)){return true}cA=cB.length-cz.length;if((cA>0)&&(cB.slice(cA)===cz)){return true}}return false}function bO(cz){var cA=document.createElement("a");if(cz.indexOf("//")!==0&&cz.indexOf("http")!==0){if(cz.indexOf("*")===0){cz=cz.substr(1) -}if(cz.indexOf(".")===0){cz=cz.substr(1)}cz="http://"+cz}cA.href=p.toAbsoluteUrl(cz);if(cA.pathname){return cA.pathname}return""}function aH(cA,cz){if(!V(cz,"/")){cz="/"+cz}if(!V(cA,"/")){cA="/"+cA}var cB=(cz==="/"||cz==="/*");if(cB){return true}if(cA===cz){return true}cz=String(cz).toLowerCase();cA=String(cA).toLowerCase();if(I(cz,"*")){cz=cz.slice(0,-1);cB=(!cz||cz==="/");if(cB){return true}if(cA===cz){return true}return cA.indexOf(cz)===0}if(!I(cA,"/")){cA+="/"}if(!I(cz,"/")){cz+="/"}return cA.indexOf(cz)===0}function ad(cD,cF){var cA,cz,cB,cC,cE;for(cA=0;cA<ag.length;cA++){cC=C(ag[cA]);cE=bO(ag[cA]);if(b5(cD,cC)&&aH(cF,cE)){return true}}return false}function aA(cC){var cA,cz,cB;for(cA=0;cA<ag.length;cA++){cz=C(ag[cA].toLowerCase());if(cC===cz){return true}if(cz.slice(0,1)==="."){if(cC===cz.slice(1)){return true}cB=cC.length-cz.length;if((cB>0)&&(cC.slice(cB)===cz)){return true}}}return false}function bT(cz,cB){var cA=new Image(1,1);cA.onload=function(){w=0;if(typeof cB==="function"){cB() -}};cz=cz.replace("send_image=0","send_image=1");cA.src=ak+(ak.indexOf("?")<0?"?":"&")+cz}function cn(cA,cD,cz){if(!A(cz)||null===cz){cz=true}try{var cC=K.XMLHttpRequest?new K.XMLHttpRequest():K.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;cC.open("POST",ak,true);cC.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)&&cz){bT(cA,cD)}else{if(this.readyState===4&&(typeof cD==="function")){cD()}}};cC.setRequestHeader("Content-Type",bY);cC.send(cA)}catch(cB){if(cz){bT(cA,cD)}}}function bK(cA){var cz=new Date();var cB=cz.getTime()+cA;if(!l||cB>l){l=cB}}function bR(cz){if(bG||!aJ){return}bG=setTimeout(function cA(){bG=null;if(!aQ){aQ=(!x.hasFocus||x.hasFocus())}if(!aQ){bR(aJ);return}if(bm()){return}var cB=new Date(),cC=aJ-(cB.getTime()-cj);cC=Math.min(aJ,cC);bR(cC)},cz||aJ)}function bf(){if(!bG){return}clearTimeout(bG);bG=null}function aN(){aQ=true;if(bm()){return}bR()}function ah(){bf()}function cx(){if(at||!aJ){return}at=true;Y(K,"focus",aN); -Y(K,"blur",ah);bR()}function b2(cD){var cA=new Date();var cz=cA.getTime();cj=cz;if(b1&&cz<b1){var cB=b1-cz;setTimeout(cD,cB);bK(cB+50);b1+=50;return}if(b1===false){var cC=800;b1=cz+cC}cD()}function bb(cA,cz,cB){if(!cc&&cA){b2(function(){if(cs==="POST"){cn(cA,cB)}else{bT(cA,cB)}bK(cz)})}if(!at){cx()}else{bR()}}function bN(cz){if(cc){return false}return(cz&&cz.length)}function cw(cB,cz){if(!bN(cB)){return}var cA='{"requests":["?'+cB.join('","?')+'"]}';b2(function(){cn(cA,null,false);bK(cz)})}function ay(cz){return aU+cz+"."+bA+"."+aY}function bz(){if(aV){return"0"}if(!A(f.cookieEnabled)){var cz=ay("testcookie");cv(cz,"1");return aj(cz)==="1"?"1":"0"}return f.cookieEnabled?"1":"0"}function aS(){aY=bB((ci||cg)+(aZ||"/")).slice(0,4)}function br(){var cA=ay("cvar"),cz=aj(cA);if(cz.length){cz=JSON2.parse(cz);if(N(cz)){return cz}}return{}}function b3(){if(av===false){av=br()}}function cd(){return bB((f.userAgent||"")+(f.platform||"")+JSON2.stringify(cq)+(new Date()).getTime()+Math.random()).slice(0,16) -}function ca(){var cB=new Date(),cz=Math.round(cB.getTime()/1000),cA=ay("id"),cE=aj(cA),cD,cC;if(cE){cD=cE.split(".");cD.unshift("0");if(bj.length){cD[1]=bj}return cD}if(bj.length){cC=bj}else{if("0"===bz()){cC=""}else{cC=cd()}}cD=["1",cC,cz,0,cz,"",""];return cD}function aC(){var cG=ca(),cC=cG[0],cD=cG[1],cA=cG[2],cz=cG[3],cE=cG[4],cB=cG[5];if(!A(cG[6])){cG[6]=""}var cF=cG[6];return{newVisitor:cC,uuid:cD,createTs:cA,visitCount:cz,currentVisitTs:cE,lastVisitTs:cB,lastEcommerceOrderTs:cF}}function an(){var cC=new Date(),cA=cC.getTime(),cD=aC().createTs;var cz=parseInt(cD,10);var cB=(cz*1000)+b8-cA;return cB}function aq(cz){if(!bA){return}var cB=new Date(),cA=Math.round(cB.getTime()/1000);if(!A(cz)){cz=aC()}var cC=cz.uuid+"."+cz.createTs+"."+cz.visitCount+"."+cA+"."+cz.lastVisitTs+"."+cz.lastEcommerceOrderTs;cv(ay("id"),cC,an(),aZ,ci)}function bh(){var cz=aj(ay("ref"));if(cz.length){try{cz=JSON2.parse(cz);if(N(cz)){return cz}}catch(cA){}}return["","",0,""]}function bs(cB,cA,cz){cv(cB,"",-86400,cA,cz) -}function a4(cA){var cz="testvalue";cv("test",cz,10000,null,cA);if(aj("test")===cz){bs("test",null,cA);return true}return false}function al(){var cB=aV;aV=false;var cz=["id","ses","cvar","ref"];var cA,cC;for(cA=0;cA<cz.length;cA++){cC=ay(cz[cA]);if(0!==aj(cC)){bs(cC,aZ,ci)}}aV=cB}function bx(cz){bA=cz;aq()}function cy(cD){if(!cD||!N(cD)){return}var cC=[];var cB;for(cB in cD){if(Object.prototype.hasOwnProperty.call(cD,cB)){cC.push(cB)}}var cE={};cC.sort();var cz=cC.length;var cA;for(cA=0;cA<cz;cA++){cE[cC[cA]]=cD[cC[cA]]}return cE}function bH(){cv(ay("ses"),"*",bS,aZ,ci)}function bV(cB,cW,cX,cC){var cV,cA=new Date(),cJ=Math.round(cA.getTime()/1000),cG,cU,cD=1024,c2,cK,cS=av,cE=ay("ses"),cQ=ay("ref"),cN=ay("cvar"),cO=aj(cE),cT=bh(),cZ=aI||bi,cH,cz;if(aV){al()}if(cc){return""}var cP=aC();if(!A(cC)){cC=""}var cM=x.characterSet||x.charset;if(!cM||cM.toLowerCase()==="utf-8"){cM=null}cH=cT[0];cz=cT[1];cG=cT[2];cU=cT[3];if(!cO){var cY=bS/1000;if(!cP.lastVisitTs||(cJ-cP.lastVisitTs)>cY){cP.visitCount++; -cP.lastVisitTs=cP.currentVisitTs}if(!a3||!cH.length){for(cV in bU){if(Object.prototype.hasOwnProperty.call(bU,cV)){cH=M(cZ,bU[cV]);if(cH.length){break}}}for(cV in bc){if(Object.prototype.hasOwnProperty.call(bc,cV)){cz=M(cZ,bc[cV]);if(cz.length){break}}}}c2=c(aX);cK=cU.length?c(cU):"";if(c2.length&&!aA(c2)&&(!a3||!cK.length||aA(cK))){cU=aX}if(cU.length||cH.length){cG=cJ;cT=[cH,cz,cG,bw(cU.slice(0,cD))];cv(cQ,JSON2.stringify(cT),co,aZ,ci)}}cB+="&idsite="+bA+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+cA.getHours()+"&m="+cA.getMinutes()+"&s="+cA.getSeconds()+"&url="+n(bw(cZ))+(aX.length?"&urlref="+n(bw(aX)):"")+((a6&&a6.length)?"&uid="+n(a6):"")+"&_id="+cP.uuid+"&_idts="+cP.createTs+"&_idvc="+cP.visitCount+"&_idn="+cP.newVisitor+(cH.length?"&_rcn="+n(cH):"")+(cz.length?"&_rck="+n(cz):"")+"&_refts="+cG+"&_viewts="+cP.lastVisitTs+(String(cP.lastEcommerceOrderTs).length?"&_ects="+cP.lastEcommerceOrderTs:"")+(String(cU).length?"&_ref="+n(bw(cU.slice(0,cD))):"")+(cM?"&cs="+n(cM):"")+"&send_image=0"; -for(cV in cq){if(Object.prototype.hasOwnProperty.call(cq,cV)){cB+="&"+cV+"="+cq[cV]}}var c1=[];if(cW){for(cV in cW){if(Object.prototype.hasOwnProperty.call(cW,cV)&&/^dimension\d+$/.test(cV)){var cF=cV.replace("dimension","");c1.push(parseInt(cF,10));c1.push(String(cF));cB+="&"+cV+"="+cW[cV];delete cW[cV]}}}if(cW&&t(cW)){cW=null}for(cV in aW){if(Object.prototype.hasOwnProperty.call(aW,cV)){var cL=(-1===c1.indexOf(cV));if(cL){cB+="&dimension"+cV+"="+aW[cV]}}}if(cW){cB+="&data="+n(JSON2.stringify(cW))}else{if(aa){cB+="&data="+n(JSON2.stringify(aa))}}function cI(c3,c4){var c5=JSON2.stringify(c3);if(c5.length>2){return"&"+c4+"="+n(c5)}return""}var c0=cy(bq);var cR=cy(bP);cB+=cI(c0,"cvar");cB+=cI(cR,"e_cvar");if(av){cB+=cI(av,"_cvar");for(cV in cS){if(Object.prototype.hasOwnProperty.call(cS,cV)){if(av[cV][0]===""||av[cV][1]===""){delete av[cV]}}}if(bl){cv(cN,JSON2.stringify(av),bS,aZ,ci)}}if(aG){if(bQ){cB+=">_ms="+bQ}else{if(g&&g.timing&&g.timing.requestStart&&g.timing.responseEnd){cB+=">_ms="+(g.timing.responseEnd-g.timing.requestStart) -}}}cP.lastEcommerceOrderTs=A(cC)&&String(cC).length?cC:cP.lastEcommerceOrderTs;aq(cP);bH();cB+=R(cX);if(ck.length){cB+="&"+ck}if(s(bF)){cB=bF(cB)}return cB}bm=function aK(){var cz=new Date();if(cj+aJ<=cz.getTime()){var cA=bV("ping=1",null,"ping");bb(cA,be);return true}return false};function a0(cC,cB,cH,cD,cz,cK){var cF="idgoal=0",cG,cA=new Date(),cI=[],cJ,cE=String(cC).length;if(cE){cF+="&ec_id="+n(cC);cG=Math.round(cA.getTime()/1000)}cF+="&revenue="+cB;if(String(cH).length){cF+="&ec_st="+cH}if(String(cD).length){cF+="&ec_tx="+cD}if(String(cz).length){cF+="&ec_sh="+cz}if(String(cK).length){cF+="&ec_dt="+cK}if(cl){for(cJ in cl){if(Object.prototype.hasOwnProperty.call(cl,cJ)){if(!A(cl[cJ][1])){cl[cJ][1]=""}if(!A(cl[cJ][2])){cl[cJ][2]=""}if(!A(cl[cJ][3])||String(cl[cJ][3]).length===0){cl[cJ][3]=0}if(!A(cl[cJ][4])||String(cl[cJ][4]).length===0){cl[cJ][4]=1}cI.push(cl[cJ])}}cF+="&ec_items="+n(JSON2.stringify(cI))}cF=bV(cF,aa,"ecommerce",cG);bb(cF,be);if(cE){cl={}}}function bt(cz,cD,cC,cB,cA,cE){if(String(cz).length&&A(cD)){a0(cz,cD,cC,cB,cA,cE) -}}function a1(cz){if(A(cz)){a0("",cz,"","","","")}}function bu(cA,cC,cB){var cz=bV("action_name="+n(Z(cA||aT)),cC,"log");bb(cz,be,cB)}function aE(cB,cA){var cC,cz="(^| )(piwik[_-]"+cA;if(cB){for(cC=0;cC<cB.length;cC++){cz+="|"+cB[cC]}}cz+=")( |$)";return new RegExp(cz)}function az(cz){return(ak&&cz&&0===String(cz).indexOf(ak))}function bW(cD,cz,cE,cA){if(az(cz)){return 0}var cC=aE(bg,"download"),cB=aE(aL,"link"),cF=new RegExp("\\.("+cp.join("|")+")([?&#]|$)","i");if(cB.test(cD)){return"link"}if(cA||cC.test(cD)||cF.test(cz)){return"download"}if(cE){return 0}return"link"}function ae(cA){var cz;cz=cA.parentNode;while(cz!==null&&A(cz)){if(S.isLinkElement(cA)){break}cA=cz;cz=cA.parentNode}return cA}function ct(cE){cE=ae(cE);if(!S.hasNodeAttribute(cE,"href")){return}if(!A(cE.href)){return}var cD=S.getAttributeValueFromNode(cE,"href");if(az(cD)){return}var cA=cE.pathname||bO(cE.href);var cF=cE.hostname||c(cE.href);var cG=cF.toLowerCase();var cB=cE.href.replace(cF,cG);var cC=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto|tel):","i"); -if(!cC.test(cB)){var cz=bW(cE.className,cB,ad(cG,cA),S.hasNodeAttribute(cE,"download"));if(cz){return{type:cz,href:cB}}}}function au(cz,cA,cB,cC){var cD=p.buildInteractionRequestParams(cz,cA,cB,cC);if(!cD){return}return bV(cD,null,"contentInteraction")}function b9(cB,cC,cG,cz,cA){if(!A(cB)){return}if(az(cB)){return cB}var cE=p.toAbsoluteUrl(cB);var cD="redirecturl="+n(cE)+"&";cD+=au(cC,cG,cz,(cA||cB));var cF="&";if(ak.indexOf("?")<0){cF="?"}return ak+cF+cD}function aO(cz,cA){if(!cz||!cA){return false}var cB=p.findTargetNode(cz);if(p.shouldIgnoreInteraction(cB)){return false}cB=p.findTargetNodeNoDefault(cz);if(cB&&!L(cB,cA)){return false}return true}function bX(cB,cA,cD){if(!cB){return}var cz=p.findParentContentNode(cB);if(!cz){return}if(!aO(cz,cB)){return}var cC=p.buildContentBlock(cz);if(!cC){return}if(!cC.target&&cD){cC.target=cD}return p.buildInteractionRequestParams(cA,cC.name,cC.piece,cC.target)}function aB(cA){if(!bE||!bE.length){return false}var cz,cB;for(cz=0;cz<bE.length;cz++){cB=bE[cz]; -if(cB&&cB.name===cA.name&&cB.piece===cA.piece&&cB.target===cA.target){return true}}return false}function ba(cC){if(!cC){return false}var cF=p.findTargetNode(cC);if(!cF||p.shouldIgnoreInteraction(cF)){return false}var cG=ct(cF);if(cr&&cG&&cG.type){return false}if(S.isLinkElement(cF)&&S.hasNodeAttributeWithValue(cF,"href")){var cz=String(S.getAttributeValueFromNode(cF,"href"));if(0===cz.indexOf("#")){return false}if(az(cz)){return true}if(!p.isUrlToCurrentDomain(cz)){return false}var cD=p.buildContentBlock(cC);if(!cD){return}var cB=cD.name;var cH=cD.piece;var cE=cD.target;if(!S.hasNodeAttributeWithValue(cF,p.CONTENT_TARGET_ATTR)||cF.wasContentTargetAttrReplaced){cF.wasContentTargetAttrReplaced=true;cE=p.toAbsoluteUrl(cz);S.setAnyAttribute(cF,p.CONTENT_TARGET_ATTR,cE)}var cA=b9(cz,"click",cB,cH,cE);p.setHrefAttribute(cF,cA);return true}return false}function ar(cA){if(!cA||!cA.length){return}var cz;for(cz=0;cz<cA.length;cz++){ba(cA[cz])}}function aD(cz){return function(cA){if(!cz){return}var cD=p.findParentContentNode(cz); -var cE;if(cA){cE=cA.target||cA.srcElement}if(!cE){cE=cz}if(!aO(cD,cE)){return}bK(be);if(S.isLinkElement(cz)&&S.hasNodeAttributeWithValue(cz,"href")&&S.hasNodeAttributeWithValue(cz,p.CONTENT_TARGET_ATTR)){var cB=S.getAttributeValueFromNode(cz,"href");if(!az(cB)&&cz.wasContentTargetAttrReplaced){S.setAnyAttribute(cz,p.CONTENT_TARGET_ATTR,"")}}var cI=ct(cz);if(ab&&cI&&cI.type){return cI.type}if(ba(cD)){return"href"}var cF=p.buildContentBlock(cD);if(!cF){return}var cC=cF.name;var cJ=cF.piece;var cH=cF.target;var cG=au("click",cC,cJ,cH);bb(cG,be);return cG}}function bv(cB){if(!cB||!cB.length){return}var cz,cA;for(cz=0;cz<cB.length;cz++){cA=p.findTargetNode(cB[cz]);if(cA&&!cA.contentInteractionTrackingSetupDone){cA.contentInteractionTrackingSetupDone=true;Y(cA,"click",aD(cA))}}}function a5(cB,cC){if(!cB||!cB.length){return[]}var cz,cA;for(cz=0;cz<cB.length;cz++){if(aB(cB[cz])){cB.splice(cz,1);cz--}else{bE.push(cB[cz])}}if(!cB||!cB.length){return[]}ar(cC);bv(cC);var cD=[];for(cz=0;cz<cB.length; -cz++){cA=bV(p.buildImpressionRequestParams(cB[cz].name,cB[cz].piece,cB[cz].target),undefined,"contentImpressions");if(cA){cD.push(cA)}}return cD}function b0(cA){var cz=p.collectContent(cA);return a5(cz,cA)}function aM(cA){if(!cA||!cA.length){return[]}var cz;for(cz=0;cz<cA.length;cz++){if(!p.isNodeVisible(cA[cz])){cA.splice(cz,1);cz--}}if(!cA||!cA.length){return[]}return b0(cA)}function am(cB,cz,cA){var cC=p.buildImpressionRequestParams(cB,cz,cA);return bV(cC,null,"contentImpression")}function cu(cC,cA){if(!cC){return}var cz=p.findParentContentNode(cC);var cB=p.buildContentBlock(cz);if(!cB){return}if(!cA){cA="Unknown"}return au(cA,cB.name,cB.piece,cB.target)}function cb(cA,cC,cz,cB){return"e_c="+n(cA)+"&e_a="+n(cC)+(A(cz)?"&e_n="+n(cz):"")+(A(cB)?"&e_v="+n(cB):"")}function af(cB,cD,cz,cC,cE){if(String(cB).length===0||String(cD).length===0){return false}var cA=bV(cb(cB,cD,cz,cC),cE,"event");bb(cA,be)}function bD(cz,cC,cA,cD){var cB=bV("search="+n(cz)+(cC?"&search_cat="+n(cC):"")+(A(cA)?"&search_count="+cA:""),cD,"sitesearch"); -bb(cB,be)}function cf(cz,cC,cB){var cA=bV("idgoal="+cz+(cC?"&revenue="+cC:""),cB,"goal");bb(cA,be)}function cm(cC,cz,cG,cF,cB){var cE=cz+"="+n(bw(cC));var cA=bX(cB,"click",cC);if(cA){cE+="&"+cA}var cD=bV(cE,cG,"link");bb(cD,(cF?0:be),cF)}function bn(cA,cz){if(cA!==""){return cA+cz.charAt(0).toUpperCase()+cz.slice(1)}return cz}function bL(cE){var cD,cz,cC=["","webkit","ms","moz"],cB;if(!aR){for(cz=0;cz<cC.length;cz++){cB=cC[cz];if(Object.prototype.hasOwnProperty.call(x,bn(cB,"hidden"))){if(x[bn(cB,"visibilityState")]==="prerender"){cD=true}break}}}if(cD){Y(x,cB+"visibilitychange",function cA(){x.removeEventListener(cB+"visibilitychange",cA,false);cE()});return}cE()}function ap(cz){if(x.readyState==="complete"){cz()}else{if(K.addEventListener){K.addEventListener("load",cz)}else{if(K.attachEvent){K.attachEvent("onload",cz)}}}}function aP(cC){var cz=false;if(x.attachEvent){cz=x.readyState==="complete"}else{cz=x.readyState!=="loading"}if(cz){cC();return}var cB;if(x.addEventListener){Y(x,"DOMContentLoaded",function cA(){x.removeEventListener("DOMContentLoaded",cA,false); -if(!cz){cz=true;cC()}})}else{if(x.attachEvent){x.attachEvent("onreadystatechange",function cA(){if(x.readyState==="complete"){x.detachEvent("onreadystatechange",cA);if(!cz){cz=true;cC()}}});if(x.documentElement.doScroll&&K===K.top){(function cA(){if(!cz){try{x.documentElement.doScroll("left")}catch(cD){setTimeout(cA,0);return}cz=true;cC()}}())}}}Y(K,"load",function(){if(!cz){cz=true;cC()}},false)}function b6(cz){var cA=ct(cz);if(cA&&cA.type){cA.href=k(cA.href);cm(cA.href,cA.type,undefined,null,cz)}}function bZ(){return x.all&&!x.addEventListener}function ch(cz){var cB=cz.which;var cA=(typeof cz.button);if(!cB&&cA!=="undefined"){if(bZ()){if(cz.button&1){cB=1}else{if(cz.button&2){cB=3}else{if(cz.button&4){cB=2}}}}else{if(cz.button===0||cz.button==="0"){cB=1}else{if(cz.button&1){cB=2}else{if(cz.button&2){cB=3}}}}}return cB}function bo(cz){switch(ch(cz)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function aF(cz){return cz.target||cz.srcElement}function ai(cz){return function(cC){cC=cC||K.event; -var cB=bo(cC);var cD=aF(cC);if(cC.type==="click"){var cA=false;if(cz&&cB==="middle"){cA=true}if(cD&&!cA){b6(cD)}}else{if(cC.type==="mousedown"){if(cB==="middle"&&cD){aw=cB;a8=cD}else{aw=a8=null}}else{if(cC.type==="mouseup"){if(cB===aw&&cD===a8){b6(cD)}aw=a8=null}else{if(cC.type==="contextmenu"){b6(cD)}}}}}}function ac(cA,cz){Y(cA,"click",ai(cz),false);if(cz){Y(cA,"mouseup",ai(cz),false);Y(cA,"mousedown",ai(cz),false);Y(cA,"contextmenu",ai(cz),false)}}function a9(cA){if(!ab){ab=true;var cB,cz=aE(a7,"ignore"),cC=x.links;if(cC){for(cB=0;cB<cC.length;cB++){if(!cz.test(cC[cB].className)){ac(cC[cB],cA)}}}}}function ax(cB,cD,cE){if(bJ){return true}bJ=true;var cF=false;var cC,cA;function cz(){cF=true}ap(function(){function cG(cI){setTimeout(function(){if(!bJ){return}cF=false;cE.trackVisibleContentImpressions();cG(cI)},cI)}function cH(cI){setTimeout(function(){if(!bJ){return}if(cF){cF=false;cE.trackVisibleContentImpressions()}cH(cI)},cI)}if(cB){cC=["scroll","resize"];for(cA=0;cA<cC.length;cA++){if(x.addEventListener){x.addEventListener(cC[cA],cz) -}else{K.attachEvent("on"+cC[cA],cz)}}cH(100)}if(cD&&cD>0){cD=parseInt(cD,10);cG(cD)}})}function b4(){var cA,cC,cD={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(!((new RegExp("MSIE")).test(f.userAgent))){if(f.mimeTypes&&f.mimeTypes.length){for(cA in cD){if(Object.prototype.hasOwnProperty.call(cD,cA)){cC=f.mimeTypes[cD[cA]];cq[cA]=(cC&&cC.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&A(f.javaEnabled)&&f.javaEnabled()){cq.java="1"}if(s(K.GearsFactory)){cq.gears="1"}cq.cookie=bz()}var cB=parseInt(O.width,10);var cz=parseInt(O.height,10);cq.res=parseInt(cB,10)+"x"+parseInt(cz,10)}b4();aS();aq();return{getVisitorId:function(){return aC().uuid},getVisitorInfo:function(){return ca()},getAttributionInfo:function(){return bh()},getAttributionCampaignName:function(){return bh()[0] -},getAttributionCampaignKeyword:function(){return bh()[1]},getAttributionReferrerTimestamp:function(){return bh()[2]},getAttributionReferrerUrl:function(){return bh()[3]},setTrackerUrl:function(cz){ak=cz},getTrackerUrl:function(){return ak},addTracker:function(cz,cB){if(!cB){throw new Error("A siteId must be given to add a new tracker")}if(!A(cz)||null===cz){cz=this.getTrackerUrl()}var cA=new H(cz,cB);z.push(cA);return cA},getSiteId:function(){return bA},setSiteId:function(cz){bx(cz)},setUserId:function(cz){if(!A(cz)||!cz.length){return}a6=cz;bj=bB(a6).substr(0,16)},getUserId:function(){return a6},setCustomData:function(cz,cA){if(N(cz)){aa=cz}else{if(!aa){aa={}}aa[cz]=cA}},getCustomData:function(){return aa},setCustomRequestProcessing:function(cz){bF=cz},appendToTrackingUrl:function(cz){ck=cz},getRequest:function(cz){return bV(cz)},addPlugin:function(cz,cA){a[cz]=cA},setCustomDimension:function(cz,cA){cz=parseInt(cz,10);if(cz>0){if(!A(cA)){cA=""}if(!q(cA)){cA=String(cA)}aW[cz]=cA}},getCustomDimension:function(cz){cz=parseInt(cz,10); -if(cz>0&&Object.prototype.hasOwnProperty.call(aW,cz)){return aW[cz]}},deleteCustomDimension:function(cz){cz=parseInt(cz,10);if(cz>0){delete aW[cz]}},setCustomVariable:function(cA,cz,cD,cB){var cC;if(!A(cB)){cB="visit"}if(!A(cz)){return}if(!A(cD)){cD=""}if(cA>0){cz=!q(cz)?String(cz):cz;cD=!q(cD)?String(cD):cD;cC=[cz.slice(0,a2),cD.slice(0,a2)];if(cB==="visit"||cB===2){b3();av[cA]=cC}else{if(cB==="page"||cB===3){bq[cA]=cC}else{if(cB==="event"){bP[cA]=cC}}}}},getCustomVariable:function(cA,cB){var cz;if(!A(cB)){cB="visit"}if(cB==="page"||cB===3){cz=bq[cA]}else{if(cB==="event"){cz=bP[cA]}else{if(cB==="visit"||cB===2){b3();cz=av[cA]}}}if(!A(cz)||(cz&&cz[0]==="")){return false}return cz},deleteCustomVariable:function(cz,cA){if(this.getCustomVariable(cz,cA)){this.setCustomVariable(cz,"","",cA)}},storeCustomVariablesInCookie:function(){bl=true},setLinkTrackingTimer:function(cz){be=cz},setDownloadExtensions:function(cz){if(q(cz)){cz=cz.split("|")}cp=cz},addDownloadExtensions:function(cA){var cz;if(q(cA)){cA=cA.split("|") -}for(cz=0;cz<cA.length;cz++){cp.push(cA[cz])}},removeDownloadExtensions:function(cB){var cA,cz=[];if(q(cB)){cB=cB.split("|")}for(cA=0;cA<cp.length;cA++){if(D(cB,cp[cA])===-1){cz.push(cp[cA])}}cp=cz},setDomains:function(cz){ag=q(cz)?[cz]:cz;var cD=false,cB=0,cA;for(cB;cB<ag.length;cB++){cA=String(ag[cB]);if(b5(cg,C(cA))){cD=true;break}var cC=bO(cA);if(cC&&cC!=="/"&&cC!=="/*"){cD=true;break}}if(!cD){ag.push(cg)}},setIgnoreClasses:function(cz){a7=q(cz)?[cz]:cz},setRequestMethod:function(cz){cs=cz||bM},setRequestContentType:function(cz){bY=cz||ao},setReferrerUrl:function(cz){aX=cz},setCustomUrl:function(cz){aI=bp(bi,cz)},setDocumentTitle:function(cz){aT=cz},setAPIUrl:function(cz){bd=cz},setDownloadClasses:function(cz){bg=q(cz)?[cz]:cz},setLinkClasses:function(cz){aL=q(cz)?[cz]:cz},setCampaignNameKey:function(cz){bU=q(cz)?[cz]:cz},setCampaignKeywordKey:function(cz){bc=q(cz)?[cz]:cz},discardHashTag:function(cz){bk=cz},setCookieNamePrefix:function(cz){aU=cz;av=br()},setCookieDomain:function(cz){var cA=C(cz); -if(a4(cA)){ci=cA;aS()}},setCookiePath:function(cz){aZ=cz;aS()},setVisitorCookieTimeout:function(cz){b8=cz*1000},setSessionCookieTimeout:function(cz){bS=cz*1000},setReferralCookieTimeout:function(cz){co=cz*1000},setConversionAttributionFirstReferrer:function(cz){a3=cz},disableCookies:function(){aV=true;cq.cookie="0";if(bA){al()}},deleteCookies:function(){al()},setDoNotTrack:function(cA){var cz=f.doNotTrack||f.msDoNotTrack;cc=cA&&(cz==="yes"||cz==="1");if(cc){this.disableCookies()}},addListener:function(cA,cz){ac(cA,cz)},enableLinkTracking:function(cz){cr=true;bL(function(){aP(function(){a9(cz)})})},enableJSErrorTracking:function(){if(ce){return}ce=true;var cz=K.onerror;K.onerror=function(cE,cC,cB,cD,cA){bL(function(){var cF="JavaScript Errors";var cG=cC+":"+cB;if(cD){cG+=":"+cD}af(cF,cG,cE)});if(cz){return cz(cE,cC,cB,cD,cA)}return false}},disablePerformanceTracking:function(){aG=false},setGenerationTimeMs:function(cz){bQ=parseInt(cz,10)},enableHeartBeatTimer:function(cz){cz=Math.max(cz,1); -aJ=(cz||15)*1000;if(cj!==null){cx()}},killFrame:function(){if(K.location!==K.top.location){K.top.location=K.location}},redirectFile:function(cz){if(K.location.protocol==="file:"){K.location=cz}},setCountPreRendered:function(cz){aR=cz},trackGoal:function(cz,cB,cA){bL(function(){cf(cz,cB,cA)})},trackLink:function(cA,cz,cC,cB){bL(function(){cm(cA,cz,cC,cB)})},trackPageView:function(cz,cB,cA){bE=[];if(E(bA)){bL(function(){P(ak,bd,bA)})}else{bL(function(){bu(cz,cB,cA)})}},trackAllContentImpressions:function(){if(E(bA)){return}bL(function(){aP(function(){var cz=p.findContentNodes();var cA=b0(cz);cw(cA,be)})})},trackVisibleContentImpressions:function(cz,cA){if(E(bA)){return}if(!A(cz)){cz=true}if(!A(cA)){cA=750}ax(cz,cA,this);bL(function(){ap(function(){var cB=p.findContentNodes();var cC=aM(cB);cw(cC,be)})})},trackContentImpression:function(cB,cz,cA){if(E(bA)){return}if(!cB){return}cz=cz||"Unknown";bL(function(){var cC=am(cB,cz,cA);bb(cC,be)})},trackContentImpressionsWithinNode:function(cz){if(E(bA)||!cz){return -}bL(function(){if(bJ){ap(function(){var cA=p.findContentNodesWithinNode(cz);var cB=aM(cA);cw(cB,be)})}else{aP(function(){var cA=p.findContentNodesWithinNode(cz);var cB=b0(cA);cw(cB,be)})}})},trackContentInteraction:function(cB,cC,cz,cA){if(E(bA)){return}if(!cB||!cC){return}cz=cz||"Unknown";bL(function(){var cD=au(cB,cC,cz,cA);bb(cD,be)})},trackContentInteractionNode:function(cA,cz){if(E(bA)||!cA){return}bL(function(){var cB=cu(cA,cz);bb(cB,be)})},logAllContentBlocksOnPage:function(){var cA=p.findContentNodes();var cz=p.collectContent(cA);if(console!==undefined&&console&&console.log){console.log(cz)}},trackEvent:function(cA,cC,cz,cB,cD){bL(function(){af(cA,cC,cz,cB,cD)})},trackSiteSearch:function(cz,cB,cA,cC){bL(function(){bD(cz,cB,cA,cC)})},setEcommerceView:function(cC,cz,cB,cA){if(!A(cB)||!cB.length){cB=""}else{if(cB instanceof Array){cB=JSON2.stringify(cB)}}bq[5]=["_pkc",cB];if(A(cA)&&String(cA).length){bq[2]=["_pkp",cA]}if((!A(cC)||!cC.length)&&(!A(cz)||!cz.length)){return}if(A(cC)&&cC.length){bq[3]=["_pks",cC] -}if(!A(cz)||!cz.length){cz=""}bq[4]=["_pkn",cz]},addEcommerceItem:function(cD,cz,cB,cA,cC){if(cD.length){cl[cD]=[cD,cz,cB,cA,cC]}},trackEcommerceOrder:function(cz,cD,cC,cB,cA,cE){bt(cz,cD,cC,cB,cA,cE)},trackEcommerceCartUpdate:function(cz){a1(cz)}}}function y(){return{push:T}}function b(af,ae){var ag={};var ac,ad;for(ac=0;ac<ae.length;ac++){var aa=ae[ac];ag[aa]=1;for(ad=0;ad<af.length;ad++){if(af[ad]&&af[ad][0]){var ab=af[ad][0];if(aa===ab){T(af[ad]);delete af[ad];if(ag[ab]>1){W("The method "+ab+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}ag[ab]++}}}}return af}Y(K,"beforeunload",U,false);Date.prototype.getTimeAlias=Date.prototype.getTime;z.push(new H());var u=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"]; +}}K.name=ai+"###"+af+"###"+aa+"###"+ad}var ah=K.name.split("###");return ah.length===4&&ah[0]===ai}function P(ab,ah,ad){var ag=K.name.split("###"),af=ag[1],aa=ag[2],ae=ag[3],ac=F(ab,ah);j(ac+"plugins/Overlay/client/client.js?v=1",function(){Piwik_Overlay_Client.initialize(ac,ad,af,aa,ae)})}function o(){if(A(K.frameElement)){return(K.frameElement&&String(K.frameElement.nodeName).toLowerCase()==="iframe")?true:false}try{return K.self!==K.top}catch(aa){return true}}function H(bI,bC){var by=Q(x.domain,K.location.href,B()),ch=C(by[0]),bi=k(by[1]),aX=k(by[2]),cf=false,bM="GET",ct=bM,ao="application/x-www-form-urlencoded; charset=UTF-8",bY=ao,ak=bI||"",bd="",cl="",bA=bC||"",a6="",bj="",aI,cq=["7z","aac","apk","arc","arj","asf","asx","avi","azw3","bin","csv","deb","dmg","doc","docx","epub","exe","flv","gif","gz","gzip","hqx","ibooks","jar","jpg","jpeg","js","mobi","mp2","mp3","mp4","mpg","mpeg","mov","movie","msi","msp","odb","odf","odg","ods","odt","ogg","ogv","pdf","phps","png","ppt","pptx","qt","qtm","ra","ram","rar","rpm","sea","sit","tar","tbz","tbz2","bz","bz2","tgz","torrent","txt","wav","wma","wmv","wpd","xls","xlsx","xml","z","zip"],ag=[ch],a7=[],bg=[],aL=[],be=500,b8,aJ,bm,bk,aa,bU=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],bc=["pk_kwd","piwik_kwd","utm_term"],aU="_pk_",cj,aZ,aV=false,cd,aR,a3,b9=33955200000,bS=1800000,cp=15768000000,aG=true,bQ=0,bl=false,av=false,bF,bq={},bP={},aW={},a2=200,cm={},cr={},bE=[],bJ=false,b2=false,ab=false,cs=false,at=false,aQ=o(),ck=null,bG,aw,a8,bB=X,aY,aT; +try{aT=x.title}catch(b0){aT=""}function cw(cG,cD,cC,cF,cB,cE){if(aV){return}var cA;if(cC){cA=new Date();cA.setTime(cA.getTime()+cC)}x.cookie=cG+"="+n(cD)+(cC?";expires="+cA.toGMTString():"")+";path="+(cF||"/")+(cB?";domain="+cB:"")+(cE?";secure":"")}function aj(cC){if(aV){return 0}var cA=new RegExp("(^|;)[ ]*"+cC+"=([^;]*)"),cB=cA.exec(x.cookie);return cB?J(cB[2]):0}function bw(cA){var cB;if(bk){cB=new RegExp("#.*");return cA.replace(cB,"")}return cA}function bp(cC,cA){var cD=m(cA),cB;if(cD){return cA}if(cA.slice(0,1)==="/"){return m(cC)+"://"+c(cC)+cA}cC=bw(cC);cB=cC.indexOf("?");if(cB>=0){cC=cC.slice(0,cB)}cB=cC.lastIndexOf("/");if(cB!==cC.length-1){cC=cC.slice(0,cB+1)}return cC+cA}function b6(cC,cA){var cB;cC=String(cC).toLowerCase();cA=String(cA).toLowerCase();if(cC===cA){return true}if(cA.slice(0,1)==="."){if(cC===cA.slice(1)){return true}cB=cC.length-cA.length;if((cB>0)&&(cC.slice(cB)===cA)){return true}}return false}function bO(cA){var cB=document.createElement("a");if(cA.indexOf("//")!==0&&cA.indexOf("http")!==0){if(cA.indexOf("*")===0){cA=cA.substr(1) +}if(cA.indexOf(".")===0){cA=cA.substr(1)}cA="http://"+cA}cB.href=p.toAbsoluteUrl(cA);if(cB.pathname){return cB.pathname}return""}function aH(cB,cA){if(!V(cA,"/")){cA="/"+cA}if(!V(cB,"/")){cB="/"+cB}var cC=(cA==="/"||cA==="/*");if(cC){return true}if(cB===cA){return true}cA=String(cA).toLowerCase();cB=String(cB).toLowerCase();if(I(cA,"*")){cA=cA.slice(0,-1);cC=(!cA||cA==="/");if(cC){return true}if(cB===cA){return true}return cB.indexOf(cA)===0}if(!I(cB,"/")){cB+="/"}if(!I(cA,"/")){cA+="/"}return cB.indexOf(cA)===0}function ad(cE,cG){var cB,cA,cC,cD,cF;for(cB=0;cB<ag.length;cB++){cD=C(ag[cB]);cF=bO(ag[cB]);if(b6(cE,cD)&&aH(cG,cF)){return true}}return false}function aA(cD){var cB,cA,cC;for(cB=0;cB<ag.length;cB++){cA=C(ag[cB].toLowerCase());if(cD===cA){return true}if(cA.slice(0,1)==="."){if(cD===cA.slice(1)){return true}cC=cD.length-cA.length;if((cC>0)&&(cD.slice(cC)===cA)){return true}}}return false}function bT(cA,cC){var cB=new Image(1,1);cB.onload=function(){w=0;if(typeof cC==="function"){cC() +}};cA=cA.replace("send_image=0","send_image=1");cB.src=ak+(ak.indexOf("?")<0?"?":"&")+cA}function co(cB,cE,cA){if(!A(cA)||null===cA){cA=true}try{var cD=K.XMLHttpRequest?new K.XMLHttpRequest():K.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;cD.open("POST",ak,true);cD.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)&&cA){bT(cB,cE)}else{if(this.readyState===4&&(typeof cE==="function")){cE()}}};cD.setRequestHeader("Content-Type",bY);cD.send(cB)}catch(cC){if(cA){bT(cB,cE)}}}function bK(cB){var cA=new Date();var cC=cA.getTime()+cB;if(!l||cC>l){l=cC}}function bR(cA){if(bG||!aJ){return}bG=setTimeout(function cB(){bG=null;if(!aQ){aQ=(!x.hasFocus||x.hasFocus())}if(!aQ){bR(aJ);return}if(bm()){return}var cC=new Date(),cD=aJ-(cC.getTime()-ck);cD=Math.min(aJ,cD);bR(cD)},cA||aJ)}function bf(){if(!bG){return}clearTimeout(bG);bG=null}function aN(){aQ=true;if(bm()){return}bR()}function ah(){bf()}function cy(){if(at||!aJ){return}at=true;Y(K,"focus",aN); +Y(K,"blur",ah);bR()}function b3(cE){var cB=new Date();var cA=cB.getTime();ck=cA;if(b2&&cA<b2){var cC=b2-cA;setTimeout(cE,cC);bK(cC+50);b2+=50;return}if(b2===false){var cD=800;b2=cA+cD}cE()}function bb(cB,cA,cC){if(!cd&&cB){b3(function(){if(ct==="POST"){co(cB,cC)}else{bT(cB,cC)}bK(cA)})}if(!at){cy()}else{bR()}}function bN(cA){if(cd){return false}return(cA&&cA.length)}function cx(cC,cA){if(!bN(cC)){return}var cB='{"requests":["?'+cC.join('","?')+'"]}';b3(function(){co(cB,null,false);bK(cA)})}function ay(cA){return aU+cA+"."+bA+"."+aY}function bz(){if(aV){return"0"}if(!A(f.cookieEnabled)){var cA=ay("testcookie");cw(cA,"1");return aj(cA)==="1"?"1":"0"}return f.cookieEnabled?"1":"0"}function aS(){aY=bB((cj||ch)+(aZ||"/")).slice(0,4)}function br(){var cB=ay("cvar"),cA=aj(cB);if(cA.length){cA=JSON2.parse(cA);if(N(cA)){return cA}}return{}}function b4(){if(av===false){av=br()}}function ce(){return bB((f.userAgent||"")+(f.platform||"")+JSON2.stringify(cr)+(new Date()).getTime()+Math.random()).slice(0,16) +}function cb(){var cC=new Date(),cA=Math.round(cC.getTime()/1000),cB=ay("id"),cF=aj(cB),cE,cD;if(cF){cE=cF.split(".");cE.unshift("0");if(bj.length){cE[1]=bj}return cE}if(bj.length){cD=bj}else{if("0"===bz()){cD=""}else{cD=ce()}}cE=["1",cD,cA,0,cA,"",""];return cE}function aC(){var cH=cb(),cD=cH[0],cE=cH[1],cB=cH[2],cA=cH[3],cF=cH[4],cC=cH[5];if(!A(cH[6])){cH[6]=""}var cG=cH[6];return{newVisitor:cD,uuid:cE,createTs:cB,visitCount:cA,currentVisitTs:cF,lastVisitTs:cC,lastEcommerceOrderTs:cG}}function an(){var cD=new Date(),cB=cD.getTime(),cE=aC().createTs;var cA=parseInt(cE,10);var cC=(cA*1000)+b9-cB;return cC}function aq(cA){if(!bA){return}var cC=new Date(),cB=Math.round(cC.getTime()/1000);if(!A(cA)){cA=aC()}var cD=cA.uuid+"."+cA.createTs+"."+cA.visitCount+"."+cB+"."+cA.lastVisitTs+"."+cA.lastEcommerceOrderTs;cw(ay("id"),cD,an(),aZ,cj)}function bh(){var cA=aj(ay("ref"));if(cA.length){try{cA=JSON2.parse(cA);if(N(cA)){return cA}}catch(cB){}}return["","",0,""]}function bs(cC,cB,cA){cw(cC,"",-86400,cB,cA) +}function a4(cB){var cA="testvalue";cw("test",cA,10000,null,cB);if(aj("test")===cA){bs("test",null,cB);return true}return false}function al(){var cC=aV;aV=false;var cA=["id","ses","cvar","ref"];var cB,cD;for(cB=0;cB<cA.length;cB++){cD=ay(cA[cB]);if(0!==aj(cD)){bs(cD,aZ,cj)}}aV=cC}function bx(cA){bA=cA;aq()}function cz(cE){if(!cE||!N(cE)){return}var cD=[];var cC;for(cC in cE){if(Object.prototype.hasOwnProperty.call(cE,cC)){cD.push(cC)}}var cF={};cD.sort();var cA=cD.length;var cB;for(cB=0;cB<cA;cB++){cF[cD[cB]]=cE[cD[cB]]}return cF}function bH(){cw(ay("ses"),"*",bS,aZ,cj)}function bV(cC,cX,cY,cD){var cW,cB=new Date(),cK=Math.round(cB.getTime()/1000),cH,cV,cE=1024,c3,cL,cT=av,cF=ay("ses"),cR=ay("ref"),cO=ay("cvar"),cP=aj(cF),cU=bh(),c0=aI||bi,cI,cA;if(aV){al()}if(cd){return""}var cQ=aC();if(!A(cD)){cD=""}var cN=x.characterSet||x.charset;if(!cN||cN.toLowerCase()==="utf-8"){cN=null}cI=cU[0];cA=cU[1];cH=cU[2];cV=cU[3];if(!cP){var cZ=bS/1000;if(!cQ.lastVisitTs||(cK-cQ.lastVisitTs)>cZ){cQ.visitCount++; +cQ.lastVisitTs=cQ.currentVisitTs}if(!a3||!cI.length){for(cW in bU){if(Object.prototype.hasOwnProperty.call(bU,cW)){cI=M(c0,bU[cW]);if(cI.length){break}}}for(cW in bc){if(Object.prototype.hasOwnProperty.call(bc,cW)){cA=M(c0,bc[cW]);if(cA.length){break}}}}c3=c(aX);cL=cV.length?c(cV):"";if(c3.length&&!aA(c3)&&(!a3||!cL.length||aA(cL))){cV=aX}if(cV.length||cI.length){cH=cK;cU=[cI,cA,cH,bw(cV.slice(0,cE))];cw(cR,JSON2.stringify(cU),cp,aZ,cj)}}cC+="&idsite="+bA+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+cB.getHours()+"&m="+cB.getMinutes()+"&s="+cB.getSeconds()+"&url="+n(bw(c0))+(aX.length?"&urlref="+n(bw(aX)):"")+((a6&&a6.length)?"&uid="+n(a6):"")+"&_id="+cQ.uuid+"&_idts="+cQ.createTs+"&_idvc="+cQ.visitCount+"&_idn="+cQ.newVisitor+(cI.length?"&_rcn="+n(cI):"")+(cA.length?"&_rck="+n(cA):"")+"&_refts="+cH+"&_viewts="+cQ.lastVisitTs+(String(cQ.lastEcommerceOrderTs).length?"&_ects="+cQ.lastEcommerceOrderTs:"")+(String(cV).length?"&_ref="+n(bw(cV.slice(0,cE))):"")+(cN?"&cs="+n(cN):"")+"&send_image=0"; +for(cW in cr){if(Object.prototype.hasOwnProperty.call(cr,cW)){cC+="&"+cW+"="+cr[cW]}}var c2=[];if(cX){for(cW in cX){if(Object.prototype.hasOwnProperty.call(cX,cW)&&/^dimension\d+$/.test(cW)){var cG=cW.replace("dimension","");c2.push(parseInt(cG,10));c2.push(String(cG));cC+="&"+cW+"="+cX[cW];delete cX[cW]}}}if(cX&&t(cX)){cX=null}for(cW in aW){if(Object.prototype.hasOwnProperty.call(aW,cW)){var cM=(-1===c2.indexOf(cW));if(cM){cC+="&dimension"+cW+"="+aW[cW]}}}if(cX){cC+="&data="+n(JSON2.stringify(cX))}else{if(aa){cC+="&data="+n(JSON2.stringify(aa))}}function cJ(c4,c5){var c6=JSON2.stringify(c4);if(c6.length>2){return"&"+c5+"="+n(c6)}return""}var c1=cz(bq);var cS=cz(bP);cC+=cJ(c1,"cvar");cC+=cJ(cS,"e_cvar");if(av){cC+=cJ(av,"_cvar");for(cW in cT){if(Object.prototype.hasOwnProperty.call(cT,cW)){if(av[cW][0]===""||av[cW][1]===""){delete av[cW]}}}if(bl){cw(cO,JSON2.stringify(av),bS,aZ,cj)}}if(aG){if(bQ){cC+=">_ms="+bQ}else{if(g&&g.timing&&g.timing.requestStart&&g.timing.responseEnd){cC+=">_ms="+(g.timing.responseEnd-g.timing.requestStart) +}}}cQ.lastEcommerceOrderTs=A(cD)&&String(cD).length?cD:cQ.lastEcommerceOrderTs;aq(cQ);bH();cC+=R(cY);if(cl.length){cC+="&"+cl}if(s(bF)){cC=bF(cC)}return cC}bm=function aK(){var cA=new Date();if(ck+aJ<=cA.getTime()){var cB=bV("ping=1",null,"ping");bb(cB,be);return true}return false};function a0(cD,cC,cI,cE,cA,cL){var cG="idgoal=0",cH,cB=new Date(),cJ=[],cK,cF=String(cD).length;if(cF){cG+="&ec_id="+n(cD);cH=Math.round(cB.getTime()/1000)}cG+="&revenue="+cC;if(String(cI).length){cG+="&ec_st="+cI}if(String(cE).length){cG+="&ec_tx="+cE}if(String(cA).length){cG+="&ec_sh="+cA}if(String(cL).length){cG+="&ec_dt="+cL}if(cm){for(cK in cm){if(Object.prototype.hasOwnProperty.call(cm,cK)){if(!A(cm[cK][1])){cm[cK][1]=""}if(!A(cm[cK][2])){cm[cK][2]=""}if(!A(cm[cK][3])||String(cm[cK][3]).length===0){cm[cK][3]=0}if(!A(cm[cK][4])||String(cm[cK][4]).length===0){cm[cK][4]=1}cJ.push(cm[cK])}}cG+="&ec_items="+n(JSON2.stringify(cJ))}cG=bV(cG,aa,"ecommerce",cH);bb(cG,be);if(cF){cm={}}}function bt(cA,cE,cD,cC,cB,cF){if(String(cA).length&&A(cE)){a0(cA,cE,cD,cC,cB,cF) +}}function a1(cA){if(A(cA)){a0("",cA,"","","","")}}function bu(cB,cD,cC){var cA=bV("action_name="+n(Z(cB||aT)),cD,"log");bb(cA,be,cC)}function aE(cC,cB){var cD,cA="(^| )(piwik[_-]"+cB;if(cC){for(cD=0;cD<cC.length;cD++){cA+="|"+cC[cD]}}cA+=")( |$)";return new RegExp(cA)}function az(cA){return(ak&&cA&&0===String(cA).indexOf(ak))}function bW(cE,cA,cF,cB){if(az(cA)){return 0}var cD=aE(bg,"download"),cC=aE(aL,"link"),cG=new RegExp("\\.("+cq.join("|")+")([?&#]|$)","i");if(cC.test(cE)){return"link"}if(cB||cD.test(cE)||cG.test(cA)){return"download"}if(cF){return 0}return"link"}function ae(cB){var cA;cA=cB.parentNode;while(cA!==null&&A(cA)){if(S.isLinkElement(cB)){break}cB=cA;cA=cB.parentNode}return cB}function cu(cF){cF=ae(cF);if(!S.hasNodeAttribute(cF,"href")){return}if(!A(cF.href)){return}var cE=S.getAttributeValueFromNode(cF,"href");if(az(cE)){return}var cB=cF.pathname||bO(cF.href);var cG=cF.hostname||c(cF.href);var cH=cG.toLowerCase();var cC=cF.href.replace(cG,cH);var cD=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto|tel):","i"); +if(!cD.test(cC)){var cA=bW(cF.className,cC,ad(cH,cB),S.hasNodeAttribute(cF,"download"));if(cA){return{type:cA,href:cC}}}}function au(cA,cB,cC,cD){var cE=p.buildInteractionRequestParams(cA,cB,cC,cD);if(!cE){return}return bV(cE,null,"contentInteraction")}function ca(cC,cD,cH,cA,cB){if(!A(cC)){return}if(az(cC)){return cC}var cF=p.toAbsoluteUrl(cC);var cE="redirecturl="+n(cF)+"&";cE+=au(cD,cH,cA,(cB||cC));var cG="&";if(ak.indexOf("?")<0){cG="?"}return ak+cG+cE}function aO(cA,cB){if(!cA||!cB){return false}var cC=p.findTargetNode(cA);if(p.shouldIgnoreInteraction(cC)){return false}cC=p.findTargetNodeNoDefault(cA);if(cC&&!L(cC,cB)){return false}return true}function bX(cC,cB,cE){if(!cC){return}var cA=p.findParentContentNode(cC);if(!cA){return}if(!aO(cA,cC)){return}var cD=p.buildContentBlock(cA);if(!cD){return}if(!cD.target&&cE){cD.target=cE}return p.buildInteractionRequestParams(cB,cD.name,cD.piece,cD.target)}function aB(cB){if(!bE||!bE.length){return false}var cA,cC;for(cA=0;cA<bE.length;cA++){cC=bE[cA]; +if(cC&&cC.name===cB.name&&cC.piece===cB.piece&&cC.target===cB.target){return true}}return false}function ba(cD){if(!cD){return false}var cG=p.findTargetNode(cD);if(!cG||p.shouldIgnoreInteraction(cG)){return false}var cH=cu(cG);if(cs&&cH&&cH.type){return false}if(S.isLinkElement(cG)&&S.hasNodeAttributeWithValue(cG,"href")){var cA=String(S.getAttributeValueFromNode(cG,"href"));if(0===cA.indexOf("#")){return false}if(az(cA)){return true}if(!p.isUrlToCurrentDomain(cA)){return false}var cE=p.buildContentBlock(cD);if(!cE){return}var cC=cE.name;var cI=cE.piece;var cF=cE.target;if(!S.hasNodeAttributeWithValue(cG,p.CONTENT_TARGET_ATTR)||cG.wasContentTargetAttrReplaced){cG.wasContentTargetAttrReplaced=true;cF=p.toAbsoluteUrl(cA);S.setAnyAttribute(cG,p.CONTENT_TARGET_ATTR,cF)}var cB=ca(cA,"click",cC,cI,cF);p.setHrefAttribute(cG,cB);return true}return false}function ar(cB){if(!cB||!cB.length){return}var cA;for(cA=0;cA<cB.length;cA++){ba(cB[cA])}}function aD(cA){return function(cB){if(!cA){return}var cE=p.findParentContentNode(cA); +var cF;if(cB){cF=cB.target||cB.srcElement}if(!cF){cF=cA}if(!aO(cE,cF)){return}bK(be);if(S.isLinkElement(cA)&&S.hasNodeAttributeWithValue(cA,"href")&&S.hasNodeAttributeWithValue(cA,p.CONTENT_TARGET_ATTR)){var cC=S.getAttributeValueFromNode(cA,"href");if(!az(cC)&&cA.wasContentTargetAttrReplaced){S.setAnyAttribute(cA,p.CONTENT_TARGET_ATTR,"")}}var cJ=cu(cA);if(ab&&cJ&&cJ.type){return cJ.type}if(ba(cE)){return"href"}var cG=p.buildContentBlock(cE);if(!cG){return}var cD=cG.name;var cK=cG.piece;var cI=cG.target;var cH=au("click",cD,cK,cI);bb(cH,be);return cH}}function bv(cC){if(!cC||!cC.length){return}var cA,cB;for(cA=0;cA<cC.length;cA++){cB=p.findTargetNode(cC[cA]);if(cB&&!cB.contentInteractionTrackingSetupDone){cB.contentInteractionTrackingSetupDone=true;Y(cB,"click",aD(cB))}}}function a5(cC,cD){if(!cC||!cC.length){return[]}var cA,cB;for(cA=0;cA<cC.length;cA++){if(aB(cC[cA])){cC.splice(cA,1);cA--}else{bE.push(cC[cA])}}if(!cC||!cC.length){return[]}ar(cD);bv(cD);var cE=[];for(cA=0;cA<cC.length; +cA++){cB=bV(p.buildImpressionRequestParams(cC[cA].name,cC[cA].piece,cC[cA].target),undefined,"contentImpressions");if(cB){cE.push(cB)}}return cE}function b1(cB){var cA=p.collectContent(cB);return a5(cA,cB)}function aM(cB){if(!cB||!cB.length){return[]}var cA;for(cA=0;cA<cB.length;cA++){if(!p.isNodeVisible(cB[cA])){cB.splice(cA,1);cA--}}if(!cB||!cB.length){return[]}return b1(cB)}function am(cC,cA,cB){var cD=p.buildImpressionRequestParams(cC,cA,cB);return bV(cD,null,"contentImpression")}function cv(cD,cB){if(!cD){return}var cA=p.findParentContentNode(cD);var cC=p.buildContentBlock(cA);if(!cC){return}if(!cB){cB="Unknown"}return au(cB,cC.name,cC.piece,cC.target)}function cc(cB,cD,cA,cC){return"e_c="+n(cB)+"&e_a="+n(cD)+(A(cA)?"&e_n="+n(cA):"")+(A(cC)?"&e_v="+n(cC):"")}function af(cC,cE,cA,cD,cF){if(String(cC).length===0||String(cE).length===0){return false}var cB=bV(cc(cC,cE,cA,cD),cF,"event");bb(cB,be)}function bD(cA,cD,cB,cE){var cC=bV("search="+n(cA)+(cD?"&search_cat="+n(cD):"")+(A(cB)?"&search_count="+cB:""),cE,"sitesearch"); +bb(cC,be)}function cg(cA,cD,cC){var cB=bV("idgoal="+cA+(cD?"&revenue="+cD:""),cC,"goal");bb(cB,be)}function cn(cD,cA,cH,cG,cC){var cF=cA+"="+n(bw(cD));var cB=bX(cC,"click",cD);if(cB){cF+="&"+cB}var cE=bV(cF,cH,"link");bb(cE,(cG?0:be),cG)}function bn(cB,cA){if(cB!==""){return cB+cA.charAt(0).toUpperCase()+cA.slice(1)}return cA}function bL(cF){var cE,cA,cD=["","webkit","ms","moz"],cC;if(!aR){for(cA=0;cA<cD.length;cA++){cC=cD[cA];if(Object.prototype.hasOwnProperty.call(x,bn(cC,"hidden"))){if(x[bn(cC,"visibilityState")]==="prerender"){cE=true}break}}}if(cE){Y(x,cC+"visibilitychange",function cB(){x.removeEventListener(cC+"visibilitychange",cB,false);cF()});return}cF()}function ap(cA){if(x.readyState==="complete"){cA()}else{if(K.addEventListener){K.addEventListener("load",cA)}else{if(K.attachEvent){K.attachEvent("onload",cA)}}}}function aP(cD){var cA=false;if(x.attachEvent){cA=x.readyState==="complete"}else{cA=x.readyState!=="loading"}if(cA){cD();return}var cC;if(x.addEventListener){Y(x,"DOMContentLoaded",function cB(){x.removeEventListener("DOMContentLoaded",cB,false); +if(!cA){cA=true;cD()}})}else{if(x.attachEvent){x.attachEvent("onreadystatechange",function cB(){if(x.readyState==="complete"){x.detachEvent("onreadystatechange",cB);if(!cA){cA=true;cD()}}});if(x.documentElement.doScroll&&K===K.top){(function cB(){if(!cA){try{x.documentElement.doScroll("left")}catch(cE){setTimeout(cB,0);return}cA=true;cD()}}())}}}Y(K,"load",function(){if(!cA){cA=true;cD()}},false)}function b7(cA){var cB=cu(cA);if(cB&&cB.type){cB.href=k(cB.href);cn(cB.href,cB.type,undefined,null,cA)}}function bZ(){return x.all&&!x.addEventListener}function ci(cA){var cC=cA.which;var cB=(typeof cA.button);if(!cC&&cB!=="undefined"){if(bZ()){if(cA.button&1){cC=1}else{if(cA.button&2){cC=3}else{if(cA.button&4){cC=2}}}}else{if(cA.button===0||cA.button==="0"){cC=1}else{if(cA.button&1){cC=2}else{if(cA.button&2){cC=3}}}}}return cC}function bo(cA){switch(ci(cA)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function aF(cA){return cA.target||cA.srcElement}function ai(cA){return function(cD){cD=cD||K.event; +var cC=bo(cD);var cE=aF(cD);if(cD.type==="click"){var cB=false;if(cA&&cC==="middle"){cB=true}if(cE&&!cB){b7(cE)}}else{if(cD.type==="mousedown"){if(cC==="middle"&&cE){aw=cC;a8=cE}else{aw=a8=null}}else{if(cD.type==="mouseup"){if(cC===aw&&cE===a8){b7(cE)}aw=a8=null}else{if(cD.type==="contextmenu"){b7(cE)}}}}}}function ac(cB,cA){Y(cB,"click",ai(cA),false);if(cA){Y(cB,"mouseup",ai(cA),false);Y(cB,"mousedown",ai(cA),false);Y(cB,"contextmenu",ai(cA),false)}}function a9(cB){if(!ab){ab=true;var cC,cA=aE(a7,"ignore"),cD=x.links;if(cD){for(cC=0;cC<cD.length;cC++){if(!cA.test(cD[cC].className)){ac(cD[cC],cB)}}}}}function ax(cC,cE,cF){if(bJ){return true}bJ=true;var cG=false;var cD,cB;function cA(){cG=true}ap(function(){function cH(cJ){setTimeout(function(){if(!bJ){return}cG=false;cF.trackVisibleContentImpressions();cH(cJ)},cJ)}function cI(cJ){setTimeout(function(){if(!bJ){return}if(cG){cG=false;cF.trackVisibleContentImpressions()}cI(cJ)},cJ)}if(cC){cD=["scroll","resize"];for(cB=0;cB<cD.length;cB++){if(x.addEventListener){x.addEventListener(cD[cB],cA) +}else{K.attachEvent("on"+cD[cB],cA)}}cI(100)}if(cE&&cE>0){cE=parseInt(cE,10);cH(cE)}})}function b5(){var cB,cD,cE={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(!((new RegExp("MSIE")).test(f.userAgent))){if(f.mimeTypes&&f.mimeTypes.length){for(cB in cE){if(Object.prototype.hasOwnProperty.call(cE,cB)){cD=f.mimeTypes[cE[cB]];cr[cB]=(cD&&cD.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&A(f.javaEnabled)&&f.javaEnabled()){cr.java="1"}if(s(K.GearsFactory)){cr.gears="1"}cr.cookie=bz()}var cC=parseInt(O.width,10);var cA=parseInt(O.height,10);cr.res=parseInt(cC,10)+"x"+parseInt(cA,10)}b5();aS();aq();return{getVisitorId:function(){return aC().uuid},getVisitorInfo:function(){return cb()},getAttributionInfo:function(){return bh()},getAttributionCampaignName:function(){return bh()[0] +},getAttributionCampaignKeyword:function(){return bh()[1]},getAttributionReferrerTimestamp:function(){return bh()[2]},getAttributionReferrerUrl:function(){return bh()[3]},setTrackerUrl:function(cA){ak=cA},getTrackerUrl:function(){return ak},addTracker:function(cA,cC){if(!cC){throw new Error("A siteId must be given to add a new tracker")}if(!A(cA)||null===cA){cA=this.getTrackerUrl()}var cB=new H(cA,cC);z.push(cB);return cB},getSiteId:function(){return bA},setSiteId:function(cA){bx(cA)},setUserId:function(cA){if(!A(cA)||!cA.length){return}a6=cA;bj=bB(a6).substr(0,16)},getUserId:function(){return a6},setCustomData:function(cA,cB){if(N(cA)){aa=cA}else{if(!aa){aa={}}aa[cA]=cB}},getCustomData:function(){return aa},setCustomRequestProcessing:function(cA){bF=cA},appendToTrackingUrl:function(cA){cl=cA},getRequest:function(cA){return bV(cA)},addPlugin:function(cA,cB){a[cA]=cB},setCustomDimension:function(cA,cB){cA=parseInt(cA,10);if(cA>0){if(!A(cB)){cB=""}if(!q(cB)){cB=String(cB)}aW[cA]=cB}},getCustomDimension:function(cA){cA=parseInt(cA,10); +if(cA>0&&Object.prototype.hasOwnProperty.call(aW,cA)){return aW[cA]}},deleteCustomDimension:function(cA){cA=parseInt(cA,10);if(cA>0){delete aW[cA]}},setCustomVariable:function(cB,cA,cE,cC){var cD;if(!A(cC)){cC="visit"}if(!A(cA)){return}if(!A(cE)){cE=""}if(cB>0){cA=!q(cA)?String(cA):cA;cE=!q(cE)?String(cE):cE;cD=[cA.slice(0,a2),cE.slice(0,a2)];if(cC==="visit"||cC===2){b4();av[cB]=cD}else{if(cC==="page"||cC===3){bq[cB]=cD}else{if(cC==="event"){bP[cB]=cD}}}}},getCustomVariable:function(cB,cC){var cA;if(!A(cC)){cC="visit"}if(cC==="page"||cC===3){cA=bq[cB]}else{if(cC==="event"){cA=bP[cB]}else{if(cC==="visit"||cC===2){b4();cA=av[cB]}}}if(!A(cA)||(cA&&cA[0]==="")){return false}return cA},deleteCustomVariable:function(cA,cB){if(this.getCustomVariable(cA,cB)){this.setCustomVariable(cA,"","",cB)}},storeCustomVariablesInCookie:function(){bl=true},setLinkTrackingTimer:function(cA){be=cA},setDownloadExtensions:function(cA){if(q(cA)){cA=cA.split("|")}cq=cA},addDownloadExtensions:function(cB){var cA;if(q(cB)){cB=cB.split("|") +}for(cA=0;cA<cB.length;cA++){cq.push(cB[cA])}},removeDownloadExtensions:function(cC){var cB,cA=[];if(q(cC)){cC=cC.split("|")}for(cB=0;cB<cq.length;cB++){if(D(cC,cq[cB])===-1){cA.push(cq[cB])}}cq=cA},setDomains:function(cA){ag=q(cA)?[cA]:cA;var cE=false,cC=0,cB;for(cC;cC<ag.length;cC++){cB=String(ag[cC]);if(b6(ch,C(cB))){cE=true;break}var cD=bO(cB);if(cD&&cD!=="/"&&cD!=="/*"){cE=true;break}}if(!cE){ag.push(ch)}},setIgnoreClasses:function(cA){a7=q(cA)?[cA]:cA},setRequestMethod:function(cA){ct=cA||bM},setRequestContentType:function(cA){bY=cA||ao},setReferrerUrl:function(cA){aX=cA},setCustomUrl:function(cA){aI=bp(bi,cA)},setDocumentTitle:function(cA){aT=cA},setAPIUrl:function(cA){bd=cA},setDownloadClasses:function(cA){bg=q(cA)?[cA]:cA},setLinkClasses:function(cA){aL=q(cA)?[cA]:cA},setCampaignNameKey:function(cA){bU=q(cA)?[cA]:cA},setCampaignKeywordKey:function(cA){bc=q(cA)?[cA]:cA},discardHashTag:function(cA){bk=cA},setCookieNamePrefix:function(cA){aU=cA;av=br()},setCookieDomain:function(cA){var cB=C(cA); +if(a4(cB)){cj=cB;aS()}},setCookiePath:function(cA){aZ=cA;aS()},setVisitorCookieTimeout:function(cA){b9=cA*1000},setSessionCookieTimeout:function(cA){bS=cA*1000},setReferralCookieTimeout:function(cA){cp=cA*1000},setConversionAttributionFirstReferrer:function(cA){a3=cA},disableCookies:function(){aV=true;cr.cookie="0";if(bA){al()}},deleteCookies:function(){al()},setDoNotTrack:function(cB){var cA=f.doNotTrack||f.msDoNotTrack;cd=cB&&(cA==="yes"||cA==="1");if(cd){this.disableCookies()}},addListener:function(cB,cA){ac(cB,cA)},enableLinkTracking:function(cA){cs=true;bL(function(){aP(function(){a9(cA)})})},enableJSErrorTracking:function(){if(cf){return}cf=true;var cA=K.onerror;K.onerror=function(cF,cD,cC,cE,cB){bL(function(){var cG="JavaScript Errors";var cH=cD+":"+cC;if(cE){cH+=":"+cE}af(cG,cH,cF)});if(cA){return cA(cF,cD,cC,cE,cB)}return false}},disablePerformanceTracking:function(){aG=false},setGenerationTimeMs:function(cA){bQ=parseInt(cA,10)},enableHeartBeatTimer:function(cA){cA=Math.max(cA,1); +aJ=(cA||15)*1000;if(ck!==null){cy()}},killFrame:function(){if(K.location!==K.top.location){K.top.location=K.location}},redirectFile:function(cA){if(K.location.protocol==="file:"){K.location=cA}},setCountPreRendered:function(cA){aR=cA},trackGoal:function(cA,cC,cB){bL(function(){cg(cA,cC,cB)})},trackLink:function(cB,cA,cD,cC){bL(function(){cn(cB,cA,cD,cC)})},trackPageView:function(cA,cC,cB){bE=[];if(E(bA)){bL(function(){P(ak,bd,bA)})}else{bL(function(){bu(cA,cC,cB)})}},trackAllContentImpressions:function(){if(E(bA)){return}bL(function(){aP(function(){var cA=p.findContentNodes();var cB=b1(cA);cx(cB,be)})})},trackVisibleContentImpressions:function(cA,cB){if(E(bA)){return}if(!A(cA)){cA=true}if(!A(cB)){cB=750}ax(cA,cB,this);bL(function(){ap(function(){var cC=p.findContentNodes();var cD=aM(cC);cx(cD,be)})})},trackContentImpression:function(cC,cA,cB){if(E(bA)){return}if(!cC){return}cA=cA||"Unknown";bL(function(){var cD=am(cC,cA,cB);bb(cD,be)})},trackContentImpressionsWithinNode:function(cA){if(E(bA)||!cA){return +}bL(function(){if(bJ){ap(function(){var cB=p.findContentNodesWithinNode(cA);var cC=aM(cB);cx(cC,be)})}else{aP(function(){var cB=p.findContentNodesWithinNode(cA);var cC=b1(cB);cx(cC,be)})}})},trackContentInteraction:function(cC,cD,cA,cB){if(E(bA)){return}if(!cC||!cD){return}cA=cA||"Unknown";bL(function(){var cE=au(cC,cD,cA,cB);bb(cE,be)})},trackContentInteractionNode:function(cB,cA){if(E(bA)||!cB){return}bL(function(){var cC=cv(cB,cA);bb(cC,be)})},logAllContentBlocksOnPage:function(){var cB=p.findContentNodes();var cA=p.collectContent(cB);if(console!==undefined&&console&&console.log){console.log(cA)}},trackEvent:function(cB,cD,cA,cC,cE){bL(function(){af(cB,cD,cA,cC,cE)})},trackSiteSearch:function(cA,cC,cB,cD){bL(function(){bD(cA,cC,cB,cD)})},setEcommerceView:function(cD,cA,cC,cB){if(!A(cC)||!cC.length){cC=""}else{if(cC instanceof Array){cC=JSON2.stringify(cC)}}bq[5]=["_pkc",cC];if(A(cB)&&String(cB).length){bq[2]=["_pkp",cB]}if((!A(cD)||!cD.length)&&(!A(cA)||!cA.length)){return}if(A(cD)&&cD.length){bq[3]=["_pks",cD] +}if(!A(cA)||!cA.length){cA=""}bq[4]=["_pkn",cA]},addEcommerceItem:function(cE,cA,cC,cB,cD){if(cE.length){cm[cE]=[cE,cA,cC,cB,cD]}},trackEcommerceOrder:function(cA,cE,cD,cC,cB,cF){bt(cA,cE,cD,cC,cB,cF)},trackEcommerceCartUpdate:function(cA){a1(cA)}}}function y(){return{push:T}}function b(af,ae){var ag={};var ac,ad;for(ac=0;ac<ae.length;ac++){var aa=ae[ac];ag[aa]=1;for(ad=0;ad<af.length;ad++){if(af[ad]&&af[ad][0]){var ab=af[ad][0];if(aa===ab){T(af[ad]);delete af[ad];if(ag[ab]>1){W("The method "+ab+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}ag[ab]++}}}}return af}Y(K,"beforeunload",U,false);Date.prototype.getTimeAlias=Date.prototype.getTime;z.push(new H());var u=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"]; _paq=b(_paq,u);for(w=0;w<_paq.length;w++){if(_paq[w]){T(_paq[w])}}_paq=new y();d={addPlugin:function(aa,ab){a[aa]=ab},getTracker:function(aa,ab){if(!A(ab)){ab=this.getAsyncTracker().getSiteId()}if(!A(aa)){aa=this.getAsyncTracker().getTrackerUrl()}return new H(aa,ab)},getAsyncTracker:function(ab,ae){var ad;if(z&&z[0]){ad=z[0]}if(!ae&&!ab){return ad}if((!A(ae)||null===ae)&&ad){ae=ad.getSiteId()}if((!A(ab)||null===ab)&&ad){ab=ad.getTrackerUrl()}var ac,aa=0;for(aa;aa<z.length;aa++){ac=z[aa];if(ac&&String(ac.getSiteId())===String(ae)&&ac.getTrackerUrl()===ab){return ac}}}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return d})}return d}())}if(window&&window.piwikAsyncInit){window.piwikAsyncInit()}(function(){var a=(typeof AnalyticsTracker);if(a==="undefined"){AnalyticsTracker=window.Piwik}}());if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{if(window["piwik_"+h]){return window["piwik_"+h]}}catch(i){}return}var c,e=window.Piwik.getTracker(d,f); e.setDocumentTitle(b);e.setCustomData(g);c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}}; /*!! @license-end */ diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 18d34e6d78..1c9a8b478a 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -5,6 +5,13 @@ <meta charset="utf-8"> <title>piwik.js: Unit Tests</title> <?php + +$cacheBuster = md5(uniqid(mt_rand(), true)); + +// Note: when you want to debug the piwik.js during the tests, you need to set a cache buster that is always the same +// between requests so the browser knows it is the same file and know where to breakpoint. +//$cacheBuster= 'nocb'; // uncomment to debug + $root = dirname(__FILE__) . '/../..'; try { @@ -53,8 +60,7 @@ testTrackPageViewAsync(); ?> </script> <script src="../lib/q-1.4.1/q.js" type="text/javascript"></script> - <script src="../../js/piwik.js?rand=<?php $cacheBuster = md5(uniqid(mt_rand(), true)); - echo $cacheBuster ?>" type="text/javascript"></script> + <script src="../../js/piwik.js?rand=<?php echo $cacheBuster ?>" type="text/javascript"></script> <script src="../../plugins/Overlay/client/urlnormalizer.js" type="text/javascript"></script> <script src="piwiktest.js" type="text/javascript"></script> <link rel="stylesheet" href="assets/qunit.css" type="text/css" media="screen" /> @@ -80,6 +86,7 @@ testTrackPageViewAsync(); <script type="text/javascript"> QUnit.config.reorder = false; + QUnit.config.altertitle = false; function _e(id){ if (document.getElementById) return document.getElementById(id); @@ -3102,11 +3109,13 @@ function PiwikTest() { <scr' + 'ipt src="' + hostAndPath + '../../libs/bower_components/jquery/dist/jquery.min.js" type="text/javascript"></sc' + 'ript> \ <scr' + 'ipt type="text/javascript"> \ $(document).ready(function() { \ + window.iframeIsLoaded = true; \ window.isInsideIframe = function () { \ var tracker = Piwik.getTracker(); \ return tracker.hook.test._isInsideAnIframe(); \ }; \ - });\ + }); \ + window.iframeIsLoaded = false; \ \ </sc' + 'ript> \ </body></html>\ @@ -3117,26 +3126,29 @@ function PiwikTest() { iframe.contentWindow.document.write(html); iframe.contentWindow.document.close(); - } + }; test("isInsideAnIframe", function() { + expect(6); + var tracker = Piwik.getTracker(); + var isInsideAnIframe = tracker.hook.test._isInsideAnIframe; + equal( typeof isInsideAnIframe, 'function', 'isInsideAnIframe' ); + equal( isInsideAnIframe(), false, 'these tests are not running inside an iframe, got: ' + isInsideAnIframe()); + equal( !isInsideAnIframe(), true, 'these tests are not running inside an iframe'); + equal( document.getElementById("iframeTesting"), undefined, 'the iframe is not loaded yet...'); + generateAnIframeInDocument(); + stop(); setTimeout(function() { - - expect(4); - var tracker = Piwik.getTracker(); - var isInsideAnIframe = tracker.hook.test._isInsideAnIframe; - equal( typeof isInsideAnIframe, 'function', 'isInsideAnIframe' ); - equal( isInsideAnIframe(), false, 'these tests are not running inside an iframe, got: ' + isInsideAnIframe()); - equal( !isInsideAnIframe(), true, 'these tests are not running inside an iframe'); + equal( document.getElementById("iframeTesting").contentWindow.iframeIsLoaded, true, 'the iframe is loaded now!'); equal( document.getElementById("iframeTesting").contentWindow.isInsideIframe(), true, 'inside an iframe, isInsideAnIframe() returns true'); start(); - }, 2000); // wait for iframe to load + }, 4000); // wait for iframe to load }); |