/*
 * Constructor for RadioElement object.  It stores the widget instance name,
 * reguardless if it is a radio button type or not.  Sets other internal
 * attributes and defines the supported methods.  The caller of this object
 * will be responsible for determining the widget type.
 *
 * Note:
 * This object is used in conjuction with RadioElements object.  This object
 * is a representation of several radio button widget(s) that are group to
 * together based of the 'Name' attribute for the INPUT tag.
 */
function RadioElement(strName)
{
	this.strName = strName;
	this.blnIsSet = false;  // Assume user has not clicked on any buttons.
	this.strValue = null;   // Since nothing has been set, we have no value.

	// Method prototype definitions
	this.toString = RadioElement_toString;
	this.getIsSet = RadioElement_getIsSet;
	this.getName = RadioElement_getName;
	this.setIsSet = RadioElement_setIsSet;
	this.setValue = RadioElement_setValue;
}

/*
 * Returns the value if the radio button is set or not.
 */
function RadioElement_getIsSet()
{
	return (this.blnIsSet);
}

/*
 * Returns the widget instance name of the widget that this object currently
 * represents.
 */
function RadioElement_getName()
{
	return (this.strName);
}

/*
 * This method will either set or unset the current RadioButton marking based
 * the passed in value.
 */
function RadioElement_setIsSet(blnValue)
{
	this.blnIsSet = blnValue;
}

/*
 * This method will store the value representation of the current selected
 * radio button from the option group.
 */
function RadioElement_setValue(strValue)
{
	this.setValue = strValue;
}

/*
 * Outputs the attribute values of this object into a string format.
 */
function RadioElement_toString()
{
	var strMsg;

	strMsg = this.strName + " radio button is ";

	if (this.blnIsSet == true)
	{
		strMsg = strMsg + "set and has value of '" + this.strValue + "'";
	} 
	else
	{
		strMsg = strMsg + "not set and has value of '" + this.strValue + "'";
	}
	return (strMsg);
}