/* * menuDropdown.js - implements an dropdown menu based on a HTML list * Author: Dave Lindquist (http://www.gazingus.org) *//* sets the currentMenu variable to null */var currentMenu = null;/* jackadd - create currentSubMenu variable */var currentSubMenu = null;if (!document.getElementById)    document.getElementById = function() { return null; }/* sets up the function by which the menubar is initialized when the page loads */function initializeMenu(menuId, actuatorId) {    var menu = document.getElementById(menuId);    var actuator = document.getElementById(actuatorId);    if (menu == null || actuator == null) return;    //if (window.opera) return; // I'm too tired/* jackadd - added function that will make submenus hidden as well */    actuator.onmouseover = function() {        if (currentMenu) {            currentMenu.style.visibility = "hidden";            this.showMenu();        }		if (currentSubMenu) {			currentSubMenu.style.visibility = "hidden";			currentSubMenu = null;		}		    }      actuator.onclick = function() {        if (currentMenu == null) {            this.showMenu();        }        else {            currentMenu.style.visibility = "hidden";            currentMenu = null;        }        return false;    }    actuator.showMenu = function() {        menu.style.left = this.offsetLeft + "px";        menu.style.top = this.offsetTop + this.offsetHeight + "px";        menu.style.visibility = "visible";        currentMenu = menu;    }}/* jackadd - sets up the function by which the submenus are initialized when the page loads */function initializeSubMenu(submenuId, subactuatorId) {    var submenu = document.getElementById(submenuId);    var subactuator = document.getElementById(subactuatorId);    if (submenu == null || subactuator == null) return;    //if (window.opera) return; // I'm too tired		    subactuator.onmouseover = function() {        if (currentSubMenu) {            currentSubMenu.style.visibility = "hidden";            this.showSubMenu();        }    }      subactuator.onclick = function() {        if (currentSubMenu == null) {            this.showSubMenu();        }        else {            currentSubMenu.style.visibility = "hidden";            currentSubMenu = null;        }        return false;    }	    subactuator.showSubMenu = function() {        submenu.style.left = this.offsetLeft + 185 + "px";        submenu.style.top = this.offsetTop + "px";        submenu.style.visibility = "visible";        currentSubMenu = submenu;    }}