0% found this document useful (0 votes)
12K views7 pages

Web Developers Debugging Guide

The document describes code for logging and tracking timing events during the loading and rendering of ads on a web page. It defines classes for slots, services, and an event log. Slots can be rendered and associate with services to fetch and display ads. The event log is used to record timing data at different stages of the process.

Uploaded by

contigo_63
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12K views7 pages

Web Developers Debugging Guide

The document describes code for logging and tracking timing events during the loading and rendering of ads on a web page. It defines classes for slots, services, and an event log. Slots can be rendered and associate with services to fetch and display ads. The event log is used to record timing data at different stages of the process.

Uploaded by

contigo_63
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

(function(){var e=true,g=null,i=false,j;function aa(a)

{this.t={};this.tick=function(b,c,d){this.t[b]=[d?d:(new
Date).getTime(),c]};this.tick("start",g,a)}var ba=new
aa;window.GPT_jstiming={Timer:aa,load:ba};try{var
k=g;if(window.chrome&&window.chrome.csi)k=Math.floor(window.chrome.csi().pageT);if(
k==g)if(window.gtbExternal)k=window.gtbExternal.pageT();if(k==g)if(window.external)
k=window.external.pageT;if(k)window.GPT_jstiming.pt=k}catch(da)
{};if(window.GPT_jstiming){window.GPT_jstiming.ia={};window.GPT_jstiming.Ya=1;var
ea=function(a,b,c){var d=a.t[b],f=a.t.start;if(d&&(f||c)){d=a.t[b][0];f=c!
=undefined?c:f[0];return d-f}},fa=function(a,b,c){var
d="";if(window.GPT_jstiming.pt){d+="&srt="+window.GPT_jstiming.pt;delete
window.GPT_jstiming.pt}try{if(window.external&&window.external.tran)d+="&tran="+win
dow.external.tran;else
if(window.gtbExternal&&window.gtbExternal.tran)d+="&tran="+window.gtbExternal.tran(
);else if(window.chrome&&window.chrome.csi)d+=
"&tran="+window.chrome.csi().tran}catch(f){}var
h=window.chrome;if(h)if(h=h.loadTimes)
{if(h().wasFetchedViaSpdy)d+="&p=s";if(h().wasNpnNegotiated)d+="&npn=1";if(h().wasA
lternateProtocolAvailable)d+="&apa=1"}if(a.Da)d+="&"+a.Da;h=a.t;var
q=h.start,r=[],m=[];for(var n in h)if(n!="start")if(n.indexOf("_")!=0){var v=h[n]
[1];if(v)h[v]&&m.push(n+"."+ea(a,n,h[v][0]));else q&&r.push(n+"."+ea(a,n))}delete
h.start;if(b)for(var l in b)d+="&"+l+"="+b[l];return[c?
c:"http://csi.gstatic.com/csi","?v=3","&s="+(window.GPT_jstiming.sn||
"gpt")
+"&action=",a.name,m.length?"&it="+m.join(","):"","",d,"&rt=",r.join(",")].join("")
};window.GPT_jstiming.report=function(a,b,c){a=fa(a,b,c);b=new Image;var
d=window.GPT_jstiming.Ya+
+;window.GPT_jstiming.ia[d]=b;b.onload=b.onerror=function(){delete
window.GPT_jstiming.ia[d]};b.src=a;b=g;return a}};var o=this,ga=function(a){var
b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instanceof
Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof
a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!
="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof
Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!
="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!
a.propertyIsEnumerable("call")))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return
b},p=function(a){return ga(a)=="array"},s=function(a){return typeof
a=="string"},t=function(a){return typeof
a=="number"};Math.floor(Math.random()*2147483648).toString(36);
var ha=function(a,b){var c=b||o;if(arguments.length>2){var
d=Array.prototype.slice.call(arguments,2);return function(){var
f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return
a.apply(c,f)}}else return function(){return a.apply(c,arguments)}},u=function(a,b)
{function c(){}c.prototype=b.prototype;a.hb=b.prototype;a.prototype=new c};var
w=function(){return o.googletag||(o.googletag={})},x=function(a,b,c){var d=w();if(!
(a in d)||c)d[a]=b;return d[a]},ia=function(a,b){if(a.attachEvent)
{a.attachEvent("onload",b);return e}if(a.addEventListener)
{a.addEventListener("load",b,i);return e}return i};var y=function(a,b,c,d,f)
{this.fa=new Date;this.cb=d||g;this.Za=c||g;this.sa=a;this.ta=b;this.Y=f||
g};j=y.prototype;j.oa=function(){return this.cb};j.na=function(){return
this.Za};j.ma=function(){return this.sa};j.pa=function(){return
this.fa};j.Pa=function(){return this.ta};j.Qa=function(){return this.Y};var
ja=["Debug","Info","Warning","Error","Fatal"];
y.prototype.toString=function(){var a=[];a.push(this.fa.toTimeString());a.push(":
");a.push(ja[this.sa]);a.push(": ");a.push(this.ta);if(this.Y){a.push(" Duration:
");a.push(this.fa.getTime()-this.Y.pa().getTime());a.push("ms.")}return
a.join("")};y.prototype.getTimestamp=y.prototype.pa;y.prototype.getService=y.protot
ype.na;y.prototype.getSlot=y.prototype.oa;y.prototype.getLevel=y.prototype.ma;y.pro
totype.getMessage=y.prototype.Pa;y.prototype.getReference=y.prototype.Qa;var
z=function(){this.F=[]};z.prototype.Ja=function(){return
this.F};z.prototype.Na=function(a){return ka(this,function(b){return
b.na()===a})};z.prototype.Oa=function(a){return ka(this,function(b){return
b.oa()===a})};z.prototype.Ma=function(a){return ka(this,function(b){return
b.ma()>=a})};var ka=function(a,b){for(var c=[],d=0;d<a.F.length;+
+d)b(a.F[d])&&c.push(a.F[d]);return c};z.prototype.log=function(a,b,c,d,f){a=new
y(a,b,c,d,f);this.F.push(a);return a};
z.prototype.info=function(a,b,c,d){return
this.log(1,a,b,c,d)};z.prototype.error=function(a,b,c,d){return
this.log(3,a,b,c,d)};var A=function(){var a=w();return a.debug_log||
(a.debug_log=new
z)};x("getEventLog",A);z.prototype.getAllEvents=z.prototype.Ja;z.prototype.getEvent
sByService=z.prototype.Na;z.prototype.getEventsBySlot=z.prototype.Oa;z.prototype.ge
tEventsByLevel=z.prototype.Ma;var B,la,C,ma,na=function(){return o.navigator?
o.navigator.userAgent:g};ma=C=la=B=i;var D;if(D=na()){var
oa=o.navigator;B=D.indexOf("Opera")==0;la=!B&&D.indexOf("MSIE")!=-1;C=!
B&&D.indexOf("WebKit")!=-1;ma=!B&&!C&&oa.product=="Gecko"}var
pa=la,qa=ma,ra=C,sa="",E;if(B&&o.opera){var ta=o.opera.version;sa=typeof
ta=="function"?ta():ta}else{if(qa)E=/rv\:([^\);]+)(\)|;)/;else if(pa)E=/MSIE\s+
([^\);]+)(\)|;)/;else if(ra)E=/WebKit\/(\S+)/;if(E){var ua=E.exec(na());sa=ua?
ua[1]:""}};var F=function(a,b){this.eb=a;this.Ta=b};F.prototype.o=function(){return
this.eb};F.prototype.m=function(){return this.Ta};var va=function(a){var
b=[];if(p(a))if(a.length>1&&t(a[0])&&t(a[1]))b.push(new F(a[0],a[1]));else for(var
c=0;c<a.length;++c){var d=a[c];p(d)&&d.length>1&&t(d[0])&&t(d[1])&&b.push(new
F(d[0],d[1]))}return
b};F.prototype.getWidth=F.prototype.o;F.prototype.getHeight=F.prototype.m;var
G=function(a,b,c){this.u=a;this.qa=t(b)?
b:0;this.f=this.u+"_"+this.qa;this.Ea=c||"gpt_unit_"+this.f};j=G.prototype;j.r=func
tion(){return this.f};j.getName=function(){return this.u};j.U=function(){return
this.qa};j.toString=G.prototype.r;j.q=function(){return
this.Ea};G.prototype.getId=G.prototype.r;G.prototype.getName=G.prototype.getName;G.
prototype.getDomId=G.prototype.q;G.prototype.getInstance=G.prototype.U;var
wa=function(a,b,c){if(c)c=new G(a,c);else{c=x("google_slot_id_instance_map",{},i);a
in c||(c[a]=0);var d=new G(a,c[a]);c[a]
+=1;c=d}c=c;this.name=a;this.instance=c.U();this.domId=c.q();this.sizes=b};wa.proto
type.$=function(){if(this.name){var a=va(this.sizes);if(xa(this.domId,a.length>0?
a[0]:g,o.document)){a=ya();p(a)&&a.push(this)}}};
var ya=function(){var a=x("displayed_slot_queue",[],i);return p(a)?a:
[]},xa=function(a,b,c){if(c.getElementById(a))return i;a=['<div
id="',a,'"'];b&&a.push(' style="'+("margin: 0px; width: "+(b.o()+"px")+"; height:
"+(b.m()+"px"))+'"');a.push("></div>");c.write(a.join(""));return e};var
H=function(a,b,c,d){this.u=a;this.bb=va(c);c=g;for(var f=ya()||[],h=0;h<f.length;+
+h){var q=f[h];if(q.name===a&&q.instance===b){c=q.id;break}}this.f=c||new
G(a,b,d);this.g=[];this.l={};this.A=g;this.b=A();this.b.info("Created slot:
"+this.f,g,this);this.Xa=this.O=this.Ha=this.T=g;this.ka="";this.ua=e};j=H.prototyp
e;
j.aa=function(a,b){var c=[" attribute ",a," with value ",b," for slot
",this.getName()].join("");if(a&&s(a)&&b){this.l[a]=b;this.T||this.O?
this.b.log(2,"Setting"+c+" after its contents have been loaded",g,this,void
0):this.b.info("Setting"+c,g,this)}else this.b.log(2,"Unable to set"+c,g,this,void
0);return this};j.d=function(a){if(a in this.l)return this.l[a];return
g};j.G=function(){var a=[];for(var b in this.l)ga(this.l[b])=="function"||
a.push(b);return a};
j.ha=function(a){for(var b=0;b<this.g.length;++b)if(a==this.g[b])
{this.b.log(2,"Service "+a.getName()+" is already associated with slot
"+this.f,a,this,void 0);return this}this.g.push(a);a.ba(this);return
this};j.getName=function(){return this.u};j.j=function(){return
this.f};j.Ra=function(){return this.g};j.V=function(){return
this.bb};j.s=function(){return!!
document.getElementById(this.f.q())};j.H=function(a){this.A=a};
var za=function(a){if(!a.s()){a.b.error("Unable to write to slot "+a.f+". It has
not yet been rendered.",g,a);return i}var
b=o.document,c=a.f.q();b=b&&b.getElementById(c);if(!b){a.b.error("Unable to find
the div container with id "+c+" for slot "+a.f,g,a);return
i}c=a.A;if(s(c)&&c.length>0){a.xa();b.innerHTML=c;a.wa();return e}return
i},Aa=function(a,b){if(!b||b==1)return za(a);a.b.error("Unknown render type for
slot "+a.f,g,a);return i};j=H.prototype;
j.$=function(a){if(this.s())this.b.log(2,"Slot "+this.f+" has already been
rendered.",g,this,void 0);else{a=va(a||[]);a=a.length>0?
a[0]:g;xa(this.f.q(),a,o.document);for(a=0;a<this.g.length;+
+a)this.g[a].p&&this.g[a].C(this)}};j.Ia=function(a){this.T=this.b.info("Fetching
ad for slot "+this.getName(),g,this);this.ka=a};j.Ka=function(){return
this.ka};j.Ga=function(){this.Ha=this.b.info("Receiving ad for slot
"+this.getName(),g,this,this.T)};
j.xa=function(){this.O=this.b.info("Rendering ad for slot
"+this.getName(),g,this)};j.wa=function(){this.Xa=this.b.info("Completed rendering
ad for slot
"+this.getName(),g,this,this.O)};H.prototype.set=H.prototype.aa;H.prototype.get=H.p
rototype.d;H.prototype.getName=H.prototype.getName;H.prototype.getSlotId=H.prototyp
e.j;H.prototype.getSizes=H.prototype.V;H.prototype.addService=H.prototype.ha;H.prot
otype.getServices=H.prototype.Ra;H.prototype.getAttributeKeys=H.prototype.G;
H.prototype.fetchStarted=H.prototype.Ia;H.prototype.fetchEnded=H.prototype.Ga;H.pro
totype.renderStarted=H.prototype.xa;H.prototype.renderEnded=H.prototype.wa;H.protot
ype.hasWrapperDiv=H.prototype.s;H.prototype.getContentUrl=H.prototype.Ka;var
I=function(){this.J={};this.la={};this.b=A()};I.prototype.add=function(a,b,c){if(!
s(a)||a.length<=0||!b)return g;a in this.J||(this.J[a]=[]);b=new
H(a,this.J[a].length,b,c);c=b.j().q();if(this.la[c]){this.b.error("Div element
"+c+" is already associated with another slot");return g}this.J[a].push(b);return
this.la[b.j().q()]=b};I.prototype.find=function(a,b){var c=b||0,d=s(a)&&this.J[a]||
[];if(c>=0&&c<d.length){d=d[c];if(d.j().U()==c)return d}return g};
var Ba=function(){var a=w();return a.slot_manager_instance||
(a.slot_manager_instance=new I)},J=function(a,b,c){var d=Ba();return
d&&d.add(a,b,c)};x("defineSlot",J);x("defineUnit",J);I.prototype.find=I.prototype.f
ind;I.getInstance=Ba;var Ca=function(a,b){var c=A();if(!s(a)||b!=g&&!
p(b))c.error("Illegal slot name or size in display(). Name: "+a.toString()+"; size:
"+b.toString());else{for(var d=Ba(),f=g,h=0;f=d.find(a,h);++h)if(!f.s()){f.$
(b);return}c.info("Displaying undeclared instance "+(h+1)+" of slot "+a);(new
wa(a,b,h)).$()}};x("display",Ca,e);var K=function(a,b){this.u=a;this.ea=b?b:new
o.GPT_jstiming.Timer;this.ea.name=a;this.S=[]};j=K.prototype;j.getName=function()
{return this.u};j.tick=function(a,b){this.ea.tick(a,b)};j.ga=function(a)
{a&&this.S.push(a)};j.report=function(){var
a={};if(this.S.length)a.e=this.S.join();return
o.GPT_jstiming.report(this.ea,a)};j.Z=function(a){ia(window,a)};var L=function(a)
{this.u=a};u(L,K);L.prototype.tick=function(){};L.prototype.ga=function()
{};L.prototype.report=function(){return g};L.prototype.Z=function(){};
var Da=function(a,b,c,d)
{b=b;if(b==undefined)b=1;b=o.GPT_jstiming&&o.GPT_jstiming.load&&o.location.protocol
=="http:"&&Math.random()<b?e:i;a=b?new K(a,d):new
L(a,d);c&&a.Z(ha(K.prototype.report,a));return a};(function(){if(!
w()._gpt_timer_&&o.GPT_jstiming){var
a=Da("global",1,i,o.GPT_jstiming.load);a.Z(function()
{a.tick("load");a.report()});x("_gpt_timer_",a)}return w()._gpt_timer_})();var
M=function(a,b)
{this.N=[];this.p=i;this.l={};this.Ca=Da(this.getName(),a,b);this.log=A();this.log.
info("Created service: "+this.getName(),this)};j=M.prototype;j.getName=function()
{return"unknown"};j.La=function(){return this.Ca};j.aa=function(a,b){var
c=["attribute ",a," with value ",b," for service
",this.getName()].join("");if(s(a)&&a.length>0){this.l[a]=b;this.log.info("Setting
"+c,this,g)}else this.log.log(2,"Unable to set "+c,this,g,void 0);return
this};j.d=function(a){return this.l[a]};
j.G=function(){var a=[];for(var b in this.l)typeof this.l[b]!
="function"&&a.push(b);return a};j.K=function(){return this.N};j.Sa=function()
{for(var a={},b=0;b<this.N.length;++b){var c=this.N[b];a[c.j().r()]=c}return
a};j.R=function(){if(this.p)this.log.info("Service is already
enabled.",this);else{this.p=e;try{this.M()}catch(a){this.log.error("Failed to
enable service: "+a,this)}}};j.display=function(a,b,c){this.R();(c?
J(a,b,c):J(a,b)).ha(this);Ca(a,b)};
j.ba=function(a){this.N.push(a);this.log.info("Associated "+this.getName()+"
service with slot
"+a.getName(),this,a);this.p&&a.s()&&this.C(a)};M.prototype.getSlots=M.prototype.K;
M.prototype.getSlotIdMap=M.prototype.Sa;M.prototype.enable=M.prototype.R;M.prototyp
e.set=M.prototype.aa;M.prototype.get=M.prototype.d;M.prototype.getAttributeKeys=M.p
rototype.G;M.prototype.getCsiTimer=M.prototype.La;M.prototype.display=M.prototype.d
isplay;var N=function(){this.g={};this.X=i;this.b=A();this.db=this.b.info("Google
service JS loaded");ia(window,ha(N.prototype.Wa,this))};N.prototype.add=function(a)
{this.g[a.getName()]=a};N.prototype.find=function(a){var b=g;if(a in
this.g)b=this.g[a];return b};var O=function(a){return
a.X};N.prototype.Wa=function(){this.X=e;this.b.info("Page load
complete",g,g,this.db)};
var Ea=function(a,b,c){a=i;try{a=b.top.document.URL===c.URL}catch(d){}return a?
c.URL:c.referrer},P=function(){var a=w();return a.service_manager_instance||
(a.service_manager_instance=new N)};x("enableServices",function(){var a=P();for(var
b in a.g){var c=a.g[b];if(ga(c)!="function"){c.R();c=b;var
d=w()._gpt_timer_;d&&d.ga(c)}}});var Fa=function(){var
a=document,b=a.createElement("script");b.type="text/javascript";b.src="http://publi
sherconsole.appspot.com/js/loader.js";b.async=e;(a=a.getElementsByTagName("script")
[0])&&a.parentNode&&a.parentNode.insertBefore(b,a)},Ga;
a:{var Ha=window,Ia;var
Ja=document.cookie.split("google_pubconsole=");Ia=Ja.length==2?Ja[1].split(";")
[0]:"";if(Ia){var Ka=Ia.split("|");if(Ka.length>0&&(Ka[0]=="1"||Ka[0]=="0"))
{Ga=e;break a}}var La;var Q=Ea(P(),Ha,document),Na=Q.search(/#|$/),R;c:{for(var
S=0;(S=Q.indexOf("google_console",S))>=0&&S<Na;){var Oa=Q.charCodeAt(S-
1);if(Oa==38||Oa==63){var Pa=Q.charCodeAt(S+14);if(!Pa||Pa==61||Pa==38||Pa==35)
{R=S;break c}}S+=15}R=-1}if(R<0)La=g;else{var Qa=Q.indexOf("&",R);if(Qa<0||
Qa>Na)Qa=Na;R+=15;
La=decodeURIComponent(Q.substr(R,Qa-R).replace(/\+/g," "))}Ga=g!
==La}Ga&&ia(window,Fa);var T=function()
{M.call(this);this.ra=i;this.Q={}};u(T,M);j=T.prototype;j.M=function(){if(!this.ra)
{o.document.write('<script type="text/javascript" src="'+this.L()
+'"><\/script>');this.ra=e}};j.getName=function()
{return"companion_ads"};j.L=function()
{return"http://pagead2.googlesyndication.com/pagead/show_companion_ad.js"};j.B=func
tion(a){var b=a&&a.j().r();if(b&&b in this.Q&&a.s()&&this.p){a.H(this.Q[b]);return
Aa(a)}return i};j.C=function(a){this.B(a)};
j.fillSlot=function(a,b){if(a&&s(b)&&b.length>0){this.Q[a.j().toString()]=b;return
this.B(a)}return i};x("companionAds",function(){var
a=P(),b=a.find("companion_ads");if(!b){b=new T;a.add(b)}return
b});T.prototype.fillSlot=T.prototype.fillSlot;var U=function()
{M.call(this);this.A={}};u(U,M);j=U.prototype;j.getName=function()
{return"content"};j.B=function(a){var b=a&&a.j().r();if(b in
this.A&&this.p&&a.s()&&!a.O){a.H(this.A[b]);return Aa(a)}return i};j.M=function()
{for(var a=this.K(),b=0;b<a.length;++b)this.B(a[b])};j.C=function(a)
{this.B(a)};j.H=function(a,b){if(a&&s(b)&&b.length>0)
{this.A[a.j().r()]=b;this.B(a)}};x("content",function(){var
a=P(),b=a.find("content");if(!b){b=new U;a.add(b)}return
b});U.prototype.setContent=U.prototype.H;var V=function()
{M.call(this);this.ja=i;this.da=1;this.D=this.P=0;this.za={};this.Ba=Math.random()*
1E16};u(V,M);V.prototype.getName=function(){return"network_ads"};var Ra=function(a)
{a=a.d("network_config_path");if(!a)return"";return a.replace(/^\/+|\/+$/g,"")};
V.prototype.M=function(){var a=Ra(this);if(s(a)&&a.length>0){if(!(this.ja||O(P())))
{a=Sa(this,"network_debug_src_url","http://s0.2mdn.net/dnb")
+"/config/"+a+"/gut_config.js";W(this,"Configuration file
location",a);document.write(Ta(this,a,i));this.ja=e}}else throw"Configuration key
not set before NetworkAdsService.enable() called. Please properly set the
configuration key with NetworkAdsService.set('network_config_path', site tag
name')";};
V.prototype.C=function(a){var b=a.j().r(),c;a:{var
d=a.getName(),f=a.V();this.gb=this.fb=0;for(var
h=d.split(/\//g),q=[],r=0;r<h.length;++r)h[r].length>0&&q.push(h[r]);var
m=q.length;W(this,"Total IU count",""+m);r={};h="["+q[q.length-1]+"]";for(var n=m-
1;n>0;n--){var v=q.slice(0,n).join("/");W(this,"Attempt to match marker
key",v);if(r=this.za[v]){W(this,"Marker key match!",v);m=r.a;for(c in m)
{W(this,"Match ad unit "+h+" to ",c);if(c&&c.indexOf(h)>=0){W(this,"Ad Unit
match!",c);W(this,"Config file entry used identified by key",
v);h=f;r=r;m=m[c].ab;c=[];q=f=d="";if(m)
{d=Ua(this,m["2"],"2",e);q=this.d("iframe_rendering")=="true"||
d.length>0;f=Ua(this,m["0"],"0",q);q=Ua(this,m["1"],"1",q)}var
l;n=r;h=h;r=d.length>0;v=Va(this,n.asbu,"http://ad.doubleclick.net");var
ca=n.z;if(!ca||ca.length==0)ca="_default";m=[];var
Ma="adj";if(r)Ma="adi";m.push(v+"/"+Ma+"/"+Ra(this)
+"/"+Sa(this,"network_zone",ca));if(n=n.k){v=[];for(l in
n)v.push(l+"="+n[l]);m.push(Wa(this,v.join(";")))}l=Sa(this,"network_key_values",""
);l.length>0&&m.push(l);
m.push("tile="+this.da);++this.da;l=[];for(n=0;n<h.length;++n)l.push(h[n].o()
+"x"+h[n].m());m.push("sz="+l.join(","));m.push("ord="+this.Ba+"?");l=[];W(this,"Ad
tag Url",m.join(";"));if(r){W(this,"Third party
targeting","enabled");l.push(Xa(this,m.join(";"),Ya(this,h)))}else
l.push(Ta(this,m.join(";"),this.d("iframe_rendering")=="true"));l=l.join("");d.leng
th>0&&c.push(d);f.length>0&&c.push(f);l.length>0&&c.push(l);q.length>0&&c.push(q);c
=c.join("");break a}}W(this,"No supported ad unit found.",h)}}W(this,
"No configuration file entry
found",d);c=""}l=document.getElementById(a.j().q());if(this.d("iframe_rendering")||
c.indexOf("document.write")!=-1){c=c;if(!O(P())){d=document;f=[];f.push('<script
type="text/javascript">');f.push(" function "+b.replace(/\W/g,"")+"() {");f.push("
return ['<!DOCTYPE html><html><body>',");f.push(" '"+c+"',");f.push("
'</body></html>'].join('\\n');");f.push(" }");f.push("<\/script>");d.write(f.join(
"\n"))}d=Ya(this,a.V());c=d.o();d=d.m();if(c<this.D)c=
this.D;d+=this.P;c=new F(c,d);if(l)
{l.style.height=c.m();l.style.width=c.o()}a.H("<iframe width='"+c.o()+"'
height='"+c.m()+"' scrolling='no' frameborder ='0'
src=\"javascript:parent."+b.replace(/\W/g,"")
+'()"></iframe>');Aa(a)}else{if(l)l.style.display="none";O(P())||
document.write(c)}this.D=this.P=0};
var Ya=function(a,b){for(var c=0,d=0,f=0;f<b.length;++f)
{if(b[f].o()>c)c=b[f].o();if(b[f].m()>d)d=b[f].m()}return new
F(c,d)},Xa=function(a,b,c){a="_"+c.o()+"_"+c.m()+"_"+a.da;var d=[];d.push('<script
type="text/javascript">');d.push(" var url=\\'"+b+"\\';");d.push(' if
(typeof(key_values) != "undefined") {');d.push(" var tileIndex =
url.indexOf(\\';tile=\\');");d.push(" if (tileIndex < 0) {");d.push(" url
+= \\';\\' + key_values;");d.push(" } else {");d.push(" var content =
[];");
d.push(" content.push(url.substring(0, tileIndex));");d.push("
content.push(\\';\\' + key_values);");d.push("
content.push(url.substring(tileIndex));");d.push(" url =
content.join(\\'\\');");d.push(" }");d.push(" }");d.push("
document.write(\\'<iframe id=\""+a+'" width="'+c.o()+'" height="'+c.m()+'"
frameborder = "0" src="\\\' + encodeURI(url)
+ \\\'"/>\\\');');d.push("<\\/script>");return d.join("")},Ua=function(a,b,c,d)
{if(!b)return"";var f=Va(a,b.bu,"http://s0.2mdn.net/dnb")+
"/"+b.n+".js";if(b.h)a.P+=parseInt(b.h,10);if((b=b.w)&&parseInt(b,10)>a.D)a.D=parse
Int(b,10);W(a,"Block type ["+c+"]",f);return Ta(a,f,d)},Sa=function(a,b,c){var
d="";d=a.d(b);if(s(d)&&d.length>0){W(a,"Page level override "+b,d);return d}return
c},Wa=function(a,b){if(!b)return b;var c=b.match(/%+\w+%+/);if(!c)return b;for(var
d=0;d<c.length;++d){var f="";if(c[d].search(/%AD_PAGE_URL
%/gi)>=0)f=encodeURIComponent(self.top.window.location.toString().replace(/^http[s]
?:\/\/[www.]*/i,"").substring(0,253));
if(f&&f.length>0)b=b.replace(RegExp(c[d],"g"),f)}return b},Va=function(a,b,c)
{if(s(b)&&b.length>0){if(b.lastIndexOf("/")==b.length-1)b=b.substring(0,b.length-
1);return b}return c};V.prototype.Aa=function(a){this.za=a};
var Ta=function(a,b,c){a=[];a.push("<");c?
a.push("scr'+'ipt"):a.push("script");a.push(' type="text/javascript"
src="'+b+'">');c?a.push("<\\/"):a.push("</");a.push("script>");return
a.join("")},W=function(a,b,c)
{(a=a.d("network_debug"))&&a=="true"&&document.write("<b>"+b+"</b>:
"+c+"<br>")},Za=function(){var a=P(),b=a.find("network_ads");if(!b){b=new
V;a.add(b)}return b},X="Gut.networkAdsService".split("."),Y=o;!(X[0]in
Y)&&Y.execScript&&Y.execScript("var "+X[0]);
for(var Z;X.length&&(Z=X.shift());)if(!X.length&&Za!==undefined)Y[Z]=Za;else
Y=Y[Z]?Y[Z]:Y[Z]={};V.prototype.applyConfig=V.prototype.Aa;x("networkAds",Za);var
$=function()
{M.call(this);this.W=i;this.c=g;this.ca={};this.va=i;this.ya=e;this.I=i;this.i=e;th
is.v=[]};u($,M);
var
$a={adsense_channel_ids:"google_ad_channel",adsense_ad_types:"google_ad_type",adsen
se_ad_format:"google_ad_format",adsense_background_color:"google_color_bg",adsense_
border_color:"google_color_border",adsense_link_color:"google_color_link",adsense_t
ext_color:"google_text_color",adsense_url_color:"google_color_url",adsense_ui_featu
res:"google_ui_features",adsense_keywords:"google_kw",adsense_keyword_type:"google_
kw_type",page_url:"google_page_url"};j=$.prototype;
j.M=function(){var a=P();if(!(this.W||a.X)){var
b=document;this.W=e;b.write('<script type="text/javascript"
src="'+this.L(Ea(a,window,b))+'"><\/script>')}};j.getName=function()
{return"publisher_ads"};j.L=function(a){if(a.indexOf("&google_debug")>0||
a.indexOf("?
google_debug")>0)return"http://partner.googleadservices.com/gampad/google_ads_gpt_d
bg.js";return"http://partner.googleadservices.com/gampad/google_ads_gpt.js"};
j.Va=function(){var a=P(),b=w().impl;if(b&&b.pubads)
{this.c=b.pubads;this.log.info("GDFP implementation fetched.",this);this.ya||
this.c.disableFetch();if(this.I){this.i?
this.c.enableAsyncSingleRequest():this.c.enableSingleRequest();ab(this);a=this.K();
for(b=0;b<a.length;++b)bb(this,a[b])}else
this.i&&this.c.enableAsyncRendering();if(this.v.length>0)for(b=0;b<this.v.length;+
+b)this.C(this.v[b])}else this.log.error("Unable to fetch pubads service
implementation from "+this.L(Ea(a,window,document)),
this)};j.ba=function(a){if(!this.i)a.ua=i;M.prototype.ba.call(this,a)};
j.C=function(a){if(O(P())&&!this.i)this.log.error("Attempting to display ad in sync
mode after page load is complete.",this);else if(this.c){ab(this);if(this.I||
bb(this,a)){this.log.info("Calling fillslot");this.c.fillSlot(a)}}else if(this.i||
this.W&&this.v.length==0){for(var b=i,c=0;c<this.v.length;+
+c)if(a===this.v[c])b=e;if(!b){this.log.info("Delaying rendering of ad slot
"+a.getName()+" pending loading of the GDFP
implementation",this,a);this.v.push(a)}}else this.log.error("Skipping rendering of
slot "+
a.getName()+" due to missing GDFP implementaition",this,a)};
var bb=function(a,b){if(a.c&&a.c.addSlot(b)==g){a.log.error("Unable to process name
for slot "+b.getName(),a,b);return i}for(var c=b.G(),d=0;d<c.length;++d)c[d]in $a?
a.c.addAdSenseSlotAttribute(b,$a[c[d]],b.d(c[d])):a.log.log(2,"Ignoring unknown
pubads attribute "+c[d]+" with value "+b.d(c[d])+" for slot "+b.getName(),a,b,void
0);return e},ab=function(a){if(!a.va){a.va=e;for(var b=a.G(),c=0;c<b.length;+
+c)b[c]in $a?a.c.addAdSensePageAttribute($a[b[c]],a.d(b[c])):a.log.log(2,"Ignoring
unknown pubads attribute "+
b[c]+" with value "+a.d(b[c]),a,void 0,void
0);a.c.addAdSensePageAttribute("google_tag_info","v2");for(var d in a.ca)
{b=a.ca[d];if(p(b))for(c=0;c<b.length;+
+c)a.c.addAttribute(d,b[c])}}};j=$.prototype;j.$a=function(a,b){var
c=[];if(s(b))c.push(b);else c=b;var d=[" targeting attribute ",a," with value
",c.join()," for service ",this.getName()].join("");if(a&&s(a))
{this.ca[a]=c;this.log.info("Setting"+d,this)}else this.log.log(2,"Unable to
set"+d,this,void 0,void 0)};
j.Ua=function(){if(this.c)this.log.log(2,"Ignoring noFetch since the pubads service
is already enabled",this,void 0,void 0);else
this.ya=i};j.enableSingleRequest=function(){if(this.p&&!
this.I)this.log.log(2,"Ignoring change to single request mode since the service is
already enabled",this,void 0,void 0);else{this.log.info("Using single request mode
to fetch ads",this);this.I=e}return this.I};
j.enableAsyncRendering=function(){if(this.p&&!this.i)this.log.log(2,"Ignoring
change to async-rendering mode since the service is already enabled",this,void
0,void 0);else{this.log.info("Using async-rendering mode to fetch
ads",this);this.i=e}return this.i};
j.Fa=function(){if(this.p&&this.i)this.log.log(2,"Ignoring change to async-
rendering mode since the service is already enabled",this,void 0,void
0);else{this.log.info("Using sync-rendering mode to fetch
ads",this);this.i=i;for(var a=this.K(),b=0;b<a.length;++b)a[b].ua=i}return!
this.i};x("pubads",function(){var a=P(),b=a.find("publisher_ads");if(!b){b=new
$;a.add(b)}return b});
$.prototype.enableSingleRequest=$.prototype.enableSingleRequest;
$.prototype.enableAsyncRendering=$.prototype.enableAsyncRendering;
$.prototype.enableSyncRendering=$.prototype.Fa;$.prototype.noFetch=$.prototype.Ua;
$.prototype.setTargeting=$.prototype.$a;
$.prototype.onGoogleAdsJsLoad=$.prototype.Va;})()

You might also like