//*****************************************************************************
//
//						Core HTML forms related functions
//						(c) 2003 WebThoughts 
//
//*****************************************************************************




//*****************************************************************************
// Name:	setSelect
//
// Purpose:	Changes the selected item of select control to the the item
//			matching given value.
// Inputs:
//			select: The select control to change selected item.
//			value:	The value to look for.
// Returns: void
//
//*****************************************************************************
function setSelect(select, value)
{
	for(i=0; i<select.options.length; i++)
	{
		if (select.options[i].value == value)
		{
			select.selectedIndex = i;
			return;
		}
	}
}


//*****************************************************************************
// Name:	setSelect
//
// Purpose:	Set the selected item of radio button group to the the item with
//			specified value.
// Inputs:
//			radioSet: The select control to change selected item.
//			value: The value to look for.
// Returns: void
//
//*****************************************************************************
function setRadio(radioSet, value)
{
	for(i=0; i<radioSet.length; i++)
	{
		if (radioSet[i].value == radioValue)
		{
			radioSet[i].checked = true;
			return;
		}
	}
}


function setCheckbox(checkboxElem, checkboxValue)
{
	checkboxElem.checked = checkboxValue
}
