// JavaScript Document

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		WB_homepage_03_over = newImage("images/WB_homepage_03-over.jpg");
		WB_homepage_05_over = newImage("images/WB_homepage_05-over.jpg");
		WB_homepage_07_over = newImage("images/WB_homepage_07-over.jpg");
		WB_homepage_09_over = newImage("images/WB_homepage_09-over.jpg");
		WB_homepage_11_over = newImage("images/WB_homepage_11-over.jpg");
		preloadFlag = true;
	}
}

function checkFields() {
	var objectRef = document.application;
	//var submitForm = true;
	if (objectRef.position_applied_for.options[objectRef.position_applied_for.selectedIndex].value == "NONE") {
	 	alert("Please select the position you are applying for");
		objectRef.position_applied_for.focus();
		return false;
	}
	if (objectRef.first_name.value == "") {
	 	alert("Please provide your first name");
		objectRef.first_name.focus();
		return false;
	}
	if (objectRef.last_name.value == "") {
	 	alert("Please provide your last name");
		objectRef.last_name.focus();
		return false;
	}
	if (objectRef.email.value == "") {
	 	alert("Please provide your email name");
		objectRef.email.focus();
		return false;
	}
	/*if (objectRef.initials_current_7_year_mvr.value == "") {
	 	alert("Please enter your initals to indicate that you agree to bring current 7 year Motor Vehicle Driving History Report (MVR) to the interview.	");
		objectRef.initials_current_7_year_mvr.focus();
		return false;
	}
	if (objectRef.initials_DOT_regulations.value == "") {
	 	alert("Please enter your initals to indicate that you are fully aware of and follow Department of Transportation (DOT) regulations");
		objectRef.initials_DOT_regulations.focus();
		return false;
	}
	if (objectRef.initials_drug_tested.value == "") {
	 	alert("Please enter your initals to indicate that you understand that positions that require a CDL license falls under DOT drug testing guidelines and that you will be drug tested");
		objectRef.initials_drug_tested.focus();
		return false;
	}*/
	
	return true; 

}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
