// JavaScript Document
function openImagePopup(bildurl,w,h) {
	
	var params,sWidth,sHeight,popupWindow,w,h;
	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);

	if(ns6||ns4) {
		sWidth = innerWidth;
		sHeight = innerHeight;
	}else if(ie4) {
		sWidth = document.body.clientWidth;
		sHeight = document.body.clientHeight;
	}
	
	// Position (Fensterbreite ermiitteln)
	//x = (sWidth-w)/2; //mittig
	//y = (sHeight-h)/2; //mittig
	x = 0;
	y = 0;

	params="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+w+",height="+h+",menubar=no,toolbar=no,statusbar=0";
	
	popupWindow=window.open("","",params);
	//popupWindow.moveTo(0,0);
	popupWindow.focus();
	popupWindow.document.open();

	with (popupWindow) {
		//document.write("<html><head>");
		//document.write('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">');
		//document.write("function click() { window.close(); } ");
		//document.write("document.onmousedown=click ");
		//document.write('</scr' + 'ipt>');
		//document.write("<title>PopUp</title></head>");
		//document.write("<" + "body onblur='window.close()';");
		//document.write("marginwidth='0' marginheight='0' leftmargin='0' topmargin='0'>");
		//document.write("<img src='"+ bildurl +"' border='0'>");
		//document.write("</body></html>");
		
		document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
		document.write('<html xmlns="http://www.w3.org/1999/xhtml">\n');
		document.write('<head>\n');
		document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n');
		document.write('<title>Thumbnail - PopUp</title>\n');
		document.write('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">\n');
		document.write("function click() { window.close(); } \n");
		document.write("document.onmousedown=click \n");
		document.write('</scr' + 'ipt>\n');
		document.write('</head>\n');
		document.write('<body onblur=\"window.close()\";" style="margin:0;">\n');
		document.write('<img onclick=\"window.close()\";" src="'+ bildurl +'" alt="" border="" />');
		document.write('</body>\n');
		document.write('</html>\n');
		
		popupWindow.document.close();
	}
}