      $(document).ready(function() {		  
        $('#links > a').hover(
         function(){ $('.foot-menu > ul > li:eq('+$(this).index()+') > h2 > a').addClass('hover') },
         function(){ $('.foot-menu > ul > li:eq('+$(this).index()+') > h2 > a').removeClass('hover')}         
        );
        // ������������ �����������
        (function($) {
          var cache = [];
          $.preLoadImages = function(url) {            
            var cacheImage = document.createElement('img');
            cacheImage.src = url;
            cache.push(cacheImage);              
          }
        })(jQuery);
        var preload = true;
        var firstStart = true;
        var rotateImages = function(){
          if(preload){
            $('.slide-group:not(.shown):first > input').each(function(i, element){
              jQuery.preLoadImages($(element).attr('value'));
            });         
          }          
          $('.holder > img').each(function(index, image){       
            firstStart
            var next = $('.slide-group:not(.shown):first > input:not(.shown):eq(' +index+ ')');
            image = $(image);                                    
            image.delay(index*200+ (!firstStart? 3000: 4000)).animate(
              {                
                'width': 0,
                'margin-right': 65,
                'margin-left': 65
              }, 300, 'linear', function() {    // 1150 
                firstStart = false;
                image.attr('src', next.attr('value'));
                image.animate(
                  {                    
                    'width': 130,
                    'margin-right': 0,
                    'margin-left': 0
                   }, 300, 'linear', function() {                      
                      next.addClass('shown');
                      // ���� ����� ������ �� �������� ������, �� �� ���������� ��� ����������
                      if($('.slide-group:not(.shown):first > input:not(.shown)').length == 0){
                        $('.slide-group:not(.shown):first').addClass('shown');
                        // ���� ������� ������ ���, �� �������� ��� ��� �� ���������� � �������� � ������
                        if($('.slide-group:not(.shown)').length == 0){
                          preload = false;
                          $('.shown').removeClass('shown');
                        }
                        //������� ���������� ����������
                        rotateImages();
                      }
                    }
                  )
                }
            );
          });
        };
        
        //$('#slideshow').bind('click', function(){ rotateImages() });
        rotateImages();
      });
