function RotatorDiv(id, rotatorHeight, interval)
{
    var obj = document.getElementById(id);
    if(!obj) return false;
    obj.style.overflow = "hidden";
    obj.originalHeight = obj.scrollHeight;
    obj.currentRotatorHeight = 0;
    obj.rotatorInterval = interval;
    obj.innerHTML = obj.innerHTML + obj.innerHTML;
    obj.isMouseOn = false;
    obj.onmouseover = function(){this.isMouseOn = true;};
    obj.onmouseout = function(){this.isMouseOn = false;};

    window["scroll_interval_"+id] = setInterval(rotatorScroll(id,rotatorHeight),50);
}
function rotatorScroll(id,rotatorHeight)
{
    return function()
    {
        var obj = document.getElementById(id);
        if(!obj) return;
        if(obj.isMouseOn) return;
        var step = parseInt(rotatorHeight/10);
        if(obj.currentRotatorHeight<rotatorHeight && obj.currentRotatorHeight+step>rotatorHeight)
        {
            step = rotatorHeight - obj.currentRotatorHeight;
            obj.currentRotatorHeight = rotatorHeight;
        }
        else
        {
            obj.currentRotatorHeight = obj.currentRotatorHeight+step;
        }
        if(obj.currentRotatorHeight > rotatorHeight)
        {
            obj.currentRotatorHeight = 0;
            clearInterval(window["scroll_interval_"+id]);
            setTimeout(function(id,rotatorHeight){return function(){window["scroll_interval_"+id] = setInterval(rotatorScroll(id,rotatorHeight),50)}}(id,rotatorHeight),obj.rotatorInterval*1000);
            return;
        }
        var ct = obj.scrollTop;
        ct+=step;
        obj.scrollTop = ct;
        if(obj.scrollTop >= obj.originalHeight)
        {
            obj.scrollTop = obj.scrollTop-obj.originalHeight;
        }
    }
	
}
