var menuids = ["sidebarmenu1"];
function initsidebarmenu() {
	for (var i = 0; i < menuids.length; i++) {
		var ultags = document.getElementById(menuids[i]).getElementsByTagName("ul")
		for (var t = 0; t < ultags.length; t++) {
			ultags[t].parentNode.getElementsByTagName("a")[0].className += " subfolderstyle"
			if (ultags[t].parentNode.parentNode.id == menuids[i])
				ultags[t].style.left = ultags[t].parentNode.offsetWidth + "px";
			else
				ultags[t].style.left = ultags[t - 1].getElementsByTagName("a")[0].offsetWidth + "px";
			ultags[t].parentNode.onmouseover = function () {
				this.getElementsByTagName("ul")[0].style.display = "block";
			}
			ultags[t].parentNode.onmouseout = function () {
				this.getElementsByTagName("ul")[0].style.display = "none";
			}
		}
		for (var t = ultags.length - 1; t > -1; t--) {
			ultags[t].style.visibility = "visible";
			ultags[t].style.display = "none";
		}
	}
}
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
		begin += 2;
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}
menus_array = new Array('ddDETAILS', 'ddSETTINGS', 'dd1', 'dd2', 'dd3', 'dd4', 'dd5', 'dd6', 'dd7', 'dd8', 'dd9', 'dd10', 'dd11');
menus_status_array = new Array();
img_close = '../../Images/buttonExpand.gif';
img_open = '../../Images/buttonCollapse.gif';
function showHideSwitch(theid) {
	if (document.getElementById) {
		var switch_id = document.getElementById(theid);
		var imgid = theid + 'Button';
		var button_id = document.getElementById(imgid);
		if (menus_status_array[theid] == undefined) {
			resetMenu(theid);
		}
		else {
			if (menus_status_array[theid] != 'show') {
				button_id.setAttribute('src', img_open);
				switch_id.className = 'showSwitch';
				menus_status_array[theid] = 'show';
				document.cookie = theid + '=show';
				if (theid == "ddDETAILS") {
					menus_status_array[ddDETAILS] = 'hide';
					var theid2 = "ddDETAILS";
					document.cookie = theid2 + '=hide';
				}
				else if (theid == "ddSETTINGS") {
					menus_status_array[ddSETTINGS] = 'hide';
					var theid2 = "ddSETTINGS";
					document.cookie = theid2 + '=hide';
				}
				else if (theid == "dd1") {
					menus_status_array[dd1] = 'hide';
					var theid2 = "dd1";
					document.cookie = theid2 + '=hide';
				}
				else if (theid == "dd2") {
					menus_status_array[dd2] = 'hide';
					var theid2 = "dd2";
					document.cookie = theid2 + '=hide';
				}
			}
			else {
				button_id.setAttribute('src', img_close);
				switch_id.className = 'hideSwitch';
				menus_status_array[theid] = 'hide';
				document.cookie = theid + '=hide';
			}
		}
	}
}
function resetMenu(id) {
	var idname = id;
	var imgid = idname + 'Button';
	var button_id = document.getElementById(imgid);
	var switch_id = document.getElementById(id);
	button_id.setAttribute('src', img_close);
	switch_id.className = 'hideSwitch';
	menus_status_array[idname] = 'hide';
	document.cookie = idname + '=hide';
}
function changeTitle() {
	var sUrl = "../../ClinicalInformation/InpatientObservations/NursingActivities.aspx?MasterPage=Dialog";
	var left = (screen.width / 2);
	var top = (screen.height / 2);
	var oWin;         
	oWin = window.showModalDialog(sUrl, '', 'status:no;dialogWidth:1000px;dialogHeight:750px;center:yes');            
}