$(document).ready(function() {

	/** slideshow **/
    $("#slideshow").cycle({
		fx: 'shuffle' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	$("#slideshow2").cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	/** modalBox **/
	
	$("a.group").fancybox({
		'width'				: '600',
		'height'			: '500',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titleShow'			: false
	});
	
	$("a.iframe").fancybox({
		'type'				: 'iframe',
		'cyclic'			: true
	});
	
	/** switch pages activités **/
	
	$("a.artisans").click(function(){
		$("#artisans-content").fadeIn();
		$("#restaurants-content").fadeOut();
		$("#loisirs-content").fadeOut();
		return false;
	});
	
   $("a.restaurants").click(function(){
		$("#restaurants-content").fadeIn();
		$("#artisans-content").fadeOut();
		$("#loisirs-content").fadeOut();
		return false;
	});
	
   $("a.loisirs").click(function(){
		$("#loisirs-content").fadeIn();
		$("#restaurants-content").fadeOut();
		$("#artisans-content").fadeOut();
		return false;
	});    
		 
	
	/** switch page chambres **/
   $("a.canche").click(function(){
		$("#canche-content").fadeIn();
		$("#authie-content").fadeOut();
		$("#crequoise-content").fadeOut();
		$("#planquette-content").fadeOut();
		$("#ternoise-content").fadeOut();
		$("#exterieur-content").fadeOut();
		return false;
	});
	
   $("a.authie").click(function(){
		$("#authie-content").fadeIn();
		$("#canche-content").fadeOut();
		$("#crequoise-content").fadeOut();
		$("#planquette-content").fadeOut();
		$("#ternoise-content").fadeOut();
		$("#exterieur-content").fadeOut();
		return false;
	});
	
   $("a.crequoise").click(function(){
		$("#crequoise-content").fadeIn();
		$("#authie-content").fadeOut();
		$("#canche-content").fadeOut();
		$("#planquette-content").fadeOut();
		$("#ternoise-content").fadeOut();
		$("#exterieur-content").fadeOut();
		return false;
	});
	
   $("a.planquette").click(function(){
		$("#planquette-content").fadeIn();
		$("#authie-content").fadeOut();
		$("#canche-content").fadeOut();
		$("#crequoise-content").fadeOut();
		$("#ternoise-content").fadeOut();
		$("#exterieur-content").fadeOut();
		return false;
	});
	
   $("a.ternoise").click(function(){
		$("#ternoise-content").fadeIn();
		$("#authie-content").fadeOut();
		$("#canche-content").fadeOut();
		$("#planquette-content").fadeOut();
		$("#crequoise-content").fadeOut();
		$("#exterieur-content").fadeOut();
		return false;
	});
	
   $("a.exterieur").click(function(){
		$("#exterieur-content").fadeIn();
		$("#ternoise-content").fadeOut();
		$("#authie-content").fadeOut();
		$("#canche-content").fadeOut();
		$("#planquette-content").fadeOut();
		$("#crequoise-content").fadeOut();
		return false;
	});
	
	/**slidingBox **/
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'200px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
});
