function validateForm(form) {

// Make sure that the first name is filled in
     var firstname = form.firstname
       if (firstname.value.length == 0) {
         alert("Please enter your first name");
         firstname.focus();
         firstname.select();
         return false;
     }

// Make sure that the last name is filled in
     var lastname = form.lastname
       if (lastname.value.length == 0) {
         alert("Please enter your last name");
         lastname.focus();
         lastname.select();
         return false;
     }

// Make sure you can contact the visitor with a response 
     var address = form.address
     var city = form.city
     var state = form.state
     var zipcode = form.zip
     var phone = form.work_phone
     var mobile = form.mobile
     var city = form.city
     var email = form.emailfrom
     
     if (address.value.length == 0 || city.value.length == 0 || state.value.length == 0 || zip.value.length ==0) {
       if (email.value.length == 0 && phone.value.length == 0 && mobile.value.length == 0) {
         alert("Enter your email address and/or a phone number for a response.");
         phone.focus();
         phone.select();
         return false;
       }
     }

  return true;
}

// Validates that the phone number is in the correct format
function validatePhone(textfield) {
    phoneOK = true;
    var digits = 0;
    
    for (var i=0; i < textfield.value.length; i++) {
    	var theChar = textfield.value.charAt(i);
    	if ((theChar >= "0") && (theChar <= "9")) {
    	   digits++;
    	   continue;
    	}
    	if (theChar == " ") continue;
    	if (theChar == "-") continue;
    	if (theChar == "(") continue;
    	if (theChar == ")") continue;
    	if (theChar == ".") continue;
    	phoneOK = false;
    }
    
    phoneOK = phoneOK && (digits == 10);
    if (!phoneOK) {
    	alert("Please enter a phone number in the format (555) 555-5555");
    	textfield.focus();
    	textfield.select();
    }
    
    return phoneOK;    
}

//--  End of function validateForm(form)