function validateForm(f) {

	if (trim(f.nombre.value)=="") {		
		document.getElementById('lb_nombre').style.color="red";
		alert("El campo Nombre es obligatorio");
		f.elements['nombre'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_nombre').style.color="black";		
	}
	
	if (trim(f.apellidos.value)=="") {
		document.getElementById('lb_apellidos').style.color="red";
		alert("El campo Apellidos es obligatorio");		
		f.elements['apellidos'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_apellidos').style.color="black";
	}	

	if (trim(f.mail.value)=="") {
		document.getElementById('lb_mail').style.color="red";
		alert("El campo Mail es obligatorio");		
		f.elements['mail'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_mail').style.color="black";
	}
	
	if (validateEmail(f.mail.value)==false){ 
		document.getElementById('lb_mail').style.color="red";
		alert("El campo Mail es incorrecto");		
		f.elements['mail'].focus();
		return false;
	}
	else
	{
		document.getElementById('lb_mail').style.color="black";
	}	
	
	if (trim(f.dni.value)=="") {
		document.getElementById('lb_dni').style.color="red";
		alert("El campo DNI es obligatorio");		
		f.elements['dni'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_dni').style.color="black";
	}		
	
	if (trim(f.texto.value)=="") {
		document.getElementById('lb_texto').style.color="red";
		alert("El campo Texto es obligatorio");		
		f.elements['texto'].focus();
		return false;
		}
	else
	{
		document.getElementById('lb_texto').style.color="black";
	}		

	return true;
	
}