(function(){
function c(a){this.J=a.adsContainer;this.C=a.nextAdIndex||0;this.L=a.linksContainer;this.b=a.previousLink;this.a=a.nextLink;this.r=a.linkActiveBgColor;this.t=a.linkInactiveBgColor;this.s=a.linkActiveCursor;this.u=a.linkInactiveCursor;this.B=a.loading;this.g=a.requestToken;this.M=a.renderAds;this.K=a.getNextAdRequestUrl;this.d=a.pages;this.c=0;this.f=false;this.p="";this.o="";this.D(window.location.search);this.H();this.L.style.display="block"}c.prototype.A=function(a){this.q();if(a.ads.length==0){this.g=
null;this.c=0;this.h()}else{this.g=a.token&&a.token.length>0?a.token:null;for(var b=0;b<a.ads.length;++b){var d=a.ads[b];d.id=this.C;++this.C}this.v(a.ads)}this.j();this.f=false};c.prototype.n=function(){for(var a=0;a<this.d.length;++a)this.d[a].style.display="none"};c.prototype.I=function(){this.n();this.B.style.display=""};c.prototype.q=function(){this.B.style.display="none"};c.prototype.k=function(a){if(a==0&&this.c>0)this.z();else if(a==1&&(this.g||this.c<this.d.length-1))this.w()};c.prototype.l=
function(a){this.i(a)};c.prototype.m=function(a){if(a==0&&this.c>0||a==1&&(this.g||this.c<this.d.length-1))this.G(a)};c.prototype.v=function(a){var b=this.M(this.c,a);this.d.push(b);this.J.appendChild(b)};c.prototype.w=function(){if(!this.f){this.f=true;++this.c;if(this.c==this.d.length){this.I();this.F()}else{this.h();this.j();this.f=false}}};c.prototype.z=function(){if(!this.f){this.f=true;--this.c;this.h();this.j();this.f=false}};c.prototype.h=function(){this.n();this.d[this.c].style.display=""};
c.prototype.D=function(a){if(this.p==""||this.o==""){if(a.charAt(0)=="?")a=a.substring(1);var b=a.split("&");for(var d=0;d<b.length;d++){var e=b[d].split("=");if(e.length==2)switch(e[0]){case "url":this.p=e[1];break;case "hl":this.o=e[1];break}}}};c.prototype.F=function(){var a={language:this.o,requestToken:this.g,url:this.p},b=this.K(a),d=document.createElement("script");d.setAttribute("src",b);var e=document.getElementsByTagName("head")[0];e.appendChild(d)};c.prototype.G=function(a){var b=a==0?
this.b:this.a;b.style.backgroundColor=b.activeBgColor;b.style.cursor=b.activeCursor};c.prototype.i=function(a){var b=a==0?this.b:this.a;b.style.backgroundColor=b.inactiveBgColor;b.style.cursor=b.inactiveCursor};c.prototype.j=function(){if(this.c>0)this.b.onmouseover=this.b.activeMouseOver;else{this.b.onmouseover=null;this.i(0)}if(this.g||this.c<this.d.length-1)this.a.onmouseover=this.a.activeMouseOver;else{this.a.onmouseover=null;this.i(1)}};c.prototype.H=function(){this.b.activeBgColor=this.r;this.b.inactiveBgColor=
this.t;this.b.e=this;this.b.activeCursor=this.s;this.b.inactiveCursor=this.u;this.b.onmousedown=function(){this.e.k(0)};this.b.activeMouseOver=function(){this.e.m(0)};this.b.onmouseout=function(){this.e.l(0)};this.b.onmouseover=this.b.activeMouseOver;this.b.onmouseout();this.a.activeBgColor=this.r;this.a.inactiveBgColor=this.t;this.a.e=this;this.a.activeCursor=this.s;this.a.inactiveCursor=this.u;this.a.onmousedown=function(){this.e.k(1)};this.a.activeMouseOver=function(){this.e.m(1)};this.a.onmouseout=
function(){this.e.l(1)};this.a.onmouseover=this.a.activeMouseOver;this.a.onmouseout()};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1};if(window.sma){window.smaSlotManager=new c(window.sma);window.handleAdsRequestDone=function(a){window.smaSlotManager.A(a)}};
})()
