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

<?cs set:color.0 = "#FFCC00" ?>
<?cs set:color.1 = "#99FFCC" ?>
<?cs set:color.2 = "#99CCFF" ?>
<?cs set:color.3 = "#FF9999" ?>


<?cs set:highlight.0 = "#FFFFDD" ?>
<?cs set:highlight.1 = "#DDFFDD" ?>
<?cs set:highlight.2 = "#DDFFFF" ?>
<?cs set:highlight.3 = "#FFEEEE" ?>



<?cs def:personal_info_link() ?>
<span style="padding: 0.5em; background-color: #ffc;"><a href="<?cs var:bio_url ?>" title="<?cs var:lang.mymanhattan.bio_title ?>"
onclick="newwin=window.open('<?cs var:bio_url ?>','bio','menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false"><?cs var:lang.mymanhattan.bio ?></a></span>
<?cs /def ?>

<?cs def:print_days_hours_left() ?>
<?cs if:Query.expire ?>
  <?cs if:expire.days < 7 ?>
  <span style="color:#f00; background-color: #ffc; padding: 0.5em">
  <?cs else ?>
  <span style="background-color: #ffc; padding: 0.5em">
  <?cs /if ?> 
   Your password will expire in  <?cs var:expire.days ?> <?cs if:expire.days > 1 ?>days <?cs else ?>day <?cs /if ?> <?cs var:expire.hours ?> <?cs if:expire.hours > 1 ?>hours <?cs else ?>hour <?cs /if ?> <?cs var:expire.minutes ?> <?cs if:expire.minutes > 1 ?>minutes. <?cs else ?>minute.<?cs /if ?> <span style="font-size:10px">(<a href="javascript:loginhelpwin=window.open('http://www1.wnec.edu/oit/faq/?selection=doc.5320#149', 'newwin', 'menubar=0,toolbar=1,status=0,scrollbars=yes,resizable=1,width=600,height=500'); loginhelpwin.focus()" >What does this mean?</a>)</span>

  <?cs if:expire.days < 7 ?>
  &nbsp;&nbsp;Please click <a href="javascript:passwordwin=window.open('http://www1.wnec.edu/oit/index.cfm?selection=doc.3306', 'newwin', 'menubar=0,toolbar=1,status=0,scrollbars=yes,resizable=1,width=600,height=500'); passwordwin.focus()" > here </a> to change your password!!!
  <?cs /if ?>
   </span>
  &nbsp;&nbsp;
<?cs /if ?>
<?cs /def ?>

<?cs def:print_links() ?>
 <div style="text-align: right; font-weight: bold;  padding: 0.5em;">
 <?cs call:print_days_hours_left() ?>
   <?cs if:password_url ?>
     <span style="padding: 0.5em; background-color: #ffc;"><a href="<?cs var:password_url ?>" title="<?cs var:lang.mymanhattan.change_password_title ?>"><?cs var:lang.mymanhattan.change_password ?></a></span>
   <?cs /if ?>
   <?cs call:personal_info_link() ?>
   <?cs if:wnec_course_request_url ?>
    <span style="padding: 0.5em; background-color: #ffc;"><a href="<?cs var:wnec_course_request_url ?>" title="Request a Manhattan Classroom"
      onclick="newwin=window.open('<?cs var:wnec_course_request_url ?>','request_course','menubar=yes,toolbar=no,status=no,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false">
       Request Classroom</a></span>
   <?cs /if ?>
   <span style="padding: 0.5em; background-color: #ffc;"><a href="<?cs var:logout_url ?>" title="<?cs var:lang.mymanhattan.logout_title ?>"><?cs var:lang.mymanhattan.logout ?></a></span>
</div>
<?cs /def ?>







<?cs def:print_semester_heading(group, count) ?>


<tr>
<?cs # put up arrow  ?>
<td>
<?cs if:count == #0 ?>
<img src="<?cs var:image_path ?>spacer.gif" width="16" height="16" alt="" />
<?cs else ?>
<a href="mymanhat_semester_order?id=<?cs var:key ?>&amp;item=<?cs var:item_count ?>&amp;up=1" title="<?cs var:lang.mymanhattan.move_up_title ?>">
   <img src="<?cs var:image_path ?>uparrow.gif"  width="16" height="16" alt="<?cs var:lang.mymanhattan.move_up_title ?>" />
</a>
<?cs /if ?>
</td>

<?cs #print semester ?>
<?cs set:color_index = count % #4 ?>
<td align="left" colspan="4"><div style="background-color:<?cs var:color[color_index]?>;"><b><?cs var:group.semester ?></b><?cs if:!group.unread_msgs_checked ?> <i><?cs var:lang.mymanhattan.not_checking_unread ?></i><?cs /if ?></div></td>

<?cs # put down arrow  ?>
<td>
<?cs if:item_count == semester_count ?>
<img src="<?cs var:image_path ?>spacer.gif" width="16" height="16" alt="" />
<?cs else ?>
<a href="mymanhat_semester_order?id=<?cs var:key ?>&amp;item=<?cs var:item_count ?>" title="<?cs var:lang.mymanhattan.move_down_title ?>">
   <img src="<?cs var:image_path ?>downarrow.gif" width="16" height="16" alt="<?cs var:lang.mymanhattan.move_down_title ?>" />
</a>
<?cs /if ?>
</td>
</tr>

<?cs /def ?>







<?cs def:print_one_crs(crs, unread_checked) ?>
<tr>
<td>&nbsp;</td>
<td <?cs if:unread_checked ?>style="background-color:<?cs var:highlight[color_index] ?>;"<?cs /if ?> >

<?cs if:crs.classroom_locked ?>
<img src="<?cs var:image_path ?>lock.gif" title="<?cs var:lang.mymanhattan.classroom_locked?>" alt="<?cs var:lang.mymanhattan.classroom_locked ?>"  />
<?cs else ?>
<img src="<?cs var:image_path ?>spacer.gif"  alt="" width="16" height="16" />
<?cs /if ?>

<?cs if:crs.unread ?>
<img src="<?cs var:image_path ?>redstar.gif" title="<?cs var:lang.mymanhattan.redstar_title ?>" alt="<?cs var:lang.mymanhattan.redstar_title ?>" /><?cs if:crs.unread_postoffice ?><span title="<?cs var:lang.mymanhattan.unread_postoffice ?>" style="color:red; font-weight:bold">!</font><?cs /if ?>
<?cs else ?>
 &nbsp;
<?cs /if ?>

<a href="<?cs var:crs.url ?><?cs if:Query.expire ?>&expire=<?cs var:Query.expire ?><?cs /if ?>" title="<?cs var:lang.mymanhattan.enter_prompt ?> <?cs var:crs.title ?> "><?cs var:crs.course_no ?></a>
</td>
<td <?cs if:unread_checked ?>style="background-color:<?cs var:highlight[color_index] ?>;"<?cs /if ?> ><b><?cs var:crs.title ?></b></td>
<td <?cs if:unread_checked ?>style="background-color:<?cs var:highlight[color_index] ?>;"<?cs /if ?> ><i><?cs var:crs.instructor ?></i></td>

<?cs # print access rights - see global.h in the 'src' directory of your distribution ACCESS_ALL for clues ?>  
<td><span style="background-color:#ffff33"><?cs var:lang.mymanhattan.access[crs.access]?></span></td>
<td>&nbsp;</td> 
</tr>
<?cs /def ?>



<?cs def:one_semester(group, count) ?>
<?cs set:color_index = count % #4 ?>
<?cs set:item_count = count + #1 ?>
<?cs if:count != 0 ?><tr><td colspan="6">&nbsp;</td></tr><?cs /if ?>
  <tr><td colspan="6">
    <?cs if:group.unread_msgs_checked ?>
        <fieldset width="100%" style="background-color:<?cs var:highlight[color_index] ?>" >
           <legend style="background-color:#000000; color:<?cs var:highlight[color_index] ?>; font-weight:bold; font-size:13px;"><?cs var:lang.mymanhattan.redstar_label ?></legend>
     <?cs else ?>
         <fieldset width="100%">
           <legend><a href="mymanhat_semester_order?id=<?cs var:key ?>&amp;item=<?cs var:item_count ?>&amp;check_unread=1" title="<?cs var:lang.mymanhattan.check_unread_title ?>"><?cs var:lang.mymanhattan.check_unread_link ?></a></legend>
    <?cs /if ?>
  <table border = "0" width="100%" >
<?cs call:print_semester_heading(group, count) ?>
<?cs each:crs=group.course ?>
<?cs call:print_one_crs(crs, group.unread_msgs_checked) ?>
<?cs /each ?>
  </table>
 </fieldset>
  </td>
  </tr>


<?cs /def ?>








<?cs call:html_heading() ?>
<head>
<title><?cs var:lang.mymanhattan.page_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"  />
</head>

<?cs call:define_body() ?>
<?cs call:print_links() ?>

<?cs # show last login information if this is first visit to this page ?>
<div style="clear: right">
<?cs if:Query.host ?>
<table width="100%" border="0">
<tr><td align="center">
<table  border="0" cellspacing="10" >
<tr>
<td><img src="<?cs var:image_path ?>attach_locked.gif" alt="" height="63" width="80"></td>
<td class="small" valign="top" align="center">
      <?cs var:lang.mymanhattan.current_time_prompt ?><br />
      <b><?cs var:current_time ?></b><br />
      <?cs var:lang.mymanhattan.current_host_prompt ?><br />
      <b><?cs var:remote_host ?></b>
</td>
<?cs if:last_login_time ?>
<td class="small" valign="top" align="center">
   <?cs var:lang.mymanhattan.last_login_prompt ?><br />
   <b><?cs var:last_login_time ?></b><br />
   <?cs var:lang.mymanhattan.last_host_prompt  ?><br />
   <b><?cs var:last_login_host  ?></b>
</td>
<?cs else ?>
<td class="small" align="center">
   <?cs var:lang.mymanhattan.welcome_msg ?>
</td>
<?cs /if ?>
</tr>
</table>
</td></tr></table>
<?cs /if ?>

<!-- center entire page within a table element  -->
<table width="100%" border="0">
<tr><td align="center">


<?cs #list surveys, if any ?>
<?cs if:survey.0.url ?>
<fieldset style="width:35%">
<legend class="fieldset_legend"><?cs var:lang.mymanhattan.survey_heading ?></legend>
<?cs each:this = survey ?>
<div style="text-align:left; padding:4px"> <a href="<?cs var:this.url  ?>" title="<?cs var:lang.mymanhattan.enter_survey ?>"><?cs var:this.title  ?></a></div>
<?cs /each ?>
</fieldset>
<?cs /if ?>



<?cs # list courses ?>
<table cellpadding="1" border="0" >
<tr><td align="right"><span style="font-size:14pt; font-weight:bold;"><?cs var:realname  ?></span></td></tr>

<?cs set:count = #0 ?>
<?cs each:group = item ?>
<?cs call:one_semester(group, count) ?>
<?cs set:count = count + #1  ?>
<?cs /each ?>     
</table>

<!-- end centering of entire page -->
</td>
</tr>
</table>
</div>
</body></html>
<?cs call:runtime() ?>
