function validateForm(form) {

// Make sure that the name is filled in
     var name = form.name
       if (name.value.length == 0) {
         alert("Dale needs your name to contact you");
         name.focus();
         name.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.zipcode
     var homephone = form.homephone
     var workphone = form.workphone
     var city = form.city
     var email = form.emailfrom
     
     if (address.value.length == 0 || city.value.length == 0 || state.value.length == 0 || zipcode.value.length ==0) {
       if (email.value.length == 0 && homephone.value.length == 0 && workphone.value.length == 0) {
         alert("Dale needs either your email address, home phone, or work phone to contact you with a response");
         email.focus();
         email.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)