// JavaScript Document

function validarEmail(valor) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
return (true)
} else {
return (false);
}
}

function validaformulariosimple(){
    //valido el nombre
    if (document.getElementById("nombre").value.length==0){
       alert("El nombre es obligatorio")
       document.fvalida.nombre.focus()
       return 0;
    }
	 
	 if (document.getElementById("apellidos").value.length==0){
       alert("Los apellidos son obligatorios")
       document.fvalida.nombre.focus()
       return 0;
    }

   	 if (document.getElementById("email").value.length==0){
       alert("El email es obligatorio")
       document.fvalida.nombre.focus()
       return 0;
    }
	
	if (validarEmail(document.getElementById("email").value)==false){
		alert("El email parece no ser correcto")
		return 0;
		}

    document.getElementById("formulario").submit();
} 