/*
 * Ext Core Library 3.0
 * http://extjs.com/
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * 
 * The MIT License
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * 
 */


(function(){var NULL=null,UNDEFINED=undefined,TRUE=true,FALSE=false,SETX="setX",SETY="setY",SETXY="setXY",LEFT="left",BOTTOM="bottom",TOP="top",RIGHT="right",HEIGHT="height",WIDTH="width",POINTS="points",HIDDEN="hidden",ABSOLUTE="absolute",VISIBLE="visible",MOTION="motion",POSITION="position",EASEOUT="easeOut",flyEl=new Ext.Element.Flyweight(),queues={},getObject=function(o){return o||{};},fly=function(dom){flyEl.dom=dom;flyEl.id=Ext.id(dom);return flyEl;},getQueue=function(id){if(!queues[id]){queues[id]=[];}
return queues[id];},setQueue=function(id,value){queues[id]=value;};Ext.enableFx=TRUE;Ext.Fx={switchStatements:function(key,fn,argHash){return fn.apply(this,argHash[key]);},slideIn:function(anchor,o){o=getObject(o);var me=this,dom=me.dom,st=dom.style,xy,r,b,wrap,after,st,args,pt,bw,bh;anchor=anchor||"t";me.queueFx(o,function(){xy=fly(dom).getXY();fly(dom).fixDisplay();r=fly(dom).getFxRestore();b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight};b.right=b.x+b.width;b.bottom=b.y+b.height;fly(dom).setSize(b.width,b.height);wrap=fly(dom).fxWrap(r.pos,o,HIDDEN);st.visibility=VISIBLE;st.position=ABSOLUTE;function after(){fly(dom).fxUnwrap(wrap,r.pos,o);st.width=r.width;st.height=r.height;fly(dom).afterFx(o);}
pt={to:[b.x,b.y]};bw={to:b.width};bh={to:b.height};function argCalc(wrap,style,ww,wh,sXY,sXYval,s1,s2,w,h,p){var ret={};fly(wrap).setSize(ww,wh);if(fly(wrap)[sXY]){fly(wrap)[sXY](sXYval);}
style[s1]=style[s2]="0";if(w){ret.width=w};if(h){ret.height=h;}
if(p){ret.points=p;}
return ret;};args=fly(dom).switchStatements(anchor.toLowerCase(),argCalc,{t:[wrap,st,b.width,0,NULL,NULL,LEFT,BOTTOM,NULL,bh,NULL],l:[wrap,st,0,b.height,NULL,NULL,RIGHT,TOP,bw,NULL,NULL],r:[wrap,st,b.width,b.height,SETX,b.right,LEFT,TOP,NULL,NULL,pt],b:[wrap,st,b.width,b.height,SETY,b.bottom,LEFT,TOP,NULL,bh,pt],tl:[wrap,st,0,0,NULL,NULL,RIGHT,BOTTOM,bw,bh,pt],bl:[wrap,st,0,0,SETY,b.y+b.height,RIGHT,TOP,bw,bh,pt],br:[wrap,st,0,0,SETXY,[b.right,b.bottom],LEFT,TOP,bw,bh,pt],tr:[wrap,st,0,0,SETX,b.x+b.width,LEFT,BOTTOM,bw,bh,pt]});st.visibility=VISIBLE;fly(wrap).show();arguments.callee.anim=fly(wrap).fxanim(args,o,MOTION,.5,EASEOUT,after);});return me;},slideOut:function(anchor,o){o=getObject(o);var me=this,dom=me.dom,st=dom.style,xy,wrap,r,b,a,zero={to:0};anchor=anchor||"t";me.queueFx(o,function(){xy=fly(dom).getXY();r=fly(dom).getFxRestore();b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight};b.right=b.x+b.width;b.bottom=b.y+b.height;fly(dom).setSize(b.width,b.height);wrap=fly(dom).fxWrap(r.pos,o,VISIBLE);st.visibility=VISIBLE;st.position=ABSOLUTE;fly(wrap).setSize(b.width,b.height);function after(){o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();fly(dom).fxUnwrap(wrap,r.pos,o);st.width=r.width;st.height=r.height;fly(dom).afterFx(o);}
function argCalc(style,s1,s2,p1,v1,p2,v2,p3,v3){var ret={};style[s1]=style[s2]="0";ret[p1]=v1;if(p2){ret[p2]=v2;}
if(p3){ret[p3]=v3;}
return ret;};a=fly(dom).switchStatements(anchor.toLowerCase(),argCalc,{t:[st,LEFT,BOTTOM,HEIGHT,zero],l:[st,RIGHT,TOP,WIDTH,zero],r:[st,LEFT,TOP,WIDTH,zero,POINTS,{to:[b.right,b.y]}],b:[st,LEFT,TOP,HEIGHT,zero,POINTS,{to:[b.x,b.bottom]}],tl:[st,RIGHT,BOTTOM,WIDTH,zero,HEIGHT,zero],bl:[st,RIGHT,TOP,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.x,b.bottom]}],br:[st,LEFT,TOP,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.x+b.width,b.bottom]}],tr:[st,LEFT,BOTTOM,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.right,b.y]}]});arguments.callee.anim=fly(wrap).fxanim(a,o,MOTION,.5,EASEOUT,after);});return me;},puff:function(o){o=getObject(o);var me=this,dom=me.dom,st=dom.style,width,height,r;me.queueFx(o,function(){width=fly(dom).getWidth();height=fly(dom).getHeight();fly(dom).clearOpacity();fly(dom).show();r=fly(dom).getFxRestore();function after(){o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();fly(dom).clearOpacity();fly(dom).setPositioning(r.pos);st.width=r.width;st.height=r.height;st.fontSize='';fly(dom).afterFx(o);}
arguments.callee.anim=fly(dom).fxanim({width:{to:fly(dom).adjustWidth(width*2)},height:{to:fly(dom).adjustHeight(height*2)},points:{by:[-width*.5,-height*.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},o,MOTION,.5,EASEOUT,after);});return me;},switchOff:function(o){o=getObject(o);var me=this,dom=me.dom,st=dom.style,r;me.queueFx(o,function(){fly(dom).clearOpacity();fly(dom).clip();r=fly(dom).getFxRestore();function after(){o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();fly(dom).clearOpacity();fly(dom).setPositioning(r.pos);st.width=r.width;st.height=r.height;fly(dom).afterFx(o);};fly(dom).fxanim({opacity:{to:0.3}},NULL,NULL,.1,NULL,function(){fly(dom).clearOpacity();(function(){fly(dom).fxanim({height:{to:1},points:{by:[0,fly(dom).getHeight()*.5]}},o,MOTION,0.3,'easeIn',after);}).defer(100);});});return me;},highlight:function(color,o){o=getObject(o);var me=this,dom=me.dom,attr=o.attr||"backgroundColor",a={},restore;me.queueFx(o,function(){fly(dom).clearOpacity();fly(dom).show();function after(){dom.style[attr]=restore;fly(dom).afterFx(o);}
restore=dom.style[attr];a[attr]={from:color||"ffff9c",to:o.endColor||fly(dom).getColor(attr)||"ffffff"};arguments.callee.anim=fly(dom).fxanim(a,o,'color',1,'easeIn',after);});return me;},frame:function(color,count,o){o=getObject(o);var me=this,dom=me.dom,proxy,active;me.queueFx(o,function(){color=color||"#C3DAF9"
if(color.length==6){color="#"+color;}
count=count||1;fly(dom).show();var xy=fly(dom).getXY(),b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight},queue=function(){proxy=fly(document.body||document.documentElement).createChild({style:{visbility:HIDDEN,position:ABSOLUTE,"z-index":35000,border:"0px solid "+color}});return proxy.queueFx({},animFn);};arguments.callee.anim={isAnimated:true,stop:function(){count=0;proxy.stopFx();}};function animFn(){var scale=Ext.isBorderBox?2:1;active=proxy.anim({top:{from:b.y,to:b.y-20},left:{from:b.x,to:b.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:b.height,to:b.height+20*scale},width:{from:b.width,to:b.width+20*scale}},{duration:o.duration||1,callback:function(){proxy.remove();--count>0?queue():fly(dom).afterFx(o);}});arguments.callee.anim={isAnimated:true,stop:function(){active.stop();}};};queue();});return me;},pause:function(seconds){var dom=this.dom,t;this.queueFx({},function(){t=setTimeout(function(){fly(dom).afterFx({});},seconds*1000);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(t);fly(dom).afterFx({});}};});return this;},fadeIn:function(o){o=getObject(o);var me=this,dom=me.dom,to=o.endOpacity||1;me.queueFx(o,function(){fly(dom).setOpacity(0);fly(dom).fixDisplay();dom.style.visibility=VISIBLE;arguments.callee.anim=fly(dom).fxanim({opacity:{to:to}},o,NULL,.5,EASEOUT,function(){if(to==1){fly(dom).clearOpacity();}
fly(dom).afterFx(o);});});return me;},fadeOut:function(o){o=getObject(o);var me=this,dom=me.dom,style=dom.style,to=o.endOpacity||0;me.queueFx(o,function(){arguments.callee.anim=fly(dom).fxanim({opacity:{to:to}},o,NULL,.5,EASEOUT,function(){if(to==0){fly(dom).visibilityMode==Ext.Element.DISPLAY||o.useDisplay?style.display="none":style.visibility=HIDDEN;fly(dom).clearOpacity();}
fly(dom).afterFx(o);});});return me;},scale:function(w,h,o){this.shift(Ext.apply({},o,{width:w,height:h}));return this;},shift:function(o){o=getObject(o);var dom=this.dom,a={};this.queueFx(o,function(){for(var prop in o){if(o[prop]!=UNDEFINED){a[prop]={to:o[prop]};}}
a.width?a.width.to=fly(dom).adjustWidth(o.width):a;a.height?a.height.to=fly(dom).adjustWidth(o.height):a;if(a.x||a.y||a.xy){a.points=a.xy||{to:[a.x?a.x.to:fly(dom).getX(),a.y?a.y.to:fly(dom).getY()]};}
arguments.callee.anim=fly(dom).fxanim(a,o,MOTION,.35,EASEOUT,function(){fly(dom).afterFx(o);});});return this;},ghost:function(anchor,o){o=getObject(o);var me=this,dom=me.dom,st=dom.style,a={opacity:{to:0},points:{}},pt=a.points,r,w,h;anchor=anchor||"b";me.queueFx(o,function(){r=fly(dom).getFxRestore();w=fly(dom).getWidth();h=fly(dom).getHeight();function after(){o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();fly(dom).clearOpacity();fly(dom).setPositioning(r.pos);st.width=r.width;st.height=r.height;fly(dom).afterFx(o);}
pt.by=fly(dom).switchStatements(anchor.toLowerCase(),function(v1,v2){return[v1,v2];},{t:[0,-h],l:[-w,0],r:[w,0],b:[0,h],tl:[-w,-h],bl:[-w,h],br:[w,h],tr:[w,-h]});arguments.callee.anim=fly(dom).fxanim(a,o,MOTION,.5,EASEOUT,after);});return me;},syncFx:function(){var me=this;me.fxDefaults=Ext.apply(me.fxDefaults||{},{block:FALSE,concurrent:TRUE,stopFx:FALSE});return me;},sequenceFx:function(){var me=this;me.fxDefaults=Ext.apply(me.fxDefaults||{},{block:FALSE,concurrent:FALSE,stopFx:FALSE});return me;},nextFx:function(){var ef=getQueue(this.dom.id)[0];if(ef){ef.call(this);}},hasActiveFx:function(){return getQueue(this.dom.id)[0];},stopFx:function(finish){var me=this,id=me.dom.id;if(me.hasActiveFx()){var cur=getQueue(id)[0];if(cur&&cur.anim){if(cur.anim.isAnimated){setQueue(id,[cur]);cur.anim.stop(finish!==undefined?finish:TRUE);}else{setQueue(id,[]);}}}
return me;},beforeFx:function(o){if(this.hasActiveFx()&&!o.concurrent){if(o.stopFx){this.stopFx();return TRUE;}
return FALSE;}
return TRUE;},hasFxBlock:function(){var q=getQueue(this.dom.id);return q&&q[0]&&q[0].block;},queueFx:function(o,fn){var me=this;if(!me.hasFxBlock()){Ext.applyIf(o,me.fxDefaults);if(!o.concurrent){var run=me.beforeFx(o);fn.block=o.block;getQueue(me.dom.id).push(fn);if(run){me.nextFx();}}else{fn.call(me);}}
return me;},fxWrap:function(pos,o,vis){var dom=this.dom,wrap,wrapXY;if(!o.wrap||!(wrap=Ext.getDom(o.wrap))){if(o.fixPosition){wrapXY=fly(dom).getXY();}
var div=document.createElement("div");div.style.visibility=vis;wrap=dom.parentNode.insertBefore(div,dom);fly(wrap).setPositioning(pos);if(fly(wrap).isStyle(POSITION,"static")){fly(wrap).position("relative");}
fly(dom).clearPositioning('auto');fly(wrap).clip();wrap.appendChild(dom);if(wrapXY){fly(wrap).setXY(wrapXY);}}
return wrap;},fxUnwrap:function(wrap,pos,o){var dom=this.dom;fly(dom).clearPositioning();fly(dom).setPositioning(pos);if(!o.wrap){wrap.parentNode.insertBefore(dom,wrap);fly(wrap).remove();}},getFxRestore:function(){var st=this.dom.style;return{pos:this.getPositioning(),width:st.width,height:st.height};},afterFx:function(o){var dom=this.dom,id=dom.id;if(o.afterStyle){fly(dom).setStyle(o.afterStyle);}
if(o.afterCls){fly(dom).addClass(o.afterCls);}
if(o.remove==TRUE){fly(dom).remove();}
if(o.callback){o.callback.call(o.scope,fly(dom));}
if(!o.concurrent){getQueue(id).shift();fly(dom).nextFx();}},fxanim:function(args,opt,animType,defaultDur,defaultEase,cb){animType=animType||'run';opt=opt||{};var anim=Ext.lib.Anim[animType](this.dom,args,(opt.duration||defaultDur)||.35,(opt.easing||defaultEase)||EASEOUT,cb,this);opt.anim=anim;return anim;}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx);})();