//SET YOUR DEFAULT PAGE BELOW.
var defaultPage = "default.html"
var globalNav = "<ul>"+
                    "<li><a href='/our-programs/program-overview/CIRCLE/default.html'>Background</a></li>"+
                    "<li><a href='/our-programs/program-overview/CIRCLE/projects/default.html'>Projects</a></li>"+
                    "<li><a href='/our-programs/program-overview/CIRCLE/training/default.html'>Training</a>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/training/e-circle.html'>E-CIRCLE</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/training/m-class-circle.html'>mClass&reg; CIRCLE</a></li>"+
						"</ul>"+
					"</li>"+
                    "<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/best-practices.html'>Literacy Components</a>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/best-practices.html'>Best Practices</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/language-development.html'>Language Development</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/written-expression.html'>Written Expression</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/letter-knowledge.html'>Letter Knowledge</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/read-aloud.html'>Read Aloud</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/phonological.html'>Phonological Awareness</a></li>"+
							"<li><a href='/our-programs/program-overview/CIRCLE/literacy-components/print-and-book.html'>Print &amp; Book Knowledge</a></li>"+
						"</ul>"+
					"</li>"+
					"<li><a href='/our-programs/program-overview/CIRCLE/tools/default.html'>Tools &amp; Links</a>"+
					"</li>"+
					"<li><a href='/our-programs/program-overview/CIRCLE/contact-us/default.html'>Contact Us</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";
			}
		}
	}
}