// imagezoomer.js öffnet Bilder in einem extra Fenster, dass die richtige Passgröße zum Bild hat
// by Martin Sommer
// Das Script ist kostenlos und darf frei verwendet und modifiziert werden, solange
// dieser und weitere Kommentare erhalten bleiben

//Variablen

var bgcolor = "#FFFFCC"; // Hintegrundfarbe (mit Raute bei Hexangabe)
var linkcolor = "#0000FF"; // Linkfarbe (mit Raute bei Hexangabe)
var vlinkcolor = "#FF0000"; // ViewedLinkfarbe (mit Raute bei Hexangabe)
var alinkcolor = "#FF0000"; // ActiveLinkFarbe (mit Raute bei Hexangabe)

var stimagetree = "/images/"; // Standardordner für Bilder mit /, wenn identisch mit Ordner mit Javascriptfile dann ""
var stheight = 500 //Standardhöhe, falls keine Bildbreite vorliegt
var stwidth = 500 //Standardbreite, falls keine Bildbreite vorliegt



// Hier nichts ändern, wenn sie nicht genau wissen, was sie tun

function zoomImage(imagefile,wwidth,wheight,imagetree) {
	if (imagetree == null) {imagetree = stimagetree;}
	var imgadress = imagetree+imagefile;
	var Bild = new Image();
	Bild.src = imgadress;
	if ( wheight == 0 ) {
		var wheight = Bild.height;
		if ( wheight == 0 ) { wheight = stheight; }
	} // height
	if ( wwidth == 0 ) {
		var wwidth = Bild.width;
		if ( wwidth == 0 ) { wwidth = stwidth; }
	} // width
	wwidth += 20;
	wheight += 50;
	var Fenster = window.open("","bildfenster","height="+wheight+",width="+wwidth+",status=no,location=no,menubar=no,toolbar=no");
	Fenster.document.write("<html><head><title>Vergr\&ouml\;ßerte Ansicht</title></head><body bgcolor=\"" + bgcolor + "\" link=\"" + linkcolor + "\" alink=\"" + alinkcolor + "\" vlink=\"" + vlinkcolor + "\">");
	Fenster.document.write("<center><img src=\"" + Bild.src + "\" border=\"0\"><br>");
	Fenster.document.write("<a style=\"font-weight:bold;font-decoration:none;\" href=\"javascript:self.close()\">Close window</a></center>");
	Fenster.document.write("</body></html>");
}