function stleoCheckForm(form) {
	if (form.program.value.indexOf("M") == 0||form.program.value.indexOf("G") == 0) {
		if (form.educationLevel) {
			if(form.educationLevel.value != "Bachelors"&&form.educationLevel.value != "Masters"&&form.educationLevel.value != "Doctoral") {
				alert("Your Student Information Form indicates that you do not meet the admissions requirements.");
				return (false);
			}
		}
	}
	if (form.gradYear && form.gradYear.value == "") {
		alert("Please specify your graduation year.");
		return (false);
	}
	if (form.gradYear && form.gradYear.value > '2007') {
        alert("Your Student Information Form indicates that you do not meet the admissions requirements.");
        return (false);
    }
	if (form.custom1 && form.custom1.value == "") {
		alert("Please specify Best Time to Call.");
		return (false);
	}
	if (form.custom2 && form.custom2.value == "") {
		alert("Please specify when you plan to begin.");
		return (false);
	}
	if (form.program.value.indexOf("M") == 0||form.program.value.indexOf("G") == 0) {
		var gpaSyntax = /^\d\.\d{1,2}$/;
		if (form.custom3 && form.custom3.value != "" && !gpaSyntax.test(form.custom3.value))
		{
			alert("Please enter GPA in x.x or x.xx format.")
			return (false);
		}
		var gmatSyntax = /^\d\d\d$/;
		if (form.custom4 && form.custom4.value != "" && !gmatSyntax.test(form.custom4.value))
		{
			alert("Please enter GMAT score in 3-digit format.")
			return (false);
		}
	}	
	if (form.custom5 && !form.custom5[0].checked && !form.custom5[1].checked) {
		alert("Please specify whether you have work experience.");
		return (false);
	}
	if (form.custom6 && !form.custom6[0].checked && !form.custom6[1].checked) {
		alert("Please specify whether you are a U.S. citizen.");
		return (false);
	}
	if (form.ageRange && form.ageRange.value=='') {
		alert("Please specify age.");
		return (false);
	}
	if (form.ageRange && (form.ageRange.value == "16"||form.ageRange.value == "17" ||form.ageRange.value == "19")) {
		alert("You must be 21 years of age or above to qualify for this offer.");
		return (false);
	}
	if (form.program.value.indexOf("Masters of Education") == 0) {		
		if (form.custom3 && form.custom3.value == "")
		{
			alert("Please enter GPA in x.x or x.xx format.")
			return (false);
		}
		if (form.custom3 && form.custom3.value < "3")
		{
			alert("Your GPA must be 3.0 or higher to qualify for this offer.")
			return (false);
		}
		if (form.certificate && !form.certificate[0].checked && !form.certificate[1].checked) {
			alert("Please specify whether you posess a Professional Teaching Certificate.");
			return (false);
		}
		if (form.certificate && !form.certificate[0].checked) {
			alert("You must posess a Professional Teaching Certificate to qualify for this offer.");
			return (false);
		}
    }
	if (form.program.value.indexOf("Master of Social Work") == 0) {
		if(form.state && form.state.value != 'FL' && form.state.value != 'GA' && form.state.value != 'VA') {
			alert("Sorry, this program is not offered in your state, please select another program.");
			return (false);
		}
		if (form.custom2 && (form.custom2.value == "Winter"||form.custom2.value == "Summer")) {
			alert("Sorry, this program only starts in Fall and Spring.");
			return (false);
		}
	}
	if (form.contactRequest && !form.contactRequest.checked) {
        alert("To request more information, you must understand that you will be contacted by Saint Leo University, and that you have read and understand the Terms and Conditions and Privacy Policy.");
        return (false);
    }
    return true;
}

function stleoProgramChange(form)
{
	if (form.program.value.indexOf("M") != 0 && form.program.value.indexOf("G") != 0) {
		document.getElementById("masterDiv1").style.display = "none";
		document.getElementById("masterDiv2").style.display = "none";
	}
	else {
		document.getElementById("masterDiv1").style.display = "block";
		document.getElementById("masterDiv2").style.display = "block";
	}
	if (form.program.value.indexOf("Masters of Education") == 0) {
		document.getElementById("medDiv").style.display = "block";
    }
    else {
		document.getElementById("medDiv").style.display = "none";
    }
}