home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / email / navigation.inc < prev    next >
Text File  |  2004-03-08  |  18KB  |  618 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. if (isset($_REQUEST['unseen_state_changed']))
  14. {
  15.     $unseen_state_changed=true;
  16. }
  17.  
  18. if (isset($_REQUEST['empty_mailbox']) && $_REQUEST['empty_mailbox']=='true')
  19. {
  20.     $mail->sort();
  21.     if ($mailbox == $account['trash'] || $account['type'] == 'pop3')
  22.     {
  23.         $mail->delete($mail->messages);
  24.         //set this var so we can check if unseen messages were deleted
  25.         //if so, the auto mail checker must now too.
  26.         $unseen_state_changed = true;
  27.     }else
  28.     {
  29.         $mail->move($account['trash'], $mail->messages);
  30.     }
  31. }
  32.  
  33. if (isset($_REQUEST['delete_message_uid']) && $_REQUEST['delete_message_uid'] > 0)
  34. {
  35.     $messages[] = $_REQUEST['delete_message_uid'];
  36.     if ($mailbox == $account['trash'] || $account['type'] == 'pop3')
  37.     {
  38.         $mail->delete($messages);
  39.         //set this var so we can check if unseen messages were deleted
  40.         //if so, the auto mail checker must now too.
  41.         $unseen_state_changed = true;
  42.     }else
  43.     {
  44.         $mail->move($account['trash'], $messages);
  45.     }
  46.     $task = '';
  47. }
  48.  
  49. $messages_display = '';
  50.  
  51. //when this is post request delete selected messages
  52. if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['messages']))
  53. {
  54.     switch ($_POST['form_action'])
  55.     {
  56.         case 'delete':
  57.             if ($mailbox == $account['trash'] || $account['type'] == 'pop3' || $account['trash'] == '')
  58.             {
  59.                 $mail->delete($_POST['messages']);
  60.                 //set this var so we can check if unseen messages were deleted
  61.                 //if so, the auto mail checker must now too.
  62.                 $unseen_state_changed = true;
  63.             }else
  64.             {
  65.                 $mail->move($account['trash'], $_POST['messages']);
  66.             }
  67.         break;
  68.  
  69.         case 'move':
  70.             $mail->move($_POST['folder'], $_POST['messages']);
  71.         break;
  72.  
  73.         case 'markread':
  74.             //set this var so we can check if unseen messages were deleted
  75.             //if so, the auto mail checker must now too.
  76.             $unseen_state_changed = true;
  77.             $mail->set_message_flag($mailbox, $_POST['messages'], "\\Seen");
  78.         break;
  79.  
  80.         case 'markunread':
  81.             //set this var so we can check if unseen messages were deleted
  82.             //if so, the auto mail checker must now too.
  83.             $unseen_state_changed = true;
  84.             $mail->set_message_flag($mailbox, $_POST['messages'], "\\Seen", "reset");
  85.         break;
  86.     }
  87. }
  88.  
  89. //determine how to sort messages and sort them
  90. $mail_reverse = isset($_COOKIE['mail_reverse']) ? $_COOKIE['mail_reverse'] : '1';
  91. $mail_sort = isset($_COOKIE['mail_sort']) ? $_COOKIE['mail_sort'] : SORTDATE;
  92.  
  93. $mail->sort($mail_sort, $mail_reverse);
  94.  
  95. if ($mail_reverse == 1)
  96. {
  97.     $image_string = '<img src="'.$GO_THEME->images['arrow_down'].'" border="0" />';
  98.     $mail_reverse=0;
  99. }else
  100. {
  101.     $image_string = '<img src="'.$GO_THEME->images['arrow_up'].'" border="0" />';
  102.     $mail_reverse=1;
  103. }
  104.  
  105. //count total and new messages
  106. $mail->count();
  107. $msg_count = $mail->count;
  108.  
  109. $show = "from";
  110.  
  111. if ($mail->is_imap() && $account['sent'] != '')
  112. {
  113.     if (strpos($mailbox, $account['sent']) === 0)
  114.     {
  115.         $show = "to";
  116.     }
  117. }
  118.  
  119. $mail->mailbox_info();
  120. $total_size = $mail->mailbox_info["size"];
  121.  
  122. $unseen = $mail->unseen;
  123.  
  124. $_SESSION['unseen_in_mailbox'] = isset($_SESSION['unseen_in_mailbox']) ? $_SESSION['unseen_in_mailbox'] : $unseen;
  125. if (isset($unseen_state_changed) && $account['auto_check'] == '1')
  126. {
  127.     if ($unseen != $_SESSION['unseen_in_mailbox'])
  128.     {
  129.         $diff = $_SESSION['unseen_in_mailbox'] - $unseen;
  130.         $_SESSION['notified_new_mail'] -= $diff;
  131.     }
  132. }
  133. $_SESSION['unseen_in_mailbox'] = $unseen;
  134.  
  135. //loop through messages and display them
  136.  
  137. if ($msg_count > 0)
  138. {
  139.     $email_filter = array();
  140.     $subject_filter = array();
  141.     $filters = array();
  142.     //if there are new messages get the filters
  143.     if ($mail->unseen > 0)
  144.     {
  145.         $email->get_filters($account['id']);
  146.         while ($email->next_record())
  147.         {
  148.             $filter["field"] = $email->f("field");
  149.             $filter["folder"] = $email->f("folder");
  150.             $filter["keyword"] = $email->f("keyword");
  151.             $filters[] = $filter;
  152.         }
  153.     }
  154.     $mail->next_message_id = $first_row;
  155.     $row_count = 0;
  156.     while($mail->next_message() && ($row_count < $max_rows || $max_rows == 0))
  157.     {
  158.         $row_count++;
  159.         $continue = false;
  160.         //check if message is new and apply users filters to new messages only in the inbox folder.
  161.         if ($mail->f('new') == 1)
  162.         {
  163.             if (strtolower($mailbox) == "inbox")
  164.             {
  165.                 for ($i=0;$i<sizeof($filters);$i++)
  166.                 {
  167.                     if ($filters[$i]["folder"])
  168.                     {
  169.                         $field = $mail->f($filters[$i]["field"]);
  170.                         if (!is_array($field))
  171.                         {
  172.                             if (eregi($filters[$i]["keyword"], $field))
  173.                             {
  174.                                 $messages[] = $mail->f("uid");
  175.                                 if ($mail->move($filters[$i]["folder"], $messages))
  176.                                 {
  177.                                     $msg_count--;
  178.                                     $unseen--;
  179.                                     $continue = true;
  180.                                     break;
  181.                                 }
  182.                             }
  183.                         }else
  184.                         {
  185.                             for ($x=0;$x<sizeof($field);$x++)
  186.                             {
  187.                                 if (eregi($filters[$i]["keyword"], $field[$x]))
  188.                                 {
  189.                                     $messages[] = $mail->f("uid");
  190.                                     if ($mail->move($filters[$i]["folder"], $messages))
  191.                                     {
  192.                                         $msg_count--;
  193.                                         $unseen--;
  194.                                         $continue = true;
  195.                                         break;
  196.                                     }
  197.                                 }
  198.                             }
  199.                         }
  200.                     }
  201.                 }
  202.             }
  203.  
  204.             if ($continue)
  205.             {
  206.                 continue;
  207.             }
  208.  
  209.             $class = ' class="Table4"';
  210.             $image = '<img src="'.$GO_THEME->images['newmail'].'" border="0" width="16" height="16" />';
  211.         }else
  212.         {
  213.             if ($mail->f('answered'))
  214.             {
  215.                 $image = '<img src="'.$GO_THEME->images['mail_repl'].'" border="0" width="16" height="16" />';
  216.             }else
  217.             {
  218.                 $image = '<img src="'.$GO_THEME->images['mail'].'" border="0" width="16" height="16" />';
  219.             }
  220.             if($mail->f('uid')==$uid)
  221.             {
  222.                 $class = ' class="Table5"';
  223.             }else
  224.             {
  225.                 $class = ' class="Table1"';
  226.             }
  227.         }
  228.  
  229.         //check if message has attachments
  230.         if ($mail->f("attachment"))
  231.         {
  232.             $attachment = '<img src="'.$GO_THEME->images['attach'].'" border="0" />';
  233.         }else
  234.         {
  235.             $attachment = ' ';
  236.         }
  237.  
  238.         switch ($mail->f("priority"))
  239.         {
  240.             case "4":
  241.                     $priority = '<img src="'.$GO_THEME->images['low_priority'].'" width="8" height="16" />';
  242.             break;
  243.  
  244.             case "2":
  245.                     $priority = '<img src="'.$GO_THEME->images['high_priority'].'" width="8" height="16" />';
  246.             break;
  247.  
  248.             default:
  249.                     $priority = '';
  250.             break;
  251.         }
  252.  
  253.         //display message
  254.         $subject = $mail->f('subject') ? $mail->f('subject') : $ml_no_subject;
  255.         $short_subject = cut_string($subject, 50);
  256.         if ($show == "from")
  257.         {
  258.             $short_from = cut_string($mail->f('from'), 40);
  259.         }else
  260.         {
  261.             $to = '';
  262.             $to_array = $mail->f("to");
  263.             for ($i=0;$i<sizeof($to_array);$i++)
  264.             {
  265.                 if ($i != 0)
  266.                 {
  267.                         $to .= ", ";
  268.                 }
  269.                 $to .= $to_array[$i];
  270.             }
  271.             if ($to == "")
  272.             {
  273.                     $to = $ml_no_reciepent;
  274.             }
  275.             $short_to = cut_string($to, 50);
  276.         }
  277.  
  278.         $messages_display .= '<tr'.$class.' id="'.$mail->f('uid').'">';
  279.         $messages_display .= '<td nowrap><input type="checkbox" name="messages[]" value="'.$mail->f('uid').'" onclick="javascript:item_click(this);" /></td>';
  280.         $messages_display .= '<td nowrap>'.$priority.' </td>';
  281.         $messages_display .= '<td nowrap>'.$attachment.' </td>';
  282.         $messages_display .= '<td nowrap width="20">'.$image.'</td>';
  283.         if ($show=="from")
  284.         {
  285.             $messages_display .= "<td nowrap><a href=\"message.php?account_id=".$account['id']."&uid=".$mail->f('uid')."&mailbox=".$mailbox."&first_row=".$first_row."&return_to=".urlencode($link_back)."\" title=\"".$mail->f('from')." <".$mail->f("sender").">\">".$short_from." </a></td>";
  286.         }else
  287.         {
  288.             $messages_display .= "<td nowrap><a href=\"message.php?account_id=".$account['id']."&uid=".$mail->f('uid')."&mailbox=".$mailbox."&first_row=".$first_row."&return_to=".urlencode($link_back)."\" title=\"".$to."\">".$short_to." </a></td>";
  289.         }
  290.  
  291.         $messages_display .= "<td nowrap><a href=\"message.php?account_id=".$account['id']."&uid=".$mail->f('uid')."&mailbox=".$mailbox."&first_row=".$first_row."&return_to=".urlencode($link_back)."\" title=\"".$mail->f('subject')."\">".$short_subject." </a></td>";
  292.         $messages_display .= '<td nowrap>'.format_size($mail->f('size')).' </td>';
  293.         $messages_display .= '<td nowrap>'.date($_SESSION['GO_SESSION']['date_format'].' '.$_SESSION['GO_SESSION']['time_format'], get_time($mail->f('udate'))).'</td>';
  294.         $messages_display .= "</tr>\n";
  295.         $messages_display .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td>';
  296.         $messages_display .= "</tr>\n";
  297.  
  298.     }
  299.     $messages_display .= '<tr><td colspan="99" class="small" height="18"> '.$msg_count.' '.$ml_messages.'   ';
  300.     if ($mail->is_imap())
  301.     {
  302.         $messages_display .= '('.$unseen.' '.$ml_new.')';
  303.     }
  304.  
  305.     $messages_display .= '     '.$fbFolderSize.': '.format_size($total_size).'</td></tr>';
  306.     $messages_display .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td>';
  307.     $messages_display .= "</tr>\n";
  308.  
  309. }
  310. if ($msg_count == 0)
  311. {
  312.     $email_folder = $email->get_folder($account['id'], $mailbox);
  313.     if ($email_folder['attributes']&LATT_NOSELECT)
  314.     {
  315.         $messages_display = '<tr><td colspan="99" height="18">'.$ml_no_mailbox.'</td></tr>';
  316.     }else
  317.     {
  318.         $messages_display = '<tr><td colspan="99" height="18">'.$ml_no_messages.'</td></tr>';
  319.     }
  320.     $messages_display .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  321. }
  322.  
  323. ?>
  324. <table border="0" cellpadding="5" cellspacing="0">
  325. <tr>
  326.         <td valign="top"><?php
  327.         require("treeview.inc"); ?>
  328.         </td>
  329.         <td valign="top">
  330.         <input type="hidden" name="first_row" value="<?php echo $first_row; ?>" />
  331.         <input type="hidden" name="mailbox" value="<?php echo $mailbox; ?>" />
  332.         <input type="hidden" name="form_action" value="delete" />
  333.         <table border="0" cellspacing="0" cellpadding="0" class="Table1">
  334.         <tr>
  335.                 <td colspan="6" nowrap>
  336.  
  337.                     <?php
  338.                     if ($account['type'] == "imap" && $email->get_all_folders($account['id'],true) > 0)
  339.                     {
  340.                         $dropbox = new dropbox();
  341.                         $dropbox->add_value('', $ml_move_mail);
  342.                         if (strtolower($mailbox) != 'inbox')
  343.                         {
  344.                             $dropbox->add_value('INBOX',$ml_inbox);
  345.                         }
  346.                         while ($email->next_record())
  347.                         {
  348.                             if (!($email->f('attributes')&LATT_NOSELECT) && $email->f('name') != $mailbox)
  349.                             {
  350.                                 $dropbox->add_value($email->f('name'), $email->f('name'));
  351.                             }
  352.                         }
  353.                         $dropbox->print_dropbox('folder','','onchange="javascript:move_mail()"');
  354.  
  355.                     }else
  356.                     {
  357.                             echo ' ';
  358.                     }
  359.                     ?>
  360.  
  361.                 </td>
  362.                 <td colspan="2" align="right" class="small" nowrap>
  363.                 <?php
  364.                 echo $msg_count." ".$ml_messages;
  365.                 if ($mail->is_imap())
  366.                 {
  367.                         echo "   (".$unseen." ".$ml_new.")";
  368.                 }
  369.                 ?>
  370.                 </td>
  371.         </tr>
  372.  
  373.         <tr>
  374.                 <td class="TableHead2" width="16"><input type="checkbox" name="dummy" value="dummy" onclick="javascript:invert_selection()" /></td>
  375.                 <td class="TableHead2" width="8"> </td>
  376.                 <td class="TableHead2" width="6"> </td>
  377.                 <td class="TableHead2" width="16"> </td>
  378.                 <?php
  379.                 if ($show == "from")
  380.                 {
  381.                     echo '<td class="TableHead2" nowrap><a class="TableHead2" href="'.$_SERVER['PHP_SELF'].'?newsort='.SORTFROM.'&newreverse='.$mail_reverse.'&mailbox='.urlencode($mailbox).'">'.$ml_from;
  382.                     if ($mail_sort == SORTFROM)
  383.                     {
  384.                             echo ' '.$image_string;
  385.                     }
  386.                     echo '</a></td>';
  387.                 }else
  388.                 {
  389.                     echo '<td class="TableHead2" nowrap><a class="TableHead2" href="'.$_SERVER['PHP_SELF'].'?newsort='.SORTTO.'&newreverse='.$mail_reverse.'&mailbox='.urlencode($mailbox).'">'.$ml_to;
  390.                     if ($mail_sort == SORTTO)
  391.                     {
  392.                             echo ' '.$image_string;
  393.                     }
  394.                     echo '</a></td>';
  395.                 }
  396.                 echo '<td class="TableHead2" nowrap><a class="TableHead2" href="'.$_SERVER['PHP_SELF'].'?newsort='.SORTSUBJECT.'&newreverse='.$mail_reverse.'&mailbox='.urlencode($mailbox).'">'.$ml_subject;
  397.                 if ($mail_sort == SORTSUBJECT)
  398.                 {
  399.                     echo ' '.$image_string;
  400.                 }
  401.                 echo '</a></td>';
  402.  
  403.                 echo '<td class="TableHead2" nowrap><a class="TableHead2" href="'.$_SERVER['PHP_SELF'].'?newsort='.SORTSIZE.'&newreverse='.$mail_reverse.'&mailbox='.urlencode($mailbox).'">'.$ml_size;
  404.                 if ($mail_sort == SORTSIZE)
  405.                 {
  406.                     echo ' '.$image_string;
  407.                 }
  408.                 echo '</a></td>';
  409.  
  410.                 echo '<td class="TableHead2" nowrap><a class="TableHead2" href="'.$_SERVER['PHP_SELF'].'?newsort='.SORTDATE.'&newreverse='.$mail_reverse.'&mailbox='.urlencode($mailbox).'">'.$strDate;
  411.                 if ($mail_sort == SORTDATE)
  412.                 {
  413.                     echo ' '.$image_string;
  414.                 }
  415.                 echo '</a></td></tr>';
  416.  
  417.         echo $messages_display;
  418.  
  419. $links = '';
  420. $max_links=10;
  421. if ($max_rows != 0)
  422. {
  423.     if ($msg_count > $max_rows)
  424.     {
  425.         $links = '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>';
  426.         $next_start = $first_row+$max_rows;
  427.         $previous_start = $first_row-$max_rows;
  428.         if ($first_row != 0)
  429.         {
  430.             $links .= '<a href="'.$_SERVER['PHP_SELF'].'?mailbox='.$mailbox.'&first_row=0"><<</a> ';
  431.             $links .= '<a href="'.$_SERVER['PHP_SELF'].'?mailbox='.$mailbox.'&first_row='.$previous_start.'">'.$cmdPrevious.'</a> ';
  432.         }else
  433.         {
  434.             $links .= '<font color="#cccccc"><< '.$cmdPrevious.'</font> ';
  435.         }
  436.  
  437.         $start = ($first_row-(($max_links/2)*$max_rows));
  438.  
  439.         $end = ($first_row+(($max_links/2)*$max_rows));
  440.  
  441.         if ($start < 0)
  442.         {
  443.             $end = $end - $start;
  444.             $start=0;
  445.         }
  446.         if ($end > $msg_count)
  447.         {
  448.             $end = $msg_count;
  449.         }
  450.  
  451.         if ($start > 0)
  452.         {
  453.             $links .= '... ';
  454.         }
  455.  
  456.         for ($i=$start;$i<$end;$i+=$max_rows)
  457.         {
  458.             $page = ($i/$max_rows)+1;
  459.             if ($i==$first_row)
  460.             {
  461.                 $links .= '<b><i>'.$page.'</i></b> ';
  462.             }else
  463.             {
  464.                 $links .= '<a href="'.$_SERVER['PHP_SELF'].'?mailbox='.$mailbox.'&first_row='.$i.'">'.$page.'</a> ';
  465.             }
  466.         }
  467.  
  468.         if ($end < $msg_count)
  469.         {
  470.             $links .= '... ';
  471.         }
  472.  
  473.         $last_page = floor($msg_count/$max_rows)*$max_rows;
  474.  
  475.         if ($msg_count > $next_start)
  476.         {
  477.             $links .= '<a href="'.$_SERVER['PHP_SELF'].'?account_id='.$account['id'].'&mailbox='.$mailbox.'&first_row='.$next_start.'">'.$cmdNext.'</a> ';
  478.             $links .= '<a href="'.$_SERVER['PHP_SELF'].'?account_id='.$account['id'].'&mailbox='.$mailbox.'&first_row='.$last_page.'">>></a>';
  479.         }else
  480.         {
  481.             $links .= '<font color="#cccccc">'.$cmdNext.' >></font>';
  482.         }
  483.         $links .= '</td><td align="right"><a class="normal" href="'.$_SERVER['PHP_SELF'].'?account_id='.$account['id'].'&mailbox='.$mailbox.'&max_rows=0">'.$cmdShowAll.'</a></td></tr></table>';
  484.         echo '<tr><td colspan="99" height="20">'.$links.'</td></tr>';
  485.         echo '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  486.     }
  487.  
  488. }
  489.             echo '</table>';
  490.             ?>
  491.             </td>
  492.     </tr>
  493.     </table>
  494.  
  495.  
  496.  
  497. <script type="text/javascript">
  498. <!--
  499. function move_mail()
  500. {
  501.     document.forms[0].form_action.value = 'move';
  502.     document.forms[0].submit();
  503.  
  504. }
  505.  
  506. function invert_selection()
  507. {
  508.     for (var i=0;i<document.forms[0].elements.length;i++)
  509.     {
  510.         if(document.forms[0].elements[i].type == 'checkbox' && document.forms[0].elements[i].name != 'dummy')
  511.         {
  512.             document.forms[0].elements[i].checked = !(document.forms[0].elements[i].checked);
  513.             item_click(document.forms[0].elements[i]);
  514.         }
  515.     }
  516. }
  517.  
  518. function confirm_delete()
  519. {
  520.     var count = 0;
  521.  
  522.     for (var i=0;i<document.forms[0].elements.length;i++)
  523.     {
  524.         if(document.forms[0].elements[i].type == 'checkbox' && document.forms[0].elements[i].name != 'dummy')
  525.         {
  526.             if (document.forms[0].elements[i].checked == true)
  527.             {
  528.                 count++;
  529.  
  530.             }
  531.         }
  532.     }
  533.     switch (count)
  534.     {
  535.         case 0:
  536.             alert("<?php echo $fbNoSelect; ?>");
  537.         break;
  538.         <?php
  539.         $trash_folder = $account['trash'];
  540.         if ($trash_folder == '' || $trash_folder == $mailbox)
  541.         {
  542.             echo '
  543.                 case 1:
  544.                     if (confirm("'.$strDeletePrefix.$ml_message.$strDeleteSuffix.'"))
  545.                     {
  546.                         document.forms[0].submit();
  547.                     }
  548.                 break;
  549.  
  550.                 default:
  551.                     if (confirm("'.$strDeletePrefix.$strThis.' "+count+" '.$ml_messages2.$strDeleteSuffix.'"))
  552.                     {
  553.                         document.forms[0].submit();
  554.                     }
  555.                 break;
  556.                 ';
  557.         }else
  558.         {
  559.             echo '
  560.             default:
  561.                 document.forms[0].submit();
  562.             break;
  563.             ';
  564.         }
  565.         ?>
  566.     }
  567. }
  568.  
  569. function confirm_empty_mailbox()
  570. {
  571.     if (confirm("<?php echo $ml_confirm_empty_mailbox; ?>"))
  572.     {
  573.         document.forms[0].empty_mailbox.value='true';
  574.         document.forms[0].submit();
  575.     }
  576. }
  577.  
  578. function item_click(check_box)
  579. {
  580.     var item = get_object(check_box.value);
  581.     if (check_box.checked)
  582.     {
  583.         if (item.className == 'Table1' || item.className == 'Table5')
  584.         {
  585.             item.className = 'Table2';
  586.         }else
  587.         {
  588.             item.className = 'Table3';
  589.         }
  590.     }else
  591.     {
  592.         if (item.className == 'Table2')
  593.         {
  594.             item.className = 'Table1';
  595.         }else
  596.         {
  597.             item.className = 'Table4';
  598.         }
  599.     }
  600. }
  601.  
  602. function mark_as_read()
  603. {
  604.     document.forms[0].form_action.value = 'markread';
  605.     document.forms[0].submit();
  606.  
  607. }
  608.  
  609. function mark_as_unread()
  610. {
  611.     document.forms[0].form_action.value = 'markunread';
  612.     document.forms[0].submit();
  613.  
  614. }
  615.  
  616. //-->
  617. </script>
  618.