	//
	function InitMenu()
	{
		var bar = menuBar.children;    

		for(var i=0;i < bar.length;i++) 
		{
			//var menu=eval(bar[i].menu)
			var atrr = bar[i].getAttribute('menu', 0);
			var menu = document.getElementById(atrr.toString());
			
			menu.style.visibility = "hidden"; //none
			
			var Items = menu.children;
			
			if (Items.length > 0)
				bar[i].onmouseover = new Function("ShowMenu(" + bar[i].id + ")");

			if (bar[i].getAttribute('cmd', 0) != null && bar[i].getAttribute('target', 0) !=null) 
			{			
				bar[i].onclick = new Function('DoOpen(' + bar[i].id+ ')');			
			}
			else
			{				
				bar[i].onclick = new Function('Do(' + bar[i].id + ')');
			} 

			for (var j=0; j<Items.length; j++)
			{	
				var menuItem = eval(Items[j].id);

				if (menuItem.getAttribute('menu', 0) != null)
				{ 
					menuItem.innerHTML += "<Span Id=" + menuItem.id + "_Arrow class='Arrow'>4</Span>";
					//var tmp = eval(menuItem.id+"_Arrow")
					// tmp.style.pixelLeft = menu.getBoundingClientRect().Right //- tmp.offsetWidth - 15
					FindSubMenu(menuItem.getAttribute('menu', 0));
				}
				
				if (Items[j].getAttribute('cmd', 0) != null && Items[j].getAttribute('target', 0) != null){
					Items[j].onclick = new Function('DoOpen(' + Items[j].id + ')');
				}                 
				else (menuItem.getAttribute('cmd', 0) != null) 
				{
					menuItem.onclick = new Function('Do(' + menuItem.id + ')') ;
				} 				
				menuItem.onmouseover = new Function('highlight(' + Items[j].id + ')');

			} 			
		}  
	}
   
	//   
	function FindSubMenu(subMenu)
	{
		var menu = eval(subMenu);		
		var Items = menu.children;
		
		for(var j=0; j<Items.length; j++)
		{
			menu.style.visibility = 'hidden';

			var menuItem = eval(Items[j].id)

			if (menuItem.getAttribute('menu', 0) != null)
			{
				menuItem.innerHTML += "<Span Id=" +menuItem.id + "_Arrow class='Arrow'>4</Span>";
				// var tmp = eval(menuItem.id+"_Arrow")
				//tmp.style.pixelLeft = 35 //menuItem.getBoundingClientRect().right - tmp.offsetWidth - 15
				FindSubMenu(menuItem.getAttribute('menu', 0));
			}

			if (menuItem.getAttribute('cmd', 0) != null) 
			{
				menuItem.onclick = new Function("Do(" + menuItem.id + ")");
			} 

			menuItem.onmouseover = new Function("highlight(" + Items[j].id + ")");
		}  
	}
	
	//	
	function ShowMenu(obj)
	{
		HideMenu(menuBar);
		
		var menu = eval(obj.getAttribute('menu', 0));
		var bar = eval(obj.id);
		
		bar.className = "barOver";
		menu.style.visibility = "visible";
		menu.style.pixelTop =  obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop;
		menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft + 30;
	}
   
	//   
	function highlight(obj)
	{
		var PElement = eval(obj.parentElement.id);
		
		if (PElement.hasChildNodes() == true)
		{  
			var Elements = PElement.children;

			for (var i=0; i<Elements.length; i++)
			{
				TE = eval(Elements[i].id);
				TE.className = "menuItem";
			}
		} 
		
		obj.className = "ItemMouseOver";
		window.defaultStatus = obj.title;
		ShowSubMenu(obj);
	}
   
	//   
	function Do(obj)
	{
		var cmd = eval(obj).getAttribute('cmd', 0);	
		//非標準用法 for IE only
		//window.navigate(cmd);
		window.open(cmd, '_self');	
	}
   
	//   
	function DoOpen(obj)
	{
		var cmd = eval(obj).getAttribute('cmd', 0);	
		window.open(cmd);
	}
   
	//   
	function HideMenu(obj)
	{
		//obj = <div Id="menu2" class="menu">
		
		if (obj.hasChildNodes()==true)
		{  
			var child = obj.children;
			
			for (var j =0;j<child.length;j++)
			{	
				if (child[j].className == "barOver")
				{
					var bar = eval(child[j].id);
					
					bar.className="Bar";
				}

				if(child[j].getAttribute('menu', 0) != null)
				{
					var childMenu = eval(child[j].getAttribute('menu', 0));
					
					if (childMenu.hasChildNodes()==true) 
						HideMenu(childMenu);
						
					childMenu.style.visibility = 'hidden'; 
				}
			}
		}
	}
	
	function ShowSubMenu(obj)
	{
		PMenu = eval(obj.parentElement.id); //<div Id="menu2" class="menu">
		HideMenu(PMenu);

		if (obj.getAttribute('menu', 0) != null)
		{	
			var menu = eval(obj.getAttribute('menu', 0));

			menu.style.visibility = "visible";
			menu.style.pixelTop =  obj.getBoundingClientRect().top + Bdy.scrollTop;;
			menu.style.pixelLeft = obj.getBoundingClientRect().right + Bdy.scrollLeft;			
			
			if (menu.getBoundingClientRect().right > window.screen.availWidth)
				menu.style.pixelLeft = obj.getBoundingClientRect().left - menu.offsetWidth;			
		}
	} 


 ///////////////////CascadedDropdown Menu/////////////////
 //Date : 08/09/2001               						//
 //Version : 1.0        								//
 //Author Mr.Arun N Kumar	                            //
 //EMail: n_arunk@hotmail.com							//		
 /////////////////////////////////////////////////////////
 // Modifications on this code is not recomended
 // Suggestions are welcome

