$(function(){

$(document).ready(function() {

$("a.speisekmodal").fancybox({
	'transitionIn'	:	'fade',
	'transitionOut'	:	'fade',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'height'		:	700,
	'width'			:	980,
	'overlayShow'	:	false,
	'padding'		:	5,
	'scrolling'		:	'no'
});
$("a.contactmodal").fancybox({
	'transitionIn'	:	'fade',
	'transitionOut'	:	'fade',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'height'		:	600,
	'width'			:	580,
	'overlayShow'	:	false,
	'padding'		:	5,
	'scrolling'		:	'yes'
});
$("a.reservmodal").fancybox({
	'transitionIn'	:	'fade',
	'transitionOut'	:	'fade',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'height'		:	660,
	'width'			:	580,
	'overlayShow'	:	false,
	'padding'		:	5,
	'scrolling'		:	'yes'
});


$("a[rel=lightboxgroup]").fancybox({
				'transitionIn'	:	'fade',
				'transitionOut'	:	'fade',
				'speedIn'		:	600, 
				'speedOut'		:	200, 
				'overlayShow'	:	true,
				'padding'		:	5,
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});


	var bgCount = 0;
	var bgImages = $('div.ngg-widget a').length;

	$('#imagecontrolright').click(function() {
		var indent = parseInt($('div.ngg-widget').css("textIndent"));
		var indent = Math.round(indent/128)*128;
		var newindent = indent-128;
		bgCount++;
		if (bgImages-7 <= bgCount ) {
			bgCount = 0;
			newindent = 0;
		}
		$('div.ngg-widget').animate({
										textIndent: newindent+"px"
							}, 1000, function() {
		});
	});
	$('#imagecontrolleft').click(function() {
		var indent = parseInt($('div.ngg-widget').css("textIndent"));
		var indent = Math.round(indent/128)*128;
		var newindent = indent+128;
		bgCount--;
		if (bgCount-7 <= 0 ) {
			bgCount = bgImages;
			newindent = -(bgImages-7)*128;
		}
		$('div.ngg-widget').animate({
										textIndent: newindent+"px"
							}, 1000, function() {
		});
	});


});
});
