<?PHP
echo "<html>\n";
if($dia_bereich == "stop")
	{
	echo "<br><br><br><br><br><br><br><br>\n<div align=\"center\"><font size=6 color=#FF0000>Sie müssen eine Dia Show auswählen!</font><br>\n";
	echo "<br><br><a href=\"javascript:history.back()\">Zur&uuml;ck</a></div>\n";
	exit;
	}
include("dia_show/shows/$dia_bereich.conf");

$count_file = file("dia_show/shows/$dia_bereich");

$end_show = count($count_file);

###########################################
###	Zeitgesteuert!

if($art == time)
	{
	if(isset($count)){}
	else
		{
		$count = 0;
		}
	$counts = $count+1;
	$data = explode("$%$",$count_file[$count]);
	$info = getimagesize("eigene_bilder/$data[0]/jpg/jpg_$data[1].jpg");
	if($info[0]>1200)
		{
		$width = " width=100%";
		}
	else
		{
		$width = " width=$info[0]";
		}
	if ($count == $end_show-1)
		{
		if($end != true)
			{
			$end_name = explode("/", $SCRIPT_NAME);
			for($x=0; $x<count($end_name)-1; $x++)
				{
				$end_names = "$end_names$end_name[$x]/";
				}
			$end_names = $end_names."dia.php";
			echo "<head>\n<meta http-equiv=\"refresh\" content=\"$time; URL=http://$SERVER_NAME$end_names\">\n</head>\n";
			}
		if($end == true)
			{
			echo "<head>\n<meta http-equiv=\"refresh\" content=\"$time; URL=http://$SERVER_NAME$SCRIPT_NAME?dia_bereich=$dia_bereich&count=0\">\n</head>\n";
			}
		}
	else
		{
		echo "<head>\n<meta http-equiv=\"refresh\" content=\"$time; URL=http://$SERVER_NAME$SCRIPT_NAME?dia_bereich=$dia_bereich&count=$counts\">\n</head>\n";
		}
	$data = explode("$%$",$count_file[$count]);
	echo "<body bgcolor=#000000>\n";
	echo "<div align=\"center\" style=\"position:absolute; top:1px\">\n";
	echo "<a href=dia.php><img border=0 src=eigene_bilder/$data[0]/jpg/jpg_$data[1].jpg$width></a>\n";
	echo "</div>\n";
	echo "</body>";
	}

###########################################
###	/Zeitgesteuert

###########################################
###	Mausgesteuert!

if($art == mouse)
	{
	echo "<body bgcolor=#000000>\n";
	if(isset($count))
		{
		$counts = $count;
		}
	else
		{
		$counts = 0;
		}
	if ($counts == 0)
		{
		$back = $end_show-1;
		}
	else
		{
		$back = $counts-1;
		}
	$back_link = "&count=$back";

	if($counts == $end_show-1)
		{
		$up = 0;
		}
	else
		{
		$up = $counts+1;
		}
	$up_link = "&count=$up";
	$data = explode("$%$",$count_file[$counts]);

	$info = getimagesize("eigene_bilder/$data[0]/jpg/jpg_$data[1].jpg");


	if($info[0]>1020)
		{
		$b = $info[1]/($info[0]/1020);
		$width = " width=\"1020\" height=\"$b\"";
		$half_width = 490;
		$half_high = floor($b/2);
		echo "<div style=\"position:absolute; top:0px; left:0px\">";
		}
	else
		{
		$width = " width=$info[0] height=\"$info[1]\"";
		$half_width = floor($info[0]/2);
		$half_high =floor($info[1]/2);
		echo "<div align=\"center\">";
		}
		echo "<map name=\"pic\">\n";
		echo "<area shape=\"rect\" coords=\"0,0,$info[0],$half_high\" href=\"dia.php\">\n";
		echo "<area shape=\"rect\" coords=\"0,$half_high,$half_width,$info[1]\" href=\"dia_show.php?dia_bereich=$dia_bereich$back_link\">\n";
		if ($end != true && $count == $end_show-1)
			{
			echo "<area shape=\"rect\" coords=\"$half_width,$half_high,$info[0],$info[1]\" href=\"dia.php\">\n";
			}
		else
			{
		echo "<area shape=\"rect\" coords=\"$half_width,$half_high,$info[0],$info[1]\" href=\"dia_show.php?dia_bereich=$dia_bereich$up_link\">\n";
			}
		echo "</map>\n";


	echo "<img src=eigene_bilder/$data[0]/jpg/jpg_$data[1].jpg$width alt=\"jpg_$data[1].jpg\" usemap=\"#pic\">\n";
	echo "</div>\n";
	echo "</body>\n";
	}

###########################################
###	/Mausgesteuert
echo "</html>";
?>
