// JavaScript Documentmoz=document.getElementById&&!document.all
moz=document.getElementById&&!document.all
var password=new Array("test","jctest") // list of passwords

Input='' // initialise

function whichKey(e) {
pressed_key=(!moz)?event.keyCode:e.which

key_In = String.fromCharCode(pressed_key).toLowerCase(); //Identify which key is pressed and convert to letter and lowercase
process(key_In) // Send result to function process
this.focus()
}

function process(key_In){
Input+=key_In // Input equals Input plus key
for(i=0;i<password.length;i++){ // check through password array for match
}


if(Input==password[0]){
document.location="../index/test.asp","_blank"
Input=''} //reset

if(Input==password[1]){
document.location="../index/jctest.asp","_blank"
Input=''} //reset




if(Input=="clr"){ // clears the display
document.getElementById("display").innerHTML=""
Input=''} //reset

if(pressed_key==(!moz?27:0)){ // Esc resets Input
Input='';
//process
}
//else{process}

}
document.onkeypress = whichKey;

