    function Validate(theForm)
    {return (true);}

    function chgClr(element)
    {
      var chk = element.checked;
      while (element.tagName.toUpperCase() != 'TR' && element != null)
        element = document.all ? element.parentElement : element.parentNode;
      if (element && chk)
        element.bgColor = "#FF9F5B";
      else
        element.bgColor = "#E4EDF5";
    }

    function spellcheckf()
    {
      document.spellcheckform.content.value = document.f.body.value;
      window.open('spellcheck.php?attempt=2','spellcheckwindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=600,height=400,resizable=yes');
    }

    ch1 = 0;
    function check()
    {
      var send = true;
      if(document.f.to.value.indexOf(";")!=-1 || document.f.cc.value.indexOf(";")!=-1 || document.f.bcc.value.indexOf(";")!=-1)
      {
        send = false;
        alert("Your email addresses must be separated by a comma, not a semicolon");
      }
      else if(document.f.to.value==null || document.f.to.value.length < 5 || document.f.to.value.indexOf("@")==-1 || document.f.to.value.indexOf(".")==-1)
      {
        if(document.f["maillist[]"]==null || document.f["maillist[]"].selectedIndex==-1)
        {
          send = false;
          alert("You must enter a valid email address or select at least one mailing list.");
        }
      }
      else if(document.f.to.value.indexOf(" ")!=-1 || document.f.cc.value.indexOf(" ")!=-1 || document.f.bcc.value.indexOf(" ")!=-1)
      {
        send = false;
        alert("Your email address lines must not contain a space!");
      }

      if(send && ch==0) // only allowed to submit once
      {
        ch=1;
        document.f.submit();
      }
    }

    function addrBook(box)
    {
      var field;
      if(box==1) field = document.f.to;
      else if(box==2) field = document.f.cc;
      else if(box==3) field = document.f.bcc;

      if(field.value.length==0)
        field.value = document.f.addr.options[document.f.addr.selectedIndex].value;
      else
        field.value = field.value + "," + document.f.addr.options[document.f.addr.selectedIndex].value;
    }

    function checkem()
    {
      if(document.f.c.checked)
        for (var i=0;i<document.f.elements.length;i++)
        {
          var e = document.f.elements[i];
          if(e.name=='del')
          {
            if(!e.checked)
              e.checked=true;
            chgClr(e);
          }
        }
      else
        for (var i=0;i<document.f.elements.length;i++)
        {
          var e = document.f.elements[i];
          if(e.name=='del')
          {
            if(e.checked)
              e.checked=false;
            chgClr(e);
          }
        }
    }
    ch = 0;

    function sub(pagefunction)
    {
      for(var i=0;i<document.f.elements.length;i++)
      {
        var e = document.f.elements[i];
        if(e.name=='del')
          if(e.checked)
          {
            if(pagefunction=="move" && document.f.box.options[document.f.box.selectedIndex].value=="NONE") 
              alert("You must select a folder to move the messages to!");
            else 
              if(ch==0)
              {
                conf = false;
                if(pagefunction=="isspam")
                  conf = confirm("Are you sure this email address is sending you spam?");
                else if(pagefunction=="notspam")
                  conf = confirm("Are you sure this email address is NOT sending you spam?");
                else if(pagefunction=="delete")
                  conf = confirm("Are you sure you wish to "+pagefunction+" this email?\n\nDoing so will move this email to your trash folder.\nYour trash is automatically emptied every 7-14 days.");
                else if(pagefunction=="deletetrash")
                  conf = confirm("Are you sure you wish to delete this email?\n\nIf you delete email from your trash folder, there is no way to recover it.");
                else
                  conf = confirm("Are you sure you wish to "+pagefunction+" this email?");
                if(conf)
                {
                  ch = 1;
                  document.f.elements['function'].value=pagefunction;
                  document.f.submit();
                }
              }
            return;
          }
      }
      if(pagefunction=="isspam")
        alert("You must select a message to mark as spam!");
      else if(pagefunction=="notspam")
        alert("You must select a message to mark as not spam!");
      else
        alert("You must select a message to "+pagefunction+"!");
    }

    function empty(pagefunc)
    {
      if(ch==0)
      {
        if(pagefunc=="emptytrash")
          conf = "Are you sure you wish to delete ALL of the mail in this box?\n\nIf you delete email from your trash folder, there is no way to recover it.";
        else
          conf = "Are you sure you wish to delete ALL of the mail in this box?\n\nDoing so will move this email to your trash folder.\nYour trash is automatically emptied every 7-14 days.";
        if(confirm(conf))
        {
          ch = 1;
          document.f.elements['function'].value=pagefunc;
          document.f.submit();
        }
      }
    }

    function deleteEn(idn,pagefunction,subfunction,txt,link)
    {
      if(link==undefined) link = "functions.jsp";
      if(confirm("Are you sure you wish to delete this "+txt+"?"))
        window.location = link+"?function="+pagefunction+"&subfunction="+subfunction+"&idn="+idn;
    }

    function pop(page,name,width,height)
    {
      var w;
      w = (window.open(page,name,'toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,width='+width+',height='+height+',resizable=yes'));
      w.focus();
    }
    function popPlain(page,name,width,height)
    {
      var w = (window.open(page,name,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width='+width+',height='+height+',resizable=no'));
      w.focus();
    }
