var pos=0;
var speed=20;            //Teletype speed: Lower = Faster
var scrSpeed=40;         //Scroll Speed
var arrowSpeed=40;	
var rollArray = new Array(60);
var tArray = new Array(60);
var temp = "";
var ttCurrRoll=1;
var currPix=0;
var dontReType=0;
var linkHeight=22;
var frozen=0;
var frozenTyp=0;
var frozenPix=0;
var arrowOverride=0; //If going back via arrow, scroll upwards
var arrowTarget=9999;
var penult=0; //Is is penultimate, and recently unfrozen? 
var cease=0;

isW3C = (document.getElementById) ? true :false;
isIE4 = (document.all) ? true :false;
showing = false;

function menui(id) {
	showing = true;
	if 	(isW3C) {
		document.getElementById(id).style.backgroundColor="#ccd0f2";
	}
	if (id.charAt(0)=="a") {convCode=1;}
	if (id.charAt(0)=="b") {convCode=2;}
	if (id.charAt(0)=="c") {convCode=3;}
	if (id.charAt(0)=="d") {convCode=4;}
	if (id.charAt(0)=="e") {convCode=5;}
	if (document.all) {temporal.innerHTML=tArray[(convCode+id.charAt(1))]}
	ttCurrRoll = convCode+id.charAt(1);
	frozenTyp = ttCurrRoll;
	pos=0;
	Typ();
}

function menuo(id) {
	showing = false;
	startTimer();
	if (isW3C) {
		document.getElementById(id).style.backgroundColor="#FFFFFF";
	}
}

function show(id) {
	if (isW3C) {
		document.getElementById("menu_a").style.visibility="hidden";
		document.getElementById("menu_b").style.visibility="hidden";
		document.getElementById("menu_c").style.visibility="hidden";
		document.getElementById("menu_d").style.visibility="hidden";
		document.getElementById("menu_e").style.visibility="hidden";
		if (id!='menu_no'){
			document.getElementById(id).style.display="block"; //for NN6
			document.getElementById(id).style.visibility="visible";
			showing = true;
			
		}
		if (id=='menu_no'){
			showing = false;
		}
			
		if (id.charAt(5)=="a") {convCode=1;}
		if (id.charAt(5)=="b") {convCode=2;}
		if (id.charAt(5)=="c") {convCode=3;}
		if (id.charAt(5)=="d") {convCode=4;}
		if (id.charAt(5)=="e") {convCode=5;}
		if (document.all) {temporal.innerHTML=tArray[(convCode+"0")]}
		ttCurrRoll = convCode+"0";
		frozenTyp = ttCurrRoll;
		pos=0;
		Typ();
	}
}

function startTimer(){
showing = false;
setTimeout("continueTimer()",1000);
}

function continueTimer(){
if (showing==false)
	{
	setTimeout("unshow()",1000);
	}
}


function unshow(id) {
	if ((isW3C) && (showing==false)) {
		document.getElementById("menu_a").style.visibility="hidden";
		document.getElementById("menu_b").style.visibility="hidden";
		document.getElementById("menu_c").style.visibility="hidden";
		document.getElementById("menu_d").style.visibility="hidden";
		document.getElementById("menu_e").style.visibility="hidden";
		}
	}

//------------------------

function Typ(){
whichTyp=ttCurrRoll;
if (frozenTyp!=0){
whichTyp=frozenTyp;
}
pos++;pos++;pos++;pos++;

 //if (rollArray[ttCurrRoll].substring(pos-4,pos) == "    ")
 //{
 // pos++;pos++;pos++;pos++;
 //}
text=rollArray[whichTyp].substring(0,pos);
 if (document.layers)
 {
  //document.layers.rolloverTextArea.document.open();
  //document.layers.rolloverTextArea.document.write("<div style='position:absolute;top:0px;left:0px;font-family:Verdana, Courier New;font-size:18px;color:#00ff00'>" + text + "");
  //document.layers.rolloverTextArea.document.close();
 }
else if (document.all)
document.all.rolloverTextArea.innerHTML=text;
 if (pos < rollArray[whichTyp].length)
 {
  tmer=setTimeout('Typ();',speed);
 }
}

