

$(window).load(function () {
  // run code
  $('#t1').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '60', height: '40'}, {duration: 1500, easing: 'easeOutExpo'},  function() {
    // Animation complete.
  }).css('overflow', 'visible');
    
    $(this).oneTime(250, function() {
    
    $('#t2').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '60', height: '40'}, {duration: 1500, easing: 'easeOutExpo'}, function() {
    // Animation complete.
    }).css('overflow', 'visible');
    
    });
    
      $(this).oneTime(500, function() {
    
    $('#t3').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '60', height: '40'}, {duration: 1500, easing: 'easeOutExpo'}, function() {
    // Animation complete.
    }).css('overflow', 'visible');
    
    });

          $(this).oneTime(750, function() {
    
    $('#t4').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '40', height: '40'}, {duration: 1500, easing: 'easeOutExpo'}, function() {
    // Animation complete.
    }).css('overflow', 'visible');
    
    });
    
          $(this).oneTime(1000, function() {
    
    $('#t5').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '40', height: '40'}, {duration: 1500, easing: 'easeOutExpo'}, function() {
    // Animation complete.
    }).css('overflow', 'visible');
    
    });
    
          $(this).oneTime(1250, function() {
    
    $('#t6').animate({opacity: '1', paddingTop: '75',fontSize: '80', width: '40', height: '40'}, {duration: 1500, easing: 'easeOutExpo'}, function() {
    // Animation complete.
    }).css('overflow', 'visible');
    
    });

  

  
  
  
  
  
});


$(window).ready(function () {

function runAnimation() {
        var gauche = (Math.floor(Math.random()*91)) + 400;
        var haut = (Math.floor(Math.random()*60)+ 69);
     $("#oiseaux1").animate({
     left: gauche, top: haut}, {duration: 1500, easing: 'easeInOutCubic'}
    , function() { runAnimation() });
}

function runAnimation2() {
        var gauche = (Math.floor(Math.random()*91)) + 400;
        var haut = (Math.floor(Math.random()*60)+ 69);
     $("#oiseaux2").animate({
     left: gauche, top: haut}, {duration: 1500, easing: 'easeInOutCubic'}
    , function() { runAnimation() });
}

function runAnimation3() {
        var gauche = (Math.floor(Math.random()*91)) + 400;
        var haut = (Math.floor(Math.random()*60)+ 69);
     $("#oiseaux3").animate({
     left: gauche, top: haut}, {duration: 1500, easing: 'easeInOutCubic'}
    , function() { runAnimation() });
}





setInterval(runAnimation,1510);
setInterval(runAnimation2,1210);
setInterval(runAnimation3,1710);
       
        
        

 $("#bottom").mouseenter(function(){
         
     $("footer").css({height: '300'}).stop().animate({top: '-100'}, {duration: 500, easing: 'easeOutQuint'}, function() {  });
     $("#bottom").css({'overflow': 'visible'});
     
    });
    
     $("#bottom").mouseleave(function(){
        //$("footer").animate({top: '0'}, {duration: 200, easing: 'easeOutQuint'}, function() { alert("ok"); });
          $('footer').stop().animate({
    top: '0'  }, 400, function() {    // Animation complete.
                                      $("#bottom").css({'overflow': 'hidden'});  
                                });
    
     });


        
//var menuli = $(".menu li");
//console.log(menuli);

$(".menu li").each(function() {
        $(this).hover(
    function() {
        $(this).stop().animate({backgroundColor:'#006CAD',"color":"white"}, 600);
        }, function () {
                var aclass = $(this).hasClass('select');
                if (aclass == true) {
                        
                } else {
        $(this).stop().animate({backgroundColor:'#FFFFFF', "color":"#006CAD"}, 400);
        }
    });


        
});

$(".portcaption a").each(function() {
        $(this).hover(
    function() {
        $(this).stop().animate({backgroundColor:'#006CAD',"color":"white"}, 600);
        }, function () {
                var aclass = $(this).hasClass('select');
                if (aclass == true) {
                        
                } else {
        $(this).stop().animate({backgroundColor:'#FFFFFF', "color":"#006CAD"}, 400);
        }
    });


        
});

     
        
$('#services').click(function() {
        
           $(".menu li").each(function() {
                var aclass = $(this).hasClass('select');
                if (aclass == true) {
                    $(this).stop().animate({backgroundColor:'#FFFFFF', "color":"#006CAD"}, 400);
                    $(this).removeClass('select');
                } else {   }
           });
           
           $('#main').animate({left: '-910',top: '0'}, {duration: 1300, easing: 'easeInOutExpo'}, function() {  } );
           $('#soleil').animate({left: '600'}, {duration: 1300, easing: 'easeInOutExpo'});
           $('#services').addClass('select');
        });


$('#home').click(function() { 
         $(".menu li").each(function() {
              var aclass = $(this).hasClass('select');
              if (aclass == true) {
                  $(this).stop().animate({backgroundColor:'#FFFFFF', "color":"#006CAD"}, 400);
                  $(this).removeClass('select');
                } else {   }
           });
        $('#main').animate({left: '0',top: '0'}, {duration: 1300, easing: 'easeInOutExpo'}, function() {  }).fadeIn(500);
       
        $('#soleil').animate({left: '450'}, {duration: 1300, easing: 'easeInOutExpo'});
        $('#home').addClass('select');
        });

$('#portofolio').click(function() { 
         $(".menu li").each(function() {
              var aclass = $(this).hasClass('select');
              if (aclass == true) {
                  $(this).stop().animate({backgroundColor:'#FFFFFF', "color":"#006CAD"}, 400);
                  $(this).removeClass('select');
                } else {   }
           });
        $('#main').animate({left: '-1910',top: '0'}, {duration: 1300, easing: 'easeInOutExpo'}, function() {  }).fadeIn(500);
       
        $('#soleil').animate({left: '800'}, {duration: 1300, easing: 'easeInOutExpo'});
        $('#portofolio').addClass('select');
        });
  
        
});
