<!--
function formulario(theForm)
{
// check to see if the field is blank
if (theForm.nombres.value == "")
{
alert("Ha olvidado escribir su Nombre.");
theForm.nombres.focus();
return (false);
}
if (theForm.apellidos.value == "")
{
alert("Ha olvidado escribir su Apellido.");
theForm.apellidos.focus();
return (false);
}
if (theForm.direccion.value == "")
{
alert("Ha olvidado escribir su Dirección.");
theForm.direccion.focus();
return (false);
}
// test if valid email address, must have @ and .
theForm.email.value = theForm.email.value.toLowerCase(); // Added by gpinchev to force lowercase
var checkEmail = "@.";
var checkStr = theForm.email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("Por favor inserte un correo electrónico válido.");
theForm.email.focus();
return (false);
}
if (theForm.email.value!=document.form1.email_.value)
{
alert("Su correo electrónico no coincide con la primera introducida");
theForm.email_.focus();
return (false);
}
if (theForm.clave1.value == "")
{
alert("Ha olvidado escribir su primera clave.");
theForm.clave1.focus();
return (false);
}
if (theForm.clave2.value!=document.form1.clave1.value)
{
alert("La primera clave no coincide con la segunda clave.");
theForm.clave2.focus();
return (false);
}
}
//-->

