/* Copyright 2008-2011 Adometry, Inc. */
var DMTRY=DMTRY||{};(function(){try{var c="na";DMTRY.namespace=function(o){var q=DMTRY,e=o.split("."),p;if(e[0]==="DMTRY"){e=e.slice(1)}for(p=0;p<e.length;p++){if(typeof q[e[p]]==="undefined"){q[e[p]]={}}q=q[e[p]]}return q};var i={id:"ADO",lHost:"log.dmtry.com",fName:"http(s)?://(js|log).dmtry.com/antenna2.js"};var k=DMTRY.namespace(i.id);var n=false;var d=new function(){this.hasFocus=true};d.onblur=function(){d.hasFocus=false};d.onfocus=function(){d.hasFocus=true};var j=function(o,p,e){this.type=o;this.description=p;this.requiredProps=e;this.processResponseCallback=null};j.DEFINED={IMP:new j("i","Imp",["sz"]),LOAD:new j("ol","Load",["ddl","dqc","drl","dti","dxn","ds","dsf","if","sn","sz","ta","tp","x","y"]),SEEN:new j("sn","Seen",["sn","ta","tp"]),POST:new j("p","Post",["ta","tp"]),DEMO_DATALOGIX:new j("ddl","DataLogix",[]),DEMO_EXELATE_N:new j("dxn","ExelateN",[]),DEMO_QUANTCAST:new j("dqc","Quantcast",[]),DEMO_RAPLEAF:new j("drl","RapLeaf",[]),DEMO_TARGUS:new j("dti","Targus",[])};j.DEFINED.IMP.processResponseCallback=function(p,o){var e=p;if(o.cookie!==false){e=p.replace(b.HOSTNAME,b.HOSTNAME+"/redir")}return e};j.DEFINED.DEMO_DATALOGIX.processResponseCallback=function(q,p){var o=b.HOSTNAME,r="adometry.nexac.com/dlp",e;e=q.replace(o,r);return e};j.DEFINED.DEMO_EXELATE_N.processResponseCallback=function(o,e){return g(o,e,"exp")};j.DEFINED.DEMO_QUANTCAST.processResponseCallback=function(s,q){var o=null;if(q!=null){_qoptions={qacct:"p-fcd0u1L_qX43k",labels:q.props.gid+"."+q.props.bid};var p="http://edge.quantserve.com/quant.js";try{var t=document.createElement("script");t.setAttribute("type","text/javascript");t.setAttribute("src",p);document.body.appendChild(t)}catch(r){b.sendError(null,"Error inserting QC tag: "+r.toString())}}return o};j.DEFINED.DEMO_RAPLEAF.processResponseCallback=function(r,p){var o=encodeURIComponent(r),q="43971",e="http://rd.rlcdn.com/rd?site="+q+"&type=redir&url="+o;return e};j.DEFINED.DEMO_TARGUS.processResponseCallback=function(o,e){return g(o,e,"tp")};var g=function(r,q,o){var p=b.HOSTNAME,s=p,e;if(o!=null&&o.length>0){if(o.indexOf("/")!==0){s+="/"}s+=o}e=r.replace(p,s);return e};k.Action=k.Action||j;var l=function(){this.forElement=null;this.scriptElement=null;this.protocol="http";this.dgVendors=[];this.adSize="";this.position="";this.cookie=true;var o=l.INCOMING_PARAM_ORDER;for(var e=0;e<o.length;e++){this[o[e]]=0}};l.INCOMING_PARAM_ORDER=["bid","gid","pid","cid","aid","srcid","advid"];l.processQueryParam=function(q,s){var t,r;t=/debug=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])===1){n=true}return}t=/sz=(\d+x\d+)/i;r=t.exec(s);if(r){q.adSize=r[1];return}t=/pos=(\w{2})$/i;r=t.exec(s);if(r){q.position=r[1].toLowerCase();return}t=/nc=(\d)/i;r=t.exec(s);if(r){q.cookie=(Number(r[1])===1)?false:true;return}t=/dl=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])==1){q.dgVendors.push("dl")}return}t=/qc=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])==1){q.dgVendors.push("qc")}return}t=/rl=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])==1){q.dgVendors.push("rl")}return}t=/ti=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])==1){q.dgVendors.push("ti")}return}t=/xn=(\d)/i;r=t.exec(s);if(r){if(Number(r[1])==1){q.dgVendors.push("xn")}return}t=/ename=(\w*)&?/i;r=t.exec(s);if(r){var e=null;var p=document.getElementsByName(r[1]);for(var o=0;o<p.length;o++){if(!p[o].dmtry){e=p[o];e.dmtry=true;break}}if(e){}else{}q.forElement=e;return}};l.parseScriptUrl=function(t){var x=new l(),p=document.getElementsByTagName("script"),r=new RegExp(t+"\\?"),B,s;for(var u=0;u<p.length;u++){B=p[u];s=B.src;if(s.search(r)==0&&B[i.id]===undefined){B[i.id]=true;var y=s.indexOf(":");var z="http";if(y>0){z=s.substring(0,y)}var e=s.replace(/^[^\?]+\??/,"");if(e!=""){var A=e.split("&");for(var v=1;v<A.length;v++){var q=A[v];l.processQueryParam(x,q)}x.scriptElement=p[u];x.protocol=z;var o=A[0].split("_");if(o.length>=3){for(var w=0;w<o.length;w++){if(o[w]!=null&&o[w]!=""){x[l.INCOMING_PARAM_ORDER[w]]=o[w]}}}else{throw new Error("Script param error: "+A[0])}}return x}}};k.AntennaManager=k.AntennaManager||{};k.AntennaManager.antennas=k.AntennaManager.antennas||[];k.AntennaManager.imageElems=k.AntennaManager.imageElems||[];k.AntennaManager.scriptElems=k.AntennaManager.scriptElems||[];k.AntennaManager.create=function(s){if(s==null||!s.protocol||!s.bid||!s.gid||!s.pid||(s&&typeof s=="object"&&s.constructor!=l)){return null}var A=k.AntennaManager;var e=b;var u=j;var t=A.antennas;var w=A.imageElems;var r=t.length;var y=i.id+"_track";var o=null;var p=(n)?5:0;if(o==null){var v=y+"_new";document.write('<img width="0" height="0" border="'+p+'" name="'+v+'">');var z=document.getElementsByName(v);if(z.length>0){o=z[0];o.name=y}if(z.length>1){}}if(o==null){var q=s.scriptElement;if(q!=null){try{o=document.createElement("img");o.name=y;o.width=0;o.height=0;o.border=p;q.parentNode.insertBefore(o,q)}catch(x){o=null}}}if(o!=null){w[r]=o;t[r]=new e(s,u.DEFINED.IMP,r)}else{e.sendError(s,"noImage")}return t[r]};k.AntennaManager.shutdownAntennas=function(){var p=k.AntennaManager,q=j,o=a,r=p.antennas;if(r&&r.length>0){var e;for(e=0;e<r.length;e++){r[e].sendResponse(q.DEFINED.POST);if(r[e].timerID){clearInterval(r[e].timerID);r[e].timerID=null}}}};var b=function(M,L,o){var e=j,u=b,q=k.AntennaManager,x=a,r=d,z=this;z.version=b.VERSION+"";z.timerInterval=1;z.timerID=null;z.startTime=new Date();z.inFrame=false;z.nfPresent=false;z.forElement=null;z.props=[];z.rImages=[];z.size=null;z.cookie=true;var F=function(){z.forElement=M.forElement;z.props.bid=M.bid;z.props.gid=M.gid;z.props.pid=M.pid;z.props.cid=M.cid;z.props.aid=M.aid;z.props.srcid=M.srcid;z.props.advid=M.advid;z.props.sid=u.generateRandom(999998);z.size=G();z.props.sz=(z.size.width!=null&&z.size.height!=null)?(z.size.width+"x"+z.size.height):c;z.cookie=(typeof M.cookie!=="undefined")?M.cookie:true;z.props.nc=(z.cookie===false)?1:0;var N=s();z.inFrame=N.inFrame;z.nfPresent=N.nonFriendlyPresent;z.props.url=N.url;z.props.jt=N.toTop;z.props.jf=N.friendLevel;z.props["if"]=c;z.props.num=o;z.props.sr=u.getScreenRes();z.props.ds=c;z.props.dsf=c;z.props.tz=u.getTimeZone();z.props.sn=0;z.props.tp=0;z.props.ta=0;z.props.x=c;z.props.y=c;z.props.jsv=z.version;z.props.dqc=0;z.props.drl=0;z.props.dti=0;z.props.dxn=0;z.props.oc=i.id;C(window,"load",function(){z.props["if"]=(z.inFrame)?1:0;z.props.ta=(z.props["if"]===1)?-1:0;var O;O=u.getDocumentSize();z.props.ds=O.width+"x"+O.height;O=u.getDocumentSize(window);z.props.dsf=O.width+"x"+O.height;y(false);v();if(M.dgVendors!=null&&b.arrayContains(M.dgVendors,"dl")){z.props.ddl=1;z.sendResponse(e.DEFINED.DEMO_DATALOGIX)}if(M.dgVendors!=null&&b.arrayContains(M.dgVendors,"qc")){z.props.dqc=1;z.sendResponse(e.DEFINED.DEMO_QUANTCAST)}if(M.dgVendors!=null&&b.arrayContains(M.dgVendors,"rl")){z.props.drl=1;z.sendResponse(e.DEFINED.DEMO_RAPLEAF)}if(M.dgVendors!=null&&b.arrayContains(M.dgVendors,"ti")){z.props.dti=1;z.sendResponse(e.DEFINED.DEMO_TARGUS)}if(M.dgVendors!=null&&b.arrayContains(M.dgVendors,"xn")){z.props.dxn=1;z.sendResponse(e.DEFINED.DEMO_EXELATE_N)}z.sendResponse(e.DEFINED.LOAD)});if(L!==null&&typeof(L)!="undefined"){z.sendResponse(L)}};var t=function(){if(document.readyState){if(document.readyState!="loaded"&&document.readyState!="interactive"&&document.readyState!="complete"){return false}}return true};var C=function(P,R,N){var O=false;if((!(P&&typeof P=="object"))||(!(R&&typeof R=="string"))||(!(N&&typeof N=="function"))){return O}try{if(P.attachEvent){P.attachEvent("on"+R.toLowerCase(),N);O=true}else{P.addEventListener(R,N,false);O=true}}catch(Q){}return O};var B=function(){var O=function(){try{var Q=z;if(r.hasFocus){if(A()){Q.props.ta+=Q.timerInterval}y()}}catch(P){if(z.timerID){clearInterval(z.timerID);z.timerID=null}}};var N=z.timerInterval*1000;O();z.timerID=setInterval(O,N)};var G=function(){var Q=null,N=null,P,O;if(M!=null){if(M.adSize!=null&&M.adSize!=""){P=M.adSize.split("x");if(P!=null&&P.length===2){Q=Number(P[0]);N=Number(P[1])}}else{O=b.AD_TYPES[M.cid];if(O!=null){Q=O.w;N=O.h}}}return{width:Q,height:N}};var s=function(){var W={url:document.referrer,toTop:-1,friendLevel:0,nonFriendlyPresent:false},T={winObj:window,levelsUp:0},R=20,U=W.url,Q=false,P=false;for(var N=window,S=0;;N=N.parent,S++){if(S==R){S=-1;break}try{if(N.document){T.winObj=N;T.levelsUp=S}else{P=true}}catch(O){P=true}if(N==N.parent){break}else{Q=true}}var V=S;try{if(T.levelsUp==V){U=T.winObj.location.href}else{U=T.winObj.document.referrer}}catch(O){}W.url=U;W.toTop=V;W.friendLevel=T.levelsUp;W.inFrame=Q;W.nonFriendlyPresent=P;return W};var v=function(){if(z.props.x!=null&&z.props.y!=null){if(z.props.x==c||z.props.y==c){var N=H("document");z.props.x=N.x;z.props.y=N.y}}};var y=function(O){if(O===null||typeof O!="boolean"){O=true}var R=z,Q=r.hasFocus,N=A(),P=I();if(Q&&(P||N)){if(R.props.sn!==null&&R.props.sn===0){R.props.sn=1;if(O){R.sendResponse(e.DEFINED.SEEN)}}}};var A=function(){return p("viewport")};var I=function(){return p("document")};var p=function(O){var Q=H(O),N=Q.x,P=Q.y;if(N==c||N<0||N>100||P<0||P>100){return false}return true};var H=function(O){var S={x:c,y:c},W={x:0,y:0},P={},V={left:0,top:0},R=window,ab=null,N=false,ad=Math.round,U=true;if(O.toLowerCase()=="document"){U=false}if(z.inFrame||!t()){return S}P=u.getDocumentSize(R);V.left=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft||0;V.top=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0;if(U){W.x-=V.left;W.y-=V.top}if(z.forElement){ab=z.forElement}else{ab=q.imageElems[o];N=true}if(ab){var Q=ab;while(Q!=null){W.x+=Q.offsetLeft+Q.clientLeft;W.y+=Q.offsetTop+Q.clientTop;if(Q.style!=null){var T=Q.style.position;if(T!=null&&T.toLowerCase()==="fixed"){W.x+=V.left;W.y+=V.top}}Q=Q.offsetParent}if(!N){var aa=ab.clientWidth||ab.offsetWidth||0;var Y=ab.clientHeight||ab.offsetHeight||0;if(aa){W.x+=ad(aa/2)}if(Y){W.y+=ad(Y/2)}}else{var Z=80,X=-1,ae=50,ac=-1;if(z.size!=null){if(z.size.width!=null&&!isNaN(z.size.width)){Z=ad(z.size.width/2)}if(z.size.height!=null&&!isNaN(z.size.height)){ae=ad(z.size.height/2)}}if(M!=null&&M.position!=null){X=(M.position.indexOf("l")>0)?1:-1;ac=(M.position.indexOf("t")>0)?1:-1}W.x+=X*Z;W.y+=ac*ae}}if(U){}else{}if(isNaN(P.width)||isNaN(P.height)||P.width<=0||P.height<=0){return S}S.x=Math.round(W.x/P.width*100);S.y=Math.round(W.y/P.height*100);if(!U){S.x=(S.x<0)?0:S.x;S.y=(S.y<0)?0:S.y}return S};var D=function(){z.props.rand=u.generateRandom(999998);z.props.tp=Math.round(((new Date()).getTime()-z.startTime.getTime())/1000)};var w=function(O,Q){var N="";if(Q===undefined){Q=null}if(typeof z.props[O]!="function"){try{Q=encodeURIComponent(Q)}catch(P){Q=escape(Q)}N=O+"="+Q+"&"}return N};var E=function(Q){if(!Q){return null}var S="?";S+=w("at",Q.type);S+=w("d",Q.description);if(!Q.requiredProps){return S}else{if(Q.requiredProps.constructor==Array){var P="",R="",N=[],O=0;N=N.concat(Q.requiredProps);N=N.concat(u.QS_ALWAYS);for(O=0;O<N.length;O++){P=N[O];if(!u.arrayContains(u.PATHORDER,P)&&P.toLowerCase()!="url"){R=z.props[P];S+=w(P,R)}}}else{return null}}S+=w("url",z.props.url);return S.substring(0,S.length-1)};var J=function(){var O="/";for(var N=0;N<u.PATHORDER.length;N++){O+=z.props[u.PATHORDER[N]]+"/"}O+="1.ver";return O};var K=function(P){D();var N=J(),Q=E(P),O=M.protocol+"://"+u.HOSTNAME+N+Q;return O};this.sendResponse=function(P){var O=null;if(P===null||P.type===null){return null}var N=new Image;N.border="0";N.height=1;N.width=1;N.vspace=0;N.hspace=0;if(N){O=K(P);if(P.processResponseCallback!=null&&typeof P.processResponseCallback=="function"){O=P.processResponseCallback(O,this)}if(O!=null){if(O.length>u.MAX_URL_LENGTH){O=O.substring(0,u.MAX_URL_LENGTH)}if(O.length>0){N.src=O;z.rImages.push(N)}}}else{}if(P.type.toLowerCase()=="ol"){B()}return O};F()};b.VERSION="4.1.2";b.MAX_URL_LENGTH=2048;b.HOSTNAME=i.lHost;b.PATHORDER=["rand","bid","gid","pid","cid","sid","aid","srcid","advid"];b.QS_ALWAYS=["jf","jt","jsv","oc","nc","num","sr","tz","url"];b.AD_TYPES={8:{w:728,h:90},9:{w:300,h:250},10:{w:160,h:600},11:{w:300,h:600},12:{w:120,h:600}};b.sendError=function(o,s){var e=new Image();var q="/";if(o!=null){var r=b.PATHORDER;for(var p=0;p<r.length;p++){if(o[r[p]]!=null){q+=o[r[p]]}else{q+=0}q+="/"}}e.src="http://"+b.HOSTNAME+q+"1.ver?at=e&d="+escape(s)+"&jsv="+b.VERSION};b.arrayContains=function(e,p){for(var o=0;o<e.length;o++){if(e[o]==p){return true}}return false};b.generateRandom=function(e){return Math.floor(Math.random()*(e))+1};b.getScreenRes=function(){try{return screen.width+"x"+screen.height+"x"+screen.colorDepth}catch(e){return c}};b.getDocumentSize=function(e){var p={width:-1,height:-1};try{e=(e==null)?window.top:e;p.width=e.innerWidth||e.document.documentElement.clientWidth||e.document.body.clientWidth||-1;p.height=e.innerHeight||e.document.documentElement.clientHeight||e.document.body.clientHeight||-1}catch(o){}return p};b.getTimeZone=function(){try{return new Date().getTimezoneOffset()/60}catch(e){return c}};var a={debugWindow:null,init:function(){},log:function(e){},markPixel:function(p,e,o){}};(function(){try{var o=l.parseScriptUrl(i.fName);if(k.AntennaManager.create(o)){}else{var p="Antenna object COULD NOT be created.";b.sendError(o,p)}}catch(e){b.sendError(null,e.message)}if(window.addEventListener){if(k.AntennaManager.antennas.length==1){window.addEventListener("unload",k.AntennaManager.shutdownAntennas,false)}window.addEventListener("focus",d.onfocus,false);window.addEventListener("blur",d.onblur,false)}else{if(k.AntennaManager.antennas.length==1){window.attachEvent("onunload",k.AntennaManager.shutdownAntennas)}document.attachEvent("onfocusin",d.onfocus);document.attachEvent("onfocusout",d.onblur)}})()}catch(m){try{var f="Global Catch: "+m.name+":"+m.number+": "+m.message;b.sendError(null,f)}catch(h){}}})();
