forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
piwik.js
30 lines (30 loc) · 21.6 KB
/
piwik.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*!
* Piwik - Web Analytics
*
* JavaScript tracking client
*
* @link http://piwik.org
* @source https://github.com/piwik/piwik/blob/master/js/piwik.js
* @license http://piwik.org/free-software/bsd/ Simplified BSD (also in js/LICENSE.txt)
*/
if(typeof JSON2!=="object"){JSON2={}}(function(){function d(f){return f<10?"0"+f:f}function l(n,m){var f=Object.prototype.toString.apply(n);if(f==="[object Date]"){return isFinite(n.valueOf())?n.getUTCFullYear()+"-"+d(n.getUTCMonth()+1)+"-"+d(n.getUTCDate())+"T"+d(n.getUTCHours())+":"+d(n.getUTCMinutes())+":"+d(n.getUTCSeconds())+"Z":null}if(f==="[object String]"||f==="[object Number]"||f==="[object Boolean]"){return n.valueOf()}if(f!=="[object Array]"&&typeof n.toJSON==="function"){return n.toJSON(m)}return n}var c=new RegExp("[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]","g"),e='\\\\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]',i=new RegExp("["+e,"g"),j,b,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;
function a(f){i.lastIndex=0;return i.test(f)?'"'+f.replace(i,function(m){var n=k[m];return typeof n==="string"?n:"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function g(s,p){var n,m,t,f,q=j,o,r=p[s];if(r&&typeof r==="object"){r=l(r,s)}if(typeof h==="function"){r=h.call(p,s,r)}switch(typeof r){case"string":return a(r);case"number":return isFinite(r)?String(r):"null";case"boolean":case"null":return String(r);case"object":if(!r){return"null"}j+=b;o=[];if(Object.prototype.toString.apply(r)==="[object Array]"){f=r.length;for(n=0;n<f;n+=1){o[n]=g(n,r)||"null"}t=o.length===0?"[]":j?"[\n"+j+o.join(",\n"+j)+"\n"+q+"]":"["+o.join(",")+"]";j=q;return t}if(h&&typeof h==="object"){f=h.length;for(n=0;n<f;n+=1){if(typeof h[n]==="string"){m=h[n];t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}else{for(m in r){if(Object.prototype.hasOwnProperty.call(r,m)){t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}t=o.length===0?"{}":j?"{\n"+j+o.join(",\n"+j)+"\n"+q+"}":"{"+o.join(",")+"}";j=q;
return t}}if(typeof JSON2.stringify!=="function"){JSON2.stringify=function(o,m,n){var f;j="";b="";if(typeof n==="number"){for(f=0;f<n;f+=1){b+=" "}}else{if(typeof n==="string"){b=n}}h=m;if(m&&typeof m!=="function"&&(typeof m!=="object"||typeof m.length!=="number")){throw new Error("JSON2.stringify")}return g("",{"":o})}}if(typeof JSON2.parse!=="function"){JSON2.parse=function(o,f){var n;function m(s,r){var q,p,t=s[r];if(t&&typeof t==="object"){for(q in t){if(Object.prototype.hasOwnProperty.call(t,q)){p=m(t,q);if(p!==undefined){t[q]=p}else{delete t[q]}}}}return f.call(s,r,t)}o=String(o);c.lastIndex=0;if(c.test(o)){o=o.replace(c,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)})}if((new RegExp("^[\\],:{}\\s]*$")).test(o.replace(new RegExp('\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})',"g"),"@").replace(new RegExp('"[^"\\\\\n\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?',"g"),"]").replace(new RegExp("(?:^|:|,)(?:\\s*\\[)+","g"),""))){n=eval("("+o+")");
return typeof f==="function"?m({"":n},""):n}throw new SyntaxError("JSON2.parse")}}}());if(typeof _paq!=="object"){_paq=[]}if(typeof Piwik!=="object"){Piwik=(function(){var h,a={},q=document,d=navigator,D=screen,A=window,e=A.performance||A.mozPerformance||A.msPerformance||A.webkitPerformance,n=false,y=[],k=A.encodeURIComponent,z=A.decodeURIComponent,f=unescape,E,H,c;function s(P){var i=typeof P;return i!=="undefined"}function o(i){return typeof i==="function"}function C(i){return typeof i==="object"}function l(i){return typeof i==="string"||i instanceof String}function K(){var P,R,Q;for(P=0;P<arguments.length;P+=1){Q=arguments[P];R=Q.shift();if(l(R)){E[R].apply(E,Q)}else{R.apply(E,Q)}}}function N(R,Q,P,i){if(R.addEventListener){R.addEventListener(Q,P,i);return true}if(R.attachEvent){return R.attachEvent("on"+Q,P)}R["on"+Q]=P}function I(Q,T){var P="",S,R;for(S in a){if(Object.prototype.hasOwnProperty.call(a,S)){R=a[S][Q];if(o(R)){P+=R(T)}}}return P}function L(){var i;I("unload");if(h){do{i=new Date()
}while(i.getTimeAlias()<h)}}function J(){var P;if(!n){n=true;I("load");for(P=0;P<y.length;P++){y[P]()}}return true}function m(){var P;if(q.addEventListener){N(q,"DOMContentLoaded",function i(){q.removeEventListener("DOMContentLoaded",i,false);J()})}else{if(q.attachEvent){q.attachEvent("onreadystatechange",function i(){if(q.readyState==="complete"){q.detachEvent("onreadystatechange",i);J()}});if(q.documentElement.doScroll&&A===A.top){(function i(){if(!n){try{q.documentElement.doScroll("left")}catch(Q){setTimeout(i,0);return}J()}}())}}}if((new RegExp("WebKit")).test(d.userAgent)){P=setInterval(function(){if(n||/loaded|complete/.test(q.readyState)){clearInterval(P);J()}},10)}N(A,"load",J,false)}function g(Q,P){var i=q.createElement("script");i.type="text/javascript";i.src=Q;if(i.readyState){i.onreadystatechange=function(){var R=this.readyState;if(R==="loaded"||R==="complete"){i.onreadystatechange=null;P()}}}else{i.onload=P}q.getElementsByTagName("head")[0].appendChild(i)}function t(){var i="";
try{i=A.top.document.referrer}catch(Q){if(A.parent){try{i=A.parent.document.referrer}catch(P){i=""}}}if(i===""){i=q.referrer}return i}function j(i){var Q=new RegExp("^([a-z]+):"),P=Q.exec(i);return P?P[1]:null}function b(i){var Q=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),P=Q.exec(i);return P?P[1]:i}function B(Q,P){var T=new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+)[?])([^#]+)"),S=T.exec(Q),R=new RegExp("(?:^|&)"+P+"=([^&]*)"),i=S?R.exec(S[1]):0;return i?z(i[1]):""}function p(i){return f(k(i))}function M(af){var R=function(W,i){return(W<<i)|(W>>>(32-i))},ag=function(am){var al="",ak,W;for(ak=7;ak>=0;ak--){W=(am>>>(ak*4))&15;al+=W.toString(16)}return al},U,ai,ah,Q=[],Z=1732584193,X=4023233417,V=2562383102,T=271733878,S=3285377520,ae,ad,ac,ab,aa,aj,P,Y=[];af=p(af);P=af.length;for(ai=0;ai<P-3;ai+=4){ah=af.charCodeAt(ai)<<24|af.charCodeAt(ai+1)<<16|af.charCodeAt(ai+2)<<8|af.charCodeAt(ai+3);Y.push(ah)}switch(P&3){case 0:ai=2147483648;break;case 1:ai=af.charCodeAt(P-1)<<24|8388608;
break;case 2:ai=af.charCodeAt(P-2)<<24|af.charCodeAt(P-1)<<16|32768;break;case 3:ai=af.charCodeAt(P-3)<<24|af.charCodeAt(P-2)<<16|af.charCodeAt(P-1)<<8|128;break}Y.push(ai);while((Y.length&15)!==14){Y.push(0)}Y.push(P>>>29);Y.push((P<<3)&4294967295);for(U=0;U<Y.length;U+=16){for(ai=0;ai<16;ai++){Q[ai]=Y[U+ai]}for(ai=16;ai<=79;ai++){Q[ai]=R(Q[ai-3]^Q[ai-8]^Q[ai-14]^Q[ai-16],1)}ae=Z;ad=X;ac=V;ab=T;aa=S;for(ai=0;ai<=19;ai++){aj=(R(ae,5)+((ad&ac)|(~ad&ab))+aa+Q[ai]+1518500249)&4294967295;aa=ab;ab=ac;ac=R(ad,30);ad=ae;ae=aj}for(ai=20;ai<=39;ai++){aj=(R(ae,5)+(ad^ac^ab)+aa+Q[ai]+1859775393)&4294967295;aa=ab;ab=ac;ac=R(ad,30);ad=ae;ae=aj}for(ai=40;ai<=59;ai++){aj=(R(ae,5)+((ad&ac)|(ad&ab)|(ac&ab))+aa+Q[ai]+2400959708)&4294967295;aa=ab;ab=ac;ac=R(ad,30);ad=ae;ae=aj}for(ai=60;ai<=79;ai++){aj=(R(ae,5)+(ad^ac^ab)+aa+Q[ai]+3395469782)&4294967295;aa=ab;ab=ac;ac=R(ad,30);ad=ae;ae=aj}Z=(Z+ae)&4294967295;X=(X+ad)&4294967295;V=(V+ac)&4294967295;T=(T+ab)&4294967295;S=(S+aa)&4294967295}aj=ag(Z)+ag(X)+ag(V)+ag(T)+ag(S);
return aj.toLowerCase()}function G(Q,i,P){if(Q==="translate.googleusercontent.com"){if(P===""){P=i}i=B(i,"u");Q=b(i)}else{if(Q==="cc.bingj.com"||Q==="webcache.googleusercontent.com"||Q.slice(0,5)==="74.6."){i=q.links[0].href;Q=b(i)}}return[Q,i,P]}function u(P){var i=P.length;if(P.charAt(--i)==="."){P=P.slice(0,i)}if(P.slice(0,2)==="*."){P=P.slice(1)}return P}function O(P){P=P&&P.text?P.text:P;if(!l(P)){var i=q.getElementsByTagName("title");if(i&&s(i[0])){P=i[0].text}}return P}function w(i,P){if(P){return P}if(i.slice(-9)==="piwik.php"){i=i.slice(0,i.length-9)}return i}function v(S){var i="Piwik_Overlay";var V=new RegExp("index\\.php\\?module=Overlay&action=startOverlaySession&idsite=([0-9]+)&period=([^&]+)&date=([^&]+)$");var Q=V.exec(q.referrer);if(Q){var R=Q[1];if(R!==String(S)){return false}var U=Q[2],P=Q[3];A.name=i+"###"+U+"###"+P}var T=A.name.split("###");return T.length===3&&T[0]===i}function F(P,U,R){var T=A.name.split("###"),S=T[1],i=T[2],Q=w(P,U);g(Q+"plugins/Overlay/client/client.js?v=1",function(){Piwik_Overlay_Client.initialize(Q,R,S,i)
})}function x(aj,aK){var S=G(q.domain,A.location.href,t()),a4=u(S[0]),bi=S[1],aR=S[2],aP="GET",R=aj||"",ag="",aM="",a8=aK||"",aB,aq=q.title,at="7z|aac|ar[cj]|as[fx]|avi|bin|csv|deb|dmg|docx?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|ms[ip]|od[bfgpst]|og[gv]|pdf|phps|png|pptx?|qtm?|ra[mr]?|rpm|sea|sit|tar|t?bz2?|tgz|torrent|txt|wav|wm[av]|wpd||xlsx?|xml|z|zip",aN=[a4],V=[],aF=[],ai=[],aL=500,W,ak,X,Y,av=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],ap=["pk_kwd","piwik_kwd","utm_term"],bg="_pk_",ab,bh,Z=false,bb,ax,aA,af=63072000000,ah=1800000,aC=15768000000,ay=true,am=0,U=false,aG={},bc=200,aX={},a9={},aU=false,aS=false,aQ,aH,ac,au=M,aT,az;function aZ(br,bo,bn,bq,bm,bp){if(Z){return}var bl;if(bn){bl=new Date();bl.setTime(bl.getTime()+bn)}q.cookie=br+"="+k(bo)+(bn?";expires="+bl.toGMTString():"")+";path="+(bq||"/")+(bm?";domain="+bm:"")+(bp?";secure":"")}function ae(bn){if(Z){return 0}var bl=new RegExp("(^|;)[ ]*"+bn+"=([^;]*)"),bm=bl.exec(q.cookie);
return bm?z(bm[2]):0}function bd(bl){var bm;if(X){bm=new RegExp("#.*");return bl.replace(bm,"")}return bl}function a3(bn,bl){var bo=j(bl),bm;if(bo){return bl}if(bl.slice(0,1)==="/"){return j(bn)+"://"+b(bn)+bl}bn=bd(bn);if((bm=bn.indexOf("?"))>=0){bn=bn.slice(0,bm)}if((bm=bn.lastIndexOf("/"))!==bn.length-1){bn=bn.slice(0,bm+1)}return bn+bl}function aO(bo){var bm,bl,bn;for(bm=0;bm<aN.length;bm++){bl=u(aN[bm].toLowerCase());if(bo===bl){return true}if(bl.slice(0,1)==="."){if(bo===bl.slice(1)){return true}bn=bo.length-bl.length;if((bn>0)&&(bo.slice(bn)===bl)){return true}}}return false}function bk(bl){var bm=new Image(1,1);bm.onload=function(){};bm.src=R+(R.indexOf("?")<0?"?":"&")+bl}function a0(bl){try{var bn=A.XMLHttpRequest?new A.XMLHttpRequest():A.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;bn.open("POST",R,true);bn.onreadystatechange=function(){if(this.readyState===4&&this.status!==200){bk(bl)}};bn.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
bn.send(bl)}catch(bm){bk(bl)}}function aw(bn,bm){var bl=new Date();if(!bb){if(aP==="POST"){a0(bn)}else{bk(bn)}h=bl.getTime()+bm}}function aY(bl){return bg+bl+"."+a8+"."+aT}function T(){if(Z){return"0"}if(!s(d.cookieEnabled)){var bl=aY("testcookie");aZ(bl,"1");return ae(bl)==="1"?"1":"0"}return d.cookieEnabled?"1":"0"}function aI(){aT=au((ab||a4)+(bh||"/")).slice(0,4)}function ad(){var bm=aY("cvar"),bl=ae(bm);if(bl.length){bl=JSON2.parse(bl);if(C(bl)){return bl}}return{}}function Q(){if(U===false){U=ad()}}function a7(){var bl=new Date();aQ=bl.getTime()}function aa(bp,bm,bl,bo,bn,bq){aZ(aY("id"),bp+"."+bm+"."+bl+"."+bo+"."+bn+"."+bq,af,bh,ab)}function P(){var bm=new Date(),bl=Math.round(bm.getTime()/1000),bo=ae(aY("id")),bn;if(bo){bn=bo.split(".");bn.unshift("0")}else{if(!az){az=au((d.userAgent||"")+(d.platform||"")+JSON2.stringify(a9)+bl).slice(0,16)}bn=["1",az,bl,0,bl,"",""]}return bn}function i(){var bl=ae(aY("ref"));if(bl.length){try{bl=JSON2.parse(bl);if(C(bl)){return bl}}catch(bm){}}return["","",0,""]
}function ar(bn,bM,bN,bp){var bK,bm=new Date(),bv=Math.round(bm.getTime()/1000),bP,bL,br,bD,bH,bu,bF,bs,bJ,bq=1024,bQ,by,bG=U,bB=aY("id"),bw=aY("ses"),bx=aY("ref"),bR=aY("cvar"),bE=P(),bA=ae(bw),bI=i(),bO=aB||bi,bt,bl;if(Z){Z=false;aZ(bB,"",-86400,bh,ab);aZ(bw,"",-86400,bh,ab);aZ(bR,"",-86400,bh,ab);aZ(bx,"",-86400,bh,ab);Z=true}if(bb){return""}bP=bE[0];bL=bE[1];bD=bE[2];br=bE[3];bH=bE[4];bu=bE[5];if(!s(bE[6])){bE[6]=""}bF=bE[6];if(!s(bp)){bp=""}var bz=q.characterSet||q.charset;if(!bz||bz.toLowerCase()==="utf-8"){bz=null}bt=bI[0];bl=bI[1];bs=bI[2];bJ=bI[3];if(!bA){br++;bu=bH;if(!aA||!bt.length){for(bK in av){if(Object.prototype.hasOwnProperty.call(av,bK)){bt=B(bO,av[bK]);if(bt.length){break}}}for(bK in ap){if(Object.prototype.hasOwnProperty.call(ap,bK)){bl=B(bO,ap[bK]);if(bl.length){break}}}}bQ=b(aR);by=bJ.length?b(bJ):"";if(bQ.length&&!aO(bQ)&&(!aA||!by.length||aO(by))){bJ=aR}if(bJ.length||bt.length){bs=bv;bI=[bt,bl,bs,bd(bJ.slice(0,bq))];aZ(bx,JSON2.stringify(bI),aC,bh,ab)}}bn+="&idsite="+a8+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+bm.getHours()+"&m="+bm.getMinutes()+"&s="+bm.getSeconds()+"&url="+k(bd(bO))+(aR.length?"&urlref="+k(bd(aR)):"")+"&_id="+bL+"&_idts="+bD+"&_idvc="+br+"&_idn="+bP+(bt.length?"&_rcn="+k(bt):"")+(bl.length?"&_rck="+k(bl):"")+"&_refts="+bs+"&_viewts="+bu+(String(bF).length?"&_ects="+bF:"")+(String(bJ).length?"&_ref="+k(bd(bJ.slice(0,bq))):"")+(bz?"&cs="+k(bz):"");
var bo=JSON2.stringify(aG);if(bo.length>2){bn+="&cvar="+k(bo)}for(bK in a9){if(Object.prototype.hasOwnProperty.call(a9,bK)){bn+="&"+bK+"="+a9[bK]}}if(bM){bn+="&data="+k(JSON2.stringify(bM))}else{if(Y){bn+="&data="+k(JSON2.stringify(Y))}}if(U){var bC=JSON2.stringify(U);if(bC.length>2){bn+="&_cvar="+k(bC)}for(bK in bG){if(Object.prototype.hasOwnProperty.call(bG,bK)){if(U[bK][0]===""||U[bK][1]===""){delete U[bK]}}}aZ(bR,JSON2.stringify(U),ah,bh,ab)}if(ay&&am){bn+="&generation_time_ms="+am}else{if(ay&&e&&e.timing&&e.timing.requestStart&&e.timing.responseEnd){bn+="&generation_time_ms="+(e.timing.responseEnd-e.timing.requestStart)}}aa(bL,bD,br,bv,bu,s(bp)&&String(bp).length?bp:bF);aZ(bw,"*",ah,bh,ab);bn+=I(bN);if(aM.length){bn+="&"+aM}return bn}function a2(bo,bn,bs,bp,bl,bv){var bq="idgoal=0",br,bm=new Date(),bt=[],bu;if(String(bo).length){bq+="&ec_id="+k(bo);br=Math.round(bm.getTime()/1000)}bq+="&revenue="+bn;if(String(bs).length){bq+="&ec_st="+bs}if(String(bp).length){bq+="&ec_tx="+bp}if(String(bl).length){bq+="&ec_sh="+bl
}if(String(bv).length){bq+="&ec_dt="+bv}if(aX){for(bu in aX){if(Object.prototype.hasOwnProperty.call(aX,bu)){if(!s(aX[bu][1])){aX[bu][1]=""}if(!s(aX[bu][2])){aX[bu][2]=""}if(!s(aX[bu][3])||String(aX[bu][3]).length===0){aX[bu][3]=0}if(!s(aX[bu][4])||String(aX[bu][4]).length===0){aX[bu][4]=1}bt.push(aX[bu])}}bq+="&ec_items="+k(JSON2.stringify(bt))}bq=ar(bq,Y,"ecommerce",br);aw(bq,aL)}function a1(bl,bp,bo,bn,bm,bq){if(String(bl).length&&s(bp)){a2(bl,bp,bo,bn,bm,bq)}}function bf(bl){if(s(bl)){a2("",bl,"","","","")}}function aE(bo,bp){var bl=new Date(),bn=ar("action_name="+k(O(bo||aq)),bp,"log");aw(bn,aL);if(W&&ak&&!aS){aS=true;N(q,"click",a7);N(q,"mouseup",a7);N(q,"mousedown",a7);N(q,"mousemove",a7);N(q,"mousewheel",a7);N(A,"DOMMouseScroll",a7);N(A,"scroll",a7);N(q,"keypress",a7);N(q,"keydown",a7);N(q,"keyup",a7);N(A,"resize",a7);N(A,"focus",a7);N(A,"blur",a7);aQ=bl.getTime();setTimeout(function bm(){var bq=new Date(),br;if((aQ+ak)>bq.getTime()){if(W<bq.getTime()){br=ar("ping=1",bp,"ping");
aw(br,aL)}setTimeout(bm,ak)}},ak)}}function ao(bl,bo,bm,bp){var bn=ar("search="+k(bl)+(bo?"&search_cat="+k(bo):"")+(s(bm)?"&search_count="+bm:""),bp,"sitesearch");aw(bn,aL)}function aJ(bl,bo,bn){var bm=ar("idgoal="+bl+(bo?"&revenue="+bo:""),bn,"goal");aw(bm,aL)}function a6(bm,bl,bo){var bn=ar(bl+"="+k(bd(bm)),bo,"link");aw(bn,aL)}function ba(bm,bl){if(bm!==""){return bm+bl.charAt(0).toUpperCase()+bl.slice(1)}return bl}function an(bq){var bp,bl,bo=["","webkit","ms","moz"],bn;if(!ax){for(bl=0;bl<bo.length;bl++){bn=bo[bl];if(Object.prototype.hasOwnProperty.call(q,ba(bn,"hidden"))){if(q[ba(bn,"visibilityState")]==="prerender"){bp=true}break}}}if(bp){N(q,bn+"visibilitychange",function bm(){q.removeEventListener(bn+"visibilitychange",bm,false);bq()});return}bq()}function al(bn,bm){var bo,bl="(^| )(piwik[_-]"+bm;if(bn){for(bo=0;bo<bn.length;bo++){bl+="|"+bn[bo]}}bl+=")( |$)";return new RegExp(bl)}function a5(bo,bl,bp){var bn=al(aF,"download"),bm=al(ai,"link"),bq=new RegExp("\\.("+at+")([?&#]|$)","i");
return bm.test(bo)?"link":(bn.test(bo)||bq.test(bl)?"download":(bp?0:"link"))}function aW(bq){var bo,bm,bl;while((bo=bq.parentNode)!==null&&s(bo)&&((bm=bq.tagName.toUpperCase())!=="A"&&bm!=="AREA")){bq=bo}if(s(bq.href)){var br=bq.hostname||b(bq.href),bs=br.toLowerCase(),bn=bq.href.replace(br,bs),bp=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):","i");if(!bp.test(bn)){bl=a5(bq.className,bn,aO(bs));if(bl){bn=f(bn);a6(bn,bl)}}}}function bj(bl){var bm,bn;bl=bl||A.event;bm=bl.which||bl.button;bn=bl.target||bl.srcElement;if(bl.type==="click"){if(bn){aW(bn)}}else{if(bl.type==="mousedown"){if((bm===1||bm===2)&&bn){aH=bm;ac=bn}else{aH=ac=null}}else{if(bl.type==="mouseup"){if(bm===aH&&bn===ac){aW(bn)}aH=ac=null}}}}function aV(bm,bl){if(bl){N(bm,"mouseup",bj,false);N(bm,"mousedown",bj,false)}else{N(bm,"click",bj,false)}}function aD(bm){if(!aU){aU=true;var bn,bl=al(V,"ignore"),bo=q.links;if(bo){for(bn=0;bn<bo.length;bn++){if(!bl.test(bo[bn].className)){aV(bo[bn],bm)}}}}}function be(){var bm,bn,bo={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"},bl=(new RegExp("Mac OS X.*Safari/")).test(d.userAgent)?A.devicePixelRatio||1:1;
if(!((new RegExp("MSIE")).test(d.userAgent))){if(d.mimeTypes&&d.mimeTypes.length){for(bm in bo){if(Object.prototype.hasOwnProperty.call(bo,bm)){bn=d.mimeTypes[bo[bm]];a9[bm]=(bn&&bn.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&s(d.javaEnabled)&&d.javaEnabled()){a9.java="1"}if(o(A.GearsFactory)){a9.gears="1"}a9.cookie=T()}a9.res=D.width*bl+"x"+D.height*bl}be();aI();return{getVisitorId:function(){return(P())[1]},getVisitorInfo:function(){return P()},getAttributionInfo:function(){return i()},getAttributionCampaignName:function(){return i()[0]},getAttributionCampaignKeyword:function(){return i()[1]},getAttributionReferrerTimestamp:function(){return i()[2]},getAttributionReferrerUrl:function(){return i()[3]},setTrackerUrl:function(bl){R=bl},setSiteId:function(bl){a8=bl},setCustomData:function(bl,bm){if(C(bl)){Y=bl}else{if(!Y){Y=[]}Y[bl]=bm}},appendToTrackingUrl:function(bl){aM=bl},getCustomData:function(){return Y},setCustomVariable:function(bm,bl,bp,bn){var bo;if(!s(bn)){bn="visit"
}if(bm>0){bl=s(bl)&&!l(bl)?String(bl):bl;bp=s(bp)&&!l(bp)?String(bp):bp;bo=[bl.slice(0,bc),bp.slice(0,bc)];if(bn==="visit"||bn===2){Q();U[bm]=bo}else{if(bn==="page"||bn===3){aG[bm]=bo}}}},getCustomVariable:function(bm,bn){var bl;if(!s(bn)){bn="visit"}if(bn==="page"||bn===3){bl=aG[bm]}else{if(bn==="visit"||bn===2){Q();bl=U[bm]}}if(!s(bl)||(bl&&bl[0]==="")){return false}return bl},deleteCustomVariable:function(bl,bm){if(this.getCustomVariable(bl,bm)){this.setCustomVariable(bl,"","",bm)}},setLinkTrackingTimer:function(bl){aL=bl},setDownloadExtensions:function(bl){at=bl},addDownloadExtensions:function(bl){at+="|"+bl},setDomains:function(bl){aN=l(bl)?[bl]:bl;aN.push(a4)},setIgnoreClasses:function(bl){V=l(bl)?[bl]:bl},setRequestMethod:function(bl){aP=bl||"GET"},setReferrerUrl:function(bl){aR=bl},setCustomUrl:function(bl){aB=a3(bi,bl)},setDocumentTitle:function(bl){aq=bl},setAPIUrl:function(bl){ag=bl},setDownloadClasses:function(bl){aF=l(bl)?[bl]:bl},setLinkClasses:function(bl){ai=l(bl)?[bl]:bl
},setCampaignNameKey:function(bl){av=l(bl)?[bl]:bl},setCampaignKeywordKey:function(bl){ap=l(bl)?[bl]:bl},discardHashTag:function(bl){X=bl},setCookieNamePrefix:function(bl){bg=bl;U=ad()},setCookieDomain:function(bl){ab=u(bl);aI()},setCookiePath:function(bl){bh=bl;aI()},setVisitorCookieTimeout:function(bl){af=bl*1000},setSessionCookieTimeout:function(bl){ah=bl*1000},setReferralCookieTimeout:function(bl){aC=bl*1000},setConversionAttributionFirstReferrer:function(bl){aA=bl},disableCookies:function(){Z=true;a9.cookie="0"},setDoNotTrack:function(bm){var bl=d.doNotTrack||d.msDoNotTrack;bb=bm&&(bl==="yes"||bl==="1");if(bb){this.disableCookies()}},addListener:function(bm,bl){aV(bm,bl)},enableLinkTracking:function(bl){if(n){aD(bl)}else{y.push(function(){aD(bl)})}},disablePerformanceTracking:function(){ay=false},setGenerationTimeMs:function(bl){am=parseInt(bl,10)},setHeartBeatTimer:function(bn,bm){var bl=new Date();W=bl.getTime()+bn*1000;ak=bm*1000},killFrame:function(){if(A.location!==A.top.location){A.top.location=A.location
}},redirectFile:function(bl){if(A.location.protocol==="file:"){A.location=bl}},setCountPreRendered:function(bl){ax=bl},trackGoal:function(bl,bn,bm){an(function(){aJ(bl,bn,bm)})},trackLink:function(bm,bl,bn){an(function(){a6(bm,bl,bn)})},trackPageView:function(bl,bm){if(v(a8)){an(function(){F(R,ag,a8)})}else{an(function(){aE(bl,bm)})}},trackSiteSearch:function(bl,bn,bm){an(function(){ao(bl,bn,bm)})},setEcommerceView:function(bo,bl,bn,bm){if(!s(bn)||!bn.length){bn=""}else{if(bn instanceof Array){bn=JSON2.stringify(bn)}}aG[5]=["_pkc",bn];if(s(bm)&&String(bm).length){aG[2]=["_pkp",bm]}if((!s(bo)||!bo.length)&&(!s(bl)||!bl.length)){return}if(s(bo)&&bo.length){aG[3]=["_pks",bo]}if(!s(bl)||!bl.length){bl=""}aG[4]=["_pkn",bl]},addEcommerceItem:function(bp,bl,bn,bm,bo){if(bp.length){aX[bp]=[bp,bl,bn,bm,bo]}},trackEcommerceOrder:function(bl,bp,bo,bn,bm,bq){a1(bl,bp,bo,bn,bm,bq)},trackEcommerceCartUpdate:function(bl){bf(bl)}}}function r(){return{push:K}}N(A,"beforeunload",L,false);m();Date.prototype.getTimeAlias=Date.prototype.getTime;
E=new x();for(H=0;H<_paq.length;H++){if(_paq[H][0]==="setTrackerUrl"||_paq[H][0]==="setSiteId"){K(_paq[H]);delete _paq[H]}}for(H=0;H<_paq.length;H++){if(_paq[H]){K(_paq[H])}}_paq=new r();c={addPlugin:function(i,P){a[i]=P},getTracker:function(i,P){return new x(i,P)},getAsyncTracker:function(){return E}};if(typeof define==="function"&&define.amd){define(["piwik"],[],function(){return c})}return c}())}if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)}catch(i){}return}var c,e=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()}}};