$(function() {
    // the element inside of which we want to scroll
        var $elem = $('#main')

        // clicking the "up" button will make the page scroll to the top of the page
    $('#nav_up').click(
        function (e) {
            $('html, body').animate({scrollTop: '0px'}, 300);
        }
    );
 });

