<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><img src="<%image_url%>/pics/1pixel.gif" width="1" height="3"></td>
  </tr>
  <tr bgcolor="#7a9f54">
    <td>
      <table width="100%" border="0" cellspacing="1" cellpadding="1">
        <tr class="body">
          <td width="3%" height="20" align="center" bgcolor="#256A19" class="body"><img src="<%image_url%>/icons/message.gif" hspace=2></td>
          <td width="3%" height="20" align="center" bgcolor="#256A19" class="body"><img src="<%image_url%>/icons/attachment.gif" hspace=2></td>
          <td width="63%" height="20" bgcolor="#256A19" class="body_bold">
            <a href="glist.cgi?do=msg_home&<%if query%><%query%><%elsif msg_cat_id_fk%>msg_cat_id_fk=<%msg_cat_id_fk%><%else%>msg_root=1<%endif%><%ifnot use_cookie%>&sid=<%session_id%><%endif%><%if users%>&users=1<%endif%>&sb=msg_subject&so=<%if so eq 'ASC'%>DESC<%else%>ASC<%endif%>"><font color="#FFFFFF">Subject</font></a>
            <%if sb eq 'msg_subject'%>
            <img src="<%image_url%>/icons/<%if so eq 'ASC'%>down.gif<%else%>up.gif<%endif%>" border=0>
            <%endif%>
          </td>
          <td width="28%" height="20" bgcolor="#256A19" class="body_bold" align="center">
            <a href="glist.cgi?do=msg_home&<%if query%><%query%><%elsif msg_cat_id_fk%>msg_cat_id_fk=<%msg_cat_id_fk%><%else%>msg_root=1<%endif%><%ifnot use_cookie%>&sid=<%session_id%><%endif%><%if users%>&users=1<%endif%>&so=<%if so eq 'ASC'%>DESC<%else%>ASC<%endif%>"><font color="#FFFFFF">Created</font></a>
            <%ifnot sb%>
            <img src="<%image_url%>/icons/<%if so eq 'ASC'%>up.gif<%else%>down.gif<%endif%>" border=0>
            <%endif%>
          </td>
          <td width="5%" align="center" height="20" bgcolor="#256A19" class="body">
           <input name=c_all type=checkbox onclick="check_all()" />
          </td>
        </tr>
        <%loop results%>
        <tr bgcolor="<%if even%>#d9e4f2<%else%>#FFFFFF<%endif%>" class="body">
          <td align="center">
            <img src="<%image_url%>/icons/<%if msg_status%>sent.gif<%else%>message.gif<%endif%>" hspace=2>
          </td>
          <td align="center">
            <%GList::HTML::generate_attachments%>
            <%if attachments%><img src="<%image_url%>/icons/attachment.gif" hspace=2><%else%>&nbsp;<%endif%>
          </td>
          <td class="body">
            <%if msg_user_id_fk and msg_user_id_fk ne $usr_username%>
              <%set user_search = 1%>
            <%elsif msg_user_id_fk eq $usr_username and msg_user_id_fk-opt eq '<>'%>
              <%set user_search = 1%>
            <%endif%>
            <a href="glist.cgi?do=msg_home;d=1;msg_id=<%msg_id%>;msg_id-opt==<%if lookup%>;lu=<%lookup%><%endif%><%hidden_query%>"><%msg_subject%></a>
          </td>
          <td class="body" align=center>
            <%GList::HTML::date_get('msg_created', 1)%>
          </td>
          <td align="center">
            <input type="checkbox" name="modify" value="<%row_num%>" onclick="check_item(this)" />
            <input type="hidden" name="<%row_num%>-msg_id" value="<%msg_id%>" />
          </td>
        </tr>
        <%endloop%>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height=30 >
        <%if hits > $mh and $mh != -1%>
        <tr align="left" class="body">
          <td class="body" cols="2"><%include include_toolbar.html%></td>
        </tr>
        <%endif%>
        <tr class="body">
          <td class="body"><%if msg%><%msg%><%else%>&nbsp;<%endif%></td>
          <%if hits%>
          <td class="body" align="right">
            <%if hits_cat%>
            <b>Move to</b>:
            <select name="move_to" class=object>
              <option value="">-------</option>
              <%if msg_cat_id_fk%>
              <option value='root'>Messages</option>
              <%endif%>
              <%loop results_cat%>
                <%if msg_cat_id_fk ne $cms_id%>
                <option value="<%cms_id%>"><%cms_name%></option>
                <%endif%>
              <%endloop%>
            </select>
            <input type="button" name="bmove" value="Move" onclick="init_do('myform', 'msg_move', '', '', 'msg_', '', '', 'Please choose one or more message to move by checking the boxes to the right of the message(s).')" class=button />
            <%endif%>
            <input type="button" name="bdelete" value="Delete Messages" onclick="init_do('myform', 'msg_delete', '', '', 'msg_')" class=button />
            <input type="button" name="bselect" value="Select Lists" onclick="init_do('myform', 'msg_send_form', '', '', 'msg_', '', '', 'Please choose one or more message to send by checking the boxes to the right of the message(s).')" class=button />
          </td>
          <%endif%>
        </tr>
      </table>
    </td>
  </tr>
</table>

