!function(t){t.fn.extend({easyResponsiveTabs:function(a){var e=a=t.extend({type:"default",width:"auto",fit:!0,closed:!1,activate:function(){}},a),s=e.type,i=e.fit,n=e.width,r=window.location.hash;!window.history||history.replaceState;t(this).on("tabactivate",(function(t,e){"function"==typeof a.activate&&a.activate.call(e,t)})),this.each((function(){var e=t(this);if(!(e.find(".resp-accordion").length>0)){var c,d=e.find("ul.resp-tabs-list"),o=e.attr("id");e.find("ul.resp-tabs-list li").addClass("resp-tab-item"),e.css({display:"block",width:n}),e.find(".resp-tabs-container > div").addClass("resp-tab-content"),function(){"vertical"==s&&e.addClass("resp-vtabs");1==i&&e.css({width:"100%"});"accordion"==s&&(e.addClass("resp-easy-accordion"),e.find(".resp-tabs-list").css("display","none"))}(),e.find(".resp-tab-content").before("<h2 class='resp-accordion'><span class='resp-arrow'></span></h2>");var l=0;e.find(".resp-accordion").each((function(){c=t(this),0==l&&(!a.closed||window.innerWidth>767)&&c.addClass("resp-tab-active");var s=e.find(".resp-tab-item:eq("+l+")"),i=e.find(".resp-accordion:eq("+l+")");i.append(s.html()),i.data(s.data()),c.attr("data-target","tab_item-"+l),l++}));var p=0;e.find(".resp-tab-item").each((function(){$tabItem=t(this),$tabItem.attr("data-target","tab_item-"+p),$tabItem.attr("role","tab");var a=0;e.find(".resp-tab-content").each((function(){t(this).attr("aria-labelledby","tab_item-"+a),a++})),p++}));var b=0;if(""!=r){var v=r.match(new RegExp(o+"([0-9]+)"));null!==v&&2===v.length&&(b=parseInt(v[1],10)-1)>p&&(b=0)}t(e.find(".resp-tab-item")[b]).addClass("resp-tab-active"),!0===a.closed||"accordion"===a.closed&&!d.is(":visible")||"tabs"===a.closed&&d.is(":visible")?t(e.find(".resp-tab-content")[b]).addClass("resp-tab-content-active resp-accordion-closed"):(t(e.find(".resp-accordion")[b]).addClass("resp-tab-active"),t(e.find(".resp-tab-content")[b]).addClass("resp-tab-content-active").attr("style","display:block")),e.find("ul.resp-tabs-list li[role=tab], .resp-accordion[data-target]").each((function(){var a=t(this),s=!1;a.on("click",(function(){var a=t(this),i=a.attr("aria-controls");if(i||(i=a.attr("data-target")),!s&&a.hasClass("resp-accordion")&&a.hasClass("resp-tab-active"))return s=!0,e.find(".resp-tab-content-active").slideUp("",(function(){s=!1,t(this).addClass("resp-accordion-closed")})),a.removeClass("resp-tab-active"),!1;!a.hasClass("resp-tab-active")&&a.hasClass("resp-accordion")?s||(s=!0,e.find(".resp-tab-active").removeClass("resp-tab-active"),e.find(".resp-tab-content-active").slideUp().removeClass("resp-tab-content-active resp-accordion-closed"),e.find("[data-target="+i+"]").addClass("resp-tab-active"),e.find(".resp-tab-content[aria-labelledby="+i+"]").slideDown("",(function(){s=!1})).addClass("resp-tab-content-active")):(e.find(".resp-tab-active").removeClass("resp-tab-active"),e.find(".resp-tab-content-active").removeAttr("style").removeClass("resp-tab-content-active").removeClass("resp-accordion-closed"),e.find("[data-target="+i+"]").addClass("resp-tab-active"),e.find(".resp-tab-content[aria-labelledby="+i+"]").addClass("resp-tab-content-active").attr("style","display:block")),a.trigger("tabactivate",a)}))})),t(window).on("resize",(function(a,s){s&&s.length&&t.contains(e,s)&&e.find(".resp-accordion-closed").removeAttr("style")}))}}))}})}(jQuery);