<!--
function onKeyDown(theChar)
{
   switch (theChar)
   {
      case 32:
      return onSpacebar();

      case 37:
      return onLeftArrow();

      case 38:
      return onUpArrow();

      case 39:
      return onRightArrow();

      case 40:
      return onDownArrow();
      
      case 49:
      case 97:
      if (window.onNum1)
         return onNum1();
      break;
         
      case 50:
      case 98:
      if (window.onNum2)
         return onNum2();
      break;
      
      case 51:
      case 99:
      if (window.onNum3)
         return onNum3();
      break;
      
      case 52:
      case 100:
      if (window.onNum4)
         return onNum4();
      break;
      
      case 53:
      case 101:
      if (window.onNum5)
         return onNum5();
      break;
   }

   return false;
}

function keydownIE()
{
   if (inFormField(event))
      return true;
      
   if (onKeyDown(event.keyCode))
   {
      event.cancelBubble = true;
      return false;
   }

   return true;
}

function keydownMoz(e)
{
   if (inFormField(e))
      return true;
      
   if (onKeyDown(e.which))
   {
      if (e.stopPropagation)
         e.stopPropagation();
      else
         e.cancelBubble = true;
      if (e.preventDefault)
         e.preventDefault();
      return false;
   }

   return true;
}

// don't process navigation keys while in a form field
function inFormField(e)
{
   if (e.target) 
      targ = e.target;
   else if (e.srcElement) 
      targ = e.srcElement;
   if (targ.nodeType == 3) // defeat Safari bug
      targ = targ.parentNode;
   var tname = targ.tagName.toLowerCase();
   
   return 'input' == tname || 'select' == tname || 'textarea' == tname;
}

if (window.captureEvents)
{
   window.captureEvents(Event.KeyDown);
   window.onkeydown = keydownMoz;
}
else if (document.attachEvent)
   document.attachEvent('onkeydown', keydownIE);
//else
//  alert("Events are not supported");

// -->
