// JavaScript Document
function display_menuSidebar(divID){
	if (divID != "sm0000"){
		if (document.all){
			// IE 6
			if(document.all[divID])
				document.all[divID].style.display= "block";
		} else if (document.layers){
			if(document.layers[divID])
			// NS 6
			document.layers[divID].display = "block";
		} else if (document.getElementById) {
			// Mozilla / Fire Fox / IE4
			if(document.getElementById(divID))
			document.getElementById(divID).style.display = "block";
		}
	}
}


// Function to Control Drop-Down Menus
function showSubNav(subNavId){
	subNavParentID = document.getElementById(subNavId).parentNode.id;
	subNavParentTop = document.getElementById(subNavParentID).offsetTop;
	subNavParentLeft = document.getElementById(subNavParentID).offsetLeft;
	subNavParentWidth = document.getElementById(subNavParentID).offsetWidth;
	subNavParentHeight = document.getElementById(subNavParentID).offsetHeight;
	//alert(subNavParentLeft);
		//alert(subNavParentLeft);
	// Check for available space for dropdown
	ddWidth = 150;
	ddLeft = 0;
	windowWidth = document.body.offsetWidth;
	requiredWidth = ddWidth;
	availableWidth = windowWidth - subNavParentLeft;	
	if (requiredWidth > availableWidth)
		ddLeft = -subNavParentWidth; 

	// Set Dropdown Top and Left Coordinates
	document.getElementById(subNavId).style.top = subNavParentHeight+"px";
	document.getElementById(subNavId).style.left = ddLeft+"px";
	//document.getElementById(subNavId).style.z-index = 100;

}

// Function to Control Drop-Down Menus
function showList(navId){
	navParentID = document.getElementById(navId).parentNode.id;
	navParentTop = document.getElementById(navParentID).offsetTop;
	navParentLeft = document.getElementById(navParentID).offsetLeft;
	navParentWidth = 150;
	navParentHeight = document.getElementById(navParentID).offsetHeight;
	//alert(ddWidth);
	// Check for available space for flyout
	foWidth = 150;
	foLeft = navParentWidth-2;
	windowWidth = document.body.offsetWidth;
	requiredWidth = foWidth;
	//alert(ddWidth);
	availableWidth = windowWidth - (ddWidth+subNavParentLeft);	
	if (requiredWidth > availableWidth)
		foLeft = -(foWidth+2); 

	document.getElementById(navId).style.top = 0+"px";
	document.getElementById(navId).style.left = foLeft+"px";
	//document.getElementById(navId).style.z-index = 100;
}


