<!--

var usragent=navigator.userAgent.toLowerCase();
var is_mac  = (usragent.indexOf("mac") != -1);
var is_win  = (usragent.indexOf("win") != -1);
var is_ie   = (usragent.indexOf("msie") != -1); 
var is_nav  = ((usragent.indexOf('mozilla')!=-1) && (usragent.indexOf('spoofer')==-1) 
            && (usragent.indexOf('compatible') == -1) && (usragent.indexOf('opera')==-1) 
            && (usragent.indexOf('webtv')==-1));


var isDOM = document.getElementById?1:0;
var isIE  = document.all?1:0;
var isNS4 = navigator.appName=='Netscape'&&!isDOM?1:0;

function showMenu()
{
	if (isDOM)
	{
		document.getElementById(this.name).style.visibility = "visible";

		if (document.getElementById("divSelect"))
			document.getElementById("divSelect").style.visibility = "hidden";
	}
	else if (isIE)
	{
		document.all[this.name].style.visibility = "visible";

		if (document.all["divSelect"])
			document.all["divSelect"].style.visibility = "hidden";
	}

	this.isVisible = true;

	if (this.highlightElement != null)
		setHighlight(this.highlightElement, true);
}

function hideMenu()
{
	if (isDOM)
	{
		document.getElementById(this.name).style.visibility = "hidden";

		if (document.getElementById("divSelect"))
			document.getElementById("divSelect").style.visibility = "visible";
	}
	else if (isIE)
	{
		document.all[this.name].style.visibility = "hidden";

		if (document.all["divSelect"])
			document.all["divSelect"].style.visibility = "visible";
	}

	this.isVisible = false;

	if (this.highlightElement != null)
		setHighlight(this.highlightElement, false);
}

function setMouseOver()
{
	this.isMouseOver = true;

	var p = this.parent;
	while (p != null)
	{
		clearTimeout(p.timer);
		p = p.parent;
	}

	clearTimeout(this.timer);
	this.timer = setTimeout("setMenuState(" + this.name + ");", delayTime);
	//this.show();
}

function setMouseOut()
{
	this.isMouseOver = false;
	clearTimeout(this.timer);
	this.timer = setTimeout("setMenuState(" + this.name + ");", delayTime);
	//this.hide();

	var p = this.parent;
	while (p != null)
	{
		if ((!p.isMouseOver) && (p.isVisible))
		{
			clearTimeout(p.timer);
			p.timer = setTimeout("setMenuState(" + p.name + ");", delayTime);
		}
		p = p.parent;
	}
}

function setMenuState(menu)
{
	if (!isNS4)
	{
		if ((menu.isMouseOver) && (!menu.isVisible))
			menu.show();
		else if ((!menu.isMouseOver) && (menu.isVisible))
			menu.hide();
	}
}

function popMenu(menuName, highlight, subMenuArray)
{
	this.show = showMenu;
	this.hide = hideMenu;
	this.mouseOver = setMouseOver;
	this.mouseOut = setMouseOut;
	
	this.name = menuName;
	this.highlightElement = highlight;
	this.parent = null;
	this.isSubMenu = false;
	this.hasChildren = false;
	this.isVisible = false;
	this.isMouseOver = false;
	this.timer = 0;
	
	if (subMenuArray != null)
	{
		this.hasChildren = true;
		this.children = subMenuArray;
		for (i = 0; i < subMenuArray.length; i++)
		{
			subMenuArray[i].isSubMenu = true;
			subMenuArray[i].parent = this;
		}
	}
}

function setHoverState(menu, isOver)
{
	if (!isNS4)
	{
		if (isOver)
			menu.mouseOver();
		else
			menu.mouseOut();
	}
}

function setHighlight(item, isOver)
{
	var bgColor = "#eaecf1";
	if (isOver)
		bgColor = "#BEC6CE";
	
	if (isDOM)
		document.getElementById(item).style.background = bgColor;
	else if (isIE)
		document.all[item].style.background = bgColor;
}

function highlightCell(td, isHover)
{
	if (isHover)
		td.className = "menuhover";
	else
		td.className = "menu";
}

if (!isNS4)
{
	var subProducts = new popMenu("subProducts", null, null);
	var delayTime = 250;
}


// -->
