function HideMenus ()
{
  for (var menuIndex = 0; menuIndex < menuNameArray.length; menuIndex++)
	{
	 	document.getElementById (menuNameArray[menuIndex]).style.display="none";
//		alert (menuNameArray[menuIndex]);
	}
}

function DisplayMenu (menuID)
{
	document.getElementById (menuID).style.display="block";
}

var toggle=1;
function HighLight (NameID)
{
	if (document.getElementById (NameID))
	{
  	if (document.getElementById (NameID).href != document.location)
  	{
  		//document.getElementById (NameID).style.color=DEFAULT_MENU_BGCOLOR;
  		//document.getElementById (NameID).style.backgroundColor=DEFAULT_MENU_COLOR;
  		document.getElementById (NameID).style.textDecoration='underline';
  		document.getElementById (NameID).style.fontStyle='italic';
  	}
	}
}

function unHighLight (NameID)
{
	if (document.getElementById (NameID))
	{
  	if (document.getElementById (NameID).href != document.location)
  	{
  		// document.getElementById (NameID).style.color=DEFAULT_MENU_COLOR;
  		// document.getElementById (NameID).style.backgroundColor=DEFAULT_MENU_BGCOLOR;
  		document.getElementById (NameID).style.textDecoration='none';
  		document.getElementById (NameID).style.fontStyle='normal';
  	}
	}
}

function HighLightPictureText (NameID)
{
	if (document.getElementById (NameID))
	{
  	if (document.getElementById (NameID).href != document.location)
  	{
  		document.getElementById (NameID).style.color='#666666';
  		document.getElementById (NameID).style.textDecoration='underline';
  	}
	}
}

function unHighLightPictureText (NameID)
{
	if (document.getElementById (NameID))
	{
  	if (document.getElementById (NameID).href != document.location)
  	{
  		document.getElementById (NameID).style.color='#ffff99';
  		document.getElementById (NameID).style.textDecoration='none';
  	}
	}
}

function HighLightPicture (LinkID, ImageID, ImageSrc)
{
	if (document.getElementById (LinkID))
	{
  	if (document.getElementById (LinkID).href != document.location)
  	{
  		//document.getElementById (NameID).style.color='#ff6666';
  		//document.getElementById (NameID).style.textDecoration='underline';
    	document.getElementById (ImageID).src=ImageSrc;
  	}
	}
}

function unHighLightPicture (LinkID, ImageID, ImageSrc)
{
	if (document.getElementById (LinkID))
	{
  	if (document.getElementById (LinkID).href != document.location)
  	{
  		//document.getElementById (NameID).style.color='#ffff99';
  		//document.getElementById (NameID).style.textDecoration='none';
  	 	document.getElementById(ImageID).src=ImageSrc;
  	}
	}
}

function HighlightCurrentLink ()
{
	allLinks = document.getElementsByTagName("a");
	for (IndexNum=0; IndexNum < allLinks.length; IndexNum++ )
	{
   		if ((document.location == allLinks.item(IndexNum).href) && (allLinks.item(IndexNum).className != 'exempt'))
  		{
  			allLinks.item(IndexNum).style.color='#999999'; 	
  			allLinks.item(IndexNum).style.cursor='default';	
  			allLinks.item(IndexNum).style.textDecoration='none';	
  			//allLinks.item(IndexNum).parentNode.style.backgroundColor='ffff99';	
  			//allLinks.item(IndexNum).parentNode.style.borderStyle='solid'; 	
  			//allLinks.item(IndexNum).parentNode.style.borderColor='#800000'; 
  			//document.write ('<p>' + allLinks.item(IndexNum).parentNode.nodeName + '</p>');
  		
  			//allLinks.item(IndexNum).style.class='selectedMenuItem';
  	 		if (allLinks[IndexNum].childNodes[0].src)
  			{
  		 		//Create a copy of the mouseover picture as picture.jpg.jpg
				allLinks[IndexNum].childNodes[0].src=allLinks[IndexNum].childNodes[0].src+'.jpg';
  			}
  		}
  	}
}

function SelectPicture (LinkID, ImageID, ImageSrc)
{
	//document.getElementById (NameID).style.color='#ff6666';
	//document.getElementById (NameID).style.textDecoration='underline';
  document.getElementById (ImageID).src=ImageSrc;
	return false;
}

function isHiddenSubMenu (NameID)
{
	if (document.getElementById (NameID))
	{
  		return document.getElementById (NameID).style.visibility == 'hidden';
	}
	else
	{
	 	return false;
	}
}

function HideSubMenu (NameID)
{
	if (document.getElementById (NameID))
	{
  		document.getElementById (NameID).style.visibility='hidden';
   		document.getElementById (NameID).style.position='absolute';
 		document.getElementById (NameID).style.zIndex='100';
	}
}

function ShowSubMenu (NameID)
{
	if (document.getElementById (NameID))
	{
  		document.getElementById (NameID).style.visibility='visible';
  		document.getElementById (NameID).style.position='relative';
	}
}

function PopupSubMenu (NameID)
{
	if (document.getElementById (NameID))
	{
  		themenu = document.getElementById (NameID);
		if (document.getElementById (NameID).style.visibility == 'visible')
  			HideSubMenu (NameID);
		else 
		{
  		ShowSubMenu (NameID);
			document.getElementById ('leftCol').style.length='auto';
		}
	}
}

function PreloadImages ()
{
  ImageArray = new Array();
	allImages = document.getElementsByTagName("img");
	for (IndexNum=0; IndexNum < allImages.length; IndexNum++ )
	{
  	 	ImageArray[IndexNum] = new Image;
		ImageArray[IndexNum].src = allImages.item(IndexNum);
  }
  return ImageArray;
}
