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*/} 

//alert(diffY); 
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("leftDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";
document.getElementById("rightDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";
document.getElementById("top_leftDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";
document.getElementById("top_rightDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";

lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}

sidebar1= "<div id=leftDIV style='left:10px; PosITION:absolute; TOP:30px;'>  <a href='http://www.crfcard.com/' target='_blank'><img src='images/duilian.jpg' width='120' height='365' border='0'></a></div>" 
sidebar2= "<div id=rightDIV style='right:10px; PosITION:absolute; TOP:30px;'> <a href='http://www.crfcard.com/' target='_blank'><img src='images/duilian.jpg' width='120' height='365' border='0'></a></div> " 


sidebar3= "<div id=top_leftDIV style='left:10px; PosITION:absolute; TOP:0px;' z-index:2;><img onclick='closeAD()' src='images/close.png' width='12' height='12' border='0'></div>" 
sidebar4= "<div id=top_rightDIV style='right:10px; PosITION:absolute; TOP:0px;' z-index:2;><img onclick='closeAD()' src='images/close.png' width='12' height='12' border='0'></div>" 


document.write(sidebar1); 
document.write(sidebar2); 
document.write(sidebar3);
document.write(sidebar4)

//下面这段删除后，对联将不跟随屏幕而移动。
window.setInterval("heartBeat()",1); 
//-->

function closeAD() 
{ 
document.getElementById("leftDIV").style.display='none'; 
document.getElementById("rightDIV").style.display='none'; 
document.getElementById("top_leftDIV").style.display='none';
document.getElementById("top_rightDIV").style.display='none';
}
