// Arrays for storing the menu data.
var Menu_text = new Array(0);
var Menu_document = new Array(0);
var Menu_sub = new Array(0);
var contentdir = ""


// This function adds a new menu to the arrays.
function newMenuItem(text, document, level)
{
    Menu_text.push(text);
    Menu_document.push(document);
    Menu_sub.push(level);
}


// This function builds the menu and outputs it in HTML.
function BuildMenu()
{

    // Set the font, write the title, and arange the top of the menu.
    document.write("<font class=\"menulink\">");
    document.write("<b>Topics</b><br />");
    document.write("<hr noshade=\"noshade\" width=\"100%\" color=\"#C0C0C0\" />");

    // Write menu links to the document. 
    for (count = 0; count < Menu_text.length; count++)	// Loop through the menu arrays.
    {
	// Write root menu item.
	if (Menu_sub[count] == 0) { document.write(":: <a href=\"" + contentdir + Menu_document[count] + "\">" + Menu_text[count] + "</a><br />"); }

	// Write sub menu item.
	else { document.write("::--- <a href=\"" + contentdir + Menu_document[count] + "\">" + Menu_text[count] + "</a><br />"); }
    }

    document.write("</font>");
}

// Insert the menu items.
newMenuItem("Overview","overview.html",0);
newMenuItem("Purchase","purchase.html",0);
newMenuItem("Register for Updates","updates.html",0);
newMenuItem("Window Interface","mainwindow.html",0);
    newMenuItem("Main Window","mainwindow.html",1);
    newMenuItem("Tender Drawings","tenderwindow.html",1);
    newMenuItem("Current Drawings","constructionwindow.html",1);
newMenuItem("Index","index.html",0);
//newMenuItem("Back to Jobs","javascript:close();",0);

BuildMenu();

// Padding, hmmm white space!
for (count = 0; count < 20; count++) { document.write("<br />"); }
