    //------------------------------------------------------------------

    var tbaURL      = 'http://www.bethami.net//cgi-bin/tbacomm.cgi';
    var tbaMail     = 'http://www.bethami.org/aboutus/contactus/sendmail/';
    var tbaGroups   = new Array('Temple Beth Ami', 'Clergy', 'Lay Leadership', 'Staff', 'Nursery School', 'Machane TBA (Education K-12)', 'Brotherhood', 'Sisterhood', 'Youth Group', 'Do not Display');
    var tbaContacts = new Array();

    //------------------------------------------------------------------

    function tbaRecord (seq, role, name, email, phone, group, groupOrder)
    {
      this.seq        = seq;
      this.role       = role;
      this.name       = name;
      this.email      = email;
      this.phone      = phone;
      this.group      = group;
      this.groupOrder = groupOrder;
    }

    //------------------------------------------------------------------

    function tbaByGroup (a, b)
    {
      return (a.groupOrder - b.groupOrder);
    }

    //------------------------------------------------------------------

    function tbaBySeq (a, b)
    {
      return (a.seq - b.seq);
    }

    //------------------------------------------------------------------

    function populateTable ()
    {
      var records = tbaContacts.sort(tbaByGroup);
      var group   = tbaGroups[tbaGroups.length-1];
      var max     = 0;

      for (i=0; i<records.length; i++)
      {
        displayOfficeRecord(records[i]);

        max = (records[i].seq > max) ? records[i].seq : max;
      }

      for (i=1; i<5; i++)
      {
        var n = parseInt(max)+(5*i);
        var x = n+99000;

        n = '000' + n.toString();
        n = n.substr(n.length - 3);

        displayOfficeRecord(new tbaRecord(n, "", "", "", "", group, x));
      }
    }

    //------------------------------------------------------------------

    function populateContactList ()
    {
       var records = tbaContacts.sort(tbaByGroup);
       var squeeze = false;
       var last    = '';

       for (i=0; i<arguments.length; i++)
       {
         if (arguments[i].match(/squeeze/i))
           squeeze = true;
       }

       // var s = squeeze ? 'SET' : 'not set';
       // document.writeln("<tr>Squeeze is "+s+"<tr>");
       // document.writeln("<tr>arguments.length = "+arguments.length+"<tr");

       for (i=0; i<records.length; i++)      // For Each Record
       {
         var displayed = false;

         for (j=0; (j<arguments.length && !displayed); j++)  // Look at each argument passed
         {
           if (arguments[j] == records[i].group)
           {
             displayed = true;
             last      = squeeze ? records[i].group : last;
             last      = displayContactRecord(last, records[i], squeeze);
           }
         }
       }
    }

    //------------------------------------------------------------------

    function displayOfficeRecord (rec)
    {
     var q = '"';
     var i;

     document.writeln ("<tr>");

     document.writeln (" <td> <input type='checkbox' name='delete' value="+q+rec.seq+q+">");
     document.writeln ("      <input type='hidden'   name='rowid'  value="+q+rec.seq+q+"> </td>");
     document.writeln (" <td> <input type='text'     name='order'  value="+q+rec.seq+q+" size='4'> </td>");

     document.writeln (" <td> <select name='group'>");

     i = 0;
     while (i<tbaGroups.length)
     {
       var groupId  = tbaGroups[i];
       var selected = (rec.group.toUpperCase() == groupId.toUpperCase()) ? ' selected>' : '>';

       document.writeln ('       <option'+selected+groupId+'</option>');
       i++;
     }

     document.writeln ("      </select> </td>");

     document.writeln (" <td> <input type='text'     name='role'   value="+q+rec.role+q+"></td>");
     document.writeln (" <td> <input type='text'     name='name'   value="+q+rec.name+q+"></td>");
     document.writeln (" <td> <input type='text'     name='email'  value="+q+rec.email+q+"></td>");
     document.writeln (" <td> <input type='text'     name='phone'  value="+q+rec.phone+q+"></td>");

     document.writeln ("</tr>");
     document.writeln (" ");
    }

    //------------------------------------------------------------------

    function displayContactRecord (last, rec, squeeze)
    {
     if (rec.group != last)
     {
       document.writeln ("<tr colspan='3'><td></td></tr>");
       document.writeln ("<tr colspan='3'><td><b>"+rec.group.toUpperCase()+"</b></td></tr>");
     }

     var comma     = (rec.name && rec.role) ? ', ' : '';
     var colon     = (rec.phone) ? ': ' : '';
     var recipient = rec.name+comma+rec.role;
     var roleText  = rec.role;
     var nameText  = rec.name;
     var sqzText   = "<a href='"+tbaMail+"?recipient="+recipient+"'>"+recipient+"</a>";

     if (rec.email != '' && rec.role != '' && rec.name == '')
        roleText  = "<a href='"+tbaMail+"?recipient="+recipient+"'>"+rec.role+"</a>";

     if (rec.email != '' && rec.name != '')
        nameText = "<a href='"+tbaMail+"?recipient="+recipient+"'>"+rec.name+"</a>";

     document.writeln ("<tr>");

     if (squeeze)
     {
        document.writeln (" <td>"+sqzText+colon+rec.phone+"</td>");
     }
     else
     {
        document.writeln (" <td>"+roleText+"</td>");
        document.writeln (" <td>"+nameText+"</td>");
        document.writeln (" <td>"+rec.phone+"</td>");
     }

     document.writeln ("</tr>");
     document.writeln (" ");

     return rec.group;
    }

    //------------------------------------------------------------------

