// slidenav.js -*- java -*-

if (document.captureEvents && Event.KEYUP) {
    //remove this part if you do not need Netscape 4 to work
    document.captureEvents(Event.KEYUP);
}

function handlekey(e) {
    if (!e) {
	/* if the browser did not pass the event information to the
	   function, we will have to obtain it from the event
	   register. */
	if (window.event) {
	    // Internet Explorer
	    e = window.event;
	} else {
	    //total failure, we have no way of referencing the event
	    return;
	}
    }

  if (typeof(e.keyCode) == 'number') {
    // DOM
      e = e.keyCode;
  } else if (typeof(e.which) == 'number') {
      // NS 4 compatible
      e = e.which;
  } else if (typeof(e.charCode) == 'number') {
      // also NS 6+, Mozilla 0.9+
      e = e.charCode;
  } else {
      //total failure, we have no way of obtaining the key code
      return;
  }

  if (e == 32 || e == 34) {
      // space and pgdw jump forward
      if (next != 0)
	  window.location = next;
  } else if (e == 33) {
      // pdup jump backward
      if (prev != 0)
	  window.location = prev;
  }
}

document.onkeyup = handlekey;

