//document.all.Menu_Items.style.display="none";
	/* cache 2 arrow images */
	/*imageUp = new Image();
	imageUp.src = "";
	imageDown = new Image();
	imageDown.src = "";*/
	
	var cnt;										/* for doing the loop */
	var objSpanCollection;							/* store a collecion of Menu */
	var menuHeightCollection = new Array(); 		/* store a collection of Menulists' height */
	var objMenu;									/* the menu is clicked on */
	
	function InitializeMenu() 
	{

		/* get a collection of menus */
		objSpanCollection = document.body.all.MainMenu.getElementsByTagName("SPAN");
		for (var i = 0; i < objSpanCollection.length; i++)
		{
			var objSpan = objSpanCollection(i);
			/* get a collection of Menus' height */
			menuHeightCollection[i] = objSpan.childNodes(1).clientHeight;
			
			/* get a collection of links inside a submenu */
			//var objLinkCollection = document.body.all.MainMenu.getElementsByTagName("A");
			//for (var j = 0; j < objLinkCollection.length; j++)
			//{
				//var objA = objLinkCollection(j);
				//objA.onmouseover = ShowDescription;
				//objA.onmousemove = ShowDescription;
				//objA.onmouseout = HideDescription;
			//}
			
			/* assign the click event to every Menuheader */
			objSpan.childNodes(0).onclick = ControlMenu;
			objSpan.childNodes(0).style.cursor = "hand";
		}
		
		/* to collapse a submenu at startup change the index number of the
		objSpanCollection() to collapse the submenu you want */
		
		objSpanCollection(0).childNodes(1).style.display = "none";
		objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		objSpanCollection(1).childNodes(1).style.display = "none";
		objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";
		objSpanCollection(2).childNodes(1).style.display = "none";
		objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";
		objSpanCollection(3).childNodes(1).style.display = "none";
		objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";
		objSpanCollection(4).childNodes(1).style.display = "none";
		objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
		objSpanCollection(5).childNodes(1).style.display = "none";
		objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";

	}
	
	function ShowDescription()
	{	
		x = event.clientX + document.body.scrollLeft; /* get the mouse left position */
		y = event.clientY + document.body.scrollTop + 35; /* get the mouse top position  */
		this.parentNode.childNodes(2).style.display = "block";
		this.parentNode.childNodes(2).style.left = x;
		this.parentNode.childNodes(2).style.top = y;
	}
	
	function HideDescription()
	{
		this.parentNode.childNodes(2).style.display = "none";
	}
	
	function ControlMenu() 
	{
		cnt = 1;
		objMenu = this.parentNode.childNodes(1);	/* memorize the Menulist has been clicked */
		
		/* Get the arrow that belongs to the clicked menu */
		/* starting with <div> then <table> then <tbody> then <tr> then <td> and the last one is */
		/* what we need: <img> */
		//var objArrow = this.childNodes(0).childNodes(0).childNodes(0).childNodes(1).childNodes(0);
		
		if (objMenu.style.display == "none")
		{
			//objArrow.src = imageDown.src;  /* change to the Down Arrow */
			ShowMenu();
		}
		else
		{
			//objArrow.src = imageUp.src;  /* change to the Up Arrow */
			HideMenu();
		}

	}
	
	function ShowMenu()
	{
		var objList = objMenu.childNodes(0);	// get the Linkslist of the Menulist
		if (cnt < 10)
		{
			// display the Menulist
			objMenu.style.display = "block";
			// increase the tranparency of the Menulist
			objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity + 10;
			// loop through the Menu collection to find the position of the clicked Menu
			// to get the actual height of the menu list and then increase the height of the Menulist
			for (var i = 0; i < objSpanCollection.length; i++)
				if (objMenu.parentNode == objSpanCollection[i])
					   objMenu.style.height = objMenu.clientHeight + (menuHeightCollection[i]/10);
					   
			cnt++;
			// do this function again after 30 miliseconds until the actual Menulist's height is returned
			setTimeout("ShowMenu()",30)
		}
		// display the Menulist if the it's actual height is returned
		if (cnt >= 10)
		{
		  	for (var i = 0; i < objSpanCollection.length; i++)
				if (objMenu.parentNode == objSpanCollection[i])
					objMenu.style.height = menuHeightCollection[i];
			objList.style.display = "block"; 
		}
	}
	
	function HideMenu()
	{	
		var objList = objMenu.childNodes(0);	// get the Linkslist of the Menulist
		if (cnt < 10)
		{
			objMenu.filters["alpha"].opacity = objMenu.filters["alpha"].opacity - 10;
			for (var i = 0; i < objSpanCollection.length; i++)
				if (objMenu.parentNode == objSpanCollection[i])
				    if (objMenu.clientHeight > menuHeightCollection[i]/10)
					objMenu.style.height = objMenu.clientHeight - (menuHeightCollection[i]/10);
			objList.style.display = "none";
			cnt++;
			setTimeout("HideMenu()",30)
		}
		if (cnt >= 10)
		{
		    objMenu.style.height = 0;
			objMenu.style.display = "none";
		}
	}


	function test(x)
	{
		if(x==0)
			{
				objSpanCollection(1).childNodes(1).style.height = 0;
				objSpanCollection(1).childNodes(1).style.display = "none";
				objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";
								
				objSpanCollection(2).childNodes(1).style.height = 0;
				objSpanCollection(2).childNodes(1).style.display = "none";
				objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(3).childNodes(1).style.height = 0;
				objSpanCollection(3).childNodes(1).style.display = "none";
				objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(4).childNodes(1).style.height = 0;
				objSpanCollection(4).childNodes(1).style.display = "none";
				objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(5).childNodes(1).style.height = 0;
				objSpanCollection(5).childNodes(1).style.display = "none";
				objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";
			}
		if(x==1)
			{
				objSpanCollection(0).childNodes(1).style.height = 0;
				objSpanCollection(0).childNodes(1).style.display = "none";
				objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		
				objSpanCollection(2).childNodes(1).style.height = 0;		
				objSpanCollection(2).childNodes(1).style.display = "none";
				objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(3).childNodes(1).style.height = 0;
				objSpanCollection(3).childNodes(1).style.display = "none";
				objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(4).childNodes(1).style.height = 0;
				objSpanCollection(4).childNodes(1).style.display = "none";
				objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(5).childNodes(1).style.height = 0;
				objSpanCollection(5).childNodes(1).style.display = "none";
				objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";
			}
		if(x==2)
			{
				objSpanCollection(0).childNodes(1).style.height = 0;
				objSpanCollection(0).childNodes(1).style.display = "none";
				objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		
				objSpanCollection(1).childNodes(1).style.height = 0;
				objSpanCollection(1).childNodes(1).style.display = "none";
				objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(3).childNodes(1).style.height = 0;
				objSpanCollection(3).childNodes(1).style.display = "none";
				objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(4).childNodes(1).style.height = 0;
				objSpanCollection(4).childNodes(1).style.display = "none";
				objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(5).childNodes(1).style.height = 0;
				objSpanCollection(5).childNodes(1).style.display = "none";
				objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";
			}
		if(x==3)
			{
				objSpanCollection(0).childNodes(1).style.height = 0;
				objSpanCollection(0).childNodes(1).style.display = "none";
				objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		
				objSpanCollection(1).childNodes(1).style.height = 0;
				objSpanCollection(1).childNodes(1).style.display = "none";
				objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(2).childNodes(1).style.height = 0;		
				objSpanCollection(2).childNodes(1).style.display = "none";
				objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(4).childNodes(1).style.height = 0;
				objSpanCollection(4).childNodes(1).style.display = "none";
				objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(5).childNodes(1).style.height = 0;
				objSpanCollection(5).childNodes(1).style.display = "none";
				objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";
			}				
		if(x==4)
			{
				objSpanCollection(0).childNodes(1).style.height = 0;
				objSpanCollection(0).childNodes(1).style.display = "none";
				objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		
				objSpanCollection(1).childNodes(1).style.height = 0;
				objSpanCollection(1).childNodes(1).style.display = "none";
				objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(2).childNodes(1).style.height = 0;		
				objSpanCollection(2).childNodes(1).style.display = "none";
				objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(3).childNodes(1).style.height = 0;
				objSpanCollection(3).childNodes(1).style.display = "none";
				objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(5).childNodes(1).style.height = 0;
				objSpanCollection(5).childNodes(1).style.display = "none";
				objSpanCollection(5).childNodes(1).childNodes(0).style.display = "none";
			}
		if(x==5)
			{
				objSpanCollection(0).childNodes(1).style.height = 0;
				objSpanCollection(0).childNodes(1).style.display = "none";
				objSpanCollection(0).childNodes(1).childNodes(0).style.display = "none";
		
				objSpanCollection(1).childNodes(1).style.height = 0;
				objSpanCollection(1).childNodes(1).style.display = "none";
				objSpanCollection(1).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(2).childNodes(1).style.height = 0;		
				objSpanCollection(2).childNodes(1).style.display = "none";
				objSpanCollection(2).childNodes(1).childNodes(0).style.display = "none";

				objSpanCollection(3).childNodes(1).style.height = 0;
				objSpanCollection(3).childNodes(1).style.display = "none";
				objSpanCollection(3).childNodes(1).childNodes(0).style.display = "none";
				
				objSpanCollection(4).childNodes(1).style.height = 0;
				objSpanCollection(4).childNodes(1).style.display = "none";
				objSpanCollection(4).childNodes(1).childNodes(0).style.display = "none";
			}					
	}
