$(document).ready(function(){

	$().piroBox({
		my_speed: 300, //animation speed
		bg_alpha: 0.5, //background opacity
		slideShow : 'true', // true == slideshow on, false == slideshow off
		slideSpeed : 3, //slideshow 
		close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
    });
	
	$('html').css({ 'overflow-y': 'scroll' });
	
	//*** HIDE SHOW NEXT DIV AFTER .hidetext CLASS ***//
	
	$(".hidetext").next("ul").hide();
	$('body').delegate('.hidetext','click mouseover', function(e){
		if(e.type == 'mouseover'){
			$(this).next("ul").show("slow");
		}else{
			$(this).next("ul").toggle("slow");
		}
	});
	
	$("#toptext-up").delay(500).show( 1000, function(){
		$("#toptext-down").delay(1000).animate({ width: "120px" }).delay(1000).animate({ width: "210px" }).delay(1000).animate({ width: "308px" });
	});
	
	$(function(){
    $('.fadein img:gt(0)').hide();
    setInterval(function(){
      $('.fadein :first-child').fadeOut(1500)
         .next('img').fadeIn(1500)
         .end().appendTo('.fadein');}, 
      5000);
	});
	
	$('.programme-menu').on('mouseover mouseout', 'a', function(e){
		if(e.type == 'mouseover'){
			$(this).stop().animate({ 'padding-left': '12px', color: '#d35f53' }, 300);
		}else{
			$(this).stop().animate({ 'padding-left': 0, color: '#6B160D' }, 300);
		}
	});
	
	$('#galerie-p').delegate('.gallery-img','mouseover mouseout', function(e){
		if(e.type === 'mouseover'){
			$(this).css({opacity: 0.7});
		}else{
			$(this).css({opacity: 1});
		}
	});
	
	$('#galerie-p').delegate('.gallery-img','click', function(e){
		$('.gallery-small').hide();
		$(window).scrollTop('0');
		$(this).parent('.gallery-small').next('.gallery-hidden').show();
	});
	
	$('#galerie-p').delegate('.gallery-back','click', function(e){
		$(this).parent('.gallery-hidden').hide();
		$(window).scrollTop('0');
		$('.gallery-small').show();
	});
	
	//*** END HIDE SHOW ***//
	
	var href = window.location.href;
	var splithref = href.split('=');
	$('a[href*="'+splithref[1]+'"]').addClass('top-active');

});
