
function initGalerie (){
	$('div.koerper').hide();
	$('div.einzelgalerie h2 a').addClass('zu');
	$('div.bilderleiste p').css('display','none');
}


$(document).ready(function() {
   	
  $("div.einzelgalerie h2 a").click(function(){
  		if ($(this).hasClass('zu')){
  			$(this).addClass('auf');
  			$(this).removeClass('zu');
  			$(this).parent('h2').parent('div').find('div.koerper').slideDown();
  		}
  		else {
  			$(this).addClass('zu');
  			$(this).removeClass('auf');
  			$(this).parent('h2').parent('div').find('div.koerper').slideUp();
  		
  		}
  		return false;
	});
			
});

$(document).ready(function() {
   	
  $("div.einzelbild a").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'	: 'none',
				'titlePosition' 	: 'over',
				'padding' : 0,
				'onComplete'	: bildInfo,
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		      return '<div id="bildInfo" class="bild'+currentIndex+' reihe'+title+'"><p id="bildbesitz">&nbsp;</p><p id="bildtitel">&nbsp;</p><p id="bildunterschrift">&nbsp;</p></div>';
		      }
			});
   	
  $("a.aufblasen").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'	: 'none',
				'titlePosition' 	: 'over',
				'padding' : 10
			});
			
});

function bildInfo() {
	var speicher = $('div#bildInfo').attr('class').split(' ');
	var bildNr = speicher[0].substr(4)*1;
	var galerieName = speicher[1].substr(5);
	$('p#bildtitel').text('Historische Baustoffe');
	$('p#bildunterschrift').text('So präsentieren unsere Mitglieder das Material');
	$('p#bildbesitz').text('Bild-Nr. '+(bildNr+1)+': Wenn Sie Fragen zum Bild haben, wenden Sie sich bitte an die Geschäftsstelle.');
	$('p#bildtitel').html($('div.'+galerieName+'').find('div').eq(bildNr).find('p.bildTitel').html());
	$('p#bildunterschrift').html($('div.'+galerieName+'').find('div').eq(bildNr).find('p.bildUnterschrift').html());
	$('p#bildbesitz').html(galerieName+', Bild-Nr: '+(bildNr+1)+': '+$('div.'+galerieName+'').find('div').eq(bildNr).find('p.bildBesitz').html());
	$.fancybox.resize();
	return false;
}



var wen;
var war = 'leer';
var knoten;
        
function anzeigen(wen)
{	
	if ((war != 'leer') && (war != 'alle'))
		{
			document.getElementById( war ).style.display = 'none';
    	}
   if (war == 'alle')
   	{
			document.getElementById( 'listenhinweis' ).style.display = 'block';
   		knoten = document.getElementById( 'mitgliederliste' ).firstChild;
   		do
   		{
   			if (knoten.nodeName == 'TABLE')
					{	
						knoten.style.display = "none";
					}
				if (knoten.nodeName == 'P')
					{
						knoten.style.display = "none";	
					}
			knoten = knoten.nextSibling;
   		}
   		while (knoten != null);
   	}
   if (wen == 'alle')
   	{
			document.getElementById( 'druckhinweis' ).style.display = 'block';
			document.getElementById( 'listenhinweis' ).style.display = 'none';
   		knoten = document.getElementById( 'mitgliederliste' ).firstChild;
   		do
   		{
   			if (knoten.nodeName == 'TABLE')
					{	
						knoten.className = "listenadresse";
						knoten.style.display = "block";	
					}
				if (knoten.nodeName == 'P')
					{
						knoten.style.display = "block";
						knoten.style.marginBottom = "40px";
					}
			knoten = knoten.nextSibling;
   		}
   		while (knoten != null);
   	}
   else
   	{
			document.getElementById( 'druckhinweis' ).style.display = 'none';
			document.getElementById( wen ).className = 'einzeladresse';
			document.getElementById( wen ).style.display = 'block';
		}
	war = wen;
}

