//*******************************************************************************'
// de-select all children of the element
// select optSelected if specified
// requires ../format/trim.js

function clearDDLSelected(elementObj, optSelected)
{
	// make sure the element is of the right object type
	if (elementObj.type == "select-one")
	{
		// clear all selected options
		for (var i = 0; i < elementObj.length; i++)
		{
			// if this child of the element is selected, de-select it
			elementObj[i].selected = false;
		}
	
		// select the option specified
		if (optSelected.length > 0)
		{
			// for each child of the element...
			for (var i = 0; i < elementObj.length; i++)
			{
				// if this child's value matches the passed value to select...
				if (Trim(elementObj[i].value) == Trim(optSelected))
				{
					// check the object
					elementObj[i].selected = true;
					
					// break out of the for loop
					break;
				}
			}
		}
		
	}
}
