function initGallery() {
	// bildergalerie
	$(".gallery-thumb").click(function(e) {

		var src = $(this).attr("src");

		$(".gallery-thumb").removeClass("gal-selected");
		$(this).addClass("gal-selected");
		$(".gallery-view").attr("src", src);
		$(".gallery-view").hide().fadeIn();

	});
	
	// weingalerie
	$(".gallery-thumb2").click(function(e) { 
				
		var src = $(this).attr("rel");
		
		$(".gallery-thumb2").removeClass("gal-selected");
		$(this).addClass("gal-selected");
		$(".info-box").hide();
		$("#"+src).fadeIn()
				
	});
	
	// bildergalerie blätterfunktion
	var galIndex = 0;
	var galRowLength = 7;
	var galThumbCount;
	
	function showCurrentThumbs() {
		//console.log(galIndex + ", i = " + galIndex*galRowLength + " und < " +  Number(galIndex*galRowLength+galRowLength));
		var i = 0;
		var min = galIndex*galRowLength;
		var max = Number(galIndex*galRowLength+galRowLength)
		$('.gallery-thumb').hide();
		$('.gallery-thumb').each(function() {
			if (i >= min && i < max) {
				$(this).show();
			}
			i++;
		});
		if (!galThumbCount) galThumbCount = i;
		
		if (galIndex <= 0) $("#arrow-left").hide();
		else $("#arrow-left").show();
		
		if (galIndex >= Math.floor(galThumbCount/galRowLength)) $("#arrow-right").hide();
		else $("#arrow-right").show();
	}
	showCurrentThumbs();
	
	$("#arrow-left").click(function(e) {
		if (galIndex > 0) galIndex--;
		showCurrentThumbs();
	});
	$("#arrow-right").click(function(e) {
		if (galIndex < Math.floor(galThumbCount/galRowLength)) galIndex++;
		showCurrentThumbs();
	});
	
}
