if (window != window.top) {top.location.href = location.href;}

var y=0;
var lasty=0;
var uagent=navigator.userAgent;
var hop = 0;
var aieee=0;
var scratch;
var workInterval = 0;
var scrollInterval = -2;
var cruft = 0

if(!document.getElementById && document.all)
	document.getElementById = function(id)
	{
		return document.all[id];
	}


if ((uagent.indexOf("MSIE") > 0) && (uagent.indexOf("Mac")) < 0) {
	aieee = 1;
}

if (document.layers) {
	cruft = 1
}

function getScrollRate(){
	if (cruft) {
		return document.layers[0].document.speedy.ss.options[document.layers[0].document.speedy.ss.selectedIndex].value;
	} else {
		return document.getElementById("speedy").ss.options[document.getElementById("speedy").ss.selectedIndex].value;
	}
}

function about_scroller(){
	if (cruft) {
	   document.layers[0].document.speedy.ss.options[0].selected=1;
	   startRemote( '' );
	}  else {
	   document.getElementById("speedy").ss.options[0].selected=1;
	   startRemote( '' );
	}
}

function scroller() {
	if (cruft) {
	   y = getY() + 3;
	} else {		
	   y = getY() + 1;
	}
	top.scroll(0,y);
	if (aieee || cruft) {
		holdwork();
	}
	return true;
}

function setfontsize(fs) {
	scratch=fs+"pt";	
	if (cruft) {
	       document.tags.P.fontSize=scratch;
	} else {
    		document.body.style.fontSize=scratch;
	}
}


function runScroller() {
	if (aieee) {
		document.writeln( '<DIV ID="floatScroll" style="position:absolute; left: 0; top:0;">' );
	} else {
		if (cruft) {
 			document.writeln( '<LAYER name="floatScroll">' );  
		}
		else {
			 document.writeln( '<DIV ID="floatScroll" style="position: fixed; left: 0; top:0;">' );
		}
	}
	document.writeln('<table border=0>');
	document.writeln('<tr><td>');
	document.writeln('<FORM name="speedy" id="speedy">');
	document.writeln('<select name="ss" id="ss" onChange="unpause();" onFocus="dopause();"');


	document.writeln('<option value="10">Scroll Very Fast');
	document.writeln('<option value="25">Fast Scroll');
	document.writeln('<option value="50">Medium Scroll');
	document.writeln('<option value="100">Slow Scroll');
	document.writeln('<option value="150" selected>Very Slow Scroll');
	document.writeln('<option value="200">Even Slower');
	document.writeln('<option value="500">Slowest');
	document.writeln('</select>');
	if (!cruft) {
		document.writeln('<select name="fs" id="fs" onChange="setfontsize(this.options[this.selectedIndex].value); return true;">');
		document.writeln('<option value="8">Font Size 8');
		document.writeln('<option value="9" selected>Font Size 9');
		document.writeln('<option value="10">Font Size 10');
		document.writeln('<option value="11">Font Size 11');
		document.writeln('<option value="12">Font Size 12');
		document.writeln('<option Selected value="13">Font Size 13');
		document.writeln('<option value="14">Font Size 14');
		document.writeln('<option value="15">Font Size 15');
		document.writeln('<option value="20">Font Size 20');
		document.writeln('<option value="25">Font Size 25');
		document.writeln('<option value="30">Font Size 30');
		document.writeln('</Select>');
		document.getElementById("speedy").fs.options[5].selected=1;
	}

	document.writeln('<input type=button id="pause" name=pause value=Start onclick=parent.pause()>');
	document.writeln('<input type=button id="hide" name=hide value=Hide onclick=parent.hide()>');
	document.writeln('<input type=submit id="textonly" name=textonly value="Text Only">');
	// document.writeln('<input type=submit id="textonly" name=textonly value="Text Only" onclick=submit();>');
	document.writeln('</FORM>');
	document.writeln('</td><td>');
	document.writeln('</td><td>');
	document.writeln('</td>');
	document.writeln('</table>');
	document.writeln('<br>');
	if (cruft) {
		document.writeln( '</LAYER>' );
	} else {
		document.writeln( '</DIV>' );
	}
	document.writeln( '<br><br>' );
	if (cruft) {
		document.layers[0].document.speedy.ss.options[0].selectedIndex=3;
	} else {
		document.getElementById("speedy").ss.options[0].selectedIndex=3;
		document.getElementById("speedy").ss.options[1].selectedIndex=1;
	}
	if (aieee || cruft) {
		hold();
	}
	return true;
}

function getY(){
	if (cruft) {
		return top.pageYOffset;
	} else {
		return document.body.scrollTop;
	}
}

function holdwork(){
	if (cruft) {
		obj = document.floatScroll;
	} else {
		obj = document.getElementById("floatScroll").style;
	}
	obj.top = getY();
}

function hold(){
	holdwork();
	workInterval = setInterval( "holdwork()", 1000 );
}

function hide(){
	if (cruft) {
		document.floatScroll.visibility = "hide";
	} else {	
		document.getElementById("floatScroll").style.visibility = "hidden";
	}
	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 );
	}
	hop = 0;
	if (cruft) {
		document.layers[0].document.speedy.pause.value = "Start";
	} else {
		document.getElementById("pause").value = "Start";
	}
}

function unpause(){
	if( scrollInterval != -2 ){
		clearInterval( scrollInterval );
	}
	hop = 1;
	if (cruft) {
		document.layers[0].document.speedy.pause.value = "Stop";
	} else {
		document.getElementById("pause").value = "Stop";
	}
	if( getScrollRate() != 999 ){
		scrollInterval = setInterval( "scroller()", getScrollRate() );
	} else {
		about_scroller();
	}
}




