function validate(){
var error = "";

if (document.health_form.firstname.value == "") {var error = error + "You didn't enter a First Name.\n";}
if (document.health_form.lastname.value == "") {var error = error + "You didn't enter a Last Name.\n";}
if (document.health_form.contactline.value == "") {var error = error + "You didn't enter an Address.\n";}
if (document.health_form.contactcity.value == "") {var error = error + "You didn't enter a City.\n";}
var n = document.health_form.contactstate.selectedIndex;
if (document.health_form.contactstate[n].value == "Select State") {var error = error + "You didn't Select a State.\n";}

//CHECK ZIP CODE
reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
if (!reZip.test(document.health_form.contactzipcode.value)) {
  var error = error + "You didn't enter a Valid Zip Code.\n";     }
if (document.health_form.contactcounty.value == "") {var error = error + "You didn't enter a County.\n";}

//CHECK PHONE NUMBER
var stripped = document.health_form.telephone.value.replace(/[\(\)\.\-\ ]/g, '');     
   if (stripped == "") {
        error =  error + "You didn't enter a phone number.\n";
    } else if (isNaN(parseInt(stripped))) {
        error =  error + "The phone number contains illegal characters.\n";
    } else if (!(stripped.length == 10)) {
        error =  error + "The phone number is the wrong length. Make sure you included an area code.\n";
    } 
//CHECK EMAIL ADDRESS
	var tfld = document.health_form.email.value; 
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
    if (tfld == "") {
        error = error + "You didn't enter an email address.\n";
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
        error = error + "Please enter a valid email address.\n";
    } else if (tfld.match(illegalChars)) {
        error = error + "The email address contains illegal characters.\n";
    } else {
	        
    }
 if (document.health_form.home_status.value == "Select"){
error = error + "You didn't select a residence status\n";
}

var n = document.health_form.gender.selectedIndex;
var gender = document.health_form.gender[n].value;
if (gender == "Select"){error = error + "Please select a gender.\n";}

var n = document.health_form.marital_status.selectedIndex;
var marital_status = document.health_form.marital_status[n].value;
if (marital_status == "Select"){error = error + "Please select a marital status.\n";}

var n = document.health_form.bmonth.selectedIndex;
var month = document.health_form.bmonth[n].value;
var n = document.health_form.bday.selectedIndex;
var day = document.health_form.bday[n].value;
var n = document.health_form.byear.selectedIndex;
var year = document.health_form.byear[n].value;
if (month == "" || day == "" || year == ""){error = error + "Please select a correct birthdate.\n";}

var weight = document.health_form.weight.value;
if (weight == ""){error = error + "Please enter a weight.\n";}

   
if (error != ""){
error = "Please correct the following error(s).\n"+error;
alert(error);
error = "";
return false;
}
document.health_form.submit();	

}