// JavaScript Document

function checkUsername (name) {
  var error = "";
  if (name == "") {
    error = "Please enter a name - it is a required input.\n";
  }
  return error;
}

function checkEmailAddress(email) {
  var error = "";
  if (email == "") {
    error = "Pleas enter an E-mail address - it is a required input.\n";
  }
  return error;
}

function checkCommentInput(comment) {
  var error = "";
  if (comment == "") {
    error = "Pleas enter your comment - it is a required input.\n";
  }
  return error;
}

function checkWholeForm(theForm) {

    var why = "";

    why += checkUsername(theForm.name.value);
    why += checkEmailAddress(theForm.email.value);
    why += checkCommentInput(theForm.comment.value);
    
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}