function drawMenu(root_d) {
	document.writeln("<H1>Flossie Peitsch</H1>");
	document.writeln("<CENTER><SPAN STYLE='color: white; font-weight: bold; font-size: 8pt'>Web design by Philip Peitsch</SPAN></CENTER>");
	root_dir = root_d;
	startMenu('Home','index.html');
	addMenuItem('Introduction','index.html');
	addMenuItem('Brief CV','cv.html');	
	addMenuItem('Chapter Themes','themes.html');		
	endMenu();
	
	startMenu('The Immortal Now','the_immortal_now/index.html');
	addMenuItem('Home','the_immortal_now/index.html');
	addMenuItem('Abstract','the_immortal_now/abstract.html');
	addMenuItem('Images','the_immortal_now/images.html');
	addSubMenuItem('Chapel','the_immortal_now/chapel/index.html');
	addSubMenuItem('Nave','the_immortal_now/nave/index.html');
	addSubMenuItem('Sanctuary','the_immortal_now/sanctuary/index.html');
	endMenu();
	
	startMenu('Chisholm\'s Homes','chisholms_homes/index.html');
	addMenuItem('Home','chisholms_homes/index.html');
	addMenuItem('Website','chisholms_homes/chisholms/index.html');		
	addMenuItem('Powerpoint Presentation','chisholms_homes/shakingdown.html');			
	addMenuItem('Images','chisholms_homes/images.html');
	endMenu();
	
	startMenu('Other Installations','other_installations/index.html');
	addMenuItem('Home','other_installations/index.html');
	addMenuItem('Images','other_installations/chapel/index.html');
	addSubMenuItem('Chapel','other_installations/chapel/index.html');
	addSubMenuItem('Nave','other_installations/nave/index.html');
	addSubMenuItem('Sanctuary','other_installations/sanctuary/index.html');
	endMenu();
}

function startMenu(caption, path) {
	document.writeln("<TABLE ID='menu'>");
	document.writeln("<TR><TD CLASS='header'>");
	document.writeln("<A HREF='" + root_dir + path + "'>" + caption + "</A>");
	document.writeln("</TD>");
	document.writeln("</TR>");
}

function endMenu() {
	document.writeln("</TABLE>");
}

function addMenuItem(caption, path) {
	var address = document.location + "";
	var pth = root_dir + path
	if(address.length > path.length && address.substring(address.length-path.length, address.length) == path)
		document.writeln("<TR CLASS='entrySelected'><TD CLASS='entrySelected'>");
	else
		document.writeln("<TR CLASS='entry'><TD CLASS='entry'>");
	document.writeln("<A HREF='" + pth + "'>" + caption + "</A>");
	document.writeln("</TR>");
}

function addSubMenuItem(caption, path) {
	var address = document.location + "";
	var pth = root_dir + path
	if(address.length > path.length && address.substring(address.length-path.length, address.length) == path)
		document.writeln("<TR CLASS='entry2Selected'><TD CLASS='entry2Selected'>");
	else
		document.writeln("<TR CLASS='entry2'><TD CLASS='entry2'>");
	document.writeln("<A HREF='" + pth + "'>" + caption + "</A>");
	document.writeln("</TR>");
}