function validate_form (theform) {

var validform = true;

if ( (theform.first_name.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your first name.");
	theform.first_name.focus();
}

if ( (theform.last_name.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your last name.");
	theform.last_name.focus();
}

if ( (theform.address.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your address.");
	theform.address.focus();
}

if ( (theform.home_phone.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your home phone number.");
	theform.home_phone.focus();
}




if ( (theform.call_pref[0].checked == false) && (theform.call_pref[1].checked == false) && (theform.call_pref[2].checked == false) && validform  ) {
	validform = false;
	window.alert("Please specify your preference to receive calls at.");
	
		
}

if ( (theform.best_time.value.length == 0) && validform ) {
	validform = false;
	window.alert("What is the best time to contact you?");
	theform.best_time.focus();
}

if ( (theform.age[0].checked == false) && (theform.age[1].checked == false) && validform ) {
	validform = false;
	window.alert("Are you 18 years of age or older?");
	
		
}

if ( (theform.emerg_name.value.length == 0) && validform ) {
	validform = false;
	window.alert("Who would you like us to contact in an emergency?");
	theform.emerg_name.focus();
}

if ( (theform.emerg_relationship.value.length == 0) && validform ) {
	validform = false;
	window.alert("What is your relationship with your emergency contact?");
	theform.emerg_relationship.focus();
}

if ( (theform.emerg_HomePhone.value.length == 0) && validform ) {
	validform = false;
	window.alert("What is your emergency contact\'s home number?");
	theform.emerg_HomePhone.focus();
}

if ( (theform.reference1_name.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter at least 2 references.");
	theform.reference1_name.focus();
}

if ( (theform.reference1_phone.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your reference\'s contact number?");
	theform.reference1_phone.focus();
}

if ( (theform.reference2_name.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter at least 2 references.");
	theform.reference2_name.focus();
}

if ( (theform.reference2_phone.value.length == 0) && validform ) {
	validform = false;
	window.alert("Please enter your second reference\'s contact number?");
	theform.reference2_phone.focus();
}

if ( (theform.iagree.checked == false) && validform ) {
	validform = false;
	window.alert("Please make sure you agree to all the terms of the form.");
	
		
}


return(validform);


} // end function validate_form //

