// JavaScript Document




//text pour les onglets de l'accueil

$(document).ready(function(){
//animation des onglets  
    $('.boxgrid.caption').hover(function(){  
        $(".cover", this).stop().animate({top:'53px'},{queue:false,duration:300});  
    }, function() {  
        $(".cover", this).stop().animate({top:'170px'},{queue:false,duration:160});  
    });
	



//animation des onglets de realisation 
    $('.boxgrid2.caption2').hover(function(){  
        $(".cover2", this).stop().animate({top:'0px'},{queue:false,duration:300});  
    }, function() {  
        $(".cover2", this).stop().animate({top:'165px'},{queue:false,duration:160});  
    });	
	
	  

	//animation du sous-menu
$('.boxsousmenu.captionsousmenu').hover(function(){  
        $(".cover", this).stop().animate({left:'40px'},{queue:false,duration:120});  
    }, function() {  
        $(".cover", this).stop().animate({left:'-30px'},{queue:false,duration:60});  
    });  
	 });

// texte pour le banner de l'accueil

function slideSwitch() {
    var $active = $('#slideshow A.active');

    if ( $active.length == 0 ) $active = $('#slideshow A:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow A:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1500, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 9000 );
});	

$(function(){  
  
        //cache nav  
        var nav = $("#topNav");  
  
        //add indicators and hovers to submenu parents  
        nav.find("li").each(function() {  
            if ($(this).find("ul").length > 0) {  
  
                $("<span>").text("^").appendTo($(this).children(":first"));  
  
                //show subnav on hover  
                $(this).mouseenter(function() {  
                    $(this).find("ul").stop(true, true).slideDown();  
                });  
  
                //hide submenus on exit  
                $(this).mouseleave(function() {  
                    $(this).find("ul").stop(true, true).slideUp();  
                });  
            }  
        });  
    })(jQuery);  

