#!/usr/local/bin/perl5
#
# Created by F.Murtas 
# ======
#
# Date : 18-12-98
# ====
#[ <A  HREF = "#lett">Published Papers : </A>   ] 

#$docdir  = "/afs/kloe.infn.it/www/pub/doc/";
$docdir  = "/afs/lnf.infn.it/project/www/kloe/pub/doc/";
$httpdir = "/kloe/pub/doc/";
#$docfil  = "/afs/kloe.infn.it/www/pub/doc/kd.list";
$docfil  = "/afs/lnf.infn.it/project/www/kloe/pub/doc/kd.list";

print <<EOF;
Content-type: text/html

<HTML>
<HEAD>
<TITLE>List of KLOE Papers </TITLE>
</HEAD>
<BODY BGCOLOR=FFFFFF>

<A NAME=lett><P><CENTER><H1>KLOE Published Papers </H1></CENTER>
<A NAME=lett><P><CENTER><H1>(click a year below) </H1></CENTER>

[ <A  HREF = "/kloe/">Kloe Home</A>                ]
[ <A  HREF = "#tech">Technical Proposal</A>        ]
[ <A  HREF = "#1992">1992</A> ]
[ <A  HREF = "#1993">1993</A> ]
[ <A  HREF = "#1994">1994</A> ]
[ <A  HREF = "#1995">1995</A> ]
[ <A  HREF = "#1996">1996</A> ]
[ <A  HREF = "#1997">1997</A> ]
[ <A  HREF = "#1998">1998</A> ]
[ <A  HREF = "#1999">1999</A> ]
[ <A  HREF = "#2000">2000</A> ]
[ <A  HREF = "#2001">2001</A> ]
[ <A  HREF = "#2002">2002</A> ]
[ <A  HREF = "#2003">2003</A> ]
[ <A  HREF = "#2004">2004</A> ]
[ <A  HREF = "#2005">2005</A> ]
[ <A  HREF = "#2006">2006</A> ]
[ <A  HREF = "#2007">2007</A> ]
[ <A  HREF = "#2008">2008</A> ]
[ <A  HREF = "#LAST">last paper</A> ]

<P><PRE>
EOF


open(FILE,"<$docfil") or die "Can't open file $docfil \n";

LINE: while ($line=<FILE>){
    if($line =~ "!"){
	print "<HR>\n"; 
	next LINE
	}

    if($line =~ "No"){
#        ($F1,$F2,$num) = ($line =~ /^\s*(\S+)\s+(\S+)\s*(.*)/); 
        ($F1,$F2,$num) = ($line =~ /^\s*(\S+)\s+(\S+)\s*(\S+)/); 
        print "$line";
	next LINE
	}

    if($line =~ "Date   :"){
        print $line;
        $file = "k" . $num ;
        $filepdf=$docdir . $file . ".pdf" ;
        $filepdfgz=$docdir . $file . ".pdf.gz" ;
        $filedir=$docdir . $file . ".dir" ;
        $fileps=$docdir . $file . ".ps" ;
        $filepsgz=$docdir . $file . ".ps.gz" ;
        $filehtml=$docdir . $file . ".html" ;
        print "</PRE><B>";
        -e $filedir and print " <A HREF=$httpdir$file.dir>$file.dir</A>&nbsp;&nbsp;\n";
        -e $filepdf and print " <A HREF=$httpdir$file.pdf>$file.pdf</A>&nbsp;&nbsp;\n";
        -e $filepdfgz and print " <A HREF=$httpdir$file.pdf.gz>$file.pdf.gz</A>&nbsp;&nbsp;\n";
        -e $fileps and print " <A HREF=$httpdir$file.ps>$file.ps</A>&nbsp;&nbsp;\n";
        -e $filepsgz and print " <A HREF=$httpdir$file.ps.gz>$file.ps.gz</A>&nbsp;&nbsp;\n";
        -e $filehtml and print " <A HREF=$httpdir$file.html>$file.html</A>&nbsp;&nbsp;\n";
        print "</B><PRE>";
	next LINE
	}

    print $line;
    }

close (FILE);


print <<EOF;
</PRE>
<ADDRESS> <A HREF=mailto:wwwkloe.lnf.infn.it>wwwkloe</A></ADDRESS>
</BODY>
</HTML>
EOF
