// (location.href.toLowerCase().indexOf(urlSearchString.toLowerCase()) > -1) -- example of examining URL
document.write('<div id="menu"> </div>');

var http = getHTTPObject();
if (location.href.toLowerCase().indexOf('fuelsurcharge') > -1) {
	http.open("GET", "/includes/left-nav-selection.html?Section_Name=resources&Sub_Section_Name=fuel-surcharge", true);
}
else if (location.href.toLowerCase().indexOf('terminallist') > -1) {
	http.open("GET", "/includes/left-nav-selection.html?Section_Name=resources&Sub_Section_Name=terminal-list", true);
}
// Job Opportunities home page
else if (location.href.toLowerCase().indexOf('jobs/home') > -1) {
	http.open("GET", "/includes/left-nav.html?location="+location.href, true);
	//http.open("GET", "/includes/left-nav-selection.html?Section_Name=about-us&Sub_Section_Name=job-opportunities", true);
}
// Job Opportunities open positions
else if (location.href.toLowerCase().indexOf('jobs/positions') > -1) {
	http.open("GET", "/includes/left-nav.html?location="+location.href, true);
}
else {
	http.open("GET", "/includes/left-nav-selection.html", true);
}

http.onreadystatechange = function()
{
	if (http.readyState == 4) {
		// document.write(http.responseText);
		document.getElementById('menu').innerHTML = http.responseText
	}
}
http.send(null);

function getHTTPObject() {
	if (typeof XMLHttpRequest != 'undefined') {
		return new XMLHttpRequest();
	}
	try {
		return new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			return new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
	}
	} return false;
}
