
function showOverNav(butName)
{
	var navButton = document.images[navOverArray[butName][1]];
	navButton.src = navOverArray[butName][0].src;
}

function hideOverNav(butName)
{
	var navButton = document.images[navOffArray[butName][1]];
	navButton.src = navOffArray[butName][0].src;
}

var navOverArray = new Array(2);
for (var i=0;i<3;i++) {
	navOverArray[i] = new Array(2);
}

var navOffArray = new Array(2);
for (var i=0;i<3;i++) {
	navOffArray[i] = new Array(2);
}

var LATEST = 0;
var RECRUITERS = 1;
var ABOUT = 2;
var JOBS = 3;
var FAQS = 4;
var CONTACT = 5;
var APPLY = 6;

// preload work
navOverArray[LATEST][0] = new Image();
navOverArray[LATEST][0].src = "images/latest_on.gif";
navOverArray[LATEST][1] = "latest";

navOffArray[LATEST][0] = new Image();
navOffArray[LATEST][0].src= "images/latest.gif";
navOffArray[LATEST][1] = "latest";

// preload work
navOverArray[RECRUITERS][0] = new Image();
navOverArray[RECRUITERS][0].src = "images/recruiters_on.gif";
navOverArray[RECRUITERS][1] = "recruiters";

navOffArray[RECRUITERS][0] = new Image();
navOffArray[RECRUITERS][0].src= "images/recruiters.gif";
navOffArray[RECRUITERS][1] = "recruiters";

function chkApply() { 	
	
	var msg = "";
	pObj = document.forms["applyForm"];
	if (pObj.inputForename.value == "") {
		msg = "\nYou must enter your forename." + msg;
		pObj.inputForename.focus();
	}
	if (pObj.inputSurname.value == "") {
		msg = "\nYou must enter your surname." + msg;
		pObj.inputSurname.focus();
	}
	if (pObj.inputEmail.value == "") {
		msg = "\nYou must enter your email address." + msg;
		pObj.inputEmail.focus();
	}
	if (pObj.inputTitle.value == "") {
		msg = "\nYou must enter your title." + msg;
		pObj.inputTitle.focus();
	}
	if (pObj.inputhouseno.value == "") {
		msg = "\nYou must enter your house number." + msg;
		pObj.inputhouseno.focus();
	}
	//if (pObj.inputPcode.value == "") {
	//	msg = "\nYou must enter your postcode." + msg;
	//	pObj.inputPcode.focus();
	//}
	if (pObj.inputAddress1.value == "") {
		msg = "\nYou must enter your address line 1." + msg;
		pObj.inputAddress1.focus();
	}
	if (pObj.inputCounty.value == "") {
		msg = "\nYou must enter your county." + msg;
		pObj.inputCounty.focus();
	}
	if (pObj.inputCountry.value == "") {
		msg = "\nYou must enter your country." + msg;
		pObj.inputCountry.focus();
	}
	if (pObj.inputHtel.value == "") {
		msg = "\nYou must enter your home telephone number." + msg;
		pObj.inputHtel.focus();
	}
	//if ((pObj.dob_day.value == "") || (pObj.dob_month.value == "") || (pObj.dob_year.value == "")) {
	//	msg = "\nYou must enter your date of birth." + msg;
	//	pObj.dob_day.focus();
	//}
	if (pObj.inputage.value == "") {
		msg = "\nYou must enter your age." + msg;
		pObj.inputage.focus();
	}
	if (pObj.inputPaymentType.value == "") {
		msg = "\nYou must enter your payment type." + msg;
		pObj.inputPaymentType.focus();
	}
	if (pObj.inputCardNo.value == "") {
		msg = "\nYou must enter your card number." + msg;
		pObj.inputCardNo.focus();
	}
	if ((pObj.expirymonth.value == "") || (pObj.expiryyear.value == ""))  {
		msg = "\nYou must enter your card expiry date." + msg;
		pObj.expirymonth.focus();
	}
	if ((pObj.expiryyear.value == jyear) && (pObj.expirymonth.value < jmonth)) {
		msg = "\nYour card expiry date is in the past." + msg;
		pObj.expirymonth.focus();
	}
	if (pObj.inputSecurity.value == "") {
		msg = "\nYou must enter your card security number." + msg;
		pObj.inputSecurity.focus();
	}
	if (pObj.inputSecurityname.value == "") {
		msg = "\nYou must enter the name on your card." + msg;
		pObj.inputSecurityname.focus();
	}
		
	if (pObj.inputCardNo.value != "") {
		if (!isInteger(pObj.inputCardNo.value)) {
			msg = "\nCard number must be numeric with no spaces" + msg;
			pObj.inputCardNo.focus();
		} 
	}
	if (pObj.expirymonth.value != "") {
		if (!isInteger(pObj.expirymonth.value)) {
			msg = "\nExpiry month must be numeric with no spaces" + msg;
			pObj.expirymonth.focus();
		}	
	}
	if (pObj.expiryyear.value != "") {
		if (!isInteger(pObj.expiryyear.value) ) {
			msg = "\nExpiry year must be numeric with no spaces" + msg;
			pObj.expiryyear.focus();
		}		
	}
	if (pObj.inputIssue.value != "") {
		if (!isInteger(pObj.inputIssue.value)) {
			msg = "\nIssue Number must be numeric with no spaces" + msg;
			pObj.inputIssue.focus();
		}		
	}
	if (pObj.inputSecurity.value != "") {
		if (!isInteger(pObj.inputSecurity.value)) {
			msg = "\nSecurity number must be numeric with no spaces" + msg;
			pObj.inputSecurity.focus();
		}		
	}
	if (pObj.inputDates.value == "") {
		msg = "\nYou must enter the date you wish to attend your course." + msg;
		pObj.inputDates.focus();
	}
	if (pObj.inputLocations.value == "") {
		msg = "\nYou must enter the location you wish to attend your course." + msg;
		pObj.inputLocations.focus();
	}
	if (pObj.inputcity.value == "") {
		msg = "\nYou must enter the city you wish to attend your course." + msg;
		pObj.inputcity.focus();
	}
	if (msg == "") {
		return true;
	} else {
		alert(msg);
		return false;
	}	
		
}