var openSubMenu = 0;
var selectedMainMenu = 0;
var selectedSubMenu = 0;
var rightBarColor = "";
	
function HiliteSubMenu(obj)
{
	obj.style.cursor = "hand";
	obj.style.backgroundColor = "#002067";
}

function DeliteSubMenu(obj)
{
	if (obj.id != ("subMenuItem" + selectedMainMenu + "_" + selectedSubMenu))
	{
		obj.style.cursor = "default";
		obj.style.backgroundColor = "#8498C2";
	}
}

function HiliteMainMenu(obj)
{
	obj.style.cursor = "hand";
	obj.style.color = "#FFCC33";
}

function DeliteMainMenu(obj)
{
	if (obj.id != ("mainMenu" + openSubMenu))
	{
		obj.style.cursor = "default";
		obj.style.color = "#FFFFFF";
	}
}
		
function DisplaySubMenu(number)
{
	if (openSubMenu != 0)
	{
		if (document.getElementById("subMenu" + openSubMenu) != null)
		{
			document.getElementById("subMenu" + openSubMenu).style.display = "none";
		}
		document.getElementById("mainMenu" + openSubMenu).style.color = "#FFFFFF";
	}
			
	if (openSubMenu == number)
	{
		document.getElementById("mainMenu" + openSubMenu).style.color = "#FFCC33";
		openSubMenu = 0;
	}
	else
	{
		document.getElementById("subMenu" + number).style.display = "block";
		document.getElementById("mainMenu" + number).style.color = "#FFCC33";
		openSubMenu = number;
	}
}
		
function InitMenu(main,sub)
{
	if (main != 0)
	{
		if (document.getElementById("subMenu" + main) != null)
		{
			selectedMainMenu = main;
			DisplaySubMenu(main)
			
			if (sub > 0)
			{
				selectedSubMenu = sub;
				document.getElementById("subMenuItem" + main + "_" + sub).style.backgroundColor = "#002067";
			}
		}
		else
		{
			document.getElementById("mainMenu" + main).style.color = "#FFCC33";
			openSubMenu = main;
		}
	}
}

function OpenLocation(url)
{
	document.location = url;
}
		
var menuOpened = false;
var timerId;
		
function ShowYourIndustryMenu()
{
	var menu = document.getElementById("yourIndustryMenu");
	var menuTopCss = new String();
	var menuTopInt;
		
	menuTopCss = menu.style.top;
	menuTopCss = menuTopCss.replace("px","");
	menuTopInt = parseInt(menuTopCss);
			
	if (menuTopInt > 0)
	{
		menu.style.top = (menuTopInt - 10) + "px";
		timerId = setTimeout("ShowYourIndustryMenu()", 5);
	}
	else
	{
		menuOpened = true;
	}			
}
		
function HideYourIndustryMenu()
{
	var menu = document.getElementById("yourIndustryMenu");
	var menuTopCss = new String();
	var menuTopInt;
			
	if (menuOpened)
	{
		menuTopCss = menu.style.top;
		menuTopCss = menuTopCss.replace("px","");
		menuTopInt = parseInt(menuTopCss);
			
		if (menuTopInt < 130 )
		{
			menu.style.top = (menuTopInt + 10) + "px";
			timerId = setTimeout("HideYourIndustryMenu()", 5);
		}
		else
		{
			menuOpened = false;
			closeMenu = false;
		}
	}
}

function ShowObject(layerId)
{
	document.getElementById(layerId).style.display = "block";
}

function HideObject(layerId)
{
	document.getElementById(layerId).style.display = "none";
}

function OpenWindow(page, windowName, windowWidth, windowHeight)
{
	var features = "top=50,left=50,width=" + windowWidth + ",height=" + windowHeight;
	window.open(page, windowName, features);
}



function SetRightBarColor()
{
	if (rightBarColor == "white")
	{
		document.getElementById("mainTable").background = "";
		document.getElementById("rightBottom").background = "";
	}
}

function ShowPicture(image)
{
	var page = "/showPicture.asp?image=" + image;
	var windowName = "picture";
	var features = "top=50,left=50,width=480,height=300";
	
	window.open(page, windowName, features);
}
