var KickTabsOptions={mouseevent:["click"],duration:[0],transition:[Fx.Transitions.Quad.easeInOut],auto:[],delay:[2E3],type:["scrolling"]},KickTabs=new Class({version:"1.8 (mt1.3)",Implements:[Options,Events],options:{scroll:KickTabsOptions},initialize:function(){this.setOptions({scroll:KickTabsOptions});this.containers=$$(".kicktabs-container-inner");this.tabsWrapper=$$(".kicktabs-links");this.tabs=$$(".kicktabs-links ul");this.panels=$$(".kicktabs-container-wrapper");this.outer=$$(this.tabsWrapper.getParent()); this.wrapper=$$(this.outer.getParent());this.fx=[];this.current=[];this.panels.each(function(b,c){this.current[c]=0;this.options.scroll.mouseevent[c]||(this.options.scroll.mouseevent[c]="click");b.setStyle("width",Browser.opera?3E4:5E4)},this);this.attachEvents();this.adjustFirstHieght()},adjustFirstHieght:function(){var b=this.panels[0].getFirst("div").getSize().y;this.fx[0].element.set("tween",{property:"height",duration:300,wait:false}).get("tween").start(b+"px")},attachEvents:function(){var b; this.tabs.each(function(c,a){this.fx[a]=new Fx.Scroll(this.panels[a].getParent(),{link:"cancel",wheelStops:false,duration:this.options.scroll.duration[a],transition:this.options.scroll.transition[a]});this.fx[a].set(0,false);b=0;this.containers[a].setStyle("width",this.wrapper[a].getStyle("width").toInt()-this.tabsWrapper[a].getParent().getStyle("border-left-width").toInt()-this.tabsWrapper[a].getParent().getStyle("border-right-width").toInt());c.getElements("li").each(function(d,e){var f=this.panels[a].getChildren()[e]; f.setStyle("width",(Browser.ie6?this.wrapper[a]:this.outer[a]).getStyle("width").toInt()-f.getStyle("padding-left").toInt()-f.getStyle("padding-left").toInt()-f.getStyle("margin-left").toInt()-f.getStyle("margin-left").toInt());b+=d.getSize().x;d.setStyle("cursor","pointer").addEvents({mousedown:this.mousedown.bind(this,[d,f,a,e]),mouseup:this.mouseup.bind(this,[d,f,a,e])})},this)},this);return this},mousedown:function(b,c,a,d){if(b[0]){d=b[3];a=b[2];c=b[1];b=b[0]}b.removeClass("up").addClass("down"); if(this.options.scroll.type[a]=="scrolling"){this.fx[a].options.duration=KickTabsOptions.duration[a];this.fx[a].options.link="cancel";this.fx[a].toElement(c);this.fx[a].element.set("tween",{property:"height",duration:300,wait:false}).get("tween").start(c.getSize().y+"px")}else{var e=this;this.fx[a].element.set("tween",{link:"chain",onComplete:function(){e.fx[a].options.duration=0;e.fx[a].toElement(c);e.fx[a].element.fade(1)}});this.fx[a].element.fade(0)}this.fireEvent("mousedown",[b,c,a,d])},mouseup:function(b, c,a,d,e){if(b[0]){e=b[4];d=b[3];a=b[2];c=b[1];b=b[0]}if(!(KickTabsOptions.mouseevent[a]!="click"&&!e)){this.tabs[a].getElements("li").removeClass("active");b.removeClass("down").addClass("up").addClass("active");this.current[a]=d;this.fireEvent("mouseup",[b,c,a,d])}}});window.addEvent("load",function(){kicktabs=new KickTabs});
