// JavaScript Document<!-- //

function popup_show_menu(menu) { //v3.0
	menuObj = document.getElementById(menu);
	if (menuObj) {
		if (menuObj.style)
			menuObj.style.visibility = "visible";
	}
}

function popup_hide_menu(menu) {
	menuObj = document.getElementById(menu);
	if (menuObj) {
		if (menuObj.style)
			menuObj.style.visibility = "hidden";
	}
}

function popup_resize_children() {
	body = document.body;
	elements = body.getElementsByTagName("div");
	var re = new RegExp("sub_(.*)_[0-9]+");
	var i = 0;
	var width = 0;
	var popup = null;
	
	for (i=0; i < elements.length; i++) {
		id = elements[i].id;
		matches = re.exec(id);
		if (matches && matches.length > 0) {
			elem_id = "sub_menu_" + matches[1];
			popup = document.getElementById("sub_menu_" + matches[1]);
			width = popup.offsetWidth - 2;
			elements[i].style.left = width + "px";
		}
	}
	
	return;
}
