var error = 0;
function cr(x) {
	if(document.forms.speech_request[x].value == "") {
		document.getElementById(x).style.backgroundColor = "#ffbbbb";
		if(error==0) {
			document.forms.speech_request[x].focus();
			error = 1;
		}
	} else {
		document.getElementById(x).style.backgroundColor = "#ffffff";
	}
}
function cra(x) {
	for(var i=0;i<document.forms.speech_request[x].length;i++) {
		if(document.forms.speech_request[x][i].checked == true) {
			i=30;
		}
	}
	if(i<30) {
		document.getElementById(x).style.backgroundColor = "#ffbbbb";
		if(error==0) {
			document.forms.speech_request[x][0].focus();
			error = 1;
		}
	} else {
		document.getElementById(x).style.backgroundColor = "#ffffff";
	}
}
/*
If you wish to add required fields to be checked, make sure you first give the
<tr> tag which the required input tag is in an id with the same name as
the required field. For instance, the field event_name is in a table row
tr tag which looks like this: <tr id="event_name">
*/
function checkForm() {
	error = 0;
	cr("event_name");
	cr("sponsor");
	cr("contact_name");
	cr("contact_phone");
	cr("day_date_event");
	cr("time_event");
	cr("place_event");
	cr("purpose");
	cra("remarks");
	cra("speakers");
	cra("press");
	if(error==1) {
		alert("Please fill in all required fields highlighted in red.");
		return false;
	}
	return true;
}