$webdir = "c:/home/web";
$htmlname = shift;
$thumbname = shift;

if (!$thumbname) { $thumbname = "${htmlname}_t"; }

if (!$htmlname) {
  print "usage: makepage htmlname [thumbname]\n";
  exit 0;
}

if ( -e "$webdir/html/${htmlname}.htm" ) {
    $htmlname = "${htmlname}.htm";
} elsif ( -e "$webdir/html/${htmlname}.html" ) {
    $htmlname = "${htmlname}.html";
}

sub findimages {
    open(HTML, "$webdir/html/${htmlname}");
    while(<HTML>) {
	if (/\/(\S+\/\S+\.jpg)/) { print "$1\n"; }
	if (/\/(\S+\/\S+\.gif)/) { print "$1\n"; }
    }
    
    close(HTML);
}

findimages $htmlname
