<?php 
	$path = $_SERVER['PHP_SELF'];
	$id = basename ($path,".php"); 
	if ($id == "index") {
		// sonderfall: $id muss den verzeichnis-Namen haben
		$dir_path = dirname ($path);
		$dir_array = explode ("/", $dir_path);
		$id = $dir_array[count($dir_array) - 1];
		$myTarget = "../templates/template_gallery.php"; 
	} else {
		$myTarget = "../templates/template_image.php"; 
	}
	include( $myTarget ); 
?>