function validar(theForm)
{
if (theForm.Nombre.value == "")
{
alert("Por favor, escriba su nombre y apellidos.");
theForm.Nombre.focus();
return (false);
}
if (theForm.Nombre.value.length < 3)
{
alert("Nombre y apellidos debe tener al menos 3 caracteres.");
theForm.Nombre.focus();
return (false);
}
if (theForm.email.value == "")
{
alert("Por favor, escriba su dirección de correo electrónico.");
theForm.email.focus();
return (false);
}
if (theForm.email.value.length < 7)
{
alert("E-Mail ha de tener al menos 7 caracteres.");
theForm.email.focus();
return (false);
}
if (theForm.Localidad.value == "")
{
alert("Por favor, indique su localidad.");
theForm.Localidad.focus();
return (false);
}
if (theForm.Localidad.value.length < 2)
{
alert("La localidad ha de tener al menos 2 caracteres.");
theForm.Localidad.focus();
return (false);
}
if (theForm.Telefono.value == "")
{
alert("Por favor, escriba su número de teléfono.");
theForm.Telefono.focus();
return (false);
}
if (theForm.Telefono.value.length < 9)
{
alert("Escriba por lo menos 9 caracteres en el campo \"Teléfono\".");
theForm.Telefono.focus();
return (false);
}
var checkOK = "0123456789-()+-/ \t\r\n\f";
var checkStr = theForm.Telefono.value;
var allValid = true;
var validGroups = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
	break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Por favor, escriba un número de teléfono válido.");
theForm.Telefono.focus();
return (false);
}
return (true);
}

