// Constructor for menu item objects
function MenuItem(text, url, height)
{
	this.text = text;
	this.url = url;
	this.height = height;
}


// An object for each menu item
ItemA = new MenuItem("Home", "index.htm", 32);
ItemB = new MenuItem("Location Map", "location.htm", 32);
ItemC = new MenuItem("Worship Services", "worship.htm", 32);
ItemD = new MenuItem("Events and<br>Announcements", "events.htm", 32);
ItemE = new MenuItem("Kids&#39; Activity Page", "kids.htm", 32);
ItemF = new MenuItem("Teaching and<br>Learning about<br>Christ", "teaching.htm", 56);
ItemG = new MenuItem("Our Work in the<br>Community and<br>Beyond", "ourwork.htm", 32);
ItemH = new MenuItem("Women&#39;s Groups", "women.htm", 32);
ItemI = new MenuItem("For Youth", "youth.htm", 32);
ItemJ = new MenuItem("Baptism", "baptism.htm", 32);
ItemK = new MenuItem("Church Staff", "staff.htm", 32);
ItemL = new MenuItem("Wedding Rentals", "wedding.htm", 32);
ItemM = new MenuItem("Community Groups", "groups.htm", 32);
ItemN = new MenuItem("Contact Us", "location.htm#Contact Us", 32);
ItemO = new MenuItem("Sermon Podcast", "podcasting.htm", 32);


// Array of menu items we can iterate over
MenuItems = new Array(ItemA, ItemB, ItemC, ItemD, ItemO, ItemE, ItemF, ItemG, ItemH, ItemI, ItemJ, ItemK, ItemL, ItemM, ItemN);


MenuTop = new Array(
"<table border='0' cellpadding='0' cellspacing='0' width='135'>",
"<tr>",
"<td><img src='menubg/bartopa.jpg' width='10' height='10'></td>",
"<td background='menubg/bartopb.jpg'>",
"<img src='menubg/bartopb.jpg' width='10' height='10'></td>",
"<td><img src='menubg/bartopc.jpg' width='10' height='10'></td>",
"</tr>",
"<tr>",
"<td><img src='menubg/bartopleft160.jpg' width='10' height='160'></td>",
"<td valign='top' background='menubg/barbg.jpg'>",
"<img src='menubg/bartitle.jpg' width='110' height='70'></td>",
"<td>",
"<img src='menubg/bartopright160.jpg' width='10' height='160'></td>",
"</tr>"
);


MenuBottom = new Array(
"<tr>",
"<td valign='top'>",
"<img src='menubg/bartaila.jpg' width='10' height='85'>",
"</td>",
"<td valign='top'>",
"<img src='menubg/bartailb.jpg' width='115' height='85'>",
"</td>",
"<td valign='top'>",
"<img src='menubg/bartailc.jpg' width='10' height='85'>",
"</td>",
"</tr>",
"<tr>",
"<td>&nbsp;</td>",
"<td>&nbsp;</td>",
"<td>&nbsp;</td>",
"</tr>",
"</table>"
);


function
ShowMenuTop()
{
	for(i = 0; i < MenuTop.length; i++)
	{
		document.write(MenuTop[i]);
	}
}


function
ShowMenuItems()
{
	for(i = 0; i < MenuItems.length; i++)
	{
		html = "";

		text = MenuItems[i].text;
		url = MenuItems[i].url;
		height = MenuItems[i].height;

		// create one row of three cells
		html += "<tr>",
		html += "<td background='menubg/barlefttile.jpg'>&nbsp;</td>",
		html += "<td valign='top' background='menubg/barbg.jpg' height='" + height + "'>",
		html += "<a href='" + url + "'><h5>" + text + "</h5></a></td>",
		html += "<td background='menubg/barrighttile.jpg'>&nbsp;</td>",
		html += "</tr>",

		// display this menu item
		document.write(html);
	}
}


function
ShowMenuBottom()
{
	for(i = 0; i < MenuBottom.length; i++)
	{
		document.write(MenuBottom[i]);
	}
}


function
ShowMenu()
{
	ShowMenuTop();
	ShowMenuItems();
	ShowMenuBottom();
}
