var partLogo = new Array();
partLogo[0] = "boeing_sm.gif";
partLogo[1] = "ni_sm.gif";
partLogo[2] = "thsp_sm.gif";
logoRotate = function() {
		var lotto = (Math.round(Math.random()*2));
		var canvas = document.getElementById('partnerlogos').getElementsByTagName('IMG');
		canvas[0].src = "images/" + partLogo[lotto];
}

whereAreWe = function() {
	var where = window.location.pathname;
	var endPath = where.lastIndexOf("/");
	var whereDir = where.substring(1, endPath);
	whereDirs = whereDir.split("/", 2);
	return whereDirs;
}

navLoc = function() {
	setInterval('logoRotate()', 10000);
	var whereDirs = whereAreWe();
	if(whereDirs[1]) {
		var secondDir = " - " + whereDirs[1];
	} else {
		var secondDir = "";
	}
	document.title += secondDir;
	var mainNav = document.getElementById("navmain").getElementsByTagName("LI");
	for (var i=0; i < mainNav.length; i++) {
		var showOn = document.getElementById(mainNav[i].id);
		if (whereDirs[1] == mainNav[i].id) {
			showOn.className = "navon";
		}
	}
}

window.onload = function() {
		navLoc();
}