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


<?cs def:print_hidden(s_name, s_value) ?>
 <input type="hidden" name="<?cs var:s_name ?>" value="<?cs var:s_value ?>" />
<?cs /def ?>

<?cs def:print_title(vname, value) ?>
  <tr>
    <th align="left">
      <?cs var:vname ?>
    </th>
   <td>
      <?cs var:value ?>
   </td>
  </tr>
<?cs /def ?>

<?cs def:print_desc() ?>
  <tr>
    <th align="left">
        <?cs var:lang.calendar_event_edit.desc ?>
    </th>
    <td>&nbsp;</td>
  </tr>
  <tr>
  <td>&nbsp;</td>
  <td>
    <?cs var:escaped_desc ?>
 </td></tr>
<?cs /def ?>

<?cs def:print_time(vname, time_value, time_am) ?>
  <tr>
    <th align="left">
      <?cs var:vname ?>
    </th>
   <td>
    <?cs var:time_value ?> <?cs var:lang.calendar_event_edit.ampm[time_am] ?>
   </td>
 </tr> 
<?cs /def ?>

<?cs def:print_icon() ?>
   <tr>
    <th align="left">
       <?cs var:lang.calendar_event_edit.picked ?>
     </th>
     <td>
     <?cs with:opt = lang.calendar_event_edit.imageicon[icon] ?>
           <img src="<?cs var:image_path ?><?cs var:opt ?>" style="width:12px; height:12px"  alt="" />
     <?cs /with ?>
   </td>
  </tr>
<?cs /def ?>

<?cs def:print_submit() ?>
  <tr><td colspan="2" align="center" >
   <div>
   <form method="post" action="calendar_event_action">
   <div>
   <?cs call:print_hidden("crs", Query.crs) ?>
   <?cs call:print_hidden("id", Query.id) ?>
   <?cs call:print_hidden("event_id", Query.event_id) ?>
   </div>
  <table  cellpadding="4">
   <tr>
    <th>
     <input type="submit" value="<?cs var:lang.calendar_event_edit.edit ?>" title="<?cs var:lang.calendar_event_edit.edit_help ?>" name="operE" />
     <input type="submit" value="<?cs var:lang.calendar_event_edit.delete ?>" title="<?cs var:lang.calendar_event_edit.delete_help ?>" name="operD" onclick="return window.confirm('<?cs var:lang.calendar_event_edit.delete_confirm ?>')" />
    </th>
   </tr>
  </table>
   </form>
  </div>
 </td></tr>
<?cs /def ?>
 


<?cs ###########################
     # HTML starts here
     ###########################
?>
<?cs call:html_heading() ?>
<head>
<title><?cs var:course_title ?> <?cs var:course_no ?> <?cs var:lang.calendar_event_edit.detail_page_title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="StyleSheet" href="<?cs var:image_path ?>calendar_style.css" type="text/css"  />
<link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
<?cs if:delete_success ?>
   <script type="text/javascript">
   function dothis()
   {
      opener.parent.location.reload();
          window.close();
   }
   </script>
<?cs /if ?>
</head>

<?cs call:define_body() ?> 
   <?cs call:course_info() ?>
   <div>   
    <?cs if:delete_success ?>
     <a href="javascript:dothis()" title="<?cs var:lang.calendar_event_edit.closewindow ?>" >
    <?cs else ?>
     <a href="javascript:window.close()" title="<?cs var:lang.calendar_event_edit.closewindow ?>" >
    <?cs /if ?>
      <img src="<?cs var:image_path ?>close.gif" alt="<?cs var:lang.calendar_event_edit.closewindow ?>" /></a>
   </div>
<div>
<br />
<br />
</div>
<?cs if:delete_success ?>
<fieldset style="width:90%">
<legend class="fieldset_legend">
  <?cs var:lang.calendar_event_edit.delete_success_msg ?>
</legend>
  <div class="instructions"><?cs var:lang.calendar_event_edit.delete_success_instruction ?></div>
</fieldset>
<?cs else ?>
<fieldset style="width:90%">
<legend class="fieldset_legend">
   <?cs var:lang.calendar_event_edit.detail_page_title ?>
</legend>
  <table width="100%">
  <tr><td align="center">
    <table  border="0" cellpadding="4" >
      <?cs call:print_title(lang.calendar_event_edit.date, event_date) ?>
      <?cs call:print_title(lang.calendar_event_edit.title, escaped_title) ?>
      <?cs call:print_desc() ?>
      <?cs call:print_time(lang.calendar_event_edit.start, event_start, event_start_am) ?>
      <?cs if:!no_end_time ?>
      <?cs call:print_time(lang.calendar_event_edit.end, event_end, event_end_am) ?>
      <?cs /if ?>
      <?cs call:print_icon() ?>
    <?cs if:submit_button ?>
      <?cs call:print_submit() ?>
    <?cs /if ?>
    </table>
  </td></tr>
 </table>
</fieldset>
<?cs /if ?>
</body>
</html>
<?cs call:runtime() ?>
