Sierracan = {
  
  init: function() {
    this.loadGalleries();
    this.loadCarousels();
    this.loadHomeTwitter();
    this.loadHomeTabs();
  },
  
  
  /* Load fancybox galleries */
  loadGalleries: function(){
    var galleries       = $('.gallery'),
        video_galleries = $('.gallery-video');
    
    if (galleries.length) {
      galleries.find('a').fancybox({});
    }
    
    if (video_galleries.length) {
      video_galleries.find('a').fancybox({
        width: 425,
        height: 349,
        type: 'iframe'
      });
    }
    
    
  },
  
  /* Load carousels (not home) */
  loadCarousels: function() {
    var carousels = $('.carrusel');
    if (carousels.length) {
      carousels.carrusel({ autoplay: true, arrows: true });
    }
  },
  
  /* loads twitter module */
  loadHomeTwitter: function() {
    var home_twitter = $('#tweet');
    
    if (home_twitter.length) {
      home_twitter.tweet({ user: 'sierracan' });
    }
  },
  
  loadHomeTabs: function() {
    var home_tabs = $('#tabs');
    
    if (home_tabs.length) {
      home_tabs.tabs({ autoplay: true });
    }
  }
  
  
  
};


Sierracan.init();
