<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery(document).ready(function() {
	
	var submit_formulario = false;
	
	jQuery('#formulario_landing_ayudas').submit(function(e){
		
		e.preventDefault();

		if (!submit_formulario) {
			solicitar_info_ayudas();			
		}
		
	});
        
	jQuery('#formulario_formacion').submit(function(e){
		
		e.preventDefault();

		if (!submit_formulario) {
			solicitar_info_formacion();			
		}
		
	});        
		
});

function solicitar_info_ayudas() {
	
	var msg;
	error = false;
	
	submit_formulario = true;
	
	jQuery('#formulario_landing_ayudas *').css('cursor', 'wait');
	
	jQuery('#formulario_landing_ayudas [name]').css('border', '0px');
	
	if ( !jQuery('#formulario_landing_ayudas input[name=nombre]').val()) {
		error = true;
		msg = "Debe completar todos los campos nombre";
		jQuery('#formulario_landing_ayudas input[name=nombre]').css('border', '1px solid red');
		
	}

	if ( !jQuery('#formulario_landing_ayudas input[name=empresa]').val()) {
		error = true;
		msg = "Debe completar todos los campos empresa";
		jQuery('#formulario_landing_ayudas input[name=empresa]').css('border', '1px solid red');
		
	}	

	if ( !jQuery('#formulario_landing_ayudas #sector').val()) {
		error = true;
		msg = "Debe completar todos los campos sector";
		jQuery('#formulario_landing_ayudas #sector').css('border', '1px solid red');
		
	}	
	
	if ( !jQuery('#formulario_landing_ayudas input[name=telefono]').val()) {
		msg = "Debe completar todos los campos telefono";
		error = true;
		jQuery('#formulario_landing_ayudas input[name=telefono]').css('border', '1px solid red');
	}
	
	expr = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (!expr.test(jQuery('#formulario_landing_ayudas input[name=email]').val())){
		error = true;
		msg = "Email no vÃ¡lido";
		jQuery('#formulario_landing_ayudas input[name=email]').css('border', '1px solid red');		
	}
	
	if ( !jQuery('#formulario_landing_ayudas input[name=email]').val()) {
		error = true;
		msg = "Debe completar todos los campos email";
		jQuery('#formulario_landing_ayudas input[name=email]').css('border', '1px solid red');
	}
		
	if ( !jQuery('#formulario_landing_ayudas input[name=acepto]').is(':checked') ) {
		error = true;
		msg = "Debe aceptar las condiciones legales";
	}
	

	if (!error) {
		
		jQuery.post(
				MyAjax.url, {
					action : 'enviar_consulta_ayudas',
					nombre: jQuery('#formulario_landing_ayudas input[name=nombre]').val(),					
					empresa: jQuery('#formulario_landing_ayudas input[name=empresa]').val(),
					sector: jQuery('#formulario_landing_ayudas #sector').val(),					
					telefono: jQuery('#formulario_landing_ayudas input[name=telefono]').val(),					
					email: jQuery('#formulario_landing_ayudas input[name=email]').val(),
				}, function(response) {
					jQuery('#status_form_landing_ayudas').html('&lt;div&gt;'+response+'&lt;/div&gt;');
					jQuery('#formulario_landing_ayudas *').css('cursor', 'auto');
					jQuery('#formulario_landing_ayudas [name]').val('');
					jQuery('#formulario_landing_ayudas select').val('');					
					jQuery('#formulario_landing_ayudas input[name=acepto]').prop('checked',false);
					submit_formulario = false;										
					
				}
								
		);		
		
	}
	else {
		
		jQuery('#formulario_landing_ayudas *').css('cursor', 'auto');
		jQuery('#status_form_landing_ayudas').html('&lt;div&gt;'+msg+'&lt;/div&gt;');
				
		submit_formulario = false;
	}	
	
}


function solicitar_info_formacion() {
	
	var msg;
	error = false;
	
	submit_formulario = true;
	
	jQuery('#formulario_formacion *').css('cursor', 'wait');
	
	jQuery('#formulario_formacion [name]').css('border', '0px');
	
	if ( !jQuery('#formulario_formacion input[name=nombre]').val()) {
		error = true;
		msg = "Debe completar todos los campos nombre";
		jQuery('#formulario_formacion input[name=nombre]').css('border', '1px solid red');
		
	}

	if ( !jQuery('#formulario_formacion input[name=empresa]').val()) {
		error = true;
		msg = "Debe completar todos los campos empresa";
		jQuery('#formulario_formacion input[name=empresa]').css('border', '1px solid red');
		
	}	

	if ( !jQuery('#formulario_formacion #sector').val()) {
		error = true;
		msg = "Debe completar todos los campos sector";
		jQuery('#formulario_formacion #sector').css('border', '1px solid red');
		
	}	
	
	if ( !jQuery('#formulario_formacion input[name=telefono]').val()) {
		msg = "Debe completar todos los campos telefono";
		error = true;
		jQuery('#formulario_formacion input[name=telefono]').css('border', '1px solid red');
	}
	
	expr = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (!expr.test(jQuery('#formulario_formacion input[name=email]').val())){
		error = true;
		msg = "Email no vÃ¡lido";
		jQuery('#formulario_formacion input[name=email]').css('border', '1px solid red');		
	}
	
	if ( !jQuery('#formulario_formacion input[name=email]').val()) {
		error = true;
		msg = "Debe completar todos los campos email";
		jQuery('#formulario_formacion input[name=email]').css('border', '1px solid red');
	}
		
	if ( !jQuery('#formulario_formacion input[name=acepto]').is(':checked') ) {
		error = true;
		msg = "Debe aceptar las condiciones legales";
	}
	

	if (!error) {
		
		jQuery.post(
				MyAjax.url, {
					action : 'enviar_consulta_formacion',
					nombre: jQuery('#formulario_formacion input[name=nombre]').val(),					
					empresa: jQuery('#formulario_formacion input[name=empresa]').val(),
					sector: jQuery('#formulario_formacion #sector').val(),					
					telefono: jQuery('#formulario_formacion input[name=telefono]').val(),					
					email: jQuery('#formulario_formacion input[name=email]').val(),
                                        idcurso: jQuery('#formulario_formacion input[name=idcurso]').val(),
                                        titulocurso: jQuery('#formulario_formacion input[name=titulocurso]').val(),
                                        emailcontacto: jQuery('#formulario_formacion input[name=emailcontacto]').val()
				}, function(response) {
					jQuery('#status_form_landing').html('&lt;div&gt;'+response+'&lt;/div&gt;');
					jQuery('#formulario_formacion *').css('cursor', 'auto');
					jQuery('#formulario_formacion [name]').val('');
					jQuery('#formulario_formacion select').val('');					
					jQuery('#formulario_formacion input[name=acepto]').prop('checked',false);
					submit_formulario = false;										
					
				}
								
		);		
		
	}
	else {
		
		jQuery('#formulario_formacion *').css('cursor', 'auto');
		jQuery('#status_form_landing').html('&lt;div&gt;'+msg+'&lt;/div&gt;');
				
		submit_formulario = false;
	}	
	
}</pre></body></html>