<!-- Hide from old browsers
// This script is Copyright 2001-2002 SBA Design (http://www.sbadesign.com).
// Use and distribution of this program without SBA Design's prior
// written permission is strictly forbidden.

// This script will check that required form fields are filled out properly

// Make sure the email they gave is formatted correctly
function checkEmail(checkString,fieldDesc){
    var newstr = "";
    var at = false;
    var dot = false;
    var checkretval = true;

    // DO SOME PRELIMINARY CHECKS ON THE DATA

    // IF EMAIL ADDRESS HAS A '@' CHARACTER
    if (checkString.indexOf("@") != -1) {
      at = true;

    // IF EMAIL ADDRESS HAS A '.' CHARACTER
    } else if (checkString.indexOf(".") != -1) {
      dot = true;
    }
    // PARSE REMAINDER OF STRING
    for (var i = 0; i < checkString.length; i++) {
        ch = checkString.substring(i, i + 1)
        if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
                || (ch == "@") || (ch == ".") || (ch == "_")
                || (ch == "-") || (ch >= "0" && ch <= "9")) {
                newstr += ch;
                if (ch == "@") {
                    at=true;
                }
                if (ch == ".") {
                    dot=true;
                }
        }
    }
    if ((at == true) && (dot == true)) {
        checkretval = true;
    }
    else {
       // DISPLAY ERROR MESSAGE
       alert ("Sorry, " + fieldDesc + " is not\nin the correct format.");
       checkretval = false;
    }
    return checkretval;
}

// Check for empty required fields
function checkforblanks(){
   for (var i = 0; i < arguments.length; i += 2){
      if (!arguments[i].value){
         alert("Please enter " + arguments[i+1] + ".");
         arguments[i].focus();
         return false;
      }
      if (arguments[i] == document.contact_form.email){
         if((checkEmail(arguments[i].value,arguments[i+1])) == false){
            arguments[i].focus();
            return false;
         }
      }
   }
   return true;
}




function validate(){
   // Make sure none of the required fields are empty
   if (!checkforblanks(document.contact_form.name, "your name",
       document.contact_form.email, "your email",
       document.contact_form.comments, "your comments")){
          return false;
   }
   return true;
}


// End hiding from old browsers -->