// 
 // wir erweitern jquery um die methode autozoom(), das macht es uns einfacher die elemente zu iterieren
 // die elemente auf die das autozoom angewandt wird muss man dann nur noch mit einem jquery selector auswählen
 // 
(function($) {
  $.fn.autozoom = function() {
	var cnt = 0;
    return this.each(function() {
 // das hier wird für jeden Treffer des selektors angewandt, $this ist das aktuelle element
      var $this = $(this);
      var html = $this.html();
      var shortText=$this.attr('title');
      var toolTip=$this.attr('alt');
      
      if($this.attr('title')==null) {
        shortText='...';
      }
      if($this.attr('alt')==null) {
        toolTip=shortText;
      }
      $this.html('<span class="_zoomlink"><a id="_link_id_za_'+cnt+'" href="#_id_za_'+cnt+'" rel="superbox[content]" title="'+toolTip+'">'+shortText+'</a></span>');
      $this.append('<span id="_id_za_'+cnt+'" style="display:none;"><a name="za'+cnt+'"/>'+html+'</span>');
      /* Fix für IE 6/7: die schreiben die voll-referenzierte URL in den 1. Link und dann ist die Superbox bis auf den Schließen-Knopf leer */
      $('#_link_id_za_'+cnt).attr('href', '#_id_za_'+cnt);
      cnt++;
    });
  };
})(jQuery);
 // 
 // die autozoom Ersetzung auf unsere Klasse anwenden 
 // 
$(document).ready(function() {
    $('._auto_zoom').autozoom();
    $.superbox.settings = {
      closeTxt: "Schlie&szlig;en",
      loadTxt: "Lade...",
      nextTxt: "weiter",
      prevTxt: "zur&uuml;ck",
      overlayOpacity: 0.8, // Background opaqueness
      boxWidth: "960", // Default width of the box
      boxHeight: "500", // Default height of the box
      boxClasses: "autozoom_box", // Class of the "superbox" element
      cssPathSuperboxPrint:	cssSuperBoxPath
	};
	$.superbox();
});

