function LinkEntry (id, label, url)
{
	this.id = id
	this.label = label
	this.url = url
}


links = new Array
(
	new LinkEntry ("home", 		"Home",				"index.html"),
	new LinkEntry ("chedd",		"St. Giles Cheddington",	"StGilesBells/index.html"),
	new LinkEntry ("restoration",	"St. Giles Bell Restoration",	"StGilesBells/Appeal.html"),
	new LinkEntry ("marsworth",	"All Saints Marsworth",		"Marsworth/index.html"),
	new LinkEntry ("mentmore",	"St. Mary's Mentmore",		"Mentmore/index.html")
)


function makeLinks (links, selId, selCSS, readyCSS, urlAdjust)
{
	makeLinks (links, selId, selCSS, readyCSS, urlAdjust, false)
}


function makeLinks (links, selId, selCSS, readyCSS, urlAdjust, submenu)
{
	var widthPc = 100 / links.length
	var html = ""
	if (submenu)
	{
		html += "<div id=SubMenu>"
	}
	else
	{
		html += "<div id=NavButtons>"
	}
	
	html += "<center><table cellpadding=3 cellspacing=5>"
	if ( ! submenu)
	{
		html += "<tr>"
	}
	for (var i=0; i < links.length; i++)
	{
		if ( submenu)
		{
			html += "<tr>"
		}
		html += "<td align=center width=" + widthPc + "% class="
		
		if (links[i].id == "SPACER")
		{
			html += "<hr width=80%>"
		}
		else
		{
		
			if (links[i].id == selId)
			{
				html += selCSS
			}
			else
			{
				html += readyCSS
			}
			html += "><a href=" + urlAdjust + links[i].url + " class="
			if (links[i].id == selId)
			{
				html += selCSS
			}
			else
			{
				html += readyCSS
			}
			html += ">" + links[i].label + "</a>"
		}
		html += "</td>"
		if (submenu)
		{
			html += "</tr>"
		}

		html += "\n"
	}
	if ( ! submenu)
	{
		html += "</tr>"
	}

	html += "</table></center></div>"
//	alert (html)
	document.writeln (html)
}

function title()
{
	var html = "<div id=title>"
    	html += "The Bell Ringers of Cheddington, Mentmore and Marsworth"
	html += "</div>"

	document.writeln (html)
}
