// jquery functions
$(document).ready(function(){

	jQuery.easing.def = 'easeInOutExpo';

	$("a").hover(
		function () {
			$(this).addClass("hover");
		}, 
		function () {
			$(this).removeClass("hover");
		}
	);
	
	$(".menu li a").hover(
		function () {
			$(this).parent('li').find('.container').animate({top: 0}, {duration: 700, easing: 'easeOutExpo'});
		},
		function () {
			$(this).parent('li').find('.container').animate({top: 45}, {duration: 400, easing: 'easeInExpo'});
		}
	);
	
	$(".menu li a.scroll").click(
		function(event) {
			if ($($(this).attr('href')).length != 0) {
				$.scrollTo($(this).attr('href'), 1000);
			}
			
			event.preventDefault();
		}
	);
	
	$('.slideshow').crossSlide(
		{
			sleep: 3,
			fade: 1
		}, 
		[
			{ src: 'img/diapo/image-01.jpg' },
			{ src: 'img/diapo/image-02.jpg' },
			{ src: 'img/diapo/image-03.jpg' },
			{ src: 'img/diapo/image-04.jpg' },
			{ src: 'img/diapo/image-05.jpg' },
			{ src: 'img/diapo/image-06.jpg' }
		]
	);
	
	$('#locative a.toggle').click(
		function(event) {
			var infobox = $(this).parent().children('.infobox');
			var height = 0;
			
			if (infobox.height() == 0)
			{
				height = 105;
				$(this).addClass('close');
				$(this).removeClass('open');
			}
			else
			{
				$(this).addClass('open');
				$(this).removeClass('close');
			}
			
			infobox.animate({height: height}, {duration: 500, easing: 'linear'});
			
			
			event.preventDefault();
		}
	);
	
	$('#locative .slidedown a').click(
		function(event) {
			$('#locative #forfaits').animate({height: 0}, {duration: 1000, easing: 'easeInOutCirc'});
			
			event.preventDefault();
		}															
	);
	$('#locative .slideup a').click(
		function(event) {
			$('#locative #forfaits').animate({height: 280}, {duration: 1000, easing: 'easeInOutCirc'});
			
			event.preventDefault();
		}															
	);
	

	
});
