// JavaScript Document

//  Global Variable List

var whatToHideforTimeOut;
var isMouseOverSubmenu = false;
var mainListItemToBeHighlighted;

// ***************************************************************************************************
	
function ShowOrHide(whatToHide, x)
{
	var totalMenuItems = 9;
	
	whatToHideforTimeOut = whatToHide;
	
	var elementToChange = document.getElementById('List'+whatToHide).style.display;

	if (elementToChange == "none")
	{
		document.getElementById('List'+whatToHide).style.display="block";		
		setTimeout("document.getElementById('List'+whatToHideforTimeOut).style.opacity='1';", 25);
		document.getElementById('MainListDiv'+whatToHide).style.background='#008080';
		document.getElementById('MainListDiv'+whatToHide).style.MozTransform = "translate(10px)";
		if (navigator.appName == "Opera")
		{
			document.getElementById('MainListDiv'+whatToHide).setAttribute('style','-o-transform: translate(10px)');
		}
		document.getElementById('MainListDiv'+whatToHide).style.webkitTransform = "translate(10px)";
		
	}
	else if (elementToChange == "block")
	{
		if (navigator.appName != "Opera")
		{
			document.getElementById('List'+whatToHide).style.opacity="0";
		}
		if (mainListItemToBeHighlighted != whatToHide)
		{
			document.getElementById('MainListDiv'+whatToHide).style.background="";
		}
		document.getElementById('List'+whatToHide).style.webkitTransform="translate(0px)";
		document.getElementById('MainListDiv'+whatToHide).style.webkitTransform = "translate(0px)"
		document.getElementById('MainListDiv'+whatToHide).setAttribute('style','-o-transform: translate(0px)');
		document.getElementById('MainListDiv'+whatToHide).style.MozTransform = "translate(0px)";
		document.getElementById('List'+whatToHideforTimeOut).style.display='none';
	}
}

// ***************************************************************************************************


function WhereAmIFunction() {

	var currentpath = (window.location.pathname).substring(8);
	
	if (currentpath.substr(0,9) == 'sub_menus') 
	{
		ExpandMenuForPageLoad(1);
	}
//	if (currentpath.substr(0,9) == 'default-c') 
//	{
//		ExpandMenuForPageLoad(1);
//	}
	if (currentpath.substr(0,8) == 'about_us') 
	{
		ExpandMenuForPageLoad(1);
	}
	else if (currentpath.substr(0,25) == 'strategic-market-planning') 
	{
		ExpandMenuForPageLoad(4);
	}
	else if (currentpath.substr(0,23) == 'operations/benchmarking') 
	{
		ExpandMenuForPageLoad(5);
	}
		else if (currentpath.substr(0,25) == 'supply-chain-intelligence') 
		{
			ExpandMenuForPageLoad(5);
		}
	else if (currentpath.substr(0,35) == 'operations/benchmarking-reports.asp') 
	{
		ExpandMenuForPageLoad(8);
	}
	else if (currentpath.substr(0,26) == 'operations/lsp-consortium/') 
	{
		ExpandMenuForPageLoad(5);
	}
	else if (currentpath.substr(0,10) == 'operations') 
	{
		ExpandMenuForPageLoad(2);
	}
		else if (currentpath.substr(0,6) == 'global') 
		{
			ExpandMenuForPageLoad(2);
		}
		else if (currentpath.substr(0,18) == 'asia-supply-chains') 
		{
			ExpandMenuForPageLoad(2);
		}
		else if (currentpath.substr(0,20) == 'sustainable-business') 
		{
			ExpandMenuForPageLoad(2);
		}
		else if (currentpath.substr(0,8) == 'strategy') 
		{
			ExpandMenuForPageLoad(2);
		}
		else if (currentpath.substr(0,20) == 'service-supply-chain') 
		{
			ExpandMenuForPageLoad(2);
		}
		else if (currentpath.substr(0,13) == 'costreduction') 
		{
			ExpandMenuForPageLoad(2);
		}
	else if (currentpath.substr(0,7) == 'systems') 
	{
		ExpandMenuForPageLoad(3);
	}
	else if (currentpath.substr(0,11) == 'integration')
	{
		ExpandMenuForPageLoad(4);
	}
	//	else if (currentpath.substr(0,22) == 'systems/TU/default.asp') 
	//	{
	//		ExpandMenuForPageLoad(4);
	//	}
	else if (currentpath.substr(0,10) == 'industries') 
	{
		ExpandMenuForPageLoad(7);
	}
	else if (currentpath.substr(0,12) == 'publications') 
	{
		ExpandMenuForPageLoad(8);
	}
		else if (currentpath.substr(0,7) == 'podcast') 
		{
			ExpandMenuForPageLoad(8);
		}
		else if (currentpath.substr(0,5) == 'books') 
		{
			ExpandMenuForPageLoad(8);
		}
		else if (currentpath.substr(0,17) == 'asdf/SCE_home.asp') 
		{
			ExpandMenuForPageLoad(8);
		}
	else if (currentpath.substr(0,4) == 'news') 
	{
		document.getElementById('MainList9').style.textDecoration="underline";
		//as of 11-9-11, this section of the site did not have sub pages, and no sub menus. This only makes it underline itself
	}
}




function ExpandMenuForPageLoad(listNumber)
	{
		document.getElementById('MainListDiv'+listNumber).style.background="#008080";

		mainListItemToBeHighlighted = listNumber;
	}

