//--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* //-- FUNCTION: //-- fnKeyStrokeNavigate() //-- DESCRIPTION: //-- captures a key stroke from the user and //-- navigates to aa new web-page. This is designed to //-- work properly in Netscape and IE. But it does not work in //-- Netscape. This is not really a proper function, //-- because it reference a global array ('aaHotKeys[]'). //-- It should have the array passed as a parameter. //-- DOCUMENTATION: none //----*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* function fnKeyStrokeNavigate(sKeyStroke) { //--- This array (aaHotKeys) contains a list of pointers //--- to web pages which are used by a keyboard capture //--- routine (fnGetKeyStroke) to allow the user of the //--- web-page to navigate to new pages with the keyboard //--- instead/ as well as, the mouse. var aaHotKeys = new Array(); aaHotKeys['r'] = "http://www.geocities.com/matth3wbishop/cv/cv1.html"; aaHotKeys['j'] = "http://www.geocities.com/matth3wbishop/eg/javascript/"; aaHotKeys['a'] = "http://www.geocities.com/matth3wbishop/eg/asp/"; aaHotKeys['b'] = "http://www.geocities.com/matth3wbishop/eg/batch/"; bIsNetscape = (document.layers); if (bIsNetscape) { iKeyStrokeCode = sKeyStroke.which; } else { iKeyStrokeCode = event.keyCode; } sKey = String.fromCharCode(iKeyStrokeCode); for (var ii in aaHotKeys) { if (sKey == ii) { window.location = aaHotKeys[ii]; } } //-- for } //-- fnKeyStrokeNavigate