﻿function NpiMenuColor(anElement)
{
	var menuColor;
	if (anElement.currentStyle)	//for IE
	{
		menuColor = anElement.currentStyle.backgroundImage;
	}
	else if (window.getComputedStyle) // for Mozilla
	{
		menuColor = document.defaultView.getComputedStyle(anElement,null).getPropertyValue("background-image");
	}
//	else
//	{
//	    menuColor = anElement.style.background;
//	}
//	if(menuColor.length>0){
        if(menuColor.indexOf("green")!=-1) return "green";
        if(menuColor.indexOf("orange")!=-1) return "orange";
        if(menuColor.indexOf("purple")!=-1) return "purple";
        if(menuColor.indexOf("red")!=-1) return "red";
//	}else{
//	    alert("An error occured while setting up the menu color")
//	}
}
function NpiMenuItemMouseOver(anElement)
{
	anElement.style.backgroundPosition = "0px -46px";
}
function NpiMenuItemMouseOut(anElement)
{
	anElement.style.backgroundPosition = "0px 0px";
}
function NpiMenuItemClick(elementId)
{
	var targetElement = document.getElementById(elementId);
	if(targetElement!=null)
	    targetElement.style.display = (targetElement.style.display == "none" || targetElement.style.display == "")? targetElement.style.display = "block" : targetElement.style.display = "none";
}
function NpiMenuSubItemMouseOver(anElement)
{
	anElement.className = "NpiSubmenuItemHover";
}
function NpiMenuSubItemMouseOut(anElement)
{
	anElement.className = "NpiSubmenuItem";
}
function NpiMenuSubItemClick(anUrl, aTarget)
{
    window.open(anUrl, aTarget);
}


