	function menuBarMouseOver(obj, menuID, direction)	{
		nav = document.getElementById("menubar");
	    if (!nav) 
	    	return false;
	    
		availableWidth = -1;
		if (typeof window.innerWidth != 'undefined'){
			availableWidth = window.innerWidth
		}
		else {
			availableWidth = document.documentElement.clientWidth;
		}
		
		selectedMenuWidth = -1;
		
	    navListItems = nav.getElementsByTagName("td");
		for (j = 0; j < navListItems.length; j++)  {
			var nodeOther = navListItems[j];
			
			if (nodeOther.id == ('item' + menuID)) {
				obj.className = "selected_menubar_box";
				selectedMenuWidth = getAbsolutePosition(nodeOther, "width");
			}
			else {
				nodeOther.className = "menubar_box";
			}
	    } 

		//-------------------------------------
	    navListItems = nav.getElementsByTagName("ul");
		for (j = navListItems.length - 1; j >= 0; j--)  {
			var nodeOther = navListItems[j];
			
			if (nodeOther.id != ('menulist' + menuID)) {
				nodeOther.style.visibility = 'hidden';
			}
			else {
				nodeOther.style.visibility = 'visible';
		        nodeOther.x = getAbsolutePosition(obj, "left");
		        nodeOther.y = getAbsolutePosition(obj, "top");

				if (direction == 'horizontal') {
					if (availableWidth < getAbsolutePosition(nodeOther, "width")) {
						nodeOther.x = nodeOther.x - (getAbsolutePosition(nodeOther, "width") - selectedMenuWidth);
					}
					nodeOther.style.left = nodeOther.x + "px";
					nodeOther.style.top = (nodeOther.y + getAbsolutePosition(obj, "height"))+ "px";
		        }
		        else {
					nodeOther.style.left = (nodeOther.x  + getAbsolutePosition(obj, "width")) + "px";
					nodeOther.style.top = (nodeOther.y - 5) + "px";
		        }
			} 
	    } 
	}
		
	function getAbsolutePosition(what, offsetType) {
	    var absPosition = 0;
	    if (offsetType == "left" || offsetType == "top") {
		    absPosition = (offsetType == "left") ? what.offsetLeft : what.offsetTop;
		    var parentEl = what.offsetParent;
		    
		    while (parentEl != null) {
		        absPosition += (offsetType == "left") ? parentEl.offsetLeft : parentEl.offsetTop;
		        parentEl = parentEl.offsetParent;
		    }
	    }
	    else {
		    absPosition = (offsetType == "width") ? what.offsetWidth: what.offsetHeight;
	    }
	    
	    return absPosition;
	}
