Effect.ScrollHorizontal = Class.create();

Object.extend(Object.extend(Effect.ScrollHorizontal.prototype, Effect.Base.prototype), 
{
    initialize: function(element) 
    {
		if(typeof element == "string")
        {        
            this.element = $(element);
            if(!this.element) 
            {
                throw(Effect._elementDoesNotExistError);
            }
        }

        var options = Object.extend({
            from: this.element.scrollLeft || 0,
            to:   this.element.offsetWidth
        }, arguments[1] || {});

        this.start(options);
    },

    update: function(position) 
    {
        this.element.scrollLeft = position;
    }
});