function evaluar_form(){
	oForm=document.forms.contacto;
	if (oForm.nombre.value==""){
		alert("El nombre es requerible")
		return false
	}
	if (oForm.apellidos.value==""){
		alert("El campo apellidos es requerible")
		return false
	}
	if (oForm.email.value!=""){
		return(validarEmail(oForm.email.value))
	}else{
		alert("El campo e-mail es requerible")
		return false
	}
	return true
}
//-------------------
function validarEmail(valor){
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    	return true
	}else{
		alert("El formato del e-mail no es válido");
		return false;
	}
}
function errores(err){
	switch(err){
		case 1:
			alert("El envio ha finalizado con exito");
			location.href='contacta.php';
			return false;
		break;
		case 2:
			alert("El envio no se ha podido realizar");
			location.href='contacta.php';
			return false;
		break;
	}
}


