function WebTrends(){var b=this;if(location.hostname.toLowerCase().indexOf("hmv.com")>-1&&location.hostname.toLowerCase().indexOf("staging.")<0){this.dcsid="dcszvdi9hoifwzj8z5nosjjah_6i9k"}else{this.dcsid="dcsvia05c000008eo288zjegv_4i7v"}this.domain="statse.webtrendslive.com";this.timezone=0;this.fpcdom=".hmv.com";this.onsitedoms="hmv.com,hmv.co.uk";this.downloadtypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx,csv,txt";this.navigationtag="div,table";this.trackevents=true;this.trimoffsiteparams=true;this.enabled=true;this.i18n=false;this.fpc="WT_FPC";this.paidsearchparams="gclid";this.DCS={};this.WT={};this.DCSext={};this.images=[];this.index=0;this.exre=(function(){return(window.RegExp?new RegExp("dcs(uri)|(ref)|(aut)|(met)|(sta)|(sip)|(pro)|(byt)|(dat)|(p3p)|(cfg)|(redirect)|(cip)","i"):"")})();this.re=(function(){return(window.RegExp?(b.i18n?{"%25":/\%/g}:{"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g}):"")})()}WebTrends.prototype.dcsGetId=function(){if(this.enabled&&(document.cookie.indexOf(this.fpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){document.write("<script type='text/javascript' src='http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+this.domain+"/"+this.dcsid+"/wtid.js'><\/script>")}};WebTrends.prototype.dcsGetCookie=function(p){var s=document.cookie.split("; ");var t=[];var u=0;var c=0;var q=p.length;var w=s.length;for(c=0;c<w;c++){var x=s[c];if((x.substring(0,q+1))==(p+"=")){t[u++]=x}}var r=t.length;if(r>0){u=0;if((r>1)&&(p==this.fpc)){var v=new Date(0);for(c=0;c<r;c++){var o=parseInt(this.dcsGetCrumb(t[c],"lv"));var i=new Date(o);if(i>v){v.setTime(i.getTime());u=c}}}return unescape(t[u].substring(q+1))}else{return null}};WebTrends.prototype.dcsGetCrumb=function(i,l,k){var g=i.split(k||":");for(var j=0;j<g.length;j++){var h=g[j].split("=");if(l==h[0]){return h[1]}}return null};WebTrends.prototype.dcsGetIdCrumb=function(j,g){var i=j.substring(0,j.indexOf(":lv="));var h=i.split("=");for(var f=0;f<h.length;f++){if(g==h[0]){return h[1]}}return null};WebTrends.prototype.dcsIsFpcSet=function(h,i,c,g){var j=this.dcsGetCookie(h);if(j){return((i==this.dcsGetIdCrumb(j,"id"))&&(c==this.dcsGetCrumb(j,"lv"))&&(g==this.dcsGetCrumb(j,"ss")))?0:3}return 2};WebTrends.prototype.dcsFPC=function(){if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var x=this.WT;var E=this.fpc;var A=new Date();var z=(A.getTimezoneOffset()*60000)+(this.timezone*3600000);A.setTime(A.getTime()+z);var t=new Date(A.getTime()+315360000000);var v=new Date(A.getTime());x.co_f=x.vtid=x.vtvs=x.vt_f=x.vt_f_a=x.vt_f_s=x.vt_f_d=x.vt_f_tlh=x.vt_f_tlv="";if(document.cookie.indexOf(E+"=")==-1){if((typeof(gWtId)!="undefined")&&(gWtId!="")){x.co_f=gWtId}else{if((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){x.co_f=gTempWtId;x.vt_f="1"}else{x.co_f="2";var G=A.getTime().toString();for(var D=2;D<=(32-G.length);D++){x.co_f+=Math.floor(Math.random()*16).toString(16)}x.co_f+=G;x.vt_f="1"}}if(typeof(gWtAccountRollup)=="undefined"){x.vt_f_a="1"}x.vt_f_s=x.vt_f_d="1";x.vt_f_tlh=x.vt_f_tlv="0"}else{var B=this.dcsGetCookie(E);var c=this.dcsGetIdCrumb(B,"id");var w=parseInt(this.dcsGetCrumb(B,"lv"));var y=parseInt(this.dcsGetCrumb(B,"ss"));if((c==null)||(c=="null")||isNaN(w)||isNaN(y)){return}x.co_f=c;var H=new Date(w);x.vt_f_tlh=Math.floor((H.getTime()-z)/1000);v.setTime(y);if((A.getTime()>(H.getTime()+1800000))||(A.getTime()>(v.getTime()+28800000))){x.vt_f_tlv=Math.floor((v.getTime()-z)/1000);v.setTime(A.getTime());x.vt_f_s="1"}if((A.getDay()!=H.getDay())||(A.getMonth()!=H.getMonth())||(A.getYear()!=H.getYear())){x.vt_f_d="1"}}x.co_f=escape(x.co_f);x.vtid=(typeof(this.vtid)=="undefined")?x.co_f:(this.vtid||"");x.vtvs=(v.getTime()-z).toString();var C="; expires="+t.toGMTString();var i=A.getTime().toString();var F=v.getTime().toString();document.cookie=E+"=id="+x.co_f+":lv="+i+":ss="+F+C+"; path=/"+(((this.fpcdom!=""))?("; domain="+this.fpcdom):(""));var u=this.dcsIsFpcSet(E,x.co_f,i,F);if(u!=0){x.co_f=x.vtvs=x.vt_f_s=x.vt_f_d=x.vt_f_tlh=x.vt_f_tlv="";if(typeof(this.vtid)=="undefined"){x.vtid=""}x.vt_f=x.vt_f_a=u}};WebTrends.prototype.dcsIsOnsite=function(f){if(f.length>0){f=f.toLowerCase();if(f==window.location.hostname.toLowerCase()){return true}if(typeof(this.onsitedoms.test)=="function"){return this.onsitedoms.test(f)}else{if(this.onsitedoms.length>0){var e=this.dcsSplit(this.onsitedoms);var h=e.length;for(var g=0;g<h;g++){if(f==e[g]){return true}}}}}return false};WebTrends.prototype.dcsTypeMatch=function(i,j){var k=i.toLowerCase().substring(i.lastIndexOf(".")+1,i.length);var l=this.dcsSplit(j);var g=l.length;for(var h=0;h<g;h++){if(k==l[h]){return true}}return false};WebTrends.prototype.dcsEvt=function(d,e){var f=d.target||d.srcElement;while(f.tagName&&(f.tagName.toLowerCase()!=e.toLowerCase())){f=f.parentElement||f.parentNode}return f};WebTrends.prototype.dcsNavigation=function(e){var i="";var o="";var p=this.dcsSplit(this.navigationtag);var m=p.length;var n,k,l;for(n=0;n<m;n++){l=p[n];if(l.length){k=this.dcsEvt(e,l);i=(k.getAttribute&&k.getAttribute("id"))?k.getAttribute("id"):"";o=k.className||"";if(i.length||o.length){break}}}return i.length?i:o};WebTrends.prototype.dcsBind=function(c,d){if((typeof(d)=="function")&&document.body){if(document.body.addEventListener){document.body.addEventListener(c,d.wtbind(this),true)}else{if(document.body.attachEvent){document.body.attachEvent("on"+c,d.wtbind(this))}}}};WebTrends.prototype.dcsET=function(){var b=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";this.dcsBind(b,this.dcsDownload);this.dcsBind(b,this.dcsJavaScript);this.dcsBind(b,this.dcsMailTo);this.dcsBind(b,this.dcsOffsite);this.dcsBind("contextmenu",this.dcsRightClick);this.dcsBind(b,this.dcsImageMap)};WebTrends.prototype.dcsMultiTrack=function(){var c=dcsMultiTrack.arguments?dcsMultiTrack.arguments:arguments;if(c.length%2==0){this.dcsSetProps(c);var d=new Date();this.DCS.dcsdat=d.getTime();this.dcsFPC();this.dcsTag()}};WebTrends.prototype.dcsCleanUp=function(){this.DCS={};this.WT={};this.DCSext={};if(arguments.length%2==0){this.dcsSetProps(arguments)}};WebTrends.prototype.dcsSetProps=function(d){for(var c=0;c<d.length;c+=2){if(d[c].indexOf("WT.")==0){this.WT[d[c].substring(3)]=d[c+1]}else{if(d[c].indexOf("DCS.")==0){this.DCS[d[c].substring(4)]=d[c+1]}else{if(d[c].indexOf("DCSext.")==0){this.DCSext[d[c].substring(7)]=d[c+1]}}}}};WebTrends.prototype.dcsSplit=function(e){var g=e.toLowerCase().split(",");var h=g.length;for(var f=0;f<h;f++){g[f]=g[f].replace(/^\s*/,"").replace(/\s*$/,"")}return g};WebTrends.prototype.dcsDownload=function(o){o=o||(window.event||"");if(o&&((typeof(o.which)!="number")||(o.which==1))){var m=this.dcsEvt(o,"A");if(m.href){var j=m.hostname?(m.hostname.split(":")[0]):"";if(this.dcsIsOnsite(j)&&this.dcsTypeMatch(m.pathname,this.downloadtypes)){var n=m.search?m.search.substring(m.search.indexOf("?")+1,m.search.length):"";var k=m.pathname?((m.pathname.indexOf("/")!=0)?"/"+m.pathname:m.pathname):"/";var e="";var l=document.all?m.innerText:m.text;var p=this.dcsEvt(o,"IMG");if(p.alt){e=p.alt}else{if(l){e=l}else{if(m.innerHTML){e=m.innerHTML}}}this.dcsMultiTrack("DCS.dcssip",j,"DCS.dcsuri",k,"DCS.dcsqry",m.search||"","WT.ti","Download:"+e,"WT.dl","20","WT.nv",this.dcsNavigation(o));this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};WebTrends.prototype.dcsRightClick=function(h){h=h||(window.event||"");if(h){var g=h.which||h.button;if((g!=1)||(navigator.userAgent.indexOf("Safari")!=-1)){var e=this.dcsEvt(h,"A");if((typeof(e.href)!="undefined")&&e.href){if((typeof(e.protocol)!="undefined")&&e.protocol&&(e.protocol.indexOf("http")!=-1)){if((typeof(e.pathname)!="undefined")&&this.dcsTypeMatch(e.pathname,this.downloadtypes)){var i=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";var j=e.hostname?(e.hostname.split(":")[0]):"";this.dcsMultiTrack("DCS.dcssip",j,"DCS.dcsuri",i,"DCS.dcsqry","","WT.ti","RightClick:"+i,"WT.dl","25");this.DCS.dcssip=this.DCS.dcsuri=this.WT.ti=this.WT.dl=this.WT.nv=""}}}}}};WebTrends.prototype.dcsMailTo=function(e){e=e||(window.event||"");if(e&&((typeof(e.which)!="number")||(e.which==1))){var f=this.dcsEvt(e,"A");if(f.href&&f.protocol){var d=f.search?f.search.substring(f.search.indexOf("?")+1,f.search.length):"";if(f.protocol.toLowerCase()=="mailto:"){this.dcsMultiTrack("DCS.dcssip","","DCS.dcsuri",f.href,"WT.ti","MailTo:"+f.innerHTML,"WT.dl","23","WT.nv",this.dcsNavigation(e));this.DCS.dcssip=this.DCS.dcsuri=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};WebTrends.prototype.dcsJavaScript=function(e){e=e||(window.event||"");if(e&&((typeof(e.which)!="number")||(e.which==1))){var f=this.dcsEvt(e,"A");if(f.href&&f.protocol){var d=f.search?f.search.substring(f.search.indexOf("?")+1,f.search.length):"";if(f.protocol.toLowerCase()=="javascript:"){this.dcsMultiTrack("DCS.dcssip","","DCS.dcsuri",f.href,"WT.ti","JavaScript:"+f.innerHTML,"WT.dl","22","WT.nv",this.dcsNavigation(e));this.DCS.dcssip=this.DCS.dcsuri=this.WT.ti=this.WT.cl=this.WT.nv=""}}}};WebTrends.prototype.dcsOffsite=function(h){h=h||(window.event||"");if(h&&((typeof(h.which)!="number")||(h.which==1))){var l=this.dcsEvt(h,"A");if(l.href){var j=l.hostname?(l.hostname.split(":")[0]):"";var i=l.protocol||"";if((j.length>0)&&(i.indexOf("http")==0)&&!this.dcsIsOnsite(j)){var e=l.search?l.search.substring(l.search.indexOf("?")+1,l.search.length):"";var k=l.pathname?((l.pathname.indexOf("/")!=0)?"/"+l.pathname:l.pathname):"/";this.dcsMultiTrack("DCS.dcssip",j,"DCS.dcsuri",k,"DCS.dcsqry",this.trimoffsiteparams?"":e,"DCS.dcsref",window.location,"WT.ti","Offsite:"+j+k+"?"+e,"WT.dl","24","WT.nv",this.dcsNavigation(h));this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.DCS.dcsref=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};WebTrends.prototype.dcsImageMap=function(e){e=e||(window.event||"");if(e){var k=this.dcsEvt(e,"AREA");if(k.href){var i=k.hostname?(k.hostname.split(":")[0]):"";if((i!="")&&k.protocol&&(k.protocol.indexOf("http")!=-1)){var h="";var l=this.dcsEvt(e,"MAP");if(l){if(l.name){h=l.name}else{if(l.id){h=l.id}}}var j=k.pathname?((k.pathname.indexOf("/")!=0)?"/"+k.pathname:k.pathname):"/";this.dcsMultiTrack("DCS.dcssip",i,"DCS.dcsuri",j,"DCS.dcsqry",k.search||"","WT.ti","ImageMap:"+h,"WT.dl","30","WT.nv",this.dcsNavigation(e));this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};WebTrends.prototype.dcsAdv=function(){if(this.trackevents&&(typeof(this.dcsET)=="function")){if(window.addEventListener){window.addEventListener("load",this.dcsET.wtbind(this),false)}else{if(window.attachEvent){window.attachEvent("onload",this.dcsET.wtbind(this))}}}this.dcsFPC()};WebTrends.prototype.dcsVar=function(){var o=new Date();var e=this.WT;var i=this.DCS;e.tz=parseInt(o.getTimezoneOffset()/60*-1)||"0";e.bh=o.getHours()||"0";e.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof(screen)=="object"){e.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;e.sr=screen.width+"x"+screen.height}if(typeof(navigator.javaEnabled())=="boolean"){e.jo=navigator.javaEnabled()?"Yes":"No"}if(document.title){if(window.RegExp){var m=new RegExp("^"+window.location.protocol+"//"+window.location.hostname+"\\s-\\s");e.ti=document.title.replace(m,"")}else{e.ti=document.title}}e.js="Yes";e.jv=(function(){var H=navigator.userAgent.toLowerCase();var h=parseInt(navigator.appVersion);var I=(H.indexOf("mac")!=-1);var F=(H.indexOf("firefox")!=-1);var L=(H.indexOf("firefox/0.")!=-1);var G=(H.indexOf("firefox/1.0")!=-1);var K=(H.indexOf("firefox/1.5")!=-1);var g=(H.indexOf("firefox/2.0")!=-1);var d=(F&&!L&&!G&!K&!g);var M=(!F&&(H.indexOf("mozilla")!=-1)&&(H.indexOf("compatible")==-1));var J=(M&&(h==4));var E=(M&&(h>=5));var C=((H.indexOf("msie")!=-1)&&(H.indexOf("opera")==-1));var f=(C&&(h==4)&&(H.indexOf("msie 4")!=-1));var j=(C&&!f);var a=(H.indexOf("opera")!=-1);var b=(H.indexOf("opera 5")!=-1||H.indexOf("opera/5")!=-1);var c=(H.indexOf("opera 6")!=-1||H.indexOf("opera/6")!=-1);var N=(a&&!b&&!c);var D="1.1";if(d){D="1.8"}else{if(g){D="1.7"}else{if(K){D="1.6"}else{if(L||G||E||N){D="1.5"}else{if((I&&j)||c){D="1.4"}else{if(j||J||b){D="1.3"}else{if(f){D="1.2"}}}}}}}return D})();e.ct="unknown";if(document.body&&document.body.addBehavior){try{document.body.addBehavior("#default#clientCaps");e.ct=document.body.connectionType||"unknown";document.body.addBehavior("#default#homePage");e.hp=document.body.isHomePage(location.href)?"1":"0"}catch(l){}}if(document.all){e.bs=document.body?document.body.offsetWidth+"x"+document.body.offsetHeight:"unknown"}else{e.bs=window.innerWidth+"x"+window.innerHeight}e.fv=(function(){var b,c;if(window.ActiveXObject){for(b=10;b>0;b--){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);return b+".0"}catch(a){}}}else{if(navigator.plugins&&navigator.plugins.length){for(b=0;b<navigator.plugins.length;b++){if(navigator.plugins[b].name.indexOf("Shockwave Flash")!=-1){return navigator.plugins[b].description.split(" ")[2]}}}}return"Not enabled"})();e.slv=(function(){var g="Not enabled";try{if(navigator.userAgent.indexOf("MSIE")!=-1){var d=new ActiveXObject("AgControl.AgControl");if(d){g="Unknown"}}else{if(navigator.plugins["Silverlight Plug-In"]){g="Unknown"}}}catch(a){}if(g!="Not enabled"){var b,c,f;if((typeof(Silverlight)=="object")&&(typeof(Silverlight.isInstalled)=="function")){for(b=3;b>0;b--){for(c=9;c>=0;c--){f=b+"."+c;if(Silverlight.isInstalled(f)){g=f;break}}if(g==f){break}}}}return g})();if(this.i18n){if(typeof(document.defaultCharset)=="string"){e.le=document.defaultCharset}else{if(typeof(document.characterSet)=="string"){e.le=document.characterSet}else{e.le="unknown"}}}e.tv="8.6.2";e.dl="0";e.ssl=(window.location.protocol.indexOf("https:")==0)?"1":"0";i.dcsdat=o.getTime();i.dcssip=window.location.hostname;i.dcsuri=window.location.pathname;e.es=i.dcssip+i.dcsuri;if(window.location.search){i.dcsqry=window.location.search}if(i.dcsqry){var p=i.dcsqry.toLowerCase();var k=this.paidsearchparams.length?this.paidsearchparams.toLowerCase().split(","):[];for(var n=0;n<k.length;n++){if(p.indexOf(k[n]+"=")!=-1){e.srch="1";break}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){i.dcsref=window.document.referrer}}};WebTrends.prototype.dcsEscape=function(e,f){if(f!=""){e=e.toString();for(var d in f){if(f[d] instanceof RegExp){e=e.replace(f[d],d)}}return e}else{return escape(e)}};WebTrends.prototype.dcsA=function(l,p){if(this.i18n&&(this.exre!="")&&!this.exre.test(l)){if(l=="dcsqry"){var r="";var o=p.substring(1).split("&");for(var m=0;m<o.length;m++){var n=o[m];var k=n.indexOf("=");if(k!=-1){var i=n.substring(0,k);var q=n.substring(k+1);if(m!=0){r+="&"}r+=i+"="+this.dcsEncode(q)}}p=p.substring(0,1)+r}else{p=this.dcsEncode(p)}}return"&"+l+"="+this.dcsEscape(p,this.re)};WebTrends.prototype.dcsEncode=function(b){return(typeof(encodeURIComponent)=="function")?encodeURIComponent(b):escape(b)};WebTrends.prototype.dcsCreateImage=function(b){if(document.images){this.images[this.index]=new Image();this.images[this.index].src=b;this.index++}else{document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+b+'">')}};WebTrends.prototype.dcsMeta=function(){var g;if(document.all){g=document.all.tags("meta")}else{if(document.documentElement){g=document.getElementsByTagName("meta")}}if(typeof(g)!="undefined"){var i=g.length;for(var k=0;k<i;k++){var l=g.item(k).name;var j=g.item(k).content;var h=g.item(k).httpEquiv;if(l.length>0){if(l.toUpperCase().indexOf("WT.")==0){this.WT[l.substring(3)]=j;if(j.indexOf("Login-Error")>-1){this.DCS.dcsuri="/Error/Login/Login Failed"}}else{if(l.toUpperCase().indexOf("DCSEXT.")==0){this.DCSext[l.substring(7)]=j}else{if(l.toUpperCase().indexOf("DCS.")==0){this.DCS[l.substring(4)]=j}}}}}}};WebTrends.prototype.dcsTag=function(){if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var r=this.WT;var l=this.DCS;var q=this.DCSext;var i=this.i18n;var o="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+this.domain+(this.dcsid==""?"":"/"+this.dcsid)+"/dcs.gif?";if(i){r.dep=""}for(var n in l){if(l[n]&&(typeof l[n]!="function")){o+=this.dcsA(n,l[n])}}var k=["co_f","vtid","vtvs","vt_f_tlv"];for(var p=0;p<k.length;p++){var m=k[p];if(r[m]){o+=this.dcsA("WT."+m,r[m]);delete r[m]}}for(n in r){if(r[n]&&(typeof r[n]!="function")){o+=this.dcsA("WT."+n,r[n])}}for(n in q){if(q[n]&&(typeof q[n]!="function")){if(i){r.dep=(r.dep.length==0)?n:(r.dep+";"+n)}o+=this.dcsA(n,q[n])}}if(i&&(r.dep.length>0)){o+=this.dcsA("WT.dep",r.dep)}if(o.length>2048&&navigator.userAgent.indexOf("MSIE")>=0){o=o.substring(0,2040)+"&WT.tu=1"}this.dcsCreateImage(o);this.WT.ad=""};WebTrends.prototype.dcsDebug=function(){var f=this;var g=f.images[0].src;var i=g.indexOf("?");var j=g.substring(0,i).split("/");var h="<b>Protocol</b><br><code>"+j[0]+"<br></code>";h+="<b>Domain</b><br><code>"+j[2]+"<br></code>";h+="<b>Path</b><br><code>/"+j[3]+"/"+j[4]+"<br></code>";h+="<b>Query Params</b><code>"+g.substring(i+1).replace(/\&/g,"<br>")+"</code>";h+="<br><b>Cookies</b><br><code>"+document.cookie.replace(/\;/g,"<br>")+"</code>";if(f.w&&!f.w.closed){f.w.close()}f.w=window.open("","dcsDebug","width=500,height=650,scrollbars=yes,resizable=yes");f.w.document.write(h);f.w.focus()};WebTrends.prototype.dcsCollect=function(){if(this.enabled){this.dcsVar();this.dcsMeta();this.dcsAdv();this.dcsTag()}};function dcsMultiTrack(){if(typeof(_tag)!="undefined"){return(_tag.dcsMultiTrack())}}function dcsDebug(){if(typeof(_tag)!="undefined"){return(_tag.dcsDebug())}}Function.prototype.wtbind=function(d){var f=this;var e=function(){return f.apply(d,arguments)};return e};
