var romanI = new Array("","I","II","III","IV","V","VI","VII","VIII","IX");
var romanX = new Array("","X","XX","XXX","XL","L","LX","LXX","LXXX","XC");
var romanC = new Array("","C","CC","CCC","CD","D","DC","DCC","DCCC","CM");
var romanM = new Array("","M","MM","MMM");

function arabicRoman(arabic) {
	var arabicString = new String(arabic);
	var roman = romanM[parseInt(arabicString.charAt(0))] + romanC[parseInt(arabicString.charAt(1))] + romanX[parseInt(arabicString.charAt(2))] + romanI[parseInt(arabicString.charAt(3))];
	return roman;
}

// assign calendar variables
var today = new Date();
var year = today.getYear();
if (year <= 1000) {
	year = year + 1900
}

var copyRight = '&copy; Mallory Explorer Scout Unit, ' + arabicRoman(2003) + ' - ' + arabicRoman(year);

var emailGSL = '<A HREF="mailto:gsl@secondmonkspath.org.uk">Eddie Marston</A>';
var emailChairman = '<A HREF="mailto:chairman@secondmonkspath.org.uk">Kevin Clarke</A>';
var emailTreasurer = '<A HREF="mailto:treasurer@secondmonkspath.org.uk">Denis Aitchison</A>';
var emailScouts = '<A HREF="mailto:scouts@secondmonkspath.org.uk">Harvey Smith</A>';
var emailCubs = '<A HREF="mailto:cubs@secondmonkspath.org.uk">Phil Bevan</A>';
var emailBeavers = '<A HREF="mailto:beavers@secondmonkspath.org.uk">Jane Carthew</A>';

var emailExplorers = '<A HREF="mailto:explorers@malloryexplorers.org.uk">Harvey Smith</A>';
var emailProgramme = '<A HREF="mailto:programme@malloryexplorers.org.uk">Chris Ashford</A>';
var emailDofE = '<A HREF="mailto:dofe@malloryexplorers.org.uk">Claire Downs</A>';
var emailYLTS = '<A HREF="mailto:ylts@malloryexplorers.org.uk">Eddie Marston</A>';
var emailWebmaster = '<A HREF="mailto:technical@malloryexplorers.org.uk">Kevin Clarke</A>';

optTtl = new Array(
	'About Us',
	'Programme',
	'Activities',
	'Links',
	'For Sale',
	'Contact');
optUrl = new Array(
	'http://www.malloryexplorers.org.uk/index.htm',
	'http://www.malloryexplorers.org.uk/programme.htm',
	'http://www.malloryexplorers.org.uk/activities.htm',
	'http://www.malloryexplorers.org.uk/links.htm',
	'http://www.secondmonkspath.org.uk/exp_forsale.htm',
	'http://www.malloryexplorers.org.uk/contact.htm');
optAlt = new Array(
	'About Mallory Explorer Scout Unit',
	'Weekly programme',
	'Activities calendar',
	'Useful web links',
	'Buy and sell stuff',
	'Contacting us');
optWid = new Array(
	'105',
	'125',
	'100',
	'80',
	'100',
	'100');
var numOpts = optTtl.length;

tabHeader = '<P><TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0">';
	tabHeader = tabHeader + '<TR>';
		tabHeader = tabHeader + '<TD><IMG SRC="media/shim.gif" WIDTH="3" HEIGHT="3"></TD>';

		for(optNum=0; optNum<numOpts; optNum++) {
			tabHeader = tabHeader + '<TD ROWSPAN="2"><IMG SRC="media/shim.gif" WIDTH="10" HEIGHT="1"></TD>';
			tabHeader = tabHeader + '<TD ROWSPAN="3" BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="3" HEIGHT="1"></TD>';
			tabHeader = tabHeader + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="' + optWid[optNum] + '" HEIGHT="1"></TD>';
			tabHeader = tabHeader + '<TD ROWSPAN="3" BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="3" HEIGHT="1"></TD>';
		}

		tabHeader = tabHeader + '<TD ROWSPAN="2" COLSPAN="2">&nbsp;</TD>';
	tabHeader = tabHeader + '</TR>';
	tabHeader = tabHeader + '<TR>';
		tabHeader = tabHeader + '<TD><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="40"></TD>';

		for(optNum=0; optNum<numOpts; optNum++) {
			tabHeader = tabHeader + '<TD><FONT SIZE="+1"';
			if (optNum == CurrOn) {
				tabHeader = tabHeader + 'COLOR="#993300">';
			} else {
				tabHeader = tabHeader + '><A HREF="' + optUrl[optNum] + '" STYLE="text-decoration:none"';
				tabHeader = tabHeader + ' TITLE="' + optAlt[optNum] + '">';
			}
			tabHeader = tabHeader + '&nbsp;&nbsp;' + optTtl[optNum];
			if (optNum != CurrOn) tabHeader = tabHeader + '</A>';
			tabHeader = tabHeader + '</FONT></TD>';
		}

	tabHeader = tabHeader + '</TR>';
	tabHeader = tabHeader + '<TR>';
		tabHeader = tabHeader + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="3"></TD>';

		for(optNum=0; optNum<numOpts; optNum++) {
			tabHeader = tabHeader + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="1"></TD>';
			tabHeader = tabHeader + '<TD';
			if (optNum != CurrOn) tabHeader = tabHeader + ' BGCOLOR="#999966"';
			tabHeader = tabHeader + '><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="1"></TD>';
		}

		tabHeader = tabHeader + '<TD BGCOLOR="#999966" WIDTH="100%"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="1"></TD>';
		tabHeader = tabHeader + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="3" HEIGHT="1"></TD>';
	tabHeader = tabHeader + '</TR>';
	tabHeader = tabHeader + '<TR>';
		tabHeader = tabHeader + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="1"></TD>';
		tabHeader = tabHeader + '<TD COLSPAN="' + (numOpts * 4 + 1) + '">';


		tabFooter = '</TD>';
		tabFooter = tabFooter + '<TD BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="1"></TD>';
	tabFooter = tabFooter + '</TR>';
	tabFooter = tabFooter + '<TR>';
		tabFooter = tabFooter + '<TD COLSPAN="' + (numOpts * 4 + 3) + '" BGCOLOR="#999966"><IMG SRC="media/shim.gif" WIDTH="1" HEIGHT="3"></TD>';
	tabFooter = tabFooter + '</TR>';
tabFooter = tabFooter + '</TABLE>';
