var eras = new Array("1900", "1920", "1940", "1960", "1980", "2000");
var pageNames = new Array("index", "culture", "third", "multi");

function setCurrentVars() {
	if (document.getElementById) {
		var theId;									// Will hold the ID name
		var inEra = false;							// Needed to determine if we are in an era
													// since the left side nav will need to be
													// set; it is set manually in the pages in
													// the root directory.
		sURL = window.location.href;
		for (var a = 0; a < eras.length; a++) {		// Find which era we are in
			if (sURL.indexOf(eras[a]) > 0) {
				theId = "era" + a;
				inEra = true;
				document.getElementById(theId).className = "this_year";
				break;
			}
		}
		
		// Find which section we are in
		for (var a = 0; a < pageNames.length; a++) {		// Find which era we are in
			if (sURL.indexOf(pageNames[a]) > 0 && inEra) {
				theId = "side-nav_" + a;
				document.getElementById(theId).className = "this_section";
				break;
			}
		}
	}
}

//
//	Image Swapper for Home Page
//
function changeNav(lineNode, state) {
	if (document.getElementById) {
	
		// Cycle through all of the elements of the link
		for (i = 0; i < lineNode.childNodes.length; i++) {
			node = lineNode.childNodes[i];
			
			// If we hit an <A> tag, then...
			if (node.nodeName=="IMG") {
				var imgId = node.id;
				document.images[imgId].src = "images/home_" + imgId + "_" + state + ".jpg";
				break;
			}
		}
	}
}
