// John Daharsh/Dale McCrory
// declare this variable
// BEGIN control all nav code
	document.currentlyActive = "";

	function controlAllNav()
	{
		for (i=0;i<document.getElementsByTagName("div").length;i++)
		{
			thisObj = document.getElementsByTagName("div")[i];
			thisName = thisObj.id
			thisSubNavObj = document.getElementById(thisName+"_sub")
			thisActive = (thisName==document.currentlyActive)

			if (thisSubNavObj)
			{
				var shimObj = document.getElementById(thisName + '_shim_div');
				if (thisActive)
				{
					thisSubNavObj.style.marginTop = shimObj.offsetTop;
					thisSubNavObj.style.marginLeft = shimObj.offsetLeft + shimObj.offsetWidth-1;
					thisSubNavObj.style.visibility = "visible";
					var tblObj = thisSubNavObj.childNodes[0];
					if (tblObj.nodeName != 'TABLE') tblObj = thisSubNavObj.childNodes[1];
					shimObj.parentNode.bgColor = tblObj.bgColor;
				} 
				else 
				{
					thisSubNavObj.style.visibility = "hidden";
					shimObj.parentNode.bgColor = "#ffffff";
				}
				//imageSwap(thisName, thisActive)
			} 
		}
	}

	// attaching controlAllNav to mouse over event
	//document.onmouseover = controlAllNav;


	// END control all nav code

	function divHandler(anObj, aBool)
	{
		if (aBool) // true
		{
			if (anObj.id.indexOf('nav_') > -1)
			{
				var objName;
				if (anObj.id.indexOf('_sub') != -1)
				{
					objName = anObj.id.substring(0,anObj.id.indexOf('_sub'));
				}
				else
				{
					objName = anObj.id;
				}
				document.currentlyActive=objName;
			}
		}
		else // false
		{
			document.currentlyActive = '';
		}
		controlAllNav();
	}

	function imageSwap(anObj, aBool)
	{
		thisSubNavObj = document.getElementById(thisName+"_sub");
		//if (anObj != '' && thisSubNavObj.innerHTML.search(/[a-zA-Z0-9]/) != -1)
		//{
			if (aBool && document.getElementById(thisName+"_shim") != null) // true
			{  
				swap(anObj + "_shim",document.getElementById(thisName+"_shim").getAttribute("rollover"));
			}
			else
			{
				swap(anObj + "_shim","#")
			}
		//}
	}
	
	function closeBtnHover(tblObj)
	{
		var row = tblObj.rows[0];
		row.cells[0].style.color = row.cells[1].style.color='#999999';
		row.cells[1].style.border='1px solid #999999'
	}
	function closeBtnOut(tblObj)
	{
		var row = tblObj.rows[0];
		row.cells[0].style.color = row.cells[1].style.color='#000000';
		row.cells[1].style.border='1px solid #000000'
	}
	function closeBtnDown(tblObj)
	{
		tblObj.style.marginRight = '2px'
		tblObj.style.marginBottom = '2px'
	}
	function closeBtnUp(tblObj)
	{
		tblObj.style.marginRight = '3px'
		tblObj.style.marginBottom = '3px'
	}
