function validate_form() {
	//check for non-emptiness of some fields
	var req = new Array("phone","city");
	var desc = new Array("phone number where we can call you to set-up an appointment","the city you live in");
	for (var i = 0; i < req.length; i++ ) {
		with (document.entryform) {
			if (eval(req[i] + ".value") == "") {
				alert("Please enter your " + desc[i]);
				eval(req[i] + ".focus()");
				eval(req[i] + ".select()");
				return false;
			}
			
		}
			
	}
	with (document.entryform) {
		if (!chk_email(email)) {
				email.focus();
				email.select();
				return false;
		}
		
		
	}		
	return true;
}

function chk_email(obj) {
 
 var bad_email_chars = "`/ (){}[]|<>/,&+=*'%?!~#^:;";
  
 // check for spl characters that are invalid
 if (!chk_badchar(obj.value, bad_email_chars)) {
  alert("Please remove all special characters from email address.")
  return false;
 }
 
 // Check for an @ sign
 var at_sign = obj.value.indexOf("@");
 if (at_sign < 0) {
  var msg = "Oops!  You forgot an '@' sign in your e-mail address.  Please enter an address such as ";
  msg = msg + obj.value + "@aol.com";
  alert(msg);
  return false;
 }
 	return true;
 }
 
 
function chk_badchar(word, badchars) {
 
 var found = -1; // bad char not found 
    
 for (var i = 0; i < badchars.length; i++) {
  found = word.indexOf(badchars.charAt(i));
  if (found > -1) {
   break;  // exit from for loop
  }
 }

 if (found > -1) 
  return false;
 else 
  return true;
}
