function hiliteField(formField, toggle) {
	with (document.entryform) {
		if (toggle) {
			formField.style.backgroundColor='#FF9';
			formField.style.borderColor='#C00';
			formField.focus();
		} else {
			formField.style.backgroundColor='#FFF';
			formField.style.borderColor='#CCC';
		}
	}
}

function validate_form() {
	var CHARSET2 = /[^a-zA-Z\s\.',-]/;
	var CHARSET3 = /[0-9]/;
	var CHARSET4 = /[^a-zA-Z0-9\s\.',-]/;

	with (document.entryform) {
		if (!checkMail(email, "Email", true)) {
			hiliteField(email, 1);
			return false;
		} else hiliteField(email, 0);
		if (!educationLevel.value) {
			alert("Please select your Current Education Level");
			hiliteField(educationLevel, 1);
			return false;
		} else hiliteField(educationLevel, 0);
		if (!preferredStartMonth.value) {
			alert("Please select your Preferred Start Month");
			hiliteField(preferredStartMonth, 1)
			return false;
		} else hiliteField(preferredStartMonth, 0);
		if (!preferredStartYear.value) {
			alert("Please select your Preferred Start Year");
			hiliteField(preferredStartYear, 1)
			return false;
		} else hiliteField(preferredStartYear, 0);	
		if (!educationGoal.value) {
			alert("Please select your Education Goal");
			hiliteField(educationGoal, 1)
			return false;
		} else hiliteField(educationGoal, 0);
		if (!serviceAffiliation.value) {
			alert("Please select your Service Affiliation");
			hiliteField(serviceAffiliation, 1);
			return false;
		} else hiliteField(serviceAffiliation, 0);
		if (!status.value) {
			alert("Please select your Military Status");
			hiliteField(status, 1);
			return false;
		} else hiliteField(status, 0);
		if (!invalidCharMinLength(zipOfResidence, CHARSET4, 5, "Zip Code", "", false)) {
			hiliteField(zipOfResidence, 1);
			return false;
		} else hiliteField(zipOfResidence, 0);
		if (agreement.checked == false) {
			alert("We're sorry: in order to submit the form, you must review and agree to the Military.com Service Agreement");
			hiliteField(agreement, 1);
			return false;
		} else hiliteField(agreement, 0);
		return true;
	}		
}

function newWin(path) {
	window.open(path, 'new', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500');
}