Shadowbox.init();

$(document).ready(function()
{
	// Check if the client is an iPad
	var isiPad = navigator.userAgent.match(/iPad/i) != null;

	//On Hover Over
	function intentHoverOver()
	{
		var me = $(this)
		$(this).children('div').fadeIn('slow');
	}
	//On Hover Out
	function intentHoverOut()
	{
		$(this).children('div').fadeOut('slow');
	}
	
	//Set custom configurations
	var intentConfig = {
		sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		interval: 50, // number = milliseconds for onMouseOver polling interval
		over: intentHoverOver, // function = onMouseOver callback (REQUIRED)
		timeout: 0, // number = milliseconds delay before onMouseOut
		out: intentHoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	if(!isiPad)
	{
		$("ul#home_menu li").hoverIntent(intentConfig);
		$("ul#menu li").hoverIntent(intentConfig);
	}
	
	// Home menu fadeIn effect
	$("ul#home_menu li").css("display", "none");
	$("ul#home_menu li").each(function(i, menu){
		$(this).delay(i*300).fadeIn('slow');
	});
	
	/* Over animation effects */
	$('.rollover').hover(
		// Mouseover, fadeIn the hidden hover class    
		function() {
			$(this).children('.rollover_on').fadeIn('2000');
		},   
	
		// Mouseout, fadeOut the hover class  
		function() {
			$(this).children('.rollover_on').fadeOut('2000');    
	});
	
	/* Terrasse rooftop slider */
	$('#terrasses_rooftop_content_right div#image ul').nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:1000, // Slide transition speed
        pauseTime:7000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:false, // Next & Prev navigation
        directionNavHide:false, // Only show on hover
        controlNav:false, // 1,2,3... navigation
        keyboardNav:false, // Use left & right arrows
        pauseOnHover:false, // Stop animation while hovering
        captionOpacity:0.8, // Universal caption opacity
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
    });
	
	/* Events services fader */
	$('#events_services_pictures').innerfade({
		animationtype: 'fade',
		speed: 2000,
		timeout: 6000,
		type: 'random'
	});
	
	/* Events services slider */
	$("#events_services_slider").easySlider({
		continuous: false
	});
	
	/* Events passion fader */
	$('#events_passion_pictures').innerfade({
		animationtype: 'fade',
		speed: 2000,
		timeout: 6000,
		type: 'random'
	});
	
	/* Events references slider */
	$("#events_references_slider").easySlider({
		continuous: false
	});
	
	/* Multimedia galerie slider */
	$("#multimedia_galerie_list").easySlider({
		continuous: false
	});

});

