/*
class Keynav ;-)

Enables the user to navigate via arrow keys and/or Page Up/Page Down keys. It is also
possible for the user to either enable/disable this feature.
To enable this permanent, you have to comment out an if-block below (see comments in code). 
Use something like this in your HTML Code if you want to let the user decide if or not to
use keynav:

	<body onLoad="javascript:checkCheckBox();">

	and

	<input type="checkbox" name="cb" value="hallo" onClick="javascript:setCheckBox();">
*/
/**
* void tastendruck()
* @PARAM Event ereignis
* Jumps to next or previous Page, depending on which arrow key has been pressed 
*/
function tastendruck (ereignis) 
{
  // comment out first if-block to enable keynav permanent
  //if (document.cookie == "true")
  //{
    if (!ereignis)
    {
      // init object if none exists
      ereignis = window.event;
    }
    switch (ereignis.keyCode)
    {
      // enter
      case 13:
	jumpToPage();
	break;
      //pagedown
      //case 34:
      //right
      case 39:
       window.open(myNextPage, "_parent");
        break;
      //pageup
      //case 33:
      //left
      case 37:
        window.open(myPreviousPage,"_parent");
        break;
      case 38:
        parent.centerFrame.scrollBy(0,-30);     
	break;
      case 40:
        parent.centerFrame.scrollBy(0,30);
        break;	
    }
  //end of if-block to comment out to enable keynav permanent
 //}
}

/**
* void checkCheckBox()
* Checks if cookie is present. 
* If true, then keynav and checkbox are enabled
* If false, then keynav and checkbox are disabled
*/
function checkCheckBox()
{
  keyNav = false;
  if (document.cookie == "true")
  {
    keyNav = true;
  }
  document.getElementsByName("cb")[0].checked = keyNav;
}

/**
* void setCheckBox()
* Sets cookie true or false if checkbox is enabled/disabled
*/
function setCheckBox()
{
  cb = document.getElementsByName("cb")[0].checked; 
  if (document.cookie == "true") 
  {
    document.cookie = "false";
    cb = false;
  }
  else
  {
    document.cookie = "true";
    cb = true;
  }
  location.reload();
}

// Catching Event
document.onkeydown = tastendruck;

// end class Keynav ;-)