
// This hashmap contains a key-value pair of
// KEY = page name, VALUE = page title
//var PAGES = {
//	/* HOME */
//	welcome : "Welcome! ",
//	enrollment : "Enrollment",
//	
//	/* GENERAL */
//	honors	: "Honors",
//	mission : "Mission Statement",
//	schoolboard : "School Board",
//	
//	/* PARENT */
//	calendar : "Calendar",
//	staff : "Staff",
//	events : "Events",
//	
//	/* STUDENT */
//	homework: "Homework",
//	schoolevents : "School Events",
//	mindpuzzles : "Mind Puzzles",
//	
//	/* CONTACT US */
//	employment : "Employment",
//	information : "Maps &amp; Information",
//	
//	
//	llamaster : "Testing"
//};

// Initialize the page
function init() {

//	var page = location.href.replace(/.*\//,'').replace(/\..*/,'').toLowerCase();
	var page = location.href.replace(/.*\//,'').replace(/\{db\}/,'').replace(/\%7Bdb\%7D/,'').replace(/\.php/,'').replace(/\?/,'-').replace(/#.*/,'').toLowerCase();	
	//document.write(page);
	var pageTitle = document.getElementById("page-title");
//	var section = /\?.*/i(location.href);	
	var navLink = document.getElementById(page + "-link"  );

	var containerLink = document.getElementById(page + "-container" );
//	alert("Nav link = " + (page + "-link") + ", found it ? " + navLink);
	if(navLink != null) {
		navLink.className += ' link-active';

		if(containerLink != null) {
			containerLink.className += ' container-visible';
		}
		else {
			containerLink = navLink.parentNode;
			containerLink.className += ' container-visible';
		}
		
		var parentLink = document.getElementById(  containerLink.id.replace(/container/,"link") );
		parentLink.className += ' link-active';
		
	}
	if(pageTitle != null) {
//		pageTitle.innerHTML = PAGES[page];
	}
	
}

// Highlight link on mouse over
function HeaderLinkOver(element) {
	element.style.backgroundColor='#b0ffb0';

}

// Remove highlight on link when mouse removed
function HeaderLinkOut(element) {
	element.style.backgroundColor='';
}

// Go to the specified link
function Go(element) {
	var href = element.getAttribute('href');
	location.href = href;
	//window.alert("navLink = ");
	//window.alert("containerLink = ");
	//window.alert("parentLink = ");

}
