$(document).ready(function(){
  
    $(document).pngFix(); 

    
    $("#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").hover(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);
      
    });

    $("#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 
    });     


    $("#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").hover(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);
      
    });


    $('#slideshow3').cycle();
    
    $('#slideshow2').cycle({
        prev:   '#prev',
        next:   '#next',
        timeout: 0
    });
    
    $('#slideshow1').cycle({
        delay: 1500,
        speed: 1500,
        before: onBefore
    });
    
    $('div.panel123').cycle({
        delay: 1500,
        speed: 1500,
        before: onBefore
    });    
    
    $('#small_thumbnails ul li').cycle({
        delay: 1500,
        speed: 1500,
        before: onBefore
    });
    
    function onBefore() {
        $('#title').html(this.alt);
    }
});


$(document).ready(function()
{
  $("div.category-container").mouseover(function ()
  {
    $(this).addClass("category-container-hover");
  });

  $("div.category-container").mouseout(function ()
  {
    $(this).removeClass("category-container-hover");
  });
});

$(document).ready(function()
{
  $("div.side-buttons").mouseover(function ()
  {
    $(this).addClass("side-buttons-hover");
  });

  $("div.side-buttons").mouseout(function ()
  {
    $(this).removeClass("side-buttons-hover");
  });
});
    

