/*Share*/
$(document).ready(function(){

                $("#box").mouseover(function(){
                        $("#box").animate({left: '0px'});
                });
                $("#box").mouseleave(function(){
                    $("#box").animate({left: '-34px'});
                });
            });
    var didit = false;
	$("#kontakt").waypoint(function() {
						if(didit == false) {
						offset: '50%',
						$("#box").animate({left: '0px'},2000);
						$("#box").animate({left: '-34px'},2000);
						didit = true;
						} else
						{}
    });


/*Tinyscrollbar*/
	$(document).ready(function(){
		$('#scrollbar1').tinyscrollbar({ sizethumb: 60 });
					});

/*Quicksand*/
$(document).ready(function() {
  // get the action filter option item on page load
  var $filterType = $('#filterOptions li.active a').attr('class');

  // get and assign the ourHolder element to the
  // $holder varible for use later
  var $holder = $('ul.ourHolder');

  // clone all items within the pre-assigned $holder element
  var $data = $holder.clone();

  // attempt to call Quicksand when a filter option
  // item is clicked
  $('#filterOptions li a').click(function(e) {
    // reset the active class on all the buttons
    $('#filterOptions li').removeClass('active');

    // assign the class of the clicked filter option
    // element to our $filterType variable
    var $filterType = $(this).attr('class');
    $(this).parent().addClass('active');
    if ($filterType == 'all') {
      // assign all li items to the $filteredData var when
      // the 'All' filter option is clicked
      var $filteredData = $data.find('li');
    }
    else {
      // find all li elements that have our required $filterType
      // values for the data-type element
      var $filteredData = $data.find('li[data-type=' + $filterType + ']');
    }

    // call quicksand and assign transition parameters
    $holder.quicksand($filteredData, {
      duration: 800,
      easing: 'easeInOutQuad',
	  enhancement: function() {
	  $("a[data-lightbox]").lightbox();
	  }
    });
    return false;
  });
});


	
/*BX Slider*/
$(document).ready(function(){
        $('#slider1').bxSlider({
            infiniteLoop: true,
            hideControl: true,
			auto: true,
			speed: 800,
			pause: 5000
        });
    });
$(document).ready(function(){
		 $('#blog .mod_newslist').bxSlider({
			pager: true,
			infiniteLoop: false,
			hideControlOnEnd: true,
			pagerLocation: 'top',
			mode: 'fade'
        });
    });

/*ScrollTo*/
jQuery(function( $ ){
$.localScroll({offset:-160,duration:2500});
});

/*Waypoints*/
jQuery(function($) {
    // Register each section as a waypoint.
    $('article').waypoint({ offset: '50%' });
    
    // The same for all waypoints
    $('body').delegate('article', 'waypoint.reached', function(event, direction) {
        var $active = $(this);
        
        if (direction === "up") {
            $active = $active.prev();
        }
        if (!$active.length) $active.end();
        
        $('.section-active').removeClass('section-active');
        $active.addClass('section-active');
        
        $('.link-active').removeClass('link-active');
        $('a[href=#'+$active.attr('id')+']').addClass('link-active');
    });
    
    // Negates the flash of non-active nav.
    $('body > header nav a').click(function() {
        $(this).addClass('link-active');
    }).eq(0).addClass('link-active');

});

/*Lightbox*/
   $(document).ready(function(){
      $("a[data-lightbox]").lightbox();
   });
