var Blitz = {
  init: function() {
    // apply smoothscroll
    $('html').smoothScroll({ speed: 1000 });
    
    // check if there is a # in the URL, if so activate menu-item
    if (location.hash.length !== 0)
      $('#menu .' + location.hash.substring(1) + ' a').addClass('active');
    
    // apply click on links
    $('#menu a').click(Blitz.menuClick);
    
    // apply fancybox
    $("a[rel*=example_group]").fancybox({
      'transitionIn'		: 'none',
      'transitionOut'		: 'none',
      'titlePosition' 	: 'over',
      'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
        return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
      }
    });
  },
  
  
  menuClick: function() {
    $('#menu .active').removeClass('active');
    $(this).addClass('active');
  }
}


$(Blitz.init);
