//SET YOUR DEFAULT PAGE BELOW.
var defaultPage = "default.html"
var globalNav = "<ul>"+
	"<li><a href='#'>about us</a>"+
		"<ul>"+
			"<li><a href='/about/default.html'>Our History</a></li>"+
			"<li><a href='/about/technology.html'>Technology</a></li>"+
			"<li><a href='/about/markets.html'>Markets</a></li>"+
			"<li><a href='/about/manufacturing.html'>Manufacturing</a></li>"+
			"<li><a href='/about/quality.html'>Quality</a></li>"+
			"<li><a href='/about/news.html'>News</a></li>"+
		"</ul>"+
	"</li>"+
	"<li><a href='#'>our products</a>"+
		"<ul>"+
			"<li><a href='/products/default.html'>Advantages</a></li>"+
			"<li><a href='/products/applications.html'>Applications</a></li>"+
			"<li><a href='/products/specifications.html'>Specifications</a></li>"+
			"<li><a href='/products/connectors.html'>Connectors</a></li>"+
			"<li><a href='/products/faq.html'>FAQ</a></li>"+
			"<li><a href='/products/presentation.html'>Presentation</a></li>"+
		"</ul>"+
	"</li>"+
	"<li><a href='#'>case histories</a>"+
		"<ul>"+
			"<li><a href='/case_histories/default.html'>Field Notes</a></li>"+
			"<li><a href='/case_histories/tech_notes.html'>Tech Notes</a></li>"+
		"</ul>"+
	"</li>"+
	"<li><a href='#' class='large'>downhole products</a>"+
		"<ul>"+
			"<li><a href='/downhole/production.html'>Production</a></li>"+
		"</ul>"+
	"</li>"+
		"<li><a href='#'>contact us</a>"+
		"<ul>"+
			"<li><a href='/contact_us/contact-us.html'>Sales Offices</a></li>"+
			"<li><a href='/contact_us/deployment.html'>Deployment</a></li>"+
		"</ul>"+
		"</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";
			}
		}
	}
}



