
// Bilder anzeigen mit "Zoom"-Funktion

var zaehler = 150;
function aufmachen(breite,ID) {
 if (zaehler < breite) {
  document.getElementById(ID).style.display="inline";
  document.getElementById(ID).style.width=zaehler+"px";
  zaehler += 10; 
  window.setTimeout("aufmachen("+breite+",'"+ID+"')",0);
 }
 else {
  document.getElementById("beschreibung-"+ID).style.display="block";
 }
}

function zumachen(ID) {
 document.getElementById(ID).style.display="none";
 document.getElementById("beschreibung-"+ID).style.display="none";
 zaehler = 150;
}

function anzeigen(zoom) {
 if(document.getElementById(zoom).style.display=="none") {
  document.getElementById(zoom).style.display="inline";
 }
 else {
  document.getElementById(zoom).style.display="none";
 }
}

/*
Ein Script von Julian Hibbeln.
http://www.fun-fox.de/bilder-fokus.php
Version 1.3.1
*/
<!--
window.onload=function()
{
	var links=document.getElementsByTagName("a");
	for(var i=0; i<links.length; i++)
	{ 
		if(links[i].getAttribute("rel") && links[i].getAttribute("rel")=="bildzoom")
		{	
			links[i].onclick=function()
			{
				imagePreload(this.getAttribute("href"));
				return false;
			}
		}
	}
}

document.onkeypress=function(key)
{
	key = !key ? event:key;
	code = key.keyCode ? key.keyCode:key.which;
	if(code==27)
		remove();
}

function imagePreload(url)
{
	document.getElementById("show").innerHTML = "<table id=\"bf_picture\"><tr><td><img id=\"bf_picture_img\"  src=\""+url+"\" onload=\"movePicture();\" /><a href=\"javascript:remove()\"id=\"bf_close\"  title=\"Klicken oder ESC drücken zum Schließen\">Schließen X</a></td></tr></table>";
	document.getElementById("bf_picture").style.visibility = "hidden";
	return;
}

function movePicture()
{
	var picture = document.getElementById("bf_picture");
	var x_close = document.getElementById("bf_close");
	
	var heightPicture = picture.offsetHeight;
	var heightScreen = document.documentElement.clientHeight;
	if (window.innerWidth)
		var heightWindow = window.pageYOffset;
	else
		var heightWindow = document.documentElement.scrollTop;
	
	var top = Math.round(heightWindow + (heightScreen - heightPicture)/2);
	if(top < 0) top = 0;
	
	picture.style.top = top + "px";
	
	var widthPicture = picture.offsetWidth;
	var widthScreen = document.documentElement.clientWidth;
	
	var left = Math.round((widthScreen - widthPicture)/2);
	if(left < 0) left = 0;
	
	picture.style.left = left + "px";
	
	x_close_top = (heightWindow - top);
	if(x_close_top>0)
		x_close.style.top = x_close_top + "px";
	
	picture.style.visibility = "visible";
	return;
}

function remove()
{
	document.getElementById("show").innerHTML = "";
	return;
}
//-->
