#!/usr/bin/perl
print "Content-Type: text/html\n\n";
use CGI;
use CGI::Carp 'fatalsToBrowser';
$cgi = new CGI;
$cdate = $cgi->param('date');
$y = $cgi->param('y');
$m = $cgi->param('m');
$d = $cgi->param('d');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$thismonth=$mon+1; $year += 1900;
if ($thismonth < 10) { $thismonth = join '', 0, $thismonth; }
if ($mday < 10) { $thisday = join '', 0, $mday; } else { $thisday = $mday; }
$filedate = "$year$thismonth$thisday";
if ($cdate eq "") { $date = $filedate; }
else { if ($cdate < 10) { $cdate = join '', 0, $cdate; } }
$date = "$year$thismonth$cdate";
if (($y != 0) and ($m != 0) and ($d != 0)) { $date = $y . sprintf("%2.2u",$m) . sprintf("%2.2u",$d); }
#$localfile = "/kunden/ifs24.de/bwaktuell.de/pod/images/$date.jpg";
#$url = "bwaktuell.de/pod/images/$date.jpg";
$url = "bwaktuell.de/pod/images/$date.jpg";
open(TPL,"index.shtml");
$i=0;
foreach () {
if ($i > 18) { last; }
else { print $_; }
$i++;
}
close(TPL);
#if (-e $localfile) { print; }
#else { $url = "bwaktell.de/pod/qm.gif"; }
print "