 
	var txtMenu // variable for building menu in HTML
	txtMenu = "";

	function menuItem(text,url,target,parent,level) 
	{
		this.text = text  
		this.url = url
		this.target = target
		this.parent = parent 
		this.level = level
	}

	function initMenu() {

	var itemCount
	itemCount = 0 
	var menuitems

	menuwidth = 100 // fixed width of buttons
	
	txtMenu = "<TABLE width='100%' border=0 cellpadding=2 cellspacing=0 ><TR><TD class='top_menu' width=10>&nbsp;</TD>";
		for (counter=0; counter < myMenu.length ;counter++) 
		{
			if (myMenu[counter].level == 0) 
			{
				if (myMenu[counter].url.length > 0) 
				{
				  txtMenu = txtMenu + "<TD height='20' nowrap align='center' id='top" + counter + "' class='top_menu' width=" + menuwidth + " onMouseOver='draw_sub_menu(" + myMenu[counter].parent + ",1);highlight_bgcolor(this);'><a href='" +myMenu[counter].url + " 'target='" + myMenu[counter].target + "' >" + myMenu[counter].text + "</A></TD>"
				}
				else
				{
					txtMenu = txtMenu + "<TD height='20'  nowrap align='center'  id='top" + counter + "' class='top_menu' width=" + menuwidth +  " onMouseOver='draw_sub_menu(" + myMenu[counter].parent + ",1);highlight_bgcolor(this);'>" + myMenu[counter].text + "</TD>"
				}			
				itemCount = itemCount + 1
			}
		}
	 txtMenu = txtMenu + "<TD class='top_menu' width=100%  >&nbsp;</TD></TR><TR><TD height='20' class='bottom_menu'  colspan=" + (itemCount + 2) + "><div id='submenu'>&nbsp;</div></TD></TR></TABLE>";
	 document.getElementById("menu").innerHTML = txtMenu
	
	//alert (txtMenu)
	
	}

	function draw_sub_menu(parent,level)
	{
	var txtSubMenu 
	var subMenuWidth
	
	subMenuWidth = 120 // fixed width

	txtSubMenu = "<TABLE cellpadding=0 cellspacing=0 border=0><TR>"
		for (counter = 0; counter < myMenu.length;counter++)
		{
			if ((myMenu[counter].level == level) && (myMenu[counter].parent == parent)) 
			{
				if (myMenu[counter].url.length > 0) 
				{
					txtSubMenu = txtSubMenu + "<TD align='center' class='bottom_menu' width=" + subMenuWidth + "><a class='bottom_menu'  href='" +myMenu[counter].url + " 'target='" + myMenu[counter].target + "' >" + myMenu[counter].text + "</A></TD>"
				}
				else
				{
				txtSubMenu = txtSubMenu + "<TD align='center' class='bottom_menu' width=" + subMenuWidth + ">" + myMenu[counter].text + "</TD>"
				}
			
				if (myMenu[counter].text != '&nbsp;' )
				{
				txtSubMenu = txtSubMenu +  "<TD class='bottom_menu' width=1>|</TD>"
				}
			
			}
		}
	txtSubMenu = txtSubMenu + "</TR></TABLE>"
	document.getElementById("submenu").innerHTML = txtSubMenu
	
	// reset the all the tabs bgcolor, we're going to set this again when we get back
	reset_bgcolor()
	}
	

	// sets the background color of the element being passed in
	function highlight_bgcolor(element) {
		if (element) {
			element.style.backgroundColor  = "#EEEEEE"
		}
	}
	
	// resets all the top level elements to the default color
	function reset_bgcolor() 
	{
		for (counter = 0 ; counter < myMenu.length;counter++)
		{
			if	(myMenu[counter].level == 0) {
				document.getElementById("top"+counter).style.backgroundColor = ""	
			}
		}
	}

