if (window != window.top) {top.location.href = location.href;}

var y=0;
var lasty=0;
var uagent=navigator.userAgent;
var hop = 0;
var pinoy=0;
var scratch;
var workInterval = 0;
var scrollInterval = -2;
var melo = 0

if(!document.getElementById && document.all)
	document.getElementById = function(id)
	{
		return document.all[id];
	}


if ((uagent.indexOf("MSIE") > 0) && (uagent.indexOf("Mac")) < 0) {
	pinoy = 1;
}

if (document.layers) {
	melo = 1
}

function getScrollRate(){
	if (melo) {
		return document.layers[0].document.pantasya.cavite.options[document.layers[0].document.pantasya.cavite.selectedIndex].value;
	} else {
		return document.getElementById("pantasya").cavite.options[document.getElementById("pantasya").cavite.selectedIndex].value;
	}

}

function scroller() {
	if (melo) {
	   y = getY() + 3;
	} else {		
	   y = getY() + 1;
	}
	top.scroll(0,y);
	if (pinoy || melo) {
		holdwork();
	}
	return true;
}

function setfontsize(fontsize) {
	scratch=fontsize+"pt";	
	if (melo) {
	       document.tags.P.fontSize=scratch;
	} else {
    		document.body.style.fontSize=scratch;
	}
}

function runScroller() {
	if (pinoy) {
		document.writeln( '<DIV ID="ling" style="position:fixed; left: 280; top:0;">' );
	} else {
		if (melo) {
 			document.writeln( '<LAYER name="ling">' );  
		}
		else {
			 document.writeln( '<DIV ID="ling" style="position: fixed; left: 0; top:0;">' );
		}
	}
	document.writeln('<table border=0>');
	document.writeln('<tr><td>');
	document.writeln('<FORM name="pantasya" id="pantasya">');
	document.writeln('<select name="cavite" id="cavite" onChange="unpause();" onFocus="dopause();"');

      document.writeln('<option value="25" selected>Bilis');
	document.writeln('<option value="50" selected>Mabilis');
	document.writeln('<option value="150">Katamtaman');
	document.writeln('<option value="500">Mabagal');

	document.writeln('</select>');
	

	document.writeln('<input type=button id="pause" name=pause value=Andar onclick=parent.pause()>');
	document.writeln('<input type=button id="tago" name=tago value=x onclick=parent.tago()>');
	document.writeln('</td><td>');
	document.writeln('</td>');
	document.writeln('</table>');
	document.writeln('<br>');
	if (melo) {
		document.writeln( '</LAYER>' );
	} else {
		document.writeln( '</DIV>' );
	}
	document.writeln( '<br><br>' );
	if (melo) {
		document.layers[0].document.pantasya.cavite.options[0].selectedIndex=3;
	} else {
		document.getElementById("pantasya").cavite.options[0].selectedIndex=3;
		document.getElementById("pantasya").cavite.options[1].selectedIndex=1;
	}
	if (pinoy || melo) {
		hold();
	}
	return true;
}

function getY(){
	if (melo) {
		return top.pageYOffontsizeet;
	} else {
		return document.body.scrollTop;
	}
}

function holdwork(){
	if (melo) {
		obj = document.ling;
	} else {
		obj = document.getElementById("ling").style;
	}
	obj.top = getY();
}

function hold(){
	holdwork();
	workInterval = setInterval( "holdwork()", 1000 );
}

function tago(){
	if (melo) {
		document.ling.visibility = "tago";
	} else {	
		document.getElementById("ling").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 (melo) {
		document.layers[0].document.pantasya.pause.value = "Andar";
	} else {
		document.getElementById("pause").value = "Andar";
	}
}

function unpause(){
	if( scrollInterval != -2 ){
		clearInterval( scrollInterval );
	}
	hop = 1;
	if (melo) {
		document.layers[0].document.pantasya.pause.value = "Hinto";
	} else {
		document.getElementById("pause").value = "Hinto";
	}
	if( getScrollRate() != 999 ){
		scrollInterval = setInterval( "scroller()", getScrollRate() );
	} else {
		about_scroller();
	}
}




