var lists = document.getElementsByTagName("ul");
var links = document.getElementsByTagName("li");


/* These functions are for the Links page */

function hideAll() {
	for (var i=0; i<lists.length; i++)
		if (lists[i].className == "link_list") lists[i].style.display = "none";
}

function showList(id) {
	hideAll();
	document.getElementById(id).style.display = "block";
	return false;
}


/* These functions are for the Events page */

function showTabs(set) {
	// default is 'local'
	if ((set != 'local') && (set != 'reg') && (set != 'intl') && (set != 'all')) set = "local";
	for (var i=0; i<links.length; i++) {
		// screen for calendar tabs
		if (links[i].parentNode.id == "calendar_tabs") {
			// select the correct tab
			if (links[i].id != set) links[i].className = null;
			else links[i].className = "selected";
			
		// screen for calendar events
		} else if (links[i].parentNode.className == "event_list") {
			// hide inappropriate links
			if ((links[i].className != set) && (set != "all")) links[i].style.display = "none";
			// show appropriate links
			else links[i].style.display = "block";
		}
	}
}