﻿///<reference path="/_js/jQuery/1.4.1/jquery-1.4.1-vsdoc.js"/>

(function ($) {

    $.fn.myBizHomepageSidebar = function () {

        //perform these actions on each element
        return this.each(function () {

            var widget = $(this); //get itself

            //tabs
            $("div.tabs > div", widget).click(function () {
                var tab = $(this);
                var clickedIndex = $("div.tabs > div", widget).index(tab);

                //get rid of the old active classes
                $("div.tabs > div", widget).removeClass("active");
                //hide the content divs
                $("div.content > div", widget).hide();

                //add a new active tab
                tab.addClass("active");
                //show new div
                $("div.content > div:eq(" + clickedIndex + ")", widget).show();
            });
        });

    };

})(jQuery);
