navIndex = new Array('home','leadership','services','contract_vehicles','clients','careers','contact_us')

function preLoadImages() {
	imgArray = navIndex
	for (x=0;x<imgArray.length;x++) {
	if (eval("document." + "tm_" + imgArray[x])) {
		thisImage = eval("document." + "tm_" + imgArray[x])
		thisImage.name = imgArray[x]
		thisImage.defaultState = "images/" + "tm_" + imgArray[x] + ".gif"
		thisImage.overState = "images/" + "tm_" + imgArray[x] + "_sel.gif"
		thisImage.selectedState = "images/" + "tm_" + imgArray[x] + "_sel.gif"
		thisImage.onmouseover = function () { this.src=this.overState }
		thisImage.onmouseout = function () { 
			if (currentSection == this.name ) { this.src=this.selectedState }
			else { this.src=this.defaultState }
		}
		if (imgArray[x] == currentSection) { thisImage.src=thisImage.selectedState; }
	}
	}
}


function showtime() {
	now = new Date()
	var date = now.getDate()
	var month = now.getMonth()
	monthArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var year = now.getFullYear()
	year = "" + year
	year = year
	var day = now.getDay()
	timeValue = monthArray[month] + " " + date + ", " + year;
	//timeValue = month + "/" + date + "/" + year + " "
	document.getElementById('clock').innerHTML = timeValue //+ " EST";
}



function initSubnav(group) {
	dummyGroup = group
	if (subnavDummys[currentSection]) {
		for (x=0;x<subnavDummys[currentSection].length;x++) {
			if (group != subnavDummys[currentSection][x] || group == "") {
				document.getElementById(subnavDummys[currentSection][x]).style.display = "none"
			} else {
				document.getElementById(group + "Parent").style.backgroundColor = "#939393"
			}
		}
	}
}


function openPopup(fileW,dimensionsIndex) {
	dimensionsArray = new Array([300,340])
	attributesW = "width=" + dimensionsArray[dimensionsIndex][0] + ", height = " + dimensionsArray[dimensionsIndex][1] + ", menubar=no, status=no, resize=no, directories=no"
	newWindow = window.open(fileW,"popUp",attributesW)
	newWindow.focus()
}


function clearBox(box,field) {
	if(box.checked) { 
		eval("document.editForm."+field+".value = ''")
	}
}



var xmlObj;
var childNodeLength;
var currentCSIndex = 0;

function loadXML() {

	var http_request = false;
	dataFileName = "_newslist.xml";

	if (window.ActiveXObject) { //IE
		http_request = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) { //other
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else {
		alert("your browser does not support AJAX");
	}
	http_request.onreadystatechange = function() {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				xmlObj = http_request.responseXML.documentElement;
				childNodeLength = (window.ActiveXObject)? xmlObj.childNodes.length : parseInt(xmlObj.childNodes.length/2);
				buildNewsMenu()
			}
		}
	}
	http_request.open("GET", dataFileName, true);
	http_request.send(null);

}

function loadNewsList() {
	loadXML()
}

function buildNewsMenu () {
	menuText = ""
	for (z=0;z<childNodeLength;z++) {
		menuText += '<li><a href="' + xmlObj.getElementsByTagName('link')[z].firstChild.data + '">' + xmlObj.getElementsByTagName('headline')[z].firstChild.data + '</a></li>'
	}
	document.getElementById('newsBlock').innerHTML = menuText
}




