
<!--

function ValDatos(theform) {
    if (theform.txtEmail.value == "")
    {
	alert("Se debe capturar el E-mail");
	theform.txtEmail.focus();
	return (false);
    }

    if (theform.txtEmail.value.indexOf('@',0) == -1)
    {
	alert("El E-mail debe contener una arroba (@)");
	theform.txtEmail.focus();
	return (false);
    }

    if (theform.txtPassword.value == "")
    {
	alert("Se debe capturar el Password");
	theform.txtPassword.focus();
	return (false);
    }

    return (true);	
}



function ValCrearDir(theform) {
    if (theform.txtNombre.value == "")
    {
        alert("Se debe capturar el Nombre");
	theform.txtNombre.focus();
	return (false);
    }

    if (theform.txtEmail.value == "")
    {
	alert("Se debe capturar el E-mail");
	theform.txtEmail.focus();
	return (false);
    }

    if (theform.txtEmail.value.indexOf('@',0) == -1)
    {
	alert("El E-mail debe contener una arroba (@)");
	theform.txtEmail.focus();
	return (false);
    }

    if (theform.txtPassword.value == "")
    {
	alert("Se debe capturar el Password");
	theform.txtPassword.focus();
	return (false);
    }

    if (theform.txtPassword.value != theform.txtPassConfirm.value)
    {
	alert("Verifique que el Password sea correcto");
	 theform.txtPassConfirm.value = ""
	theform.txtPassword.focus();

	return (false);
    }

    if (theform.txtPassword.value.length <= 3)
    {
	alert("Debe capturar mínimo 4 caracteres para el Password");
	theform.txtPassword.focus();
	return (false);
    }

    if (theform.txtCodeCves.value == "") 
    {
        if (theform.chkNo.checked == false)
	{
	    alert("No tecleó la Clave del radio.");
            theform.txtCodeCves.focus();
            return (false);
	}
    }


    if (theform.txtCodeCves.value != "") 
    {
        theform.chkNo.checked = false;
        if (theform.txtCodeCves.value.length < 4) 
        {
	    alert("El número minimo de caracteres para la Clave son 4.");
            theform.txtCodeCves.focus();
	    return (false);
    	}
	if (!ValCharInElement("0123456789", theform.txtCodeCves.value)) 
        {
            alert("La clave debe contener caracteres numéricos");
            theform.txtCodeCves.focus();
            return (false);
	}
    }


    if (theform.chkNo.checked == true)
    {
	theform.txtCodeCves.value = "";
    }

   return (true);

}



function ValCharInElement(checkOK, checkStr) 
{		
  // Valida caracteres válidos.
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }

  return (allValid);
}

//-->

