function sendregform() {
  msg = '';
  if ($("#firstname").val() == '') { msg = msg + "\n- First name"; };
  if ($("#lastname").val() == '') { msg = msg + "\n- Last name"; };
  if ($("#street").val() == '') { msg = msg + "\n- Street"; };
  if ($("#suburb").val() == '') { msg = msg + "\n- Suburb"; };
  if ($("#city").val() == '') { msg = msg + "\n- City"; };
  if ($("#postcode").val() == '') { msg = msg + "\n- Postcode"; };
  if ($("#country").val() == '') { msg = msg + "\n- Country"; };
  if ($("#dob").val() == '') { msg = msg + "\n- Date of birth"; };
  if ($("#home_phone").val() == '') { msg = msg + "\n- Home phone number"; };
  if ($("#mobile").val() == '') { msg = msg + "\n- Mobile number"; };
  if ($("#email").val() == '') { msg = msg + "\n- Email address"; };
  if ($("#school_or_org").val() == '') { msg = msg + "\n- School or organisation"; };
  if ($("#coordinator").val() == '') { msg = msg + "\n- Coordinator"; };
  var n = $("input:checked").length; 
  if (n == 0) { msg = msg + "\n- Terms and conditions"; };
  if (msg == '') {
	  var dobymd = $("#dob_yy").val()+'-'+$("#dob_mm").val()+'-'+$("#dob_dd").val();
		
  e = document.getElementById('sendregformbtn');
  if (e) e.disabled = true;
		  
    $("#payerrorbox").load("ajax_payment.php", 
	       {firstname:$("#firstname").val(),
				  lastname:$("#lastname").val(),
				  street:$("#street").val(),
				  suburb:$("#suburb").val(),
				  city:$("#city").val(),
				  postcode:$("#postcode").val(),
				  country:$("#country").val(),
				  dob:dobymd,
				  home_phone:$("#home_phone").val(),
				  mobile:$("#mobile").val(),
				  email:$("#email").val(),
				  school_or_org:$("#school_or_org").val(),
				  teacher:$("#coordinator").val(),
					totalprice:$("#totalprice").html()
				  },
      function(){
	e = document.getElementById('ajaxok');
	if (e) {
	  document.forms[0].submit();
        }
	e = document.getElementById('sendregformbtn');
        if (e) e.disabled = false;
      } 
	       );
  } else {
    alert('Please fill in the following fields:'+msg);
  };
	return false;
}	       

