<!--

function checkForm() {
var invaliddata = "";
var phoneRE = /^[0-9]\d{2}-\d{3}-\d{4}$/;

// check for event
if (document.form1.event.value == "") {
	invaliddata += "\n - Event selection has not been made.";
}

// check for event
if (document.form1.slot.value == "") {
	invaliddata += "\n - Timeslot selection has not been made.";
}

// check for name
if (document.form1.name.value == "") {
	invaliddata += "\n - Name has not been entered.";
}

// check for phone
if (document.form1.mobile.value == "") {
	invaliddata += "\n - Mobile number is missing.";
} else {
	if (!phoneRE.test(document.form1.mobile.value)) {
		invaliddata += "\n - Mobile number is invalid.  Should be in the format XXX-XXX-XXXX";
	}
}

// check for email
if (document.form1.email.value == "") {
	invaliddata += "\n - Email address is missing.";
}

// check for school
if (document.form1.school.value == "") {
	invaliddata += "\n - School name has not been entered.";
}

if (document.form1.set.checked == 0) {
	invaliddata += "\n - You must agree to the terms and conditions to enter.";
}

// show errors
if (invaliddata != "") {
	invaliddata ="Errors have been detected in your submission:\n" + invaliddata;
	alert(invaliddata);
	return false;
}

}
//->