function debug(){}function adriver(f,a,d){try{this.ph=f;this.prm={};for(var b in this.defaults){this.prm[b]=this.defaults[b]}for(var b in a){this.prm[b]=a[b]}for(var b in this.prm){this.req+=b+"="+this.prm[b]+"&"}if(!adriver.items){adriver.items={};this.addHandlers();this.checkFlash()}this.p=document.getElementById(f);this.p.adriver=this;adriver.items[f]=this;d||this.load()}catch(c){}}adriver.prototype.ver="1.1";adriver.prototype.flashVer=[0];adriver.prototype.domReady=false;adriver.prototype.handlers=[];adriver.prototype.defaults={tail256:(document.referrer?escape(document.referrer):"unknown")};adriver.prototype.h=document.getElementsByTagName("head").item(0);adriver.prototype.req="http://ad.adriver.ru/cgi-bin/erle.cgi?";adriver.prototype.loadScript=function(c,a){try{a||(c+="ph="+this.ph+"&rnd="+Math.round(Math.random()*10000));var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","windows-1251");b.setAttribute("src",c);this.s=b;this.h.insertBefore(b,this.h.firstChild)}catch(d){}};adriver.prototype.detachScript=function(){try{this.h.removeChild(this.s)}catch(a){}};adriver.prototype.load=function(){try{this.loadScript(this.req)}catch(a){}};adriver.prototype.onDomReady=function(a){try{this.domReady?a():this.handlers.push(a)}catch(b){}};adriver.prototype.runHandlers=function(a){try{if(a){a()}if(!this.domReady){adriver.prototype.domReady=true;var b;while(b=this.handlers.shift()){b()}}}catch(c){}};adriver.prototype.addHandlers=function(){try{var h=document,a=this,c;if(/WebKit/i.test(navigator.userAgent)){c=setInterval(function(){if(/loaded|complete/.test(h.readyState)){clearInterval(c);a.runHandlers()}},100)}else{if(h.addEventListener){h.addEventListener("DOMContentLoaded",function(){a.runHandlers()},false)}else{if(h.all&&!window.opera){var b=h.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src","");b.setAttribute("defer","true");b.onreadystatechange=function(){if(this.readyState=="complete"){a.runHandlers()}};this.h.insertBefore(b,this.h.firstChild)}}}var f=window.onload;window.onload=function(){a.runHandlers(f)}}catch(g){}};adriver.prototype.checkFlash=function(b){debug("checking flash");try{if(b){return(this.flashVer[0]>=b)}var h,i=navigator,a,c="Shockwave Flash";if((a=i.mimeTypes)&&(a=a["application/x-shockwave-flash"])&&a.enabledPlugin&&(i=i.plugins)&&i[c]){h=i[c].description}else{if(window.ActiveXObject){debug("activeX flash detect");try{h=(new ActiveXObject((c+"."+c).replace(/ /g,""))).GetVariable("$version")}catch(g){debug("error in activeX detection")}}}debug("version obj: "+h);if(h){adriver.prototype.flashVer=h.replace(/\D+/,"").split(/\D+/)}debug("flash "+this.flashVer+" detected")}catch(g){}return false};adriver.prototype.setAnchor=function(){this.anchor=this.addDiv(this.p,{position:"relative"})};adriver.prototype.addPanel=function(g,f,b,c){debug("add panel"+g);var a=null;try{if(!this.panels){this.panels={}}a=this.addDiv(c||this.anchor,f,b);this.panels[g]=a}catch(d){}return a};adriver.prototype.addDiv=function(f,d,a){var g=null;try{g=document.createElement("DIV");for(var b in d){g.style[b]=d[b]}if(a){g.innerHTML=a}f.insertBefore(g,f.firstChild)}catch(c){}return g};function adriver_dispatcher(h,d,g,b){debug("dispatching "+g+": "+b+" to "+h+"."+d);try{var c=adriver.items[h];if(c&&c.dispatch){c.dispatch(d,g,b)}}catch(f){}};