function show( sID )
{
	oElement = document.getElementById( sID );
	if( oElement != null )
		oElement.style.display = "block";
}

function hide( sID )
{
	oElement = document.getElementById( sID );
	if( oElement != null )
		oElement.style.display = "none";
}

function assess( sID, sSiblingID, sValue )
{
	var oSibling = document.getElementById( sSiblingID );

	if( oSibling == null )
		return false;

	aInput = oSibling.getElementsByTagName( 'input' );
	
	for( var i = 0; i < aInput.length; ++i )
	{
		if ( aInput[ i ].checked )
		{
			if( aInput[ i ].value == sValue )
				show( sID );
			else
				hide( sID );
			return true;
		}
	}
}

function toggle( oElement, sTargetId )
{
	if( oElement.checked )
		show( sTargetId );
	else
		hide( sTargetId );
}

function uncheckAll( oElement, sParentId )
{
	var aInput = document.getElementsByTagName( "input" );
	for ( var i = 0; i < aInput.length; ++i )
	{
		if ( aInput[ i ] != oElement )
		{
			if ( oElement.checked ) {
				aInput[ i ].checked = false;
				if( oElement.parentNode.parentNode == aInput[ i ].parentNode.parentNode )
				aInput[ i ].disabled = true;
			}
			else
			{
				aInput[ i ].disabled = false;
			}
			if( typeof aInput[ i ].onclick == "function" )
				aInput[ i ].onclick();
		}
	}
}

function checkScore( oElement, nMin, nMax, sId )
{
	if( oElement == null )
		return false;
	var oParent = oElement.parentNode.parentNode;
	var aSelect = oParent.getElementsByTagName( "input" );
	var bShow = false;
	for( var i = 0; i < aSelect.length; ++i )
	{
		nValue = aSelect[ i ].value;
		if( nValue > nMin && nValue < nMax && aSelect[ i ].checked )
			bShow = true;
	}
	if( bShow )
		show( sId );
	else
		hide( sId );
}