(function(b){var j=false;b.fn.tabcontrol=function(a,f,g){var d=b.extend({},b.fn.tabcontrol.defaults,g);return this.each(function(){var c=b(this),e=b.meta?b.extend({},d,c.data()):d,h=e.tabsInside?b(a,this):b(a),i=e.contentInside?b(f,this):b(f);c=i.first();var k=h.first();if(e.usePermalinks){var l=window.location.hash;if(l!=""){c=i.filter(l);if(c.length==0){c=i.first();k=h.first()}else k=h.filter("[href="+l+"]")}}k.addClass(e.selectedClass);c.addClass(e.selectedClass);i.not("."+e.selectedClass).hide();
h.click(function(){if(!j){j=true;b.fn.tabcontrol.showTab(e,h,i,this)}return false})})};b.fn.tabcontrol.resetAll=function(a,f,g,d){var c=g.filter(":visible");f.removeClass(a.selectedClass);g.removeClass(a.selectedClass);if(a.effect==false){c.hide();d()}else if(a.effect=="fade")c.fadeOut(a.effectDuration,d);else a.effect=="slide"&&c.slideUp(a.effectDuration,d)};b.fn.tabcontrol.nextTab=function(){};b.fn.tabcontrol.prevTab=function(){};b.fn.tabcontrol.jumpTo=function(){};b.fn.tabcontrol.showTab=function(a,
f,g,d){a.onBefore!=false&&typeof a.onBefore=="function"&&a.onBefore(a,f,g,d);var c=b(d).attr("href");if(a.usePermalinks)window.location.hash=c;b.fn.tabcontrol.resetAll(a,f,g,function(){var e=function(){j=false;a.onAfter!=false&&typeof a.onAfter=="function"&&a.onAfter(a,f,g,d)};if(a.effect==false){b(c).show();e()}else if(a.effect=="fade")b(c).fadeIn(a.effectDuration,function(){e()});else a.effect=="slide"&&b(c).slideDown(a.effectDuration,function(){e()});b(c).addClass(a.selectedClass)});b(d).addClass(a.selectedClass)};
b.fn.tabcontrol.defaults={tabsInside:true,contentInside:false,selectedClass:"selected",onBefore:false,onAfter:false,effect:false,effectDuration:"normal",usePermalinks:true}})(jQuery);
