var msg=new Array('\u6d4f\u89c8\u65e0\u6548\uff0c\u8bf7\u5237\u65b0\u7f51\u9875\u540e\u7ee7\u7eed\u6d4f\u89c8\uff01','\u540c\u4e00\u65f6\u95f4\u4e0d\u53ef\u4ee5\u6d4f\u89c8\u591a\u4e2a\u7f51\u9875\uff01','\u6d4f\u89c8\u5b8c\u6210\uff01','\u6b63\u5728\u6253\u5f00\u7f51\u9875\uff0e\uff0e\uff0e');var cs=new Array(4);var st=0;var waitt=5;var flag=1;var bIsCatchFlyBar=false;var dragClickX=0;var dragClickY=0;var nInterval;var isStartSurf=0;var location="";function killErrors(){return true;}window.onerror=killErrors;function HideFlyBar(){divFlyBar.style.visibility="hidden";}function openFlyBar(){myload_flybar();divFlyBar.style.visibility="visible";}function catchFlyBar(e){bIsCatchFlyBar=true;var x=event.x+document.body.scrollLeft;var y=event.y+document.body.scrollTop;dragClickX=x-divFlyBar.style.pixelLeft;dragClickY=y-divFlyBar.style.pixelTop;divFlyBar.setCapture();document.onmousemove=moveFlyBar;}function releaseFlyBar(e){bIsCatchFlyBar=false;divFlyBar.releaseCapture();document.onmousemove=null;}function moveFlyBar(e){if(bIsCatchFlyBar){divFlyBar.style.left=event.x+document.body.scrollLeft-dragClickX;divFlyBar.style.top=event.y+document.body.scrollTop-dragClickY;}}function myload_flybar(){divFlyBar.style.top=event.y+document.body.scrollTop+20;divFlyBar.style.left=event.x+document.body.scrollLeft+20;}function getPass(len){var tmpCh="";for(var i=0;i<len;i++){tmpCh+=String.fromCharCode(Math.floor(Math.random()*26)+"a".charCodeAt(0));}return tmpCh;}function StartSurf(){win=window.open(cs[1],"ViewAds"+getPass(10),"width="+(screen.availWidth-8)+",height="+(screen.availHeight-60)+",top=0,left=0,location=1,toolbar=1,directories=1,menubar=1,scrollbars=1,resizable=1,status=1");nInterval=setInterval("SurfGo()",cs[2]*1000);CmdStart.style.display="none";time_wait.style.display="";isStartSurf=1;gocl();}function SurfStop(){st=cs[0];window.clearInterval(nInterval);isStartSurf=0;CmdStart.style.display="";time_wait.style.display="none";viewok.style.display="none";win.close();flag=1;}function SurfGo(){if(win.closed==true){SurfStop();}else{window.clearInterval(nInterval);isStartSurf=0;CmdStart.style.display="none";time_wait.style.display="none";viewok.style.display="";mess.innerHTML=msg[2];document.getElementById("view_done").src='dianjiview%2Easp?i='+cs[3]+'&mm=1';cs[0]=0;cs[1]='';cs[2]=0;cs[3]=0;st=0;flag=1;}}function gocl(){if(win.closed==true){SurfStop();}else{win.focus();}if(isStartSurf==0){return false;}else{st=st-1;document.value=st;if(st>cs[0]){viewok.style.display="";mess.innerHTML=msg[3];document.all('timer').innerHTML=cs[0];}else{viewok.style.display="none";document.all('timer').innerHTML=st;}setTimeout("gocl()",1000);}}function work(url,miao,id){openFlyBar();if(url==''||isNaN(miao)||isNaN(id)){alert(msg[0]);return false;}if(flag!==1){alert(msg[1]);return false;}cs[0]=miao;cs[1]=url;cs[2]=miao+waitt;cs[3]=id;st=miao+waitt;flag=0;CmdStart.style.display="none";time_wait.style.display="none";viewok.style.display="none";window.onresize=myload_flybar;window.onscroll=myload_flybar;StartSurf();}function workclick(id){openFlyBar();document.getElementById("clickok").src='ddadview%2Easp?id='+id;}function openad(url){win=window.open(url,'ViewAds','width='+(screen.availWidth-8)+',height='+(screen.availHeight-60)+',top=0,left=0,location=1,toolbar=0,directories=1,menubar=0,scrollbars=1,resizable=1,status=0');}function closead(){win.close();}