/** * jQuery Switchable v2.0 * http://switchable.mrzhang.me/ * * Copyright 2011 mrzhang.me * Licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php * * Date: 2011-10-13 13:51 */ (function(d){function f(f,a,e){var c=this,b=d(this);d.isFunction(a.beforeSwitch)&&b.bind("beforeSwitch",a.beforeSwitch);d.isFunction(a.onSwitch)&&b.bind("onSwitch",a.onSwitch);d.extend(c,{_initPlugins:function(){for(var a=d.switchable.Plugins,e=a.length,b=0;b"+(b?a.triggers:h)+"");c.triggers=d("
",{"class":a.triggersWrapCls,html:l.join("")})[a.putTriggers](f).find("li")}c.triggers.eq(c.index).addClass(a.currentTriggerCls);for(h=0;h0?c.index-1:a.loop?c.length-1:!1:c.index=0?f:0-f)=0?b:0-b)<1.0E-6)break;d-=f/b}b=0;e=1;d=a;if(de)return e;for(;b=0?f-a:0-(f-a))f?b=d:e=d;d=(e-b)*0.5+b}return d}var k=bx=cx=ay=by=cy=0;cx=3*c;bx=3*(d-c)-cx;k=1-cx-bx;cy=3*b;by=3*(f-b)-cy;ay=1-cy-by;return function(a,b){var c=g(a,b);return((ay*c+by)*c+cy)*c}(a,1/(200*j))}d.switchable.TimingFn={ease:f(".25, .1, .25, 1"),linear:f("0, 0, 1, 1"),"ease-in":f(".42, 0, 1, 1"),"ease-out":f("0, 0, .58, 1"),"ease-in-out":f(".42, 0, .58, 1")};d.switchable.Easing=function(e){var c,b,i=0,e=e.split(",");for(b=e.length;it&&b.slice(0,e.visible).clone(!0).addClass(e.clonedCls).appendTo(i).click(function(a){a.preventDefault();b.eq(d(this).index()-r).click()});d.extend(a,{_adjustPosition:function(a){p=a?q:0;m.position="relative";m[o]=(a?-1:1)*s;b.slice(p*c,(p+1)*c).css(m);return a?u:-s},_resetPosition:function(e){p=e?q:0;m.position="";m[o]="";b.slice(p*c,(p+1)*c).css(m);m.position=void 0;m[o]=e?-a.groupSize[n]*q:0;i.css(m)}})}a.container.css("position")=="static"&&a.container.css("position","relative");m.position="absolute";m[o]=-a.groupSize[n]*a.index;i.css(m).css("width",g?2*a.groupSize[n]*a.length:e.groupSize[0]?e.groupSize[0]:void 0);a.isHoriz=g;a.isBackward=h===1||h===3}}})})(jQuery);(function(d){var f=["accordion","horizaccordion"],g=[["height","marginTop","marginBottom","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],["width","marginLeft","marginRight","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"]];d.extend(d.switchable.Config,{multiple:!1,customProps:{}});for(var a=0;a<2;a++)d.switchable.Effects[f[a]]=function(a,c){var b=this,f=b.config,g=a!==c;b.anim&&b.anim.stop(g);b.anim=(new d.switchable.Anim(b.panels.eq(c),b.triggers.eq(c).hasClass(f.currentTriggerCls)?b.collapseProps:b.expandProps[c],f.duration,f.easing,function(){b.anim=void 0})).run();if(!f.multiple&&a!==void 0&&g)b.anim2&&b.anim2.stop(g),b.anim2=(new d.switchable.Anim(b.panels.eq(a),b.collapseProps,f.duration,f.easing,function(){b.anim2=void 0})).run()};d.switchable.Plugins.push({name:"accordion effect",init:function(a){var c=a.config,b=d.inArray(c.effect,f);if(!(b===-1||c.steps!==1)){window.console&&console.info("Remember to set the border-width for the accordion's panels, even without border.");d.extend(a,{_triggerIsValid:function(){return!0},_switchTrigger:function(b,d){var f=a.triggers,g=c.currentTriggerCls;f.eq(d).toggleClass(g);!c.multiple&&b!==void 0&&b!==d&&f.eq(b).removeClass(g)}});a.expandProps=[];a.collapseProps={};var i=g[b].length,h={},j,l,k;for(k=0;k