//////////////////////////
// configuration...
//////////////////////////

var buttons = new Array(
	"index.html","Main Page",
	"about.htm","About SICARS",
	"times.htm","Slave Times",
	"hammock.htm","Hog Hammock",
	"support.htm","Membership and Donations",
	"events.htm","Events Calendar",
	"griot5.html","The Griot",
	"catalog.htm","Catalog",
	"contact.htm","Contact Us!",
	"");

var bg_inactive = "#ffb020";
var fg_active = "#000000";
var bg_active = "#ff9000";
var fg_inactive = "#503010";

var txt_caption = "";

////////////////////////////////
// DON'T EDIT BELOW THIS LINE //
////////////////////////////////

//////////////////////////
// run-time init
//////////////////////////
var file = getname();
if(file == "") {
	file = "index.htm"
}

//////////////////////////
// public functions
//////////////////////////
function genHTable ()
{	
	document.write(
		txt_caption +
		'<TABLE CELLSPACING=0 WIDTH= 700 CELLPADDING=1><TR><TD BGCOLOR="BLACK">' +
		'<TABLE HEIGHT="0" CELLSPACING="0" CELLPADDING="3"><TR>'
		);

	for( i=0; i+2 < buttons.length; i += 2 ){
		var url = buttons[i];
		var txt = buttons[i+1];
		var str = "";
		if(file == url){
			writeHBox("",txt, fg_active, bg_active );
		}else{
			writeHBox('HREF="' + url + '"',txt, fg_inactive, bg_inactive );
		}
	}
	document.write('</TR></TABLE></TD></TR></TABLE>');
	return true;
}

function genMTable ()
{	
	document.write('<TABLE CELLSPACING=1 CELLPADDING=3 BGCOLOR=#ffe030>');
	for( i=0; i+2 < buttons.length; i += 2 ){
		var url = buttons[i];
		var txt = buttons[i+1];
		if(file == url){
			writeMBox("",txt,fg_active,bg_active);
		}else{
			writeMBox('HREF="' + url + '"',txt,fg_inactive,bg_inactive);
		}
	}
	document.write('</TABLE>');
	return true;
}

//////////////////////////
// private functions
//////////////////////////

function writeHBox(url,txt,fg,bg)
{	
	document.write(
		'<TD WIDTH="100" HEIGHT="20" BGCOLOR="' + bg + '">' +
		'<A '+ url + '>' +
		'<FONT FACE="Verdana" SIZE=1 COLOR="' + fg + '"><B><CENTER>' +
		txt +
		'</CENTER></B></FONT></A></TD>'
		);
}

function writeMBox(url,txt,fg,bg)
{	
	document.write(
		'<TR><TD WIDTH=100 HEIGHT=20 BGCOLOR="' + bg + '">' +
		'<A '+ url + '>' +
		'<FONT FACE="Verdana" SIZE=1 COLOR="' + fg + '"><B><CENTER>' +
		txt +
		'</CENTER></B></FONT></A></TD></TR>'
		);
}

function getname ()
{	
	var str = location.pathname;
	var a = 1+Math.max(str.lastIndexOf("/"),str.lastIndexOf("\\"));
	if(a <= 0) { return str; }
	return str.substr(a);
}

