/*
 * Tabs 2.5.2 - jQuery plugin for accessible, unobtrusive tabs
 *
 * http://stilbuero.de/tabs/
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
(function(b){b.fn.tabs=function(d,e){if(typeof d=="object"){e=d;}e=b.extend({initial:(d&&typeof d=="number"&&d>0)?--d:0,disabled:null,bookmarkable:b.ajaxHistory?true:false,fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:"normal",fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,selectedClass:"tabs-selected",disabledClass:"tabs-disabled",hideClass:"tabs-hide",tabStruct:"div"},e||{});b.browser.msie6=b.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);var f=function(){scrollTo(0,0);};return this.each(function(){var j=this;var w=b(">ul:eq(0)>li>a",this);if(location.hash){w.each(function(z){if(this.hash==location.hash){e.initial=z;if(b.browser.msie||b.browser.opera){var k=b(location.hash);var A=k.attr("id");k.attr("id","");setTimeout(function(){k.attr("id",A);},500);}f();return false;}});}if(b.browser.msie){f();}b(">"+e.tabStruct,this).filter(":eq("+e.initial+")").show().end().not(":eq("+e.initial+")").addClass(e.hideClass);b(">ul:eq(0)>li:eq("+e.initial+")",this).addClass(e.selectedClass);if(e.fxAutoHeight){var n=b(">"+e.tabStruct,j);var l=function(i){var k=b.map(n.get(),function(A){var z,B=b(A);if(i){if(b.browser.msie6){A.style.removeExpression("behaviour");A.style.height="";A.minHeight=null;}z=B.css({"min-height":""}).height();}else{z=B.height();}return z;}).sort(function(A,z){return z-A;});if(b.browser.msie6){n.each(function(){this.minHeight=k[0]+"px";this.style.setExpression("behaviour",'this.style.height = this.minHeight ? this.minHeight : "1px"');});}else{n.css({"min-height":k[0]+"px"});}};l();var s=j.offsetWidth;var h=j.offsetHeight;var t=b("#tabs-watch-font-size").get(0)||b('<span id="tabs-watch-font-size">M</span>').css({display:"block",position:"absolute",visibility:"hidden"}).appendTo(document.body).get(0);var m=t.offsetHeight;setInterval(function(){var k=j.offsetWidth;var z=j.offsetHeight;var i=t.offsetHeight;if(z>h||k!=s||i!=m){l((k>s||i<m));s=k;h=z;m=i;}},50);}var g={},y={};var x,r;if(e.fxSlide||e.fxFade){if(e.fxSlide){g.height="show";y.height="hide";}if(e.fxFade){g.opacity="show";y.opacity="hide";}x=r=e.fxSpeed;}else{if(e.fxShow){g=e.fxShow;x=e.fxShowSpeed||e.fxSpeed;}else{g["min-width"]=0;x=e.bookmarkable?50:1;}if(e.fxHide){y=e.fxHide;r=e.fxHideSpeed||e.fxSpeed;}else{y["min-width"]=0;r=e.bookmarkable?50:1;}}var v=e.onClick,p=e.onHide,u=e.onShow;if(e.bookmarkable){w.history();b.ajaxHistory.initialize(function(){w.eq(e.initial).click();});}w.bind("triggerTab",function(){var k=this.hash;if(b(k).is(":hidden")&&!b(this.parentNode).is("."+e.disabledClass)){if(b.browser.msie){b(this).click();if(e.bookmarkable){b.ajaxHistory.update(k);location.hash=k.replace("#","");}}else{if(b.browser.safari){var i=b('<form action="'+k+'"><div><input type="submit" value="h" /></div></form>').get(0);i.submit();b(this).click();if(e.bookmarkable){b.ajaxHistory.update(k);}}else{if(e.bookmarkable){location.hash=k.replace("#","");}else{b(this).click();}}}}});w.bind("disableTab",function(){b(this.parentNode).addClass(e.disabledClass);});if(e.disabled&&e.disabled.length){for(var q=0,o=e.disabled.length;q<o;q++){w.eq(--e.disabled[q]).trigger("disableTab").end();}}w.bind("enableTab",function(){var i=b(this.parentNode);i.removeClass(e.disabledClass);if(b.browser.safari){i.fadeTo(1,1).css({display:"",opacity:1});setTimeout(function(){i.css({opacity:""});},30);}});w.bind("click",function(){var k=b(this.parentNode);if(k.is("."+e.disabledClass)){return false;}if(!k.is("."+e.selectedClass)){var i=b(this.hash);if(i.length>0){if(e.bookmarkable&&b.browser.msie){var B=this.hash.replace("#","");i.attr("id","");setTimeout(function(){i.attr("id",B);},0);}var A=this;var z=b(">"+e.tabStruct+":visible",j);if(typeof v=="function"){setTimeout(function(){v(A,i[0],z[0]);},0);}z.animate(y,r,function(){b(A.parentNode).addClass(e.selectedClass).siblings().removeClass(e.selectedClass);if(typeof p=="function"){p(A,i[0],z[0]);}z.addClass(e.hideClass).css({display:"",overflow:"",height:""});i.removeClass(e.hideClass).animate(g,x,function(){i.css({overflow:"",height:""});if(b.browser.msie){}if(typeof u=="function"){u(A,i[0],z[0]);}});});}else{return true;}}var D=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var C=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(D,C);},0);this.blur();return e.bookmarkable;});});};var c=["triggerTab","disableTab","enableTab"];for(var a=0;a<c.length;a++){b.fn[c[a]]=(function(d){return function(e){return this.each(function(){var f=e&&e>0&&e-1||0;b(">ul:eq(0)>li>a",this).eq(f).trigger(d);});};})(c[a]);}})(jQuery);
