



/* Variables, go nuts changing those! */
	// initial position 
	var nt_startpos=10; 			
	// end position
	var nt_endpos=-5; 			
	// Speed of scroller higher number = slower scroller 
	var nt_speed=30;				
	// ID of the news box
	var nt_newsID='news';			
	// class to add when JS is available
	var nt_classAdd='hasJS';		
	// Message to stop scroller
	var nt_stopMessage='Stop scroller';	
	// ID of the generated paragraph
	var nt_paraID='DOMnewsstopper';





	/* Initialise scroller when window loads */
	window.onload=function()
	{
		// check for DOM
		if(!document.getElementById || !document.createTextNode){return;}
		initDOMnews();
		// add more functions as needed
	}
	/* stop scroller when window is closed */
	window.onunload=function()
	{
		clearInterval(nt_interval);
	}

/*
	This is the functional bit, do not press any buttons or flick any switches
	without knowing what you are doing!
*/

	var nt_scrollpos=nt_startpos;
	/* Initialise scroller */
	function initDOMnews()
	{
		var n=document.getElementById(nt_newsID);
		if(!n){return;}

		n.style.visibility="visible";

//test
//var x=document.getElementById(nt_newsID).getElementsByTagName('div')[0];

//alert(x.offsetHeight + ":" + x.scrollHeight + ":" + x.clientHeight + ":" + x.style.top + ":" + x.style.bottom);
//sizeing

		var c=document.getElementById("content");
		var m=document.getElementById("menu");
		



		var calcheight = c.offsetHeight - m.offsetHeight;

	//	alert(c.offsetHeight + ":" + m.offsetHeight + ":" + calcheight);
		if (calcheight>200)
		{

			n.style.height = calcheight + 'px';

		}else calcheight=200;


		nt_startpos=calcheight;
		
//----



		n.className=nt_classAdd;
		nt_interval=setInterval('scrollDOMnews()',nt_speed);
		//var newa=document.createElement('a');
		//var newp=document.createElement('p');
		//newp.setAttribute('id',nt_paraID);
		//newa.href='#';
		//newa.appendChild(document.createTextNode(nt_stopMessage));
		//newa.onclick=stopDOMnews;
		//newp.appendChild(newa);
		//n.parentNode.insertBefore(newp,n.nextSibling);
		n.onmouseover=function()
		{		
			clearInterval(nt_interval);
		}
		n.onmouseout=function()
		{
			nt_interval=setInterval('scrollDOMnews()',nt_speed);
		}
	}

	function stopDOMnews()
	{
		clearInterval(nt_interval);
		var n=document.getElementById('news');
		n.className='';
		n.parentNode.removeChild(n.nextSibling);
		return false;
	}
	function scrollDOMnews()
	{



		var n=document.getElementById(nt_newsID).getElementsByTagName('div')[0];
/*
if (nt_scrollpos%50==0)
{
	alert(n.offsetHeight + ":" + n.scrollHeight + ":" + n.clientHeight + ":" + n.style.top + ":" + n.style.bottom);
}
*/
		n.style.top=nt_scrollpos+'px';	
		if(nt_scrollpos==nt_endpos-n.scrollHeight){nt_scrollpos=nt_startpos;}
		nt_scrollpos--;	
	}
