/*
 * main.js
 */

/******************************************************************************
 * HEADER
 *
 *	File_Name		: main.js
 *  Author			: Davis Hammon
 *	Date			: Dec 14 2005
 *  Description		: This javascript file is inteaded to house general multi-purpose
 *						functions required for the web site front ends. All sites
 *						link to this js file.
 *
 *****************************************************************************/

/******************************************************************************
 * FUNCTIONS
******************************************************************************/



/*****************************************************************************
******************************************************************************
HACK FOR DROP DOWN MENUS ON IE
*****************************************************************************/


function setInClasses($withinTagId,$tagName)
/*
 * Variables: $withinTagId, $tagName
 * Returns: 
 * Description: This will go through each child of $withinTagId element and find all $tagName elements.
 *				It will then set in the 'hover' into the class. This is used to make the menus work for IE.
 */
{
	var sfEls = document.getElementById($withinTagId).getElementsByTagName($tagName);
	for (var i=0; i<sfEls.length; i++) 
	{
		sfEls[i].onmouseover=function() 
		{
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() 
		{
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
/******************************************************************************/


makeHover = function() 
/*
 * Variables: 
 * Returns: 
 * Description: Calls setInClasses function twice; one for LI and SPAN.
 */
{
	setInClasses("navmenu","LI");
	setInClasses("navmenu","SPAN");
}
/******************************************************************************/

// This instigates our hack for setting the menu to rollover for IE. This will
// run once the page is loaded and will set call functions to set in class names
// on the needed elements. Please refer to makeHover and setInClasses for more detail
if (window.attachEvent) window.attachEvent("onload", makeHover);

/*****************************************************************************
******************************************************************************
END HACK FOR DROP DOWN MENUS ON IE
*****************************************************************************/

