#!/usr/local/bin/perl

$PRE="";
#$x="[a-bA-B]";makepage("AB","$x*.gif $x*.jpg $x*.xbm","grep -v anim-");

#--------------


system("rm index.html; cat HEADER > index.html");
open(GIFINDEX,">>index.html");

open(GIFDIR, "ls *.jpg | grep -v sm |") || die "No image files\n";

    print GIFINDEX "<HR><CENTER>\n";

FILE:
while (<GIFDIR>) {
    chop $_;$F=$_;
    $basename=`basename $F .jpg`;chop $basename;
    $file=$basename.".jpg";
    print GIFINDEX "<A HREF=\"$file\">";
    print GIFINDEX "<IMG SRC=\"$basename"."sm.jpg"."\">";
    print GIFINDEX "</a>\n ";
	next FILE;
}


    print GIFINDEX "</CENTER>";

close(GIFINDEX);


sub makepage {
    ($pagename, $what, $andnot) = @_;
open(GIFDIR, "ls $what| $andnot |") || die "No $what files\n";
open(GIFINDEX,">00summarize$pagename.html");

    print GIFINDEX "<H1>$pagename</H1><BR>";
FILE:
while (<GIFDIR>) {
	chop $_;
	print GIFINDEX "/icons/$_ <IMG ALIGN=MIDDLE SRC=\"$_\"> <br> \n";
	next FILE;
    }
}

