product = {
  scroll: function() {
    $("div.scrollable").scrollable({ 
      next: '.nav-next #next',
      prev: '.nav-prev #prev',
      size: 1
    });
  },

  youMayLike: function() {
    $(".product-right .you-may-like-list ul li img").hover(
      function () {
        $(this).css({'border' : '1px solid #0C0C0C'});
      }, 
      function () {
        $(this).css({'border' : '1px solid #C2C2C2'});
      }
    );
  },

  fabrics: {
    replace: function() {
      $('.thumbnail-images li img').click( function() {
        // Hide the old image and show the selected one
        var fabricClass = $(this).attr('class');
        $('.main-image li.show').removeAttr('class');
        $('.main-image li#'+fabricClass).addClass('show');
      });
    },

    scroll: function() {
      $('.thumbnail-images').addClass('show');
      $('#thumbnails-fabric .carousel').jCarouselLite({
        btnNext: "#thumbnails-fabric .next",
        btnPrev: "#thumbnails-fabric .prev",
        visible: 3,
        scroll: 1,
        circular: false
      });
      $('#thumbnails-insitu .carousel').jCarouselLite({
        btnNext: "#thumbnails-insitu .next",
        btnPrev: "#thumbnails-insitu .prev",
        visible: 3,
        scroll: 1,
        circular: false
      });
      $('#thumbnails-product .carousel').jCarouselLite({
        btnNext: "#thumbnails-product .next",
        btnPrev: "#thumbnails-product .prev",
        visible: 3,
        scroll: 1,
        circular: false
      });
    }
  }
}

if (typeof window.jQuery != "undefined") {
  jQuery(product.scroll);
  jQuery(product.youMayLike);
  jQuery(product.fabrics.replace);
  jQuery(product.fabrics.scroll);
}


