/*
	http://cbsides.com/javascript/cb.js
*/
(function(cb) {
  
  cb.scrollJump = function(el) {
    return $(el).click(function() {
        var target = $('a[name=' + this.hash.split('#')[1] + ']');
        
        if (target.length) {
          var targetOffset = target.offset().top - 2;
          $('html,body').animate({scrollTop: targetOffset}, 'fast');
          return false;
        }
    });
    
  };
  
  cb.label = function(el) {
      return $(el).hover(
        function() {
          $(this).prev().removeClass('labelHide');
        },
        function() {
          $(this).prev().addClass('labelHide');
        }
      );
  };
  
  cb.init = function() {
    cb.scrollJump('a[href*=#]');
  };
  $(document).ready(cb.init);
  
})(window.cb = window.cb || {});
