	
	$(document).ready(function(){
	
		if ($("#registration_form").length) $("#registration_form").validate();

		var options = { 
			//target:        '#reg_form_box',   
			beforeSubmit:  showRequest,  
			success:       CheckEntry 
			, url:       "__process_the_registration.php"
		}; 
		
		//if  (!/MSIE/ig.test(navigator.userAgent ) )
		//	$('#registration_form').ajaxForm(options); 
	
	}); 
	
	
	function GetMatchFecha (the_cursos) {
	
		$.get ("__process_the_registration.php?request=cursos_fecha&corse_name=" + the_cursos, function (res){
		
			$("#cursos_fecha_box").html(res) ; 
			
			$(".curso_precio").html($("#valor_socio").val()); 
		
		}) ; 
	
	}
	
	function CheckEntry(responseText, statusText, xhr, $form)  { 
		if (responseText.indexOf("NOTIMAGE") > -1) {
			$("#messages").html("Usted ingreso una imagen de formato invalido.") ; 
		}
		else{
			$("#Socio1").attr("checked", true) ; 
			$("#Socio2").attr("checked", false) ; 
			$("#reg_form_box").html("<div style='text-align:center; margin-top:20px; '>Su inscripcion ha sido exitosa, nos comunicaremos con usted a la brevedad.</div>") ;
		}
    } 
	
 
	function showRequest(formData, jqForm, options) { 
		var queryString = $.param(formData); 
		$("#reg_form_box").html("Estamos registrando su solicitud... Por favor espere."); 
		return true; 
	} 
 

