/*
 * menuDropdown.js - implements an dropdown menu based on a HTML list
 * Author: Dave Lindquist (http://www.gazingus.org)
 */
var currentMenu = null;
if (!document.getElementById)
	document.getElementById = function () {
	return null;
}
function initializeMenu(menuId, urlId) {
	var menu = document.getElementById(menuId);
	var url = document.getElementById(urlId);
	if (menu == null || url == null)
		return;
	menu.onmouseover = function () {
		if (currentMenu == null) {
			this.showMenu();
		}
	}
	menu.onmouseout = function () {
		if (currentMenu != null) {
			currentMenu.style.display = "none";
			currentMenu = null;
		}
	}
	url.onmouseout = function () {
		if (currentMenu != null) {
			currentMenu.style.display = "none";
			currentMenu = null;
		}
	}
	url.onmouseover = function () {
		if (currentMenu == null) {
			this.showMenu();
		}
	}
	url.showMenu = function () {
		menu.style.left = this.offsetLeft - 4 + "px";
		menu.style.bottom = "22px";
		menu.style.position = "absolute";
		menu.style.display = "block";
		currentMenu = menu;
	}
	menu.showMenu = function () {
		menu.style.display = "block";
		currentMenu = menu;
	}
}
