var lastScrollY=0;     
function heartBeat(){    
var diffY;     
if (document.documentElement && document.documentElement.scrollTop)     
    diffY = document.documentElement.scrollTop;     
else if (document.body)     
    diffY = document.body.scrollTop     
else     
    {/*Netscape stuff*/}     
         
percent=.1*(diffY-lastScrollY);      
if(percent>0)percent=Math.ceil(percent);      
else percent=Math.floor(percent);      
document.getElementById("adleft").style.top=parseInt(document.getElementById("adleft").style.top)+percent+"px";   
document.getElementById("adright").style.top=parseInt(document.getElementById("adright").style.top)+percent+"px";     
lastScrollY=lastScrollY+percent;      
}     
   
function adhide(names){document.getElementById(names).style.display='none';}    
function screencl(names){if(screen.width<=800){adhide(names);}}    
zcode="<div id='adleft' style='left:15px;position: absolute;z-index:1;top:80px;'><div style='width:90px;height:270px;background:#ccc;border:#999 solid 1px;'><a href='http://www.66163.com/zt/ymbl' target='_blank'> <img src='http://www.66163.com/upload_pic/201111/201111021513266052.jpg' width='90' height='270' border='0' /></a></div><div align='right' style='background:#fff;font-size:0px;'>¡¡<img src='http://www.66163.com/lj_img/close.gif' title='¹Ø±Õ' onclick=adhide('adleft') style='cursor:pointer'></div></div>"; 
ycode="<div id='adright' style='right:15px;position: absolute;z-index:1;top:80px;'><div style='width:90px;height:270px;background:#ccc;border:#999 solid 1px;'><a href='http://sjb.monternet.com' target='_blank'><img src='http://www.66163.com/upload_pic/201108/201108021015487562.jpg' width='90' height='270' border='0' /></a></div><div align='left' style='background:#fff;font-size:0px;'>¡¡<img src='http://www.66163.com/lj_img/close.gif' title='¹Ø±Õ' onclick=adhide('adright') style='cursor:pointer'></div></div>";    
   
document.write(zcode);    
document.write(ycode);    
screencl('adleft');    
screencl('adright');     
window.setInterval("heartBeat()",1); 
