
///////////////////////////////////////////////////////////
// Dealing with a group of radios - return the 
// index of the checked radio button.
///////////////////////////////////////////////////////////
function RadiosCheckedIndex(r)
{
	for (var i = 0;i < r.length; i++) 
	{
		if (r[i].checked) 
		{
			return i;
		}
	}
	
	// return -1
	return -1
}


///////////////////////////////////////////////////////////
// Dealing with a group of radios - return true if any radio is checked
// otherwise return false;
///////////////////////////////////////////////////////////
function RadiosAnyChecked(r)
{
	var index = RadiosCheckedIndex(r);
	
	// any checked ...
	if(index == -1)
	{
		return false;
	}
	else
	{
		return true
	}
}


///////////////////////////////////////////////////////////
// Dealing with a group of radios - return the value of the 
// selected radio other wise a null string.
///////////////////////////////////////////////////////////
function RadiosCheckedValue(r)
{
	var index = RadiosCheckedIndex(r);
	
	// any checked ...
	if(index == -1)
	{
		return ""
	}
	else
	{
		return r[index].value;
	}
}
