#!/usr/local/bin/perl
#   17 Jun 99 - palm@kiwin.com

require "ctime.pl";

$filename="Jun99-DOC-list.txt";

open( OUT, ">00_doc_list.html" ) || die "Can't open file: html out\n";

printf OUT "<HTML>\n";
printf OUT "<HEAD><TITLE>SG15/Q4 informal June 99 Doc List</title></head>\n";
printf OUT "<BODY bgcolor=white>\n";
printf OUT "<IMG SRC=itu.jpg ALIGN=RIGHT>\n";
printf OUT "<H1>SG15/Q4 June 99 (Geneva) Document List</H1><P><HR><P>\n";
printf OUT "<a href=\"../00_SG15Q4_home_page.html\">Return to Q4/15 Home page</a><P>\n";

printf OUT "<P>\n";
#printf OUT "<font color=red size=+3>All contributions must be submitted to the TSB by 9-June</font><br>\n";
#printf OUT "Details on how to submit are in \n";
#printf OUT "<a href=http://www.itu.int//itudoc/itu-t/circ/circ1/004.html>Circular #4</a>\n";
#printf OUT "Also available locally as <a href=004_ww7-EDH.doc>004_ww7-EDH.doc</a>\n";
#printf OUT "  <ul>\n";
#printf OUT "  <li>Delayed Document template for <a href=delayed_ww2.dot>Word 2.0</a>\n";
#printf OUT "  <li>Delayed Document template for <a href=delayed_ww6.dot>Word 6.0</a>\n";
#printf OUT "  <li>Delayed Document template for <a href=delayed_ww7.dot>Word 7.0</a> (Word 95)\n";
#printf OUT " </ul>\n";

printf OUT "Misc. meeting and local information is <a href=00_local_info.html>here</a> <P> \n";

printf OUT "<P><HR width = 50%%><P>\n";

printf OUT "If a doc link does not work, the file may not be uploaded yet or\n";
printf OUT "the filename itself might be nonstandard, please check the <a href=\".\">raw list</a>.<BR>\n";

printf OUT "Questions and comments about this page should be sent to: ";
printf OUT "<a href=\"mailto: palm\@itu.ch\">Steve Palm (palm\@itu.ch)</a> <P> \n";


######Area: Output
#printf OUT "<H2><A name=gen>Output Documents</h2>\n";
#$area_name = "Output";
#&area_sub;

printf OUT "<P><HR width = 50%%><P>\n";

#printf OUT "Misc. meeting and local information is ";
#printf OUT "<a href=\"00_local_info.html\">here</a> <P> \n";
printf OUT "Meeting Announcement: ";
printf OUT "<a href=\"http://www.itu.ch/itudoc/itu-t/com15/coll.html\">Collective Letters</a> <P> \n";


printf OUT "Please check the ITU-T official site for:\n";
printf OUT "<UL>\n";
printf OUT " <LI> <A href=\"http://ties.itu.int/itudoc/itu-t/com15/contr.html\">White Contributions</a>\n";
printf OUT " <li> <A href=\"http://ties.itu.int/itudoc/itu-t/com15/dcontr/\">Delayed Contributions</a>\n";
printf OUT " <LI> <a href=\"http://ties.itu.int/u/tsg15/sg15/td/wp1/\">WP1  Temporary & Working Documents</a>\n";
printf OUT " <LI> <a href=\"http://ties.itu.int/u/tsg15/sg15/td/gen/\">Gen  Temporary & Working Documents</a>\n";
printf OUT " <LI> <a href=\"http://ties.itu.int/u/tsg15/sg15/td/plen/\">Plen Temporary & Working Documents</a>\n";
printf OUT "</UL><P>\n";

#printf OUT "<P>For those of you who prefer FTP so that you can download a whole\n";
#printf OUT "directory of documents in one click:\n";
#printf OUT "<PRE>\n";
#printf OUT "            Type      Host         Directory\n";
#printf OUT "  -------   ------    -----------  ------------------------------------\n";
#printf OUT "  informal  TD        ftp.itu.int  /tsg15/sg15/wp1/q4/Oct98-Geneva-Input\n";
#printf OUT "  official  TD-WP1    ftp.itu.int  /tsg15/sg15/td/Oct98/wp1/\n";
#printf OUT "  official  TD-Gen    ftp.itu.int  /tsg15/sg15/td/Oct98/gen/\n";
#printf OUT "  official  TD-Plen   ftp.itu.int  /tsg15/sg15/td/Oct98/plen/\n";
#printf OUT "  official  Comm      ftp.itu.int  /itudoc/reg/itu-t/com15/contr\n";
#printf OUT "  official  Delayed   ftp.itu.int  /itudoc/reg/itu-t/com15/dcontr/dc-oct98\n";
#printf OUT "</PRE>\n";

printf OUT "This page was generated at %s JST<P>\n", &ctime(time);
printf OUT "<P>\n";


printf OUT "Quick Jump to Agenda areas:<br>\n";
printf OUT "<Table>\n";

printf OUT "<tr><TD><A href=#shdsl>G.<font color=darkred>shdsl</font></a>\n";
printf OUT "    <TD><A href=#vdsl>G.<font color=magenta>vdsl</font></a>  \n";
printf OUT "    <TD><A href=#ref.bis>G.ref.bis</a>\n";
printf OUT "    <TD><A href=#test.bis>G.<font color=purple>test</font>.bis</a>\n";
printf OUT "    <TD><A href=#ploam.bis>G.<font color=green>ploam</font>.bis</a> </tr> \n";

printf OUT "<tr><TD><A href=#hs.bis>G.<font color=grey>hs</font>.bis</a> \n";
printf OUT "    <TD><A href=#lite.bis>G.<font color=red>lite</font>.bis</a>\n";
printf OUT "    <TD><A href=#dmt.bis>G.<font color=orange>dmt</font>.bis</a>\n";
printf OUT "    <TD><A href=#gen.bis>G.<font color=orange>gen</font>.bis (all xDSL)</a> \n";
printf OUT "    <TD><A href=#hpna>hpna</a> </tr>\n";

printf OUT "<TR><TD><A href=#admin>Admin</a>\n";
printf OUT "    <TD><A href=#ipr>IPR</a>\n";
printf OUT "    <TD><A href=#ref>G.ref/G.995.1</a>\n";
printf OUT "    <TD><A href=#test>G.<font color=purple>test</font>/G.996.1</a>\n";
printf OUT "    <TD><A href=#ploam>G.<font color=green>ploam</font>/G.997.1</a> </tr> \n";

printf OUT "<tr><TD><A href=#hs>G.<font color=grey>hs</font>/G.994.1</a> \n";
printf OUT "    <TD><A href=#lite>G.<font color=red>lite</font>/G.992.2</a>\n";
printf OUT "    <TD><A href=#dmt>G.<font color=orange>dmt</font>/G.992.1</a>\n";
printf OUT "    <TD><A href=#gen>G.<font color=orange>gen</font> (G.lite/G.dmt)</a>\n";
printf OUT "    <TD><A href=#hdsl>G.hdsl/G.991.1</a></tr>\n";

printf OUT "</table>\n";
printf OUT "<P>\n";


printf OUT "<Table border=1>\n";
printf OUT "<TR><TH>Num.<TH>Source<TH>Area<TH>Title<TH>Informal Filename<TH>ITU Filename</TR>\n";

#printf OUT "<TR><TD>-<TD>Rapporteur Question 4/15<TD>Admin<TD>October 98 Document List<TD>\n";
#printf OUT "<A href=\"Oct98-DOC-list.doc\">Oct98-DOC-list.doc</a></TR>\n ";

printf OUT "<TR><TD>-<TD>Steve Palm<TD>Admin<TD>June 99 Informal Document List<TD>\n";
printf OUT "<A href=\"Jun99-DOC-list.txt\">Jun99-DOC-list.txt</a><TD>-</TR>\n ";

#printf OUT "<TR><TD>-<TD>Rapporteur Question 4/15<TD>Admin<TD>June 98 Roster List<TD>\n";
#printf OUT "<A href=\"Roster-Oct98.doc\">Roster-Oct98.doc</a></TR>\n ";

#Read the list of onetime file uploads

open( TC_FILE, $filename ) || die "Can't open file: $filename\n";

#Read the doc list
while (<TC_FILE>) {

  # Truncate the 8th bits
  tr/\200-\377/\000-\177/;

  # substitute color for some keywords
  s#G\.vdsl#<font color=magenta>G.vdsl</font>#gi;   
  s#G\.shdsl#<font color=darkred>G.shdsl</font>#gi;   
  s#G\.hs#<font color=grey>G.hs</font>#gi;   
  s#G\.lite#<font color=red>G.lite</font>#gi;   
  s#G\.gen#<font color=orange>G.gen</font>#gi;   
  s#G\.dmt#<font color=orange>G.dmt</font>#gi;   
  s#G\.test#<font color=purple>G.test</font>#gi;   
  s#G\.ploam#<font color=green>G.ploam</font>#gi;   
  s#Withdrawn#<B><i>Withdrawn</i></B>#gi;   

  chop;
  ($num, $source, $title, $fname, $ituname) = split('\#');

  printf "X%sXXXX%sX \n", $num, $source;

  printf OUT "<TR>\n";
#  printf OUT "<TD>%03u\n", $num;
  printf OUT "<TD>%s\n", $num;
  printf OUT "<TD>%s\n", $source;
  
  #parse for the subject area in the Title
  ($area, $title2) = split(':',$title);
  printf OUT "<TD>%s\n", $area;
  printf OUT "<TD>%s", $title2;

  printf OUT "<TD>";
  if ($fname eq '-' ) {
    printf OUT " - Not Available -";
  }
  else {
    printf OUT "<A href=\"%s\">%s</a> ", $fname, $fname;
  }

  printf OUT "<TD>";
  if ($ituname eq '-' ) {
    printf OUT " - Not Available -";
  }
  else {
    printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname;
    $ituname =~ s/zip/pdf/;
    $ituname =~ s/doc/pdf/;
    printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname  if -e $ituname;
  }

  printf OUT "</TR>\n\n";

} # while

printf OUT "</Table>\n";
close( TC_FILE );



#Now make the Agenda...

open( TC_FILE, "Jun99-DOC-list.txt" ) || die "Can't open file: Jun99-DOC-list.txt 2nd time\n";

while (<TC_FILE>) {

  # Truncate the 8th bits
  tr/\200-\377/\000-\177/;

  chop;
  ($num, $source, $title, $fname, $ituname) = split('\#');

  #printf "X%sXXXX%sX \n", $num, $source;
  #parse for the subject area in the Title
  ($area, $title2) = split(':',$title);
  printf "Area: %s\n", $area;
  
  if ( $area eq 'Admin'  && !($title =~ /withdrawn/i) )  { $admin_string .= sprintf( "%s, ", $num );  }   
  if ( $area eq 'IPR'    && !($title =~ /withdrawn/i) )  { $ipr_string   .= sprintf( "%s, ", $num );  }   
  if ( $area eq 'G.shdsl'&& !($title =~ /withdrawn/i) )  { $shdsl_string .= sprintf( "%s, ", $num );  } 
  if ( $area eq 'G.vdsl' && !($title =~ /withdrawn/i) )  { $vdsl_string  .= sprintf( "%s, ", $num );  }

  if ( $area eq 'G.gen.bis'  && !($title =~ /withdrawn/i) )  { $gen_bis_string   .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.lite.bis' && !($title =~ /withdrawn/i) )  { $lite_bis_string  .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.ploam.bis'&& !($title =~ /withdrawn/i) )  { $ploam_bis_string .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.test.bis' && !($title =~ /withdrawn/i) )  { $test_bis_string  .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.dmt.bis'  && !($title =~ /withdrawn/i) )  { $dmt_bis_string   .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.hs.bis'   && !($title =~ /withdrawn/i) )  { $hs_bis_string    .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.ref.bis'  && !($title =~ /withdrawn/i) )  { $ref_bis_string   .= sprintf( "%s, ", $num );  }

  if ( $area eq 'G.gen'  && !($title =~ /withdrawn/i) )  { $gen_string   .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.lite' && !($title =~ /withdrawn/i) )  { $lite_string  .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.ploam'&& !($title =~ /withdrawn/i) )  { $ploam_string .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.test' && !($title =~ /withdrawn/i) )  { $test_string  .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.hdsl' && !($title =~ /withdrawn/i) )  { $hdsl_string  .= sprintf( "%s, ", $num );  } 
  if ( $area eq 'G.dmt'  && !($title =~ /withdrawn/i) )  { $dmt_string   .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.hs'   && !($title =~ /withdrawn/i) )  { $hs_string    .= sprintf( "%s, ", $num );  }
  if ( $area eq 'G.ref'  && !($title =~ /withdrawn/i) )  { $ref_string   .= sprintf( "%s, ", $num );  }

  if ( $area eq 'hpna'   && !($title =~ /withdrawn/i) )  { $hpna_string  .= sprintf( "%s, ", $num );  }
  if ( $area eq 'Other'  && !($title =~ /withdrawn/i) )  { $other_string .= sprintf( "%s, ", $num );  }


} # while


printf OUT "<HR width=50%%><P>\n";

printf OUT "<H2>Brief Agenda:</h2>\n";

printf OUT "<Table border=1>\n";
printf OUT "<TR><TH>Area<TH>Rec<TH><TH>Contribution Numbers</TR>\n";

printf OUT "<TR><TD>Admin<TD>.<TD><A href=#admin>details</a><TD>%s</tr>\n", $admin_string;
printf OUT "<TR><TD>IPR<TD>.<TD><A href=#ipr>details</a><TD>%s</tr>\n", $ipr_string;
printf OUT "<TR><TD>hpna<TD>.<td><A href=#hpna>details</a><TD>%s</tr>\n", $hpna_string;
printf OUT "<TR><TD><font color=darkred>G.shdsl</font><TD>.<TD><A href=#shdsl>details</a><TD>%s</tr>\n", $shdsl_string;
printf OUT "<TR><TD><font color=magenta>G.vdsl</font><TD>.<TD><A href=#vdsl>details</a><TD>%s</tr>\n", $vdsl_string;

printf OUT "<TR><TD><font color=red>G.lite.bis</font><TD>-<TD><A href=#lite.bis>details</a><TD>%s</tr>\n", $lite_bis_string;
printf OUT "<TR><TD><font color=green>G.ploam.bis</font><TD>-<TD><A href=#ploam.bis>details</a><TD>%s</tr>\n",  $ploam_bis_string;
printf OUT "<TR><TD><font color=purple>G.test.bis</font><TD>-<TD><A href=#test.bis>details</a><TD>%s</tr>\n",  $test_bis_string;
printf OUT "<TR><TD><font color=orange>G.dmt.bis</font><TD>-<TD><A href=#dmt.bis>details</a><TD>%s</tr>\n", $dmt_bis_string;
printf OUT "<TR><TD><font color=grey>G.hs.bis</font><TD>-<TD><A href=#hs.bis>details</a><TD>%s</tr>\n",  $hs_bis_string;
printf OUT "<TR><TD>G.ref.bis<TD>-<TD><A href=#ref.bis>details</a><TD>%s</tr>\n", $ref_bis_string;
printf OUT "<TR><TD><font color=orange>G.gen.bis</font> (all xDSL)<TD>.<TD><A href=#gen.bis>details</a><TD>%s</tr>\n", $gen_bis_string;

printf OUT "<TR><TD><font color=red>G.lite</font><TD>G.992.2<TD><A href=#lite>details</a><TD>%s</tr>\n", $lite_string;
printf OUT "<TR><TD><font color=green>G.ploam</font><TD>G.997.1<TD><A href=#ploam>details</a><TD>%s</tr>\n",  $ploam_string;
printf OUT "<TR><TD><font color=purple>G.test</font><TD>G.996.1<TD><A href=#test>details</a><TD>%s</tr>\n",  $test_string;
#printf OUT "<TR><TD>G.hdsl<TD>G.991.1<TD><A href=#hdsl>details</a><TD>%s</tr>\n", $hdsl_string;
printf OUT "<TR><TD><font color=orange>G.dmt</font><TD>G.992.1<TD><A href=#dmt>details</a><TD>%s</tr>\n", $dmt_string;
printf OUT "<TR><TD><font color=grey>G.hs</font><TD>G.994.1<TD><A href=#hs>details</a><TD>%s</tr>\n",  $hs_string;
printf OUT "<TR><TD>G.ref<TD>G.995.1<TD><A href=#ref>details</a><TD>%s</tr>\n", $ref_string;
#printf OUT "<TR><TD><font color=orange>G.gen</font> (<font color=orange>G.dmt</font> & <font color=red>G.lite</font>)<TD>.<TD><A href=#gen>details</a><TD>%s</tr>\n", $gen_string;

#printf OUT "<TR><TD>Other<TD>.<td><A href=#other>details</a><TD>%s</tr>\n", $other_string;

printf OUT "</Table>\n<P>\n";

close( TC_FILE );


# Do each area
#  this really should be read once and sorted in memory... but for now
#  we read the file once for each area

######Area: Admin
printf OUT "<H2><A name=Admin>Admin</h2>\n";
$area_name = "Admin";
&area_sub;

######Area: Liaison Statements
printf OUT "<H2><A name=ls>Liaison Statements</h2>\n";
$area_name = "LS";
&area_sub_ls;

######Area: IP
printf OUT "<H2><A name=ip>IP</h2>\n";
$area_name = "IP";
&area_sub;

######Area: HPNA
printf OUT "<H2><A name=hpna>hpna</h2>\n";
$area_name = "hpna";
&area_sub;

######Area: G.vdsl
printf OUT "<H2><A name=vdsl><font color=magenta>G.vdsl</font></h2>\n";
$area_name = "G.vdsl";
&area_sub;

######Area: G.shdsl
printf OUT "<H2><A name=shdsl><font color=darkred>G.shdsl</font></h2>\n";
$area_name = "G.shdsl";
&area_sub;

######Area: general.bis
printf OUT "<H2><A name=gen.bis><font color=orange>G.gen.bis</font></h2>\n";
$area_name = "G.gen.bis";
&area_sub;

######Area: G.lite.bis
printf OUT "<H2><A name=lite.bis><font color=red>G.lite.bis</font></h2>\n";
$area_name = "G.lite.bis";
&area_sub;

######Area: G.ploam.bis
printf OUT "<H2><A name=ploam.bis><font color=green>G.ploam.bis</font></h2>\n";
$area_name = "G.ploam.bis";
&area_sub;

######Area: G.test.bis
printf OUT "<H2><A name=test.bis><font color=purple.bis>G.test.bis</font></h2>\n";
$area_name = "G.test.bis";
&area_sub;

######Area: G.dmt.bis
printf OUT "<H2><A name=dmt.bis><font color=orange>G.dmt.bis</font></h2>\n";
$area_name = "G.dmt.bis";
&area_sub;

######Area: G.hs.bis
printf OUT "<H2><A name=hs.bis><font color=grey>G.hs.bis</font></h2>\n";
$area_name = "G.hs.bis";
&area_sub;

######Area: G.ref.bis
printf OUT "<H2><A name=ref.bis>G.ref.bis</h2>\n";
$area_name = "G.ref.bis";
&area_sub;

######Area: G.lite
printf OUT "<H2><A name=lite><font color=red>G.lite</font></h2>\n";
$area_name = "G.lite";
&area_sub;

######Area: G.ploam
printf OUT "<H2><A name=ploam><font color=green>G.ploam</font></h2>\n";
$area_name = "G.ploam";
&area_sub;

######Area: G.test
printf OUT "<H2><A name=test><font color=purple>G.test</font></h2>\n";
$area_name = "G.test";
&area_sub;

######Area: G.dmt
printf OUT "<H2><A name=dmt><A name=dmt><font color=orange>G.dmt</font></h2>\n";
$area_name = "G.dmt";
&area_sub;

######Area: G.hs
printf OUT "<H2><A name=hs><font color=grey>G.hs</font></h2>\n";
$area_name = "G.hs";
&area_sub;

######Area: G.ref
printf OUT "<H2><A name=ref>G.ref</h2>\n";
$area_name = "G.ref";
&area_sub;


######Area: G.other
#printf OUT "<H2><A name=other>Other</h2>\n";
#$area_name = "Other";
#&area_sub;


# Trailer

printf OUT "<HR width=50%><P>\n";

printf OUT "<P>\n";
printf OUT "This page is automatically generated by a <A href=http://www.perl.com>PERL</A> \n";
printf OUT "<A href=\"doc_list_html.pl\">script</a>.<BR> ";
#printf OUT "Filenames should be of the form: AB-xxx.rtf, AB-xxxR1.rtf, AB-xxx.pdf, AB-xxx.zip, AB-xxxR1.zip \n";
#printf OUT "with strict regards for case.\n";
printf OUT "<BR>RTF and DOC files over a few hundred k bytes should be ZIPped\n";

printf OUT "</body></html>\n";

exit;



sub area_sub {
  open( TC_FILE, $filename ) || die "Can't open file: $filename 2nd time\n";

  printf OUT "<Table border=1>\n";
  printf OUT "<TR><TH>Num.<TH>Source<TH>Area<TH>Title<TH>Informal Filename<TH>ITU filename</TR>\n";

  while (<TC_FILE>) {

    # Truncate the 8th bits
    tr/\200-\377/\000-\177/;

    chop;
    ($num, $source, $title, $fname, $ituname) = split('\#');

    printf "X%sXXXX%sX \n", $num, $source;
    #parse for the subject area in the Title
    ($area, $title2) = split(':',$title);

    if ( $area eq $area_name && !($title =~ /withdrawn/i)  )     { 

       printf OUT "<TR>\n";
#       printf OUT "<TD>%03u\n", $num;
       printf OUT "<TD>%s\n", $num;
       printf OUT "<TD>%s\n", $source;
       printf OUT "<TD>%s\n", $area;
       printf OUT "<TD>%s", $title2;
       printf OUT "<TD>";
       if ($fname eq '-' ) {
         printf OUT " - Not Available -";
       }
       else {
         printf OUT "<A href=\"%s\">%s</a> ", $fname, $fname;
       }
       printf OUT "<TD>";
       if ($ituname eq '-' ) {
         printf OUT " - Not Available -";
       }
       else {
         printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname;
         $ituname =~ s/zip/pdf/;
         $ituname =~ s/doc/pdf/;
         printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname if -e $ituname;
       }
       printf OUT "</TR>\n\n";

    }  # if

  } # while

  printf OUT "</table><P>\n";

  close( TC_FILE );

}





sub area_sub_ls {
  open( TC_FILE, $filename ) || die "Can't open file: $filename 2nd time\n";

  printf OUT "<Table border=1>\n";
  printf OUT "<TR><TH>Num.<TH>Source<TH>Area<TH>Title<TH>Informal Filename<TH>ITU filename</TR>\n";

  while (<TC_FILE>) {

    # Truncate the 8th bits
    tr/\200-\377/\000-\177/;

    chop;
    ($num, $source, $title, $fname, $ituname) = split('\#');

    printf "X%sXXXX%sX \n", $num, $source;
    #parse for the subject area in the Title
    ($area, $title2) = split(':',$title);
    ($ls, $title3) = split('-',$title2);
printf "LS = >%s<   ---  title3 = %s\n", $ls, $title3;

    if ( $ls eq ' LS ' && !($title =~ /withdrawn/i)  )     { 

       printf OUT "<TR>\n";
#       printf OUT "<TD>%03u\n", $num;
       printf OUT "<TD>%s\n", $num;
       printf OUT "<TD>%s\n", $source;
       printf OUT "<TD>%s\n", $area;
       printf OUT "<TD>%s", $title2;
       printf OUT "<TD>";
       if ($fname eq '-' ) {
         printf OUT " - Not Available -";
       }
       else {
         printf OUT "<A href=\"%s\">%s</a> ", $fname, $fname;
       }
       printf OUT "<TD>";
       if ($ituname eq '-' ) {
         printf OUT " - Not Available -";
       }
       else {
         printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname;
         $ituname =~ s/zip/pdf/;
         $ituname =~ s/doc/pdf/;
         printf OUT "<A href=\"%s\">%s</a> ", $ituname, $ituname  if -e $ituname;
       }
       printf OUT "</TR>\n\n";

    }  # if

  } # while

  printf OUT "</table><P>\n";

  close( TC_FILE );

}
