var sections;

function initSections()
{
	if (document.getElementById == null) return;
	sections = document.getElementById("sections").getElementsByTagName("div");
	
	var sectionLinks = document.getElementsByTagName("a");
	for (var i=0; i<sectionLinks.length; i++)
		if (sectionLinks[i].href.indexOf("#") > -1)
			sectionLinks[i].href = "javascript:loadSection('" + sectionLinks[i].href.substr(sectionLinks[i].href.indexOf("#") + 1) + "Section')";

	var sectionLinks = document.getElementsByTagName("area");
	for (var i=0; i<sectionLinks.length; i++)
		if (sectionLinks[i].href.indexOf("#") > -1)
			sectionLinks[i].href = "javascript:loadSection('" + sectionLinks[i].href.substr(sectionLinks[i].href.indexOf("#") + 1) + "Section')";
	loadSection("westernSection");
}

function loadSection(id)
{
	for (var i=0; i<sections.length; i++)
	{
		if (sections[i].id == id)
			sections[i].style.display = "block";
		else
			sections[i].style.display = "none";
	}
}

function emailLink(email)
{
	email = email.replace(/[*]/, "@");
	location.href = "mailto:" + email;
}
