var speed=30  // speed of scroller
var step=1     // smoothness of movement
var y, scroll, hb, hs, h

function testForObject(Id, Tag)
{
  var o = document.getElementById(Id);
  if (o)
  {
    if (Tag)
    {
      if (o.tagName.toLowerCase() == Tag.toLowerCase())
      {
        return o;
      }
    }
    else
    {
      return o;
    }
  }
  return null;
}


function initScroller()
{
	var boardtest = testForObject("board","");
	if( (document.getElementById) && (document.createElement) && (document.body.appendChild) )
	{
		if( boardtest )
		{
			hb=document.getElementById('board').offsetHeight
			hc=0
			hs=hb-6-hc
			document.getElementById('scrollcontent').style.height=hs+'px'
			tp=hs-(hs/3)
			document.getElementById('snippets').style.top=tp+'px'
			y=tp
			scroll=setTimeout('startScroller()',speed)
		}
	}
}

function startScroller()
{
	h=document.getElementById('snippets').offsetHeight;
	y-=step;
	if( y<-h )
	{
		y=hs
	}
	document.getElementById('snippets').style.top=y+'px';
	scroll=setTimeout('startScroller()',speed);
}

function pauseScroller()
{
	clearTimeout(scroll);
}
