<tr><td class="control" colspan="6">
<form method="post" name="messages" action="<?php echo Horde::applicationUrl('mailbox.php') ?>">
<?php Horde::pformInput() ?>
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr class="item">
    <th align="left" nowrap="nowrap" width="8%">&nbsp;<?php echo Horde::img('checkbox.gif', 'alt="' . _("Checkbox") . '"') ?></th>
    <th class="<?php echo ($prefs->getValue('sortby') == SORTARRIVAL) ? 'selected' : 'item' ?>" width="4%" align="left" nowrap="nowrap">
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTARRIVAL . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTARRIVAL); ?>"><?php echo _("#") ?></a>
    </th>
    <th class="<?php echo ($prefs->getValue('sortby') == SORTDATE) ? 'selected' : 'item' ?>" width="12%" align="left" nowrap="nowrap">
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTDATE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTDATE); ?>"><?php echo _("Date") ?></a>
    </th>
    <th class="<?php echo ($prefs->getValue('sortby') == SORTFROM) ? 'selected' : 'item' ?>" width="20%" align="left" nowrap="nowrap">
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTFROM . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTFROM); ?>"><?php echo _("From") ?></a>
    </th>
    <th nowrap="nowrap" width="2%">&nbsp;</th>
    <th class="<?php echo ($prefs->getValue('sortby') == SORTSUBJECT || $prefs->getValue('sortby') == SORTTHREAD) ? 'selected' : 'item' ?>" width="50%" align="left" nowrap="nowrap">
<?php if ($prefs->getValue('sortby') == SORTTHREAD): ?>
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTTHREAD . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTTHREAD) ?>"><?php echo _("Thread") ?></a>
        &nbsp;<span style="font-size: 10px;">[<a style="font-size: 10px; font-weight: normal;" class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTSUBJECT) ?>"><?php echo _("Subject") ?></a>]</span>
<?php else: ?>
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTSUBJECT . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTSUBJECT) ?>"><?php echo _("Subject") ?></a>
        &nbsp;<span style="font-size: 10px;">[<a style="font-size: 10px; font-weight: normal;" class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTTHREAD) ?>"><?php echo _("Thread") ?></a>]</span>
<?php endif; ?>
    </th>
    <th class="<?php echo ($prefs->getValue('sortby') == SORTSIZE) ? 'selected' : 'item' ?>" width="4%" align="right" nowrap="nowrap">
        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTSIZE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTSIZE) ?>"><?php echo _("Size") ?></a>
    </th>
</tr>
