function submitform(form){
  document.getElementById(form).submit();
}

function validateFormOnSubmit(theForm) {
var reason = "";

  reason += validateEmpty(theForm.txtName);
  reason += validateEmpty(theForm.txtOrgName);
  reason += validateEmpty(theForm.txtTelephone);
      
  reason += validateEmpty(theForm.txtEmail);
  reason += validateEmpty(theForm.txtAddress);
  reason += validateEmpty(theForm.txtCity);
  reason += validateEmpty(theForm.drpStateProvince);
  reason += validateEmpty(theForm.txtZip);
  
  if (reason != "") {
  	reason2 = validateEmpty(theForm.txtAccess);
  	if (reason2 != "") { 
  		alert("Please fill in all fields:\n");
    	return false;
  	}
  	return true;
  }

  return true;
}

function validateEmpty(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = "The required field has not been filled in.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validatePricingForm(theForm) {
  if (theForm.quantity.value<1000 || theForm.quantity.value>5000001){
  	alert ("The quantity needs to be between 1,000 and 5 million");
  	return false;
  }
  if (theForm.percentage.value<0 || theForm.percentage.value>100){
  	alert ("The percentage needs to be between 0 and 100");
  	return false;
  }
  return true;
}