/*
  JS Grundfunktionen | © 2009 by floristik-geisberger.de
____________________________________________ */

$(document).ready(function(){

	$.fn.geisbergerScripts = function(settings) {
		settings = jQuery.extend( {

      AnimationsZeit: '500' // Durschnittliche Zeit aller Animationen

  	},settings);
  	
    $(".nav2spacer:last").css('padding', '0 0 9px 22px');

    var contentWidth = $("#content").width();
    $("h1").css('width', contentWidth);

// --------------------- REFERENZEN -------------------------------

    if ( $("#gallery").length > 0 ) {

   		var gallery = $("#gallery").galleriffic("#img_navigation", {
				delay: 3000,
				numThumbs: 8,
    		renderSSControls: false,
        enableBottomPager: false,
         preloadAhead: 8,
				imageContainerSel: '#slideshow',
				controlsContainerSel: '#controls',
				titleContainerSel: '#image-title',
				descContainerSel: '#image-desc',
				downloadLinkSel: '#download-link'
			});

			gallery.onFadeOut = function() {
				$("#details").fadeOut('fast');
				$(".selected").css('opacity', '0.5');
			};

			gallery.onFadeIn = function() {
				$("#details").fadeIn('fast');
  			$(".thumbs li").css('opacity', '0.5');
				$(".selected").css('opacity', '1.0');
				};

    };
  	
	};

  // Activate geisbergerScripts if HTML is ready
  $("html").geisbergerScripts();

});
