var lastScrollY = 0;
var ScrollBarHeight = 334;

function heartBeat(){ 
	
var diffY  =0;
var percent =0;

if (document.documentElement && document.documentElement.scrollTop){
	diffY = document.documentElement.scrollTop;	
}else if (document.body){
 	diffY = document.body.scrollTop;	
}

percent=0.1*(diffY-lastScrollY); 

if(percent>0){
	percent=Math.ceil(percent); 		
}else{
	percent=Math.floor(percent); 
}


var iTop = parseInt(document.getElementById("fd").style.top)+percent;

if(iTop > document.body.clientHeight-ScrollBarHeight)
{
	return;
}

//alert(document.body.clientWidth);
document.getElementById("fd").style.top = iTop+"px";
//document.getElementById("fd").style.right=(parseInt(document.body.clientWidth)-1220)/2+"px";
document.getElementById("fd").style.right="8px";
lastScrollY=lastScrollY+percent; 
//window.status = "";
}
var sWidth = window.screen.width;
//var sOffsetLeft = document.getElementById("fd").offsetLeft;
//if (sWidth<=950 || sOffsetLeft < 1138){
if (sWidth<=950){
	document.getElementById("fd").style.display= "none" ;
	document.getElementById("rightBord").style.display= "none" ;
	document.getElementById("fd").removeChild(document.getElementById("rightBord"));
}
//if (sWidth<1025){
//	document.getElementById("fd").style.paddingTop=204+"px";
//}
//下面这段删除后，对联将不跟随屏幕而移动。
window.setInterval("heartBeat()",1);

