/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

// execute your scripts when DOM is ready. this is a good habit
$(function() {

  // initialize scrollable
  $("div.scrollable").scrollable({
    size: 1,
    loop: true,
    clickable: false,
    items: '#thumbs',
    hoverClass: 'hover',
    circular: true,
    mousewheel: true

  }).autoscroll({interval: 5000});



  // setup triggers
  $("a[rel]").each(function(i) {

    $(this).overlay({

      // common configuration for each overlay
      oneInstance: false,
      closeOnClick: false,

      // use apple effect
      effect: 'apple',
      expose: '#000',

      onBeforeLoad: function() {
        // grab wrapper element inside content
        var wrap = this.getContent().find("div.wrap");

        // load only for the first time it is opened
        if (wrap.is(":empty")) {
          wrap.load(this.getTrigger().attr("href"));
        }
      }

    });
  });


});


