ListViewer = {
    viewerLoc: 0,
    contentPos: 0,
    intervalId: 0,
    extendedListLength: 0, //should be list length * li width - slider_container width ( 8 * 117 - 575)
    scrollLength: 0, //should be li width divided by extendedListLength

    initialize: function(listLength) {
        //CSS hide if we're using javascript
        var sliderContainer = document.getElementById('videoslider-container');
        sliderContainer.style.overflow = "hidden";

        //And show
        var leftArrow = document.getElementById('arrow-left');
        leftArrow.style.visibility = "visible";

        var rightArrow = document.getElementById('arrow-right');
        rightArrow.style.visibility = "visible";

        this.extendedListLength = listLength * 117 - 575;
        this.scrollLength = 117 / this.extendedListLength;

    },

    scrollLeft: function() {
        ListViewer.smoothScroll(ListViewer.scrollLength, -1);
    },

    scrollRight: function() {
        ListViewer.smoothScroll(ListViewer.scrollLength, 1);
    },

    smoothScroll: function(xUnits, dir) {
        var sliderContents = document.getElementById('videoslider-contents');
        //Stop scrolling if beyond limits
        ListViewer.viewerLoc = ListViewer.viewerLoc + dir * xUnits;
        if (ListViewer.viewerLoc < 0) ListViewer.viewerLoc = 0;
        if (ListViewer.viewerLoc > 1) ListViewer.viewerLoc = 1;

        //Find width to move list contents
        var absoluteLoc = -1 * ListViewer.extendedListLength * ListViewer.viewerLoc;

        //Stop scrolling if we still are
        window.clearInterval(ListViewer.intervalId);

        //Start scrolling at set intervals
        ListViewer.intervalId = window.setInterval(function() {
            var step = .25;
            //Find current position of list contents and move it 25% of the distance
            ListViewer.contentPos = ListViewer.contentPos - Math.floor(step * (ListViewer.contentPos - absoluteLoc));
            if (Math.abs(ListViewer.contentPos - absoluteLoc) < (1 / step) && Math.abs(ListViewer.contentPos - absoluteLoc) >= 1) {
                if (dir > 0) ListViewer.contentPos = ListViewer.contentPos - 1;
                else ListViewer.contentPos = ListViewer.contentPos + 1;
            }
            else if (Math.abs(ListViewer.contentPos - absoluteLoc) < 1) ListViewer.contentPos = absoluteLoc;
            sliderContents.style.left = ListViewer.contentPos + "px";
            //stop once we've reached the absolute point
            if (ListViewer.contentPos == absoluteLoc) window.clearInterval(ListViewer.intervalId);
        }, 10);
    }
};


		
		