/****************************************************************************

	Ian Clarke
	3/24/2008 (Happy Birthday!)

****************************************************************************/


/****************************************************************************
****************************************************************************/
function LibJava_DoNothing()
{
}

var	gCheckAll	= false;

/****************************************************************************
****************************************************************************/
function LibJava_CheckAll( name )
{

	var	aElem;
	var	eElem;
	var	bDoIt;
	var	bFound;

	//	Get all the elements.
	aElem	= document.getElementsByTagName( "input" );
	//alert( aElem.length );
	//alert( name );
	//	Catch the first match.
	bFound	= false;

	//	Loop thru elements.
	for ( idx = 0; idx < aElem.length; idx++ )
	{
		//	Get the single element.
		eElem	= aElem[ idx ];

		//	Form name contains the passed string.
		if ( eElem.name.match( name ) != null )
		{
			bDoIt	= true;

			//	Is this the first match.
			if ( !bFound )
			{
				//	Reverse the state.
				gCheckAll	= eElem.checked;

				//	Only reference first elem.
				bFound	= true;
			}
		}
		//	No match.
		else
		{
			bDoIt	= false;
		}

		//	Check/uncheck this input.
		if ( bDoIt )
		{
			if ( gCheckAll )
			{
				eElem.checked	= false;
			}
			else
			{
				eElem.checked	= true;
			}
		}
	}
	//	Toggle the global flag.
	if ( gCheckAll )
	{
		gCheckAll	= false;
	}
	else
	{
		gCheckAll	= true;
	}

	return
}

