$(document).ready(function() {
			
			if ($("a[rel=gallerie1]").length > 0) {
				$("a[rel=gallerie1]").fancybox({
					'titlePosition' 	: 'over',
					'overlayOpacity'	: '0.8',
					'overlayColor'		: '#222',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + 								title : '') + '</span>';
					}
				});
			}
			
			if($("a[rel=gallery[MI2]]").length > 0) {
				$("a[rel=gallery[MI2]]").fancybox({
					'titlePosition' 	: 'over',
					'overlayOpacity'	: '0.8',
					'overlayColor'		: '#222',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + 								title : '') + '</span>';
					}
				});
			}
			
			if($("a[rel=gallery[iTunesXML2HTML]]").length > 0) {
				$("a[rel=gallery[iTunesXML2HTML]]").fancybox({
					'titlePosition' 	: 'over',
					'overlayOpacity'	: '0.8',
					'overlayColor'		: '#222',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + 								title : '') + '</span>';
					}
				});
			}
			
			if($("a[rel=gallery[MI2]]").length > 0) {			
				$("a[rel=gallery[MI2]]").fancybox({
					'titlePosition' 	: 'over',
					'overlayOpacity'	: '0.8',
					'overlayColor'		: '#222',
					'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + 								title : '') + '</span>';
					}
				});
			}
});
			
	$(window).load(function() {
		if ($("#sliderIndex").length > 0) {
			$('#sliderIndex').nivoSlider({
				effect:'sliceDownLeft', //Specify sets like: 'fold,fade,sliceDown'
				slices:15,
				animSpeed:1200,
				pauseTime:5000,
				startSlide:0, //Set starting Slide (0 index)
				directionNav:true, //Next & Prev
				directionNavHide:true, //Only show on hover
				controlNav:false, //1,2,3...
				controlNavThumbs:true, //Use thumbnails for Control Nav
		      	controlNavThumbsFromRel:false, //Use image rel for thumbs
				controlNavThumbsSearch: '.jpg', //Replace this with...
				controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
				keyboardNav:true, //Use left & right arrows
				pauseOnHover:true, //Stop animation while hovering
				manualAdvance:false, //Force manual transitions
				captionOpacity:0.6, //Universal caption opacity
				beforeChange: function(){},
				afterChange: function(){},
				slideshowEnd: function(){} //Triggers after all slides have been shown
			});
		}
	});
