function validateFormOnSubmit(theForm) {
	var reason = "";
	
	if ( theForm.child_name.value.length == 0 ){
		reason += "The child's name must be filled in.\n";
		theForm.child_name.style.background = 'Yellow';
	}
	
	if ( theForm.parent_name.value.length == 0 ){
		reason += "The parent's name must be filled in.\n";
		theForm.parent_name.style.background = 'Yellow';
	}
	  
	if ( theForm.address.value.length == 0 ){
		reason += "The address name must be filled in.\n";
		theForm.address.style.background = 'Yellow';
	}

	if ( theForm.city.value.length == 0 ){
		reason += "The city must be filled in.\n";
		theForm.city.style.background = 'Yellow';
	}

	if ( theForm.state.value == '' ){
		reason += "The state must be selected.\n";
		theForm.state.style.background = 'Yellow';
	}

	if ( theForm.zip_code.value.length == 0 ){
		reason += "The zip code must be filled in.\n";
		theForm.zip_code.style.background = 'Yellow';
	}

	if ( theForm.child_age.value.length == 0 ){
		reason += "The child's age must be filled in.\n";
		theForm.child_age.style.background = 'Yellow';
	}

	if ( theForm.day_phone.value.length == 0 ){
		reason += "The day_phone must be filled in.\n";
		theForm.day_phone.style.background = 'Yellow';
	}

	if ( theForm.evening_phone.value.length == 0 ){
		reason += "The evening phone must be filled in.\n";
		theForm.evening_phone.style.background = 'Yellow';
	}

	if ( theForm.email_address.value.length == 0 ){
		reason += "The email address must be filled in.\n";
		theForm.email_address.style.background = 'Yellow';
	}

	if ( theForm.email_address_2.value.length == 0 ){
		reason += "The second confirmation email address must be filled in.\n";
		theForm.email_address_2.style.background = 'Yellow';
	}

	if ( theForm.email_address.value != theForm.email_address_2.value ){
		reason += "The email addresses must match.\n";
		theForm.email_address.style.background = 'Yellow';
		theForm.email_address_2.style.background = 'Yellow';
	}

	if ( theForm.something_to_know.value.length == 0 ){
		reason += "The text area should be filled in.\n";
		theForm.something_to_know.style.background = 'Yellow';
	}

	if ( theForm.conservation.value.length == 0 ){
		reason += "The text area should be filled in.\n";
		theForm.conservation.style.background = 'Yellow';
	}

	if ( theForm.costume_info.value.length == 0 ){
		reason += "The text area should be filled in.\n";
		theForm.costume_info.style.background = 'Yellow';
	}

	if ( theForm.how_did_you_hear.value.length == 0 ){
		reason += "The text area should be filled in.\n";
		theForm.how_did_you_hear.style.background = 'Yellow';
	}

	if ( theForm.userfile.value.length == 0 ){
		reason += "The child's image must be selected for upload.\n";
		theForm.userfile.style.background = 'Yellow';
	}

if ( !theForm.permission.checked ){
		reason += "Permission must be granted to publish the entry.\n";
		theForm.permission.style.background = 'Yellow';
	}

	if ( reason != "" ) {
		alert("Some fields need correction:\n" + reason);
		return false;
	}
	
	return true;
}