// simple combo-box routines

function comboSelectByValue(myCombo, myValue) {
	var j;
	for (j=0;j<myCombo.length;j++) {
		var child;
		try { child=myCombo.children[j]; }
		catch (e) {	child=myCombo.childNodes[j]; }
		if (child.value==myValue) {
			child.selected=true;
			break;
		}
	}
}

function comboSelectByText(myCombo, myText) {
	var j;
	for (j=0;j<myCombo.length;j++) {
		var child;
		try { child=myCombo.children[j]; }
		catch (e) {	child=myCombo.childNodes[j]; }
		if (child.text==myText) {
			child.selected=true;
			break;
		}
	}
}

function comboClear(theCombo) {
	while (theCombo.length>0) theCombo.remove(0);
}

function comboAdd(theCombo, theText, theValue) {
	var oOption = document.createElement("option");
	oOption.text=theText;
	oOption.value=theValue;
	try { theCombo.add(oOption); }
	catch (e) {	theCombo.add(oOption, null); }
}