(function ($) {
    $.fn.extend({
        vnreaNewsTab: function (options) {
            var defaults = {
                menutype: 1
            };
            var options = $.extend(defaults, options);




            return this.each(function () {
                var $m = $(this).parent();
                var $lis = [];
                var $tabs = [];
                var $isel = 0;

                $m.find(".news-summary-tab-content-item").each(function (i) {
                    $tabs.push($(this));
                })

                $(this).find("li").each(function (i) {
                    $lis.push($(this));
                    $(this).hover(
                        function (e) {
                            var idx = i;
                            $tabs[$isel].css("display", "none");
                            $lis[$isel].attr("class", "");
                            $isel = idx;
                            $tabs[$isel].css("display", "block");
                            $lis[$isel].attr("class", "select");
                        },
                        function (e) {
                            var idx = i;
                            $isel = idx;
                        }
                    )
                })
                $lis[$isel].attr("class", "select");
            });
        }
    });
})(jQuery);

$(document).ready(function () {
    $(".news-summary-tab").vnreaNewsTab(1);
});
