var HMagForm = function () {
    this.init = function () {
        $('.toggle').each(function () {
            $(this).unbind().click(function (event) {
                event.preventDefault();

                var item = $(this);
                $(item.attr('class').split(' ')).each(function () {
                    if (this == 'toggle') return;
                    
                    $('#' + this).toggle('fast');
                });

                // Prevent event bubbling.
                return false;
            });
        });
    };
    
    this.init();
};


// Run when DOM is complete.
$(function() {
    new HMagForm();
});
