function ComboBox_getSelectedIndex(id) {
	var comboBox = document.getElementById(id);
	if (comboBox != null) {
		var selIndex = comboBox.getAttribute("selIndex");
		if (selIndex == null) {
			comboBox.setAttribute("selIndex", -1);
			selIndex = -1;
		}
		return parseInt(selIndex);
	} else {
		return -1;
	}
}

function ComboBox_setSelectedIndex(id, index) {
	var oldIndex = ComboBox_getSelectedIndex(id);
	if (oldIndex != index) {
		var comboBox = document.getElementById(id);
		var comboBoxPopup = document.getElementById(id + "_Popup");
		if (comboBox != null && comboBoxPopup != null) {
			comboBox.setAttribute("selIndex", index);
			comboBox.value = html2text(comboBoxPopup.rows[index - 1].cells[0].innerHTML);
		}
		try {
			eval(id + "_onSelectionChanged(" + index + ");");
		} catch (err) {}
	}
}

