var Footer = new Class({
    Implements: [Events, Options],
    _expanded: false,
    
    options: {
        'ele': false,
        'expand': false,
        'closed_height': 0
    },
    
    initialize: function(options) {
        this.setOptions(options);
        
        this.options.ele.store('original_height', this.options.ele.getSize().y);
        
        this.options.ele.addEvents({
            'mouseenter': function() {
                 this.expand();
            }.bind(this),
            
            'mouseleave': function() {
                 this.collapse();
            }.bind(this),
            
            'click': function() {
                this.toggle();
            }.bind(this)
        });
                
        this.options.ele.setStyle('height', this.options.closed_height);
    },
    
        
    expand: function() {
        if ( this._expanded === false ) {
            this.options.ele.tween('height', this.options.ele.retrieve('original_height'));
            this.options.ele.addClass('expanded');
            this._expanded = true;
        }
    },
    
    
    collapse: function() {
        if ( this._expanded === true ) {
            this.options.ele.tween('height', this.options.closed_height);
            this.options.ele.removeClass('expanded');
            this._expanded = false;
        }
    },
    
    
    toggle: function() {
        if ( this._expanded === true ) {
            this.collapse();
        } else {
            this.expand();
        }
    }
});

