//
// jumpToAnchor()
// Scrolls the document window to the location of a passed ID.
// Implemented to fix the Anchor bug in CSS 3 Column techniques
// (previous content hidden by overflow)
//
function jumpToAnchor(id)
{
	anchorObj = document.getElementById(id);
	yPosition = findPosY(anchorObj);
	window.scrollTo(0, yPosition);
  return false;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}

function popUp(obj)
{
	window.open(obj.getAttribute('href'),"Window","status = 1, height = 336, width = 508, menubar = no, toolbar = no, scrollbars = yes, resizable = 0");
	return false;
}

function firstScroll() {
	setTimeout('startScroll()', 5000);
}

var t;
function startScroll(){

	var div = document.getElementById('newsScroll');

  if (div.scrollTop <= (div.scrollHeight-201)){
     div.scrollTop++; //scroll 1 pixel up
     t = setTimeout('startScroll()', 150); // scrolls every 200 milliseconds
  }
  else
  	t = setTimeout('resetScroll()', 5000);

}

function resetScroll(){
		var div = document.getElementById('newsScroll');

		if (div.scrollTop > 0){
			 div.scrollTop = div.scrollTop-5; //scroll 5 pixel up
			 t = setTimeout('resetScroll()', 1); // scrolls every 1 milliseconds
		}
		else
			t = setTimeout('startScroll()', 2000);

}

function stopScroll(){
	clearTimeout(t);
}