// This file cycles through an array of links.  If the link references the current page, we display the text
// of the item only.  Otherwise, we display a link to the item.
var links_text = new Array ("Committees", "Message from our President", "Dues / Endowment", "Meetings", "Upcoming Events", "History", "Tributes", "About Our Members", "News", "The Fifth Quarter", "Go Home", "Contact Us", "A&T's Home Page");
var links = new Array ("committees", "president", "fund", "meetings", "events", "history", "tributes", "membernews","news", "fifthquarter", "index", "contact", "http://www.ncat.edu");
var links_url = new Array ("committees.htm", "president.htm", "fund.htm", "meetings.html", "events.html", "history.html", "tributes.html", "membernews.html",
"news.html", "http://www.thefifthquarter.com", "index.html", "contact.htm", "http://www.ncat.edu/index.html");


function get_page_name () {
// Get URL of current page.  Convert it from object to string so we can work with it.
var loc = String (this.location); 
// loc is now http://alumband/indexnew.html

// Replace slashes in URL with commas.  Also create an array that has each of the sections
// of the URL in one slot in the array.
loc=loc.split("/"); 
// loc is now http:,,www.ncat.edu,~alumband,indexnew.html 
// Also:

// loc[0] = http:
// loc[1] = 
// loc[2] = www.ncat.edu
// loc[3] = ~alumband
// loc[4] = indexnew.html

// Set loc to the last item in the array.
loc = loc[loc.length-1];
// loc is now indexnew.html

// Create an array that splits indexnew and html apart from each other.
loc = loc.split(".");
// loc is now indexnew, html
// loc[0] - indexnew
// loc[1] = html

loc=loc[loc.length-2]; 
return (loc);
}


function display_menu_items() {
	// Cycle through the links array.  If the name of the file in the array cell is the current page, just
	// write the text of the filename.  Otherwise, write a link to the page.
	var name_of_this_file;
	name_of_this_file = get_page_name();
	for(var i=0; i < links.length; i++) {  
		// document.write ("name_of_this_file:  " + name_of_this_file + "<br>"); 
		// document.write ("links[i]:           " + links[i] + "<br>");
  		if (name_of_this_file != links[i])			
			document.write ("[ " + "<font face='Comic Sans MS' size='2'>" + "<a href= '" + links_url[i] + "'>" + links_text[i] + "</a>" + "</font>" + " ] ");
		// else
			// document.write ("<font face='Comic Sans MS' size='2'>" + links_text[i] + "</font>");
  		}
}
 
 
function generate_menu() {
 	display_menu_items();
}

generate_menu();
// document.write('<table class="explorer_active" onmouseover="this.className=&#39;:explorer_active&#39;:;return true" onmouseout="this.className=&#39;:explorer_active&#39;:;return true" onmousedown="this.className=&#39;:explorer_active&#39;:;return true" onclick="location.href=&#39;:&#39;: + links_url[i] + &#39;:&#39;:"><tr><td><a href="&#39;: + links_url[i] + &#39;:" class="menu">&#39;: + links_text[i] + &#39;: <b>»</b></a></td></tr></table>'); 
