//sets site path links to hover state
function lightUp(){
	var pathSplit;
	var testPath;
	var testRe;
	for (var i=0;i<allARef.length;i++) {
		testThisPage = allARef[i].href;
		if (!allARef[i].id || allARef[i].id == ''){
			allARef[i].id = 'link_' + i;
		}
		if (allARef[i].className == "pageNavLink"){
			allSectionNavARef.push(allARef[i]);
		}
		for (var j=0;j<againstThisPage.length;j++) {
			if (testThisPage.toLowerCase()== againstThisPage[j].toLowerCase()) {
				if (!allARef[i].className.match(/Hover$/)) {
				allARef[i].className=allARef[i].className+'Hover';
				}
				if (allARef[i].className == "pageNavLinkHover"){
					thisPage=allARef[i].id;
				}
			}
		}	
	}
	
	//the current page we are on is not in the nav (for e.g. tabbed nav)
	if ((!thisPage) || (thisPage == '')) {
		pathSplit = document.location.href.split('/');
		testPath = pathSplit.pop();
		testPath = pathSplit.join('/') + '(?:/|/index\\.[^./]+)$';
		testRe = new RegExp("^" + testPath, "i");
		for (var i=0;i<allSectionNavARef.length;i++) {
			if (testRe.test(allSectionNavARef[i].href)) {
				if (!allSectionNavARef[i].className.match(/Hover$/)) {
				allSectionNavARef[i].className=allSectionNavARef[i].className+'Hover';
				}
				thisPage = allSectionNavARef[i].id;
			}
		}
	}
}
function initTextNav() {
	var aStr = '';
	//MAIN NAV STATE
	//get the folder of the current page (which, in this case is the 3rd element in pathArray)
	//the folder name and the id of the image are set up to use the same name
	//thus we can use the folder name to set the img source to hover
	//designate that this is current page by affixing 'Selected' to its id
	//this is used as a flag so we don't change its state in mouseover and out events
	// var aWin = window.open('', 'aWin');
	// aWin.document.body.innerHTML = '<pre>' + aStr + '</pre>';
	pathArray = document.location.href.split("/");
	thisFolder = pathArray[3];
	
	if (document.getElementById(thisFolder) && !document.getElementById(thisFolder).className.match(/Hover$/)) {
		document.getElementById(thisFolder).className=document.getElementById(thisFolder).className+'Hover';
		}
	}
