//SET YOUR DEFAULT PAGE BELOW.
var defaultPage = "default.html"
var globalNav = "<ul>"+
                    "<li><a href='/our-programs/program-overview/PALS/default.html'>Background</a></li>"+
                    "<li><a href='/our-programs/program-overview/PALS/projects.html'>Projects</a></li>"+
					"<li><a href='/our-programs/program-overview/PALS/locations.html'>Locations</a></li>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/PALS/locations-texas.html'>Across Texas</a></li>"+
							"<li><a href='/our-programs/program-overview/PALS/locations-usa.html'>Across the US</a></li>"+
						"</ul>"+
					"<li><a href='/our-programs/program-overview/PALS/training.aspx'>PALS Training</a></li>"+
					"<li><a href='/our-programs/program-overview/PALS/success-stories.html'>Success Stories</a></li>"+
					"<li><a href='/our-programs/program-overview/PALS/publications.html'>Publications</a></li>"+
               "</ul>";

var pathName = new String(location.pathname);//Firefox represents the href value as /filename.html
var fullHref = new String(location.href);//IE represents the href value as http://www.domain.com/filename.html

if(fullHref.charAt(fullHref.length-1) == "/"){
	fullHref = fullHref + defaultPage;
}

//set '/' to the correct default Page
if(pathName =="/"){
	pathName = "/"+defaultPage;
}

//write the navigation
document.write(globalNav);


var navList = document.getElementsByTagName('LI');
for(i in navList){
	if(navList[i].hasChildNodes){
		if(navList[i].firstChild.attributes.href){
			var hrefPath = navList[i].firstChild.attributes.href.value;
			if((hrefPath == pathName) || (fullHref == hrefPath)){
				navList[i].className="active";
			}
		}
	}
}