(function($) {
  $.fn.Stickify = function() {
    $this = $(this);
    var top = $this.offset().top - parseInt($this.css('marginTop').replace(/auto/,0));    
    $(window).scroll(function() {
      var y = parseInt($(this).scrollTop());
      
      if (y >= top-10) {
        // if so, add the fixed class
        $this.parent().addClass('fixed');
      } else {
        // otherwise remove it
        $this.parent().removeClass('fixed');
      }
    });  
    return this;
  }
  
})(jQuery);