<!--

function MsgValidator(theForm) {		// Validación de Clave.
  if (theForm.txtCodeCves.value == "") {
    alert("No tecleó la Clave del radio.");
    theForm.txtCodeCves.focus();
    return (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("El número de la clave es invalido.");
    theForm.txtCodeCves.focus();
    return (false);
  }

  return (true);
}

function ValCveSCod(theForm) {			// Validación de Clave y Código Secreto.
  if (theForm.txtCodeCves.value == "")
  {
    alert("No tecleó la Clave del radio.");
    theForm.txtCodeCves.focus();
    return (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("El número de la clave es invalido.");
    theForm.txtCodeCves.focus();
    return (false);
  }

  if (theForm.txtSecuCode.value != "") 
  {
    if (!ValCharInElement("0123456789", theForm.txtSecuCode.value)) {
      alert("El Código Secreto es invalido.");
      theForm.txtSecuCode.focus();
      return (false);
    }
  }
  return (true);
}


function ValMsgSend(theForm) {			// Validación de Enviar Mensaje.

  /* Si la clave tiene restricción de envio por Internet */
  if (theForm.txtWEBMode.value == "2") {
    /* Valida que se haya tecleado el Código WEB */
    if (theForm.txtWEBCode.value == "") {
      alert("No tecleó el Codigo WEB!");
      return (false);
    }

    /* Valida los caracteres del Código WEB tecleado */
    if (!ValCharInElement("0123456789", theForm.txtWEBCode.value)) {
      alert("Código WEB Inválido!");
      return (false);
    }
  }

  if (theForm.txtMessage.value == "") {
    alert("No tecleó el Mensaje!");
    return (false);
  }

  if (!ValCharInElement("!#$%&()*+,-./0123456789:;>=<?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~-\" \t\r\n\f", theForm.txtMessage.value)) {
    alert("En el Mensaje, NO se permiten caracteres especiales, acentos, letras ñ o Ñ!");
    return (false);
  }

  if (theForm.txtFrom.value == "") {
    alert("No tecleó el Remitente!");
    return (false);
  }

  if (!ValCharInElement("!#$%&()*+,-./0123456789:;>=<?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~-\" \t\r\n\f", theForm.txtFrom.value)) {
    alert("En el Remitente, NO se permiten caracteres especiales, acentos, letras ñ o Ñ!");
    return (false);
  }

  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);
}

function MsgLen(Element) {

  if (Element.value.length > 239) event.returnValue=0
}




//-->
