/*
Copyright 2012, KISSY UI Library v1.30rc
MIT Licensed
build time: Jul 11 21:21
*/
KISSY.add("anim",function(d,c,b){c.Easing=b;d.mix(d,{Anim:c,Easing:c.Easing});return c},{requires:["anim/base","anim/easing","anim/color","anim/backgroundPosition"]});
KISSY.add("anim/backgroundPosition",function(d,c,b,f){function a(a){a=a.replace(/left|top/g,"0px").replace(/right|bottom/g,"100%").replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");a=a.match(/(-?[0-9\.]+)(px|%|em|pt)\s(-?[0-9\.]+)(px|%|em|pt)/);return[parseFloat(a[1]),a[2],parseFloat(a[3]),a[4]]}function e(){e.superclass.constructor.apply(this,arguments)}d.extend(e,f,{load:function(){e.superclass.load.apply(this,arguments);this.unit=["px","px"];if(this.from){var c=a(this.from);this.from=[c[0],c[2]]}else this.from=
[0,0];this.to?(c=a(this.to),this.to=[c[0],c[2]],this.unit=[c[1],c[3]]):this.to=[0,0]},interpolate:function(a,c,d){var b=this.unit,f=e.superclass.interpolate;return f(a[0],c[0],d)+b[0]+" "+f(a[1],c[1],d)+b[1]},cur:function(){return c.css(this.anim.elem,"backgroundPosition")},update:function(){var a=this.prop,d=this.anim.elem,e=this.interpolate(this.from,this.to,this.pos);c.css(d,a,e)}});return f.Factories.backgroundPosition=e},{requires:["dom","./base","./fx"]});
KISSY.add("anim/base",function(d,c,b,f,a,e,m,h){function g(a,e,i,h,b){if(a=c.get(a)){if(!(this instanceof g))return new g(a,e,i,h,b);var e=d.isString(e)?d.unparam(""+e,";",":"):d.clone(e),f;for(f in e){var m=o(d.trim(f));f!=m&&(e[m]=e[f],delete e[f])}i=d.isPlainObject(i)?d.clone(i):{duration:parseFloat(i)||void 0,easing:h,complete:b};this.config=i=d.merge(x,i);i.duration*=1E3;this.elem=this.domEl=a;this.props=e;this._backupProps={};this._fxs={};this.on("complete",r)}}function r(a){var e,i=this.config;
d.isEmptyObject(e=this._backupProps)||c.css(this.elem,e);i.complete&&i.complete.call(this,a)}function k(){var s=this.config,h=this._backupProps,i=this.elem,b,g,j,p=s.specialEasing||{},r=this._fxs,k=this.props;u(this);if(!1===this.fire("start"))this.stop(0);else{if(i.nodeType==c.ELEMENT_NODE)for(j in g="none"===c.css(i,"display"),k)if(b=k[j],"hide"==b&&g||"show"==b&&!g){this.stop(1);return}if(i.nodeType==c.ELEMENT_NODE&&(k.width||k.height))b=i.style,d.mix(h,{overflow:b.overflow,"overflow-x":b.overflowX,
"overflow-y":b.overflowY}),b.overflow="hidden","inline"===c.css(i,"display")&&"none"===c.css(i,"float")&&(a.ie?b.zoom=1:b.display="inline-block");d.each(k,function(a,c){if(k.hasOwnProperty(c)){var b;d.isArray(a)?(b=p[c]=a[1],k[c]=a[0]):b=p[c]=p[c]||s.easing;d.isString(b)&&(b=p[c]=f[b]);p[c]=b||f.easeNone}});d.each(w,function(a,b){var e,h,s;if(s=k[b]){h={};d.each(a,function(a){h[a]=c.css(i,a);p[a]=p[b]});c.css(i,b,s);for(e in h)k[e]=c.css(i,e),c.css(i,e,h[e]);delete k[b]}});for(j in k)if(k.hasOwnProperty(j)){b=
d.trim(k[j]);var o,l,q={prop:j,anim:this,easing:p[j]},n=m.getFx(q);d.inArray(b,y)?(h[j]=c.style(i,j),"toggle"==b&&(b=g?"show":"hide"),"hide"==b?(o=0,l=n.cur(),h.display="none"):(l=0,o=n.cur(),c.css(i,j,l),c.show(i)),b=o):(o=b,l=n.cur());b+="";var v="",t=b.match(z);if(t){o=parseFloat(t[2]);if((v=t[3])&&"px"!==v)c.css(i,j,b),l*=o/n.cur(),c.css(i,j,l+v);t[1]&&(o=("-="===t[1]?-1:1)*o+l)}q.from=l;q.to=o;q.unit=v;n.load(q);r[j]=n}this._startTime=d.now();e.start(this)}}function u(a){var b=a.elem,e=c.data(b,
l);e||c.data(b,l,e={});e[d.stamp(a)]=a}function p(a){var b=a.elem,e=c.data(b,l);e&&(delete e[d.stamp(a)],d.isEmptyObject(e)&&c.removeData(b,l))}function j(a,b,e){var a=c.data(a,"resume"==e?n:l),a=d.merge(a),h;for(h in a){var g=a[h];if(void 0===b||g.config.queue==b)g[e]()}}function q(a,b,e,g){e&&!1!==g&&h.removeQueue(a,g);var a=c.data(a,l),a=d.merge(a),j;for(j in a)e=a[j],e.config.queue==g&&e.stop(b)}var o=c._camelCase,y=["hide","show","toggle"],w={background:["backgroundPosition"],border:["borderBottomWidth",
"borderLeftWidth","borderRightWidth","borderTopWidth"],borderBottom:["borderBottomWidth"],borderLeft:["borderLeftWidth"],borderTop:["borderTopWidth"],borderRight:["borderRightWidth"],font:["fontSize","fontWeight"],margin:["marginBottom","marginLeft","marginRight","marginTop"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"]},x={duration:1,easing:"easeNone"},z=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i;g.SHORT_HANDS=w;d.augment(g,b.Target,{isRunning:function(){var a=c.data(this.elem,l);
return a?!!a[d.stamp(this)]:0},isPaused:function(){var a=c.data(this.elem,n);return a?!!a[d.stamp(this)]:0},pause:function(){if(this.isRunning()){this._pauseDiff=d.now()-this._startTime;e.stop(this);p(this);var a=this.elem,b=c.data(a,n);b||c.data(a,n,b={});b[d.stamp(this)]=this}return this},resume:function(){if(this.isPaused()){this._startTime=d.now()-this._pauseDiff;var a=this.elem,b=c.data(a,n);b&&(delete b[d.stamp(this)],d.isEmptyObject(b)&&c.removeData(a,n));u(this);e.start(this)}return this},
_runInternal:k,run:function(){!1===this.config.queue?k.call(this):h.queue(this);return this},_frame:function(){var a,b=this.config,e=1,c,d,h=this._fxs;for(a in h)if(h.hasOwnProperty(a)&&!(d=h[a]).finished)b.frame&&(c=b.frame(d)),1==c||0==c?(d.finished=c,e&=c):(e&=d.frame())&&b.frame&&b.frame(d);(!1===this.fire("step")||e)&&this.stop(e)},stop:function(a){var b=this.config,c=b.queue,d,g,j=this._fxs;if(this.isRunning()){if(a){for(d in j)if(j.hasOwnProperty(d)&&!(g=j[d]).finished)b.frame?b.frame(g,1):
g.frame(1);this.fire("complete")}e.stop(this);p(this);!1!==c&&h.dequeue(this);return this}!1!==c&&h.remove(this)}});var l=d.guid("ks-anim-unqueued-"+d.now()+"-"),n=d.guid("ks-anim-paused-"+d.now()+"-");g.stop=function(a,b,e,g){if(null===g||d.isString(g)||!1===g)return q.apply(void 0,arguments);e&&h.removeQueues(a);var j=c.data(a,l),j=d.merge(j),f;for(f in j)j[f].stop(b)};d.each(["pause","resume"],function(a){g[a]=function(b,e){if(null===e||d.isString(e)||!1===e)return j(b,e,a);j(b,void 0,a)}});g.isRunning=
function(a){return(a=c.data(a,l))&&!d.isEmptyObject(a)};g.isPaused=function(a){return(a=c.data(a,n))&&!d.isEmptyObject(a)};g.Q=h;return g},{requires:"dom,event,./easing,ua,./manager,./fx,./queue".split(",")});
KISSY.add("anim/color",function(d,c,b,f){function a(a){var a=a+"",b;if(b=a.match(r))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])];if(b=a.match(k))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),parseInt(b[4])];if(b=a.match(u)){for(a=1;a<b.length;a++)2>b[a].length&&(b[a]+=b[a]);return[parseInt(b[1],m),parseInt(b[2],m),parseInt(b[3],m)]}return g[a=a.toLowerCase()]?g[a]:[255,255,255]}function e(){e.superclass.constructor.apply(this,arguments)}var m=16,h=Math.floor,g={black:[0,0,0],silver:[192,
192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]},r=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,k=/^rgba\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+),\s*([0-9]+)\)$/i,u=/^#?([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})$/i,c=b.SHORT_HANDS;c.background=c.background||[];c.background.push("backgroundColor");
c.borderColor=["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"];c.border.push("borderBottomColor","borderLeftColor","borderRightColor","borderTopColor");c.borderBottom.push("borderBottomColor");c.borderLeft.push("borderLeftColor");c.borderRight.push("borderRightColor");c.borderTop.push("borderTopColor");d.extend(e,f,{load:function(){e.superclass.load.apply(this,arguments);this.from&&(this.from=a(this.from));this.to&&(this.to=a(this.to))},interpolate:function(a,b,c){var d=
e.superclass.interpolate;if(3==a.length&&3==b.length)return"rgb("+[h(d(a[0],b[0],c)),h(d(a[1],b[1],c)),h(d(a[2],b[2],c))].join(", ")+")";if(4==a.length||4==b.length)return"rgba("+[h(d(a[0],b[0],c)),h(d(a[1],b[1],c)),h(d(a[2],b[2],c)),h(d(a[3]||1,b[3]||1,c))].join(", ")+")"}});d.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(a){f.Factories[a]=e});return e},{requires:["dom","./base","./fx"]});
KISSY.add("anim/easing",function(){var d=Math.PI,c=Math.pow,b=Math.sin,f={swing:function(a){return-Math.cos(a*d)/2+0.5},easeNone:function(a){return a},easeIn:function(a){return a*a},easeOut:function(a){return(2-a)*a},easeBoth:function(a){return 1>(a*=2)?0.5*a*a:0.5*(1- --a*(a-2))},easeInStrong:function(a){return a*a*a*a},easeOutStrong:function(a){return 1- --a*a*a*a},easeBothStrong:function(a){return 1>(a*=2)?0.5*a*a*a*a:0.5*(2-(a-=2)*a*a*a)},elasticIn:function(a){return 0===a||1===a?a:-(c(2,10*(a-=
1))*b((a-0.075)*2*d/0.3))},elasticOut:function(a){return 0===a||1===a?a:c(2,-10*a)*b((a-0.075)*2*d/0.3)+1},elasticBoth:function(a){return 0===a||2===(a*=2)?a:1>a?-0.5*c(2,10*(a-=1))*b((a-0.1125)*2*d/0.45):0.5*c(2,-10*(a-=1))*b((a-0.1125)*2*d/0.45)+1},backIn:function(a){1===a&&(a-=0.0010);return a*a*(2.70158*a-1.70158)},backOut:function(a){return(a-=1)*a*(2.70158*a+1.70158)+1},backBoth:function(a){var b,c=(b=2.5949095)+1;return 1>(a*=2)?0.5*a*a*(c*a-b):0.5*((a-=2)*a*(c*a+b)+2)},bounceIn:function(a){return 1-
f.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},bounceBoth:function(a){return 0.5>a?0.5*f.bounceIn(2*a):0.5*f.bounceOut(2*a-1)+0.5}};return f});
KISSY.add("anim/fx",function(d,c,b){function f(a){this.load(a)}function a(a,d){return(!a.style||null==a.style[d])&&null!=c.attr(a,d,b,1)?1:0}d.augment(f,{load:function(a){d.mix(this,a);this.pos=0;this.unit=this.unit||""},frame:function(a){var b=this.anim,c=0;if(this.finished)return 1;var g=d.now(),f=b._startTime,b=b.config.duration;a||g>=b+f?c=this.pos=1:this.pos=this.easing((g-f)/b);this.update();this.finished=this.finished||c;return c},interpolate:function(a,c,h){return d.isNumber(a)&&d.isNumber(c)?
(a+(c-a)*h).toFixed(3):b},update:function(){var d=this.prop,f=this.anim.elem,h=this.to,g=this.interpolate(this.from,h,this.pos);g===b?this.finished||(this.finished=1,c.css(f,d,h)):(g+=this.unit,a(f,d)?c.attr(f,d,g,1):c.css(f,d,g))},cur:function(){var d=this.prop,f=this.anim.elem;if(a(f,d))return c.attr(f,d,b,1);var h,d=c.css(f,d);return isNaN(h=parseFloat(d))?!d||"auto"===d?0:d:h}});f.Factories={};f.getFx=function(a){return new (f.Factories[a.prop]||f)(a)};return f},{requires:["dom"]});
KISSY.add("anim/manager",function(d){var c=d.stamp;return{interval:15,runnings:{},timer:null,start:function(b){var d=c(b);this.runnings[d]||(this.runnings[d]=b,this.startTimer())},stop:function(b){this.notRun(b)},notRun:function(b){delete this.runnings[c(b)];d.isEmptyObject(this.runnings)&&this.stopTimer()},pause:function(b){this.notRun(b)},resume:function(b){this.start(b)},startTimer:function(){var b=this;b.timer||(b.timer=setTimeout(function(){b.runFrames()?b.stopTimer():(b.timer=0,b.startTimer())},
b.interval))},stopTimer:function(){var b=this.timer;b&&(clearTimeout(b),this.timer=0)},runFrames:function(){var b=1,c=this.runnings,a;for(a in c)c.hasOwnProperty(a)&&(b=0,c[a]._frame());return b}}});
KISSY.add("anim/queue",function(d,c){function b(b,d,f){var d=d||e,k,m=c.data(b,a);!m&&!f&&c.data(b,a,m={});m&&(k=m[d],!k&&!f&&(k=m[d]=[]));return k}function f(b,g){var g=g||e,f=c.data(b,a);f&&delete f[g];d.isEmptyObject(f)&&c.removeData(b,a)}var a=d.guid("ks-queue-"+d.now()+"-"),e=d.guid("ks-queue-"+d.now()+"-"),m={queueCollectionKey:a,queue:function(a){var c=b(a.elem,a.config.queue);c.push(a);"..."!==c[0]&&m.dequeue(a);return c},remove:function(a){var c=b(a.elem,a.config.queue,1);c&&(a=d.indexOf(a,
c),-1<a&&c.splice(a,1))},removeQueues:function(b){c.removeData(b,a)},removeQueue:f,dequeue:function(a){var c=a.elem,a=a.config.queue,d=b(c,a,1),e=d&&d.shift();"..."==e&&(e=d.shift());e?(d.unshift("..."),e._runInternal()):f(c,a)}};return m},{requires:["dom"]});
