var totalMenuCount = 0;
			var lock = false;
			var HorizontalMenuCount = parseInt(document.getElementById("HorizontalSubMenu").childNodes.length);
			var VerticalMenuCount = parseInt(document.getElementById("VerticalSubMenu").childNodes.length);
				for(var n=0;n<HorizontalMenuCount;n++)
					if(parseInt(document.getElementById("HorizontalSubMenu").childNodes[n].nodeType) == 1)
					    totalMenuCount++;
				for(var n=0;n<VerticalMenuCount;n++)
					if(parseInt(document.getElementById("VerticalSubMenu").childNodes[n].nodeType) == 1)
					    totalMenuCount++;
		
			function setLock(varLock){
				lock = varLock;
			}
			
			function hideAll(){
				for(var n=1;n<=totalMenuCount;n++)
					hide('navcontainer' + n);
			}
			
			function hide(menuToShow) {
				if (lock==false) {
					document.getElementById(menuToShow).style.display='none';
				}
			}

			function waitnhide(menuToShow) {
				setLock(false);
				clearTimeout(this.hide_timer);
				this.hide_timer = setTimeout('hide(\'' + menuToShow + '\');', 500);
			}

			function show(menuToShow, horizontal) {

				var xPos = 0;
				var yPos = 0;

				if(lock)
					setLock(false);
				
				hideAll();
				setLock(true);

				if(horizontal){
					xPos = 129;
					yPos = 129;
				}
				else{
					xPos = 100;
					var yPos = 160;
				}

				var xPos = xPos + parseInt(document.getElementById('src' + menuToShow).offsetLeft);
				var yPos = yPos + parseInt(document.getElementById('src' + menuToShow).offsetTop) + parseInt(document.getElementById('src' + menuToShow).offsetHeight);

				document.getElementById(menuToShow).style.left = xPos + 'px';
				document.getElementById(menuToShow).style.top = yPos + 'px';
				document.getElementById(menuToShow).style.display='';
			}
