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

<?cs def:roster_not_available_error() ?>
<table border="0" width="100%">
<tr>
<td align="center">
 <table border="0">
 <tr>
   <td align="center"><img src="<?cs var:image_path ?>error_checklist.gif" alt=" " /></td>
   <td align="center" valign="middle">
                   <?cs var:lang.admin_add_course_form.no_roster_available ?>
   </td>
 </tr>
 </table>
</td>
</tr>
</table>
<?cs /def ?>



<?cs call:html_heading() ?>
<head>
    <title><?cs var:lang.admin_add_course_form.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"  />
    <script type="text/javascript" src="<?cs var:image_path ?>form_validation.js"></script>
    <script>
      function check_radio()
      {
         var x = 0;
         var check_count = 0;
         var inputtype = document.forms[0].roster_path;
        
        if(document.forms[0].roster_path.checked)
        {
              check_count++;
        }
     else
     {       
         for(i = 0; i<inputtype.length; i++)
         {
                  if(inputtype[i].checked)
                       check_count++;
         }
     }
        if(!check_count)
        {
          window.alert('<?cs var:lang.admin_add_course_form.select_one_division ?>');
          return false;
        }
        else 
          return true;
        
   
      }
    </script>
  </head>

<body>
  <?cs call:course_info() ?>
  <div>
  <a href="javascript:window.close()" title="<?cs var:lang.admin_add_course_form.closewindow ?>">
  <img src="<?cs var:image_path ?>close.gif" alt="<?cs var:lang.admin_add_course_form.closewindow ?>" /></a>
  </div>
  <br />
  <br />
  <?cs if:roster_not_available ?>
    <?cs call:roster_not_available_error() ?>
  <?cs else ?>
  <table width="100%">
  <tr><td align="center">
  
      
  
  <fieldset style="width:70%" class="instructions">
    <?cs var:lang.admin_add_course_form.not_for_combined_sections ?>
  </fieldset>

  <fieldset style="width:70%">
  <legend class="fieldset_legend"><?cs var:lang.admin_add_course_form.title ?>
  </legend>
  <div>
    <form method="post" action="admin_get_course_list" onsubmit="return check_radio()" ?>
    <div>
     <input type="hidden" name="id" value="<?cs var:id ?>" />
    </div> 
  <table cellspacing="0" cellpadding="4" border="1">
    <tr class="table_heading">
        <?cs each:this = lang.admin_add_course_form.table ?>
         <th><?cs var:this ?></th>
        <?cs /each ?>
    </tr>
    <?cs each:data = file ?>
    <tr>
        <td><input type="radio" name="roster_path" value="<?cs var:data.name ?>:<?cs var:data.division ?>" title="<?cs var:lang.admin_add_course_form.select_help ?>" /></td>
        <td><?cs var:data.term ?></td>
        <td><?cs var:data.year ?></td>
        <td><?cs var:data.time ?></td>
    </tr>
    <?cs /each ?>
    <tr>
       <td colspan="5" align="center">
       <input type="submit" value="<?cs var:lang.admin_add_course_form.submit ?>" title="<?cs var:lang.admin_add_course_form.submit_help ?>" />
       </td>
    </tr>
  </table>
   </form>
  </div>
  </fieldset>
  </td></tr>
  </table>
 <?cs /if ?>
</body>
</html>
<?cs call:runtime() ?>
