/*
  index.js
*/


//--- submitForm ---
function submitForm() {
  var frmContact;
  var strErrorMsg = "";
  var strContent;
  
  frmContact = document.getElementById('contact_form');
  
  strContent = Trim(frmContact.email.value);
  if(strContent.length == 0) {
    strErrorMsg += " - Email\n";
  }
  
  strContent = Trim(frmContact.subject.value);
  if(strContent.length == 0) {
    strErrorMsg += " - Subject\n";
  }
  
  strContent = Trim(frmContact.message.value);
  if(strContent.length == 0) {
    strErrorMsg += " - Message\n";
  }

  if (strErrorMsg.length > 0) {
    alert("The following fields are required:\n\n" + strErrorMsg);
  }
  else {
    frmContact.submit();
  }
}
 

//--- HasContent ---
function HasContent(objInput) {
  var strContent;
  strContent = Trim(objInput.value);
  if(strContent.length > 0) {
    return true;
  }
  else {
    return false;
  }
}

