function Menu(x,y,width,description)
	{
	this.width = width;
	x -= 4;	//normalize x to the far left
	this.x = eval(((getWindowWidth()/2) - 320) + x);	//HACK: positions to the upper left of a 640 wide TABLE so it will work in any resolution;
	this.y = y - 4;
	if (navigator.family == 'nn4')	//Netscape 4.x
		{
		this.x -=13;
		this.y -=6;
		}
	else if (navigator.family == 'gecko')	//Netscape 6.x and other Mozilla based.
		{
		this.x -= 7;
		this.y -= 7;
		}
	this.description = description;
	menu_items = new Array();
	this.parent = -1;
	this.id = layer_counter++;
	layers[this.id] = this;
	if (print_id)
		{
		//code so you can see which id to start with or use if you have multiple main menu's
		document.write(this.description + "'s id = L" + this.id + "<BR>");
		}
	//method associations
	this.addMenuItem = addMenuItem;
	this.addParent = addParent;
	this.toHTML = MenuToHTML;
	}

function addMenuItem(menu_item)
	{
	menu_items[menu_items.length] = menu_item;
	if (instanceOf(menu_item,Menu))
		{
		menu_item.addParent(this.id);
		}
	}
function addParent(id)
	{
	this.parent = id;
	}
function MenuToHTML()
	{
	var HTML = "";
	if(No3) //MSIE
		{
		if (navigator.family == 'ie4' || navigator.family == 'gecko')	//MSIE 4.x+ , Netscape 6.0+ , Mozilla 0.9.2+
			{
			//HTML += "<SPAN onMouseOver='show("+this.id+");' onMouseOut='hide();this.bgColor=\"\"' ID='L"+this.id+"' STYLE='position:absolute; visibility:hidden; background:"+background+"; left:"+this.x+";top:"+this.y+";'><TABLE STYLE='border:solid "+menu_border+" "+border_color+"'CELLPADDING=\""+this.cellpadding+"\" CELLSPACING=\""+this.cellspacing+"\" BORDER=\"0\" BGCOLOR=\""+bgcolor+"\">\n";
			HTML += "<DIV ID=\"L"+this.id+"\" onMouseOver='show("+this.id+");' onMouseOut='hide();this.bgColor=\"\"' STYLE='position:absolute; visibility:hidden; left:"+this.x+"; top:"+this.y+";' width:"+this.width+";>\n";
			HTML += "\t<TABLE WIDTH="+this.width+" STYLE='border:solid "+menu_border+" "+border_color+"' CELLPADDING=\""+cellpadding+"\" CELLSPACING=\""+cellspacing+"\" BORDER=\"0\" BGCOLOR=\""+bgcolor+"\">\n";
			}
		else if (navigator.family == 'nn4')	//Netscape 4.x
			{
			HTML += "<LAYER onMouseOver='show("+this.id+");' onMouseOut='hide();' ID='L"+this.id+"' POSITION=ABSOLUTE VISIBILITY=hidden BGCOLOR='"+bgcolor+"' BACKGROUND='"+background+"' LEFT='"+this.x+"px' TOP='"+this.y+"px' WIDTH='"+this.width+"px'><TABLE WIDTH=\""+this.width+"\" CELLPADDING=\""+cellpadding+"\" CELLSPACING=\""+cellspacing+"\" BORDER=\"0\" BGCOLOR=\""+bgcolor+"\">\n";
			}
		for (var i = 0;i < menu_items.length;i++)
			{
			var item = menu_items[i];
			//check if Menu or MenuItem
			if (instanceOf(item,MenuItem))
				{
				HTML += item.toHTML();
				}
			else //if (instanceOf(menu_items[i],Menu))
				{
				//HTML += "<TR onClick=\"hideNOW();show("+item.id+");\" onMouseOver=\"hideNOW();show("+item.id+");this.bgColor='"+hovercolor+"';\" onMouseOut='this.bgColor=\"\";'><TD><A HREF=\"javascript:hideNOW();show("+item.id+");\" ID=\"toolbar\" onMouseOver=\"hideNOW();show("+item.id+");\">"+item.description+"</A></TD><TD ALIGN=\"RIGHT\"><IMG SRC=\""+arrow_pic+"\" BORDER=\"0\"></TD></TR>";

				HTML += "\t<TR onClick=\"hideNOW();show("+item.id+");\" onMouseOver=\"hideNOW();show("+item.id+");this.bgColor='"+hovercolor+"';\" onMouseOut='this.bgColor=\"\";'>\n";
				HTML += "\t\t<TD><A HREF=\"javascript:hideNOW();show("+item.id+");\" ID=\"toolbar\" onMouseOver=\"hideNOW();show("+item.id+");\">"+item.description+"</A></TD>\n";
				HTML += "\t\t<TD ALIGN=\"RIGHT\"><IMG SRC=\""+arrow_pic+"\" BORDER=\"0\"></TD>\n";
				HTML += "\t</TR>\n";
				}
			}
		if (navigator.family == 'ie4' || navigator.family == 'gecko')	//MSIE 5.x+
			{
			HTML += "\t</TABLE>\n</DIV>\n";
			}
		else if (navigator.family == 'nn4')	//Netscape 4.x
			{
			HTML += "</TABLE></LAYER>\n";
			}
		}
	return HTML;
	}