//SET YOUR DEFAULT PAGE BELOW.
var defaultPage = "default.html"
var globalNav = "<ul>"+
                    "<li><a href='/our-programs/program-overview/clinical-neurosciences/default.html'>Background</a></li>"+
					"<li><u>MSI Centers</u>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/msi-centers/msi-hermann.html'>MSI Center at Hermann</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/msi-centers/gallery-hermann.html'>Hermann MSI Virtual Tour</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/msi-centers/msi-tirr.html'>MSI Center at TIRR</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/msi-centers/gallery-tirr.html'>TIRR Virtual Tour</a></li>"+
						"</ul>"+
					"</li>"+
					"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/default.html'>Projects</a>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/stroke.html'>Stroke</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/epilepsy.html'>Epilepsy</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/language-mapping.html'>Language Mapping</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/math.html'>Math</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/learning-disabilities.html'>Learning Disabilities</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/projects/spina-bifida.html'>Spina Bifida</a></li>"+
						"</ul>"+
					"</li>"+
					"<li><u>About MEG/MSI</u>"+
						"<ul>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/about-FAQs/what-MEGMSI.html'>What is MEG/MSI?</a></li>"+
							"<li><a href='/our-programs/program-overview/clinical-neurosciences/about-FAQs/faqs.html'>Frequently Asked Questions</a></li>"+
						"</ul>"+
					"</li>"+
					"<li><a href='/our-programs/program-overview/clinical-neurosciences/institute.html'>Institute</a></li>"+
					"<li><a href='/our-programs/program-overview/clinical-neurosciences/symposium.html'>Symposium</a></li>"+
					"<li><a href='/our-programs/program-overview/clinical-neurosciences/MEG-conference/'>MEG Conference</a></li>"+
					"<li><a href='/our-programs/program-overview/clinical-neurosciences/contact-us.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";
			}
		}
	}
}