﻿///<reference path="/_js/jQuery/1.4.1/jquery-1.4.1-vsdoc.js"/>

(function ($) {

    $.fn.mybizArchive = function () {

        //perform these actions on each element
        return this.each(function () {

            var widget = $(this); //get itself

            //bar
            $("div.bar", widget).toggle(function () {
                //slide the categories down
                $("div.archiveWrapper", widget).slideDown();
            }, function () {
                $("div.archiveWrapper", widget).slideUp();
            });

            //archive ULs and stuff
            $("div.archiveWrapper span", widget).toggle(function () {
                var next = $(this).next();
                next.slideDown();
            }, function () {
                $(this).next().slideUp();
            });
        });

    };

})(jQuery);
