function checkEmail (strng) {
var error="";

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

// first_name - 1-15 chars, uc, lc, and underscore only.

function checkFirst_name (strng) {
var error = "";

if (strng == "") {
   error = "You didn't enter your First Name.\n";
}
    var illegalChars = /\W/; // allow letters, numbers, and underscores
    if ((strng.length < 1) || (strng.length > 15)) {
       error = "Please enter your First Name!\n";
    }
    else if (illegalChars.test(strng)) {
    error = "There is a problem with your First Name: please remove spaces & non-alphabetical characters\n";
    } 
return error;
}

// last_name - 1-15 chars, uc, lc, and underscore only.

function checkLast_name (strng) {
var error = "";

if (strng == "") {
   error = "You didn't enter your Last Name.\n";
}
    var illegalChars = /\W/; // allow letters, numbers, and underscores
    if ((strng.length < 1) || (strng.length > 15)) {
       error = "Please enter your Last Name!\n";
    }
    else if (illegalChars.test(strng)) {
    error = "There is a problem with your Last Name: please remove spaces & non-alphabetical characters.\n";
    } 
return error;
}


// non-empty textbox

function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "The comments box is empty: please tell us how we can help you.\n"
  }
return error;	  
}



