// Global values

				var menuItems = TopCategory.length-1

				var maxWidth = 768
				var SubMenuWidth = 182
				var menuStart = 15
				var LetterWidth = 6
				var preSpace = 5
				var MenuStyle
				
				if (!ns4) {
					MenuStyle = "border-style: solid; border-top-color: #FFFFFF; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: rgb(247,247,247); border-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-color: #FFFFFF; position: absolute; visibility: hidden; z-index: 99;"
				}
				else {
					MenuStyle = "border-style: none; border-color: #dfe6ec; border-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-color: #dfe6ec; position: absolute; visibility: hidden; z-index: 99;"
				}

				var TotalTextLength = preSpace
				var ItemWhiteSpace = 0
				var totalWidth = 0

				var menuWidth = new Array(0,0,0,0,0,0,0);

				var menuItemWidth = Math.round(maxWidth/menuItems);

				// Find top menu item with

				for (var i=0; i < menuItems; i++) { // Find total text lenght 

					menuText = TopCategory[i].substr(0, TopCategory[i].indexOf("="))

					TotalTextLength = TotalTextLength + (menuText.length*LetterWidth);					
				
				}

				// Find lenght of white space

				ItemWhiteSpace = Math.round((maxWidth-TotalTextLength)/menuItems)

				for (var i=0; i < menuItems; i++) { // Find menu item width

					menuText = TopCategory[i].substr(0, TopCategory[i].indexOf("="));

					if (i+1 == menuItems) {
						menuWidth[i] = maxWidth-totalWidth-preSpace-2;
					}
					else {
						menuWidth[i] = (menuText.length*LetterWidth) + ItemWhiteSpace;
					}

					totalWidth = totalWidth + menuWidth[i]								
				}

				// Drop-down menu control 

			

				// variables are defined

				var MenuTop = 98;
				var MenuTopNS6 = 95;
				var closing;
				var MenuOpen = "";

				if (ns4) { // Adjust the top if NS
					MenuTop = MenuTopNS6
				}
				
				function findObj(n, d) { // Find the object

	  				var p,i,x;  

					if (!d) d=document; 

					if ((p=n.indexOf("?"))>0&&parent.frames.length) {
    						d=parent.frames[n.substring(p+1)].document; 
						n=n.substring(0,p);
					}

	  				if (!(x=d[n])&&d.all) x=d.all[n]; 

					for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

	  				for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);

	  				if (!x && document.getElementById) x=document.getElementById(n);

					return x;
				}


				function showMenu(CategoryID,menu) { // Set pos and view menu.
					
					if ( closing || closing == 0 )  clearTimeout(closing);

					closeMenu();
					
				
					
					if (menu == 'menu1') x = menuStart
					if (menu == 'menu2') x = menuWidth[0] + menuStart
					if (menu == 'menu3') x = menuWidth[0] + menuWidth[1] + menuStart
					if (menu == 'menu4') x = menuWidth[0] + menuWidth[1] + menuWidth[2] + menuStart
					if (menu == 'menu5') x = menuWidth[0] + menuWidth[1] + menuWidth[2] + menuWidth[3] + menuStart
					if (menu == 'menu6') x = menuWidth[0] + menuWidth[1] + menuWidth[2] + menuWidth[3] + menuWidth[4] + menuStart
					if (menu == 'menu7') x = menuWidth[0] + menuWidth[1] + menuWidth[2] + menuWidth[3] + menuWidth[4] + menuWidth[5] + menuStart

					x = x-1

					if ((x+SubMenuWidth)>maxWidth) { // Adjust if it extends the right margin

						x = maxWidth-SubMenuWidth+menuStart-preSpace-2

						if (ns4) { // if it is ns4 compensate for the extra padding
							x = x-8
						}else {
							x = x-2
							}
						
					}

					obj = findObj("Menu"+CategoryID);

					if (!ns4) {
						obj.style.left = x;
						obj.style.top = MenuTop;
						obj.style.visibility = 'visible';				
					}
					else {
						obj.left = x;
						obj.top = MenuTop;
						obj.visibility = 'show';
					}

					MenuOpen = "Menu"+CategoryID
	
					return true;
				}

				function closeMenu() { 
				
					// If a menu is open close it
					if (MenuOpen != "") { 
				
						obj = findObj(MenuOpen);

						if (!ns4) {
							obj.style.visibility = 'hidden';				
						}	
						else {
							obj.visibility = 'hide';
						}
					
						MenuOpen = ""
					}
				}

				function hideMenu() { // Closing menu with delay
					
					closing = setTimeout('closeMenu()',1000);

					return true;
				}

				function delayClosing() { // Delay closing menu

					if ( closing || closing == 0 )  clearTimeout(closing);
				}

				// Drop down menu items hover effect

				var lastid = 0;
