/***************************************************************************
                         Version 4 Menu Loader

enables easier backward-compatibility of pages while allowing Netscape 6
to conditionally load scripts  
***************************************************************************/


HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_NS4old = (HM_NS4 && (parseFloat(navigator.appVersion) < 4.02));
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_IsMenu = (HM_DOM || (HM_NS4 && !HM_NS4old) || (HM_IE && !HM_IE4M));

if(window.event + "" == "undefined") event = null;

function HM_f_PopUp(){return};
function HM_f_PopDown(){return};

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

if(HM_IsMenu) {
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='javascripts/hierArrays_inside.js' TYPE='text/javascript'><\/SCR" + "IPT>");
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='javascripts/hierMenus.js' TYPE='text/javascript'><\/SCR" + "IPT>");
}

if(window.event + "" == "undefined") event = null;

function HM_f_PopUp(){return};
function HM_f_PopDown(){return};

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

// New Function

ht_bypasskey = 0;
ht_indexpage = "";
ht_mkeypage  = "";
ht_nextpage  = "";
ht_okeypage  = "";
ht_rkeypage  = "";
ht_tkeypage  = "";
ht_wkeypage  = "";
ht_ykeypage  = "";
ht_zkeypage  = "";
function handleKeyPress (keycode) {
    if (ht_bypasskey == 1) {
      return 0;
    }
    else if ((keycode == 73) || (keycode == 105)) {  // I or i [INDEX]
      window.open(((ht_indexpage == "") ? "index.htm" : ht_indexpage), "_top");
    }
    else if ((keycode == 65) || (keycode == 97)) {  // A or a [ABOUT]
	    window.open(ht_relroot+"aboutus/index.htm","_top");
    }
    else if ((keycode == 66) || (keycode == 98)) {  // B or b [BACK]
	    history.go(-1);
    }
    else if ((keycode == 67) || (keycode == 99)) {  // C or c [CAREERS]
	    window.open(ht_relroot+"aboutus/careers.htm","_top");
    }
    else if ((keycode == 70) || (keycode == 102)) {  // F or f [FORWARD]
	    history.go(+1);
    }
    else if ((keycode == 72) || (keycode == 104)) {  // H or h [HOME]
	    window.open(ht_relroot+"index.htm","_top");
    }
    else if ((keycode == 76) || (keycode == 108)) {  // L or l [LEGAL]
	    window.open(ht_relroot+"legal.htm","_top");
    }
    else if ((keycode == 77) || (keycode == 109)) {  // M or m [m-key]
	if (ht_mkeypage != "") { window.open(ht_mkeypage,"_top"); }
    }
    else if ((keycode == 78) || (keycode == 110)) {  // N or n [NEXT-PAGE]
	if (ht_nextpage != "") { window.open(ht_nextpage,"_top"); }
    }
    else if ((keycode == 79) || (keycode == 111)) {  // O or o [o-key]
	if (ht_okeypage != "") { window.open(ht_okeypage,"_top"); }
	else { window.open(ht_relroot+"aboutus/contact.htm","_top"); }
    }
    else if ((keycode == 80) || (keycode == 112)) {  // P or p [PRODUCTS]
	    window.open(ht_relroot+"products/index.htm","_top");
    }
    else if ((keycode == 82) || (keycode == 114)) {  // R or r [r-key]
	if (ht_rkeypage != "") { window.open(ht_rkeypage,"_top"); }
    }
    else if ((keycode == 83) || (keycode == 115)) {  // S or s [SERVICES]
	    window.open(ht_relroot+"services/index.htm","_top");
    }
    else if ((keycode == 84) || (keycode == 116)) {  // T or t [t-key]
	if (ht_tkeypage != "") { window.open(ht_tkeypage,"_top"); }
    }
    else if ((keycode == 85) || (keycode == 117)) {  // U or u [UP]
	    window.open(ht_relroot+"index.htm","_top");
    }
    else if ((keycode == 86) || (keycode == 118)) {  // V or v [POINT OF VIEW]
	    window.open(ht_relroot+"perspectives/index.htm","_top");
    }
    else if ((keycode == 87) || (keycode == 119)) {  // W or w [w-key]
	if (ht_wkeypage != "") { window.open(ht_wkeypage,"_top"); }
	else { window.open(ht_relroot+"news/index.htm","_top"); }
    }
    else if ((keycode == 89) || (keycode == 121)) {  // Y or y [y-key]
	if (ht_ykeypage != "") { window.open(ht_ykeypage,"_top"); }
    }
    else if ((keycode == 90) || (keycode == 122)) {  // Z or z [z-key]
	if (ht_zkeypage != "") { window.open(ht_zkeypage,"_top"); }
    }
}
function netscapeKeyPress(e) {
    return handleKeyPress(e.which);
}
function bodyKeyPress(e) {
  if (navigator.appName.substring(0, 9) == 'Microsoft') {
    return handleKeyPress(window.event.keyCode);
  }
  else if (navigator.appName == 'Netscape') {
    return handleKeyPress(e.which);
  }
  else if (navigator.appName == 'Opera') {
    if (e.which < 65) {	<!-- wierd mapping -->
	return handleKeyPress(e.which + 48);
    }
    else {
	return handleKeyPress(e.which);
    }
  }
  else {
    return handleKeyPress(e.which);
  }
}
if (navigator.appName == 'Netscape') {
    window.captureEvents(Event.KEYPRESS);
    window.onKeyPress = netscapeKeyPress;
}
