var isEmpty = function (field) {
  if (typeof field === 'undefined' || field.value === '')
    return true;
  return false;
}

var validate = function () {
  if (isEmpty(this.name) || isEmpty(this.email) || isEmpty(this.subject) || isEmpty(this.message)) {
    alert("You forgot to fill some of the fields in the contact form. Fill 'em and try again.");
    return false;
  }
  return true;
};
