function NextPrev(p_id, p_nextBtn, p_prevBtn, p_title) {

    // id of the div around the UL elements, then supply the id for the next and previous btns
    this.run = function() {
        var ulPages = $('#' + p_id + ' > ul').size();
        var currUlPage = 1;
        $('#' + p_prevBtn).fadeTo(100, 0.5);

        // adjust the width of the container accordingly
        $('#' + p_id).css('width', ulPages * 440);

        // actual next/prev related
        $('#' + p_nextBtn).click(function() {
            if(currUlPage < ulPages) {
                $('#' + p_id).stop(true,true).animate({
                    left: '-=440'
                }, 1000);
                currUlPage++;
                if(currUlPage > 1) {
                    $('#' + p_prevBtn).fadeTo(100,1);
                }
            } 
            
            if(currUlPage == ulPages) {
                $('#' + p_nextBtn).fadeTo(100, 0.5);
            }

            // title related
            if(p_title) {
                titleHtml = $('#' + p_id + ' > ul').eq(currUlPage - 1).children('.titleNextPrev').html();
                $('#' + p_title).html(titleHtml);
            }

            return false;
        });
        
        $('#' + p_prevBtn).click(function() {
            if(currUlPage > 1) {
                $('#' + p_id).stop(true,true).animate({
                    left: '+=440'
                }, 1000);
                currUlPage--;
                if(currUlPage < ulPages) {
                    $('#' + p_nextBtn).fadeTo(100,1);
                }
            } 
            
            if(currUlPage == 1) {
                $('#' + p_prevBtn).fadeTo(100, 0.5);
            }

            // title related
            if(p_title) {
                titleHtml = $('#' + p_id + ' > ul').eq(currUlPage - 1).children('.titleNextPrev').html();
                $('#' + p_title).html(titleHtml);
            }

            return false;
        
        });
    }

}
