<form method="post" name="search" action="<?php echo Horde::applicationUrl('search.php') ?>">
<input type="hidden" name="actionID" value="update_search" />
<input type="hidden" name="delete_field_id" value="" />
<?php if ($search['mbox']): ?>
<input type="hidden" name="mailbox" value="<?php echo $search['mbox'] ?>" />
<?php elseif ($subscribe): ?>
<input type="hidden" name="show_subscribed_only" value="<?php echo $shown ?>" />
<?php endif; ?>
<div align="center">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
 <tr>
  <td align="left" class="header">
<?php if ($create_vfolder): ?>
   <b><?php echo _("Create Virtual Folder") ?></b>
<?php elseif ($edit_vfolder): ?>
   <b><?php echo _("Edit Virtual Folder") ?></b>
<?php else: ?>
   <b><?php echo sprintf(_("Search %s"), $search['mbox'] ? ' ' . htmlspecialchars($search['mbox']) : '') ?></b>
<?php endif; ?>
  </td>
  <td align="right" class="header"><?php echo Help::link('imp', 'search') ?></td>
 </tr>
 <tr>
  <td valign="top" colspan="2">
   <input type="submit" class="button" value="<?php echo $submit_label ?>" onclick="return formCheck();" />
   <input type="button" class="button" value="<?php echo _("Reset") ?>" onclick="document.search.actionID.value = 'reset_search';document.search.submit();return true;" />
  </td>
 </tr>

 <tr><td colspan="2"></td></tr>

 <tr>
  <td class="smallheader" colspan="2" align="left"><b><?php echo _("Message matches") ?></b></td>
 </tr>

 <tr>
  <td class="item" colspan="2">
   <table cellspacing="0" cellpadding="0" width="100%">
    <tr>
     <td class="item1" align="left" nowrap="nowrap">
      <input type="radio" name="search_match" id="search_match_or" value="or"<?php if ($search['field_end'] > 0) echo ' onchange="document.search.submit();return true;" onclick="document.search.submit();return true;"'; if ($search['match'] == 'or') echo ' checked="checked"'; ?> />
      <i><?php echo Horde::label('search_match_or', _("Match Any Query")) ?></i>
     </td>
     <td class="item1" align="left" nowrap="nowrap">
      <input type="radio" name="search_match" id="search_match_and" value="and"<?php if ($search['field_end'] > 0) echo ' onchange="document.search.submit();return true;" onclick="document.search.submit();return true;"'; if (is_null($search['match']) || ($search['match'] == 'and')) echo ' checked="checked"'; ?> />
      <i><?php echo Horde::label('search_match_and', _("Match All Queries")) ?></i>
     </td>
     <td class="item1" width="100%">&nbsp;</td>
    </tr>
   </table>
  </td>
 </tr>

 <tr>
  <td class="smallheader" colspan="2" align="left"><b><?php echo Horde::label('field_0', _("Message fields")) ?></b></td>
 </tr>

 <tr>
  <td class="item0" align="left" colspan="2">
   <table border="0" cellpadding="1" cellspacing="1" width="100%">
