// JavaScript Document
//Lightbox
$(function() {			
		$('a.popup').lightBox();
});

$(document).ready(function(){	
						   
	//Statische Blätterfunktion
	var anzahl_content=$("div.content_m").length;
	
	for(var i=1; i<anzahl_content; ++i){
		$("div.content_m").eq(i).css("display","none");	
	}
	
	$("div#blaetter a").eq(0).removeAttr("alt");
	$("div#blaetter a").eq(0).attr("class","grey");
	
	$("div#blaetter a").click(function () {
		if($(this).attr("class")!="grey"){
			var einblenden=$(this).attr("alt");
			var ausblenden=$("div#blaetter").attr("alt");	
			
			$("div#blaetter a.grey").attr("alt",ausblenden);
			$("div#blaetter a.grey").attr("class","pointer");
	
			$(this).removeAttr("alt");
			$(this).attr("class","grey");
						
			$("div.content_m:eq("+ausblenden+")").fadeOut(1000, function () {				
				
				$("div.content_m:eq("+einblenden+")").fadeIn(1000, function () {
					$("div#blaetter").attr("alt",einblenden);	
					
					//$("span#blaetter_ausgabe").html(Number(einblenden)+1);
						
				});		
			});	
		}		
	});
	
});
