<!--

function checkform(){

  var companyname = document.getElementById("companyname");
  var ownername = document.getElementById("ownername");
  var contactname = document.getElementById("contactname");
  var uid = document.getElementById("uid");
  var contactphone = document.getElementById("contactphone");
  var contactmobile = document.getElementById("contactmobile");
  var contactemail = document.getElementById("contactemail");
  var faxnumber = document.getElementById("faxnumber");
  var companyaddress = document.getElementById("companyaddress");
  var business = document.getElementById("business");
  var errorCounter = 0;
  if (contactname.value == null || contactname.value.length == 0 ) {
    errorCounter++;
    document.getElementById("contactnameERROR").innerHTML = "請填入姓名";
  }else { document.getElementById("contactnameERROR").innerHTML = " "; }
  if (contactphone.value == null || contactphone.value.length == 0 ) {
    errorCounter++;
    document.getElementById("contactphoneERROR").innerHTML = "請填入電話";
  }else { document.getElementById("contactphoneERROR").innerHTML = " "; }
  if (!(contactemail.value == null || contactemail.value.length == 0 )) {
    if (!doEmailFormatCheck(contactemail.value)) {
      errorCounter++;
      document.getElementById("contactemailERROR").innerHTML = "電子郵件格式有誤";
    }
    else { document.getElementById("contactemailERROR").innerHTML = " "; }
  }else { document.getElementById("contactemailERROR").innerHTML = " "; }

  if(errorCounter==0) {
    document.getElementById("submitbtn").disabled = true;
    document.getElementById("resetbtn").disabled = true;

    document.getElementById("distributorform").action = "http://"+submitHOST+"/ezPayforms/distributor.jsp";
    document.getElementById("distributorform").method = "POST";
    document.getElementById("distributorform").submit();
  }
}

function resetform(){

  document.getElementById("contactnameERROR").innerHTML = " ";
  document.getElementById("contactphoneERROR").innerHTML = " ";
  document.getElementById("contactemailERROR").innerHTML = " ";
  document.getElementById("distributorform").reset();
}

-->
