function selectOptionByValue( elementId, optionValue )
{
	var element, i;
	element = document.getElementById( elementId );
	for ( i = 0; i < element.options.length; i++ )
	{
		if ( element.options.item(i).value == optionValue )
		{
			element.options.item(i).selected = true;
			break;
		}
	}
}

function getFormElement( formName, elementName )
{
	var oForm;
	if ( document.forms.namedItem )
	{
		oForm = document.forms.namedItem(formName);
		if ( oForm && elementName )
			return oForm.elements.namedItem(elementName);
		else
			return oForm;
	}
	else
	{
		oForm = document.forms.item(formName,0);
		if ( oForm && elementName )
			return oForm.elements.item(elementName,0);
		else
			return oForm;
	}
}
