$(document).ready(function(){
  
  

    
    $("#mediumimage a").attr({ 
                  rel: "lightbox"
    });

    $("a[rel^='lightbox']").slimbox();    

    $("#arrow_right img").click(function(){
        $("#thumb_container").scrollTo( '+=840px', 1000, {axis:'x'} )
    });
    
    
    $("#arrow_left img").click(function(){
        $("#thumb_container").scrollTo( '-=840px', 1000, {axis:'x'} )
    });

    $("#view_all a").click(function(){
        $("#thumb_container").css({'overflow' : 'visible', 'height' : 'auto'});
        $("#thumbs").css({'width' : '960px'});
    });    

    $("#view_less a").click(function(){
        $("#thumb_container").css({'overflow' : 'hidden', 'height' : '165px'});
        $("#thumbs").css({'width' : '10000px'});
        $(this).hide();
        $("#view_all a").show();                 
    });  


    $("#small_thumbnails a").click (function(){
  		var proLink  = $(this).attr("href");
  		$("#main_img_a").attr({ href: proLink });
  		$("#main_img").attr({ src: proLink});  		
  		
      
      $(this).fadeTo(50, 0.5);
      $(this).fadeTo(300, 1);
      
      return false;
      
    });



    $("#thumbs a").hover(function(){

      $(this).fadeTo(50, 0.5);
      $(this).fadeTo(300, 1);
      
    });    		
    

    var $container = $('#image-rotation').cycle({ 
        delay:  3000, 
        speed:  1000,
        before: onBefore 
    }); 



    function onBefore() { 
        $('#title h3').html(this.alt); 
    }; 
    
    var $container = $('#timelapse').cycle({ 
        delay:  1000, 
        speed:  1000,
        before: onBefore 
    });     


});


