// 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 = "#eeeeee"; // Hintegrundfarbe (mit Raute bei Hexangabe)
var linkcolor = "#0000FF"; // Linkfarbe (mit Raute bei Hexangabe)
var vlinkcolor = "#0000FF"; // ViewedLinkfarbe (mit Raute bei Hexangabe)
var alinkcolor = "#0000FF"; // ActiveLinkFarbe (mit Raute bei Hexangabe)

var stimagetree = "../images/"; // Standardordner für Bilder mit /, wenn identisch mit Ordner mit Javascriptfile dann ""
var stheight = 840 //Standardhöhe, falls keine Bildbreite vorliegt
var stwidth = 840 //Standardbreite, falls keine Bildbreite vorliegt



// Hier nichts ändern, wenn sie nicht genau wissen, was sie tun

function zoomImage(imagefile,imagetree) {
	if (imagetree == null) {imagetree = stimagetree;}
	var imgadress = imagetree+imagefile;
	var Bild = new Image();
	Bild.src = imgadress;
	var wheight = Bild.height;
	if ( wheight == 0 ) { wheight = stheight; }
	var wwidth = Bild.width;
	if ( wwidth == 0 ) { wwidth = stwidth; }
	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 href=\"javascript:self.close()\">Fenster schließen</a></center>");
	Fenster.document.write("</body></html>");
}

// Tag der offenen Tür: ImageMap

var MapName = "test"; // Name der ImageMap
var AreaShape = "rect"; // Form link-sensitiver Bereich
var Target = "oszimt"; // Fenster

var Coords1= "0,0,80,150"; // Koordinaten
var Link1 = "http://www.oszimt.de"; // Link-Adresse
var Coords2= "200,0,80,150"; // Koordinaten
var Link2 = "http://www.oszimt.de/0-schule/index.html"; // Link-Adresse

function zoomImage_tdot(imagefile,imagetree) {
	if (imagetree == null) {imagetree = stimagetree;}
	var imgadress = imagetree+imagefile;
	var Bild = new Image();
	Bild.src = imgadress;
	var wheight = Bild.height;
	if ( wheight == 0 ) { wheight = stheight; }
	var wwidth = Bild.width;
	if ( wwidth == 0 ) { wwidth = stwidth; }
	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("<map name=\"" + MapName + "\"><area shape=\"" + AreaShape + "\" coords=\"" + Coords1 + "\" href=\"" + Link1 + "\" target=\"" + Target + "\"><area shape=\"" + AreaShape + "\" coords=\"" + Coords2 + "\" href=\"" + Link2 + "\" target=\"" + Target + "\"></map>");

	Fenster.document.write("<center><img src=\"" + Bild.src + "\" border=\"0\"usemap=\"" + MapName + "\" ><br>");
	Fenster.document.write("<a href=\"javascript:self.close()\">Fenster schließen</a></center>");
	Fenster.document.write("</body></html>");
}
