var wndZoom		// das Zoom Window
var iLastW		// die letzte Breite des Zoom Window
var iLastH		// die letzte Höhe des Zoom Window

//
// openZoomWindow
//
// Parameter:
//		theURL  - String: Die anzuzeigende Seite
//		iWidth  - Integer: Die gewünschte Breite
//		iHeight - Integer: Die gewünschte Höhe
//
// Return:
//		keiner
//
// erzeugt / verändert ein zusätzliches Fenster mit dem Namen "wndZoom"
//
function openZoomWindow(theURL, iWidth, iHeight) { //v2.0
	var cFeatures
	if (wndZoom)
	{
		if (!wndZoom.closed && ((iWidth != iLastW) || (iHeight != iLastH)))
		{
			wndZoom.close();
		};
	};
	iLastW = iWidth;
	iLastH = iHeight;
	cFeatures="width=" + iWidth + ",height=" + iHeight
  	wndZoom = window.open(theURL, "wndZoom", cFeatures)
    wndZoom.focus();
}

//
// closeZoomWindow
//
// schließt ein evtl. vorhandenes Zoom Window
// wird integriert über onUnload
//
function closeZoomWindow() {
	if (wndZoom)
		if (!wndZoom.closed)
		{
			wndZoom.close();
		};
}

//Öfnnet eine Fenster in der Bildschirmmitte
//Wird die Funktion openZoomWindow ersetzen wenn alle Bilder ausgetauscht wurden
//paraurl 	 	Seite die in dem öffnenen Fenster angezeigt werden soll
//parawidth 	Breite des Fensters 
//paraheight	Höhe des Fensters 

function openZoomWindowBig(paraurl,parawidth, paraheight)
{
 	var ani_wndwidth = parawidth;
	var ani_wndheight = paraheight;
	var ani_wndposx = String(((screen.availWidth - parawidth)/2));	
	var ani_wndposy = String(((screen.availHeight - paraheight)/2));
	//Prüfen ob vefügbare Bildschirmfläche keliner als 800 x 600 Pixel ist.
	if (screen.availWidth < parawidth && screen.availHeight < paraheight){
		ani_wndwidth  = (screen.availWidth -16);
		ani_wndheight  = (screen.availHeight -32);
		var winpara = 'width='+ ani_wndwidth +',height='+ ani_wndheight + ',status=no,resizable=no';
	}	
	else if (screen.availWidth < parawidth) {
		ani_wndwidth  = (screen.availWidth -16);
		var winpara = 'width='+ ani_wndwidth +',height='+ ani_wndheight + ',top='+ ani_wndposy + ',status=no,resizable=no';
	}
	else if (screen.availHeight < paraheight){
		ani_wndheight  = (screen.availHeight -32);
		var winpara = 'width='+ ani_wndwidth +',height='+ ani_wndheight + ',left=' + ani_wndposx + ',status=no,resizable=no';
	}
	else {
		var winpara = 'width='+ ani_wndwidth +',height='+ ani_wndheight + ',left=' + ani_wndposx + ',top='+ ani_wndposy + ',status=no,resizable=no';
	}
	closeZoomWindow();
	wndZoom = window.open(paraurl, '', winpara);
}

