<?cs include:"util.cs" ?>
	
<?cs def:enter_chat_button() ?><?cs if:enter_chat_url ?><a href="javascript:openwindow('<?cs var:enter_chat_url ?>', 'chatwindow')" title="<?cs var:lang.enter_chat_help ?>" ><img src="<?cs var:image_path ?>chat_enter.gif" width="50" height="34" alt="<?cs var:lang.enter_chat_help ?>" /></a><?cs else ?><img src="<?cs var:image_path ?>chat_enter.gif" width="50" height="34" alt="<?cs var:lang.command_disabled ?>" title="<?cs var:lang.command_disabled ?>" /><?cs /if ?><?cs /def ?>


<?cs def:list_transcript_index() ?>
<?cs with:lang=lang.chat_transcript ?>
<table width="100%">
<tr><td align="center">
  <div>
  <a href="<?cs var:main_menu_url ?>" title="<?cs var:lang.main_help ?>" ><img src="<?cs var:image_path ?>main.gif" width="50" height="34" alt="<?cs var:lang.main_help ?>" /></a><img src="<?cs var:image_path ?>chat_label.gif" width="200" height="34" alt="<?cs var:lang.chat_label_title ?>" title="<?cs var:lang.chat_label_title ?>" /><?cs call:enter_chat_button() ?>
 </div>
 <div>
   <?cs if:sort_order_url ?>
     <a href="<?cs var:sort_order_url ?>" title="<?cs var:lang.sort_help ?>" ><img src="<?cs var:image_path ?>newest_sm.gif" alt="<?cs var:lang.sort_help ?>" /></a>
   <?cs /if ?>
 </div>
 <?cs if:!single_day ?>
 <div style="margin-bottom: 1em"><i><?cs var:lang.private_channel_notice ?></i></div>
 <?cs /if ?>


 <span class="alert_color"><?cs var:lang.title ?></span>
     <table cellspacing="0" cellpadding="4">
        <?cs each:this = day ?>
         <tr>
            <td class="regheading"><?cs var:this.date ?></td>
            <td>(<?cs var:this.msg_count ?> <?cs if:this.msg_count == #1 ?><?cs var:lang.message ?><?cs else ?><?cs var:lang.messages ?><?cs /if ?>)</td>
            <td><a href="<?cs var:this.read_url ?>" title="<?cs var:lang.read_link_help ?> <?cs var:this.date ?>" ><?cs var:lang.read_link ?></a></td>
         
         </tr>
        <?cs /each ?> 
     </table>
 </td></tr>
</table>
<?cs /with ?>
<?cs /def ?>





<?cs def:list_transcript() ?>
<?cs call:print_course_heading(back_url, lang.chat_transcript.goback) ?>
<?cs with:lang=lang.chat_transcript ?>
<div class="center_msg"><span class="alert_color"><?cs var:lang.title ?>: <?cs var:day_string ?></span></div>
<table width="100%">
 <tr><td align="center">
  <table cellspacing="0" cellpadding="4">
   <?cs each:this = msg ?>
     <tr>
         <td>
          <?cs if:this.delete_url ?>
          <a href="<?cs var:this.delete_url ?>"  title="<?cs var:lang.delete_link_help ?>" onclick="return confirm_delete()" ><?cs var:lang.delete_link ?></a>
         <?cs else ?>
          &nbsp;&nbsp; 
          <?cs /if ?>
         </td>
         <td><?cs var:this.time ?></td>
         <td class="regheading"><?cs var:this.sender ?></td>
         <td><?cs var:this.msg ?></td>
     </tr>
   <?cs /each ?>
  </table> 
 </td></tr>
 </table>
<?cs /with ?>
<?cs /def ?>




<?cs call:html_heading() ?>
<head>
<title><?cs var:course_no ?> <?cs var:lang.chat_transcript.title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />

<?cs if:allow_deletions ?>
<script type="text/javascript">
   function confirm_delete()
   {
     return window.confirm('<?cs var:lang.chat_transcript.confirm ?>');
   }
</script>
 <?cs /if ?>

<?cs if:single_day == #0 ?>
<script type="text/javascript">
 function openwindow(some_url,winname)
  {
    var new_window = window.open(some_url, winname,'menubar=0,toolbar=0,status=0,scrollbars=yes,resizable=yes,width=675,height=600');
    new_window.focus();
  }
</script>
<?cs /if ?>
 
</head>
<?cs call:define_body() ?>

<?cs if:single_day == #0 ?>
  <?cs call:list_transcript_index() ?>
<?cs else ?>
  <?cs call:list_transcript() ?>
<?cs /if ?>

</body>
</html>
<?cs call:runtime() ?> 
