<?cs include:"util.cs" ?>

<?cs ### This template supports both post_read_inbox.c AND post_read_outbox.c  ### ?>


<?cs def:print_font_selector() ?>
<?cs with:lang=lang.post_read ?>
 <div class="font_selector" >
  <?cs if:fixed_font ?>
     <a href="<?cs if:is_inbox ?>post_read_inbox<?cs else ?>post_read_outbox<?cs /if ?>?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?>" title="<?cs var:lang.print_proportional_title ?>"><?cs var:lang.print_proportional_label ?></a>/<?cs var:lang.print_fixed_label ?>
  <?cs else ?>
     <?cs var:lang.print_proportional_label ?>/<a href="<?cs if:is_inbox ?>post_read_inbox<?cs else ?>post_read_outbox<?cs /if ?>?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?>&amp;fixed=1" title="<?cs var:lang.print_fixed_title ?>"><?cs var:lang.print_fixed_label ?></a>
  <?cs /if ?>   
 </div>
<?cs /with ?>
<?cs /def ?>

<?cs def:print_commands() ?>
<?cs with:lang=lang.post_read ?>
<table width="100%">
<tr><td align="center">
<table cellspacing="0" cellpadding="0">
<tr>
<td rowspan="3"><a href="<?cs var:back_url ?>" title=<?cs if:is_inbox ?>"<?cs var:lang.inbox_back_button_title ?>"<?cs else ?>"<?cs var:lang.outbox_back_button_title ?>"<?cs /if ?>><img src="<?cs var:image_path ?>back_arrow.gif" width="50" height="34" alt=<?cs if:is_inbox ?>"<?cs var:lang.inbox_back_button_title ?>"<?cs else ?>"<?cs var:lang.outbox_back_button_title ?>"<?cs /if ?> /></a></td>
<td><a href="<?cs var:post_inbox_url ?>" title="<?cs var:lang.goto_inbox_title ?>"><img src="<?cs var:image_path ?>goto_inbox_sm.gif"  alt="<?cs var:lang.goto_inbox_title ?>" width="135" height="17" /></a></td>
<td><a href="<?cs var:post_outbox_url ?>" title="<?cs var:lang.goto_outbox_title ?>"><img src="<?cs var:image_path ?>goto_outbox_sm.gif"  alt="<?cs var:lang.goto_outbox_title ?>" width="135" height="17" /></a></td>
<td><a href="<?cs var:main_menu_url ?>" title="<?cs var:lang.goto_main_title ?>" ><img src="<?cs var:image_path ?>main_menu_sm.gif"  alt="<?cs var:lang.goto_main_title ?>" width="135" height="17" /></a></td>
<td><a href="<?cs if:is_inbox ?>post_read_inbox<?cs else ?>post_read_outbox<?cs /if ?>?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:fixed_font ?>&amp;fixed=1<?cs /if ?>&amp;print=1" title="<?cs var:lang.print_title ?>" onclick="newwin=window.open('<?cs if:is_inbox ?>post_read_inbox<?cs else ?>post_read_outbox<?cs /if ?>?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:fixed_font ?>&amp;fixed=1<?cs /if ?>&amp;print=1','print','menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false"><img src="<?cs var:image_path ?>print_sm.gif" width="135" height="17" alt="<?cs var:lang.print_title ?>" /></a></td>
</tr>
<tr>
<?cs if:can_write && new_memo_url ?>
<td><a href="<?cs var:new_memo_url ?>" title="<?cs var:lang.new_memo_title ?>"><img src="<?cs var:image_path ?>new_memo_sm.gif"  alt="<?cs var:lang.new_memo_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>new_memo_sm.gif"  alt="" width="135" height="17" /></td>
<?cs /if ?>
<?cs if:can_write && reply_url ?>
<td><a href="<?cs var:reply_url ?>" title="<?cs var:lang.reply_title ?>" ><img src="<?cs var:image_path ?>reply_sm.gif" alt="<?cs var:lang.reply_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><?cs if:is_inbox ?><img src="<?cs var:image_path ?>reply_sm.gif" alt="" width="135" height="17" /><?cs else ?><img src="<?cs var:image_path ?>gr_reply_sm.gif"  alt="" width="135" height="17" /><?cs /if ?></td>
<?cs /if ?>
<?cs if:can_write && group_reply_url ?>
<td><a href="<?cs var:group_reply_url ?>" title="<?cs var:lang.group_reply_title ?>" ><img src="<?cs var:image_path ?>group_reply_sm.gif"  alt="<?cs var:lang.group_reply_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>gr_group_reply_sm.gif"  alt="" width="135" height="17" /></td>
<?cs /if ?>
<?cs if:can_write && forward_url ?>
<td><a href="<?cs var:forward_url ?>" title="<?cs var:lang.forward_title ?>" ><img src="<?cs var:image_path ?>forward_sm.gif"  alt="<?cs var:lang.forward_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>forward_sm.gif"  alt="<?cs var:data.forward_help ?>" width="135" height="17" /></td>
<?cs /if ?>
</tr>
<tr>
<?cs if:can_write && delete_url ?>
<td><a href="<?cs var:delete_url ?>" title=<?cs if:is_inbox ?>"<?cs var:lang.inbox_delete_title ?>"<?cs else ?>"<?cs var:lang.outbox_delete_title ?>"<?cs /if ?> onclick="return confirm_delete()" ><img src="<?cs var:image_path ?>delete_sm.gif"  alt=<?cs if:is_inbox ?>"<?cs var:lang.inbox_delete_title ?>"<?cs else ?>"<?cs var:lang.outbox_delete_title ?>"<?cs /if ?> width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>delete_sm.gif"  alt="" width="135" height="17" /></td>
<?cs /if ?>
<?cs if:prev_msg_url ?>
<td><a href="<?cs var:prev_msg_url ?>" title="<?cs var:lang.read_previous_title ?>"><img src="<?cs var:image_path ?>previous_sm.gif" alt="<?cs var:lang.read_previous_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>gr_previous_sm.gif" alt="" width="135" height="17" /></td>
<?cs /if ?>
<?cs if:next_msg_url ?>
<td><a href="<?cs var:next_msg_url ?>" title="<?cs var:lang.read_next_title ?>" ><img src="<?cs var:image_path ?>next_sm.gif"  alt="<?cs var:lang.read_next_title ?>" width="135" height="17" /></a></td>
<?cs else ?>
<td><img src="<?cs var:image_path ?>gr_next_sm.gif"  alt="" width="135" height="17" /></td>
<?cs /if ?>
<td><a href="<?cs var:info_url ?>" title=<?cs if:is_inbox ?>"<?cs var:lang.inbox_info_title ?>"<?cs else ?>"<?cs var:lang.outbox_info_title ?>"<?cs /if ?> ><img src="<?cs var:image_path ?>info_sm.gif"  alt=<?cs if:is_inbox ?>"<?cs var:lang.inbox_info_title ?>"<?cs else ?>"<?cs var:lang.outbox_info_title ?>" <?cs /if ?> width="135" height="17" /></a></td>
</tr>
</table>
</td></tr>
</table>
<?cs /with ?>
<?cs /def ?>




<?cs def:print_recipients(label, count, list) ?>
<tr><td valign="top"><b><?cs var:label ?></b></td>
<td><?cs if:count ?><?cs loop:i=#0, count - #1, #1 ?><?cs if:i ?><?cs if:(i % 4) ?>, <?cs else ?>,<br /><?cs /if ?><?cs /if ?><?cs var:list[i] ?><?cs /loop ?><?cs /if ?></td>
</tr>
<?cs /def ?>



<?cs def:wimpy_button(file_number, wimpy_button_url) ?>
<?cs if:ENABLE_WIMPY_PODCAST_PLAYER ?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0"
 width="18" height="18" id="wimpy_button_<?cs var:file_number ?>" name="wimpy_button<?cs var:file_number ?>">
	<param name=movie value="<?cs var:wimpy_button_url ?>">
	<param name=quality value=high>
	<param name=wmode value=transparent>
	<embed src="<?cs var:wimpy_button_url ?>" quality=high width="18" height="18" name="wimpy_button<?cs var:file_number ?>"
 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>
<?cs else ?>
  <a href="javascript:window.open('<?cs var:wimpy_button_url ?>','litenewwin','resizable=yes,width=250,height=200,top=50,left=50,scrollbars=yes,toolbar=no'); newwin.focus()" ><img  src="<?cs var:image_path ?>Volume16.gif" /></a>
  <?cs /if ?>
<?cs /def ?>





<?cs def:file_attachments() ?>
<div style="margin-top:1em">
<table border="0">
<tr>
<td valign="top"><b><?cs var:lang.attachments_label ?></b></td>
<td><?cs if:msg.attachments ?><?cs loop:i=#0, msg.attachments - #1, #1 ?><?cs if:i ?><?cs if:(i % 4) ?>,&nbsp;&nbsp;&nbsp;<?cs else ?>,<br /><?cs /if ?><?cs /if ?><?cs if:!printer_friendly ?><a href="<?cs var:msg.file[i].url ?>" ><?cs /if ?><?cs var:msg.file[i].orig_fname ?><?cs if:!printer_friendly ?></a><?cs /if ?><?cs if:!printer_friendly && msg.file[i].wimpy_button_url ?><?cs call:wimpy_button(i,msg.file[i].wimpy_button_url) ?><?cs /if ?><?cs /loop ?><?cs /if ?></td>
</tr>
</table>
</div>
<?cs /def ?>

<?cs def:attached_website() ?>
<div style="margin-top:1em">
 <?cs if:printer_friendly ?>
    <form action="">
        <input type="button" value="<?cs var:lang.view_website_button_title ?>" />
    </form>
 <?cs elif:capture_mode ?>
    <a href="<?cs var:msg.website_url ?>" title="<?cs var:lang.view_website_button_title ?>" ><?cs var:lang.view_website_button ?></a>
<?cs else ?>
    <form method="post" action="web_page_start">
    <div>
    <input type="hidden" name="crs" value="<?cs var:crs ?>" />
    <input type="hidden" name="id" value="<?cs var:key ?>" />
    <input type="hidden" name="sender" value="<?cs var:msg.sender ?>" />
    <input type="hidden" name="inf" value="<?cs var:msg.info_fname ?>" />
    <input type="hidden" name="loc" value="<?cs var:msg.offset ?>" />
    <input type="hidden" name="grp" value="9" />
    <input type="hidden" name="read" value="1" />
    <input type="hidden" name="from" value=<?cs if:is_inbox ?>"post_read_inbox"<?cs else ?>"post_read_outbox"<?cs /if ?> />
    <?cs if:is_inbox ?><input type="hidden" name="inbox" value="yes" /><?cs /if ?>
    <input type="submit" value="<?cs var:lang.view_website_button ?>" title="<?cs var:lang.view_website_button_title ?>" />
    </div>
    </form>
<?cs /if ?>
</div>
<?cs /def ?>







<?cs def:print_message_header() ?>
<?cs with:lang=lang.post_read ?>
<fieldset style="width:70%">
<legend class="fieldset_legend">
<?cs var:course_no ?> <?cs if:is_inbox ?><?cs var:lang.inbox_name ?><?cs else ?><?cs var:lang.outbox_name ?><?cs /if ?>
</legend>
<table border="0">
<tr><td class="message_header">
<b><?cs var:lang.posted_by_label ?></b>  
<?cs if:!printer_friendly && user[0].url ?>
   <a href="<?cs var:user[0].url ?>" title="<?cs var:lang.read_bio_title ?>"  onclick="newwin=window.open('<?cs var:user[0].url ?>','bio','menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false"><?cs var:msg.sender_realname ?></a>
<?cs else ?>
  <?cs var:msg.sender_realname ?>
<?cs /if ?>
<br />
<b><?cs var:lang.posted_date_label ?></b> <?cs var:msg.time_sent ?><br />
<b><?cs var:lang.subject_label ?></b> <?cs var:msg.escaped_subject ?>
<table border="0" cellspacing="0">
<?cs call:print_recipients(lang.to_label, msg.to_count, msg.to) ?>
<?cs if:msg.cc_count ?><?cs call:print_recipients(lang.cc_label, msg.cc_count, msg.cc) ?><?cs /if ?>
</table>
</td>
</tr>
</table>
</fieldset>
<?cs if:msg.website_attached ?>
    <?cs call:attached_website() ?>
<?cs elif:msg.attachments ?>
     <?cs call:file_attachments() ?>
<?cs /if ?>
<?cs /with ?>
<?cs /def ?>


<?cs def:print_message_body() ?>
<?cs if:fixed_font ?>
<div>
<pre>
<?cs each:row=line ?><?cs var:row.content ?>
<?cs /each ?>
</pre>
</div>
<?cs else ?>
<div style="text-indent:4em; margin-top:2em">
<?cs each:row=line ?><div class="reply_level<?cs var:row.reply_level % #6 ?>"><?cs var:row.content ?></div>
<?cs /each ?>
</div>
<?cs /if ?>
<?cs /def ?>


<?cs def:insert_clipboard_copy_form() ?>
<form action="">
  <div>
  <input name="newwin" type="button" value="<?cs var:lang.post_read.clipboard_copy_button ?>"
   title="<?cs var:lang.post_read.clipboard_copy_button_title ?>"
   onclick="window.open('<?cs var:clipboard_url ?>','newwin','resizable=yes,width=350,height=275,top=50,left=50')" />
  </div>
</form>
<?cs /def ?>

<?cs call:html_heading() ?>
<head>
<title><?cs var:course_title ?> <?cs if:is_inbox ?><?cs var:lang.post_read.inbox_title ?><?cs else ?><?cs var:lang.post_read.outbox_title ?><?cs /if ?></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"  />
<script type="text/javascript">
  function confirm_delete()
  {
     return window.confirm('<?cs var:lang.post_read.delete_msg_confirm ?>');
  }
  </script>
</head>
<?cs call:define_body() ?>

<?cs if:!printer_friendly ?>
 <?cs call:print_commands() ?>
<?cs /if ?>

<?cs call:print_message_header() ?>

<?cs if:!printer_friendly ?>
  <?cs call:print_font_selector() ?>
<?cs /if ?>
<?cs call:print_message_body() ?>
<?cs if:!printer_friendly && is_faculty && !capture_mode ?>
<hr style="width:300px" />
 <div class="center_msg">
<?cs call:insert_clipboard_copy_form() ?>
</div>
<?cs /if ?>
</body>
</html>
<?cs call:runtime() ?> 
