$(document).ready(function(){
    
    // screenshot slideshow
  $('ul#slideshow_carousel.carousel').jcarousel({
    scroll: 1,
    initCallback: init_carousel,
    buttonNextCallback: next_callback,
    buttonPrevCallback: prev_callback
  })


});

function next_callback(carousel,button,disable)
{
  var button = $('.carousel_controls .next');
  
  if(disable)
  {
    button.removeClass('disabled');
  }
  else
  {
    button.addClass('disabled');
  }
}

function prev_callback(carousel,control,disable)
{
  var button = $('.carousel_controls .previous');
  
  if(disable)
  {
    button.removeClass('disabled');
  }
  else
  {
    button.addClass('disabled');
  }
}



// this method binds forward/next using generic
// class names, so it can be used for any carousel
function init_carousel(carousel)
{
  // binds next button
  $('.carousel_controls .next').bind('click', function(){
    carousel.next();
    return false;
  });
  
  
  // binds previous button 
  $('.carousel_controls .previous').bind('click', function(){
    carousel.prev();
    return false;
  });
}