﻿
function NavBar(navBarCtlId) {
	var m_subMenuList = '';
	var m_navBarCtlId = navBarCtlId;

	this.RegisterSubMenu = NavBar_RegisterSubMenu;
	function NavBar_RegisterSubMenu(activeMenu) {
		m_subMenuList += (m_subMenuList != '' ? ',' : '') + activeMenu;
	}

	this.ShowHiddenSubItems = NavBar_ShowHiddenSubItems;
	function NavBar_ShowHiddenSubItems(activeMenu) {
		var arrayList = m_subMenuList.split(',');
		var obj = null;
		for (var subMenu in arrayList) {
			if (activeMenu != arrayList[subMenu]) {
				obj = document.getElementById(arrayList[subMenu])
				if (obj) {
					obj = obj.parentNode.parentNode;
					if (obj.style.display != 'none') {
						obj.style.display = 'none';
					}
				}
			}
		}
		if (activeMenu) {
			obj = document.getElementById(activeMenu)
			if (obj) {
				obj = obj.parentNode.parentNode;
				if (obj.style.display != 'none') {
					obj.style.display = 'none';
				} else {
					obj.style.display = 'block';
				}
			}
		}

	}
}

//function Navigationbar_Show(navigationbarCtl, showStateCtl, imgCtl, minWidth, maxWidth) {
//	var hdnShowStateCtl = document.getElementById(showStateCtl);
//	var navigationbar = document.getElementById(navigationbarCtl);
//	var img = document.getElementById(imgCtl);
//	var arrayList = textItemsList.split(',');

//	if (hdnShowStateCtl.value == 'none') {
//		hdnShowStateCtl.value = 'block';
//		navigationbar.style.width = maxWidth;
//		img.src = img.src.replace("/unhide.gif", "/hide.gif");
//	} else {
//		hdnShowStateCtl.value = 'none';
//		navigationbar.style.width = minWidth;
//		img.src = img.src.replace("/hide.gif", "/unhide.gif");
//	}

//	for (var textItem in arrayList) {
//		var obj = document.getElementById(arrayList[textItem])
//		if (obj) {
//			obj.style.display = hdnShowStateCtl.value;
//		}
//	}

//	Resize();
//}