$(document).ready(function(){

  //Get the list of items.
  var items = $('li');
  i = items.length - 1;
  s = items.length - 1;
  
  for(a = items.length - 1; a >= 0; a--){
          $(items[a]).addClass("item-"+a);
  }
  
  //Animate the items.
 
  function comming(){
    if ( i >= 0){
      $(".item-"+i).animate({
        "opacity": "0.25"
        }, 'slow', 'linear', function(){});
        setTimeout(comming,100);
        i = i - 1; 
      }
      else{
        setTimeout(soon,300); 
      } 
  }
  
  function soon(){
     if ( i <= s){
       $(".item-"+i).animate({
         "opacity": "1"
         }, 'slow', 'linear', function(){});
         setTimeout(soon,100);
         i = i + 1; 
       }
       else{
         setTimeout(comming,300);
       } 
   }


  

    
  

  comming();
});
