var result;var data=new Array();[$InitDataArray$]function SelectAd(){var sum=[$CountSum$];var weight=new Array();[$InitWeightArray$]var m=0;var rndNum=Math.random()*sum;for(var i=0;i<=weight.length;i++){m+=weight[i];if(m>=rndNum){result=data[i];break;};if(i==weight.lengh){i=0;}}};SelectType([$SelectType$]);function SelectType(type){SelectAd();switch(type){case 1:Banner();break;case 2:Double();break;case 3:Scroll();break;case 4:RndFloat();break;case 5:Matrix([$Per$],data.length);break;}};function Banner(){document.write('<div id="Push_BannerAdLayer_[$LayerId$]" style="width:[$LayerWidth$]px; height:[$LayerHeight$]px;clear:both;overflow: hidden;" >'+result+'</div>');};function Scroll(){document.write('<div id="Push_ScrollLayer_[$LayerId$]" style="position:absolute;z-index:1000;">'+result+'</div>');var obj=document.getElementById("Push_ScrollLayer_[$LayerId$]");this.MoveLayer=function(){obj.style.top=document.body.scrollTop+obj.offsetHeight;obj.style.left=document.body.scrollLeft+obj.offsetWidth;};window.onscroll=this.MoveLayer;};function Double(){document.write('<div id="Push_DoubleLayer_[$LayerId$]_1" style="left:22px;position:absolute;top:69px;">'+result+'<br><a href="#" onclick="Close();"><img border="0" src="[$CloseImgPath$]" /></a></div>');document.write('<div id="Push_DoubleLayer_[$LayerId$]_2" style="right:22px;position:absolute;top:69px;">'+result+'<br><a href="#" onclick="Close();"><img border="0" src="[$CloseImgPath$]" /></a></div>');var obj1=document.getElementById('Push_DoubleLayer_[$LayerId$]_1');var obj2=document.getElementById('Push_DoubleLayer_[$LayerId$]_2');this.Close=function(){obj1.style.display='none';obj2.style.display='none';};var lastScrollY=0;this.Show=function(){var diffY;if(document.documentElement&&document.documentElement.scrollTop){diffY=document.documentElement.scrollTop;}else if(document.body){diffY=document.body.scrollTop;};var percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);obj1.style.top=parseInt(obj1.style.top)+percent+"px";obj2.style.top=parseInt(obj2.style.top)+percent+"px";lastScrollY=lastScrollY+percent;};window.setInterval("this.Show()",1);};function RndFloat(){document.write('<div id="Push_FloatLayer_[$LayerId$]" style="position:absolute;z-index:1000;visibility: visible;">'+result+'</div>');var initXPos=Math.random()*document.body.clientWidth;var initYPos=Math.random()*document.body.clientHeight;var step=2;var delay=10;var clientHeight=0;var clientWidth=0;var objHeight=0;var objWidth=0;var curYPos=0;var curXPos=0;var pause=true;var interval;var obj=document.getElementById("Push_FloatLayer_[$LayerId$]");obj.style.top=initYPos;this.changePos=function(){clientWidth=document.body.clientWidth;clientHeight=document.body.clientHeight;objHeight=obj.offsetHeight;objWidth=obj.offsetWidth;obj.style.left=initXPos+document.body.scrollLeft;obj.style.top=initYPos+document.body.scrollTop;if(curYPos){initYPos=initYPos+step;}else{initYPos=initYPos-step;};if(initYPos<0){curYPos=1;initYPos=0;};if(initYPos>=(clientHeight-objHeight)){curYPos=0;initYPos=(clientHeight-objHeight);};if(curXPos){initXPos=initXPos+step;}else{initXPos=initXPos-step;};if(initXPos<0){curXPos=1;initXPos=0;};if(initXPos>=(clientWidth-objWidth)){curXPos=0;initXPos=(clientWidth-objWidth);}};this.start=function(){obj.visibility="visible";interval=setInterval("this.changePos()",delay);};this.pause_resume=function(){if(pause){clearInterval(interval);pause=false;}else{interval=setInterval("this.changePos()",delay);pause=true;}};obj.onmouseover=this.pause_resume;obj.onmouseout=this.pause_resume;window.onload=this.start;};function Matrix(per,sum){for(var i=0;i<sum;i++){document.write(data[i]);if(i==per||per==0){document.write("<br />");}}}
