
#!/bin/perl
# pics.pl

use strict;

use CGI qw(:standard);
use myHTML;

#print header();

ins_dirs();
my ($girl,$bgfile) = my_random_pic();
my $werist         = my_button_werist();
my $ichsuche       = my_button_ichsuche();
my $data_dir       = my_dat_path();

p "<html>";
p2 "<head>",
	"<title>Home - What's new?</title>",
	"<script type='text/javascript'>",
	"<!--",
	"function ZweiFrames(URI1,F1,URI2,F2) {",
	"	Frame1=eval('parent.'+F1);",
	"	Frame2=eval('parent.'+F2);",
	"	Frame1.location.href = URI1;",
	"	Frame2.location.href = URI2;",
	"}",
	"//-->",
	"</script>",

	"<style type='text/css'>",
   "select { font-size:10pt }",
   "td { font-size:9pt }",
   "input { font:10pt }",
   "a { font-size:12pt }",
   "b { font-size:12pt }",
   "</style>";

p "</head>";
p "<body>";

open NEWS, "$data_dir/newscorner";
my @news=<NEWS>;
close NEWS;
foreach (@news) {
   chomp;
   $_=$_ . "<br>";
   p "$_\n";
}
my $let;
($let) = $girl =~ /([a-z]{1})/i;

# Index des Bildes ermitteln um über den Link direkt auf dieses Bild in der Galerie springen zu können
my $ppath = my_bilder_path();
$ppath = $ppath . "$girl" . "/content";
my $index;
my $filename;
open CONT, "<$ppath";
foreach my $controw (<CONT>) {
   ($index,$filename) = $controw =~ /([0-9]*),(.*)/;
   last if ($bgfile =~ /$filename/);
}
close CONT;

p2 "<center>",
	"<table border='0'>",
	" <tr>",
	"  <td  align='center' width='300'>",
	"   <a href='werist.pl'><img alt='Wer ist ... ?' border='0' src='$werist' width='160'></a>",
       "<br><font color='#0000ff' size='-1'>jetzt online!</font>",
	"  </td>",
	"  <td align='center' width='0'>",
	"   <a target='pics' href='pics.pl?act=$girl&ind=$index&let=$let'>",
	"    <img alt='Bild des Tages\n$girl\nKlicke um alle zu sehen' border='0' height='250' src='$bgfile'>",
	"   </a>",
	"  </td>",
	"  <td  align='center' width='300'>",
	"   <a href='ichsuche.pl'>",
	"   <img alt='Ich suche ...' border='0' src='$ichsuche' width='160'>",
	"   </a>",
	"  </td>",
	" </tr>",
	"</table>",
	"</center>";

p "<center>";
p "<table border='0'><tr><td>";
p "<a target='clustrmaps' href='http://www2.clustrmaps.com/counter/maps.php?url=http://www.bildergallerie.de' id='clustrMapsLink'> <img src='http://www2.clustrmaps.com/counter/index2.php?url=http://www.bildergallerie.de' style='border:1px solid;' alt='Locations of visitors to this page' title='Locations of visitors to this page' id='clustrMapsImg' onError='this.onError=null'; this.src='http://clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://clustrmaps.com'' /> </a>";
p "</td><td>";
p "<table cellspacing='1' cellpadding='0' border='0' bgcolor='#042C50' width='122'><tr><td align='center' style='background-color : #042C50;'><a href='http://www.meteo24.de/wetter/49X2900.html' style='text-decoration: none;' target='_blank'><font face='Verdana' size='1' color='#FFCC00' style='text-decoration: none; font-weight: bold;'>Wetter Frankfurt</font></a></td></tr><tr><td align='center'><iframe width='120' height='98' scrolling='no' frameborder='0' src='http://www.meteo24.de/hptool/v1?cid=49X2900&l=de&style=9'> </iframe></td></tr><tr><td align='center' height='15' style='background-color : #042C50;'><a href='http://www.meteo24.de/' style='text-decoration: none;' target='_blank'><font face='Verdana' size='1' color='#FFCC00'>&copy; meteo24.de</font></a></td></tr></table>";
p "</td></tr></table>";
p "</center>";

p "</body>";
p "</html>";

end_html;
