function List_getSelectedIndex(id) {
	var list = document.getElementById(id);
	if (list != null) {
		var selIndex = list.getAttribute("selIndex");
		if (selIndex == null) {
			list.setAttribute("selIndex", -1);
			selIndex = -1;
		}
		return parseInt(selIndex);
	} else {
		return -1;
	}
}

function List_setSelectedIndex(id, index) {
	var list = document.getElementById(id);
	if (list != null) {
		var oldIndex = List_getSelectedIndex(id);
		list.setAttribute("selIndex", index);
		var statePostfix = getPostfixForState(getElementState(list));
		var newClassName = id + statePostfix;
		if (index != 0) {
			newClassName = newClassName + "_" + index;
		}
		if (statePostfix == "_Disabled") {
			newClassName = id + "_Disabled";
		}
		if (list.className != newClassName) {
			list.className = newClassName;
		}
		if (oldIndex != index) {
			try {
				eval(id + "_onSelectionChanged(" + index + ");");
			} catch (err) {}
		}
	}
}
