// Copyright TagMan Ltd, All Rights Reserved. v20110101:2.4.2
function Lescape(a){return escape(a).replace(/\//g,"%2F")}function DoubleLescape(a,b){var c=Lescape(Lescape(a));if(!b)return c;var d=c.lastIndexOf("%",b),e=0;if(d>b-3)e=d;else{d=c.lastIndexOf("%25",b);if(d>b-5)e=d}if(e>0)b-=b-e;return c.substr(0,b)}
if(!window.LEV){var LEV_TMTCB=function(){window.tmTrack=undefined;window.tmTrackWaiting&&LEV_TMIFCB()},LEV_TMIFPS=function(){var a="";if(typeof tmParam!="undefined")for(var b in tmParam){var c=tmParam[b],d=typeof c;if(b&&c&&(d=="number"||d=="string"||d=="boolean"))a+="&"+b+"="+DoubleLescape(c)}return a};LEV={};LEV.String=function(a){this.value=new String(a)};LEV.String.prototype={match:function(a,b){var c=this.value.match(a);if(!c){this.value="";return this}c=c[0];if(!b){this.value=c;return this}if(c)this.value=
c.replace(a,b);return this},replace:function(a,b){this.value=this.value.replace(a,b);return this},toString:function(){return this.value}};LEV.STG={getCookie:function(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}else return""}};LEV.LOG=function(a){LEV.STG.getCookie("tmDebug")&&typeof console!=
"undefined"&&console&&console.log&&console.log(a)};if(!LEV.DOMQ){LEV.DOMQ=function(a){this.el=a||document};LEV.DOMQ.factory=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=new LEV.DOMQ(a[c]);return b};LEV.DOMQ.prototype={id:function(a){if(!this.el)return this;this.el=this.el.getElementById(a);return this},tag:function(a,b){if(!this.el)return this;b||(b=0);this.el=this.el.getElementsByTagName(a)[b];return this},name:function(a,b){if(!this.el)return this;b||(b=0);this.el=this.getElementsByName(a)[b];
return this},className:function(a,b){if(!this.el)return this;b||(b=0);this.el=this.getElementsByClassName(a)[b];return this},isAncestor:function(a){var b=this.el;if(b)for(;a;){if(a==b)return true;a=a.parentNode}},getElementsByName:function(a){if(!this.el)return[];a=document.getElementsByName(a);if(this.el==document)return a;for(var b=[],c=0;c<a.length;c++)this.isAncestor(a[c])&&b.push(a[c]);return b},getElementsByClassName:function(a){if(!this.el)return[];var b=this.el;b=b.all?b.all:b.getElementsByTagName("*");
a=a.replace(/\-/g,"\\-");a=RegExp("(^|\\s)"+a+"(\\s|$)");for(var c=[],d=0;d<b.length;d++)a.test(b[d].className)&&c.push(b[d]);return c},match:function(a,b){return(new LEV.String(this.toString())).match(a,b)},replace:function(a,b){return(new LEV.String(this.toString())).replace(a,b)},toString:function(){if(!this.el)return"";return this.el==document?this.el.documentElement.innerHTML:this.el.value?this.el.value:this.el.innerHTML}};LEV.DT=function(){var a={html:function(){return new LEV.DOMQ},id:function(c){return a.html().id(c)},
tag:function(c,d){return a.html().tag(c,d)},name:function(c,d){return a.html().name(c,d)},className:function(c,d){return a.html().className(c,d)},head:function(){return a.tag("head")},body:function(){return a.tag("body")}},b=function(c){if(!window.tmParam)window.tmParam={};for(var d in c){var e=c[d],f="";if(typeof e=="string")f=a.id(e);else if(e instanceof RegExp)f=a.html().match(e,"$1");else if(e instanceof Array)f=a.id(e[0]).match(e[1],"$1");else if(typeof e=="function")f=e(a)||"";window.tmParam[d]=
f.toString()}};window.LEV_DT&&b(window.LEV_DT);return b}()}if(!LEV.onDOM)LEV.onDOM=function(){function a(){if(!b){b=true;LEV.extend(tmParam,{tmdom:1});for(var g=0;g<c.length;g++)c[g]()}}var b=false,c=[],d=function(g){b?g():c.push(g)};d.isReady=function(){return b};var e=navigator.userAgent.toLowerCase();if(/webkit/.test(e))timeout=setTimeout(function(){document.readyState=="loaded"||document.readyState=="complete"?a():setTimeout(arguments.callee,10)},10);else if(/mozilla/.test(e)&&!/(compatible)/.test(e)||
/opera/.test(e))document.addEventListener("DOMContentLoaded",a,false);else if(/msie/.test(e)&&window==top)var f=setInterval(function(){try{document.documentElement.doScroll("left")}catch(g){return}clearInterval(f);f=null;a()},10);else{var h=window.onload;window.onload=function(){a();h&&h()}}return d}();LEV.extend=function(a,b){for(var c in b)a[c]=b[c];return a};if(typeof tmPageId=="undefined")if(typeof tmContId=="undefined")LEV.LOG("tmContId or tmPageId not defined for TagMan container, it's compulsary");
else var tmPageId=tmContId;var tmDoc=document,tmLoc=tmDoc.location,tmPageTitle=DoubleLescape(tmDoc.title,100),tmHost=DoubleLescape(tmLoc.hostName),tmHash=DoubleLescape(tmLoc.hash),tmPath=DoubleLescape(tmLoc.pathname),tmSearch=DoubleLescape(tmLoc.search),levref=DoubleLescape(tmDoc.referrer,150),gooTrans;if(tmDoc.getElementById)gooTrans=tmDoc.getElementById("utmtrans");else if(tmDoc.utmform&&tmDoc.utmform.utmtrans)gooTrans=tmDoc.utmform.utmtrans;if(gooTrans)gooTrans=DoubleLescape(gooTrans);if(typeof tmBaseUrl==
"undefined"||typeof tmPageId=="undefined")LEV.LOG("tmBaseUrl not defined for TagMan, it's compulsary");else if(!window.tmAlreadyRun){var tagStr;tagStr=LEV.STG.getCookie("tmStaging")?tmBaseUrl.replace(/(.*?)\/\/(.*?)\.(.*)/,"$1//tagstaging.$3"):tmBaseUrl;tagStr=tagStr+"/tmpageid="+tmPageId;window.tmAlreadyRun=1;tagStr+="&levyouruid="+Math.random();(function(){function a(d,e){if(e){var f=RegExp("[?|&]"+e+"=([^&]*)").exec(d);if(f)return f[1]}}var b=document.location.search;if(b)if(!a(b,"tmredirect")){var c=
a(b,"tmcampid");c&&LEV.extend(tmParam,{tmcampid:c,tmad:a(b,"tmad"),tmplaceref:a(b,"tmplaceref"),tmclickref:a(b,"tmclickref")})}})();var scriptStr=tagStr+LEV_TMIFPS(),jsCall='<script type="text/javascript" src="'+scriptStr;jsCall+="&tmlogit=0";if(tmParam.tmcampid||tmParam.levrev||tmParam.levresdes)window.tmCBRequired=1;jsCall+='&tmtag=js"><\/script>';document.write(jsCall);var loadBookmarklet=LEV.STG.getCookie("tmBookmarklet");loadBookmarklet&&LEV.BMK.loadCoreBm()}LEV_TMIFCB=function(){function a(){window.LEV_DT&&
LEV.DT(window.LEV_DT);if(window.LEV_DTD)for(var c=0;c<LEV_DTD.length;c++)LEV_DTD[c]();c=LEV_TMIFPS();c=tagStr+c;if(location.hash=="#tmtest")parent.location=document.referrer+"#"+c;if(typeof console!="undefined")try{LEV.LOG("referrer="+document.referrer);if(typeof tmParam=="object"){var d="",e;for(e in tmParam)if(typeof tmParam[e]!="undefined")d+="\t"+e+"=>"+tmParam[e]+"\n";d||(d="<empty>")}LEV.LOG("tmParam Contents\n"+d);typeof tmOPV!="undefined"&&LEV.LOG("tmOPV="+tmOPV);LEV.LOG("tmBaseURL="+tmBaseUrl);
LEV.LOG("tmPageId="+tmPageId)}catch(f){LEV.LOG("logging error on of tmPageId or tmBaseURL probably does not exits")}if(window.tmCaptureData)tagStr+=b("levref",levref,"tmpagetitle",tmPageTitle,"tmpagehost",tmHost,"tmpagehash",tmHash,"tmpagepath",tmPath,"tmsearch",tmSearch,"tmhost",tmHost);if(window.tmDisableIframe){if(tmParam.tmad||tmParam.levrev||tmParam.levresdes||tmParam.levordref||typeof window.tmCBRequired!="undefined"&&window.tmCBRequired){d=c+"&tmtag=image";if(LEV.onDOM.isReady()){e=new Image;
e.src=d;e.style.width="0px";e.style.height="0px";e.style.border="0px";document.getElementsByTagName("body")[0].appendChild(e)}else document.write('<img src="'+d+'" width="0" height="0" border="0" />');LEV.LOG("Image written: "+d)}}else{d=c+"&tmtag=iframe";d+="&tmlogit=1";if(LEV.onDOM.isReady()){e=document.createElement("iframe");e.src=d;e.style.width="0px";e.style.height="0px";e.style.border="0px";document.getElementsByTagName("body")[0].appendChild(e)}else document.write('<iframe src="'+d+'" width="0" height="0" border="0"></iframe>');
LEV.LOG("Iframe written: "+d)}}function b(){for(var c=arguments,d="",e=0;e<c.length;e+=2){var f=c[e],h=c[e+1];d+=h&&h!="undefined"?"&"+f+"="+h:""}return d}return function(){if(window.tmTrack)window.tmTrackWaiting=1;else window.tmImmediate?a():LEV.onDOM(a)}}()};

