function hideAll(what, context, tag) {
	var lists = new Array();
	if(context == "document") {
		var lists = getElementsByClassName(document, tag, what);
	} else {
		var lists = getElementsByClassName(document.getElementById(context), tag, what);
	}
	
	for(i = 0; i < lists.length; i++) {
		lists[i].style.display = "none";
	}
}

function showStatusListbox(rid) {
	hideAll("listbox", "document", "div");
	
	document.getElementById("status_" + rid).style.display = "block";
}

function hideStatusListbox(rid) {
	document.getElementById("status_" + rid).style.display = "none";	
}

function showCombobox(id) {
	hideAll("combobox", "document", "div");

	document.getElementById(id).style.display = "block";
	document.getElementById(id.split("_")[0] + "_text").focus();
}

function hideCombobox() {
	hideAll("combobox", "document", "div");
}

function filterChildCombo(id, filter) {
	var e = document.getElementById(id + "_list");
	var n = e.getElementsByTagName("div");
	
	for(i = 0; i < n.length; i++) {
		if(n[i].className != id + "_item_c" + filter && n[i].className != "new_item" && filter != "") {
			n[i].style.display = "none";
		} else {
			n[i].style.display = "block";
		}
	}
}

function setComboColor(id, c) {
	if(c == "new") {
		document.getElementById(id + "_text").style.backgroundColor = "#efe";
		document.getElementById(id + "_text").style.borderRight = "1px solid #090";
		document.getElementById(id + "_text").readOnly = false;
		document.getElementById(id + "_text").focus();
	} else {
		document.getElementById(id + "_text").style.backgroundColor = "#fff";
		document.getElementById(id + "_text").style.borderRight = "1px solid silver";
		document.getElementById(id + "_text").readOnly = true;
	}
}

function showBox(id) {
	document.getElementById(id).style.display = "block";
}

function statusBar(value) {
	document.getElementById("statbar_text").innerHTML = value;
}