var TrollScroll = (function() {
    
    var Scroller = function(container, area) {
        this.container  = $(container);
        this.area       = $(area);
        this.width      = 420;
        this.image      = this.container.select('img')[0];
        this.innerWidth = this.image.getDimensions().width;
        this.delta      = (this.innerWidth - this.width) / this.width;
        this.halfWidth  = this.innerWidth / 2;
        this.scroll();
    }
    
    Scroller.prototype.calculateScroll = function(e) {
        var offset = Math.abs(e.clientX - this.container.cumulativeOffset()[0]),
            scroll = this.delta * offset;

        return scroll;
    };

    Scroller.prototype.scroll = function(first_argument) {
        $(this.area).observe("mousemove", function(event){
            this.container.scrollLeft = this.calculateScroll(event);
        }.bind(this));
    };
    
    return Scroller;
})();
