/* OCULTAR CAPA */
function hideById(id){
	var e = document.getElementById(id);
	e.style.display = 'none';
}
//-->


<!-- VALIDACION FORMULARIO CONTACTO -->
function isMail(text){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	
	return filter.test(text);
}

function validarConsulta(formulario){
	var allValid=true;
	
	var nombre = document.contactoForm.nombre.value;
	var correo = document.contactoForm.correo.value;
	var telefono = document.contactoForm.telefono.value;
	var empresa = document.contactoForm.empresa.value;
	var sector = document.contactoForm.sector.value;
	var empleados = document.contactoForm.empleados.value;
	var consulta = document.contactoForm.consulta.value;
	
	if (allValid && nombre.length<3){
		alert("El nombre debe tener al menos 3 caracteres.");
		allValid=false;
	}
	
	if (allValid && !isMail(correo)){
		alert("El formato del E-mail no es correcto.");
		allValid=false;
	}
	
	if (allValid && (telefono=='' || isNaN(telefono) || telefono.length<9)){
		alert("El campo teléfono no es correcto. Inserte solo el número sin guinoes, espacios o puntos.");
		allValid=false;
	}

	if (allValid && consulta==''){
		alert("Por fabvor rellene el campo consulta.");
		allValid=false;
	}
	
	return allValid;
}




