document.write(''); var os=document.getElementById("sidebar") //if((Math.floor(Math.random()*2)+1)==1) os.style.left='16px'; //else os.style.left='5px' lastScrollY=0; function heartBeat(){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop //alert(diffY); percent=.1*(diffY-lastScrollY); if(percent>0)percent=Math.ceil(percent); else percent=Math.floor(percent); os.style.top=parseInt(os.style.top)+percent+"px"; lastScrollY=lastScrollY+percent; //alert(lastScrollY); } window.setInterval("heartBeat()",1);