function clikker(a,b,c,d,f,g,h,i) {
	if (a.style.display =='') {
		a.style.display = 'none';
	}
	else {
 		a.style.display='';
		b.style.display = 'none';
		c.style.display = 'none';
		d.style.display = 'none';
		f.style.display = 'none';
		g.style.display = 'none';

	}
}

	var positionIncrement = 2;
	var timerInterval = 20;
	var maxTop = 40;
	var oldTimerValue = "";
	
	function incrementPosition(id)
	{
		var oldT = parseInt(document.getElementById(id).style.top);
		var newT = parseInt(oldT + positionIncrement);
		if (newT > maxTop) { newT = maxTop; }
		document.getElementById(id).style.top = newT;
		document.getElementById(id).style.display = '';
		if (newT < maxTop) 
		{
			oldTimerValue = window.setTimeout("incrementPosition('" + id + "')", timerInterval);
		}
	}



	function resetAllPositions()
	{
		window.clearTimeout(oldTimerValue); 
			
		if (document.getElementById("divSubNav_Services")) { document.getElementById("divSubNav_Services").style.top = 0; }
		if (document.getElementById("divSubNav_Markets")) { document.getElementById("divSubNav_Markets").style.top = 0; }
		if (document.getElementById("divSubNav_About")) { document.getElementById("divSubNav_About").style.top = 0; }
		if (document.getElementById("divSubNav_Locations")) { document.getElementById("divSubNav_Locations").style.top = 0; }
		if (document.getElementById("divSubNav_News")) { document.getElementById("divSubNav_News").style.top = 0; }
		if (document.getElementById("divSubNav_Work")) { document.getElementById("divSubNav_Work").style.top = 0; }
	}


function dropdown(tdObj)
	{
		//Readjust all sub-nav divs to their starting position, so they are out of sight.
		resetAllPositions();
	 
		var tempName = tdObj.id;
		var splitName = tempName.split("a_");
		var newName = "divSubNav_" + splitName[1];
		splitName = null;
		if (document.getElementById(newName))
		{
			incrementPosition(newName);
			
		}


			
	}
function TopTabOver(tab)
	{
		TabId = tab.id;
		
		TabName = TabId.substring(2, TabId.length);
		if (document.getElementById(TabId))
			document.getElementById(TabId).src = '/images/menu/NAVroll_' + TabName + '.gif';
	}
		
function TopTabOut(tab)
	{
		TabId = tab.id;
		BodyName = document.body.id;
		BodyName = BodyName.substring(3, BodyName.length);
		TabName = TabId.substring(2, TabId.length);
		BodyName = BodyName.toUpperCase();
		TabName = TabName.toUpperCase();
		if (BodyName != TabName)
			{
			if (document.getElementById(TabId))	
				document.getElementById(TabId).src = '/images/menu/Nav_' + TabName + '.gif';
			}
			else
			{
			if (document.getElementById(TabId))
				document.getElementById(TabId).src = '/images/menu/Navroll_' + TabName + '.gif';
			}
	}
	
function switch_image(tab, action, strlength)
	{
	//alert(strlength);
	TabId = tab.id;
	TabName = TabId.substring(strlength, TabId.length);
	
	TabId = 'a_' + TabName;
		if (action=='over')
		{
			document.getElementById(TabId).src = '/images/menu/NAVroll_' + TabName + '.gif';			
		}
		else
		{
			document.getElementById(TabId).src = '/images/menu/NAV_' + TabName + '.gif';
			var splitname = TabId.split("_");
			var temp = splitname[1];
			var navplace = SubNavId 
			
			splitname = null;
			document.getElementById('a_' + temp).src = '/images/menu/NAV_' + temp + '.gif';
		}
		//always highlight the selected page type on menu
		BodyName = document.body.id;
		BodyName = BodyName.substring(3, BodyName.length);

		if (document.getElementById("a_" + BodyName))
		{
	
			document.getElementById('a_' + BodyName).src = '/images/menu/NAVroll_' + BodyName + '.gif';
		}
		
		if (document.getElementById('a_' + BodyName + '_' + navplace))
			{
			
					document.getElementById('a_' + BodyName + '_' + navplace).src = '/images/menu/NAVroll_' + BodyName + '_' + navplace + '.gif';
			}
	}
/*function onBodyLoadSecondary()
	{
	var BodyName = document.body.id;
	BodyName = BodyName.substring(3, BodyName.length);
	var tempobj = document.getElementById("a_" + BodyName);
	TopTabOver(tempobj);
	
	}*/
function onBodyLoadTertiary(subID)
	{	
	var BodyName = document.body.id;

	BodyName = BodyName.substring(3, BodyName.length);
	if (subID > 0)
	{
		var tempobj = document.getElementById("a_" + BodyName + "_" + subID);
		//used to switch images for selected sub menu item
		switch_image(tempobj,'over', 2);
		
		var tempobj = document.getElementById("a_" + BodyName);
		//used to switch inages for selected main menu and move the correct sub menu into place 
		TopTabOver(tempobj);
	}
	}


		