//
var gloxp = null;
var gloxn = null;
var gloxi = null;
var gloxo = null;
//
function keydown(xe) {
  var whichcode = null;
  if(!xe) xe = window.event;
  if(xe.keyCode) whichcode = xe.keyCode;
  else if(xe.which) whichcode = xe.which;
  switch (whichcode) {
     case 37: {if(gloxp) {window.location = gloxp; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;} 
               else return;}
     case 39: {if(gloxn) {window.location = gloxn; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     case 38: {if(gloxi) {window.location = gloxi; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     case 40: {if(gloxo) {window.location = gloxo;
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     default: {return;}
  }
}
document.onkeydown = keydown;
//
function keypress(xe) {
  var whichcode = null;
  var whichchar = null;
  if(!xe) xe = window.event;
  if(xe.keyCode) whichcode = xe.keyCode;
  else if(xe.which) whichcode = xe.which;
  whichchar = String.fromCharCode(whichcode);  
  switch (whichchar) {
     case "b":   ;
     case "B":   ;
     case "p":   ;
     case "P": {if(gloxp) {window.location = gloxp; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;} 
               else return;}
     case "n":   ;
     case "N":   ;
     case "f":   ;
     case "F": {if(gloxn) {window.location = gloxn; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     case "i":   ;
     case "I":   ;
     case "u":   ;
     case "U": {if(gloxi) {window.location = gloxi; 
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     case "s":   ;
     case "S":   ;
     case "l":   ;
     case "L": {if(gloxo) {window.location = gloxo;
                  if(xe.returnValue) xe.returnValue = false;
                  return false;}
               else return;}
     default:  {return;}
  }
}
document.onkeypress = keypress;
//
function keyerror() {
     return true;
}
document.onerror = keyerror;
