function Menu(menuname, text_array, url_array, bgcolor, width, font_color){
	
	//Calls the funtction to create the contents of the menu
	MakeLayerContents(text_array, url_array, bgcolor, width, font_color);
	body = calltable;
	
	this.window = window;
	this.left = 15;
	
	if (typeof toppos == 'string'){this.top = toppos}
	else (this.top = 81)
	
	//this.top = 86;
	this.width = width;
    this.id = menuname;
    this.body = body;
	
	//creates the styles
	var d = window.document;
	d.writeln('<STYLE TYPE="text/css">');
    d.write('#' + this.id + ' {position:absolute;');
    d.write('left:' + this.left + ';');
    d.write('top:' + this.top + ';');
    d.write('width:' + this.width + ';');
    d.writeln('}');
    d.writeln('</STYLE>');
	
	//creates the layer
	this.output();
	//hides the layer after it is created
	this.hide();
	
	//adds the name of the menu to the array
	menus[menus.length] = menuname;
		
}

function displayMenu(menuname){
	//first hides all of the menus
	for (i=1; i<menus.length; i++){
		eval(menus[i]).hide();
	}
	//shows the menu you have chosen
	eval(menuname).show();
}

function hideMenus(){
	//first hides all of the menus
	for (i=1; i<menus.length; i++){
		eval(menus[i]).hide();
	}
}

function MakeLayerContents(text_array, url_array, bgcolor, width, font_color){

//allows user to set font type to something other than Arial, Ariel, Helvetica
if (typeof fonttype == 'string'){fonttype = fonttype}
else{fonttype = 'Arial, Ariel, Helvetica'}

//allows user to set font size to another size
if (typeof rfontsize == 'string'){rfontsize = rfontsize}
else{rfontsize = '-1'}

calltable = "<Table bgcolor=" + bgcolor + " width=" + width + " cellpadding=\"3\" cellspacing=0 border=0><TR>";
	
	//loops through the arrays that are passed to create links
	for (i=1; i<text_array.length; i++){
		
		calltable += "<TD valign=middle align=center>"
		calltable += "<a href="
		calltable += url_array[i]
		calltable += ">"
		calltable += "<span style=\"" + fonttype + "\" size=\"" + rfontsize + "\" color=\"" + font_color+ "\">"
		calltable += text_array[i]
		calltable += "</span>"
		calltable += "</a>"
		calltable += "</td>"
		
		if ((i<text_array.length-1) && (typeof divider == 'string')){
			calltable += "<TD align=center>"
			calltable += "<span style=\"" + fonttype + "\" size=\"" + rfontsize + "\" color=\"" + font_color+ "\">"
			calltable += " " + divider + " "
			calltable += "</span>"
			calltable += "</TD>"
		}
		
		
	}
	calltable += "</tr></Table>";
}

//Pre Netscape 6 handlers
if ((navigator.appName.indexOf("Netscape") != -1) && (parseInt(navigator.appVersion)<5)){

    Menu.prototype.output = function() {
        var d = this.window.document;
        d.writeln('<DIV ID="' + this.id + '">');
        d.writeln(this.body);
        d.writeln("</DIV>");
        this.layer = d[this.id];
    }
	
	Menu.prototype.show = function() { this.layer.visibility = "show"; }
    Menu.prototype.hide = function() { this.layer.visibility = "hide"; }
}

//Microsoft IE Handler
if (navigator.appName.indexOf("Microsoft") != -1) {

    Menu.prototype.output = function() {
        var d = this.window.document;
        d.writeln('<DIV ID="' + this.id + '">');
        d.writeln(this.body);
        d.writeln("</DIV>");
        this.element = d.all[this.id];
        this.style = this.element.style;
    }

    Menu.prototype.show = function() { this.style.visibility = "visible"; }
    Menu.prototype.hide = function() { this.style.visibility = "hidden"; }

}

//Netscape 6 Handlers
if ((navigator.appName.indexOf("Netscape") != -1) && (parseInt(navigator.appVersion)==5)) {

    Menu.prototype.output = function() {
        var d = this.window.document;
		
        d.writeln('<DIV ID="' + this.id + '" style="left:' + this.left + ';top:' + this.top + ';zIndex:0;height:0;width:' + this.width + ';position:absolute">');
		d.writeln(this.body);
        d.writeln("</DIV>");
		this.element = d.getElementById(this.id);
        this.style = this.element.style;
    }


    Menu.prototype.show = function() { this.style.display = ""; }
    Menu.prototype.hide = function() { this.style.display = "none"; }  
}
