var pageScroller = function() {

    var config = {
        easingType: 'easeOutExpo',
        scrollDuration: 1000,
        scrollTargets: '.individual-container'
    };

    function getTargets(scrollTargets) {
        posts = $(scrollTargets);
    }

    function attachScrollEvents($posts, settings) {
        $posts.each(function() {
            $this = $(this);
            // prev link
            $this.find('.items-scroll a#prev').click(function() {

                target = $(this).parents(config.scrollTargets).prev(config.scrollTargets);
                scrollTo(target, config.scrollDuration, config.easingType);
                return false;
            });

            // next link
            $this.find('.items-scroll a#next').click(function() {
                target = $(this).parents(config.scrollTargets).next(config.scrollTargets);
                scrollTo(target, config.scrollDuration, config.easingType);
                return false;
            });
        });
    }


    function scrollTo(target, scrollDuration, easingType) {
        if (target.length > 0) {
            $.scrollTo(target, scrollDuration, { easing: easingType, axis: 'y' });
        }
    }

    // public methods
    return {
        /*
        * Attach scroll events to the page
        */
        init: function() {
            getTargets(config.scrollTargets);
            attachScrollEvents(posts, config);

            $("div.items-scroll div#prev:first").hide();
            $("div.items-scroll div#next:last").hide();

         
            
        }
    };
} ();