
  $(function() {
      var d=1000;
      $('#menu span').each(function(){
          $(this).stop().animate({
              'top':'-17px'
          },d+=250);
      });

      $('#menu > li').hover(
      function () {
          var $this = $(this);
          $('a',$this).addClass('hover');
          $('span',$this).stop().animate({'top':'40px'},300).css({'zIndex':'10'});
      },
      function () {
          var $this = $(this);
          $('a',$this).removeClass('hover');
          $('span',$this).stop().animate({'top':'-17px'},800).css({'zIndex':'-1'});
      }
  );
  });





    $('.item').hover(
        function(){
            var $this = $(this);
            expand($this);
        },
        function(){
            var $this = $(this);
            collapse($this);
        }
    );
    function expand($elem){
        var angle = 0;
        var t = setInterval(function () {
            if(angle == 1440){
                clearInterval(t);
                return;
            }
            angle += 40;
            $('.link',$elem).stop().animate({rotate: '+=-40deg'}, 0);
        },10);
        $elem.stop().animate({width:'268px'}, 1000)
        .find('.item_content').fadeIn(400,function(){
            $(this).find('p').stop(true,true).fadeIn(600);
        });
    }
    function collapse($elem){
        var angle = 1440;
        var t = setInterval(function () {
            if(angle == 0){
                clearInterval(t);
                return;
            }
            angle -= 40;
            $('.link',$elem).stop().animate({rotate: '+=40deg'}, 0);
        },10);
        $elem.stop().animate({width:'52px'}, 1000)
        .find('.item_content').stop(true,true).fadeOut().find('p').stop(true,true).fadeOut();
    }

