function form_validator(theForm) {
	if(theForm.YourName.value == "") {
		 alert("Please enter your name.");
		 theForm.YourName.focus();
		 return false;
	}
	if(theForm.YourEmail.value == "") {
		 alert("Please enter your email address.");
		 theForm.YourEmail.focus();
		 return false;
	} else if ((theForm.YourEmail.value != "") && (!emailvalid(theForm.YourEmail.value))) {
		 alert("Please make sure your email address is entered correctly.");
		 theForm.YourEmail.focus();
		 return false;
	}
	if(theForm.ServiceDate.value == "") {
		 alert("Please enter the date of your service.");
		 theForm.ServiceDate.focus();
		 return false;
	}

	var sourceSelected = "no";
	for(i=0;i<theForm.Source.length;i++) {
		if(theForm.Source[i].checked) {
			sourceSelected = "yes";
		}
	}
	if(sourceSelected == "no") {
		alert("Please indicate how you heard about us.");
		theForm.Source[0].focus();
		return false;
	}
	
	var svcRecd = "";
	for(i=0;i<theForm.Services.length;i++) {
		if(theForm.Services[i].checked) {
			svcRecd += theForm.Services[i].value + ". ";
		}
	}
	if(svcRecd == "") {
		alert("Please indicate services you received.");
		theForm.Services[0].focus();
		return false;
	} else {
		theForm.ServicesReceived.value = svcRecd;
	}
return true;
}

function emailvalid(email) {
	emailreg=/[\w\.\-]{2,}\@[\w\-]{2,}\.[a-z]{2,4}/i;
	return(emailreg.exec(email));
}
