
function send_form(){
	new Ajax('inscription_data.php', {
		method:'post',
		data: document.forms[0],
		onComplete: function(){
			// No problem -> forward to form_payement.htm
			var errors = Json.evaluate(this.transport.responseText);
			if (errors.length == 0)
			{
				window.location.href = "form_payment.php";
			}
			else
			{
				
				$$('input').each(function(e){e.style.backgroundColor = "white";});
				for(var i=0; i < errors.length; i++)
					if($(errors[i]) != null)
						$(errors[i]).style.backgroundColor = "red";
				
				if(errors.contains('email_dub'))
					$('error_detail').innerHTML = "Missing or invalid fields are in red.<br>  This email address is already in use, please choose another, unique e-mail address.";
				else
					$('error_detail').innerHTML = "Missing or invalid fields are in red.";
				$('error_detail').style.visibility = "visible";
			}
		}
	}).request();
}

