;(function(d){function q(c,a,b){var e=this,n=c.add(this),g=c.find(b.tabs),f=a.jquery?a:c.children(a),k;g.length||(g=c.children());f.length||(f=c.parent().find(a));f.length||(f=d(a));d.extend(this,{click:function(a,h){var f=g.eq(a),l=!c.data("tabs");"string"==typeof a&&a.replace("#","")&&(f=g.filter('[href*\x3d"'+a.replace("#","")+'"]'),a=Math.max(g.index(f),0));if(b.rotate){var m=g.length-1;if(0>a)return e.click(m,h);if(a>m)return e.click(0,h)}if(!f.length){if(0<=k)return e;a=b.initialIndex;f=g.eq(a)}if(a===k)return e;h=h||d.Event();h.type="onBeforeClick";n.trigger(h,[a]);if(!h.isDefaultPrevented())return p[l?b.initialEffect&&b.effect||"default":b.effect].call(e,a,function(){k=a;h.type="onClick";n.trigger(h,[a])}),g.removeClass(b.current),f.addClass(b.current),e},getConf:function(){return b},getTabs:function(){return g},getPanes:function(){return f},getCurrentPane:function(){return f.eq(k)},getCurrentTab:function(){return g.eq(k)},getIndex:function(){return k},next:function(){return e.click(k+1)},prev:function(){return e.click(k-1)},destroy:function(){g.off(b.event).removeClass(b.current);f.find('a[href^\x3d"#"]').off("click.T");return e}});d.each(["onBeforeClick","onClick"],function(a,c){if(d.isFunction(b[c]))d(e).on(c,b[c]);e[c]=function(a){if(a)d(e).on(c,a);return e}});b.history&&d.fn.history&&(d.tools.history.init(g),b.event="history");g.each(function(a){d(this).on(b.event,function(b){e.click(a,b);return b.preventDefault()})});f.find('a[href^\x3d"#"]').on("click.T",function(a){e.click(d(this).attr("href"),a)});location.hash&&"a"==b.tabs&&c.find('[href\x3d"'+location.hash+'"]').length?e.click(location.hash):(0===b.initialIndex||0