# slide.pl

use strict;

use CGI qw(:standard);
use myHTML;

my $bilderp      = my_bilder_path();


my $act    = param('act');
my $num    = param('num');
my $target = param('target');

open CONTENT, "<$bilderp$act/content";
my @content_lines=<CONTENT>;
close CONTENT;

my @bilder;
my $nnum=$num+1;

foreach (@content_lines) {
   chomp;
   my ($tmp,$bild) = split /,/,$_;
   @bilder=(@bilder,$bild);
   }

my $anz = @bilder;
if ($nnum > $anz-1) {
   $nnum=0;
   }
  
my $pic="$bilderp$act/$bilder[$num]";

#print header();                  
p2 "<html>",
   "<head>",
   "<meta http-equiv='refresh' content='5; URL=slide.pl?act=$act&num=$nnum'>",
   "</head>",
   "<body>",
   "<center>";

my $snum=$num+1;
p2 "<b><font size='+1'>$act Bild $snum / $anz</font></b><br>",
   "<br>";

my ($let) = $act =~ /(.{1})/;

p2 "<a href=\"pics.pl?act=$act&ind=$num&let=$let\" target=$target><img height='700' src='$pic'></a>",
   "<br>",
   "<font size='-1'>Bild anklicken um Slideshow zu beenden</font>",
   "</center>";   

myHTML::end_html;
