#!/usr/bin/perl -s

$title = "Centralized Conferencing (XCON) - IETF 60 Agenda";

if ($t)
{
  print "Content-Type: text/plain\n\n";
  print "$title\n\n";
  print "CHAIRS: Alan Johnston <alan.johnston\@mci.com>\n".
        "        Adam Roach <adam\@dynamicsoft.com>\n\n";
}
else
{
print
  "Content-Type: text/html\n".
  "\n".
  "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n".
  "<BODY>\n".
  "<H1>$title</h1>\n".
  "\n".
  "<pre>\n".
  "\n".
  "CHAIRS: Alan Johnston &lt;alan.johnston&#64;mci.com>\n".
  "        Adam Roach &lt;adam&#64;dynamicsoft.com>\n".
  "\n".
  "</pre>\n";
}

foreach $entry (<DATA>)
{
  chop;
  ($time, $name, $topic, $drafts, $presentations) = split(';', $entry);
  if ($time && !$topic)
  {
    if ($t)
    {
      print "\n$name==============================\n\n";
    }
    else
    {
      if ($tod)
      {
        print "</TABLE></CENTER><p>\n";
      }
      print 
      "<h3>$name</h3>\n".
      "<CENTER><TABLE border=1>\n".
      "<TR>\n".
      "  <TH>Time</TH>\n".
      "  <TH>Length</TH>\n".
      "  <TH>Discussion Leader</TH>\n".
      "  <TH>Topic</TH>\n".
      "  <TH>Draft</TH>\n".
      "  <TH>Slides</TH>\n";
    }
    $tod = $time;
    next;
  }
  @drafts = split(',', $drafts);
  @presentations = split(',', $presentations);
  $start = $tod;
  $h = int($tod / 100);
  $m = $tod % 100;
  $m += $time;
  $h += int($m / 60);
  $m %= 60;
  $tod = $h*100 + $m;
  if ($t)
  {
    printf ("%4.4d - %4.4d  $topic\n", $start, $tod);
    print "             $name ($time minutes)\n";
    foreach $draft(@drafts)
    {
      print "             $draft\n";
    }
    print "\n";
  }
  else
  {
    foreach $draft (@drafts)
    {
      $draft =~ s/(.*)/<a href="\/xcon\/drafts\/$1">$1<\/a>/;
    }
    foreach $presentation (@presentations)
    {
      $presentation =~ s/([^.]*)\.(.*)/<a href="slides\/$1.$2">$2<\/a>/;
    }
    print "<TR>\n";
    printf ("  <TD>%4.4d - %4.4d</TD>\n", $start, $tod);
    print "  <TD>$time minutes</TD>\n";
    print "  <TD>$name</TD>\n";
    print "  <TD>$topic</TD>\n";
    print "  <TD>";
    print join ("<BR>",@drafts);
    print "  &nbsp;</TD>\n";
    print "  <TD>";
    print join (", ",@presentations);
    print "  &nbsp;</TD>\n";
    print "</TR>\n";
  }
}


print "</TABLE></CENTER></BODY></HTML>" unless ($t);
# time (in minutes);presenter;topic;drafts,drafts;slides,slides
__DATA__
0900;Monday, August 2, 0900 - 1130
5;Chairs;Agenda Bash;;pres-ietf60-xcon-agenda.ppt
5;Chairs;Status;;
20;Orit Levin;Updates to the SIP Conferencing Package;draft-ietf-sipping-conference-package-05.txt;pres-ietf60-xcon-confpkg.ppt
30;Alan Johnston;Sidebars;draft-rosen-xcon-conf-sidebars-01.txt;pres-ietf60-xcon-sidebars.ppt
60;Cullen Jennings;Media Policy;draft-jennings-xcon-media-control-01.txt;pres-ietf60-xcon-mpcp.ppt
30;Chairs;Additional Discussion, if required;;
1930;Monday, August 2, 1930 - 2200
60;Gonzalo Camarillo;Binary Floor Control Protocol (BFCP);draft-ietf-xcon-bfcp-00.txt;pres-ietf60-xcon-camarillo-bfcp.ppt
60;Hisham Khartabil;Conference Policy Control Protocol (CPCP);draft-ietf-xcon-cpcp-xcap-01.txt;pres-ietf60-xcon-cpcp.ppt
10;Chris Boulton, Tim Melanchuk;CPCP over MSRP;;pres-ietf60-xcon-msrp-cpcp.ppt
20;Chairs;Additional Discussion, if required;;
