// JavaScript Document

function checkUsername (name) {
  var error = "";
  if (name == "") {
    error = "Please enter a name - it is a required input.\n";
  }
  return error;
}

function checkURL (url) {
  var error = "";
  if (url == "") {
    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 checkReciprocates(url) {
  var error = "";
  if (url == "") {
    error = "Pleas enter the  - it is a required input.\n";
  }
  return error;
}

function checkWholeForm(theForm) {

    var why = "";

    why += checkUsername(theForm.name.value);
    why += checkURL(theForm.url.value);
    why += checkReciprocates(theForm.reciprocates.value);
    why += checkEmailAddress(theForm.email.value);
    
    if (why != "") {
       alert("Some input is missing, please fill all fields and submit again");
       return false;
    }
return true;
}