var speed=50  // 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('news').style.top=tp+'px'
		y=tp
		scroll=setTimeout('startScroller()',speed)
    }
  }
}

function startScroller(){
  h=document.getElementById('news').offsetHeight
  y-=step
  if (y<-h) {y=hs}
  document.getElementById('news').style.top=y+'px'
  scroll=setTimeout('startScroller()',speed)
}

function pauseScroller(){clearTimeout(scroll)}
