
//to do on page load
$(document).ready(function() {
  /*
   * Gallery area
   */
    $("#slider.mini_slider").easySlider({
      auto: false, 
      continuous: true,
      numeric: true,
      numericId: 'controls',
      nextId: "slider1next",
      prevId: "slider1prev"
    });
    
    $("#slider.large_gallery").easySlider({
      auto: false, 
      continuous: true,
      numeric: true,
      numericId: 'hidden_controls',
      nextId: "slider1next",
      prevId: "slider1prev"
    });
    
    $('#slider').hover( function() {
        $(this).find('ul li div.gallery_text').slideDown(1000);
      },
      function() {
        $(this).find('ul li div.gallery_text').slideUp("slow");
      }
    );
    
    $('#thumb_paging li a').bind('click', { param: $(this) }, change_thumb_page);
});


function change_thumb_page(event) {
  old_index = $('#thumb_paging li.current').index();
  new_index = $(this).parent().index();
  
  $('#thumb_paging li.current').removeClass('current');
  $('#thumb_paging li:eq(' + new_index + ')').addClass('current');
  
  $('#slider2 > li:eq(' + old_index + ')').toggle();
  $('#slider2 > li:eq(' + new_index + ')').show();
}

