#!/usr/bin/perl


use strict;

my $listfile="README";
my $gfxhtml=<<GROK;

 <a href="<file>"><img 
 src="Small/<file>.jpg" 
 height="128"
 border="0" alt="<file>"><file></a>
 <br>

GROK


my $gfxpage=<<GROK;
<html><head>
<title><text></title>
<style>
    body {background: black;
    color: grey;
  }
A{
  color: grey;
}
</style>

</head>

<body>
<table width=100% height=100%>
<tr><td align=middle>
 <a href="<next>.html"><img 
    title="<text> <file> <count>"
 src="../Small/480/<file>.jpg" 
 border="0" alt="<file> <count>"></a>
<br>
<a href="<next>.html"><text></a>
</td></tr></table>
</body>
</html>
GROK


    print "<ul>\n";



open (FILE,$listfile)||die "geen $listfile";
my $count="1";
FILE: while (my $i=<FILE>){
    
    my ($n,$text)= $i =~ m!(\d\d)\s+(.*)!;
    next FILE unless ($n&&$text);
    print "<li>$n $text <br>\n ";
    my @files=`ls -1 $n*.jpg ||echo todo.jpg `;
    chop(@files);
    foreach my $file(@files){
	my $r=$gfxhtml;
	$r=~ s!<file>!$file!gcs;
	print "$r\n";

	unless ($file =~ m!todo!gic){
	    my $next=$count + 1;
	    open (SHOW,">Show/$count.html")||die "catn write $!";
	    my $s=$gfxpage;
	    $s=~ s!<file>!$file!gcs;
	    $s=~ s!<next>!$next!gcs;
	    $s=~ s!<text>!$text!gcs;
	    $s=~ s!<count>!$count!gcs;
	    print SHOW $s;
	    close SHOW;
	    $count++;
	}
	    
    } 

    print "<br>";
}



print "</ul>\n";

print <<GROK;

<!-- Begin Nedstat Basic code -->
<!-- Title: Mick -->
<!-- URL: http://kwark.yi.org/Gfx/Mick -->
<script language="JavaScript" src="http://m1.nedstatbasic.net/basic.js">
</script>
<script language="JavaScript">
<!--
  nedstatbasic("ABGFIQVMvOjh4MSz8E6sqjydKMZw", 0);
// -->
</script>
<noscript>
<a target="_blank" href="http://v1.nedstatbasic.net/stats?ABGFIQVMvOjh4MSz8E6sqjydKMZw"><img
src="http://m1.nedstatbasic.net/n?id=ABGFIQVMvOjh4MSz8E6sqjydKMZw"
border="0" nosave width="18" height="18"></a>
</noscript>
<!-- End Nedstat Basic code -->




GROK
