var AdoElement=function(a){
var b=this;
this.loadingLib=false;
this.buff=ado.placeholder;
this.tmpBuff="";
this.config=a;
this.onLoad=a.onLoad;
this.DOMElement={};
this.regs={scriptBegin:/^\s*(<script\s*)(\s*(\w+)\s*=\s*(([^\s\"\'>]{1}[^\s>]*)|\"([^\"]*)\"|\'([^\']*)\'))*[^\w>]*>/i,scriptEnd:/(<\/script\b([^>\"\']|\"[^\"]*\"|\'[^\']*\')*>)/i,attr:/(\s*(\w+)\s*=\s*(([^\s\"\'>]{1}[^\s>]*)|\"([^\"]*)\"|\'([^\']*)\'))/};
this.myWrite=function(c){
b.tmpBuff+=c;
};
this.myWriteln=function(c){
b.myWrite(c+"\n");
};
this.isMaster=function(){
return this.config.master;
};
this.isSlave=function(){
return this.config.slave;
};
this.initBuffor=function(){
ado.busy=true;
window.document.open=function(){
};
window.document.close=function(){
};
document.write=b.myWrite;
document.writeln=b.myWriteln;
};
this.rewriteBuffor=function(){
if(this.buff.indexOf(ado.placeholder)!==-1){
this.buff=b.buff.replace(ado.placeholder,b.tmpBuff);
}else{
this.buff=this.tmpBuff+this.buff;
}
this.tmpBuff="";
};
this.preDispatch=function(){
if(typeof this.config!=="object"){
return;
}
if(!this.config.id||!this.config.server){
return;
}
if(ado.protocol.substr(0,4)!=="http"){
return;
}
this.getDOMElement();
this.emptyDOMElement();
if(!this.isSlave()){
if(this.config.preview){
this.config.url=this.config.server;
}else{
this.makeUrl();
}
}
this.appendRedirUrl();
if(ado.mode==="old"||!ado.isBrowserSupport()){
document.write("<script type='text/javascript' src='"+b.config.url+"'></script>");
}else{
this.initBuffor();
this.appendScript(this.config.url,null,true);
}
};
this.postDispatch=function(){
ado.busy=false;
ado.start();
};
this.dispatch=function(){
this.deleteComment();
var d=[];
if(this.regs.scriptBegin.test(this.buff)&&this.regs.scriptBegin.test(this.buff)){
d=this.regs.scriptBegin.exec(b.buff);
var c=this.processAttributes(d[0]);
if(c.src){
this.processSrcScript(d,c.src,c.charset);
}else{
if(c.language!=="VBScript"){
this.processInlineScript(d);
}else{
this.processVBScript(d);
}
}
}else{
var g=function(){
if(b.DOMElement){
b.addToDOMElement(b.buff.replace(ado.placeholder,""));
b.buff="";
}
if(typeof b.config.onLoad==="function"){
b.onLoad();
b.onLoad=false;
}
b.postDispatch();
};
if(!this.regs.scriptBegin.test(b.buff)){
var f=/<script/i;
d=f.exec(b.buff);
if(d){
var e=b.buff.indexOf(d[0]);
b.DOMElement=ado.getById(b.config.id);
if(b.DOMElement){
b.addToDOMElement(this.buff.substr(0,e).replace(ado.placeholder,""));
}
this.buff=this.buff.substr(e);
this.dispatch();
}else{
g();
}
}
}
return;
};
this.deleteComment=function(){
var d=/\<!\s*--(.*?)(--\s*\>)/m;
while(d.test(b.buff)){
b.buff=b.buff.replace(d,"");
}
};
this.processVBScript=function(c){
var d=this.regs.scriptEnd.exec(b.buff);
td_flashinstalled=2;
td_browserFlashversion=8;
this.buff=ado.placeholder+this.buff.substr(d.index+d[0].length);
b.dispatch();
};
this.processSrcScript=function(c,e,f){
b.buff=b.buff.substr(c[0].length);
var d=this.regs.scriptEnd.exec(b.buff);
this.buff=ado.placeholder+this.buff.substr(d.index+d[0].length);
this.appendScript(e,f);
};
this.appendScript=function(e,g,c,f){
var d=function(h){
b.loadingLib=false;
if(typeof f==="function"){
f();
}
b.rewriteBuffor();
b.dispatch();
};
this.loadingLib=true;
ado.loadScript(e,d,g);
return;
};
this.onServerEmission=function(){
var e=function(){
if(typeof b.config.onServerEmissionEmpty==="function"){
b.config.onServerEmissionEmpty();
}
};
if(typeof adserver_emissions==="object"){
var d=0;
for(var c in adserver_emissions){
if(typeof adserver_emissions[c]!=="function"){
d++;
}
}
if(d>ado.adserverEmissions){
ado.adserverEmissions++;
if(typeof b.config.onServerEmission==="function"){
b.config.onServerEmission();
}
}else{
e();
}
}else{
e();
}
};
this.processInlineScript=function(c){
if(b.loadingLib){
return;
}
this.buff=this.buff.substr(c[0].length);
var f=this.regs.scriptEnd.exec(b.buff);
var e=this.buff.substr(0,f.index);
this.buff=ado.placeholder+this.buff.substr(f.index+f[0].length);
e=e.replace("/*<![CDATA[*/","");
e=e.replace("<![CDATA[","");
e=e.replace("/* <![CDATA[ */","");
e=e.replace("/* ]]> */","");
e=e.replace("/*]]>*/","");
e=e.replace("<!--","");
e=e.replace("//-->","");
e=e.replace("//]]>-->","");
e=e.replace(/\/\*.*\*\//g,"");
try{
ado.evaluate(e);
}
catch(d){
}
this.rewriteBuffor();
this.dispatch();
return;
};
this.processAttributes=function(d){
var e={};
while(d.length>0){
var c=b.regs.attr.exec(d);
if(!c){
break;
}
d=d.substr(c.index+c[1].length);
var f=null;
if(c[4]){
f=c[4];
}
if(c[5]){
f=c[5];
}
if(c[6]){
f=c[6];
}
e[c[2].toLowerCase()]=f;
}
return e;
};
this.getDOMElement=function(){
this.DOMElement=ado.getById(this.config.id);
if(!this.DOMElement){
return;
}
};
this.emptyDOMElement=function(){
if(this.DOMElement){
this.DOMElement.innerHTML="";
this.DOMElement.style.display="none";
}
};
this.addToDOMElement=function(c){
if(this.DOMElement&&c!==""){
this.DOMElement.style.display="block";
this.DOMElement.innerHTML+=c;
}
};
this.insertToDOMElement=function(c){
if(this.DOMElement&&c!==""){
this.DOMElement.style.display="block";
this.DOMElement.innerHTML=c;
}
};
this.makeUrl=function(){
if(this.config.preview){
this.config.server=this.config.emiter;
}
var c=this.config.contentType;
switch(c){
case "txt":
case "xml":
case "js":
break;
default:
c="js";
break;
}
this.config.url=ado.protocol+"//"+this.config.server;
this.config.url+="/_"+(new Date()).getTime()+"/ad."+c+"?id="+ado.trimAdoPrefix(this.config.orgId)+"/x="+screen.width+"/y="+screen.height;
this.config.url+=ado.makeKeywords(this.config.keys)+ado.makeVars(this.config.vars)+ado.makeFlash();
return;
};
this.appendRedirUrl=function(){
if(this.config.redir&&this.config.redir!==""&&this.config.redir!="<%%REDIR%%>"){
this.config.url=this.config.url+"/redir="+this.config.redir;
}
};
};
var AdoContainer=function(){
var _24=this;
var _25=navigator.userAgent.toLowerCase();
var _26=function(_27){
_27.orgId=_27.id;
_27.id=_27.id+""+ado.iterator++;
var de=ado.getById(_27.orgId);
if(de){
de.id=_27.id;
}
return _27;
};
var _29=function(s){
var d="";
var k=0;
var c="";
if(!s){
return;
}
for(k=0;k<s.length;k++){
c=s.charCodeAt(k);
if(c<128){
d+=s.charAt(k);
}else{
if(c>=128&&c<=2047){
d+=String.fromCharCode(((c>>6)&31)|192,(c&63)|128);
}else{
d+=String.fromCharCode((c>>12)|224,((c>>6)&63)|128,(c&63)|128);
}
}
}
return escape(d).replace(/\//g,"%2F").replace(/\@/g,"%40").replace(/\*/g,"%2A").replace(/\+/g,"%2B").replace(/\%/g,"$");
};
this.elems=[];
this.urlsMapping=[];
this.masterSlaves=[];
this.queue=[];
this.iterator=0;
this.busy=false;
this.placeholder="__MARKER__";
this.mode="old";
this.characterEncoding=true;
this.xml=false;
this.previewUrl="";
this.previewEnabled=[];
this.tmp=[];
this.adserverEmissions=0;
this.windowLoad=false;
this.protocol="";
this.browser={version:(_25.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(_25),opera:/opera/.test(_25),msie:/msie/.test(_25)&&!/opera/.test(_25),mozilla:/mozilla/.test(_25)&&!/(compatible|webkit)/.test(_25)};
this.config=function(cfg){
this.mode=cfg.mode;
this.xml=cfg.xml;
this.characterEncoding=cfg.characterEncoding;
if(cfg.protocol){
this.protocol=cfg.protocol;
}else{
this.protocol=location.protocol;
}
};
this.resolvId=function(id,_30){
for(var i in ado.elems){
var cfg=ado.elems[i].config;
if(cfg){
if(_30){
if(cfg.orgId===id||cfg.orgId==="ado-"+id){
return i;
}
}else{
if((cfg.orgId===id||cfg.orgId==="ado-"+id)&&ado.elems[i].begin===false){
return i;
}
}
}
}
return false;
};
this.addAdoPrefix=function(_33){
if(_33.id.length===46){
_33.id="ado-"+_33.id;
}
return _33;
};
this.trimAdoPrefix=function(_34){
if(_34.length==46){
return _34;
}else{
if(_34.indexOf("ado-")===0){
return _34.substring(4,50);
}else{
return _34;
}
}
};
this.beginCreative=function(_35){
var tmp=this.elems[ado.resolvId(_35.id,true)];
if(tmp){
tmp.onServerEmission();
}
return tmp;
};
this.beginExternal=function(){
};
this.endExternal=function(){
};
this.refresh=function(id){
var _38=ado.elems[ado.resolvId(id,true)];
if(_38.isMaster()){
ado.master(_38.config);
this.masterSlaves[_38.config.orgId]=[];
for(var i in ado.elems){
if(typeof ado.elems[i]==="object"&&ado.elems[i].config.slave&&ado.elems[i].config.myMaster===_38.config.orgId){
var _3a=ado.elems[i].config;
ado.elems[i].emptyDOMElement();
ado.slave(_3a.orgId,_3a);
}
}
}else{
ado.placement(_38.config);
ado.start();
}
};
this.placement=function(_3b){
if(!_3b.id||!_3b.server){
return;
}
if(!_3b.orgId){
_3b=_26(_3b);
}
var _3c=(ado.mode=="new"&&!ado.windowLoad&&this.isBrowserSupport());
if((ado.mode=="new"&&!ado.windowLoad&&this.isBrowserSupport())||ado.busy){
ado.queue.unshift(function(){
ado.placement(_3b);
});
return;
}
if(ado.previewEnabled["http://"+_3b.server]){
_3b.preview=true;
_3b.server=ado.previewUrl+"?id="+ado.trimAdoPrefix(_3b.orgId);
}
this.elems[_3b.id]=new AdoElement(_3b);
if(!ado.elems[_3b.id].DOMElement){
return;
}
this.elems[_3b.id].preDispatch();
};
this.master=function(_3d){
_3d.master=true;
if((ado.mode=="new"&&!ado.windowLoad&&this.isBrowserSupport())||ado.busy){
ado.queue.unshift(function(){
ado.master(_3d);
});
return;
}
if(!_3d.orgId){
_3d=_26(_3d);
}
if(typeof this.masterSlaves[_3d.orgId]==="undefined"){
this.masterSlaves[_3d.orgId]=[];
}
this.elems[_3d.id]=new AdoElement(_3d);
if(ado.previewEnabled["http://"+_3d.server]){
_3d.preview=true;
_3d.server=ado.previewUrl+"?id="+ado.trimAdoPrefix(_3d.orgId);
}
this.elems[_3d.id].preDispatch();
};
this.slave=function(_3e,_3f){
if(!_3e||typeof _3e!=="string"||_3e===""){
return;
}
if(!_3f||!_3f.myMaster){
return;
}
if(!_3f.id){
_3f.id=_3e;
}
_3f.slave=true;
if((ado.mode=="new"&&!ado.windowLoad&&this.isBrowserSupport())||ado.busy){
ado.queue.unshift(function(){
ado.slave(_3e,_3f);
});
return;
}
if(typeof this.masterSlaves[_3f.myMaster]!=="object"){
this.masterSlaves[_3f.myMaster]=[];
}
this.masterSlaves[_3f.myMaster].push(_3e);
if(!_3f.orgId){
_3f=_26(_3f);
}
this.elems[_3f.id]=new AdoElement(_3f);
this.elems[_3f.id].getDOMElement();
this.elems[_3f.id].emptyDOMElement();
if(ado.mode==="old"||!this.isBrowserSupport()){
document.write("<script type='text/javascript'>if(typeof "+_3f.orgId+"=='function'){"+_3f.orgId+"();}</script>");
if(typeof _3f.onLoad==="function"){
_3f.onLoad();
_3f.onLoad=false;
}
}else{
this.slaveStart(_3f);
}
};
this.slaveStart=function(_40){
eval(_40.orgId);
this.elems[_40.id].buff="<script type=\"text/javascript\">"+_40.orgId+"();</script>";
this.elems[_40.id].begin=false;
this.elems[_40.id].initBuffor();
this.elems[_40.id].dispatch();
};
this.preview=function(_41){
if(_41.enabled===false){
return;
}
_41.server=_41.emiter;
if(_41.preview!==true){
_41.url=ado.protocol+"//"+_41.server+"/_"+(new Date()).getTime()+"/ad.js?id="+_41.id;
}
if(!_41.orgId){
_41=_26(_41);
}
if(ado.mode=="new"&&!ado.windowLoad&&ado.isBrowserSupport()){
ado.queue.unshift(function(){
ado.preview(_41);
});
return;
}
if(ado.mode=="old"){
document.write("<script src=\""+_41.url+"\"></script>");
}else{
this.elems[_41.id]=new AdoElement(_41);
this.elems[_41.id].preDispatch();
}
};
this.turnOnPreview=function(){
for(var i in ado.tmp){
if(typeof ado.previewEnabled[ado.tmp[i]]!=="function"){
ado.previewEnabled[ado.tmp[i]]=true;
}
}
ado.tmp=[];
};
this.turnOffPreview=function(){
for(var i in ado.previewEnabled){
if(typeof ado.previewEnabled[i]!=="function"){
if(ado.previewEnabled[i]){
ado.tmp.push(i);
}
ado.previewEnabled[i]=false;
}
}
};
this.getByTag=function(n,i){
if(!i){
i=0;
}
var _46=ado.getAllByTag(n);
return _46[i];
};
this.getAllByTag=function(n){
var _48=[];
if(document.all){
_48=document.all.tags(n);
}else{
if(document.getElementsByTagName){
_48=document.getElementsByTagName(n);
}else{
if(document.layers){
_48=document.layers[n];
}
}
}
return _48;
};
this.bind=function(_49,_4a,fn){
if(_49.addEventListener){
_49.addEventListener(_4a,fn,false);
}else{
if(_49.attachEvent){
_49.attachEvent("on"+_4a,fn);
}else{
if(document.getElementById){
}
}
}
};
this.isBrowserSupport=function(){
return (document.createElement&&document.appendChild&&document.getElementById)?true:false;
};
this.evaluate=function(_4c){
if(window.execScript){
window.execScript(_4c);
return null;
}
var _4d=globalScope.eval?globalScope.eval(_4c):eval(_4c);
return _4d;
};
this.loadScript=function(url,_4f,_50){
var _51=false;
var _52=document.createElement("script");
var _53=url.indexOf("javascript:");
if(url.indexOf("javascript:")!==-1){
var fn=url.substr(_53);
ado.evaluate(fn);
_4f(this);
return;
}
_52.src=url;
if(typeof _50!=="undefined"&&_50!==null){
_52.charset=_50;
}
_52.onload=_52.onreadystatechange=function(){
if(!_51&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){
_51=true;
_4f(this);
}
};
if(ado.browser.msie&&ado.loadingPreviewSettings){
ado.onDOMReady(function(){
ado.head.appendChild(_52);
});
}else{
ado.head.appendChild(_52);
}
};
this.makeKeywords=function(_55){
var _56=function(_57){
if(typeof na_prof==="string"){
if(_57===""){
_57="/key=";
}else{
_57+=",";
}
_57+=na_prof;
}
return _57;
};
if(typeof _55==="string"){
_55=_55.split(",");
}
var k="";
if(typeof _55==="object"&&_55.length>0){
for(var key in _55){
if(typeof _55[key]==="string"){
if(ado.characterEncoding){
k+=","+_29(_55[key].toLowerCase());
}else{
k+=","+_55[key].toLowerCase();
}
}
}
k="/key="+k.slice(1);
}
k=_56(k);
return k;
};
this.makeVars=function(_5a){
var v="";
if(typeof _5a==="object"){
for(var key in _5a){
if(typeof _5a[key]==="string"||typeof _5a[key]==="number"){
v+="/"+key+"="+_5a[key];
}
}
}else{
if(typeof _5a==="string"){
if(_5a.charAt(0)!=="&"){
_5a="&"+_5a;
}
if(_5a.charAt(_5a.length-1)==="&"){
_5a=_5a.substr(0,_5a.length-1);
}
_5a=_5a.replace("&","/");
while(_5a.indexOf("&")!==-1){
_5a=_5a.replace("&","/");
}
v=_5a;
}
}
return v;
};
this.makeFlash=function(){
var fv="-";
var fo=null;
eval("try { f=(d==top.document)?1:2; if (typeof top.document.referrer==\"string\") { ref=top.document.referrer } } catch(e) {f=3;}");
eval("try { fv=navigator.plugins[\"Shockwave Flash\"].description; } catch (e) {}");
eval("if (typeof ActiveXObject!=\"undefined\") { try { fo=new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.7\"); } catch(e) { try { fo=new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.6\"); fv=\"X\"; fo.AllowScriptAccess=\"always\"; } catch(e) { if (fv==\"X\") { fv=\"WIN 6,0,20,0\"; }} try { fo=new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"); } catch(e) {} } if ((fv==\"-\" || fv==\"X\") && fo) { fv=fo.GetVariable(\"$version\"); }}");
return "/fv="+escape(fv);
};
this.getById=function(id){
return document.getElementById(id);
};
this.onDOMReady=function(_60){
var _61=function(){
var _62=ado.getAllByTag("style");
var _63=ado.getAllByTag("link");
var j=0;
for(var i in _63){
if(_63[i].rel==="stylesheet"){
j++;
}
}
return _62.length+j;
};
function bindReady(){
if(document.addEventListener&&!ado.browser.opera){
document.addEventListener("DOMContentLoaded",_60,false);
ado.windowLoad=true;
return;
}else{
if(ado.browser.msie&&window==top){
(function(){
if(ado.windowLoad){
return;
}
try{
document.documentElement.doScroll("left");
}
catch(error){
setTimeout(arguments.callee,1);
return;
}
_60();
ado.windowLoad=true;
return;
})();
}else{
if(ado.browser.opera){
document.addEventListener("DOMContentLoaded",function(){
if(ado.windowLoad){
return;
}
for(var i=0;i<document.styleSheets.length;i++){
if(document.styleSheets[i].disabled){
setTimeout(arguments.callee,0);
return;
}
}
_60();
ado.windowLoad=true;
return;
},false);
}else{
if(ado.browser.safari){
var _67;
(function(){
if(ado.windowLoad){
return;
}
if(document.readyState!="loaded"&&document.readyState!="complete"){
setTimeout(arguments.callee,0);
return;
}
if(_67===undefined){
_67=_61();
}
if(document.styleSheets.length!=_67){
setTimeout(arguments.callee,0);
return;
}
_60();
ado.windowLoad=true;
return;
})();
}else{
window.onload=_60;
ado.windowLoad=true;
return;
}
}
}
}
}
bindReady();
};
this.closeLivePreview=function(){
window.location=ado.previewDisableUrl+"?url="+encodeURIComponent(encodeURIComponent(window.location.href));
};
this.start=function(){
if(ado.queue.length>0){
var fn=ado.queue.pop();
if(typeof fn==="function"){
fn();
}
}
};
};
if(typeof ado==="undefined"){
ado=new AdoContainer();
if(typeof ado.head==="undefined"){
ado.head=ado.getByTag("head",0);
}
var go=function(){
ado.windowLoad=true;
ado.start();
};
if(window.addEventListener){
window.addEventListener("load",go,true);
}else{
if(window.attachEvent){
window.attachEvent("onload",go);
}else{
if(document.getElementById){
window.onload=go;
}
}
}
}
var globalScope=this;


