Effect.ScrollVertical = Class.create();
Object.extend(Object.extend(Effect.ScrollVertical.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.scrollTop || 0,
            to:   this.element.scrollHeight
        }, arguments[1] || {});

        options.to = options.to == this.element.scrollHeight ? options.to : options.from + options.to;

        this.start(options);
    },

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

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.scrollWidth
        }, arguments[1] || {});

        this.start(options);
    },

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


