function addMenuItem(menuID, subID){
	var menu = document.getElementById(menuID);
	var submenu = document.getElementById(subID);
	menu.onmouseover = function(){
		showSubNav(subID);
		if (this.className != 'on') showUnderline(this); // fix safari bug with the hover style losing effect
	}
	menu.onmouseout = function(){
		hideSubNav(subID);
		hideUnderline(this); // fix safari bug with the hover style losing effect
	}
	submenu.onmouseover = function(){
		showSubNav(subID);
		if(_subMenuOn != subID) showUnderline(menu);
	}
	submenu.onmouseout = function(){
		hideSubNav(subID);
		hideUnderline(menu);
	}
}

function setOnMenu(sub){
	if (sub){
		_subMenuOn = sub;
		showSubNav(sub);
	}
}

function showUnderline(elem){
	elem.style.textDecoration = 'underline';
}

function hideUnderline(elem){
	elem.style.textDecoration = 'none';
}

function showSubNav(id){
	var elem = document.getElementById(id);
	if (elem) elem.style.visibility = "visible";
	var current = document.getElementById(_subMenuOn);
	if (current && id != _subMenuOn) current.style.visibility = "hidden";
}

function hideSubNav(id){
	if (_subMenuOn != id){
		var elem = document.getElementById(id);
		elem.style.visibility = "hidden";
		
		//set back to current
		var current = document.getElementById(_subMenuOn);
		if (current) current.style.visibility = "visible";
	}
}


// pop up window
function popUp(theURL,winName,features) {
	window.open(theURL,winName,features);
	//return false;
}

