// jQuery Lightbox-Konfiguration
// Informationen unter http://leandrovieira.com/projects/jquery/lightbox/

// allgemeine Optionen

var lightbox_element_classname = "lightbox"; // Links mit dieser Klasse dienen dem Öffnen der Lightbox

var lightbox_options = {
	overlayBgColor: "#000",
	overlayOpacity: 0.6,
	imageLoading: "/lib/lightbox/images/lightbox-ico-loading.gif",
	imageBtnClose: "/lib/lightbox/images/lightbox-btn-close.gif",
	imageBtnPrev: "/lib/lightbox/images/lightbox-btn-prev.gif",
	imageBtnNext: "/lib/lightbox/images/lightbox-btn-next.gif",
	txtImage: "Bild",
	txtOf: "von"
};


// Initialisierung
$(function() {
	// finde die Gruppennamen aller Lightbox-Bilder
	var arr_groupnames = new Array();
	var current_group_name;
	
	$("a." + lightbox_element_classname).each(function() {
		current_group_name = $(this).attr("rel");
		if (current_group_name && $.inArray(current_group_name, arr_groupnames) == -1)
			arr_groupnames.push(current_group_name);
	});
	
	// Initialisiere Lightbox für alle Gruppen einzeln
	for (var i = 0; i < arr_groupnames.length; i++) {
		$("a." + lightbox_element_classname + "[rel=" + arr_groupnames[i] + "]").lightBox(lightbox_options);
	}
	
	// Initialisiere Lightbox auch für alle Elemente, die keiner Gruppe angehören, einzeln
	$("a." + lightbox_element_classname + ":not(a[rel])").each(function() {
		$(this).lightBox(lightbox_options);
	});
});