in partnership with mediatemple

Element.extend({

        isVisible: function(){
                return (this.getStyle('display') || 'none') != 'none' && this.getStyle('visibility') != 'hidden';
        },

        show: function(){
                return this.setStyle('display', '').setOpacity(1);
        },

        hide: function(collapse){
                return (collapse) ? this.setStyle('display', 'none') : this.setOpacity(0);
        },

        toggle: function(collapse){
                return (this.isVisible()) ? this.hide(collapse) : this.show();
        }

});