/* 
 * 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',
    // when seek starts make items little transparent
    onBeforeSeek: function() {
      this.getItems().fadeTo(300, 0.2);
    },
    // when seek ends resume items to full transparency
    onSeek: function() {
      this.getItems().fadeTo(300, 1);
    }
  }).circular().navigator().autoscroll(8000);



  // 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"));
        }
      }

    });
  });


});


