function popupimg($dateiname, bild_breite, bild_hoehe, $title) {

	// Neue Größe berechnen
	if (bild_breite >= (screen.width - 100)) {
		var verhaeltnis = bild_hoehe / bild_breite;
		bild_breite = screen.width - 100;
		bild_hoehe = Math.round(bild_breite * verhaeltnis);
	}
	if (bild_hoehe >= (screen.height - 100)) {
		var verhaeltnis = bild_breite / bild_hoehe;
		bild_hoehe = screen.height - 100;
		bild_breite = Math.round(bild_hoehe * verhaeltnis);
	}

	// Position berechnen - zentrieren
	var posx = (screen.width - bild_breite)/2;
	var posy = ((screen.height - bild_hoehe)/2)-10;

	// Fenster öffnen
	var win = window.open("","","width="+bild_breite+",height="+bild_hoehe+", scrollbars=no, dependent=yes, resizable=no, screenX="+posx+", screenY="+posy);
	win.moveTo(posx, posy);
	// HTML schreiben
	win.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
	win.document.writeln("<html>");
	win.document.writeln("<head><title>" + $title + "</title></head>");
	win.document.writeln("<body style='margin: 0px; padding:0px;'>");
	win.document.writeln("<img alt='Bild' style='margin:0px; padding:0px;' src='" + $dateiname + "' width='" + bild_breite + "' height='" + bild_hoehe + "' />");
	win.document.writeln("</body>");
	win.document.writeln("</html>");
	win.document.close();
}