function isBlank(inField, inLabel) {
  var retVal = false;

  if (inField.value.length == 0) {
    alert("The field '" + inLabel + "' can not be empty.  Please try again.");
    inField.focus();
    retVal = false;
  } else {
    if (inField.value == null) {
      alert("The field '" + inLabel + "' can not be null.  Please try again.");
      inField.focus();
      retVal = false;
    } else {
      retVal = true;
    }
  }

  return retVal
}

function isEmail(inField, inLabel) {
  // Note: The next expression must be all on one line...
  //       allow no spaces, linefeeds, or carriage returns!
  var goodEmail = inField.value.match(/\b(^(\S+@).+((\.ca)|(\.com)|(\.edu)|(\.gov)|(\.int)|(\.mil)|(\.net)|(\.org)|(\.info)|(\.biz)|(\.name)|(\.pro)|(\.museum)|(\.coop)|(\.aero)|(\..{2,2}))$)\b/gi);

  if (goodEmail) {
    return true;
  } else {
    alert("The field '" + inLabel + "' is not valid.  Please try again.");
    inField.focus();
    return false;
  }
}

function isPhone(inField, inLabel) {
  // Note: The next expression must be all on one line...
  //       allow no spaces, linefeeds, or carriage returns!
  var goodEmail = inField.value.match(/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/);

  if (goodEmail) {
    return true;
  } else {
    alert("The phone number for the field '" + inLabel + "' is the wrong length.  It must be in the format '# (###) ###-####', '(###) ###-####' or '###-####'.");
    inField.focus();
    return false;
  }
}

function isValidExt(inField, inLabel) {
  var fIndx = inField.indexOf(".");
  var fExt  = inField.toLowerCase();
  fExt = fExt.substring(fIndx + 1);
  if (fExt == "doc" || fExt == "txt") {
    return true;
  } else {
    alert("The '" + inLabel + "' field must be a MS Word or Text file (*.DOC or *.TXT).");
    inField.focus();
    return false;
  }
}
