// Some variables
var text = window.location+'';
// The number on the next line represents the 'http://'
var text = text.substring(7,text.lastIndexOf("/"));
var locate = text.split("/");
var baseMenu = '';
// Key is set to 2 because 0 = server name (such as www.depts.ttu.edu) and 1 = folder/org name
var key = 2;
if(locate[key]) baseMenu = "../";
if(locate[key+1]) baseMenu = "../../";
if(locate[key+2]) baseMenu = "../../../";
if(locate[key+3]) baseMenu = "../../../../";
if(locate[key+4]) baseMenu = "../../../../../";
var baseMenu = baseMenu + "images/template/menu_";
var nrm = new Array();
var omo = new Array();
var menuItems = new Array('academics','admin', 'alumni', 'athletics', 'campus',
							'current', 'distance','faculty','hsc','libraries',
							'news', 'offcampus', 'prospective','research','search',
							'sitemap', 'support','ttusystem', 'web','helpcentral',
							'student', 'jobs');

// Pre-load part.

if (document.images)
{
	for (i=0;i<menuItems.length;i++) {
		nrm[i] = new Image; nrm[i].src = baseMenu + menuItems[i] + ".gif"
		omo[i] = new Image; omo[i].src = baseMenu + menuItems[i] + "_on.gif";
	}
}

function over(name) {
	for(var x = 0; x < menuItems.length; x++) { if(name == menuItems[x]) { no = x; picnum = x; } }
	if (document.images) document.images[menuItems[no]].src = omo[no].src
}

function out(name) {
	for(var x = 0; x < menuItems.length; x++) { if(name == menuItems[x]) { no = x; picnum = x; } }
	if (document.images) document.images[menuItems[no]].src = nrm[no].src
}
