jQuery(function($){
  $('<div id="next_arrow">(j)Next</div>')
    .prependTo("body") //append the Next arrow div to the bottom of the document
    .click(function(){
      scrollTop = $(window).scrollTop();
      $('#content h2').each(function(i, h2){ // loop through article headings
        h2top = $(h2).offset().top; // get article heading top
        if (scrollTop < h2top) { // compare if document is below heading
          $.scrollTo(h2, 200); // scroll to in .8 of a second
          return false; // exit function
        } 
      });
    });

$.fn.reverse = function()
			{
return this.pushStack(this.get().reverse(), arguments);
			};

  $('<div id="prev_arrow">(k)Prev</div>')
    .prependTo("body") //append the Next arrow div to the bottom of the document
    .click(function(){
      scrollTop = $(window).scrollTop();
      $('#content h2').reverse().each(function(i, h2){ // loop through article headings
        h2top = $(h2).offset().top; // get article heading top
        if (scrollTop > h2top) { // compare if document is above heading
          $.scrollTo(h2, 200); // scroll to in .8 of a second
          return false; // exit function
        }
      });
    });
});