KISSY.add("Countdown",function(c){var e=c.DOM,b="afterPaint";function d(f,g){if(!(this instanceof d)){return new d(f,g)}f=c.get(f);if(!f){return}this.container=f;this.config=c.merge(d.Config,g);this._init()}d.Config={effect:"normal",_varReg:/\$\{([\-\w]+)\}/g,_clock:["d",100,2,"h",24,2,"m",60,2,"s",60,2,"u",10,1]};var a=(function(){var g=[],f=[];function h(){var m=+new Date(),l=100-m+h.lastTime,k,j;while(f.length){f.shift()()}for(k=0,j=g.length;k<j;k+=2){g[k+1]+=2;if(g[k+1]===21||(g[k+1]&1)===0){g[k](m);g[k+1]&=1}}h.lastTime=m;l=l>0?l:0;setTimeout(h,l)}h.lastTime=+new Date();setTimeout(h,100);return{add:function(i,j){f.push(function(){g.push(i);g.push(j===1000?1:0)})},remove:function(i){f.push(function(){g.splice(c.indexOf(i,g),2)})}}}());c.augment(d,c.EventTarget,{_init:function(){var k=this,h=k.config,i=h._varReg,f=h._clock,g=k.container,l=[];this._notify=[];k.hands=l;k.frequency=1000;k.total=parseInt(e.attr(g,"data-time"),10);k.startAt=+new Date();i.lastIndex=0;g.innerHTML=g.innerHTML.replace(i,function(o,m){if(m==="u"||m==="s-ext"){k.frequency=100}var n="";if(m==="s-ext"){l.push({type:"s"});l.push({type:"u"});n=k._html("","s","handlet")+k._html(".","","digital")+k._html("","u","handlet")}else{l.push({type:m})}return k._html(n,m,"hand")});c.each(l,function(m){var o=m.type,p=100,n;m.node=c.one(g).one(".hand-"+o);for(n=f.length-3;n>-1;n-=3){if(o===f[n]){break}p*=f[n+1]}m.base=p;m.radix=f[n+1];m.bits=f[n+2]});k._reflow(k.startAt);var j=k._reflow;k._reflow=function(m){return j.call(k,m)};a.add(k._reflow,k.frequency);e.css(g,"display","block")},_reflow:function(g){var f=this.total+this.startAt-g;if(f<this.frequency){a.remove(this._reflow)}c.each(this.hands,function(h){h.lastValue=h.value;h.value=Math.floor(f/h.base)%h.radix});this._repaint();if(this._notify[f]){c.each(this._notify[f],function(h){h()})}return this},_repaint:function(){var g=this,f=g.config.effect;d.Effects[f].paint.apply(g);g.fire(b)},_toDigitals:function(g,f){g=g<0?0:g;var h=[];while(f--){h[f]=g%10;g=Math.floor(g/10)}return h},_html:function(h,g,f){if(c.isArray(h)){h=h.join("")}switch(f){case"hand":g=f+" hand-"+g;break;case"handlet":g=f+" hand-"+g;break;case"digital":if(h==="."){g=f+" "+f+"-point "+g}else{g=f+" "+f+"-"+h+" "+g}break}return'<s class="'+g+'">'+h+"</s>"},notify:function(g,h){var f=this._notify[g]||[];f.push(h);this._notify[g]=f;return this}});c.Countdown=d});
KISSY.add("CountdownEffects",function(a){var c=a.DOM,b=a.Countdown;b.Effects={normal:{paint:function(){var e=this,d;a.each(e.hands,function(f){if(f.lastValue!==f.value){d="";a.each(e._toDigitals(f.value,f.bits),function(g){d+=e._html(g,"","digital")});f.node.html(d)}})}},slide:{paint:function(){var f=this,e,g,h,d;a.each(f.hands,function(i){if(i.lastValue!==i.value){e="";g=i.bits;h=f._toDigitals(i.value,g);if(i.lastValue===undefined){d=h}else{d=f._toDigitals(i.lastValue,g)}while(g--){if(d[g]!==h[g]){e=f._html([f._html(h[g],"","digital"),f._html(d[g],"","digital")],"slide-wrap")+e}else{e=f._html(h[g],"","digital")+e}}i.node.html(e)}});b.Effects.slide.afterPaint.apply(f)},afterPaint:function(){a.each(this.hands,function(e){if(e.lastValue!==e.value&&e.lastValue!==undefined){var f=e.node,d=f.one(".digital").height();f.css("height",d);f.all(".slide-wrap").css("top",-d).animate("top: 0",0.5,"easeIn")}})}},flip:{paint:function(){var f=this,e,d,g;a.each(f.hands,function(h){if(h.lastValue!==h.value){e="";d="";g="";a.each(f._toDigitals(h.value,h.bits),function(i){d+=f._html(i,"","digital")});if(h.lastValue===undefined){h.node.html(d)}else{d=f._html(d,"handlet");a.each(f._toDigitals(h.lastValue,h.bits),function(i){g+=f._html(i,"","digital")});e=f._html(g,"handlet mask");g=f._html(g,"handlet");h.node.html(d+g+e)}}});b.Effects.flip.afterPaint.apply(f)},afterPaint:function(){a.each(this.hands,function(g){if(g.lastValue!==g.value&&g.lastValue!==undefined){var e=g.node,i=e.all(".handlet"),f=i.item(0),j=i.item(1),h=i.item(2),d=e.width(),l=e.height(),k=Math.floor(l/2),m=l-k;j.css({clip:"rect("+k+"px, "+d+"px, "+l+"px, 0)"});h.css({overflow:"hidden",height:k+"px"});h.animate({top:k+"px",height:0},0.15,"easeNone",function(){h.html(f.html());h.css({top:0,height:k+"px",clip:"rect("+k+"px, "+d+"px, "+l+"px, 0)"});h.animate("height: "+l+"px",0.3,"bounceOut")})}})}}}});
KISSY.app("TPL");TPL.add("Slidepics",function(a){var b=KISSY;a.Slidepics={init:function(){b.Slide("#J_SlidePlayer_540",{effect:"scrolly",easing:"easeOutStrong",countdown:true,countdownFromStyle:"width:18px"})}}});TPL.add("Countdown",function(a){var b=KISSY;a.Countdown={init:function(){var c=b.Countdown(b.one("#J_SecKillClock"),{effect:"flip"})}}});TPL.add("Lazyload",function(a){var b=KISSY;a.Lazyload={init:function(){b.use("datalazyload",function(c){new c.DataLazyload({diff:c.DOM.viewportHeight()})},{order:true})}}});TPL.add("Bigcathover",function(a){var b=KISSY;a.Bigcathover={init:function(){var d=b.query(".J_Info");var c=function(e){KISSY.DOM.toggleClass(KISSY.query("img",e.currentTarget.parentNode),"hover")};b.Event.add(d,"mouseenter mouseleave",c)}}});TPL.add("Feedbotton",function(a){var b=KISSY;a.Feedbotton={init:function(){var c=b.get("#J_Feed");if(c){if(typeof(TB.app)==="undefined"||typeof(TB.app.popDialog)==="undefined"){var d=document.createElement("script");d.src="http://a.tbcdn.cn/app/marketing/subcenter/tbrss.js";document.body.appendChild(d)}}}}});TPL.add("AddFav",function(a){var b=KISSY;a.AddFav={init:function(){var c=b.get("#J_AddFav");if(c){b.Event.on(c,"click",function(d){var f=document.title,e=document.location.href;if(document.all){window.external.AddFavorite(e,f)}else{if(window.sidebar&&window.sidebar.addPanel){window.sidebar.addPanel(f,e,"")}else{alert("\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6b64\u529f\u80fd\uff0c\u8bf7\u5c1d\u8bd5\u624b\u52a8\u6536\u85cf")}}d.halt();return false})}}}});TPL.add("ShopProdCount",function(a){var b=KISSY;a.ShopProdCount={init:function(){function f(c,o){if(!(this instanceof f)){return new f(c,o)}this.constructor=c;if(o instanceof Object){for(var q in o){if(o.hasOwnProperty(q)){this[q]=o[q]}}}}function g(p){if(!(p instanceof Array)){throw'argument "config" of "CountDown" must be an instance of "Array"!'}var q=0,o=p.length,r;for(;q<o;q++){r=p[q];if(!r[2]){r[2]=1000}}this.config=p;this.currentConfig=this.config.shift();this.timerHandler={}}g.accurateInterval=function(p,s,o,q){var t=new Date().getTime(),r=q?0:s;if(typeof o!=="object"){o={}}q?c():(o.timer=window.setTimeout(c,s));function c(){var u;if(p()===false){return}r+=s;u=r+t-new Date().getTime();o.timer=window.setTimeout(arguments.callee,u)}};g.prototype=new f(g,{start:function(){var c=this,o=function(){if(c.currentConfig[1]===0){c.currentConfig[0]({hour:0,minute:0,second:0});c.next();return false}var p=c._parseTime(c.currentConfig[1]);c.currentConfig[0](p);c.currentConfig[1]-=c.currentConfig[2]};g.accurateInterval(o,this.currentConfig[2],this.timerHandler,true)},next:function(){var o=this.config.shift();if(!(o instanceof Array)){return}this.currentConfig=o;this.start()},_parseTime:function(r){var p=Math.floor(r/1000),c=Math.floor(p/3600),q=Math.floor((p%3600)/60),o=(p%3600)%60;return{hour:c,minute:q,second:o}},stop:function(){clearTimeout(this.timerHandler.timer);this.timerHandler.timer=null}});var l=b.get("#J_ShopCount"),m=b.get("#J_ProdCount"),n=b.get("#J_ProdCountDesc");if(!l||!m){return}var i={shop:parseInt(l.getAttribute("data-begin"),10),prod:parseInt(m.getAttribute("data-begin"),10),item:parseInt(n.getAttribute("data-begin"),10),shop_step:2,prod_step:5,item_step:-14,left_time:parseInt(l.getAttribute("data-left-time"),10),interval:1000};var h=(24*3600*1000-i.left_time)/1000;i.shop+=Math.ceil(h/60)*2;i.prod+=Math.ceil(h)*5;i.item-=Math.ceil(h/60)*14;var e=0,d=60;var k=function(c){if(c.hour<=0&&c.minute<=0&&c.second<=0){j.stop()}if(e%60==0){if((i.shop+=i.shop_step)>0){l.innerHTML=i.shop}if((i.item+=i.item_step)>0){n.innerHTML=i.item}}e=(++e)%60;if((i.prod+=i.prod_step)>0){m.innerHTML=i.prod}};var j=new g([[k,i.left_time,i.interval]]);j.start()}}});TPL.init=function(a){VBase.App.init(this,a)};TPL.init();
/*
Copyright 2011, KISSY UI Library v1.1.8dev
MIT Licensed
build time: ${build.time}
*/
KISSY.add("switchable",function(c){function h(b,a){a=a||{};if(!("markupType"in a))if(a.panelCls)a.markupType=1;else if(a.panels)a.markupType=2;for(var e=this.constructor;e;){a=c.merge(e.Config,a);e=e.superclass?e.superclass.constructor:null}this.container=l.get(b);this.config=a;this.activeIndex=this.completedIndex=a.activeIndex;if(!(this.activeIndex>-1))if(typeof a.switchTo!="number")this.completedIndex=this.activeIndex=0;this._init();this._initPlugins();this.fire(r);this.activeIndex>-1||typeof a.switchTo==
"number"&&this.switchTo(a.switchTo)}function n(b){var a={};a.type=b.originalEvent.type;a.target=b.originalEvent.target||b.originalEvent.srcElement;return{originalEvent:a}}var l=c.DOM,o=c.Event,t=c.EventTarget,r="init";h.Config={markupType:0,navCls:"ks-switchable-nav",contentCls:"ks-switchable-content",triggerCls:"ks-switchable-trigger",panelCls:"ks-switchable-panel",triggers:[],panels:[],hasTriggers:true,triggerType:"mouse",delay:0.1,activeIndex:-1,activeTriggerCls:"ks-active",steps:1,viewSize:[]};
h.getDomEvent=n;h.Plugins=[];c.augment(h,t,{_initPlugins:function(){for(var b=this,a=b.constructor;a;){c.each(a.Plugins,function(e){e.init&&e.init(b)});a=a.superclass?a.superclass.constructor:null}},_init:function(){var b=this.config;this._parseMarkup();b.hasTriggers&&this._bindTriggers()},_parseMarkup:function(){var b=this.container,a=this.config,e,k,f=[],m=[];switch(a.markupType){case 0:if(e=l.get("."+a.navCls,b))f=l.children(e);k=l.get("."+a.contentCls,b);m=l.children(k);break;case 1:f=l.query("."+
a.triggerCls,b);m=l.query("."+a.panelCls,b);break;case 2:f=a.triggers;m=a.panels}b=m.length;this.length=b/a.steps;if(a.hasTriggers&&b>0&&f.length===0)f=this._generateTriggersMarkup(this.length);this.triggers=c.makeArray(f);this.panels=c.makeArray(m);this.content=k||m[0].parentNode;this.nav=e||a.hasTriggers&&f[0].parentNode},_generateTriggersMarkup:function(b){var a=this.config,e=l.create("<ul>"),k,f;e.className=a.navCls;for(f=0;f<b;f++){k=l.create("<li>");if(f===this.activeIndex)k.className=a.activeTriggerCls;
k.innerHTML=f+1;e.appendChild(k)}this.container.appendChild(e);return l.children(e)},_bindTriggers:function(){var b=this,a=b.config,e=b.triggers,k,f,m=e.length;for(f=0;f<m;f++)(function(s){k=e[s];o.on(k,"click",function(v){b._onFocusTrigger(s,v)});if(a.triggerType==="mouse"){o.on(k,"mouseenter",function(v){b._onMouseEnterTrigger(s,v)});o.on(k,"mouseleave",function(){b._onMouseLeaveTrigger(s)})}})(f)},_onFocusTrigger:function(b,a){if(this._triggerIsValid(b)){this._cancelSwitchTimer();this.switchTo(b,
undefined,n(a))}},_onMouseEnterTrigger:function(b,a){var e=this;if(e._triggerIsValid(b)){var k=n(a);e.switchTimer=c.later(function(){e.switchTo(b,undefined,k)},e.config.delay*1E3)}},_onMouseLeaveTrigger:function(){this._cancelSwitchTimer()},_triggerIsValid:function(b){return this.activeIndex!==b},_cancelSwitchTimer:function(){if(this.switchTimer){this.switchTimer.cancel();this.switchTimer=undefined}},switchTo:function(b,a,e,k){var f=this,m=f.config,s=f.triggers,v=f.panels,w=f.activeIndex,q=m.steps,
p=w*q,z=b*q;if(!f._triggerIsValid(b))return f;if(f.fire("beforeSwitch",{toIndex:b})===false)return f;if(m.hasTriggers)f._switchTrigger(w>-1?s[w]:null,s[b]);if(a===undefined)a=b>w?"forward":"backward";f._switchView(w>-1?v.slice(p,p+q):null,v.slice(z,z+q),b,a,e,function(){k&&k.call(f,b);f.completedIndex=b});f.activeIndex=b;return f},_switchTrigger:function(b,a){var e=this.config.activeTriggerCls;b&&l.removeClass(b,e);l.addClass(a,e)},_switchView:function(b,a,e,k,f,m){b&&l.css(b,"display","none");l.css(a,
"display","block");this._fireOnSwitch(e,f);m&&m.call(this)},_fireOnSwitch:function(b,a){this.fire("switch",c.mix(a||{},{currentIndex:b}))},prev:function(b){var a=this.activeIndex;this.switchTo(a>0?a-1:this.length-1,"backward",b)},next:function(b){var a=this.activeIndex;this.switchTo(a<this.length-1?a+1:0,"forward",b)}});return c.Switchable=h},{requires:["core"]});
KISSY.add("switchable/aria",function(c,h,n,l){function o(){this.stop&&this.stop()}function t(){this.start&&this.start()}h=c.DOM;n=c.Event;l=c.Switchable;var r=!document.documentElement.hasAttribute?function(a,e){e=e.toLowerCase();var k=h.get(a).getAttributeNode(e);return!!(k&&k.specified)}:function(a,e){e=e.toLowerCase();return h.get(a).hasAttribute(e)};l.Plugins.push({name:"aria",init:function(a){if(a.config.aria){var e=a.container;n.on(e,"focusin",o,a);n.on(e,"focusout",t,a)}}});var b=["a","input",
"button","object"];l.Aria={setTabIndex:function(a,e){a.tabIndex=e;h.query("*",a).each(function(k){var f=k.nodeName.toLowerCase();if(c.inArray(f,b)){r(k,"oriTabIndex")||h.attr(k,"oriTabIndex",k.tabIndex);k.tabIndex=e!=-1?h.attr(k,"oriTabIndex"):e}})}}},{host:"switchable"});
KISSY.add("switchable/accordion/base",function(c,h,n){function l(o,t){if(!(this instanceof l))return new l(o,t);l.superclass.constructor.apply(this,arguments);return 0}n=c.Switchable;h=c.DOM;c.extend(l,n,{_switchTrigger:function(o,t){var r=this.config;r.multiple?h.toggleClass(t,r.activeTriggerCls):l.superclass._switchTrigger.apply(this,arguments)},_triggerIsValid:function(o){return l.superclass._triggerIsValid.call(this,o)||this.config.multiple},_switchView:function(o,t,r,b,a,e){var k=t[0];if(this.config.multiple){h.toggle(k);
this._fireOnSwitch(r,a);e.call(this)}else l.superclass._switchView.apply(this,arguments)}});l.Plugins=[];l.Config={markupType:1,triggerType:"click",multiple:false};return c.Accordion=l},{host:"switchable"});
KISSY.add("switchable/accordion/aria",function(c,h,n){function l(i){var x;c.each(this.triggers,function(B){if(B==i||m.contains(B,i))x=B});return x}function o(i){switch(i.keyCode){case s:case v:i.ctrlKey&&!i.altKey&&!i.shiftKey&&i.halt();break;case g:i.ctrlKey&&!i.altKey&&i.halt()}}function t(i){var x=i.target,B=this.triggers,C=!i.ctrlKey&&!i.shiftKey&&!i.altKey,E=i.ctrlKey&&!i.shiftKey&&!i.altKey;switch(i.keyCode){case A:case u:if(l.call(this,x)&&C){this.switchTo(this.focusIndex);i.halt()}break;case p:case z:if(l.call(this,
x)){b.call(this);i.halt()}break;case d:case j:if(l.call(this,x)){a.call(this);i.halt()}break;case v:if(E){i.halt();a.call(this)}break;case s:if(E){i.halt();b.call(this)}break;case q:if(C){x=this.focusIndex;this.focusIndex=0;r.call(this,x,0,true);i.halt()}break;case w:if(C){x=B.length-1;B=this.focusIndex;this.focusIndex=x;r.call(this,B,x,true);i.halt()}break;case g:if(i.ctrlKey&&!i.altKey){i.halt();i.shiftKey?b.call(this):a.call(this)}}}function r(i,x,B){var C=this.triggers;if(typeof i=="number")var E=
C[i];i=C[x];if(E){y(E,"-1");m.removeClass(E,k);E.setAttribute("aria-selected","false")}B&&i.focus();y(i,"0");m.addClass(i,k);i.setAttribute("aria-selected","true")}function b(){var i=this.triggers,x=this.focusIndex;i=this.focusIndex=x==0?i.length-1:x-1;r.call(this,x,i,true)}function a(){var i=this.focusIndex,x=this.focusIndex=i==this.triggers.length-1?0:i+1;r.call(this,i,x,true)}function e(i){var x=!!(i.originalEvent.target||i.originalEvent.srcElement),B=this.config.multiple,C=this.completedIndex;
i=i.currentIndex;var E=this.triggers[i],F=this.panels[i];if(C>-1){var D=this.triggers[C];C=this.panels[C];y(D,"-1");x&&E.focus();if(!B){C.setAttribute("aria-hidden","true");D.setAttribute("aria-expanded","false")}}y(E,"0");x=F.getAttribute("aria-hidden");F.setAttribute("aria-hidden",x=="false"?"true":"false");E.setAttribute("aria-expanded",x=="false"?"false":"true");r.call(this,this.focusIndex,i);this.focusIndex=i}h=c.Switchable.Aria;n=c.Accordion;var k="ks-switchable-select",f=c.Event,m=c.DOM,s=
33,v=34,w=35,q=36,p=37,z=38,d=39,j=40,g=9,u=32,A=13;c.mix(n.Config,{aria:false});n.Plugins.push({name:"aria",init:function(i){if(i.config.aria){var x=i.container,B=i.activeIndex;m.attr(x,"aria-multiselectable",i.config.multiple?"true":"false");m.attr(x,"role","tablist");var C=i.triggers,E=i.panels,F=0;c.each(E,function(D){if(!D.id)D.id=c.guid("ks-switchable-tab-panel")});c.each(C,function(D){if(!D.id)D.id=c.guid("ks-switchable-tab")});c.each(C,function(D){D.setAttribute("role","tab");D.setAttribute("aria-expanded",
B==F?"true":"false");D.setAttribute("aria-selected",B==F?"true":"false");D.setAttribute("aria-controls",E[F].id);y(D,B==F?"0":"-1");F++});F=0;c.each(E,function(D){var G=C[F];D.setAttribute("role","tabpanel");D.setAttribute("aria-hidden",B==F?"false":"true");D.setAttribute("aria-labelledby",G.id);F++});i.on("switch",e,i);if(B>-1)i.focusIndex=B;f.on(x,"keydown",t,i);f.on(x,"keypress",o,i)}}});var y=h.setTabIndex},{host:"switchable"});
KISSY.add("switchable/autoplay",function(c,h,n,l){h=c.Event;n=c.Switchable;c.mix(n.Config,{autoplay:false,interval:5,pauseOnHover:true});n.Plugins.push({name:"autoplay",init:function(o){function t(){a=c.later(function(){o.paused||o.switchTo(o.activeIndex<o.length-1?o.activeIndex+1:0,"forward")},b,true)}var r=o.config,b=r.interval*1E3,a;if(r.autoplay){if(r.pauseOnHover){h.on(o.container,"mouseenter",function(){o.stop()});h.on(o.container,"mouseleave",function(){o.start()})}t();o.stop=function(){if(a){a.cancel();
a=l}o.paused=true};o.start=function(){if(a){a.cancel();a=l}o.paused=false;t()}}}});return n},{host:"switchable"});KISSY.add("switchable/autorender",function(c,h,n,l){h=c.DOM;n=c.JSON;l=c.Switchable;l.autoRender=function(o,t){o="."+(o||"KS_Widget");h.query(o,t).each(function(r){var b=r.getAttribute("data-widget-type"),a;if(b&&"Switchable Tabs Slide Carousel Accordion".indexOf(b)>-1)try{if(a=r.getAttribute("data-widget-config"))a=a.replace(/'/g,'"');new c[b](r,n.parse(a))}catch(e){}})}},{host:"switchable"});
KISSY.add("switchable/carousel/base",function(c,h,n,l,o){function t(b,a){if(!(this instanceof t))return new t(b,a);t.superclass.constructor.apply(this,arguments)}l=c.Switchable;h=c.DOM;n=c.Event;var r={originalEvent:{target:1}};t.Config={circular:true,prevBtnCls:"ks-switchable-prev-btn",nextBtnCls:"ks-switchable-next-btn",disableBtnCls:"ks-switchable-disable-btn"};t.Plugins=[];c.extend(t,l,{_init:function(){var b=this;t.superclass._init.call(b);var a=b.config,e=a.disableBtnCls,k=false;c.each(["prev",
"next"],function(f){var m=b[f+"Btn"]=h.get("."+a[f+"BtnCls"],b.container);m&&n.on(m,"click",function(s){s.preventDefault();k||h.hasClass(m,e)||b[f](r)})});if(!a.circular){b.on("beforeSwitch",function(){k=true});b.on("switch",function(f){f=f.currentIndex;f=f===0?b.prevBtn:f===b.length-1?b.nextBtn:o;h.removeClass([b.prevBtn,b.nextBtn],e);f&&h.addClass(f,e);k=false})}n.on(b.panels,"click",function(){b.fire("itemSelected",{item:this})})}});return c.Carousel=t},{host:"switchable"});
KISSY.add("switchable/carousel/aria",function(c,h,n,l,o){function t(d){var j=d.currentIndex,g=this.completedIndex,u=this.panels,A=u[j*this.config.steps],y=this.triggers;j=y[j];if((d=!!(d.originalEvent.target||d.originalEvent.srcElement))||g==-1){c.each(y,function(i){p(i,-1)});c.each(u,function(i){p(i,-1)});j&&p(j,0);p(A,0);d&&A.focus()}}function r(d){var j;c.each(this.triggers,function(g){if(g==d||h.contains(g,d)){j=g;return false}});return j}function b(d){var j=d.target;switch(d.keyCode){case v:case s:if(j=
r.call(this,j)){j=j;var g=h.next(j),u=this.triggers;g||(g=u[0]);p(j,-1);if(g){p(g,0);g.focus()}d.halt()}break;case m:case f:if(j=r.call(this,j)){j=j;g=h.prev(j);u=this.triggers;g||(g=u[u.length-1]);p(j,-1);if(g){p(g,0);g.focus()}d.halt()}break;case q:case w:if(j=r.call(this,j)){this.switchTo(c.indexOf(j,this.triggers),undefined,z);d.halt()}}}function a(d){var j;c.each(this.panels,function(g){if(g==d||h.contains(g,d)){j=g;return false}});return j}function e(d){var j=c.indexOf(d,this.panels),g=this.config.steps,
u=Math.floor(j/g);if(u==this.activeIndex)return 1;if(j%g==0||j%g==g-1){this.switchTo(u,undefined,undefined,function(){d.focus()});return 0}return 1}function k(d){var j=d.target;switch(d.keyCode){case v:case s:if(j=a.call(this,j)){j=j;var g=h.next(j),u=this.panels;g||(g=u[0]);p(j,-1);p(g,0);e.call(this,g)&&g.focus();d.halt()}break;case m:case f:if(j=a.call(this,j)){j=j;g=h.prev(j);u=this.panels;g||(g=u[u.length-1]);p(j,-1);p(g,0);e.call(this,g)&&g.focus();d.halt()}break;case q:case w:if(j=a.call(this,
j)){this.fire("itemSelected",{item:j});d.halt()}}}h=c.DOM;n=c.Event;l=c.Switchable.Aria;o=c.Carousel;var f=37,m=38,s=39,v=40,w=32,q=13,p=l.setTabIndex,z={originalEvent:{target:1}};c.mix(o.Config,{aria:false});o.Plugins.push({name:"aria",init:function(d){if(d.config.aria){var j=d.triggers,g=d.panels,u=d.content,A=d.activeIndex;if(!u.id)u.id=c.guid("ks-switchbale-content");u.setAttribute("role","listbox");c.each(j,function(y){p(y,A==0?"0":"-1");y.setAttribute("role","button");y.setAttribute("aria-controls",
u.id)});c.each(g,function(y){p(y,-1);y.setAttribute("role","option")});d.on("switch",t,d);(j=d.nav)&&n.on(j,"keydown",b,d);n.on(u,"keydown",k,d);j=d.prevBtn;g=d.nextBtn;if(j){p(j,0);j.setAttribute("role","button");n.on(j,"keydown",function(y){if(y.keyCode==q||y.keyCode==w){d.prev(z);y.preventDefault()}})}if(g){p(g,0);g.setAttribute("role","button");n.on(g,"keydown",function(y){if(y.keyCode==q||y.keyCode==w){d.next(z);y.preventDefault()}})}}}})},{host:"switchable"});
KISSY.add("switchable/effect",function(c,h,n,l,o,t){h=c.DOM;l=c.Anim;o=c.Switchable;var r;c.mix(o.Config,{effect:"none",duration:0.5,easing:"easeNone",nativeAnim:true});o.Effects={none:function(b,a,e){b&&h.css(b,"display","none");h.css(a,"display","block");e()},fade:function(b,a,e){b&&b.length!==1&&c.error("fade effect only supports steps == 1.");var k=this,f=k.config,m=b?b[0]:null,s=a[0];if(k.anim){k.anim.stop();h.css(k.anim.fromEl,{zIndex:1,opacity:0});h.css(k.anim.toEl,{zIndex:9})}h.css(s,"opacity",
1);if(m){k.anim=(new l(m,{opacity:0},f.duration,f.easing,function(){k.anim=t;h.css(s,"z-index",9);h.css(m,"z-index",1);e&&e()},f.nativeAnim)).run();k.anim.toEl=s;k.anim.fromEl=m}else{h.css(s,"z-index",9);e&&e()}},scroll:function(b,a,e,k){var f=this;a=f.config;var m=a.effect==="scrollx",s={};s[m?"left":"top"]=-(f.viewSize[m?0:1]*k)+"px";f.anim&&f.anim.stop();if(b)f.anim=(new l(f.content,s,a.duration,a.easing,function(){f.anim=t;e&&e()},a.nativeAnim)).run();else{h.css(f.content,s);e&&e()}}};r=o.Effects;
r.scrollx=r.scrolly=r.scroll;o.Plugins.push({name:"effect",init:function(b){var a=b.config,e=a.effect,k=b.panels,f=b.content,m=a.steps,s=b.activeIndex,v=k.length;b.viewSize=[a.viewSize[0]||k[0].offsetWidth*m,a.viewSize[1]||k[0].offsetHeight*m];if(e!=="none"){c.each(k,function(z){h.css(z,"display","block")});switch(e){case "scrollx":case "scrolly":h.css(f,"position","absolute");h.css(f.parentNode,"position","relative");if(e==="scrollx"){h.css(k,"float","left");h.width(f,b.viewSize[0]*(v/m))}break;
case "fade":var w=s*m,q=w+m-1,p;c.each(k,function(z,d){p=d>=w&&d<=q;h.css(z,{opacity:p?1:0,position:"absolute",zIndex:p?9:1})})}}}});c.augment(o,{_switchView:function(b,a,e,k,f,m){var s=this,v=s.config.effect;(c.isFunction(v)?v:r[v]).call(s,b,a,function(){s._fireOnSwitch(e,f);m&&m.call(s)},e,k)}});return o},{host:"switchable"});
KISSY.add("switchable/circular",function(c,h,n,l){function o(q,p,z,d,j){var g=this;q=g.config;p=g.length;var u=g.activeIndex,A=q.scrollType===w,y=A?e:k,i=g.viewSize[A?0:1];A=-i*d;var x={},B,C=j===v;if(B=C&&u===0&&d===p-1||j===s&&u===p-1&&d===0)A=t.call(g,g.panels,d,C,y,i);x[y]=A+m;g.anim&&g.anim.stop();g.anim=(new n(g.content,x,q.duration,q.easing,function(){B&&r.call(g,g.panels,d,C,y,i);g.anim=undefined;z()},q.nativeAnim)).run()}function t(q,p,z,d,j){var g=this.config.steps;p=this.length;var u=z?
p-1:0,A=(u+1)*g;for(g=u*g;g<A;g++){h.css(q[g],b,a);h.css(q[g],d,(z?-1:1)*j*p)}return z?j:-j*p}function r(q,p,z,d,j){var g=this.config.steps;p=this.length;var u=z?p-1:0,A=(u+1)*g;for(g=u*g;g<A;g++){h.css(q[g],b,f);h.css(q[g],d,f)}h.css(this.content,d,z?-j*(p-1):f)}h=c.DOM;n=c.Anim;l=c.Switchable;var b="position",a="relative",e="left",k="top",f="",m="px",s="forward",v="backward",w="scrollx";c.mix(l.Config,{circular:false});l.Plugins.push({name:"circular",init:function(q){q=q.config;if(q.circular&&(q.effect===
w||q.effect==="scrolly")){q.scrollType=q.effect;q.effect=o}}})},{host:"switchable"});
KISSY.add("switchable/countdown",function(c,h,n,l,o,t){h=c.DOM;n=c.Event;l=c.Anim;o=c.Switchable;c.mix(o.Config,{countdown:false,countdownFromStyle:"",countdownToStyle:"width: 0"});o.Plugins.push({name:"countdown",init:function(r){function b(q){a();w=(new l(m[q],v,f-1)).run()}function a(){if(k){clearTimeout(k);k=null}if(w){w.stop();w=t}}var e=r.config,k,f=e.interval,m=[],s=e.countdownFromStyle,v=e.countdownToStyle,w;if(!(!e.autoplay||!e.hasTriggers||!e.countdown)){c.each(r.triggers,function(q,p){q.innerHTML=
'<div class="ks-switchable-trigger-mask"></div><div class="ks-switchable-trigger-content">'+q.innerHTML+"</div>";m[p]=q.firstChild});if(e.pauseOnHover){n.on(r.container,"mouseenter",function(){a();var q=m[r.activeIndex];if(s)w=(new l(q,s,0.2,"easeOut")).run();else h.removeAttr(q,"style")});n.on(r.container,"mouseleave",function(){a();var q=r.activeIndex;h.removeAttr(m[q],"style");k=setTimeout(function(){b(q)},200)})}r.on("beforeSwitch",function(){a();if(r.activeIndex>-1)h.attr(m[r.activeIndex],"style",
s||"")});r.on("switch",function(q){r.paused||b(q.currentIndex)})}}});return o},{host:"switchable"});
KISSY.add("switchable/lazyload",function(c,h,n){h=c.DOM;n=c.Switchable;var l="beforeSwitch",o="img-src",t="area-data",r={};r[o]="data-ks-lazyload-custom";r[t]="ks-datalazyload-custom";c.mix(n.Config,{lazyDataType:t});n.Plugins.push({name:"lazyload",init:function(b){function a(s){var v=k.steps;s=s.toIndex*v;e.loadCustomLazyData(b.panels.slice(s,s+v),f);a:{var w,q;if(s=(v=f===o)?"img":f===t?"textarea":""){s=h.query(s,b.container);w=0;for(q=s.length;w<q;w++)if(v?h.attr(s[w],m):h.hasClass(s[w],m)){v=
false;break a}}v=true}v&&b.detach(l,a)}var e=c.DataLazyload,k=b.config,f=k.lazyDataType,m=r[f];!e||!f||!m||b.on(l,a)}});return n},{host:"switchable"});KISSY.add("switchable/slide/base",function(c,h){function n(l,o){if(!(this instanceof n))return new n(l,o);n.superclass.constructor.apply(this,arguments);return 0}h=c.Switchable;n.Config={autoplay:true,circular:true};n.Plugins=[];c.extend(n,h);return c.Slide=n},{host:"switchable"});
KISSY.add("switchable/slide/aria",function(c,h,n,l,o){function t(m){switch(m.keyCode){case e:case a:this.next(k);m.halt();break;case b:case r:this.prev(k);m.halt()}}l=c.Switchable;h=c.DOM;n=c.Event;l=l.Aria;o=c.Slide;var r=37,b=38,a=39,e=40;c.mix(o.Config,{aria:false});var k={originalEvent:{target:1}},f=l.setTabIndex;o.Plugins.push({name:"aria",init:function(m){if(m.config.aria){var s=m.panels,v=0,w=m.activeIndex;c.each(m.triggers,function(p){f(p,"-1");v++});v=0;c.each(s,function(p){f(p,w==v?"0":
"-1");h.attr(p,"role","option");v++});var q=m.content;h.attr(q,"role","listbox");n.on(q,"keydown",t,m);f(s[0],0);m.on("switch",function(p){var z=!!(p.originalEvent.target||p.originalEvent.srcElement);p=p.currentIndex;var d=m.completedIndex;d>-1&&f(s[d],-1);f(s[p],0);z&&s[p].focus()})}}})},{host:"switchable"});
KISSY.add("switchable/tabs/base",function(c,h){function n(l,o){if(!(this instanceof n))return new n(l,o);n.superclass.constructor.call(this,l,o);return 0}h=c.Switchable;c.extend(n,h);n.Config={};n.Plugins=[];return c.Tabs=n},{host:"switchable"});
KISSY.add("switchable/tabs/aria",function(c,h,n){function l(d){var j;c.each(this.triggers,function(g){if(g==d||e.contains(g,d))j=g});return j}function o(d){switch(d.keyCode){case k:case f:d.ctrlKey&&!d.altKey&&!d.shiftKey&&d.halt();break;case q:d.ctrlKey&&!d.altKey&&d.halt()}}function t(d){var j=d.target,g=d.ctrlKey&&!d.shiftKey&&!d.altKey;switch(d.keyCode){case m:case s:if(l.call(this,j)){this.prev(p(d));d.halt()}break;case v:case w:if(l.call(this,j)){this.next(p(d));d.halt()}break;case f:if(g){d.halt();
this.next(p(d))}break;case k:if(g){d.halt();this.prev(p(d))}break;case q:if(d.ctrlKey&&!d.altKey){d.halt();d.shiftKey?this.prev(p(d)):this.next(p(d))}}}function r(d){var j=!!(d.originalEvent.target||d.originalEvent.srcElement),g=this.completedIndex,u=d.currentIndex;if(g!=u){d=this.triggers[g];var A=this.triggers[u];g=this.panels[g];u=this.panels[u];d&&z(d,"-1");z(A,"0");j&&A.focus();g&&g.setAttribute("aria-hidden","true");u.setAttribute("aria-hidden","false")}}var b=c.Switchable;h=b.Aria;n=c.Tabs;
var a=c.Event,e=c.DOM,k=33,f=34,m=37,s=38,v=39,w=40,q=9;c.mix(n.Config,{aria:false});var p=b.getDomEvent;n.Plugins.push({name:"aria",init:function(d){if(d.config.aria){var j=d.triggers,g=d.activeIndex,u=d.panels,A=d.container;d.nav&&e.attr(d.nav,"role","tablist");var y=0;c.each(j,function(i){i.setAttribute("role","tab");z(i,g==y?"0":"-1");if(!i.id)i.id=c.guid("ks-switchable");y++});y=0;c.each(u,function(i){var x=j[y];i.setAttribute("role","tabpanel");i.setAttribute("aria-hidden",g==y?"false":"true");
i.setAttribute("aria-labelledby",x.id);y++});d.on("switch",r,d);a.on(A,"keydown",t,d);a.on(A,"keypress",o,d)}}});var z=h.setTabIndex},{host:"switchable"});