<!--
// page loaded var
var _pageLoaded = 0;
// Some variables governing the apperarance of menu
// items. Note that these values also appear in the CSS
// code below, so if you change these values, be sure
// to change them in both places!
// -------------------------------------
// get root based on folder name
var _folders = new Array("/home","/aboutus","/applications","/products","/contactus","/investment","/jobs","/press","/service_support");
var _root = "";
var _location = (top.location + "").toLowerCase()
var _found = -1;
var _foundAt = 999999;
for (var r=0; r<_folders.length; r++)
  if (_location.indexOf(_folders[r]) != -1 && _location.indexOf(_folders[r]) < _foundAt)
  {
    _found = r;
	_foundAt = _location.indexOf(_folders[r]);
  }
if (_found != -1)
{
  _root = _location.substr(0,_foundAt) + "/";
}
//  -> The width of menu items in pixels. This does not
//     include its 1-pixel border, so the menu will
//     actually be 2 pixels wider than this value.
if (!menuItemWidth) var menuItemWidth = 180;
if (!bmenuItemWidth) var bmenuItemWidth = 180;
if (!cmenuItemWidth) var cmenuItemWidth = 180;

//  -> The height of menu items in pixels. This does
//     not include the 1-pixel border between menu
//     items, above the first menu item, and below the
//     last menu item. Thus, the menu's height will
//     actually be: ((menuItemHeight+1)*numMenuItems)+1
if (!menuItemHeight) var menuItemHeight = 19;
if (!bmenuItemHeight) var bmenuItemHeight = 19;
if (!cmenuItemHeight) var cmenuItemHeight = 19;

// The menuURLs array should contain the number of items
// in each menu. For example, if you have two menus with
// 1 menu item and 4 menu items respectively, this would
// be:
//     var menuLengths = new Array(1,4);
//
// NOTE: If you only need a single menu, you can't
// use this syntax. Instead, do
//     var menuLengths = new Array();
//     menuLengths[0] = x;
// where x is the number of menu items.
if (!menuLengths) var menuLengths = new Array();
if (!bmenuLengths) var bmenuLengths = new Array();
if (!cmenuLengths) var cmenuLengths = new Array();

// The menuURLs 2D array should contain the URL's to be
// loaded by each menu item. Leave the following lines alone
// (they set up the empty array).

// the menu items. Be sure to keep your URLs in sync.

// Pop-up menus close after a brief delay when the user's
// mouse passes out of them. If the user's mouse returns to
// the menu before that delay expires, however, the menu
// should no longer be closed. The menuTimers array stores
// these timers for menus that are in the process of closing.
// You don't have to set anything here; the array is
// created based on the menuLengths variable you defined
// above.
var menuTimers = new Array(menuLengths.length);
var bmenuTimers = new Array(bmenuLengths.length);
var cmenuTimers = new Array(cmenuLengths.length);

/**
 * This function is used throughout the script to obtain
 * a reference to a page element's style given its ID.
 * This reference can then be used to set style properties
 * like position and visibility.
 */
function fn_getStyleObj(id) {
	if (id+'' == 'NaN')	return false;
    if (document.getElementById || // DOM-compliant browsers (MSIE5, NSN6, O5)
        document.all) {            // or MSIE 4
        return fn_getObj(id).style;
    } else return fn_getObj(id); // NSN4
}

/**
 * This function is used throughout the script to obtain
 * a reference to a page element given its ID. This
 * reference can then be used to set variables, event
 * handlers, etc.
 */
function fn_getObj(id) {
	if (id+'' == 'NaN')	return false;
    if (document.getElementById) { // DOM-compliant browsers (MSIE5, NSN6, O5)
        return document.getElementById(id);
    } else if (document.all) { // MSIE4
        return document.all[id];
    } else if (document.layers) { // NSN4
        return document.layers[id];
    } else { // Trap DHTML-impaired browsers 
        //alert("Your browser does not support DHTML!");
        return false;
    }
}
/* find Image */
function fn_findImageWidth(_x,_y)
{
  if (!document.layers) return 0;
  for (var i=0; i<document.images.length; i++)
    if (document.images[i].x == _x && document.images[i].y == _y)
	  return document.images[i].width;
  return 0;
}
/**
 * This function displays a menu given its 1-based index.
 * For example, showMenu(6) will display the menu that is
 * defined by <DIV ID="menu6"> in the document.
 */
function fn_showMenu(index,evt,_right) {
    // do not show menu until page is loaded
	if (_pageLoaded == 0) return false;
    // valid menu ?
    if (index > menuLengths.length) return false;
	// get height
	var _height = (menuLengths[index-1] * (menuItemHeight + 1)) + 1;
	// get navigator info
    var _appName = navigator.appName + "";
	var _appVers = navigator.appVersion + "";
    // get pos
    var _x = 0;
	var _y = 0;
    if (_appName=="Netscape")
	{
	  if (_right == 1)
	  {
		if (evt.target.width)
		{ if (evt.target.offsetLeft)
		  { _x = evt.target.offsetLeft + evt.target.width;
		    _y = evt.target.offsetTop; }
		  else
		  { _x = evt.target.x + evt.target.width;
		    _y = evt.target.y; }
		}
		else
		{ _x = evt.target.x + fn_findImageWidth(evt.target.x,evt.target.y);
		  _y = evt.target.y; }
	    
	  }
	  else
	  { 
	    if (evt.target.offsetLeft)
	    { _x = parseInt(evt.target.offsetLeft);
	      _y = parseInt(evt.target.offsetTop) + 20; }
		else
	    { _x = evt.target.x;
	      _y = evt.target.y + 20; }
	  }
	}
	else
	{
	  if (_right == 1)
	  {
	    _x = event.clientX - event.offsetX + event.srcElement.width + document.body.scrollLeft;
	    _y = event.clientY - event.offsetY + document.body.scrollTop;
	  }
	  else
	  {
	    _x = event.clientX - event.offsetX + document.body.scrollLeft;
	    _y = event.clientY - event.offsetY + document.body.scrollTop + 20;
	  }
	}
    if (_appName=="Netscape")
	{
	  _left = pageXOffset;
	  _right = window.innerWidth + pageXOffset - 15;
	  _bottom = window.innerHeight + pageYOffset - 15;
	}
	else
	{
	  _left = document.body.scrollLeft;
	  _right = document.body.clientWidth + document.body.scrollLeft;
	  _bottom = document.body.clientHeight + document.body.scrollTop;
	}
	if (_x < _left) _x = _left;
	if (_x + menuItemWidth + 2 > _right) _x = _right - menuItemWidth - 2;
	if (_y + _height > _bottom) _y = _bottom - _height;
    // Make sure this menu is not marked to be closed. This
    // cancels any previous request to close this menu.
    if (menuTimers[index-1]) clearTimeout(menuTimers[index-1]);

    // Immediately close any other menus so as to avoid
    // having more than one menu open at once (which is
    // quite ugly).
    for (i=1;i<=menuLengths.length;i++)
        if (i!=index) fn_closeMenu(i,'menu');
    for (i=1;i<=bmenuLengths.length;i++)
        fn_closeMenu(i,'bmenu');
    for (i=1;i<=cmenuLengths.length;i++)
        fn_closeMenu(i,'cmenu');

    // Get a reference to the style of the menu to be displayed.
    var menu = fn_getStyleObj("menu"+index);
    // Make sure we got a valid reference, and make the menu visible.
    if (menu)
	{
	  menu.left = _x;
	  menu.top = _y;
	  menu.visibility = "visible";
	}

    // Display the 'active' version of the menu button.
    //if (document.images) document.images["menubutton"+index].src =
    //                        menuOverButtons[index-1].src;
}
/* -------------------------------------------------------------------------*/
function fn_showBMenu(index,evt) {
    // do not show menu until page is loaded
	if (_pageLoaded == 0) return false;
    // valid menu ?
    if (index > bmenuLengths.length) return false;
	// get height
	var _height = (bmenuLengths[index-1] * (bmenuItemHeight + 1)) + 1;
	// get navigator info
    var _appName = navigator.appName + "";
	var _appVers = navigator.appVersion + "";
    // get pos
    var _x = 179;
	var _y = 0;
    if (_appName=="Netscape")
	{
	  if (evt.target.y)
	    _y = evt.target.y - 3;
	  else
	    _y = evt.pageY - 6; // temporary NS7 fix
	}
	else
	{
	  _y = event.clientY - event.offsetY + document.body.scrollTop - 5;
	}
    if (_appName=="Netscape")
	{
	  _left = pageXOffset;
	  _right = window.innerWidth + pageXOffset - 15;
	  _bottom = window.innerHeight + pageYOffset - 15;
	}
	else
	{
	  _left = document.body.scrollLeft;
	  _right = document.body.clientWidth + document.body.scrollLeft;
	  _bottom = document.body.clientHeight + document.body.scrollTop;
	}
	if (_x < _left) _x = _left;
	if (_x + bmenuItemWidth + 2 > _right) _x = _right - bmenuItemWidth - 2;
	if (_y + _height > _bottom) _y = _bottom - _height;
    // Make sure this menu is not marked to be closed. This
    // cancels any previous request to close this menu.
    if (bmenuTimers[index-1]) clearTimeout(bmenuTimers[index-1]);

    // Immediately close any other menus so as to avoid
    // having more than one menu open at once (which is
    // quite ugly).
    for (i=1;i<=menuLengths.length;i++)
        fn_closeMenu(i,'menu');
    for (i=1;i<=bmenuLengths.length;i++)
        if (i!=index) fn_closeMenu(i,'bmenu');
    for (i=1;i<=cmenuLengths.length;i++)
        fn_closeMenu(i,'cmenu');

    // Get a reference to the style of the menu to be displayed.
    var menu = fn_getStyleObj("bmenu"+index);
    // Make sure we got a valid reference, and make the menu visible.
    if (menu)
	{
	  menu.left = _x;
	  if (_appName=="Netscape")
	  {
	    if (menu.top == 0 || evt.target.y) menu.top = _y; //nn7
	  }
	  else
	    menu.top = _y;
	  menu.visibility = "visible";
	}

    // Display the 'active' version of the menu button.
    //if (document.images) document.images["menubutton"+index].src =
    //                        menuOverButtons[index-1].src;
}
/* -------------------------------------------------------------------------*/
function fn_showCMenu(index,evt) {
    // do not show menu until page is loaded
	if (_pageLoaded == 0) return false;
    // valid menu ?
    if (index > cmenuLengths.length) return false;
	// get height
	var _height = (cmenuLengths[index-1] * (cmenuItemHeight + 1)) + 1;
	// get navigator info
    var _appName = navigator.appName + "";
	var _appVers = navigator.appVersion + "";
    // get pos
    var _x = 179;
	var _y = 0;
    if (_appName=="Netscape")
	{
	  if (evt.target.y)
	    _y = evt.target.y - 3;
	  else
	    _y = evt.pageY - 6; // temporary NS7 fix
	}
	else
	{
	  _y = event.clientY - event.offsetY + document.body.scrollTop - 5;
	}
    if (_appName=="Netscape")
	{
	  _left = pageXOffset;
	  _right = window.innerWidth + pageXOffset - 15;
	  _bottom = window.innerHeight + pageYOffset - 15;
	}
	else
	{
	  _left = document.body.scrollLeft;
	  _right = document.body.clientWidth + document.body.scrollLeft;
	  _bottom = document.body.clientHeight + document.body.scrollTop;
	}
	if (_x < _left) _x = _left;
	if (_x + cmenuItemWidth + 2 > _right) _x = _right - cmenuItemWidth - 2;
	if (_y + _height > _bottom) _y = _bottom - _height;
    // Make sure this menu is not marked to be closed. This
    // cancels any previous request to close this menu.
    if (cmenuTimers[index-1]) clearTimeout(cmenuTimers[index-1]);

    // Immediately close any other menus so as to avoid
    // having more than one menu open at once (which is
    // quite ugly).
    for (i=1;i<=menuLengths.length;i++)
        fn_closeMenu(i,'menu');
    for (i=1;i<=bmenuLengths.length;i++)
        fn_closeMenu(i,'bmenu');
    for (i=1;i<=cmenuLengths.length;i++)
        if (i!=index) fn_closeMenu(i,'cmenu');

    // Get a reference to the style of the menu to be displayed.
    var menu = fn_getStyleObj("cmenu"+index);
    // Make sure we got a valid reference, and make the menu visible.
    if (menu)
	{
	  menu.left = _x;
	  if (_appName=="Netscape")
	  {
	    if (menu.top == 0 || evt.target.y) menu.top = _y; //nn7
	  }
	  else
	    menu.top = _y;
	  menu.visibility = "visible";
	}

    // Display the 'active' version of the menu button.
    //if (document.images) document.images["menubutton"+index].src =
    //                        menuOverButtons[index-1].src;
}

/**
 * This function sets a menu to be closed after a brief
 * delay given its index. For example, hideMenu(3) will
 * cause the menu that is defined by <DIV ID="menu3"> to
 * be hidden after a brief delay.
 */
function fn_hideMenu(index,_classid) {
    if (_classid == null) _classid = 'menu';
	if (_classid == 'menu')
	{
      if (menuTimers[index-1]) clearTimeout(menuTimers[index-1]);
      menuTimers[index-1] = setTimeout("fn_closeMenu('"+index+"','menu');",500);
	}
	else if (_classid == 'bmenu')
	{
      if (bmenuTimers[index-1]) clearTimeout(bmenuTimers[index-1]);
      bmenuTimers[index-1] = setTimeout("fn_closeMenu('"+index+"','bmenu');",1000);
	}
	else
	{
      if (cmenuTimers[index-1]) clearTimeout(cmenuTimers[index-1]);
      cmenuTimers[index-1] = setTimeout("fn_closeMenu('"+index+"','cmenu');",1000);
	}
}

/**
 * This function closes a popup menu immediately if it
 * has been marked to be closed in the menuClosingFlags array.
 */
function fn_closeMenu(index,_classid) {
    // Get a reference to the style of the menu to be closed.
    var menu = fn_getStyleObj(_classid+index);

    // Make sure we got a valid reference, and hide the menu.
    if (menu) menu.visibility = "hidden";

    // Display the 'inactive' version of the menu button.
    //if (document.images) document.images["menubutton"+index].src =
    //                        menuOutButtons[index-1].src;
}

/**
 * This function is called every time the user's mouse
 * is over a menu item, hilighting that menu item and
 * holding the menu that contains it open.
 */
function fn_overMenuItem() {
    // Each menu item has a 'hilightitem' variable that
    // contains a reference to the <div> that contains
    // the hilighted version of the menu item. We use that
    // reference here to make that hilighted menu item
    // visibile.
    this.hilightitem.visibility='visible';

    // Each menu item has a 'menuid' variable that contains
    // the integer ID of the menu that it belongs to
    // (e.g. 2 if it belongs to "menu2"). By calling the
    // showMenu() function for that menu, we ensure that that
    // menu stays open.
	var index = this.menuid;
	var _classid = this.classid;
	if (_classid == 'menu')
	{
	  if (menuTimers[index-1]) clearTimeout(menuTimers[index-1]);
	}
	else if (_classid == 'bmenu')
	{
	  if (bmenuTimers[index-1]) clearTimeout(bmenuTimers[index-1]);
	}
	else
	{
	  if (cmenuTimers[index-1]) clearTimeout(cmenuTimers[index-1]);
	}
    //showMenu(this.menuid);
}

/**
 * This function is called every time the user's mouse
 * leaves a menu item, un-hilighting that menu item and
 * closing the menu that contains it after a delay.
 */
function fn_outMenuItem() {
    // Each menu item has a 'hilightitem' variable that
    // contains a reference to the <div> that contains
    // the hilighted version of the menu item. We use that
    // reference here to hide that hilighted menu item.
    this.hilightitem.visibility='hidden';

    // Each menu item has a 'menuid' variable that contains
    // the integer ID of the menu that it belongs to
    // (e.g. 8 if it belongs to "menu8"). By calling the
    // hideMenu() function for that menu, we indicate that
    // the menu closes after a delay if the mouse doesn't
    // move to another menu item that will keep it open.
    fn_hideMenu(this.menuid,this.classid);
}

/**
 * This function is called when the user clicks on a
 * menu item. The URL associated with that menu item is
 * then loaded.
 */
function fn_clickMenuItem() {
    if (this.url && this.url != "#") { // There is a URL associated with this item
	  if (this.url.substr(0,7).toLowerCase() == "newwin:")
	    window.open(_root + this.url.substr(7),"raywin","location=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes");
	  else if (this.url.substr(0,5).toLowerCase() == "http:" || this.url.substr(0,6).toLowerCase() == "https:")
	    window.open(this.url,"raywin","location=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes");
	  else
        window.location = _root + this.url;
    }
}

/**
 * This function finishes setting up the menus once the rest
 * of the page has loaded. It performs the following adjustments:
 *
 *    -> Sets the dimensions and positions of the menus and each of the
 *       menu items. Some of these attributes have been set already
 *       using CSS, but some browsers (especially NSN4) have a habit
 *       of ignoring them.
 *    -> Sets up the event handlers for the menu items, which detect and
 *       react to the user's mouse passing over menu items by hilighting
 *       them and closing the menu when the user's mouse leaves it, and
 *       load the correct URL when a menu item is clicked on. This method
 *       allows NSN4 to have onMouseOver/onMouseOut/onClick event handlers
 *       on page elements that are not links.
 *
 * This function is called by the onLoad event handler for this window
 * as soon as the document has finished loading.
 */
window.onload=fn_setupMenus; // Assign to onLoad event handler
function fn_setupMenus() {
    if (document.layers) { // This section is for Netscape 4 only
        for (menuid=1;menuid<=menuLengths.length;menuid++) { // For each menu
            // Get the menu object
            var menu = fn_getObj("menu"+menuid);

            // Set its 'clip' width and height. This forces NSN4 to fill in
            // the background color behind the whole menu area.
            menu.clip.width = menuItemWidth + 2;
            menu.clip.height = (menuItemHeight+1) * menuLengths[menuid-1] + 1;

            // Set the background color of the menu to force NSN4 to fill it
            // using the new 'clip' dimensions we just specified.
            menu.document.bgColor="#000000";

            for (i=1;i<=menuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements. Since they are nested inside the
                // menu DIV, we can't use the getObj function, so we use
                // eval() to grab them directly:
                var item = eval("menu.document.menu"+menuid+"item"+i);
                var onitem = eval("menu.document.menu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each (NSN4 ignores any
                // attempt to do this using CSS).
                item.top = (menuItemHeight + 1) * (i-1) + 1;
                onitem.top = (menuItemHeight + 1) * (i-1) + 1;

                // Dynamically set the 'clip' dimensions and background colors
                // of each of the menu items. Again, we're forcing NSN4 to
                // fill the full width and height of each menu item.
                item.clip.width = menuItemWidth;
                item.clip.height = menuItemHeight;
                item.document.bgColor="#FFFFFF";
                onitem.clip.width = menuItemWidth;
                onitem.clip.height = menuItemHeight;
                onitem.document.bgColor="#000000";

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitem;
                onitem.hilightitem = onitem;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'menu';
				onitem.classid = 'menu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = menuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut/onClick event
                // handlers for each menu item (and its highlighted version) so
                // that they call the overMenuItem(), outMenuItem(), and 
                // clickMenuItem() functions. We also set the types of events
                // that the menu items should react to. This is the only way to
                // get NSN4 to attach onMouseOver/onMouseOut/onClick event
                // handlers to anything but links.
                var eTypes = Event.MOUSEOVER | Event.MOUSEOUT | Event.CLICK;
                item.captureEvents(eTypes);
                onitem.captureEvents(eTypes);
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
        }
		if (bmenuLengths.length) {
          for (menuid=1;menuid<=bmenuLengths.length;menuid++) { // For each menu
            // Get the menu object
            var menu = fn_getObj("bmenu"+menuid);
            // Set its 'clip' width and height. This forces NSN4 to fill in
            // the background color behind the whole menu area.
            menu.clip.width = bmenuItemWidth + 2;
            menu.clip.height = (bmenuItemHeight+1) * bmenuLengths[menuid-1] + 1;

            // Set the background color of the menu to force NSN4 to fill it
            // using the new 'clip' dimensions we just specified.
            menu.document.bgColor="#999999";

            for (i=1;i<=bmenuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements. Since they are nested inside the
                // menu DIV, we can't use the getObj function, so we use
                // eval() to grab them directly:
                var item = eval("menu.document.bmenu"+menuid+"item"+i);
                var onitem = eval("menu.document.bmenu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each (NSN4 ignores any
                // attempt to do this using CSS).
                item.top = (bmenuItemHeight + 1) * (i-1) + 1;
                onitem.top = (bmenuItemHeight + 1) * (i-1) + 1;

                // Dynamically set the 'clip' dimensions and background colors
                // of each of the menu items. Again, we're forcing NSN4 to
                // fill the full width and height of each menu item.
                item.clip.width = bmenuItemWidth;
                item.clip.height = bmenuItemHeight;
                item.document.bgColor="#dddddd";
                onitem.clip.width = bmenuItemWidth;
                onitem.clip.height = bmenuItemHeight;
                onitem.document.bgColor="#999999";

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitem;
                onitem.hilightitem = onitem;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'bmenu';
				onitem.classid = 'bmenu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = bmenuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut/onClick event
                // handlers for each menu item (and its highlighted version) so
                // that they call the overMenuItem(), outMenuItem(), and 
                // clickMenuItem() functions. We also set the types of events
                // that the menu items should react to. This is the only way to
                // get NSN4 to attach onMouseOver/onMouseOut/onClick event
                // handlers to anything but links.
                var eTypes = Event.MOUSEOVER | Event.MOUSEOUT | Event.CLICK;
                item.captureEvents(eTypes);
                onitem.captureEvents(eTypes);
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
		  }
        }
		if (cmenuLengths.length) {
          for (menuid=1;menuid<=cmenuLengths.length;menuid++) { // For each menu
            // Get the menu object
            var menu = fn_getObj("cmenu"+menuid);
            // Set its 'clip' width and height. This forces NSN4 to fill in
            // the background color behind the whole menu area.
            menu.clip.width = cmenuItemWidth + 2;
            menu.clip.height = (cmenuItemHeight+1) * cmenuLengths[menuid-1] + 1;

            // Set the background color of the menu to force NSN4 to fill it
            // using the new 'clip' dimensions we just specified.
            menu.document.bgColor="#999999";

            for (i=1;i<=cmenuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements. Since they are nested inside the
                // menu DIV, we can't use the getObj function, so we use
                // eval() to grab them directly:
                var item = eval("menu.document.cmenu"+menuid+"item"+i);
                var onitem = eval("menu.document.cmenu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each (NSN4 ignores any
                // attempt to do this using CSS).
                item.top = (cmenuItemHeight + 1) * (i-1) + 1;
                onitem.top = (cmenuItemHeight + 1) * (i-1) + 1;

                // Dynamically set the 'clip' dimensions and background colors
                // of each of the menu items. Again, we're forcing NSN4 to
                // fill the full width and height of each menu item.
                item.clip.width = cmenuItemWidth;
                item.clip.height = cmenuItemHeight;
                item.document.bgColor="#dddddd";
                onitem.clip.width = cmenuItemWidth;
                onitem.clip.height = cmenuItemHeight;
                onitem.document.bgColor="#999999";

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitem;
                onitem.hilightitem = onitem;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'cmenu';
				onitem.classid = 'cmenu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = cmenuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut/onClick event
                // handlers for each menu item (and its highlighted version) so
                // that they call the overMenuItem(), outMenuItem(), and 
                // clickMenuItem() functions. We also set the types of events
                // that the menu items should react to. This is the only way to
                // get NSN4 to attach onMouseOver/onMouseOut/onClick event
                // handlers to anything but links.
                var eTypes = Event.MOUSEOVER | Event.MOUSEOUT | Event.CLICK;
                item.captureEvents(eTypes);
                onitem.captureEvents(eTypes);
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
		  }
        }
    } else { // This section is for all other browsers
        for (menuid=1;menuid<=menuLengths.length;menuid++) { // For each menu

            // The menus' sizes and background colors are already set using CSS,
            // since Opera doesn't like dynamically setting page element sizes
            // with JavaScript.

                for (i=1;i<=menuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements and their styles.
                var item = fn_getObj("menu"+menuid+"item"+i);
                var onitem = fn_getObj("menu"+menuid+"item"+i+"on");
                var itemstyle = fn_getStyleObj("menu"+menuid+"item"+i);
                var onitemstyle = fn_getStyleObj("menu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each. All other style attributes
                // are set using CSS for compatibility with Opera.
                itemstyle.top = ((menuItemHeight + 1) * (i-1) + 1) + "px";
                onitemstyle.top = ((menuItemHeight + 1) * (i-1) + 1) + "px";
                
                // Set the mouse cursor for the menu items to look like a
                // hand. This is for MSIE only. DOM-compliant browsers like
                // NSN6 will use the cursor:pointer setting in the CSS.
                if (navigator.appName=="Microsoft Internet Explorer") {
                    itemstyle.cursor = "hand";
                    onitemstyle.cursor = "hand";
                }

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitemstyle;
                onitem.hilightitem = onitemstyle;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'menu';
				onitem.classid = 'menu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = menuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut event handlers for
                // each menu item (and its highlighted version) so that they
                // call the overMenuItem() and outMenuItem() functions. We could
                // have just set these as attributes in the <DIV> tags, but since
                // NSN4 doesn't support that we'll keep things tidy and do it the
                // same way as we did above for that browser.
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
        }
		if (bmenuLengths.length)
		{
          for (menuid=1;menuid<=bmenuLengths.length;menuid++) { // For each menu

            // The menus' sizes and background colors are already set using CSS,
            // since Opera doesn't like dynamically setting page element sizes
            // with JavaScript.
                for (i=1;i<=bmenuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements and their styles.
                var item = fn_getObj("bmenu"+menuid+"item"+i);
                var onitem = fn_getObj("bmenu"+menuid+"item"+i+"on");
                var itemstyle = fn_getStyleObj("bmenu"+menuid+"item"+i);
                var onitemstyle = fn_getStyleObj("bmenu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each. All other style attributes
                // are set using CSS for compatibility with Opera.
                itemstyle.top = ((bmenuItemHeight + 1) * (i-1) + 1) + "px";
                onitemstyle.top = ((bmenuItemHeight + 1) * (i-1) + 1) + "px";
                
                // Set the mouse cursor for the menu items to look like a
                // hand. This is for MSIE only. DOM-compliant browsers like
                // NSN6 will use the cursor:pointer setting in the CSS.
                if (navigator.appName=="Microsoft Internet Explorer") {
                    itemstyle.cursor = "hand";
                    onitemstyle.cursor = "hand";
                }

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitemstyle;
                onitem.hilightitem = onitemstyle;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'bmenu';
				onitem.classid = 'bmenu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = bmenuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut event handlers for
                // each menu item (and its highlighted version) so that they
                // call the overMenuItem() and outMenuItem() functions. We could
                // have just set these as attributes in the <DIV> tags, but since
                // NSN4 doesn't support that we'll keep things tidy and do it the
                // same way as we did above for that browser.
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
		  }
        }
		if (cmenuLengths.length)
		{
          for (menuid=1;menuid<=cmenuLengths.length;menuid++) { // For each menu

            // The menus' sizes and background colors are already set using CSS,
            // since Opera doesn't like dynamically setting page element sizes
            // with JavaScript.
                for (i=1;i<=cmenuLengths[menuid-1];i++) { // For each menu item

                // Each menu item is actually composed of two <DIV> tags:
                // one for the menu item's regular appearance, and one for
                // what the menu item should look like when the user's mouse
                // passes over it. We start by obtaining references to each
                // of these page elements and their styles.
                var item = fn_getObj("cmenu"+menuid+"item"+i);
                var onitem = fn_getObj("cmenu"+menuid+"item"+i+"on");
                var itemstyle = fn_getStyleObj("cmenu"+menuid+"item"+i);
                var onitemstyle = fn_getStyleObj("cmenu"+menuid+"item"+i+"on");

                // Dynamically set the vertical position of each menu item,
                // leaving a 1-pixel gap between each. All other style attributes
                // are set using CSS for compatibility with Opera.
                itemstyle.top = ((cmenuItemHeight + 1) * (i-1) + 1) + "px";
                onitemstyle.top = ((cmenuItemHeight + 1) * (i-1) + 1) + "px";
                
                // Set the mouse cursor for the menu items to look like a
                // hand. This is for MSIE only. DOM-compliant browsers like
                // NSN6 will use the cursor:pointer setting in the CSS.
                if (navigator.appName=="Microsoft Internet Explorer") {
                    itemstyle.cursor = "hand";
                    onitemstyle.cursor = "hand";
                }

                // When the user's mouse is over a menu item, we want to display
                // the highlighted version of the menu item (which is hidden by
                // default). The functions overMenuItem() and outMenuItem() are
                // responsible for showing and hiding the highlighted versions of
                // the menu items. Since these 'mouseover' and 'mouseout' events
                // can come from both the normal and hilighted menu item
                // under different conditions, we need a way for these functions
                // to access the hilighted menu item no matter which of the two
                // versions of the menu item ('item' and 'onitem') triggers them.
                // What we do is attach a variable called 'hilightitem' to both
                // of them containing a reference to the highlighted menu item
                // ('onitem'). The functions can then use this reference to show
                // and hide the hilighted item as appropriate.
                item.hilightitem = onitemstyle;
                onitem.hilightitem = onitemstyle;

                // The onverMenuItem() and outMenuItem() functions also need to
                // know what menu the menu item that triggered them belongs to,
                // so that they can close or keep open that menu as appropriate.
                // So we store the menu ID in a variable called 'menid'
                // attached to each menu item (and its highlighted version).
                item.menuid = menuid;
                onitem.menuid = menuid;
				item.classid = 'cmenu';
				onitem.classid = 'cmenu';

                // We also record the URL associated with each menu item, which
                // will be used by the clickMenuItem() function to load the URL
                // when the menu item is clicked on. The URL is fetched from the
                // menuURLs array created above.
                var url = cmenuURLs[menuid-1][i-1];
                item.url = url;
                onitem.url = url;

                // Finally, we set the onMouseOver/onMouseOut event handlers for
                // each menu item (and its highlighted version) so that they
                // call the overMenuItem() and outMenuItem() functions. We could
                // have just set these as attributes in the <DIV> tags, but since
                // NSN4 doesn't support that we'll keep things tidy and do it the
                // same way as we did above for that browser.
                item.onmouseover = fn_overMenuItem;
                onitem.onmouseover = fn_overMenuItem;
                item.onmouseout = fn_outMenuItem;
                onitem.onmouseout = fn_outMenuItem;
                item.onclick = fn_clickMenuItem;
                onitem.onclick = fn_clickMenuItem;
            }
		  }
        }
    }
	_pageLoaded = 1;
}

//-->