 var VAD={debug:false, model:'normal',merge:false,queue:[], event:[],Areas:[],Advert:[],anchor:"vad_$key_$id",advert:"adv_$key_$id",preview:"",second:60,visits:10,flash:true,$:function(o){return document.getElementById(o);},write:function(i){document.write(i);},$V:function(i){document.write(i);},adPoint:function(key){var pos=VAD.position(key);var left=pos.left+20;var top=pos.top+20;var a=document.createElement("a");a.href=VAD.API+"?action=order&do=add&key="+key.replace("vad_","");var s=document.createElement("img");s.src=VAD.API+"source/buy.png";s.style.left=left+'px';s.style.top=top+'px';s.style.position='absolute';s.style.border="none";a.appendChild(s);document.body.appendChild(a);}, position:function(obj){var width=obj.offsetWidth;var height=obj.offsetHeight;var attr=obj.attributes;var top=obj.offsetTop;var left=obj.offsetLeft;while(obj=obj.offsetParent){top+=obj.offsetTop;left+=obj.offsetLeft;};return{width:width,height:height,top:top,left:left,attr:attr};},getHost:function(url){if(typeof url=="undefined"||null==url)url=window.location.href;var host=null;var regex=/.*\:\/\/([^\/]*).*/;var match=url.match(regex);if(typeof match!="undefined"&&null!=match)host=match[1];return host?host:'';},remove:function(obj){obj.parentNode.removeChild(obj);},getCookie:function(key){var str="";var arr=document.cookie.replace(/%25/g,"%").replace(/%5F/g,"_").match(new RegExp("(^| )"+key+"=([^;]*)(;|$)"));if(arr!=null){try{str=decodeURIComponent(arr[2]);}catch(e){str=arr[2];}};return str;},setCookie:function(key,value,second,domain){var cookies=key.replace("_","%5F")+"="+encodeURIComponent(value)+"; ";if(second){var expire=new Date();expire.setTime(expire.getTime()+parseInt(second*1000));cookies+="expires="+expire.toUTCString()+"; ";};if(domain){cookies+="domain="+domain+"; ";};cookies+="path=/;";document.cookie=cookies;},getDoc:function(){return(document.documentElement&&document.documentElement.clientWidth)?document.documentElement:document.body;},getScript:function(){var tag=document.getElementsByTagName("script");var ele=tag[tag.length-1];return ele;},detectFlash:function(){if(navigator.mimeTypes.length>0){if(navigator.mimeTypes["application/x-shockwave-flash"]){return navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin!=null;}else{return false;}}else if(window.ActiveXObject){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true;}catch(oError){return false;}}else{return false;}},inArray:function(a,v){var l=a.length;for(var i=0;i<=l;i++){if(a[i]==v)return true;};return false;},strTrim:function(s){return s.replace(/(^\s*)|(\s*$)/g,"");}, addProxy:function(key,option){option=option?option:[];   if(VAD.merge&&option['merge']!=false){var ele=VAD.getScript();VAD.queue[key]=ele;}else{VAD.write('<script type="text/javascript" src="'+VAD.API+'?action=proxy&key='+key+'&charset='+option['charset']+'"></script>');}}, adClose:function(key,id){var id=VAD.advert.replace("$key",key).replace("$id",id);var obj=VAD.$(id);VAD.remove(obj);var cfg=VAD.Areas[key]["config"];var cfg=cfg?cfg:{};if(cfg["SMART-MEMORY"]){VAD.setCookie(id,cfg["SMART-MEMORY"]);}},addEvent:function(obj,type,fn){if(obj.attachEvent){obj['e'+type+fn]=fn;obj[type+fn]=function(){obj['e'+type+fn](window.event);};obj.attachEvent('on'+type,obj[type+fn]);}else
obj.addEventListener(type,fn,false);},removeEvent:function(obj,type,fn){if(obj.detachEvent){obj.detachEvent('on'+type,obj[type+fn]);obj[type+fn]=null;}else
obj.removeEventListener(type,fn,false);}, addIframe:function(url,time){var time=time?time:0;window.setTimeout(function(){var ele=VAD.append('img',{'src':url},{'width':'0px','height':'0px','border':'none'});ele.onload=function(){this.parentNode.removeChild(this);}},time*1000);},reader:function(func){var old=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){old();func();}}}, append:function(tag,attr,style){var ele=document.createElement(tag);for(var key in attr){ele.setAttribute(key,attr[key]);};for(var key in style){ele.style[key]=style[key];};document.body.appendChild(ele);return ele;},Time:function(){return new Date().getTime();},Init:function(){VAD.flash=VAD.detectFlash();var ele=VAD.getScript();var path=ele.getAttribute('src');var base=path.substring(0,path.lastIndexOf("/")+1);VAD.API=base?base:'./';VAD.domain=VAD.host=location.host;if(VAD.host.indexOf(".")>0){var host=VAD.host.split(".");VAD.domain=host[host.length-2]+"."+host[host.length-1];}
VAD.reader(function(){var reg=/#vad_([\S]+?)$/ig;if(reg.test(location.hash)){var key=location.hash.substr(1);VAD.adPoint(key);}});}};VAD.adStatis=function(){var vlist=[];var elist=[];for(var k in VAD.Advert){for(var v in VAD.Advert[k]){if(!VAD.Advert[k][v]['spare']&&VAD.Time()>(VAD.Advert[k][v]['expire']*1000)){elist.push(VAD.Advert[k][v].id);}else{vlist.push(VAD.Advert[k][v].id);}}}
elist.length&&VAD.addIframe(VAD.API+"?action=expire&id="+elist.join(','),VAD.visits);vlist.length&&VAD.addIframe(VAD.API+"?action=view&id="+vlist.join(','),VAD.visits);};VAD.adShow=function(){if(VAD.merge){var parm=[];for(var key in VAD.queue){parm.push(key);}
if(parm.length){VAD.append('script',{'type':'text/javascript','src':VAD.API+'?action=proxy&key='+parm.toString()+'&charset='});}
VAD.event['done']&&VAD.event['done']();}else{VAD.adStatis();}
VAD.event['load']&&VAD.event['load']();};VAD.Init();VAD.addEvent(window,'load',VAD.adShow); VAD.adLoad=function(area){this.Key=area["key"];this.Ads=[];VAD.Areas[this.Key]=area;VAD.Advert[this.Key]=[]; this.adCheck=function(datetime){for(var i=0;i<datetime.length;i++){if(VAD.Time()/1000>=datetime[i]){VAD.addIframe(VAD.API+"?action=flush&key="+this.Key+"&rnd="+Math.random(),5);break;}}}
this.adAdd=function(advert){VAD.Advert[this.Key].push(advert);advert["source"]=advert["link"];var sid=VAD.advert.replace("$key",this.Key).replace("$id",advert["id"]);if(VAD.Areas[this.Key]["config"]&&VAD.Areas[this.Key]["config"]["SMART-MEMORY"]&&VAD.getCookie(sid)){return;}
if(advert["link"]&&advert["config"]['STAT-CLICK']=='Y'){advert["link"]=VAD.API+"?action=click&area="+this.Key+"&id="+advert["id"]+"&url="+encodeURIComponent(advert["link"])+"&variable="+(this.variable?encodeURIComponent(this.variable):'')+"&source="+encodeURIComponent(location.href);}
if(advert["config"]['SHOW-SPACE']&&advert["config"]['SHOW-SPACE']>0){var sid="S"+advert["id"];var val=VAD.getCookie(sid);var now=(VAD.Time()/1000/3600);if(val&&(now-val<=advert["config"]['SHOW-SPACE'])){return false;}else{VAD.setCookie(sid,now,(advert["config"]['SHOW-SPACE']*3600),"");}}
 var html='';var rand=Math.random()*100;if(advert["config"]&&advert["config"]["VIRTUAL-VIEWS"]&&rand<=advert["config"]["VIRTUAL-VIEWS-RADIX"]){VAD.append('img',{'src':advert["config"]["VIRTUAL-VIEWS"]},{'display':'none'});}
var rand=Math.random()*100;if(advert["config"]&&advert["config"]["VIRTUAL-CLICK"]&&rand<=advert["config"]["VIRTUAL-CLICK-RADIX"]){VAD.append('iframe',{'width':'0','height':'0','frameborder':'0','name':'virtual_iframe_'+advert["id"]},{'display':'none'});VAD.append('a',{'id':'virtual_url_'+advert["id"],'target':'virtual_iframe_'+advert["id"],'href':advert["config"]["VIRTUAL-CLICK"]},{'display':'none'});var obj=VAD.$("virtual_url_"+advert["id"]);if(document.all){obj.click();}else{var evt=document.createEvent("MouseEvents");evt.initEvent("click",true,true);obj.dispatchEvent(evt);}}
var len=this.Ads.length;this.Ads["ad_"+advert["id"]]=advert;this.Ads[len]=this.Ads["ad_"+advert["id"]];}
 this.getPart=function(option){var elid=VAD.anchor.replace(/\$key/ig,this.Key).replace(/\$id/ig,option['id']);var stag='<a href="'+option["link"]+'" target="'+option["config"]['LINK-TARGET']+'" name="'+elid+'" id="'+elid+'">';var etag='</a>';var code='';if(/\.swf$/i.test(option["file"])){if(VAD.flash==false){code='<iframe src="'+VAD.API+'compat.html?width='+option["width"]+'&height='+option["height"]+'&target='+option["config"]['LINK-TARGET']+'&title='+escape(option["name"])+'&link='+encodeURIComponent(option["link"])+'&source='+encodeURIComponent(option["source"])+'&host='+VAD.getHost(option["source"])+'" scrolling="no" frameborder="0" allowtransparency="true" width="'+option["width"]+'" height="'+option["height"]+'" style="overflow:hidden; '+option["config"]['SHOW-STYLE']+'" id="'+VAD.anchor+'"></iframe>';}else{if(option["link"]){code='<iframe src="'+VAD.API+'flash.html?flash='+encodeURIComponent(option["file"])+'&width='+option["width"]+'&height='+option["height"]+'&target='+option["config"]['LINK-TARGET']+'&title='+escape(option["name"])+'&link='+encodeURIComponent(option["link"])+'" scrolling="no" frameborder="0" allowtransparency="true" width="'+option["width"]+'" height="'+option["height"]+'" style="overflow:hidden; '+option["config"]['SHOW-STYLE']+'" id="'+VAD.anchor+'"></iframe>';}else{code='<embed src="'+option["file"]+'" quality="high" width="'+option["width"]+'" height="'+option["height"]+'" style="margin:0; paading:0; border:0; '+option["config"]['SHOW-STYLE']+'" scale="exactfit" AllowScriptAccess="always" AllowNetworking="all" wmode="opaque" type="application/x-shockwave-flash"></embed>';}}}else{if(option["file"]){code='<img src="'+option["file"]+'" alt="'+option["name"]+'" width="'+option["width"]+'" height="'+option["height"]+'" style="'+option["config"]['SHOW-STYLE']+'" />';}else{code='<span style="'+option["config"]['SHOW-STYLE']+'">'+option["name"]+'</span>';};if(option["link"]){code=stag+code+etag;}}
return code;}
this.adCreate=function(index){var ads=this.Ads[index];if(ads["form"]){return'';}
var channel=VAD.Areas[this.Key];var config=channel["config"]?channel["config"]:{};if(channel["tag"]){return'<'+channel["tag"]+' class="'+(config["TAG-CLASS"]?config["TAG-CLASS"]:'')+' ad-'+index+'-class">'+this.getPart(ads)+'</'+channel["tag"]+'>';}else{return this.getPart(ads);}}
 this.adMove=function(obj,top){var self=this;var inti=null;if(obj){obj.style.top=VAD.getDoc().scrollTop+parseInt(top)+"px";inti=window.setTimeout(function(){self.adMove(obj,top);},1);}else{clearInterval(inti);}}
 this.adBotton=function(key,id,align){return'<img src="'+VAD.API+'source/close.gif" alt="CLOSE" onclick="VAD.adClose(\''+key+'\',\''+id+'\');" align="'+align+'" style="cursor:pointer;" />';};this.getId=function(id){return VAD.advert.replace('$key',this.Key).replace('$id',id);}
this.adInsert=function(){var channel=VAD.Areas[this.Key];var config=channel["config"]?channel["config"]:{};var html='<var id="ad-'+this.Key+'-anchor" type="hidden"></var>';var data=[];if(this.Ads.length<1||channel["number"]==0){if(VAD.debug){for(var i=0;i<channel["number"];i++){var img='<div style="display:inline-block; background:#ccc; color:#fff; width:'+channel["width"]+'px; height:'+channel["height"]+'px; line-height:'+channel["height"]+'px; text-align:center; font-family:Verdana;">'+this.Key+' - '+channel["width"]+'*'+channel["height"]+'</div>';if(channel["tag"]){html+='<'+channel["tag"]+' class="'+(config["TAG-CLASS"]?config["TAG-CLASS"]:'')+' ad-'+i+'-class">'+img+'</'+channel["tag"]+'>';}else{html+=img;}}
if(VAD.merge&&VAD.queue[this.Key]){VAD.queue[this.Key].outerHTML=html;}else{VAD.write(html);}};return;}
 var self=this;var doc=VAD.getDoc();switch(VAD.model){case"iframe":if(VAD.inArray([3,5,6,8,10,11],channel["show"])){channel["show"]=1;};break;case"single":break;}
if(VAD.flash==false&&channel["show"]==9){channel["show"]=12;}
if(!config["SHOW-SPEED"])config["SHOW-SPEED"]=5;if(!config["SHOW-TWEEN"])config["SHOW-TWEEN"]=1;if(config["SHOW-RANDOM"]){this.Ads.sort(function(){return Math.random()>0.5?-1:1;});}
switch(channel["show"]){case 1:for(var i=0;i<this.Ads.length;i++){html+=this.adCreate(i);if(i==channel["number"]-1)break;};break;case 2:html+=this.adCreate(parseInt(Math.random()*this.Ads.length));break;case 3:if(config["SCREEN-X"]&&config["SCREEN-X"]>screen.width)return;for(var i=0;i<this.Ads.length;i++){var dir=(i%2==0)?'left':'right';var gap=config["STYLE-GAP"]!=''?config["STYLE-GAP"]:20;var top=config["STYLE-TOP"]!=''?config["STYLE-TOP"]:150;var id=this.getId(this.Ads[i]["id"]);var btn=this.adBotton(this.Key,this.Ads[i]["id"],dir);html+='<div id="'+id+'" style=" '+(config["SCREEN-ROLL"]=="Y"?'position:fixed!important;':'')+' position:absolute;'+dir+':'+gap+'px;top:'+top+'px;width:'+channel["width"]+'px;">'+this.adCreate(i)+(config["SHOW-CLOSE"]?btn:'')+'</div>';data[id]={'gap':gap,'top':top};if(i==channel["number"]-1)break;};break;case 4:config="COLOR-BORDER"in config?config:{"COLOR-BORDER":"#CCCCCC","COLOR-TITLE":"#1111CC","COLOR-BG":"#FFF","COLOR-TEXT":"#000000","COLOR-LINK":"#008000"};var rnd=parseInt(Math.random()*10000);html+='<style type="text/css">';html+='#box-'+rnd+'{ width:'+(channel["width"]?channel["width"]:'')+'px; height:'+(channel["height"]?channel["height"]:'')+'px; overflow:hidden; border:'+config["COLOR-BORDER"]+' solid 1px; background:'+config["COLOR-BG"]+'; font-size:12px; font-family:arial;}';html+='#box-'+rnd+' td{ padding:8px; margin:0; line-height:19px; text-align:left;}';html+='#box-'+rnd+' a,#box-'+rnd+' a:link,#box-'+rnd+' a:visited{ cursor:pointer; text-decoration:none; color:'+config["COLOR-TITLE"]+'; }';html+='#box-'+rnd+' .ads-name{ color:'+config["COLOR-TITLE"]+'; font-size:15px; text-decoration:underline; display:inline-block;}';html+='#box-'+rnd+' .ads-name:hover{ text-decoration:none;}';html+='#box-'+rnd+' .ads-text{ color:'+config["COLOR-TEXT"]+'; display:inline-block;}';html+='#box-'+rnd+' .ads-link{ color:'+config["COLOR-LINK"]+'; display:inline-block;}';html+='#box-'+rnd+' .ads-logo{  position:relative; float:right;}';html+='#box-'+rnd+' .ads-logo img{ border:none; display: block;}';html+='</style>';html+='<div id="box-'+rnd+'">';html+='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';var brk=parseInt(config["SHOW-BREAK"])||this.Ads.length||parseInt(channel["number"]);var wid=Math.floor(100/brk)+'%';for(var i=0;i<this.Ads.length;i++){html+='<td valign="top" width="'+wid+'"><a href="'+this.Ads[i]["link"]+'" target="'+this.Ads[i]["target"]+'"><span class="ads-name">'+this.Ads[i]["name"]+'</span><br /><span class="ads-text">'+this.Ads[i]["tags"]+'</span><br /><span class="ads-link">'+VAD.getHost(this.Ads[i]["source"])+'</span></a></td>';if((i+1)%config["SHOW-BREAK"]==0||(i+1)==this.Ads.length){html+='</tr>';};if(i==channel["number"]-1)break;};html+='</tr></table>';html+='<a href="http://www.veryide.com/" target="_blank" class="ads-logo"><img src="'+VAD.API+'source/logo.png" alt="Powered By VeryIDE" /></a>';html+='</div>';break;case 5:break;case 6:for(var i=0;i<this.Ads.length;i++){switch(config["OPEN-TIME"]){case"unload":window.onbeforeunload=function(){window.open(this.Ads[i]["link"],"");};break;case"load":default:window.open(this.Ads[i]["link"],"");break;};if(i==channel["number"]-1)break;};break;case 7:for(var i=0;i<this.Ads.length;i++){html+='<iframe src="'+this.Ads[i]["link"]+'" scrolling="no" frameborder="0" width="'+this.Ads[i]["width"]+'" height="'+this.Ads[i]["height"]+'" style="'+this.Ads[i]["style"]+'"></iframe>';if(i==channel["number"]-1)break;};break;case 8:for(var i=0;i<this.Ads.length;i++){var id=this.getId(this.Ads[i]["id"]);html+='<div id="'+id+'" style="width:'+this.Ads[i]["width"]+'px; height:0px;overflow:hidden;">'+this.adCreate(i)+'</div>';if(i==channel["number"]-1)break;};break;case 9:var _files='';var _links='';var _texts='';var _width=channel["width"];var _height=channel["height"];for(var i=0;i<this.Ads.length;i++){if(_width||_height){_width=this.Ads[i]["width"];_height=this.Ads[i]["height"];};_files+=this.Ads[i]["file"];_links+=this.Ads[i]["link"];_texts+=this.Ads[i]["name"];if(i==channel["number"]-1||i==this.Ads.length-1){break;}else{_files+='|';_links+='|';_texts+='|';}}
if(config["SHOW-TITLE"]=="-1"||typeof config["SHOW-TITLE"]=='undefined'){_texts="";config["SHOW-TITLE"]=2;}
 html+='<embed src="'+VAD.API+'source/bcastr31.swf" wmode="opaque" AllowScriptAccess="always" AllowNetworking="all" FlashVars="bcastr_file='+_files+'&bcastr_link='+encodeURIComponent(_links)+'&bcastr_title='+_texts+'&bcastr_config=0xFFFFFF|'+config["SHOW-TITLE"]+'|0xFF6600|'+config["SHOW-OPACITY"]+'|0xFFFFFF|0xFF8040|0x000033|'+config["SHOW-SPEED"]+'|'+config["SHOW-TWEEN"]+'|'+(config["SHOW-BUTTON"]?'1':'0')+'|_blank" menu="false" quality="high" width="'+_width+'" height="'+_height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';break;case 10:for(var i=0;i<this.Ads.length;i++){var BT=BB=this.adBotton(this.Key,this.Ads[i]["id"]);if(config["POSITION-Y"]=="top"){BT="";BB+="<br />";}else{BT=BT+"<br />";BB="";};if(config["SHOW-CLOSE"]!="Y"){BT=BB='';};var id=this.getId(this.Ads[i]["id"]);html+='<div id="'+id+'" style="text-align:'+config["POSITION-X"]+';width:'+this.Ads[i]["width"]+'px; position:absolute; z-index:999;">'+BT+this.adCreate(i)+BB+'</div>';data[id]={}
if(i==channel["number"]-1)break;};break;case 11:for(var i=0;i<this.Ads.length;i++){var id=this.getId(this.Ads[i]["id"]);html+='<div id="'+id+'" class="'+(config["TAG-CLASS"]?config["TAG-CLASS"]:'')+'" style="width:'+this.Ads[i]["width"]+'px; height:'+this.Ads[i]["height"]+'px; position:absolute;">'+this.adCreate(i)+'</div>';};break;case 12:var arr=[];var inter=null;var eve=false;var inti=0;if(config["SHOW-EFFECT"])html+='<div id="rotate-ads-'+channel["key"]+'" style="filter:revealTrans(duration=1,transition=20)">';for(var i=0;i<this.Ads.length;i++){html+='<div id="rotate-ads-'+this.Ads[i]["id"]+'" style="clear:both; overflow:hidden;">'+this.adCreate(i)+'</div>';arr.push(this.Ads[i]["id"]);if(i==channel["number"]-1)break;}
if(config["SHOW-EFFECT"])html+='</div>';break;case 13:var f=function(s){return s.replace(/(\*|\\|\-|\||\[|\])/ig,'\\$1');};for(var i=0;i<this.Ads.length;i++){var tmp=config["SHOW-TEMPLATE"];if(!tmp)break;var cfg=this.Ads[i]["config"];for(var x in cfg){if(x&&cfg[x])tmp=tmp.replace(new RegExp('\{'+f(x)+'\}','gim'),cfg[x]);};html+=tmp;if(i==channel["number"]-1)break;};break;}
 if(VAD.merge&&VAD.queue[this.Key]){VAD.queue[this.Key].outerHTML=html;}else{VAD.write(html);}
VAD.event['zone']&&VAD.event['zone'](this.Key,html);switch(channel["show"]){case 3:for(var id in data){if(config["SCREEN-ROLL"]=="Y"&&(!!window.ActiveXObject&&!window.XMLHttpRequest)){this.adMove(VAD.$(id),data[id].top);}};break;case 8:for(var i=0;i<this.Ads.length;i++){(function(){var ad=self.Ads[i];var ADO=VAD.$(self.getId(ad["id"]));var time=500;var h=0;if(config["SHOW-ENTER"]=='slow'){var inter=window.setInterval(function(){if(time>0){time--;h+=15;}else{clearInterval(inter);return;};ADO.style.display="";ADO.style.height=(h>ad["height"]?ad["height"]:h)+"px";if(h>=ad["height"]){clearInterval(inter);return;}},10);}else{ADO.style.display="";ADO.style.height="auto";}
var endfun=function(){if(ad["config"]["THUMB-FILE"]){ADO.innerHTML=self.getPart({'file':ad["config"]["THUMB-FILE"],'link':ad["link"],'width':ad["config"]["THUMB-WIDTH"],'height':ad["config"]["THUMB-HEIGHT"],'config':{'LINK-TARGET':ad["config"]["LINK-TARGET"]}});ADO.style.height="auto";}else{VAD.remove(ADO);}}
window.setTimeout(function(){clearInterval(inter);if(config["SHOW-OUTLET"]=='slow'){var N=ad["height"];var inter=window.setInterval(function(){if(N>1){N-=8;N=(N<=1?1:N);ADO.style.height=N+"px";}else{clearInterval(inter);endfun();return;}},30);}else{endfun();}},(1000*ad["config"]["SHOW-TIME"]));})();if(i==channel["number"]-1)break;};break;case 10:for(var i=0;i<this.Ads.length;i++){(function(){var ad=self.Ads[i];var ADO=VAD.$(self.getId(ad["id"]));var N=0;var inti=window.setInterval(function(){if(N<100){N+=10;ADO.style.filter="alpha(opacity="+N+");";ADO.style.mozOpacity=(N/100);ADO.style.opacity=(N/100);}else{clearInterval(inti);return;}},50);var inter=window.setInterval(function(){switch(config["POSITION-X"]){case"left":ADO.style.left="0px";break;case"center":ADO.style.left=((doc.scrollLeft+doc.offsetWidth-ad["width"])/2)+"px";break;case"right":ADO.style.right="0px";break;};switch(config["POSITION-Y"]){case"top":ADO.style.top=doc.scrollTop+"px";break;case"center":ADO.style.top=(doc.scrollTop+(doc.clientHeight-ad["height"])/2) + "px";
break;case"bottom":ADO.style.top=(doc.scrollTop+(doc.clientHeight-ad["height"]-(config["SHOW-CLOSE"]?16:0)))+"px";break;}},10);if(config["SHOW-CLOSE"]!="Y"){window.setTimeout(function(){var N=100;clearInterval(inter);var inter=window.setInterval(function(){if(N>0){N-=15;ADO.style.filter="alpha(opacity="+N+");";ADO.style.mozOpacity=(N/100);ADO.style.opacity=(N/100);}else{VAD.remove(ADO);clearInterval(inter);return;}},50);},(1000*ad["config"]["SHOW-TIME"]));}})();if(i==channel["number"]-1)break;};break;case 11:for(var i=0;i<this.Ads.length;i++){(function(){var ad=self.Ads[i];var ADO=VAD.$(self.getId(ad["id"]));var x=parseInt(Math.random()*doc.offsetWidth)-ad["width"];var y=parseInt(Math.random()*doc.offsetHeight)-ad["height"];var xin=true;var yin=true;var step=1;var delay=1;var obj=ADO;var func=function(){var L=0;var T=window.navigator.userAgent.indexOf("Chrome")!==-1?Math.max(document.documentElement.scrollTop,document.body.scrollTop):0;var R=doc.clientWidth-ADO.offsetWidth;var B=T+doc.clientHeight-ADO.offsetHeight;ADO.style.left=x+doc.scrollLeft+'px';ADO.style.top=y+doc.scrollTop+'px';x=x+step*(xin?1:-1);if(x<L){xin=true;x=L;};if(x>R){xin=false;x=R;};y=y+step*(yin?1:-1);if(y<T){yin=true;y=T;};if(y>B){yin=false;y=B;};ADO.onmouseover=function(){clearInterval(inti)};ADO.onmouseout=function(){inti=setInterval(func,delay);}};var inti=window.setInterval(func,delay);})();};break;case 12:for(var i=0;i<this.Ads.length;i++){(function(){var obj=VAD.$('rotate-ads-'+self.Ads[i]["id"]);obj.onmouseover=function(){eve=true;};obj.onmouseout=function(){eve=false;}})();if(i==channel["number"]-1)break;}
var FX=function(index){if(arr.length<=1)return;if(config["SHOW-EFFECT"]&&document.body.filters){var box=VAD.$('rotate-ads-'+channel["key"]);box.filters.revealTrans.Transition=Math.floor(Math.random()*23);box.filters.revealTrans.apply();box.filters.revealTrans.play();};for(var i=0;i<arr.length;i++){VAD.$('rotate-ads-'+arr[i]).style.display=(i==index)?"":"none";}};var inter=window.setInterval(function(){if(!eve){inti=inti+1>=arr.length?0:inti+1;FX(inti);}},config["SHOW-SPEED"]*1000);FX(inti);break;}}};if(typeof HTMLElement!=="undefined"&&!("outerHTML"in HTMLElement.prototype)){HTMLElement.prototype.__defineGetter__("outerHTML",function(){var a=this.attributes,str="<"+this.tagName,i=0;for(;i<a.length;i++)if(a[i].specified)str+=" "+a[i].name+'="'+a[i].value+'"';if(!this.canHaveChildren)return str+" />";return str+">"+this.innerHTML+"</"+this.tagName+">";});HTMLElement.prototype.__defineSetter__("outerHTML",function(s){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(s);this.parentNode.replaceChild(df,this);return s;});HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){return!/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(this.tagName.toLowerCase());});};
