	  $(document).ready(function() {
          var stopTimer = false;
          var currentlyTransitioning = false;
        
          $('.panel').hide();
          $('.photo1').show();
          var currentlySelected = $('#projectSamplesSlider .photo1');
              
           $.timer(11000, function(timer){
               if(stopTimer == true)
               {
                   timer.stop();
               }
               else
               {
                 var element = $('#projectSamplesSlider .navigation a.selected').parent().next().children();
                 if(element.length > 0)
                 { 
                   GotoNextImage(true, element);                                           
                 }
                 else
                 {
                    element = $('#projectSamplesSlider .navigation a.first');
                    GotoNextImage(true, element);
                 }
               }
          });
        
        
        function GotoNextImage(isFromTimer, button)
        {
            if(currentlyTransitioning)
            {
               return;
            }
            currentlyTransitioning = true;
            if(isFromTimer == false)
            {
              stopTimer = true;
            }
            button
            .parents('ul:first')
                .find('a')
                    .removeClass('selected')
                .end()
            .end()
            .addClass('selected');
           
           var hash = button.attr('href').replace('#', '.');
            currentlySelected.fadeOut('slow', function() {
             currentlySelected = $('#projectSamplesSlider ' + hash);
			 
             $('#projectSamplesSlider ' + hash).fadeIn('slow', function() {
                currentlyTransitioning = false;
             });      
           });  
              
        } 
                     
         $('#projectSamplesSlider .navigation').find('a').click(function() {
          GotoNextImage(false, $(this));
         }); 
	   });

