#!/s/std/bin/perl

$fromtext = $ARGV[0];
$totextfile = $ARGV[1];

if( !open(INPUT, "-")) {
    print STDERR "Couldn't open stdin\n";
    exit 1;
}

if( !open(OUTPUT, ">-")) {
    print STDERR "Couldn't open stdout\n";
    exit 1;
}

while(<INPUT>) {
  @fields = split /\t/;
  
  if (not @fields[1]) {
    last;
  }

  if ((@fields[1] eq "Lunch\n") or (@fields[1] eq "Break\n") or (@fields[1] eq "Continental Breakfast\n")) {
    print OUTPUT "
<tr>
  <td style=\"background-color: rgb(144, 238, 144); vertical-align: middle; white-space: nowrap;\">
    <span style=\"font-style: italic;\">@fields[0]</span><br>
  </td>
  <td style=\"vertical-align: top; background-color: rgb(144, 238, 144);\">
    <span style=\"font-style: italic;\">@fields[1]</span><br>
  </td>
</tr>\n";
  } else {
    if (not @fields[2]) {
      @fields[2] = "Condor Staff Member, TBA"
    }
    print OUTPUT "
<tr> 
  <td style=\"vertical-align: middle; white-space: nowrap;\">
    @fields[0]<br>
  </td> 
  <td style=\"vertical-align: top;\">
    <span style=\"font-style: italic; font-weight: bold;\">@fields[1]</span>
    <br>@fields[2]<br>
  </td>
</tr>\n";
  }
}

