Puffer = new Image();
document.writeln('<div class="PictureLayer" id="PictureLayer"></div>');
document.writeln('<div id="ZoomDiv"><img src="/images/ajax.gif" id="ZoomPic"><br><span class="ZoomCloser"><a href="javascript:CloseZoom()">Zoom schließen</a></span></div>');

function ShowZoom($Eltern, $Picture)
{
SwitchCursor("url('/images/gear.ani'), move");
document.body.style.cursor = "url('/images/gear.ani'), move";
$PicSrc		= '/common/Thumb.php?file='+$Picture+'&y=500';
Puffer.onload	= ShowItNow;
Puffer.src	= $PicSrc;
}

function ShowItNow($Puffer)
{
document.body.style.cursor = "auto";
SwitchCursor("auto");
$Bild		= document.getElementById('ZoomPic');
$Container 	= document.getElementById('ZoomDiv');
$Layer		= document.getElementById('PictureLayer');

$Layer.style.visibility 	= 'hidden';
$Container.style.visibility 	= 'hidden';

$ScrolledX 	= window.pageXOffset || document.body.scrollLeft;
$ScrolledY 	= window.pageYOffset || document.body.scrollTop;

$BodyX		= document.body.clientWidth || window.innerWidth;
$BodyY		= document.body.clientHeight || window.innerHeight;

$PosX		= Math.floor($ScrolledX + (($BodyX - Puffer.width) / 2));
$PosY		= Math.floor($ScrolledY + (($BodyY - Puffer.height) / 2));

$Bild.src 	= Puffer.src;

document.body.scroll 	= 'no';
$Layer.style.top 	= '0px';
$Layer.style.left	= '0px';
$Layer.style.width 	= document.body.scrollWidth + 'px';
$Layer.style.height 	= document.body.scrollHeight + 'px';

$Container.style.top 	= $PosY - 10 + 'px';
$Container.style.left 	= $PosX + 'px';
$Container.style.width 	= Puffer.width + 'px';
$Container.style.height	= Puffer.height + 10 + 'px';

$Layer.style.visibility = 'visible';
$Container.style.visibility = 'visible';

}


function CloseZoom()
{
$Loaded		= false;
$Container 	= document.getElementById('ZoomDiv');
$Layer		= document.getElementById('PictureLayer');

$Container.style.visibility 	= 'hidden';
$Container.style.top 		= '5px';
$Container.style.left 		= '5px';
$Container.style.width 		= '0px';
$Container.style.height 	= '0px';

$Layer.style.visibility = 'hidden';
$Layer.style.top 	= '5px';
$Layer.style.left 	= '5px';
$Layer.style.width 	= '0px';
$Layer.style.height 	= '0px';
document.body.scroll = 'yes';
}

function SwitchCursor($Zeiger)
{
for(i=0; i < document.anchors.length; i++) { document.anchors[i].style.cursor = $Zeiger; }
}