function IsEmpty(aTextField) 
{
	if ( (aTextField.value.length==0 ) || (aTextField.value==null) ) 
		return true;
	else
		return false;
}

function isEmail ( emailField ) {
 emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
 if( !emailpat.test( emailField.value ) ) {
  return false;
 }
 return true;
}

function check_radio_servicing_form()
{
	var msg="";
	if ( IsEmpty(document.radio_form.cell_letters) )				msg += "- please fill out the cell letters & frequency.\n";
	if ( IsEmpty(document.radio_form.program_director) ) 		msg += "- please fill out the program director's name.\n";
	if ( IsEmpty(document.radio_form.contact_name) ) 				msg += "- please fill out the contact name.\n";
	if ( IsEmpty(document.radio_form.job_title) ) 					msg += "- please fill out the job title.\n";
	if ( IsEmpty(document.radio_form.primary_email) ) 			msg += "- please fill out the primary email.\n";
	if ( IsEmpty(document.radio_form.downloadable_music) ) 	msg += "- can you receive downloadable music vai email?.\n";
	if ( IsEmpty(document.radio_form.main_phone) ) 					msg += "- please fill out the main phone.\n";
	if ( IsEmpty(document.radio_form.street) ) 			msg += "- please fill out the street address.\n";
	if ( IsEmpty(document.radio_form.city) ) 								msg += "- please fill out the city.\n";
	if ( IsEmpty(document.radio_form.state) ) 							msg += "- please fill out the state.\n";
	if ( IsEmpty(document.radio_form.zip) ) 								msg += "- please fill out the zip.\n";
	
	if ( msg.length > 1 ) {
		alert ( msg );
		return false;
	}
	return true;
}

function contactus()
{
	var msg="";
	if ( IsEmpty(document.contactus.form.phone) )				msg += "- please fill out the phone.\n";
	if ( IsEmpty(document.contactus.form.email) ) 		msg += "- please fill out the email.\n";
	if ( IsEmpty(document.contactus.form.topic) ) 				msg += "- please fill out the topic.\n";	

	if ( msg.length > 1 ) {
		alert ( msg );
		return false;
	}
	return true;
}

function check_booking_form()
{
	var msg="";
	if ( IsEmpty(document.booking_form.name) )						msg += "- please fill out the contact name.\n";
	if ( IsEmpty(document.booking_form.contact_email) ) 	msg += "- please fill out the contact email.\n";
	if ( IsEmpty(document.booking_form.contact_phone) ) 	msg += "- please fill out the phone number.\n";
	if ( IsEmpty(document.booking_form.event_date) ) 			msg += "- please fill out the event date.\n";
	if ( IsEmpty(document.booking_form.event_time) ) 			msg += "- please fill out the event time.\n";
	if ( IsEmpty(document.booking_form.event_location) ) 	msg += "- please fill out the event location.\n";
	if ( IsEmpty(document.booking_form.event_address) ) 	msg += "- please fill out the event address.\n";
	if ( IsEmpty(document.booking_form.city) ) 						msg += "- please fill out the city.\n";
	if ( IsEmpty(document.booking_form.state) )						msg += "- please fill out the state.\n";
	if ( IsEmpty(document.booking_form.zip) )							msg += "- please fill out the zip.\n";	
	if ( IsEmpty(document.booking_form.church_name) )			msg += "- please fill out the name of church.\n";
	if ( IsEmpty(document.booking_form.church_address) )	msg += "- please fill out the address of church.\n";
	if ( IsEmpty(document.booking_form.church_city) )			msg += "- please fill out the city of church.\n";
	if ( IsEmpty(document.booking_form.church_zip) )			msg += "- please fill out the zip of church.\n";
	if ( IsEmpty(document.booking_form.church_phone) )		msg += "- please fill out the phone of church.\n";
	if ( IsEmpty(document.booking_form.pastor) )					msg += "- please fill out the name of pastor.\n";
	
	if ( msg.length > 1 ) {
		alert ( msg );
		return false;
	}
	return true;
}
					
