/*
(function($) {
}
$.fn.panelSwitcher = function () {
    $(".panel").hide();

    $("#panelswitcher").ready(function(){
		var href = location.href;
        if (href.lastIndexOf("#") != -1) {
            $("#panelswitcher a").each(function() {
                target = $(this).attr("href");
                if (target == href.substr(href.lastIndexOf("#"))) {
                    $(target).show();
                    $(this).addClass("active");
                }
            });
        }
    });

    $("#panelswitcher a").click(function () {
        // switch all tabs off
        $("#panelswitcher a.active").removeClass("active");

        // switch this tab on
        $(this).addClass("active");

        // slide all elements with the class 'panel' up
        $(".panel").hide();

        // Now figure out what the 'href' attribute value is and find the element with that id.  Then slide that down.
        var content_show = $(this).attr("href");
        $(content_show).show();

        return false;
    });
};
})(jQuery);
*/

(function($) {
    $.fn.panelSwitcher = function (psId) {
        $(".panel").hide();
        if (psId === undefined || psId == '') {
            var psId = '#panelswitcher';
        }
        $(psId).ready(function() {
            var href = location.href;
            if (href.lastIndexOf("#") != -1) {
                target = href.substr(href.lastIndexOf("#"));
                $(target).show();
                $(psId + " a").each(function() {
                    if (target == $(this).attr("href")) {
                        $(this).addClass("active");
                    }
                });
            }
        });

        $(psId + " a").click(function () {
            // switch all tabs off
            $(psId + " a.active").removeClass("active");

            // switch this tab on
            $(this).addClass("active");

            // slide all elements with the class 'panel' up
            $(".panel").hide();

            // Now figure out what the 'href' attribute value is and find the
            // element with that id.  Then slide that down.
            var content_show = $(this).attr("href");
            $(content_show).show();

            return true;
        });
    };
})(jQuery);