// JavaScript Document
function ec1(end, beg) {
	document.write("<a href=" + "'mai" + "lto:" + beg + "@" + end + "'>" + beg + "@" + end + "</a>");
}
function ec2(end, beg) {
	document.write("<a href=" + "'mai" + "lto:" + beg + "@" + end + "'>email</a>");
}
function select_nav() {
	var nav_links = document.getElementById('navMain').getElementsByTagName('a');
	var selected = location.pathname;
	
	for (var i = 0; i < nav_links.length; i++) {
		var link = nav_links[i].pathname;
		
		// fiddle IE's view of the link
		if (link.substring(0, 1) != '/') {
			link = '/' + link;
		}
		if (link == selected) {
			nav_links[i].setAttribute("class", 'selected');
		}
	}

var nav_links = document.getElementById('subPageNavigation').getElementsByTagName('a');
	var selected = location.pathname;
	
	for (var i = 0; i < nav_links.length; i++) {
		var link = nav_links[i].pathname;
		
		// fiddle IE's view of the link
		if (link.substring(0, 1) != '/') {
			link = '/' + link;
		}
		if (link == selected) {
			nav_links[i].setAttribute("class", 'selected');
			selectParent();
		}
	}
}

function selectParent() {
	document.getElementById('eventsParent').setAttribute("class", 'selected');
}


window.onload = function() {
	select_nav();
};
