if (window != window.top) {top.location.href = location.href;}

// Mozilla 8.0 [en] (IE 6.; I)

var y=0;
var lasty=0;
var uagent=navigator.userAgent;
var hop = 0;
var IE=0;
var scratch;
var workInterval = 0;
var scrollInterval = -2;
var notCompat = 0;

if (uagent.indexOf("MSIE") > 0) {IE=1;}
if (uagent.indexOf("Mozilla 4.04") > 0) {notCompat=1;}

function getScrollRate(){
	if( document.all ){
		return document.all.speedy.ss.options[document.all.speedy.ss.selectedIndex].value;
	} else {
//		alert( document.layers[0].document.speedy.ss.options[document.layers[0].document.speedy.ss.selectedIndex].value );
		return document.layers[0].document.speedy.ss.options[document.layers[0].document.speedy.ss.selectedIndex].value;
}


}

function scroller() {
	if( IE == 1 ){
	   y = getY() + 1;
	} else {
	   y = getY() + 3;
	}
	//alert( getY() + " : " + y );
	top.scroll(0,y);
	holdwork();
	return true;
}



function runScroller() {
	if( notCompat ){
		return;
	}
	document.writeln( '' );
	if( IE==1 ){
		document.writeln( '<DIV ID="floatScroll" style="position:relative; left: 0; top: 1;">' );
	} else {
		document.writeln( '<LAYER name="floatScroll">' );
	}
//	document.writeln('<body onBlur="dopause();"></body>');
	document.writeln('<table border=0>');
	document.writeln('<tr><td>');
	document.writeln('<FORM name="speedy">');
	//document.writeln('<select name="ss" onChange="unpause();" onBlur="dopause(); return true;">');
	document.writeln('<select name="ss" onChange="unpause();" onFocus="dopause();"');
//	document.writeln('<select name="ss" onChange="window.scroll(0,lasty); startScroller(this.options[this.selectedIndex].value); return true;" onClick="pause(); return true;"');
//	document.writeln('<option value="0">No Scrolling');
	document.writeln('<option value="05">Speed Scroll');
	document.writeln('<option value="01">Fastest');
	document.writeln('<option value="30">Very Fast Scroll');
	document.writeln('<option value="45">Fast Scroll');
	document.writeln('<option value="60">Medium Fast Scroll');
	document.writeln('<option value="90"selected>Medium Scroll');
	document.writeln('<option value="120">Medium Slow Scroll');
	document.writeln('<option value="150">Slow Scroll');

	document.writeln('<input type=button name=pause value=Start onclick=parent.pause()>');
	document.writeln('<input type=button name=hide value=Hide onclick=parent.hide()>');
		document.writeln('</FORM>');
		document.writeln('</td>');
	document.writeln('</table>');
	
	if( IE==1 ){
		document.writeln( '</DIV>' );
	} else {
		document.writeln( '</LAYER>' );
	}
	document.writeln( '' );
	if( IE==1 ){
//		document.speedy.ss.options[0].selected=1;
		document.speedy.ss.options[0].selectedIndex=3;
		document.speedy.ss.options[1].selectedIndex=1;
	} else {
//		document.layers[0].document.speedy.ss.options[0].selected=1;
		document.layers[0].document.speedy.ss.options[0].selectedIndex=3;
	}
	hold();
	return true;
}

function getY(){
	if( IE==1 ){
		return document.body.scrollTop;
	} else {
		return top.pageYOffset;
	}
}

function holdwork(){
	if( IE==1 ){
		obj = document.all.floatScroll.style;
	} else {
		obj = document.floatScroll;
	}
	obj.top = getY();
}

function hold(){
//	return true;
	holdwork();
	// setTimeout( "hold()", 1 );
	workInterval = setInterval( "holdwork()", 1000 );
}

function hide(){
	if( document.all ){
		document.all.floatScroll.style.visibility = "hidden";
	} else {
		document.floatScroll.visibility = "hide";
	}
	clearInterval( workInterval );
	return false;
}

function pause(){
	if( getScrollRate() == 0 ){
		return;
	}
	if( hop == 0 ){
		unpause();
	} else {
		dopause();
	}
	return true;
}

function dopause(){
	if( scrollInterval != -2 ){
		clearInterval( scrollInterval );
	}
//	alert( "focus" );
	hop = 0;
	if( document.all ){
		document.all.pause.value = "Start";
	} else {
		document.layers[0].document.speedy.pause.value = "Start";
	}
}

function unpause(){
	if( scrollInterval != -2 ){
		clearInterval( scrollInterval );
	}
	hop = 1;
	if( document.all ){
		document.all.pause.value = "Stop";
	} else {
		document.layers[0].document.speedy.pause.value = "Stop";
	}
	if( getScrollRate() != 999 ){
		scrollInterval = setInterval( "scroller()", getScrollRate() );
	} else {
		about_scroller();
	}
}
