// JavaScript Document
$.noConflict();
 
 
jQuery(document).ready(function() {
	jQuery("a[rel=fancybox]").fancybox({              
 					'titlePosition'  : 'inside',
					'transitionIn'   : 'elastic',
					'transitionOut'  : 'elastic',
					'titleFormat'		: function(alt, currentArray, currentIndex, currentOpts) {					return '<p>Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (alt.length ? ' &nbsp; ' + alt : '') + '</p>';				}
             
                                   });
	 jQuery("#facyframe").fancybox({
		'width'				: 980,
		'height'			: '80%',
        'autoScale'     	: false,
        'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe',
		'autoDimensions'	: false,
		'padding'			: '0'
	});

});


jQuery(document).ready(function() {

	 

		
jQuery("div.text").hide();	 
	 
			jQuery("a.open").click(function(event){
		   jQuery("div.text").hide();
		  jQuery(this)
				.parent()
				.find("div.text")
				.slideToggle();
				//$("div.text").hide();
 				event.preventDefault();
		 });

 });
 

 
 jQuery(window).load(function() {
     jQuery('#slider').nivoSlider({
        effect:'random', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:4500, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // 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.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
});

// jQuery SmoothScroll | Version 11-03-14
// jQuery SmoothScroll | Version 11-03-14
jQuery(document).ready(function() {

   jQuery('a[href*=#]').click(function() {

      // duration in ms
      var duration=1000;

      // easing values: swing | linear
      var easing='swing';

      // get / set parameters
      var newHash=this.hash;
      var target=jQuery(this.hash+', a[name='+this.hash.slice(1)+']').offset().top;
      var oldLocation=window.location.href.replace(window.location.hash, '');
      var newLocation=this;

      // make sure it's the same location      
      if(oldLocation+newHash==newLocation)
      {
         // set selector
         if(jQuery.browser.safari) var animationSelector='body:not(:animated)';
         else var animationSelector='html:not(:animated)';

         // animate to target and set the hash to the window.location after the animation
         jQuery(animationSelector).animate({ scrollTop: target }, duration, easing, function() {

            // add new hash to the browser location
            window.location.href=newLocation;
         });

         // cancel default click action
         return false;
      }
   });

});

