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 {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;
}


function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "You haven't provided a message!\n"
  }
return error;
}

function checkWholeForm() {
    var why = "";
    why += checkEmail(contact_details.email_address.value);
    why += isEmpty(contact_details.message.value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

