			var orientation	= "horizontal";
			var timeoutId = null;

			function hideAll(menuPrefix) {
				hideNeighbors(menuPrefix + "_0",menuPrefix)
			}
			//var testNav = ""
			function hideNeighbors(thisID,baseID) {
				// split the ids into arrays
					var thisIDArray = thisID.split("_");
				// go through all the siblings
					for (var menuCounter=1;menuCounter<=1000;menuCounter++) {
						var currentID = baseID + '_' + menuCounter;
						var currentIDArray = currentID.split("_");
						if (currentID != thisID) {
							// get the sibling
								var testDiv = document.getElementById(currentID);
							// if a sibling exists
								if (testDiv != null) {
									if (currentIDArray.length > thisIDArray.length) {
										testDiv.style.visibility = 'hidden';
									}
									hideNeighbors(thisID,currentID);
								} else {
									break;
								}
						}
					}
			}

			// ==========================================================================
			// switch the color for this item for a mouseout
			// ==========================================================================
				function OutThis(theLink) {
						var pArray = theLink.id.split("_");
						with (theLink.style) {
							switch (pArray.length) {
								case 3: 
								// change backgroundcolor and font color
									backgroundColor	= "#ffc33";
									color					= "#000";
									break;
								case 4: 
								// change backgroundcolor and font color
									backgroundColor	= "#ffc33";
									color					= "#000";
									break;
						}
					}
				}

			function sC(objthis,theevent,menuPopDirection) {
				// stop this event from bubbling up
					theevent.cancelBubble = true;
					clearTimeout(timeoutId);
				// initialize some variables				
					var leftPos = 0;
					var topPos = 0;
					var TopStart = 0;
					var tempOrientation = orientation;
					var pArray = objthis.id.split("_");
					var outArray = objthis.id.split("_");
					outArray.length = outArray.length - 1
				// create an array to store the top positions
					var TopArray = new Array();
					var ElementArray = new Array();
				// get the base id
					var baseID = outArray.join("_")
				// hide all the children of the neighbors of this menu item
				    hideNeighbors(objthis.id,baseID);
				// get target location
					with (objthis) {
						targLeft		= parseInt(offsetLeft);
						targWidth	= parseInt(clientWidth);
						targTop		= parseInt(offsetTop)+3; //move sec nav pos
						targHeight	= parseInt(offsetHeight);
					}
				// determine starting position and orientation
						if (pArray.length <=2) {
							TopStart = targTop + targHeight
							tempOrientation = "horizontal"
						} else {
							TopStart = targTop - 12;
							tempOrientation = "vertical"
							targLeft = targLeft + targWidth
						}
				// put the first top position into the array
					//TopArray.push(TopStart)
				// get all child menu items
					for (var menuCounter=1;menuCounter<=100;menuCounter++) {
						// get the element (if one exists)
							var thisElement = document.getElementById(objthis.id + '_' + menuCounter)
						// if an element exists
							if (thisElement != null) {
								// set border properties
									with (thisElement.style) {
										borderLeftColor	= "";
										borderRightColor	= "";
										borderLeftWidth	= "";
										borderRightWidth	= "";
										borderLeftStyle	= "";
										borderRightStyle	= "";
										borderTopWidth		= ""
										visibility = "hidden"
										zIndex = pArray.length;
									}
								// put this element into the array
									ElementArray.push(thisElement);
								// put the first top position into the array
									TopArray.push(TopStart)
								// determine the top position
									TopArray[menuCounter] = TopArray[menuCounter - 1] + thisElement.offsetHeight - 1
							}
					}
				// get Size of the menu if necessary to pop UP instead of down
					var MenuSize = 0
					if (menuPopDirection == "up") {
						if (ElementArray.length > 0) {
							MenuSize = parseInt(TopArray[TopArray.length - 1]) + parseInt(ElementArray[ElementArray.length - 1].offsetHeight) - parseInt(targTop + targHeight - 2)
						}
					}

				// loop through the elements and position them (don't show them yet)
					for (var menuCounter=0;menuCounter<ElementArray.length;menuCounter++) {
						// get the element
							with (ElementArray[menuCounter].style) {
								// set coords according to orientation
									if (menuCounter > 0) {
										borderTopColor		= "";
										borderTopStyle		= "";
									} else {
										borderTopColor		= "";
										borderTopStyle		= "";
									}
									left = targLeft + "px"
									top = parseInt(parseInt(TopArray[menuCounter]) - parseInt(MenuSize)) + "px";
							// if the next object doesn't exist, set border for the last menu item and exit
								if (menuCounter == parseInt(TopArray.length) - 1) {
									borderBottomStyle="";
									borderBottomWidth="";
									borderBottomColor="";
								}
							}
					}
				// ==========================================================================
				// switch the color for this item
				// ==========================================================================
					
						with (objthis.style) {
							switch (pArray.length) {
								case 3: 
								// change backgroundcolor and font color
									backgroundColor	= "";
									color					= "";
									break;
								case 4: 
								// change backgroundcolor and font color
									backgroundColor	= "";
									color					= "";
									break;
						}
					}
				// loop through the elements and show them
					for (var menuCounter=0;menuCounter<ElementArray.length;menuCounter++) {
						// get the element
							ElementArray[menuCounter].style.visibility = "visible";
					}

			}
			function getParentArray(thisEl) {
				return thisEl.id.split("_");
			}
			function startHiding() {
				hideAll("md");
				hideAll("mc");
			}

