$.fn.accordion = function (opt) {
    return this.each(function () {
        var accordion = this;
        accordion.option = {
            autofold: true,
            animate: true,
            speed: 'fast',
            autoFoldNeighbours: true
        }

        accordion.option = $.extend(accordion.option, opt);

        $('>.accordion_header', this).click(function () {
            if ($(this).next().is(':visible')) {
                $(this).next().hide('fast');
            }
            else {
                if (accordion.option.autoFoldNeighbours) {
                    $(this).parent().children('.accordion_content').hide('fast');
                }

                $(this).next().show('fast');
            }
        });

        $('.accordion_content').hide();

        $('.accordion_header2', this).click(function () {
            $('.accordion_content').hide('fast');
        });

    });
}
