﻿function FloatingDIV(divId)
{
    var introDiv = document.getElementById(divId);
    introDiv.style.top = 0;
    FloatingDIV_refresh(divId);
} 
 
function FloatingDIV_refresh(divId)
{
    var StartPoint, EndPoint;
    var introDiv = document.getElementById(divId);

    StartPoint = parseInt(introDiv.style.top.replace("px",""));
    EndPoint = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
    if (EndPoint < 0) EndPoint = 0;

    if (StartPoint != EndPoint ) {
     ScrollAmount = Math.ceil( Math.abs( EndPoint - StartPoint ) / 15 );
     introDiv.style.top = parseInt(introDiv.style.top) + ( ( EndPoint < StartPoint ) ? -ScrollAmount : ScrollAmount )+"px";}

    setTimeout ("FloatingDIV_refresh(\""+divId+"\");", 10);
}