  function ClearForm() {
   // var RequestForm = document.RequestForInfo;
    var CompanyField = document.getElementById("companyname");
    var ContactField = document.getElementById("contactname");
    var AddressField = document.getElementById("address");
    var CityField = document.getElementById("city");
    var StateField = document.getElementById("state");
    var ZipField = document.getElementById("zipcode");
    var CommentsField = document.getElementById("comments");
    var EmailField = document.getElementById("email");

    ContactField.value = "";
    CompanyField.value = "";
    AddressField.value = "";
    CityField.value = "";
    StateField.value = "";
    ZipField.value = "";
    CommentsField.value = "";
    EmailField.value = "";
  }

  function MailToHCDC() {
    var RequestForm = document.RequestForInfo;
    var mailForm = document.MailForm;
    var CompanyField = document.getElementById("companyname");
    var theCompanyName = CompanyField.value;
    var ContactField = document.getElementById("contactname");
    var theContactName = ContactField.value;
    var AddressField = document.getElementById("address");
    var theAddress = AddressField.value;
    var CityField = document.getElementById("city");
    var StateField = document.getElementById("state");
    var ZipField = document.getElementById("zipcode");
    var theCity = CityField.value+" "+StateField.value+" "+ZipField.value;
    var CommentsField  = document.getElementById("comments");
    var theComment = CommentsField.value;
    var EmailField  = document.getElementById("email");
    var theEmail = EmailField.value;
    var MailBodyField  = document.getElementById("mailBody");
    var isValid = false;

    if ((theCompanyName != "") && (theContactName != "") && (theComment != "") && (theEmail != "")) {
      // redefine the mailForm action property
      var theAction = "mailto:hcdc@iowatelecom.net";
      //var theAction = "mailto:butrick@gmail.com";
      theAction += "?subject=Request for information from " + theContactName  + " at " + theCompanyName ; 
      mailForm.action = theAction;

      // transfer all information from dataForm to mailForm for sending
      MailBodyField.value = "\r\n\n" + theAddress + "\r\n";
      MailBodyField.value += theCity + "\r\n\nE-mail: ";
      MailBodyField.value += theEmail + "\r\n\nComment: \r\n";
      MailBodyField.value += theComment;
      isValid = true;
      ThankYou(theContactName);
    } else {
      isValid = false;
      alert("Please make sure to fill in all the required (*) fields.");
    }

    // return true to send mail (returning false should prevent submission)
    return isValid;
  }

function ThankYou(theContact) {
    alert("Thank you " + theContact + " for submitting your request for information.  You will be hearing from us in the near future.");

}
