var interval;
Tmouse=0; 
scrollpos=Tmouse;
Cursor=0;
CursorTop=0;
ScrollHeight=200
speed=75
waitingspeed=1000

function findheight()
{
	Tmouse=document.all.messagediv.offsetHeight;				
	if (document.all('NewsT0')!=null)
	{CursorTop=document.all('NewsT0').offsetTop;	
	}				
	if (Tmouse==0) {setTimeout("findheight()",60)};				
}

function doscroll()
{
	if (scrollpos<=-Tmouse) {scrollpos=ScrollHeight};
	if (scrolling) 
	{
	scrollpos=scrollpos-1;
	document.all.messagediv.style.top=scrollpos;
	}
	if (scrollpos==-CursorTop)
	{	
	cursorchange();
	interval=setTimeout("doscroll()",waitingspeed)
	}
	else
	{
	interval=setTimeout("doscroll()",speed)
	}
}

function cursorchange()
{
	Cursor=Cursor+1;
	if (document.all('NewsT'+Cursor)!=null)
	{ CursorTop=document.all('NewsT'+Cursor).offsetTop;	
	}
	else
	{
	Cursor=0;
	CursorTop=0;
	if (document.all('NewsT0')!=null)
		{CursorTop=document.all('NewsT0').offsetTop;
		}
	}				
}
function NewsWrite(SubScrollHeight,SubSpeed,SubWaitingspeed) { ScrollHeight=SubScrollHeight; speed=SubSpeed; waitingspeed=SubWaitingspeed;scrolling=true; document.all('messagediv').innerHTML='<label onmousemove="javascript:scrolling=false;" onmouseout="javascript:scrolling=true;" > ' + document.all('messagediv').innerHTML +'</label>'; findheight();doscroll();	}
