var scrollTimer = null;

function scroll(clip, scrolling)
    {
    var l = document.getElementById(scrolling);
    var p = document.getElementById(clip);
    l.style.top = (((l.offsetTop + l.offsetHeight) > 0)? l.offsetTop - 1: p.offsetHeight) + 'px';
    }

function moveup(clip, scrolling)
    {
    var l = document.getElementById(scrolling);
    l.style.top = ((l.offsetTop < -3)? l.offsetTop + 3: 0) + 'px';
    }

function movedown(clip, scrolling)
    {
    var l = document.getElementById(scrolling);
    var p = document.getElementById(clip);
    l.style.top = (((l.offsetTop + l.offsetHeight) > p.offsetHeight)? l.offsetTop - 3: l.offsetTop) + 'px';
    }

function startscroll(clip, scrolling)
    {
    if(scrollTimer)
        stop();
    scrollTimer = setInterval('window.scroll(\'' + clip + '\', \'' + scrolling + '\');', 40);
    }

function startmoveup(clip, scrolling)
    {
    if(scrollTimer)
        stop();
    scrollTimer = setInterval('window.moveup(\'' + clip + '\', \'' + scrolling + '\');', 40);
    }

function startmovedown(clip, scrolling)
    {
    if(scrollTimer)
        stop();
    scrollTimer = setInterval('window.movedown(\'' + clip + '\', \'' + scrolling + '\');', 40);
    }

function stop()
    {
    clearInterval(scrollTimer);
    }

window.onload = function()
	{
	startscroll('news', 'floating');
	var links = document.getElementsByTagName('a');
	for(var i = 0; i < links.length; i++)
		{
		links[i].onmouseover = function() { if(scrollTimer) stop(); if(this.href) this.style.textDecoration = 'underline'; };
		links[i].onmouseout = function() { startscroll('news', 'floating'); this.style.textDecoration = 'none'; };
		}
	}

