function checkForm() {
    var why = "";
    why += checkEmail(document.formmail.email.value);
    why += checkCityState(document.formmail.citystate.value);
    why += checkName(document.formmail.name.value);
    why += checkQuestion(document.formmail.question.value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

// email - check for proper formatting

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
		
// email - check for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

// Name - may not be blank

function checkName (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your name.\n";
    } 
return error;
}   

// CityState - may not be blank

function checkCityState (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your city and state.\n";
    } 
return error;
}   

// Question - may not be blank

function checkQuestion (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your question.\n";
    } 
return error;
}   

