$(document).ready(function() {

	if($('ul#slideshow').find('li').length==1){
				$('#fullscreenimgcontainer').html($('ul#slideshow').find('span.bigImg').html()); 
				$('#fullscr-copyright').html($('ul#slideshow').find('.infos-roll-copyright').html() );
				$('#fullscr-title').html($('ul#slideshow').find('.infos-roll-title').html() );
				$('#fullscreenimgcontainer').find('img').show();
	}else{
		$('ul#slideshow').cycle(
			{ before: function(currSlideElement, nextSlideElement, options, forwardFlag) { 
				console.log($(nextSlideElement).html());
				console.log($(nextSlideElement).find('span.bigImg').html());
				console.log('---'); 
				$('#fullscreenimgcontainer').html($(nextSlideElement).find('span.bigImg').html()); 
				$('#fullscr-copyright').html($(nextSlideElement).find('.infos-roll-copyright').html() );
				$('#fullscr-title').html($(nextSlideElement).find('.infos-roll-title').html() );
				$('#fullscreenimgcontainer').find('img').show();},
			fit: 0,
			width: '100%',
			height: '100%'
		  }
		);
	}
	
	$('#fullscr-prev').click(function() { $('ul#slideshow').cycle('prev'); return false;   }  );
	$('#fullscr-next').click(function() { $('ul#slideshow').cycle('next'); return false;   }  );
	
		$(".buttonHide.off, .buttonHide.on").toggle(
		
		  function () {
		  	$('.buttonBottom, .bottomMenu li, .bottomBar').slideDown(400, function(){	
		  	    $('.buttonHide').removeClass('off');
		  	   	$('.buttonHide').addClass('on');   
		  	});
		  },
		  
		  function () {
		    $('.buttonBottom, .bottomMenu li, .bottomBar, #newsletterDiv, #espaceproDiv').slideUp(400, function(){
		        $('.buttonHide').removeClass('on');
		        $('.buttonHide').addClass('off');
		    });
		  }
		);
	
	$('.slideShow.zoom').click(function() {
		$('ul#slideshow').cycle('toggle');
		//$('#fullscreenimgcontainer').html($(this).parent().find('img.bigImg'));
		//$('#fullscreenimgcontainer').find('img').show();
	  $('#wrapper, .buttonTop, .topBar, #rotator').fadeOut(400, function() {
	  });
	  $('.buttonBottom, .bottomMenu li, .bottomBar, .buttonHide').fadeOut(400, function() {
	  });
	  $('.buttonBottom-fullscreen, #fullscreenimgcontainer').delay(400).fadeIn(400, function() {
	  });
	  return false;
	});
	
	$('.buttonBottom-fullscreen .dezoom').click(function() {
		$('ul#slideshow').cycle('toggle');
	  $('.buttonBottom-fullscreen, #fullscreenimgcontainer').fadeOut(400, function() {
	  });
	  $('.buttonHide').delay(400).fadeIn(400, function() {
	  });
	  $('#wrapper, .buttonTop, .topBar, #rotator').delay(400).fadeIn(400, function() {
	  });
	  return false;
	});
	
	$(".buttonHide.inactive, .buttonHide.active").toggle(
	  function () {
	  	$('#scroller').slideUp(500);
		$('#rotator').delay(200).fadeOut(500);
	  	$('.buttonHide').removeClass('inactive');
	  	$('.buttonHide').addClass('active');   
	  },
	  
	  function () {
	  	$('#rotator').fadeIn(500);
	    $('#scroller').delay(200).slideDown(500);
	    $('.buttonHide').removeClass('active');
	    $('.buttonHide').addClass('inactive');
	  }
	);
	
	$(".slideShow.images.frame .slideshow-hover").hover(function(){
	    $(this).fadeTo(300, 1.0);
	    },function(){
	    $(this).fadeTo(300, 0.0);
	    });
		
	
	$('.slide').click(function() {
	  $('.elementToSlide').slideToggle('slow', function() {
	    // Animation complete.
	  });
	});
	
});

function newsletterSlidein(btn){
		$(btn).slideToggle(400);
}

var hasBg = false;





