            // MenuBars is a variable, but in this context it acts like a class with properties, events and methods
            var MenuBars = {
                    // Define variables (Properties of this class)
                    aSubMenus:[],                                   // Array of 2nd level menu items
                    aInnerSubMenus:[],                              // Array of 3rd level menu items
                    sLastMenu:null,                                 // element containing 'id' of last 2nd level menu item to be displayed
                    sLastInnerMenu:null,                            // element containing 'id' of last 3rd level menu item to be displayed
                
                    // Function that displays 2nd level menus
                    ShowSubmenu:function(sMenu)
                    {
                        this.HideSubmenus();                            // call function to hide all 2nd level menu items
                        this.HideInnerSubmenus();                       // call function to hide all 3rd level menu items
                        
                        if (this.sLastMenu != null)                     // check to see if a previous 2nd level menu was displayed
                            this.sLastMenu.className = "";              // if so, hide that menu via CSS

                        if (sMenu.getAttribute("rel"))                  // check to see if the current menu has submenus
                            document.getElementById(sMenu.getAttribute("rel")).style.display = "block";

                        sMenu.className = "current";                    // set the css property of selected submenu to 'current' to display
                        this.sLastMenu = sMenu;                         // set the 'sLastMenu' attribute for next pass-thru
                    },

                    // Function that displays 3rd level menus
                    ShowInnerSubmenu:function(sMenu)
                    {
                       this.HideInnerSubmenus();                       // call function to hide all 3rd level menu items
                        
                        if (this.sLastInnerMenu != null)                // check to see if a previous 3rd level menu was displayed
                            this.sLastInnerMenu.className = "";         // if so, hide that menu via css
                        
                        if (sMenu.getAttribute("rel")){                 // check to see if the current menu has submenus
	                        if (sMenu.offsetParent)
		                        var curleft = sMenu.offsetLeft;
                            document.getElementById(sMenu.getAttribute("rel")).style.position="relative";
                            document.getElementById(sMenu.getAttribute("rel")).style.left=sMenu.offsetLeft-10; 
                            document.getElementById(sMenu.getAttribute("rel")).style.display="inline";
                        }
                        
                        sMenu.className = "current";                    // set the css property of selected submenu to 'current' to display
                        this.sLastInnerMenu = sMenu;                    // set the 'sLastInnerMenu' attribute for next pass-thru
                    },

                    // Function that hides all 2nd level menus
                    HideSubmenus:function()
                    {
                        // Iterate through each submenu item, and set its display css attribute to 'none'
                        for (var iCtr = 0; iCtr < this.aSubMenus.length; iCtr++)
                            document.getElementById(this.aSubMenus[iCtr]).style.display = "none";
                    },

                    // Function that hides all 3rd level menus
                    HideInnerSubmenus:function()
                    {
                        // Iterate through each submenu item, and set its display css attribute to 'none'
                        for (var iCtr = 0; iCtr < this.aInnerSubMenus.length; iCtr++)
                            document.getElementById(this.aInnerSubMenus[iCtr]).style.display = "none";
                    },

                    // Function that initializes the menus and sets them up for usage
                    Init:function(iMenuID, iIndex)
                    {
                        // Grab all HTML elements in the containing HTML element with the passed-in "ID" and put them in an array
                        var aMenuItems = document.getElementById(iMenuID).getElementsByTagName("a");

                        // Process each HTML element in the array established in the previous line (these will be 2nd level menus)
                        for (var iCtr = 0; iCtr < aMenuItems.length; iCtr++){

                            // Check to see if the currently selected HTML element has a "rel" attribute (or a submenu)
                            if (aMenuItems[iCtr].getAttribute("rel")){

                                // Process this particular submenu, add it to the 'aSubMenus' array
                                this.aSubMenus[this.aSubMenus.length] = aMenuItems[iCtr].getAttribute("rel");

                                // Now grab all HTML elements in this submenu item and put in a new array for 3rd level menus
                                var aSubMenuItems = document.getElementById(aMenuItems[iCtr].getAttribute("rel")).getElementsByTagName("a");

                                // Process each HTML element in the array established in the previous line (these will be the 3rd level menus)
                                for (var iCtr2 = 0; iCtr2 < aSubMenuItems.length; iCtr2++){

                                    // Check to see if the currently selected HTML element has a "rel" attribute (or a submenu)
                                    if (aSubMenuItems[iCtr2].getAttribute("rel")){

                                        // Process this particular submenu, add it to the 'aInnerSubMenus' array
                                        this.aInnerSubMenus[this.aInnerSubMenus.length] = aSubMenuItems[iCtr2].getAttribute("rel");
                                    }

                                    // Assign an "EVENT" to this 2nd level menu item that will trigger display of its 3rd level menu when the mouse hovers over it
                                    aSubMenuItems[iCtr2].onmouseover = function()
                                    {
                                        MenuBars.ShowInnerSubmenu(this);
                                    }
                                }        
                            }

                            // Assign an "EVENT" to this 1st level menu item that will trigger display of its 2nd level menu when the mouse hovers over it
                            aMenuItems[iCtr].onmouseover = function()
                            {
                                MenuBars.ShowSubmenu(this);
                            }
	                    }
                        this.HideSubmenus();
                        this.HideInnerSubmenus();
                    }
                }

navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
