RATE = 1;
DELAY = 100;
CLIP_H = 205;
var up = 0;

function detectbrowser() {
 // alert(navigator.appVersion);
 IE = navigator.appName=='Microsoft Internet Explorer'?1:0;
 NS = navigator.appName=='Netscape'?1:0;
 OP = navigator.appName=='Opera'?1:0;
var VS = parseInt(navigator.appVersion);
if( !(IE|NS|OP) )alert('This browser:\n'+navigator.appName+' '+navigator.appVersion+'\nmay not be compitable');
if(IE&&(VS>=4)) { IE4a = 1; }
else if(NS&&(VS>=5)) { NS6a = 1; }
else if(NS&&(VS>=4)) { NS4a = 1; }
}

function init()
{
	detectbrowser();
	//if(IE) {
	document.getElementById("scrolltext").style.height = "205px";
	//alert(document.getElementById("scrolltext").scrollHeight);
	textup(1);
	//}
}
function textup(speed)
{
	up = speed*RATE;
	if(up>0) textmoveup();
	else textmovedown();
}

function textmoveup()
{
	if(up <= 0) return;
	else {
		textmove();
	}
	setTimeout('textmoveup()',DELAY);
}

function textmovedown()
{
	if(up >= 0) return;
	else {
		if(!textmove()) return;
	}
	setTimeout('textmovedown()',DELAY);
}

function textmove()
{
		var m = document.getElementById("scrolltext");
		if(IE || NS6a) {
			m.scrollTop += up
			if(m.scrollTop>Math.floor(m.scrollHeight/2)) m.scrollTop=0;
		}
		else if(NS) {
			var m = document.getElementById("scrolltext");
			t = m.clip.top;
			h = m.clip.height;


			if(t+up<0) return;
			if(h<CLIP_H && up>0) return;
			if(m.clip.top == Math.floor(m.height/2)) m.clip.top = 0;

			m.clip.top += up;
			m.top -= up;
			m.clip.height = CLIP_H;
		}
		else return false;
		return true;
}
onload = init;
