$(document).ready(function(){    
    $('#slides').slides({
				preload: false,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-35
					},100);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
  
              
     var safeMode = false;
     if($.browser.msie){
         if( jQuery.browser['version'] < 9){
             safeMode = true;
         }
         
     }

    
    
   $('#firstMenu a').each(function(){
       var opac;
       $menu = $(this);
       if($(this).parent('li').hasClass("actif")){
           opac = 1;
           if(safeMode){
              $menu.css("borderBottom", "2px solid #ccc");
           }
           
       }else{
           
           opac = 0.6;
           if(safeMode == true) opac = 1;
       }
       
       $(this)
                .css( {opacity: opac} )
                .hover(function(){
                        $(this).stop().animate(
                                {opacity: 1}, 100)
                        },
                        function(){
                        $(this).stop().animate(
                                {opacity: opac}, 1000)
                        })   
   })
   
   if(! safeMode){
   $('#firstMenu .actif a').css( {opacity: 0} )
   $('#firstMenu .actif a').animate({opacity: 1}, 500);
   }

})
