(function(C){C.tools=C.tools||{version:{}};C.tools.version.tabs="1.0.1";C.tools.addTabEffect=function(E,D){A[E]=D;};var A={"default":function(D){this.getPanes().hide().eq(D).show();},fade:function(D){this.getPanes().hide().eq(D).fadeIn(this.getConf().fadeInSpeed);},slide:function(D){this.getCurrentPane().slideUp("fast");this.getPanes().eq(D).slideDown();},horizontal:function(D){if(!C._hW){C._hW=this.getPanes().eq(0).width();}this.getCurrentPane().animate({width:0},function(){C(this).hide();});this.getPanes().eq(D).animate({width:C._hW},function(){C(this).show();});}};function B(H,G,F){var I=this;var E;function D(K,J){C(I).bind(K,function(L,M){if(J&&J.call(this,M.index)===false&&M){M.proceed=false;}});return I;}C.each(F,function(K,J){if(C.isFunction(J)){D(K,J);}});C.extend(this,{click:function(L){if(L===E){return I;}var J=I.getCurrentPane();var K=H.eq(L);if(typeof L=="string"){K=H.filter("[href="+L+"]");L=H.index(K);}if(!K.length){if(E>=0){return I;}L=F.initialIndex;K=H.eq(L);}var M={index:L,proceed:true};C(I).triggerHandler("onBeforeClick",M);if(!M.proceed){return I;}K.addClass(F.current);A[F.effect].call(I,L);C(I).triggerHandler("onClick",M);H.removeClass(F.current);K.addClass(F.current);E=L;return I;},getConf:function(){return F;},getTabs:function(){return H;},getPanes:function(){return G;},getCurrentPane:function(){return G.eq(E);},getCurrentTab:function(){return H.eq(E);},getIndex:function(){return E;},next:function(){return I.click(E+1);},prev:function(){return I.click(E-1);},onBeforeClick:function(J){return D("onBeforeClick",J);},onClick:function(J){return D("onClick",J);}});H.each(function(J){C(this).bind(F.event,function(K){I.click(J);if(!F.history){return K.preventDefault();}});});if(F.history){H.history(function(K,J){I.click(J||0);});}if(location.hash){I.click(location.hash);}else{I.click(F.initialIndex);}G.find("a[href^=#]").click(function(){I.click(C(this).attr("href"));});}C.fn.tabs=function(D,G){var F=this.eq(typeof conf=="number"?conf:0).data("tabs");if(F){return F;}var E={tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",history:false,initialIndex:0,event:"click",api:false};if(C.isFunction(G)){G={onBeforeClick:G};}C.extend(E,G);this.each(function(){var I=C(this).find(E.tabs);if(!I.length){I=C(this).children();}var H=D.jquery?D:C(D);F=new B(I,H,E);C(this).data("tabs",F);});return E.api?F:this;};})(jQuery);(function(A){var C,B;A.prototype.history=function(D){var E=this;if(A.browser.msie){if(!B){B=A("<iframe />").hide().get(0);A("body").append(B);setInterval(function(){var G=B.contentWindow.document;var F=G.location.hash;if(C!==F){A.event.trigger("hash",F);C=F;}},100);}E.bind("click.hash",function(F){var G=B.contentWindow.document;G.open().close();G.location.hash=A(this).attr("href");});E.eq(0).triggerHandler("click.hash");}else{setInterval(function(){var F=location.hash;if(E.filter("[href*="+F+"]").length&&F!==C){C=F;A.event.trigger("hash",F);}},100);}A(window).bind("hash",D);return this;};})(jQuery);
