
function getCombo(cmbName) 
{
	var notFound = true;
	var combos = document.getElementsByTagName('select');

	var myCmbIndex = 0;

	var returnCmb = null;

	while (notFound && myCmbIndex < combos.length) 
	{
		if (combos[myCmbIndex].id == cmbName) 
		{
			returnCmb = combos[myCmbIndex];
		}
		myCmbIndex++;
	}
	return returnCmb;
}

function clearCombo(cmbName) 
{
	getCombo(cmbName).options.length = 0;
}

function selectComboValue(cmbName, cmbValue) 
{
	var myCombo = getCombo(cmbName);

	var nofFound = true;

	var myCmbIndex = 0;

	while(nofFound && myCmbIndex < myCombo.options.length) 
	{
		if (myCombo.options[myCmbIndex].value != null) 
		{
			if (myCombo.options[myCmbIndex].value == cmbValue) 
			{
				myCombo.options[myCmbIndex].selected = true;
				nofFound = false;
			}
		}
		myCmbIndex++;
	}

	return nofFound;
}
