
var mouseoverColor
var mouseoutColor
var thisScreenColor
var savedNavItem
function changeColor(navLine, which)
{

	if (navLine==savedNavItem)
	{
	}
	else
	{
		//navigation mouseover color
		if (which == 1)
		{
			navLine.style.color=mouseoverColor
		}
	
		//navigation mouseout color
		if (which == 2)
		{
			navLine.style.color=mouseoutColor
		}
		//navigation this screen color (current page)
		if (which == 3)
		{
			navLine.style.color=thisScreenColor
		}
	}
}

function pageColors(mouseover, mouseout, thisScreen, navItem)
{
//Parameters are: 
//                Mouse over color, Mouse out color, This screen item color
//		  Nav text to look for to highlight
	
//Set the color for the navigation bar - mouseover and mouseout and this screen
	mouseoverColor=mouseover
	mouseoutColor=mouseout
	thisScreenColor=thisScreen
	
//Highlight current page in left navigation bar
	var navigationElements = document.getElementById("leftNavTopText")
	var navDivLength = navigationElements.children.length
	
	for (i=0; i<navDivLength; i++)
	{
		var navigationItem = navigationElements.children[i].innerText
		if  (navigationItem==navItem)
		{
			var thisNavItem = navigationElements.children[i]
			changeColor(thisNavItem,3)
			savedNavItem = thisNavItem
		}
		else
		{
			//var thisNavItem = navigationElements.children[i]
			//changeColor(thisNavItem,1)
		}
	}

	var navigationElements1 = document.getElementById("leftNavText")
	if (navigationElements1 != null)
	{
	var navDivLength1 = navigationElements1.children.length
	}
	else
		{
			var navDivLength1 = 0
		}
	
	for (i=0; i<navDivLength1; i++)
	{
		var navTextLength1 = navigationElements1.children[i].children.length
		//skip over the first element
		for (j=1; j<navTextLength1-1; j++)
		if  (navigationElements1.children[i].children[j].innerText==navItem)
		{
			var thisNavItem = navigationElements1.children[i].children[j]
			changeColor(thisNavItem,3)
			savedNavItem = thisNavItem
		}
		else
		{
			//var thisNavItem = navigationElements1.children[i].children[j]
			//changeColor(thisNavItem,2)
		}
	}

	var navigationElements2 = document.getElementById("leftNavText2")
	
	if (navigationElements2 != null)
	{
	var navDivLength2 = navigationElements2.children.length
	}
	else
		{
			var navDivLength2 = 0
		}
	
	for (i=0; i<navDivLength2; i++)
	{
		var navTextLength2 = navigationElements2.children[i].children.length

		for (j=0; j<navTextLength2; j++)
		{
			if  (navigationElements2.children[i].children[j].tagName=="A")
			{
			//alert(navigationElements2.children[i].children[j].tagName)
		
				if  (navigationElements2.children[i].children[j].innerText==navItem)
				{	
					var thisNavItem = navigationElements2.children[i].children[j]
					changeColor(thisNavItem,3)
					savedNavItem = thisNavItem
				}
				else
				{
					//var thisNavItem = navigationElements2.children[i].children[j]
					//changeColor(thisNavItem,2)
				}
			}
		}
	}

function MM_openBrWindow(theURL,winName,features) 
{ 
  window.open(theURL,winName,features);
}



}