//
// Generic menu object
//

function menu(font){
	// Elements
	this.Menu = '<font color = #ff9933 face='+ font + '>';	// Initialize the menu
	this.Font = font;

	// Methods
	this.Clear = Menu_Clear;
	this.AddMajorItem = Menu_AddMajorItem;
	this.AddMinorItem = Menu_AddMinorItem;
	this.InsertSpace = Menu_InsertSpace;
	this.Display = Menu_Display;
}

function Menu_Clear() {
	this.Menu = '<font face='+ this.Font + '>';	// Re-initialize the menu
}

function Menu_AddMajorItem(cText, cLink){
	var cCumulate = '';

	cCumulate += '<b>';

	// Add link, if not already on that page
	if(location.pathname.indexOf(cLink, 0) == -1){
		cCumulate += '<a href="';
		cCumulate += cLink;
		cCumulate += '" target="_top">';
	}
	
	// Add text
	cCumulate += cText;

	// Wrap up
	cCumulate += '</a></b><br>';

	this.Menu += cCumulate;
}

function Menu_AddMinorItem(cText, cLink){
	var cCumulate = '';
	var cIndent = '&nbsp;&nbsp;&nbsp;';

	// Specify font
	cCumulate += cIndent;
	cCumulate += '<font size=-1>';

	// Add link, if not already on that page
	if(location.pathname.indexOf(cLink, 0) == -1){
		cCumulate += '<a href="';
		cCumulate += cLink;
		cCumulate += '" target="_top">';
	}
	
	// Add text
	cCumulate += cText;

	// Wrap up
	cCumulate += '</a></font><br> ';

	this.Menu += cCumulate;
}

function Menu_InsertSpace() {
	this.Menu += '<p>';
}

function Menu_Display() {
	var tempMenu;

	tempMenu = this.Menu + '</font>';  // Stick the closing </font> at the end, but allow further appends
	document.write(tempMenu);
}



