// JavaScript changes to current page
// CSU Libraries: Water Resources Archive: Carpenter and the Compacts
// Greg Vogl 2006-03-23
window.onload = function() {
	// check all links in the page
    var a = document.getElementsByTagName("A");
    for (var i=0; i<a.length; i++)
		// highlight any links to current page in navigation bars to orient the user
		if (a[i].href == window.location.href.split("#")[0]) {
			a[i].style.cursor = "default";
			// do not highlight the home page logo link
//			if (!a[i].href.match("index.html")) { 
                a[i].style.color = "#ff5555"; // 
				a[i].style.backgroundColor = "transparent";
//			}
			a[i].style.textDecoration = "none";
	        a[i].title = "(You are at this page" 
	   		+ (a[i].title ? ": " + a[i].title : 
			   (a[i].innerText ? ": " + a[i].innerText : "")) + ")";
		}
	return true;
}

var pages = new Array("./","family.html","daughter.html","sister.html","classmate.html","wife.html","mother.html","moreinfo.html","digital.html");

function getPage()
{
	var n=0;
	var url=window.location.href.split("#")[0];
	for (var i=0; i<pages.length; i++)
		if (url.match(pages[i]))	
			n = i;
	return n;	
}

function goToPage(i)
{
	var n=getPage();
	n+=i; if (n == pages.length) n = 0; else if (n == -1) n = pages.length-1;
	location.href = pages[n];
	return true;
}
