/*
 * Globimages Weather Components
 * Copyright(c) 2007, JC Bordes.
 * 
 */


if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_6,_7,_8){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_6,_7,_8);}else{return false;}};YAHOO.extend=function(_a,_b,_c){var F=function(){};F.prototype=_b.prototype;_a.prototype=new F();_a.prototype.constructor=_a;_a.superclass=_b.prototype;if(_b.prototype.constructor==Object.prototype.constructor){_b.prototype.constructor=_b;}if(_c){for(var i in _c){_a.prototype[i]=_c[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");(function(){var Y=YAHOO.util,_2,_3,_4=0,_5={};var ua=navigator.userAgent.toLowerCase(),_7=(ua.indexOf("opera")>-1),_8=(ua.indexOf("safari")>-1),_9=(!_7&&!_8&&ua.indexOf("gecko")>-1),_a=(!_7&&ua.indexOf("msie")>-1);var _b={HYPHEN:/(-[a-z])/i};var _c=function(_d){if(!_b.HYPHEN.test(_d)){return _d;}if(_5[_d]){return _5[_d];}while(_b.HYPHEN.exec(_d)){_d=_d.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}_5[_d]=_d;return _d;};if(document.defaultView&&document.defaultView.getComputedStyle){_2=function(el,_f){var _10=null;var _11=document.defaultView.getComputedStyle(el,"");if(_11){_10=_11[_c(_f)];}return el.style[_f]||_10;};}else{if(document.documentElement.currentStyle&&_a){_2=function(el,_13){switch(_c(_13)){case"opacity":var val=100;try{val=el.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(e){try{val=el.filters("alpha").opacity;}catch(e){}}return val/100;break;default:var _15=el.currentStyle?el.currentStyle[_13]:null;return(el.style[_13]||_15);}};}else{_2=function(el,_17){return el.style[_17];};}}if(_a){_3=function(el,_19,val){switch(_19){case"opacity":if(typeof el.style.filter=="string"){el.style.filter="alpha(opacity="+val*100+")";if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[_19]=val;}};}else{_3=function(el,_1c,val){el.style[_1c]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!="string"&&!(el instanceof Array)){return el;}if(typeof el=="string"){return document.getElementById(el);}else{var _1f=[];for(var i=0,len=el.length;i<len;++i){_1f[_1f.length]=Y.Dom.get(el[i]);}return _1f;}return null;},getStyle:function(el,_23){_23=_c(_23);var f=function(_25){return _2(_25,_23);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,_27,val){_27=_c(_27);var f=function(_2a){_3(_2a,_27,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,"display")=="none"){return false;}var _2e=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var _32=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var _33=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+_33,box.top+_32];}else{pos=[el.offsetLeft,el.offsetTop];_2e=el.offsetParent;var _34=false;if(_2e!=el){while(_2e){pos[0]+=_2e.offsetLeft;pos[1]+=_2e.offsetTop;if(_8&&!_34&&this.getStyle(_2e,"position")=="absolute"){_34=true;}_2e=_2e.offsetParent;}}if(_8&&(_34||this.getStyle(el,"position")=="absolute")){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){_2e=el.parentNode;}else{_2e=null;}while(_2e&&_2e.tagName.toUpperCase()!="BODY"&&_2e.tagName.toUpperCase()!="HTML"){if(Y.Dom.getStyle(_2e,"display")!="inline"){pos[0]-=_2e.scrollLeft;pos[1]-=_2e.scrollTop;}if(_2e.parentNode){_2e=_2e.parentNode;}else{_2e=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,_3d){var f=function(el){var _40=this.getStyle(el,"position");if(_40=="static"){this.setStyle(el,"position","relative");_40="relative";}var _41=this.getXY(el);if(_41===false){return false;}var _42=[parseInt(this.getStyle(el,"left"),10),parseInt(this.getStyle(el,"top"),10)];if(isNaN(_42[0])){_42[0]=(_40=="relative")?0:el.offsetLeft;}if(isNaN(_42[1])){_42[1]=(_40=="relative")?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-_41[0]+_42[0]+"px";}if(pos[1]!==null){el.style.top=pos[1]-_41[1]+_42[1]+"px";}var _43=this.getXY(el);if(!_3d&&(_43[0]!=pos[0]||_43[1]!=pos[1])){this.setXY(el,pos,true);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var _4b=new Y.Region.getRegion(el);return _4b;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(_4c,tag,_4e){var _4f=function(el){return Y.Dom.hasClass(el,_4c);};return Y.Dom.getElementsBy(_4f,tag,_4e);},hasClass:function(el,_52){var re=new RegExp("(?:^|\\s+)"+_52+"(?:\\s+|$)");var f=function(el){return re.test(el["className"]);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,_57){var f=function(el){if(this.hasClass(el,_57)){return;}el["className"]=[el["className"],_57].join(" ");};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,_5b){var re=new RegExp("(?:^|\\s+)"+_5b+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_5b)){return;}var c=el["className"];el["className"]=c.replace(re," ");if(this.hasClass(el,_5b)){this.removeClass(el,_5b);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,_61,_62){if(_61===_62){return false;}var re=new RegExp("(?:^|\\s+)"+_61+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_61)){this.addClass(el,_62);return;}el["className"]=el["className"].replace(re," "+_62+" ");if(this.hasClass(el,_61)){this.replaceClass(el,_61,_62);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,_67){_67=_67||"yui-gen";el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=_67+_4++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(_6a,_6b){_6a=Y.Dom.get(_6a);if(!_6a||!_6b){return false;}var f=function(_6d){if(_6a.contains&&!_8){return _6a.contains(_6d);}else{if(_6a.compareDocumentPosition){return!!(_6a.compareDocumentPosition(_6d)&16);}else{var _6e=_6d.parentNode;while(_6e){if(_6e==_6a){return true;}else{if(!_6e.tagName||_6e.tagName.toUpperCase()=="HTML"){return false;}}_6e=_6e.parentNode;}return false;}}};return Y.Dom.batch(_6b,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(_72,tag,_74){tag=tag||"*";_74=Y.Dom.get(_74)||document;var _75=[];var _76=_74.getElementsByTagName(tag);if(!_76.length&&(tag=="*"&&_74.all)){_76=_74.all;}for(var i=0,len=_76.length;i<len;++i){if(_72(_76[i])){_75[_75.length]=_76[i];}}return _75;},batch:function(el,_7a,o,_7c){var id=el;el=Y.Dom.get(el);var _7e=(_7c)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return _7a.call(_7e,el,o);}var _7f=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}_7f[_7f.length]=_7a.call(_7e,el[i],o);}return _7f;},getDocumentHeight:function(){var _82=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(_82,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var _84=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(_84,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var _86=self.innerHeight;var _87=document.compatMode;if((_87||_a)&&!_7){_86=(_87=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return _86;},getViewportWidth:function(){var _88=self.innerWidth;var _89=document.compatMode;if(_89||_a){_88=(_89=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return _88;}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(_8e){return(_8e.left>=this.left&&_8e.right<=this.right&&_8e.top>=this.top&&_8e.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(_8f){var t=Math.max(this.top,_8f.top);var r=Math.min(this.right,_8f.right);var b=Math.min(this.bottom,_8f.bottom);var l=Math.max(this.left,_8f.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(_94){var t=Math.min(this.top,_94.top);var r=Math.max(this.right,_94.right);var b=Math.max(this.bottom,_94.bottom);var l=Math.min(this.left,_94.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_a){var _b=false;for(var i=0,_d=this.subscribers.length;i<_d;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_a)){this._delete(i);_b=true;}}return _b;},fire:function(){var _f=this.subscribers.length;if(!_f&&this.silent){return true;}var _10=[],ret=true,i;for(i=0;i<arguments.length;++i){_10.push(arguments[i]);}var _13=_10.length;if(!this.silent){}for(i=0;i<_f;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _15=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _16=null;if(_10.length>0){_16=_10[0];}ret=s.fn.call(_15,_16,s.obj);}else{ret=s.fn.call(_15,this.type,_10,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_19){var s=this.subscribers[_19];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_19,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_1d){this.fn=fn;this.obj=obj||null;this.override=_1d;};YAHOO.util.Subscriber.prototype.getScope=function(_1e){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _1e;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _21=false;var _22=[];var _23=[];var _24=[];var _25=[];var _26=0;var _27=[];var _28=[];var _29=0;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var _2a=this;var _2b=function(){_2a._tryPreloadAttach();};this._interval=setInterval(_2b,this.POLL_INTERVAL);}},onAvailable:function(_2c,_2d,_2e,_2f){_27.push({id:_2c,fn:_2d,obj:_2e,override:_2f,checkReady:false});_26=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_30,_31,_32,_33){_27.push({id:_30,fn:_31,obj:_32,override:_33,checkReady:true});_26=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_35,fn,obj,_38){if(!fn||!fn.call){return false;}if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],_35,fn,obj,_38)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_35,fn,obj,_38);});return true;}}}if(!el){return false;}if("unload"==_35&&obj!==this){_23[_23.length]=[el,_35,fn,obj,_38];return true;}var _3d=el;if(_38){if(_38===true){_3d=obj;}else{_3d=_38;}}var _3e=function(e){return fn.call(_3d,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_35,fn,_3e,_3d];var _41=_22.length;_22[_41]=li;if(this.useLegacyEvent(el,_35)){var _42=this.getLegacyIndex(el,_35);if(_42==-1||el!=_24[_42][0]){_42=_24.length;_28[el.id+_35]=_42;_24[_42]=[el,_35,el["on"+_35]];_25[_42]=[];el["on"+_35]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_42);};}_25[_42].push(li);}else{this._simpleAdd(el,_35,_3e,false);}return true;},fireLegacyEvent:function(e,_45){var ok=true;var le=_25[_45];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _4b=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_4b,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_4e){var key=this.generateId(el)+_4e;if(typeof _28[key]=="undefined"){return-1;}else{return _28[key];}},useLegacyEvent:function(el,_51){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_51||"dblclick"==_51){return true;}}}return false;},removeListener:function(el,_53,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_53,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_53);}if("unload"==_53){for(i=0,len=_23.length;i<len;i++){var li=_23[i];if(li&&li[0]==el&&li[1]==_53&&li[2]==fn){_23.splice(i,1);return true;}}return false;}var _59=null;var _5a=arguments[3];if("undefined"==typeof _5a){_5a=this._getCacheIndex(el,_53,fn);}if(_5a>=0){_59=_22[_5a];}if(!el||!_59){return false;}if(this.useLegacyEvent(el,_53)){var _5b=this.getLegacyIndex(el,_53);var _5c=_25[_5b];if(_5c){for(i=0,len=_5c.length;i<len;++i){li=_5c[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_53&&li[this.FN]==fn){_5c.splice(i,1);break;}}}}else{this._simpleRemove(el,_53,_59[this.WFN],false);}delete _22[_5a][this.WFN];delete _22[_5a][this.FN];_22.splice(_5a,1);return true;},getTarget:function(ev,_5e){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_60){if(_60&&3==_60.nodeType){return _60.parentNode;}else{return _60;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,_72,fn){for(var i=0,len=_22.length;i<len;++i){var li=_22[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_72){return i;}}return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_29;++_29;el.id=id;}return id;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){_21=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _7d=!_21;if(!_7d){_7d=(_26>0);}var _7e=[];for(var i=0,len=_27.length;i<len;++i){var _81=_27[i];if(_81){var el=this.getEl(_81.id);if(el){if(!_81.checkReady||_21||el.nextSibling||(document&&document.body)){var _83=el;if(_81.override){if(_81.override===true){_83=_81.obj;}else{_83=_81.override;}}_81.fn.call(_83,_81.obj);delete _27[i];}}else{_7e.push(_81);}}}_26=(_7e.length===0)?0:_26-1;if(_7d){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_85,_86){var _87=this.getListeners(el,_86);if(_87){for(var i=0,len=_87.length;i<len;++i){var l=_87[i];this.removeListener(el,l.type,l.fn);}}if(_85&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_85,_86);}}},getListeners:function(el,_8c){var _8d=[];if(_22&&_22.length>0){for(var i=0,len=_22.length;i<len;++i){var l=_22[i];if(l&&l[this.EL]===el&&(!_8c||_8c===l[this.TYPE])){_8d.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return(_8d.length)?_8d:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,_97;for(i=0,len=_23.length;i<len;++i){l=_23[i];if(l){var _98=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_98=l[EU.OBJ];}else{_98=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_98,EU.getEvent(e),l[EU.OBJ]);delete _23[i];l=null;_98=null;}}if(_22&&_22.length>0){j=_22.length;while(j){_97=j-1;l=_22[_97];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],_97);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_24.length;i<len;++i){delete _24[i][0];delete _24[i];}EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else{if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_9c,fn,_9e){el.addEventListener(_9c,fn,(_9e));};}else{if(window.attachEvent){return function(el,_a0,fn,_a2){el.attachEvent("on"+_a0,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_a4,fn,_a6){el.removeEventListener(_a4,fn,(_a6));};}else{if(window.detachEvent){return function(el,_a8,fn){el.detachEvent("on"+_a8,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(_ab,_ac,_ad,_ae){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_ab];if(ce){ce.subscribe(_ac,_ad,_ae);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _b0=this.__yui_subscribers;if(!_b0[_ab]){_b0[_ab]=[];}_b0[_ab].push({fn:_ac,obj:_ad,override:_ae});}},unsubscribe:function(_b1,_b2,_b3){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_b1];if(ce){return ce.unsubscribe(_b2,_b3);}else{return false;}},createEvent:function(_b5,_b6){this.__yui_events=this.__yui_events||{};var _b7=_b6||{};var _b8=this.__yui_events;if(_b8[_b5]){}else{var _b9=_b7.scope||this;var _ba=_b7.silent||null;var ce=new YAHOO.util.CustomEvent(_b5,_b9,_ba,YAHOO.util.CustomEvent.FLAT);_b8[_b5]=ce;if(_b7.onSubscribeCallback){ce.subscribeEvent.subscribe(_b7.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_b5];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _b8[_b5];},fireEvent:function(_be,_bf,_c0,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_be];if(ce){var _c3=[];for(var i=1;i<arguments.length;++i){_c3.push(arguments[i]);}return ce.fire.apply(ce,_c3);}else{return null;}},hasEvent:function(_c5){if(this.__yui_events){if(this.__yui_events[_c5]){return true;}}return false;}};YAHOO.util.Connect={_msxml_progid:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded",_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id){this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b){this._use_default_post_header=b;},setPollingInterval:function(i){if(typeof i=="number"&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(_4){var _5,_6;try{_6=new XMLHttpRequest();_5={conn:_6,tId:_4};}catch(e){for(var i=0;i<this._msxml_progid.length;++i){try{_6=new ActiveXObject(this._msxml_progid[i]);_5={conn:_6,tId:_4};break;}catch(e){}}}finally{return _5;}},getConnectionObject:function(){var o;var _9=this._transaction_id;try{o=this.createXhrObject(_9);if(o){this._transaction_id++;}}catch(e){}finally{return o;}},asyncRequest:function(_a,_b,_c,_d){var o=this.getConnectionObject();if(!o){return null;}else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,_c,_b,_d);this.releaseObject(o);return;}if(_a=="GET"){if(this._sFormData.length!=0){_b+=((_b.indexOf("?")==-1)?"?":"&")+this._sFormData;}else{_b+="?"+this._sFormData;}}else{if(_a=="POST"){_d=_d?this._sFormData+"&"+_d:this._sFormData;}}}o.conn.open(_a,_b,true);if(this._isFormSubmit||(_d&&this._use_default_post_header)){this.initHeader("Content-Type",this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}if(this._has_http_headers){this.setHeader(o);}this.handleReadyState(o,_c);o.conn.send(_d||null);return o;}},handleReadyState:function(o,_10){var _11=this;if(_10&&_10.timeout){this._timeOut[o.tId]=window.setTimeout(function(){_11.abort(o,_10,true);},_10.timeout);}this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(_11._poll[o.tId]);delete _11._poll[o.tId];if(_10&&_10.timeout){delete _11._timeOut[o.tId];}_11.handleTransactionResponse(o,_10);}},this._polling_interval);},handleTransactionResponse:function(o,_13,_14){if(!_13){this.releaseObject(o);return;}var _15,_16;try{if(o.conn.status!==undefined&&o.conn.status!=0){_15=o.conn.status;}else{_15=13030;}}catch(e){_15=13030;}if(_15>=200&&_15<300){_16=this.createResponseObject(o,_13.argument);if(_13.success){if(!_13.scope){_13.success(_16);}else{_13.success.apply(_13.scope,[_16]);}}}else{try{switch(_15){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:_16=this.createExceptionObject(o.tId,_13.argument,(_14?_14:false));if(_13.failure){if(!_13.scope){_13.failure(_16);}else{_13.failure.apply(_13.scope,[_16]);}}break;default:_16=this.createResponseObject(o,_13.argument);if(_13.failure){if(!_13.scope){_13.failure(_16);}else{_13.failure.apply(_13.scope,[_16]);}}}}catch(e){}}this.releaseObject(o);_16=null;},createResponseObject:function(o,_18){var obj={};var _1a={};try{var _1b=o.conn.getAllResponseHeaders();var _1c=_1b.split("\n");for(var i=0;i<_1c.length;i++){var _1e=_1c[i].indexOf(":");if(_1e!=-1){_1a[_1c[i].substring(0,_1e)]=_1c[i].substring(_1e+2);}}}catch(e){}obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=_1a;obj.getAllResponseHeaders=_1b;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof _18!==undefined){obj.argument=_18;}return obj;},createExceptionObject:function(tId,_20,_21){var _22=0;var _23="communication failure";var _24=-1;var _25="transaction aborted";var obj={};obj.tId=tId;if(_21){obj.status=_24;obj.statusText=_25;}else{obj.status=_22;obj.statusText=_23;}if(_20){obj.argument=_20;}return obj;},initHeader:function(lb,_28){if(this._http_header[lb]===undefined){this._http_header[lb]=_28;}else{this._http_header[lb]=_28+","+this._http_header[lb];}this._has_http_headers=true;},setHeader:function(o){for(var _2a in this._http_header){if(this._http_header.hasOwnProperty(_2a)){o.conn.setRequestHeader(_2a,this._http_header[_2a]);}}delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(_2b,_2c,_2d){this.resetFormState();var _2e;if(typeof _2b=="string"){_2e=(document.getElementById(_2b)||document.forms[_2b]);}else{if(typeof _2b=="object"){_2e=_2b;}else{return;}}if(_2c){this.createFrame(_2d?_2d:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=_2e;return;}var _2f,_30,_31,_32;var _33=false;for(var i=0;i<_2e.elements.length;i++){_2f=_2e.elements[i];_32=_2e.elements[i].disabled;_30=_2e.elements[i].name;_31=_2e.elements[i].value;if(!_32&&_30){switch(_2f.type){case"select-one":case"select-multiple":for(var j=0;j<_2f.options.length;j++){if(_2f.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(_30)+"="+encodeURIComponent(_2f.options[j].attributes["value"].specified?_2f.options[j].value:_2f.options[j].text)+"&";}else{this._sFormData+=encodeURIComponent(_30)+"="+encodeURIComponent(_2f.options[j].hasAttribute("value")?_2f.options[j].value:_2f.options[j].text)+"&";}}}break;case"radio":case"checkbox":if(_2f.checked){this._sFormData+=encodeURIComponent(_30)+"="+encodeURIComponent(_31)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(_33==false){this._sFormData+=encodeURIComponent(_30)+"="+encodeURIComponent(_31)+"&";_33=true;}break;default:this._sFormData+=encodeURIComponent(_30)+"="+encodeURIComponent(_31)+"&";break;}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(_36){var _37="yuiIO"+this._transaction_id;if(window.ActiveXObject){var io=document.createElement("<iframe id=\""+_37+"\" name=\""+_37+"\" />");if(typeof _36=="boolean"){io.src="javascript:false";}else{if(typeof secureURI=="string"){io.src=_36;}}}else{var io=document.createElement("iframe");io.id=_37;io.name=_37;}io.style.position="absolute";io.style.top="-1000px";io.style.left="-1000px";document.body.appendChild(io);},appendPostData:function(_39){var _3a=new Array();var _3b=_39.split("&");for(var i=0;i<_3b.length;i++){var _3d=_3b[i].indexOf("=");if(_3d!=-1){_3a[i]=document.createElement("input");_3a[i].type="hidden";_3a[i].name=_3b[i].substring(0,_3d);_3a[i].value=_3b[i].substring(_3d+1);this._formNode.appendChild(_3a[i]);}}return _3a;},uploadFile:function(id,_3f,uri,_41){var _42="yuiIO"+id;var io=document.getElementById(_42);this._formNode.action=uri;this._formNode.method="POST";this._formNode.target=_42;if(this._formNode.encoding){this._formNode.encoding="multipart/form-data";}else{this._formNode.enctype="multipart/form-data";}if(_41){var _44=this.appendPostData(_41);}this._formNode.submit();if(_44&&_44.length>0){try{for(var i=0;i<_44.length;i++){this._formNode.removeChild(_44[i]);}}catch(e){}}this.resetFormState();var _46=function(){var obj={};obj.tId=id;obj.argument=_3f.argument;try{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}catch(e){}if(_3f.upload){if(!_3f.scope){_3f.upload(obj);}else{_3f.upload.apply(_3f.scope,[obj]);}}if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",_46);}else{if(window.detachEvent){io.detachEvent("onload",_46);}else{io.removeEventListener("load",_46,false);}}setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",_46);}else{if(window.attachEvent){io.attachEvent("onload",_46);}else{io.addEventListener("load",_46,false);}}},abort:function(o,_49,_4a){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(_4a){delete this._timeOut[o.tId];}this.handleTransactionResponse(o,_49,true);return true;}else{return false;}},isCallInProgress:function(o){if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}else{return false;}},releaseObject:function(o){o.conn=null;o=null;}};YAHOO.util.Anim=function(el,_2,_3,_4){if(el){this.init(el,_2,_3,_4);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(_7,_8,_9){return this.method(this.currentFrame,_8,_9-_8,this.totalFrames);},setAttribute:function(_a,_b,_c){if(this.patterns.noNegatives.test(_a)){_b=(_b>0)?_b:0;}YAHOO.util.Dom.setStyle(this.getEl(),_a,_b+_c);},getAttribute:function(_d){var el=this.getEl();var _f=YAHOO.util.Dom.getStyle(el,_d);if(_f!=="auto"&&!this.patterns.offsetUnit.test(_f)){return parseFloat(_f);}var a=this.patterns.offsetAttribute.exec(_d)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,"position")=="absolute"&&pos)){_f=el["offset"+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{_f=0;}return _f;},getDefaultUnit:function(_13){if(this.patterns.defaultUnit.test(_13)){return"px";}return"";},setRuntimeAttribute:function(_14){var _15;var end;var _17=this.attributes;this.runtimeAttributes[_14]={};var _18=function(_19){return(typeof _19!=="undefined");};if(!_18(_17[_14]["to"])&&!_18(_17[_14]["by"])){return false;}_15=(_18(_17[_14]["from"]))?_17[_14]["from"]:this.getAttribute(_14);if(_18(_17[_14]["to"])){end=_17[_14]["to"];}else{if(_18(_17[_14]["by"])){if(_15.constructor==Array){end=[];for(var i=0,len=_15.length;i<len;++i){end[i]=_15[i]+_17[_14]["by"][i];}}else{end=_15+_17[_14]["by"];}}}this.runtimeAttributes[_14].start=_15;this.runtimeAttributes[_14].end=end;this.runtimeAttributes[_14].unit=(_18(_17[_14].unit))?_17[_14]["unit"]:this.getDefaultUnit(_14);},init:function(el,_1d,_1e,_1f){var _20=false;var _21=null;var _22=0;el=YAHOO.util.Dom.get(el);this.attributes=_1d||{};this.duration=_1e||1;this.method=_1f||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return _20;};this.getStartTime=function(){return _21;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(_23){if(_23){this.currentFrame=this.totalFrames;this._onTween.fire();}YAHOO.util.AnimMgr.stop(this);};var _24=function(){this.onStart.fire();this.runtimeAttributes={};for(var _25 in this.attributes){this.setRuntimeAttribute(_25);}_20=true;_22=0;_21=new Date();};var _26=function(){var _27={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};_27.toString=function(){return("duration: "+_27.duration+", currentFrame: "+_27.currentFrame);};this.onTween.fire(_27);var _28=this.runtimeAttributes;for(var _29 in _28){this.setAttribute(_29,this.doMethod(_29,_28[_29].start,_28[_29].end),_28[_29].unit);}_22+=1;};var _2a=function(){var _2b=(new Date()-_21)/1000;var _2c={duration:_2b,frames:_22,fps:_22/_2b};_2c.toString=function(){return("duration: "+_2c.duration+", frames: "+_2c.frames+", fps: "+_2c.fps);};_20=false;_22=0;this.onComplete.fire(_2c);};this._onStart=new YAHOO.util.CustomEvent("_start",this,true);this.onStart=new YAHOO.util.CustomEvent("start",this);this.onTween=new YAHOO.util.CustomEvent("tween",this);this._onTween=new YAHOO.util.CustomEvent("_tween",this,true);this.onComplete=new YAHOO.util.CustomEvent("complete",this);this._onComplete=new YAHOO.util.CustomEvent("_complete",this,true);this._onStart.subscribe(_24);this._onTween.subscribe(_26);this._onComplete.subscribe(_2a);}};YAHOO.util.AnimMgr=new function(){var _2d=null;var _2e=[];var _2f=0;this.fps=1000;this.delay=1;this.registerElement=function(_30){_2e[_2e.length]=_30;_2f+=1;_30._onStart.fire();this.start();};this.unRegister=function(_31,_32){_31._onComplete.fire();_32=_32||_33(_31);if(_32!=-1){_2e.splice(_32,1);}_2f-=1;if(_2f<=0){this.stop();}};this.start=function(){if(_2d===null){_2d=setInterval(this.run,this.delay);}};this.stop=function(_34){if(!_34){clearInterval(_2d);for(var i=0,len=_2e.length;i<len;++i){if(_2e[i].isAnimated()){this.unRegister(_34,i);}}_2e=[];_2d=null;_2f=0;}else{this.unRegister(_34);}};this.run=function(){for(var i=0,len=_2e.length;i<len;++i){var _39=_2e[i];if(!_39||!_39.isAnimated()){continue;}if(_39.currentFrame<_39.totalFrames||_39.totalFrames===null){_39.currentFrame+=1;if(_39.useSeconds){_3a(_39);}_39._onTween.fire();}else{YAHOO.util.AnimMgr.stop(_39,i);}}};var _33=function(_3b){for(var i=0,len=_2e.length;i<len;++i){if(_2e[i]==_3b){return i;}}return-1;};var _3a=function(_3e){var _3f=_3e.totalFrames;var _40=_3e.currentFrame;var _41=(_3e.currentFrame*_3e.duration*1000/_3e.totalFrames);var _42=(new Date()-_3e.getStartTime());var _43=0;if(_42<_3e.duration*1000){_43=Math.round((_42/_41-1)*_3e.currentFrame);}else{_43=_3f-(_40+1);}if(_43>0&&isFinite(_43)){if(_3e.currentFrame+_43>=_3f){_43=_3f-(_40+1);}_3e.currentFrame+=_43;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(_44,t){var n=_44.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[_44[i][0],_44[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,_4b,_4c,_4d){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,_4b,_4c,_4d);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var _4f=Y.ColorAnim.superclass;var _50=Y.ColorAnim.prototype;_50.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};_50.patterns.color=/color$/i;_50.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;_50.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;_50.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;_50.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;_50.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};_50.getAttribute=function(_55){var el=this.getEl();if(this.patterns.color.test(_55)){var val=YAHOO.util.Dom.getStyle(el,_55);if(this.patterns.transparent.test(val)){var _58=el.parentNode;val=Y.Dom.getStyle(_58,_55);while(_58&&this.patterns.transparent.test(val)){_58=_58.parentNode;val=Y.Dom.getStyle(_58,_55);if(_58.tagName.toUpperCase()=="HTML"){val="#fff";}}}}else{val=_4f.getAttribute.call(this,_55);}return val;};_50.doMethod=function(_59,_5a,end){var val;if(this.patterns.color.test(_59)){val=[];for(var i=0,len=_5a.length;i<len;++i){val[i]=_4f.doMethod.call(this,_59,_5a[i],end[i]);}val="rgb("+Math.floor(val[0])+","+Math.floor(val[1])+","+Math.floor(val[2])+")";}else{val=_4f.doMethod.call(this,_59,_5a,end);}return val;};_50.setRuntimeAttribute=function(_5f){_4f.setRuntimeAttribute.call(this,_5f);if(this.patterns.color.test(_5f)){var _60=this.attributes;var _61=this.parseColor(this.runtimeAttributes[_5f].start);var end=this.parseColor(this.runtimeAttributes[_5f].end);if(typeof _60[_5f]["to"]==="undefined"&&typeof _60[_5f]["by"]!=="undefined"){end=this.parseColor(_60[_5f].by);for(var i=0,len=_61.length;i<len;++i){end[i]=_61[i]+end[i];}}this.runtimeAttributes[_5f].start=_61;this.runtimeAttributes[_5f].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return-0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}}}},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*0.5+b;}return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*0.5+c*0.5+b;}};(function(){YAHOO.util.Motion=function(el,_b2,_b3,_b4){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,_b2,_b3,_b4);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var _b6=Y.Motion.superclass;var _b7=Y.Motion.prototype;_b7.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};_b7.patterns.points=/^points$/i;_b7.setAttribute=function(_ba,val,_bc){if(this.patterns.points.test(_ba)){_bc=_bc||"px";_b6.setAttribute.call(this,"left",val[0],_bc);_b6.setAttribute.call(this,"top",val[1],_bc);}else{_b6.setAttribute.call(this,_ba,val,_bc);}};_b7.getAttribute=function(_bd){if(this.patterns.points.test(_bd)){var val=[_b6.getAttribute.call(this,"left"),_b6.getAttribute.call(this,"top")];}else{val=_b6.getAttribute.call(this,_bd);}return val;};_b7.doMethod=function(_bf,_c0,end){var val=null;if(this.patterns.points.test(_bf)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[_bf],t);}else{val=_b6.doMethod.call(this,_bf,_c0,end);}return val;};_b7.setRuntimeAttribute=function(_c4){if(this.patterns.points.test(_c4)){var el=this.getEl();var _c6=this.attributes;var _c7;var _c8=_c6["points"]["control"]||[];var end;var i,len;if(_c8.length>0&&!(_c8[0]instanceof Array)){_c8=[_c8];}else{var tmp=[];for(i=0,len=_c8.length;i<len;++i){tmp[i]=_c8[i];}_c8=tmp;}if(Y.Dom.getStyle(el,"position")=="static"){Y.Dom.setStyle(el,"position","relative");}if(_cd(_c6["points"]["from"])){Y.Dom.setXY(el,_c6["points"]["from"]);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}_c7=this.getAttribute("points");if(_cd(_c6["points"]["to"])){end=_ce.call(this,_c6["points"]["to"],_c7);var _cf=Y.Dom.getXY(this.getEl());for(i=0,len=_c8.length;i<len;++i){_c8[i]=_ce.call(this,_c8[i],_c7);}}else{if(_cd(_c6["points"]["by"])){end=[_c7[0]+_c6["points"]["by"][0],_c7[1]+_c6["points"]["by"][1]];for(i=0,len=_c8.length;i<len;++i){_c8[i]=[_c7[0]+_c8[i][0],_c7[1]+_c8[i][1]];}}}this.runtimeAttributes[_c4]=[_c7];if(_c8.length>0){this.runtimeAttributes[_c4]=this.runtimeAttributes[_c4].concat(_c8);}this.runtimeAttributes[_c4][this.runtimeAttributes[_c4].length]=end;}else{_b6.setRuntimeAttribute.call(this,_c4);}};var _ce=function(val,_d1){var _d2=Y.Dom.getXY(this.getEl());val=[val[0]-_d2[0]+_d1[0],val[1]-_d2[1]+_d1[1]];return val;};var _cd=function(_d3){return(typeof _d3!=="undefined");};})();(function(){YAHOO.util.Scroll=function(el,_d5,_d6,_d7){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,_d5,_d6,_d7);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var _d9=Y.Scroll.superclass;var _da=Y.Scroll.prototype;_da.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};_da.doMethod=function(_dd,_de,end){var val=null;if(_dd=="scroll"){val=[this.method(this.currentFrame,_de[0],end[0]-_de[0],this.totalFrames),this.method(this.currentFrame,_de[1],end[1]-_de[1],this.totalFrames)];}else{val=_d9.doMethod.call(this,_dd,_de,end);}return val;};_da.getAttribute=function(_e1){var val=null;var el=this.getEl();if(_e1=="scroll"){val=[el.scrollLeft,el.scrollTop];}else{val=_d9.getAttribute.call(this,_e1);}return val;};_da.setAttribute=function(_e4,val,_e6){var el=this.getEl();if(_e4=="scroll"){el.scrollLeft=val[0];el.scrollTop=val[1];}else{_d9.setAttribute.call(this,_e4,val,_e6);}};})();

Ext={};window["undefined"]=window["undefined"];Ext.apply=function(o,c,_3){if(_3){Ext.apply(o,_3);}if(o&&c){for(var p in c){o[p]=c[p];}}return o;};(function(){var _5=0;var ua=navigator.userAgent.toLowerCase();var _7=document.compatMode=="CSS1Compat",_8=ua.indexOf("opera")>-1,_9=ua.indexOf("webkit")>-1,_a=ua.indexOf("msie")>-1,_b=ua.indexOf("msie 7")>-1,_c=!_9&&ua.indexOf("gecko")>-1,_d=_a&&!_7,_e=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),_f=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1);if(_a&&!_b){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Ext.apply(Ext,{isStrict:_7,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/www.yui-ext.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},id:function(el,_14){_14=_14||"ext-gen";el=Ext.getDom(el);var id=_14+(++_5);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sc,sp,_1b){var F=function(){},scp,spp=sp.prototype;F.prototype=spp;scp=sc.prototype=new F();scp.constructor=sc;sc.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;}sc.override=function(o){Ext.override(sc,o);};scp.override=io;Ext.override(sc,_1b);return sc;};}(),override:function(_20,_21){if(_21){var p=_20.prototype;for(var _23 in _21){p[_23]=_21[_23];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+" == \"undefined\"){"+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},urlEncode:function(o){if(!o){return"";}var buf=[];for(var key in o){var _2d=typeof o[key];if(_2d!="function"&&_2d!="object"){buf.push(encodeURIComponent(key),"=",encodeURIComponent(o[key]),"&");}}buf.pop();return buf.join("");},each:function(_2e,fn,_30){if(typeof _2e.length=="undefined"||typeof _2e=="string"){_2e=[_2e];}for(var i=0,len=_2e.length;i<len;i++){if(fn.call(_30||_2e[i],_2e[i],i,_2e)===false){return i;}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,_3a,_3b,_3c){if(typeof cb=="function"){if(_3c){cb.defer(_3c,_3a,_3b||[]);}else{cb.apply(_3a,_3b||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el);},isOpera:_8,isSafari:_9,isIE:_a,isIE7:_b,isGecko:_c,isBorderBox:_d,isWindows:_e,isMac:_f,useShims:((_a&&!_b)||(_c&&_f))});})();Ext.namespace("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib");Ext.apply(Function.prototype,{createCallback:function(){var _3e=arguments;var _3f=this;return function(){return _3f.apply(window,_3e);};},createDelegate:function(obj,_41,_42){var _43=this;return function(){var _44=_41||arguments;if(_42===true){_44=Array.prototype.slice.call(arguments,0);_44=_44.concat(_41);}else{if(typeof _42=="number"){_44=Array.prototype.slice.call(arguments,0);var _45=[_42,0].concat(_41);Array.prototype.splice.apply(_44,_45);}}return _43.apply(obj||window,_44);};},defer:function(_46,obj,_48,_49){var fn=this.createDelegate(obj,_48,_49);if(_46){return setTimeout(fn,_46);}fn();return 0;},createSequence:function(fcn,_4c){if(typeof fcn!="function"){return this;}var _4d=this;return function(){var _4e=_4d.apply(this||window,arguments);fcn.apply(_4c||this||window,arguments);return _4e;};},createInterceptor:function(fcn,_50){if(typeof fcn!="function"){return this;}var _51=this;return function(){fcn.target=this;fcn.method=_51;if(fcn.apply(_50||this||window,arguments)===false){return;}return _51.apply(this||window,arguments);};}});Ext.applyIf(String,{escape:function(_52){return _52.replace(/('|\\)/g,"\\$1");},leftPad:function(val,_54,ch){var _56=new String(val);if(ch==null){ch=" ";}while(_56.length<_54){_56=ch+_56;}return _56;},format:function(_57){var _58=Array.prototype.slice.call(arguments,1);return _57.replace(/\{(\d+)\}/g,function(m,i){return _58[i];});}});String.prototype.toggle=function(_5b,_5c){return this==_5b?_5c:_5b;};Ext.applyIf(Number.prototype,{constrain:function(min,max){return Math.min(Math.max(this,min),max);}});Ext.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o){return i;}}return-1;},remove:function(o){var _63=this.indexOf(o);if(_63!=-1){this.splice(_63,1);}}});Date.prototype.getElapsed=function(_64){return Math.abs((_64||new Date()).getTime()-this.getTime());};if(typeof YAHOO=="undefined"){throw"Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";}(function(){var E=YAHOO.util.Event;var D=YAHOO.util.Dom;var CN=YAHOO.util.Connect;var ES=YAHOO.util.Easing;var A=YAHOO.util.Anim;var _6;Ext.lib.Dom={getViewWidth:function(_7){return _7?D.getDocumentWidth():D.getViewportWidth();},getViewHeight:function(_8){return _8?D.getDocumentHeight():D.getViewportHeight();},isAncestor:function(_9,_a){return D.isAncestor(_9,_a);},getRegion:function(el){return D.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,_12,bd=document.body;el=Ext.getDom(el);if(el.getBoundingClientRect){b=el.getBoundingClientRect();_12=fly(document).getScroll();return[b.left+_12.left,b.top+_12.top];}else{var x=el.offsetLeft,y=el.offsetTop;p=el.offsetParent;var _16=false;if(p!=el){while(p){x+=p.offsetLeft;y+=p.offsetTop;if(Ext.isSafari&&!_16&&fly(p).getStyle("position")=="absolute"){_16=true;}if(Ext.isGecko){pe=fly(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle("overflow")!="visible"){x+=bl;y+=bt;}}p=p.offsetParent;}}if(Ext.isSafari&&(_16||fly(el).getStyle("position")=="absolute")){x-=bd.offsetLeft;y-=bd.offsetTop;}}p=el.parentNode;while(p&&p!=bd){if(!Ext.isOpera||(Ext.isOpera&&p.tagName!="TR"&&fly(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop;}p=p.parentNode;}return[x,y];},setXY:function(el,xy){el=Ext.fly(el,"_setXY");el.position();var pts=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=pts.left+"px";}if(xy[1]!==false){el.dom.style.top=pts.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}};Ext.lib.Event={getPageX:function(e){return E.getPageX(e.browserEvent||e);},getPageY:function(e){return E.getPageY(e.browserEvent||e);},getXY:function(e){return E.getXY(e.browserEvent||e);},getTarget:function(e){return E.getTarget(e.browserEvent||e);},getRelatedTarget:function(e){return E.getRelatedTarget(e.browserEvent||e);},on:function(el,_26,fn,_28,_29){E.on(el,_26,fn,_28,_29);},un:function(el,_2b,fn){E.removeListener(el,_2b,fn);},purgeElement:function(el){E.purgeElement(el);},preventDefault:function(e){E.preventDefault(e.browserEvent||e);},stopPropagation:function(e){E.stopPropagation(e.browserEvent||e);},stopEvent:function(e){E.stopEvent(e.browserEvent||e);},onAvailable:function(el,fn,_33,_34){return E.onAvailable(el,fn,_33,_34);}};Ext.lib.Ajax={request:function(_35,uri,cb,_38){return CN.asyncRequest(_35,uri,cb,_38);},formRequest:function(_39,uri,cb,_3c,_3d,_3e){CN.setForm(_39,_3d,_3e);return CN.asyncRequest("POST",uri,cb,_3c);},isCallInProgress:function(_3f){return CN.isCallInProgress(_3f);},abort:function(_40){return CN.abort(_40);}};Ext.lib.Region=YAHOO.util.Region;Ext.lib.Point=YAHOO.util.Point;Ext.lib.Anim={scroll:function(el,_42,_43,_44,cb,_46){this.run(el,_42,_43,_44,cb,_46,YAHOO.util.Scroll);},motion:function(el,_48,_49,_4a,cb,_4c){this.run(el,_48,_49,_4a,cb,_4c,YAHOO.util.Motion);},color:function(el,_4e,_4f,_50,cb,_52){this.run(el,_4e,_4f,_50,cb,_52,YAHOO.util.ColorAnim);},run:function(el,_54,_55,_56,cb,_58,_59){_59=_59||YAHOO.util.Anim;if(typeof _56=="string"){_56=YAHOO.util.Easing[_56];}var _5a=new _59(el,_54,_55,_56);_5a.animateX(function(){Ext.callback(cb,_58);});return _5a;}};function fly(el){if(!_6){_6=new Ext.Element.Flyweight();}_6.dom=el;return _6;}if(Ext.isIE){YAHOO.util.Event.on(window,"unload",function(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;});}if(YAHOO.util.Anim){YAHOO.util.Anim.prototype.animateX=function(_5d,_5e){var f=function(){this.onComplete.unsubscribe(f);if(typeof _5d=="function"){_5d.call(_5e||this,this);}};this.onComplete.subscribe(f,this,true);this.animate();};}if(YAHOO.util.DragDrop&&Ext.dd.DragDrop){YAHOO.util.DragDrop.defaultPadding=Ext.dd.DragDrop.defaultPadding;YAHOO.util.DragDrop.constrainTo=Ext.dd.DragDrop.constrainTo;}YAHOO.util.Dom.getXY=function(el){var f=function(el){return Ext.lib.Dom.getXY(el);};return YAHOO.util.Dom.batch(el,f,YAHOO.util.Dom,true);};if(YAHOO.util.AnimMgr){YAHOO.util.AnimMgr.fps=1000;}YAHOO.util.Region.prototype.adjust=function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;};})();

Ext.DomHelper=function(){var _1=null;var _2=/^(?:base|basefont|br|frame|hr|img|input|isindex|link|meta|nextid|range|spacer|wbr|audioscope|area|param|keygen|col|limittext|spot|tab|over|right|left|choose|atop|of)$/i;var _3=function(o){var b="";if(!o.tag){o.tag="div";}b+="<"+o.tag;for(var _6 in o){if(_6=="tag"||_6=="children"||_6=="html"||typeof o[_6]=="function"){continue;}if(_6=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=" style=\""+s+"\"";}else{if(typeof s=="object"){b+=" style=\"";for(var _8 in s){if(typeof s[_8]!="function"){b+=_8+":"+s[_8]+";";}}b+="\"";}}}else{if(_6=="cls"){b+=" class=\""+o["cls"]+"\"";}else{if(_6=="htmlFor"){b+=" for=\""+o["htmlFor"]+"\"";}else{b+=" "+_6+"=\""+o[_6]+"\"";}}}}if(_2.test(o.tag)){b+="/>";}else{b+=">";if(o.children){for(var i=0,_a=o.children.length;i<_a;i++){b+=_3(o.children[i],b);}}if(o.html){b+=o.html;}b+="</"+o.tag+">";}return b;};var _b=function(o,_d){var el=document.createElement(o.tag);var _f=el.setAttribute?true:false;for(var _10 in o){if(_10=="tag"||_10=="children"||_10=="html"||_10=="style"||typeof o[_10]=="function"){continue;}if(_10=="cls"){el.className=o["cls"];}else{if(_f){el.setAttribute(_10,o[_10]);}else{el[_10]=o[_10];}}}Ext.DomHelper.applyStyles(el,o.style);if(o.children){for(var i=0,len=o.children.length;i<len;i++){_b(o.children[i],el);}}if(o.html){el.innerHTML=o.html;}if(_d){_d.appendChild(el);}return el;};var _13=function(tag,_15,el,_17){if(!_1){_1=document.createElement("div");}var _18;var _19=null;if(tag=="td"){if(_15=="afterbegin"||_15=="beforeend"){return;}if(_15=="beforebegin"){_19=el;el=el.parentNode;}else{_19=el.nextSibling;el=el.parentNode;}_1.innerHTML="<table><tbody><tr>"+_17+"</tr></tbody></table>";_18=_1.firstChild.firstChild.firstChild.firstChild;}else{if(tag=="tr"){if(_15=="beforebegin"){_19=el;el=el.parentNode;_1.innerHTML="<table><tbody>"+_17+"</tbody></table>";_18=_1.firstChild.firstChild.firstChild;}else{if(_15=="afterend"){_19=el.nextSibling;el=el.parentNode;_1.innerHTML="<table><tbody>"+_17+"</tbody></table>";_18=_1.firstChild.firstChild.firstChild;}else{if(_15=="afterbegin"){_19=el.firstChild;}_1.innerHTML="<table><tbody><tr>"+_17+"</tr></tbody></table>";_18=_1.firstChild.firstChild.firstChild.firstChild;}}}else{if(tag=="tbody"){if(_15=="beforebegin"){_19=el;el=el.parentNode;_1.innerHTML="<table>"+_17+"</table>";_18=_1.firstChild.firstChild;}else{if(_15=="afterend"){_19=el.nextSibling;el=el.parentNode;_1.innerHTML="<table>"+_17+"</table>";_18=_1.firstChild.firstChild;}else{if(_15=="afterbegin"){_19=el.firstChild;}_1.innerHTML="<table><tbody>"+_17+"</tbody></table>";_18=_1.firstChild.firstChild.firstChild;}}}else{if(_15=="beforebegin"||_15=="afterend"){return;}if(_15=="afterbegin"){_19=el.firstChild;}_1.innerHTML="<table>"+_17+"</tbody>";_18=_1.firstChild.firstChild;}}}el.insertBefore(_18,_19);return _18;};return{useDom:false,applyStyles:function(el,_1b){if(_1b){el=Ext.fly(el);if(typeof _1b=="string"){var re=/\s?([a-z\-]*)\:([^;]*);?/gi;var _1d;while((_1d=re.exec(_1b))!=null){el.setStyle(_1d[1],_1d[2]);}}else{if(typeof _1b=="object"){for(var _1e in _1b){el.setStyle(_1e,_1b[_1e]);}}else{if(typeof _1b=="function"){Ext.DomHelper.applyStyles(el,_1b.call());}}}}},insertHtml:function(_1f,el,_21){_1f=_1f.toLowerCase();if(el.insertAdjacentHTML){var tag=el.tagName.toLowerCase();if(tag=="table"||tag=="tbody"||tag=="tr"||tag=="td"){var rs;if(rs=_13(tag,_1f,el,_21)){return rs;}}switch(_1f){case"beforebegin":el.insertAdjacentHTML(_1f,_21);return el.previousSibling;case"afterbegin":el.insertAdjacentHTML(_1f,_21);return el.firstChild;case"beforeend":el.insertAdjacentHTML(_1f,_21);return el.lastChild;case"afterend":el.insertAdjacentHTML(_1f,_21);return el.nextSibling;}throw"Illegal insertion point -> \""+_1f+"\"";}var _24=el.ownerDocument.createRange();var _25;switch(_1f){case"beforebegin":_24.setStartBefore(el);_25=_24.createContextualFragment(_21);el.parentNode.insertBefore(_25,el);return el.previousSibling;case"afterbegin":if(el.firstChild){_24.setStartBefore(el.firstChild);}else{_24.selectNodeContents(el);_24.collapse(true);}_25=_24.createContextualFragment(_21);el.insertBefore(_25,el.firstChild);return el.firstChild;case"beforeend":if(el.lastChild){_24.setStartAfter(el.lastChild);}else{_24.selectNodeContents(el);_24.collapse(false);}_25=_24.createContextualFragment(_21);el.appendChild(_25);return el.lastChild;case"afterend":_24.setStartAfter(el);_25=_24.createContextualFragment(_21);el.parentNode.insertBefore(_25,el.nextSibling);return el.nextSibling;}throw"Illegal insertion point -> \""+_1f+"\"";},insertBefore:function(el,o,_28){return this.doInsert(el,o,_28,"beforeBegin");},insertAfter:function(el,o,_2b){return this.doInsert(el,o,_2b,"afterEnd","nextSibling");},insertFirst:function(el,o,_2e){return this.doInsert(el,o,_2e,"afterBegin");},doInsert:function(el,o,_31,pos,_33){el=Ext.getDom(el);var _34;if(this.useDom){_34=_b(o,null);el.parentNode.insertBefore(_34,_33?el[_33]:el);}else{var _35=_3(o);_34=this.insertHtml(pos,el,_35);}return _31?Ext.get(_34,true):_34;},append:function(el,o,_38){el=Ext.getDom(el);var _39;if(this.useDom){_39=_b(o,null);el.appendChild(_39);}else{var _3a=_3(o);_39=this.insertHtml("beforeEnd",el,_3a);}return _38?Ext.get(_39,true):_39;},overwrite:function(el,o,_3d){el=Ext.getDom(el);el.innerHTML=_3(o);return _3d?Ext.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var _3f=_3(o);return new Ext.Template(_3f);}};}();Ext.Template=function(_1){if(_1 instanceof Array){_1=_1.join("");}else{if(arguments.length>1){_1=Array.prototype.join.call(arguments,"");}}this.html=_1;};Ext.Template.prototype={applyTemplate:function(_2){if(this.compiled){return this.compiled(_2);}var _3=this.disableFormats!==true;var fm=Ext.util.Format,_5=this;var fn=function(m,_8,_9,_a){if(_9&&_3){if(_9.substr(0,5)=="this."){return _5.call(_9.substr(5),_2[_8]);}else{if(_a){var re=/^\s*['"](.*)["']\s*$/;_a=_a.split(",");for(var i=0,_d=_a.length;i<_d;i++){_a[i]=_a[i].replace(re,"$1");}_a=[_2[_8]].concat(_a);}else{_a=[_2[_8]];}return fm[_9].apply(fm,_a);}}else{return _2[_8]!==undefined?_2[_8]:"";}};return this.html.replace(this.re,fn);},set:function(_e,_f){this.html=_e;this.compiled=null;if(_f){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var _11=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,_15,_16,_17){if(_16&&_11){_17=_17?","+_17:"";if(_16.substr(0,5)!="this."){_16="fm."+_16+"(";}else{_16="this.call(\""+_16.substr(5)+"\", ";_17="";}}else{_17="",_16="(values['"+_15+"'] == undefined ? '' : ";}return"'"+sep+_16+"values['"+_15+"']"+_17+")"+sep+"'";};var _18;if(Ext.isGecko){_18="this.compiled = function(values){ return '"+this.html.replace(/(\r\n|\n)/g,"\\n").replace("'","\\'").replace(this.re,fn)+"';};";}else{_18=["this.compiled = function(values){ return ['"];_18.push(this.html.replace(/(\r\n|\n)/g,"\\n").replace("'","\\'").replace(this.re,fn));_18.push("'].join('');};");_18=_18.join("");}eval(_18);return this;},call:function(_19,_1a){this[_19](_1a);},insertBefore:function(el,_1c,_1d){el=Ext.getDom(el);var _1e=Ext.DomHelper.insertHtml("beforeBegin",el,this.applyTemplate(_1c));return _1d?Ext.get(_1e,true):_1e;},insertAfter:function(el,_20,_21){el=Ext.getDom(el);var _22=Ext.DomHelper.insertHtml("afterEnd",el,this.applyTemplate(_20));return _21?Ext.get(_22,true):_22;},append:function(el,_24,_25){el=Ext.getDom(el);var _26=Ext.DomHelper.insertHtml("beforeEnd",el,this.applyTemplate(_24));return _25?Ext.get(_26,true):_26;},overwrite:function(el,_28,_29){el=Ext.getDom(el);el.innerHTML=this.applyTemplate(_28);return _29?Ext.get(el.firstChild,true):el.firstChild;}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(el){el=Ext.getDom(el);return new Ext.Template(el.value||el.innerHTML);};Ext.MasterTemplate=function(){Ext.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var st={};var m,re=this.subTemplateRe;var _2e=0;while(m=re.exec(this.html)){var _2f=m[1],_30=m[2];st[_2e]={name:_2f,index:_2e,buffer:[],tpl:new Ext.Template(_30)};if(_2f){st[_2f]=st[_2e];}st[_2e].tpl.compile();st[_2e].tpl.call=this.call.createDelegate(this);_2e++;}this.subCount=_2e;this.subs=st;};Ext.extend(Ext.MasterTemplate,Ext.Template,{subTemplateRe:/<tpl(?:\sname="([\w-]+)")?>((?:.|\n)*?)<\/tpl>/gi,add:function(_31,_32){if(arguments.length==1){_32=arguments[0];_31=0;}var s=this.subs[_31];s.buffer[s.buffer.length]=s.tpl.apply(_32);return this;},fill:function(_34,_35,_36){var a=arguments;if(a.length==1||(a.length==2&&typeof a[1]=="boolean")){_35=a[0];_34=0;_36=a[1];}if(_36){this.reset();}for(var i=0,len=_35.length;i<len;i++){this.add(_34,_35[i]);}return this;},reset:function(){var s=this.subs;for(var i=0;i<this.subCount;i++){s[i].buffer=[];}return this;},applyTemplate:function(_3c){var s=this.subs;var _3e=-1;this.html=this.originalHtml.replace(this.subTemplateRe,function(m,_40){return s[++_3e].buffer.join("");});return Ext.MasterTemplate.superclass.applyTemplate.call(this,_3c);},apply:function(){return this.applyTemplate.apply(this,arguments);},compile:function(){return this;}});Ext.MasterTemplate.prototype.addAll=Ext.MasterTemplate.prototype.fill;Ext.MasterTemplate.from=function(el){el=Ext.getDom(el);return new Ext.MasterTemplate(el.value||el.innerHTML);};Ext.DomQuery=function(){var _1={},_2={},_3={};var _4=/\S/;var _5=/^\s*(.*?)\s*$/;var _6=/\{(\d+)\}/g;var _7=/^(\s?[\/>]\s?|\s|$)/;var _8=/^(#)?([\w-\*]+)/;function child(p,_a){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==_a){return n;}}n=n.nextSibling;}return null;}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n;}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n;}function clean(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!_4.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;}n=nx;}return this;}function byClassName(c,a,v,re,cn){if(!v){return c;}var r=[];for(var i=0,ci;ci=c[i];i++){cn=ci.className;if(cn&&(" "+cn+" ").indexOf(v)!=-1){r[r.length]=ci;}}return r;}function attrValue(n,_1c){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];}if(!n){return null;}if(_1c=="for"){return n.htmlFor;}if(_1c=="class"||_1c=="className"){return n.className;}return n.getAttribute(_1c)||n[_1c];}function getNodes(ns,_1e,_1f){var _20=[],cs;if(!ns){return _20;}_1e=_1e?_1e.replace(_5,"$1"):"";_1f=_1f||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];}if(_1e!="/"&&_1e!=">"){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(_1f);for(var j=0,ci;ci=cs[j];j++){_20[_20.length]=ci;}}}else{for(var i=0,ni;ni=ns[i];i++){var cn=ni.getElementsByTagName(_1f);for(var j=0,cj;cj=cn[j];j++){if(cj.parentNode==ni){_20[_20.length]=cj;}}}}return _20;}function concat(a,b){if(b.slice){return a.concat(b);}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i];}return a;}function byTag(cs,_2d){if(cs.tagName||cs==document){cs=[cs];}if(!_2d){return cs;}var r=[];_2d=_2d.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==_2d){r[r.length]=ci;}}return r;}function byId(cs,_32,id){if(cs.tagName||cs==document){cs=[cs];}if(!id){return cs;}var r=[];for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[r.length]=ci;return r;}}return r;}function byAttribute(cs,_38,_39,op,_3b){var r=[],st=_3b=="{";var f=Ext.DomQuery.operators[op];for(var i=0;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,_38);}else{if(_38=="class"||_38=="className"){a=ci.className;}else{if(_38=="for"){a=ci.htmlFor;}else{if(_38=="href"){a=ci.getAttribute("href",2);}else{a=ci.getAttribute(_38);}}}}if((f&&f(a,_39))||(!f&&a)){r[r.length]=ci;}}return r;}function byPseudo(cs,_42,_43){return Ext.DomQuery.pseudos[_42](cs,_43);}var _44=window.ActiveXObject?true:false;var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c;}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup");}return r;}function nodup(cs){var len=cs.length,c,i,r=cs,cj;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs;}if(_44&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs);}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d;}else{r=[];for(var j=0;j<i;j++){r[r.length]=cs[j];}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[r.length]=cj;}}return r;}}return r;}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d);}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i];}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff");}return r;}function quickDiff(c1,c2){var _5c=c1.length;if(!_5c){return c2;}if(_44&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2);}var d=++key;for(var i=0;i<_5c;i++){c1[i]._qdiff=d;}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i];}}return r;}function quickId(ns,_62,_63,id){if(ns==_63){var d=_63.ownerDocument||_63;return d.getElementById(id);}ns=getNodes(ns,_62,"*");return byId(ns,null,id);}return{getStyle:function(el,_67){return Ext.fly(el).getStyle(_67);},compile:function(_68,_69){while(_68.substr(0,1)=="/"){_68=_68.substr(1);}_69=_69||"select";var fn=["var f = function(root){\n var mode; var n = root || document;\n"];var q=_68,_6c,lq;var tk=Ext.DomQuery.matchers;var _6f=tk.length;var mm;while(q&&lq!=q){lq=q;var tm=q.match(_8);if(_69=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]="n = quickId(n, mode, root, \""+tm[2]+"\");";}else{fn[fn.length]="n = getNodes(n, mode, \""+tm[2]+"\");";}q=q.replace(tm[0],"");}else{if(q.substr(0,1)!="@"){fn[fn.length]="n = getNodes(n, mode, \"*\");";}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]="n = byId(n, null, \""+tm[2]+"\");";}else{fn[fn.length]="n = byTag(n, \""+tm[2]+"\");";}q=q.replace(tm[0],"");}}while(!(mm=q.match(_7))){var _72=false;for(var j=0;j<_6f;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(_6,function(x,i){return m[i];});q=q.replace(m[0],"");_72=true;break;}}if(!_72){throw"Error parsing selector, parsing failed at \""+q+"\"";}}if(mm[1]){fn[fn.length]="mode=\""+mm[1]+"\";";q=q.replace(mm[1],"");}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f;},select:function(_78,_79,_7a){if(!_79||_79==document){_79=document;}if(typeof _79=="string"){_79=document.getElementById(_79);}var _7b=_78.split(",");var _7c=[];for(var i=0,len=_7b.length;i<len;i++){var p=_7b[i].replace(_5,"$1");if(!_1[p]){_1[p]=Ext.DomQuery.compile(p);if(!_1[p]){throw p+" is not a valid selector";}}var _80=_1[p](_79);if(_80&&_80!=document){_7c=_7c.concat(_80);}}return _7c;},selectNode:function(_81,_82){return Ext.DomQuery.select(_81,_82)[0];},selectValue:function(_83,_84,_85){_83=_83.replace(_5,"$1");if(!_3[_83]){_3[_83]=Ext.DomQuery.compile(_83,"select");}var n=_3[_83](_84);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return(v===null?_85:v);},selectNumber:function(_88,_89,_8a){var v=Ext.DomQuery.selectValue(_88,_89,_8a||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var _8e=(el instanceof Array);var _8f=Ext.DomQuery.filter(_8e?el:[el],ss);return _8e?(_8f.length==el.length):(_8f.length>0);},filter:function(els,ss,_92){ss=ss.replace(_5,"$1");if(!_2[ss]){_2[ss]=Ext.DomQuery.compile(ss,"simple");}var _93=_2[ss](els);return _92?quickDiff(_93,els):_93;},matchers:[{re:/^\.([\w-]+)/,select:"n = byClassName(n, null, \" {1} \");"},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:"n = byPseudo(n, \"{1}\", \"{2}\");"},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:"n = byAttribute(n, \"{2}\", \"{4}\", \"{3}\", \"{1}\");"},{re:/^#([\w-]+)/,select:"n = byId(n, null, \"{1}\");"},{re:/^@([\w-]+)/,select:"return {firstChild:{nodeValue:attrValue(n, \"{1}\")}};"}],operators:{"=":function(a,v){return a==v;},"!=":function(a,v){return a!=v;},"^=":function(a,v){return a&&a.substr(0,v.length)==v;},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v;},"*=":function(a,v){return a&&a.indexOf(v)!==-1;},"%=":function(a,v){return(a%v)==0;}},pseudos:{"first-child":function(c){var r=[],n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[r.length]=ci;}}return r;},"last-child":function(c){var r=[];for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[r.length]=ci;}}return r;},"nth-child":function(c,a){var r=[];if(a!="odd"&&a!="even"){for(var i=0,ci;ci=c[i];i++){var m=child(ci.parentNode,a);if(m==ci){r[r.length]=m;}}return r;}var p;for(var i=0,l=c.length;i<l;i++){var cp=c[i].parentNode;if(cp!=p){clean(cp);p=cp;}}for(var i=0,ci;ci=c[i];i++){var m=false;if(a=="odd"){m=((ci.nodeIndex+1)%2==1);}else{if(a=="even"){m=((ci.nodeIndex+1)%2==0);}}if(m){r[r.length]=ci;}}return r;},"only-child":function(c){var r=[];for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[r.length]=ci;}}return r;},"empty":function(c){var r=[];for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,_bd=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){_bd=false;break;}}if(_bd){r[r.length]=ci;}}return r;},"contains":function(c,v){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.innerHTML.indexOf(v)!==-1){r[r.length]=ci;}}return r;},"nodeValue":function(c,v){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[r.length]=ci;}}return r;},"checked":function(c){var r=[];for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[r.length]=ci;}}return r;},"not":function(c,ss){return Ext.DomQuery.filter(c,ss,true);},"odd":function(c){return this["nth-child"](c,"odd");},"even":function(c){return this["nth-child"](c,"even");},"nth":function(c,a){return c[a-1];},"first":function(c){return c[0];},"last":function(c){return c[c.length-1];},"has":function(c,ss){var s=Ext.DomQuery.select;var r=[];for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[r.length]=ci;}}return r;},"next":function(c,ss){var is=Ext.DomQuery.is;var r=[];for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[r.length]=ci;}}return r;},"prev":function(c,ss){var is=Ext.DomQuery.is;var r=[];for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[r.length]=ci;}}return r;}}};}();Ext.query=Ext.DomQuery.select;Ext.util.Observable=function(){};Ext.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()];if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1));}else{return true;}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(_2,fn,_4,o){if(typeof _2=="object"){o=_2;for(var e in o){if(this.filterOptRe.test(e)){continue;}if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o);}else{this.addListener(e,o[e].fn,o[e].scope,o[e]);}}return;}o=(!o||typeof o=="boolean")?{}:o;_2=_2.toLowerCase();var ce=this.events[_2];if(!ce){throw"Event does not exist: \""+_2+"\".";}if(typeof ce=="boolean"){ce=new Ext.util.Event(this,_2);this.events[_2]=ce;}ce.addListener(fn,_4,o);},removeListener:function(_8,fn,_a){var ce=this.events[_8.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,_a);}},purgeListeners:function(){for(var _c in this.events){if(typeof this.events[_c]=="object"){this.events[_c].clearListeners();}}},relayEvents:function(o,_e){var _f=function(_10){return function(){return this.fireEvent.apply(this,Ext.combine(_10,Array.prototype.slice.call(arguments,0)));};};for(var i=0,len=_e.length;i<len;i++){var _13=_e[i];if(!this.events[_13]){this.events[_13]=true;}o.on(_13,_f(_13),this);}},addEvents:function(o){if(!this.events){this.events={};}Ext.applyIf(this.events,o);},hasListener:function(_15){var e=this.events[_15];return typeof e=="object"&&e.listeners.length>0;}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(o,fn,_19){o.fireEvent=o.fireEvent.createInterceptor(fn,_19);};Ext.util.Observable.releaseCapture=function(o){o.fireEvent=Ext.util.Observable.prototype.fireEvent;};(function(){var _1b=function(h,o,_1e){var _1f=new Ext.util.DelayedTask();return function(){_1f.delay(o.buffer,h,_1e,Array.prototype.slice.call(arguments,0));};};var _20=function(h,e,fn,_24){return function(){e.removeListener(fn,_24);return h.apply(_24,arguments);};};var _25=function(h,o,_28){return function(){var _29=Array.prototype.slice.call(arguments,0);setTimeout(function(){h.apply(_28,_29);},o.delay||10);};};Ext.util.Event=function(obj,_2b){this.name=_2b;this.obj=obj;this.listeners=[];};Ext.util.Event.prototype={addListener:function(fn,_2d,_2e){var o=_2e||{};_2d=_2d||this.obj;if(!this.isListening(fn,_2d)){var l={fn:fn,scope:_2d,options:o};var h=fn;if(o.delay){h=_25(h,o,_2d);}if(o.single){h=_20(h,this,fn,_2d);}if(o.buffer){h=_1b(h,o,_2d);}l.fireFn=h;if(!this.firing){this.listeners.push(l);}else{this.listeners=this.listeners.slice(0).push(l);}}},findListener:function(fn,_33){_33=_33||this.obj;var ls=this.listeners;for(var i=0,len=ls.length;i<len;i++){var l=ls[i];if(l.fn==fn&&l.scope==_33){return i;}}return-1;},isListening:function(fn,_39){return this.findListener(fn,_39)!=-1;},removeListener:function(fn,_3b){var _3c;if((_3c=this.findListener(fn,_3b))!=-1){if(!this.firing){this.listeners.splice(_3c,1);}else{this.listeners=this.listeners.slice(0).splice(_3c,1);}return true;}return false;},clearListeners:function(){this.listeners=[];},fire:function(){var ls=this.listeners,_3e,len=ls.length;if(len>0){this.firing=true;var _40=Array.prototype.slice.call(arguments,0);for(var i=0;i<len;i++){var l=ls[i];if(l.fireFn.apply(l.scope,arguments)===false){this.firing=false;return false;}}this.firing=false;}return true;}};})();Ext.EventManager=function(){var _1,_2,_3=false;var _4,_5,_6,_7;var E=Ext.lib.Event;var D=Ext.lib.Dom;var _a=function(){if(!_3){_3=true;if(_2){clearInterval(_2);}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",_a,false);}if(_1){_1.fire();_1.clearListeners();}}};var _b=function(){_1=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",_a,false);}else{if(Ext.isIE){document.write("<s"+"cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"+"/:\"></s"+"cript>");E.on("ie-deferred-loader","readystatechange",function(){if(this.readyState=="complete"){_a();}});}else{if(Ext.isSafari){_2=setInterval(function(){var rs=document.readyState;if(rs=="loaded"||rs=="complete"){_a();}},10);}}}E.on(window,"load",_a);};var _d=function(h,o){var _10=new Ext.util.DelayedTask(h);return function(e){e=new Ext.EventObjectImpl(e);_10.delay(o.buffer,h,null,[e]);};};var _12=function(h,el,_15,fn){return function(e){Ext.EventManager.removeListener(el,_15,fn);h(e);};};var _18=function(h,o){return function(e){e=new Ext.EventObjectImpl(e);setTimeout(function(){h(e);},o.delay||10);};};var _1c=function(_1d,_1e,opt,fn,_21){var o=(!opt||typeof opt=="boolean")?{}:opt;fn=fn||o.fn;_21=_21||o.scope;var el=typeof _1d=="string"?document.getElementById(_1d):_1d;if(!el){throw"Error listening for "+_1e+". Element "+_1d+" doesn't exist.";}var h=function(e){e=Ext.EventObject.setEvent(e);var t;if(o.delegate){t=e.getTarget(o.delegate,el);if(!t){return;}}else{t=e.target;}if(o.stopEvent===true){e.stopEvent();}if(o.preventDefault===true){e.preventDefault();}if(o.stopPropagation===true){e.stopPropagation();}if(o.normalized===false){e=e.browserEvent;}fn.call(_21||el,e,t,o);};if(o.delay){h=_18(h,o);}if(o.single){h=_12(h,el,_1e,fn);}if(o.buffer){h=_d(h,o);}fn._handlers=fn._handlers||[];fn._handlers.push([Ext.id(el),_1e,h]);E.on(el,_1e,h);if(_1e=="mousewheel"&&el.addEventListener){el.addEventListener("DOMMouseScroll",h,false);}return h;};var _27=function(el,_29,fn){var id=Ext.id(el),hds=fn._handlers;if(hds){for(var i=0,len=hds.length;i<len;i++){var h=hds[i];if(h[0]==id&&h[1]==_29){var hd=h[2];hds.splice(i,1);return E.un(el,_29,hd);}}}E.un(el,_29,fn);if(_29=="mousewheel"){E.un(el,"DOMMouseScroll",fn);}};var _31=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized)$/;var pub={wrap:function(fn,_34,_35){return function(e){Ext.EventObject.setEvent(e);fn.call(_35?_34||window:window,Ext.EventObject,_34);};},addListener:function(_37,_38,fn,_3a,_3b){if(typeof _38=="object"){var o=_38;for(var e in o){if(_31.test(e)){continue;}if(typeof o[e]=="function"){_1c(_37,e,o,o[e],o.scope);}else{_1c(_37,e,o[e]);}}return;}return _1c(_37,_38,_3b,fn,_3a);},removeListener:function(_3e,_3f,fn){return _27(_3e,_3f,fn);},onDocumentReady:function(fn,_42,_43){if(_3){fn.call(_42||window,_42);return;}if(!_1){_b();}_1.addListener(fn,_42,_43);},onWindowResize:function(fn,_45,_46){if(!_4){_4=new Ext.util.Event();_5=new Ext.util.DelayedTask(function(){_4.fire(D.getViewWidth(),D.getViewHeight());});E.on(window,"resize",function(){if(Ext.isIE){_5.delay(50);}else{_4.fire(D.getViewWidth(),D.getViewHeight());}});}_4.addListener(fn,_45,_46);},onTextResize:function(fn,_48,_49){if(!_6){_6=new Ext.util.Event();var _4a=new Ext.Element(document.createElement("div"));_4a.dom.className="x-text-resize";_4a.dom.innerHTML="X";_4a.appendTo(document.body);_7=_4a.dom.offsetHeight;setInterval(function(){if(_4a.dom.offsetHeight!=_7){_6.fire(_7,_7=_4a.dom.offsetHeight);}},this.textResizeInterval);}_6.addListener(fn,_48,_49);},removeResizeListener:function(fn,_4c){if(_4){_4.removeListener(fn,_4c);}},fireResize:function(){if(_4){_4.fire(D.getViewWidth(),D.getViewHeight());}},ieDeferSrc:false,textResizeInterval:50};pub.on=pub.addListener;pub.un=pub.removeListener;return pub;}();Ext.onReady=Ext.EventManager.onDocumentReady;Ext.onReady(function(){var bd=Ext.get(document.body);var cls=Ext.isIE?"ext-ie":Ext.isGecko?"ext-gecko":Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":"";if(Ext.isBorderBox){cls+=" ext-border-box";}if(Ext.isStrict){cls+=" ext-strict";}bd.addClass(cls);});Ext.EventObject=function(){var E=Ext.lib.Event;var _50={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var _51=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;}this.browserEvent=e;if(e){this.button=e.button?_51[e.button]:(e.which?e.which-1:-1);this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;this.charCode=e.charCode;this.target=E.getTarget(e);this.xy=E.getXY(e);}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0];}return this;},stopEvent:function(){if(this.browserEvent){E.stopEvent(this.browserEvent);}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent);}},isNavKeyPress:function(){var k=this.keyCode;k=Ext.isSafari?(_50[k]||k):k;return(k>=33&&k<=40)||k==this.RETURN||k==this.TAB||k==this.ESC;},isSpecialKey:function(){var k=this.keyCode;return k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45);},stopPropagation:function(){if(this.browserEvent){E.stopPropagation(this.browserEvent);}},getCharCode:function(){return this.charCode||this.keyCode;},getKey:function(){var k=this.keyCode||this.charCode;return Ext.isSafari?(_50[k]||k):k;},getPageX:function(){return this.xy[0];},getPageY:function(){return this.xy[1];},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent);}return null;},getXY:function(){return this.xy;},getTarget:function(_57,_58,_59){return _57?Ext.fly(this.target).findParent(_57,_58,_59):this.target;},getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent);}return null;},getWheelDelta:function(){var e=this.browserEvent;var _5b=0;if(e.wheelDelta){_5b=e.wheelDelta/120;if(window.opera){_5b=-_5b;}}else{if(e.detail){_5b=-e.detail/3;}}return _5b;},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false;},within:function(el,_5d){var t=this[_5d?"getRelatedTarget":"getTarget"]();return t&&Ext.fly(el).contains(t);},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1]);}};return new Ext.EventObjectImpl();}();(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var _4={};var _5=/(-[a-z])/gi;var _6=function(m,a){return a.charAt(1).toUpperCase();};var _9=document.defaultView;Ext.Element=function(_a,_b){var _c=typeof _a=="string"?document.getElementById(_a):_a;if(!_c){return null;}if(!_b&&Ext.Element.cache[_c.id]){return Ext.Element.cache[_c.id];}this.dom=_c;this.id=_c.id||Ext.id(_c);};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(_e){this.visibilityMode=_e;return this;},enableDisplayMode:function(_f){this.setVisibilityMode(El.DISPLAY);if(typeof _f!="undefined"){this.originalDisplay=_f;}return this;},findParent:function(_10,_11,_12){var p=this.dom,b=document.body,_15=0,dq=Ext.DomQuery,_17;_11=_11||50;if(typeof _11!="number"){_17=Ext.getDom(_11);_11=10;}while(p&&p.nodeType==1&&_15<_11&&p!=b&&p!=_17){if(dq.is(p,_10)){return _12?Ext.get(p):p;}_15++;p=p.parentNode;}return null;},is:function(_18){return Ext.DomQuery.is(this.dom,_18);},animate:function(_19,_1a,_1b,_1c,_1d){this.anim(_19,{duration:_1a,callback:_1b,easing:_1c},_1d);return this;},anim:function(_1e,opt,_20,_21,_22,cb){_20=_20||"run";opt=opt||{};var _24=Ext.lib.Anim[_20](this.dom,_1e,(opt.duration||_21)||0.35,(opt.easing||_22)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt]);},this);opt.anim=_24;return _24;},preanim:function(a,i){return!a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});},clean:function(_27){if(this.isCleaned&&_27!==true){return this;}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;}n=nx;}this.isCleaned=true;return this;},calcOffsetsTo:function(el){el=Ext.get(el),d=el.dom;var _2e=false;if(el.getStyle("position")=="static"){el.position("relative");_2e=true;}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!="HTML"){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent;}if(_2e){el.position("static");}return[x,y];},scrollIntoView:function(_32,_33){var c=Ext.getDom(_32);var el=this.dom;var o=this.calcOffsetsTo(c),l=o[0],t=o[1],b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(t<ct){c.scrollTop=t;}else{if(b>cb){c.scrollTop=b-ch;}}if(_33!==false){if(l<cl){c.scrollLeft=l;}else{if(r>cr){c.scrollLeft=r-c.clientWidth;}}}return this;},scrollChildIntoView:function(_40){Ext.fly(_40,"_scrollChildIntoView").scrollIntoView(this);},autoHeight:function(_41,_42,_43,_44){var _45=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var _46=parseInt(this.dom.scrollHeight,10);if(!_41){this.setHeight(_46);this.unclip();if(typeof _43=="function"){_43();}}else{this.setHeight(_45);this.setHeight(_46,_41,_42,function(){this.unclip();if(typeof _43=="function"){_43();}}.createDelegate(this),_44);}}.createDelegate(this),0);return this;},contains:function(el){if(!el){return false;}return D.isAncestor(this.dom,el.dom?el.dom:el);},isVisible:function(_48){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(_48!==true||!vis){return vis;}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false;}p=p.parentNode;}return true;},select:function(_4b,_4c){return El.select("#"+Ext.id(this.dom)+" "+_4b,_4c);},query:function(_4d,_4e){return Ext.DomQuery.select(_4d,this.dom);},child:function(_4f,_50){var n=Ext.DomQuery.selectNode(_4f,this.dom);return _50?n:Ext.get(n);},initDD:function(_52,_53,_54){var dd=new Ext.dd.DD(Ext.id(this.dom),_52,_53);return Ext.apply(dd,_54);},initDDProxy:function(_56,_57,_58){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),_56,_57);return Ext.apply(dd,_58);},initDDTarget:function(_5a,_5b,_5c){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),_5a,_5b);return Ext.apply(dd,_5c);},setVisible:function(_5e,_5f){if(!_5f||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(_5e);}else{this.fixDisplay();this.dom.style.visibility=_5e?"visible":"hidden";}}else{var dom=this.dom;var _61=this.visibilityMode;if(_5e){this.setOpacity(0.01);this.setVisible(true);}this.anim({opacity:{to:(_5e?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!_5e){if(_61==El.DISPLAY){dom.style.display="none";}else{dom.style.visibility="hidden";}Ext.get(dom).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(_62){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(_63){if(typeof _63=="boolean"){_63=_63?this.originalDisplay:"none";}this.setStyle("display",_63);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(_64){if(_64 instanceof Array){for(var i=0,len=_64.length;i<len;i++){this.addClass(_64[i]);}}else{if(_64&&!this.hasClass(_64)){this.dom.className=this.dom.className+" "+_64;}}return this;},radioClass:function(_67){var _68=this.dom.parentNode.childNodes;for(var i=0;i<_68.length;i++){var s=_68[i];if(s.nodeType==1){Ext.get(s).removeClass(_67);}}this.addClass(_67);return this;},removeClass:function(_6b){if(!_6b){return this;}if(_6b instanceof Array){for(var i=0,len=_6b.length;i<len;i++){this.removeClass(_6b[i]);}}else{var re=new RegExp("(?:^|\\s+)"+_6b+"(?:\\s+|$)","g");var c=this.dom.className;if(re.test(c)){this.dom.className=c.replace(re," ");}}return this;},toggleClass:function(_70){if(this.hasClass(_70)){this.removeClass(_70);}else{this.addClass(_70);}return this;},hasClass:function(_71){return _71&&(" "+this.dom.className+" ").indexOf(" "+_71+" ")!=-1;},replaceClass:function(_72,_73){this.removeClass(_72);this.addClass(_73);return this;},getStyle:function(){return _9&&_9.getComputedStyle?function(_74){var el=this.dom,v,cs,_78;if(_74=="float"){_74="cssFloat";}if(v=el.style[_74]){return v;}if(cs=_9.getComputedStyle(el,"")){if(!(_78=_4[_74])){_78=_4[_74]=_74.replace(_5,_6);}return cs[_78];}return null;}:function(_79){var el=this.dom,v,cs,_7d;if(_79=="opacity"){if(typeof el.filter=="string"){var fv=parseFloat(el.filter.match(/alpha\(opacity=(.*)\)/i)[1]);if(!isNaN(fv)){return fv?fv/100:0;}}return 1;}else{if(_79=="float"){_79="styleFloat";}}if(!(_7d=_4[_79])){_7d=_4[_79]=_79.replace(_5,_6);}if(v=el.style[_7d]){return v;}if(cs=el.currentStyle){return cs[_7d];}return null;};}(),setStyle:function(_7f,_80){if(typeof _7f=="string"){var _81;if(!(_81=_4[_7f])){_81=_4[_7f]=_7f.replace(_5,_6);}if(name=="opacity"){this.setOpacity(_80);}else{this.dom.style[_81]=_80;}}else{for(var _82 in _7f){if(typeof _7f[_82]!="function"){this.setStyle(_82,_7f[_82]);}}}return this;},applyStyles:function(_83){Ext.DomHelper.applyStyles(this.dom,_83);return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,_85){if(!_85||!A){D.setX(this.dom,x);}else{this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,_87){if(!_87||!A){D.setY(this.dom,y);}else{this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(_88){this.setStyle("left",this.addUnits(_88));return this;},setTop:function(top){this.setStyle("top",this.addUnits(top));return this;},setRight:function(_8a){this.setStyle("right",this.addUnits(_8a));return this;},setBottom:function(_8b){this.setStyle("bottom",this.addUnits(_8b));return this;},setXY:function(pos,_8d){if(!_8d||!A){D.setXY(this.dom,pos);}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion");}return this;},setLocation:function(x,y,_90){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,_93){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(_94){var h=this.dom.offsetHeight||0;return _94!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(_96){var w=this.dom.offsetWidth||0;return _96!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb");}}return h;},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr");}}return w;},getSize:function(_9a){return{width:this.getWidth(_9a),height:this.getHeight(_9a)};},getValue:function(_9b){return _9b?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(_9c){if(typeof _9c=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_9c-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(_9c<0){_9c=0;}}return _9c;},adjustHeight:function(_9d){if(typeof _9d=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_9d-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(_9d<0){_9d=0;}}return _9d;},setWidth:function(_9e,_9f){_9e=this.adjustWidth(_9e);if(!_9f||!A){this.dom.style.width=this.addUnits(_9e);}else{this.anim({width:{to:_9e}},this.preanim(arguments,1));}return this;},setHeight:function(_a0,_a1){_a0=this.adjustHeight(_a0);if(!_a1||!A){this.dom.style.height=this.addUnits(_a0);}else{this.anim({height:{to:_a0}},this.preanim(arguments,1));}return this;},setSize:function(_a2,_a3,_a4){if(typeof _a2=="object"){_a3=_a2.height;_a2=_a2.width;}_a2=this.adjustWidth(_a2);_a3=this.adjustHeight(_a3);if(!_a4||!A){this.dom.style.width=this.addUnits(_a2);this.dom.style.height=this.addUnits(_a3);}else{this.anim({width:{to:_a2},height:{to:_a3}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,_a7,_a8,_a9){if(!_a9||!A){this.setSize(_a7,_a8);this.setLocation(x,y);}else{_a7=this.adjustWidth(_a7);_a8=this.adjustHeight(_a8);this.anim({points:{to:[x,y]},width:{to:_a7},height:{to:_a8}},this.preanim(arguments,4),"motion");}return this;},setRegion:function(_aa,_ab){this.setBounds(_aa.left,_aa.top,_aa.right-_aa.left,_aa.bottom-_aa.top,this.preanim(arguments,1));return this;},addListener:function(_ac,fn,_ae,_af){Ext.EventManager.on(this.dom,_ac,fn,_ae||this,_af);},removeListener:function(_b0,fn){Ext.EventManager.removeListener(this.dom,_b0,fn);return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(_b2,_b3){this.on(_b2,function(e){_b3.fireEvent(_b2,e);});},setOpacity:function(_b5,_b6){if(!_b6||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(_b5==1?"":"alpha(opacity="+_b5*100+")");}else{s.opacity=_b5;}}else{this.anim({opacity:{to:_b5}},this.preanim(arguments,1),null,0.35,"easeIn");}return this;},getLeft:function(_b8){if(!_b8){return this.getX();}else{return parseInt(this.getStyle("left"),10)||0;}},getRight:function(_b9){if(!_b9){return this.getX()+this.getWidth();}else{return(this.getLeft(true)+this.getWidth())||0;}},getTop:function(_ba){if(!_ba){return this.getY();}else{return parseInt(this.getStyle("top"),10)||0;}},getBottom:function(_bb){if(!_bb){return this.getY()+this.getHeight();}else{return(this.getTop(true)+this.getHeight())||0;}},position:function(pos,_bd,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative");}}else{this.setStyle("position",pos);}if(_bd){this.setStyle("z-index",_bd);}if(x!==undefined&&y!==undefined){this.setXY([x,y]);}else{if(x!==undefined){this.setX(x);}else{if(y!==undefined){this.setY(y);}}}},clearPositioning:function(_c0){_c0=_c0||"";this.setStyle({"left":_c0,"right":_c0,"top":_c0,"bottom":_c0,"z-index":"","position":"static"});return this;},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{"position":this.getStyle("position"),"left":l,"right":l?"":this.getStyle("right"),"top":t,"bottom":t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")};},getBorderWidth:function(_c3){return this.addStyles(_c3,El.borders);},getPadding:function(_c4){return this.addStyles(_c4,El.paddings);},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right="";}if(pc.bottom=="auto"){this.dom.style.bottom="";}return this;},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block");}}},setLeftTop:function(_c6,top){this.dom.style.left=this.addUnits(_c6);this.dom.style.top=this.addUnits(top);return this;},move:function(_c8,_c9,_ca){var xy=this.getXY();_c8=_c8.toLowerCase();switch(_c8){case"l":case"left":this.moveTo(xy[0]-_c9,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+_c9,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-_c9,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+_c9,this.preanim(arguments,2));break;}return this;},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={"o":this.getStyle("overflow"),"x":this.getStyle("overflow-x"),"y":this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden");}return this;},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o);}if(o.x){this.setStyle("overflow-x",o.x);}if(o.y){this.setStyle("overflow-y",o.y);}}return this;},getAnchorXY:function(_cd,_ce,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight();}else{w=this.getWidth();h=this.getHeight();}}else{w=s.width;h=s.height;}var x=0,y=0,r=Math.round;switch((_cd||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break;}if(_ce===true){return[x,y];}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top];}var o=this.getXY();return[x+o[0],y+o[1]];},getAlignToXY:function(el,p,o){el=Ext.get(el),d=this.dom;if(!el.dom){throw"Element.alignTo with an element that doesn't exist";}var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl";}else{if(p=="?"){p="tl-bl?";}else{if(p.indexOf("-")==-1){p="tl-"+p;}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p;}p1=m[1],p2=m[2],c=m[3]?true:false;var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var _ed=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var _ee=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var _f0=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;var _f1=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw){x=_ee?r.left-w:dw-w;}if(x<_f0){x=_ee?r.right:_f0;}if((y+h)>dh){y=_ed?r.top-h:dh-h;}if(y<_f1){y=_ed?r.bottom:_f1;}}return[x,y];},alignTo:function(_f2,_f3,_f4,_f5){var xy=this.getAlignToXY(_f2,_f3,_f4);this.setXY(xy,this.preanim(arguments,3));return this;},anchorTo:function(el,_f8,_f9,_fa,_fb){var _fc=function(){this.alignTo(el,_f8,_f9,_fa);};Ext.EventManager.onWindowResize(_fc,this);var tm=typeof _fb;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",_fc,this,{buffer:tm=="number"?_fb:50});}_fc.call(this);},clearOpacity:function(){if(window.ActiveXObject){this.dom.style.filter="";}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]="";}return this;},hide:function(_fe){this.setVisible(false,this.preanim(arguments,0));return this;},show:function(_ff){this.setVisible(true,this.preanim(arguments,0));return this;},addUnits:function(size){if(size===""||size=="auto"||typeof size=="undefined"){return size;}if(typeof size=="number"||!El.unitPattern.test(size)){return size+this.defaultUnit;}return size;},beginMeasure:function(){var el=this.dom;if(el.offsetWidth||el.offsetHeight){return this;}var _102=[];var p=this.dom,b=document.body;while((!el.offsetWidth&&!el.offsetHeight)&&p&&p.tagName&&p!=b){var pe=Ext.get(p);if(pe.getStyle("display")=="none"){_102.push({el:p,visibility:pe.getStyle("visibility")});p.style.visibility="hidden";p.style.display="block";}p=p.parentNode;}this._measureChanged=_102;return this;},endMeasure:function(){var _106=this._measureChanged;if(_106){for(var i=0,len=_106.length;i<len;i++){var r=_106[i];r.el.style.visibility=r.visibility;r.el.style.display="none";}this._measureChanged=null;}return this;},update:function(html,_10b,_10c){if(typeof html=="undefined"){html="";}if(_10b!==true){this.dom.innerHTML=html;if(typeof _10c=="function"){_10c();}return this;}var id=Ext.id();var dom=this.dom;html+="<span id=\""+id+"\"></span>";E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/img;var _111=/\ssrc=([\'\"])(.*?)\1/i;var _112;while(_112=re.exec(html)){var _113=_112[1].match(_111);if(_113&&_113[2]){var s=document.createElement("script");s.src=_113[2];hd.appendChild(s);}else{if(_112[2]&&_112[2].length>0){eval(_112[2]);}}}var el=document.getElementById(id);if(el){el.parentNode.removeChild(el);}if(typeof _10c=="function"){_10c();}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/img,"");return this;},load:function(){var um=this.getUpdateManager();um.update.apply(um,arguments);return this;},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Ext.UpdateManager(this);}return this.updateManager;},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this;},getCenterXY:function(){return this.getAlignToXY(document,"c-c");},center:function(_117){this.alignTo(_117||document,"c-c");return this;},isBorderBox:function(){return _118[this.dom.tagName.toLowerCase()]||Ext.isBorderBox;},getBox:function(_119,_11a){var xy;if(!_11a){xy=this.getXY();}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top];}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!_119){bx={x:xy[0],y:xy[1],width:w,height:h};}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,width:w-(l+r),height:h-(t+b)};}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx;},getFrameWidth:function(_126){return this.getPadding(_126)+this.getBorderWidth(_126);},setBox:function(box,_128,_129){var w=box.width,h=box.height;if((_128&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"));}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this;},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint");},1);return this;},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0};}else{return this.addStyles(side,El.margins);}},addStyles:function(_12e,_12f){var val=0;for(var i=0,len=_12e.length;i<len;i++){var w=parseInt(this.getStyle(_12f[_12e.charAt(i)]),10);if(!isNaN(w)){val+=w;}}return val;},createProxy:function(_134,_135,_136){if(_135){_135=Ext.getDom(_135);}else{_135=document.body;}_134=typeof _134=="object"?_134:{tag:"div",cls:_134};var _137=Ext.DomHelper.append(_135,_134,true);if(_136){_137.setBox(this.getBox());}return _137;},mask:function(){if(this.getStyle("position")=="static"){this.setStyle("position","relative");}if(!this._mask){this._mask=Ext.DomHelper.append(this.dom,{tag:"div",cls:"ext-el-mask"},true);}this.addClass("x-masked");this._mask.setDisplayed(true);return this._mask;},unmask:function(_138){if(this._mask){if(_138===true){this._mask.remove();delete this._mask;}else{this._mask.setDisplayed(false);}}this.removeClass("x-masked");},isMasked:function(){return this._mask&&this._mask.isVisible();},createShim:function(){var _139={tag:"iframe",frameBorder:"no",cls:"yiframe-shim",style:"position:absolute;visibility:hidden;left:0;top:0;overflow:hidden;",src:Ext.SSL_SECURE_URL};var shim=Ext.DomHelper.insertBefore(this.dom,_139,true);shim.setOpacity(0.01);shim.setBox(this.getBox());return shim;},remove:function(){if(this.dom.parentNode){this.dom.parentNode.removeChild(this.dom);}delete El.cache[this.dom.id];},addClassOnOver:function(_13b){this.on("mouseover",function(){Ext.fly(this,"_internal").addClass(_13b);},this.dom);var _13c=function(){Ext.fly(this,"_internal").removeClass(_13b);};this.on("mouseout",_13c,this.dom);return this;},addClassOnFocus:function(_13d){this.on("focus",function(){Ext.fly(this,"_internal").addClass(_13d);},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(_13d);},this.dom);return this;},addClassOnClick:function(_13e){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(_13e);var d=Ext.get(document);var fn=function(){Ext.fly(dom,"_internal").removeClass(_13e);d.removeListener("mouseup",fn);};d.on("mouseup",fn);});return this;},swallowEvent:function(_142,_143){var fn=function(e){e.stopPropagation();if(_143){e.preventDefault();}};if(_142 instanceof Array){for(var i=0,len=_142.length;i<len;i++){this.on(_142[i],fn);}return this;}this.on(_142,fn);return this;},fitToParent:function(_148,_149){var p=Ext.get(_149||this.dom.parentNode);this.setSize(p.getComputedWidth()-p.getFrameWidth("lr"),p.getComputedHeight()-p.getFrameWidth("tb"));if(_148===true){Ext.EventManager.onWindowResize(this.fitToParent.createDelegate(this,[]));}return this;},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling;}return n;},getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling;}return n;},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this;},createChild:function(_14e,_14f,_150){_14e=_14e||{tag:"div"};if(_14f){return Ext.DomHelper.insertBefore(_14f,_14e,_150!==true);}return Ext.DomHelper.append(this.dom,_14e,_150!==true);},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this;},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this;},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this;},insertFirst:function(el,_155){el=el||{};if(typeof el=="object"&&!el.nodeType){return this.createChild(el,this.dom.firstChild,_155);}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.domain.firstChild);return!_155?Ext.get(el):el;}},insertSibling:function(el,_157,_158){_157=_157?_157.toLowerCase():"before";el=el||{};var rt,_15a=_157=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType){if(_157=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!_158);}else{rt=Ext.DomHelper[_157=="after"?"insertAfter":"insertBefore"](this.dom,el,!_158);}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),_157=="before"?this.dom:this.dom.nextSibling);if(!_158){rt=Ext.get(rt);}}return rt;},wrap:function(_15b,_15c){if(!_15b){_15b={tag:"div"};}var _15d=Ext.DomHelper.insertBefore(this.dom,_15b,!_15c);_15d.dom?_15d.dom.appendChild(this.dom):_15d.appendChild(this.dom);return _15d;},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this;},insertHtml:function(_15f,html){return Ext.DomHelper.insertHtml(_15f,this.dom,html);},set:function(o){var el=this.dom;var _163=el.setAttribute?true:false;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue;}if(attr=="cls"){el.className=o["cls"];}else{if(_163){el.setAttribute(attr,o[attr]);}else{el[attr]=o[attr];}}}Ext.DomHelper.applyStyles(el,o.style);return this;},addKeyListener:function(key,fn,_167){var _168;if(typeof key!="object"||key instanceof Array){_168={key:key,fn:fn,scope:_167};}else{_168={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:_167};}return new Ext.KeyMap(this,_168);},addKeyMap:function(_169){return new Ext.KeyMap(this,_169);},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth;},scrollTo:function(side,_16c,_16d){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!_16d||!A){this.dom[prop]=_16c;}else{var to=prop=="scrollLeft"?[_16c,this.dom.scrollTop]:[this.dom.scrollLeft,_16c];this.anim({scroll:{"to":to}},this.preanim(arguments,2),"scroll");}return this;},scroll:function(_170,_171,_172){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;_170=_170.toLowerCase();var _17a=false;var a=this.preanim(arguments,2);switch(_170){case"l":case"left":if(w-l>cw){var v=Math.min(l+_171,w-cw);this.scrollTo("left",v,a);_17a=true;}break;case"r":case"right":if(l>0){var v=Math.max(l-_171,0);this.scrollTo("left",v,a);_17a=true;}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-_171,0);this.scrollTo("top",v,a);_17a=true;}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+_171,h-ch);this.scrollTo("top",v,a);_17a=true;}break;}return _17a;},translatePoints:function(x,y){if(x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return{left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l=window.pageXOffset||doc.documentElement.scrollLeft||doc.body.scrollLeft||0;var t=window.pageYOffset||doc.documentElement.scrollTop||doc.body.scrollTop||0;return{left:l,top:t};}else{return{left:d.scrollLeft,top:d.scrollTop};}},getColor:function(attr,_188,_189){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return _188;}var _18b=typeof _189=="undefined"?"#":_189;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]).toString(16);if(h<16){h="0"+h;}_18b+=h;}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);_18b+=c+c;}}else{if(v.length==7){_18b+=v.slice(1,6);}}}}return(_18b.length>5?_18b.toLowerCase():_188);},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format("<div class=\"{0}\"><div class=\"{0}-tl\"><div class=\"{0}-tr\"><div class=\"{0}-tc\"></div></div></div><div class=\"{0}-ml\"><div class=\"{0}-mr\"><div class=\"{0}-mc\"></div></div></div><div class=\"{0}-bl\"><div class=\"{0}-br\"><div class=\"{0}-bc\"></div></div></div></div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el;},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name];}return d[name];}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name];}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;ep.autoDisplayMode=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var _19a;El.get=function(el){var ex,elm,id;if(!el){return null;}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null;}if(ex=El.cache[el]){ex.dom=elm;}else{ex=El.cache[el]=new El(elm);}return ex;}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el);}if(ex=El.cache[id]){ex.dom=el;}else{ex=El.cache[id]=new El(el);}return ex;}else{if(el instanceof El){if(el!=_19a){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el;}return el;}else{if(el.isComposite){return el;}else{if(el instanceof Array){return El.select(el);}else{if(el==document){if(!_19a){var f=function(){};f.prototype=El.prototype;_19a=new f();_19a.dom=document;}return _19a;}}}}}}return null;};El.Flyweight=function(dom){this.dom=dom;};El.Flyweight.prototype=El.prototype;El._flyweights={};El.fly=function(el,_1a2){_1a2=_1a2||"_global";el=Ext.getDom(el);if(!El._flyweights[_1a2]){El._flyweights[_1a2]=new El.Flyweight();}El._flyweights[_1a2].dom=el;return El._flyweights[_1a2];};Ext.get=El.get;Ext.fly=El.fly;var _118=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){_118["button"]=1;}if(Ext.isGecko&&!Ext.isStrict){_118["textarea"]=0;}var ml;El.measureText=function(el,text,_1a6){if(!ml){ml=new El(document.createElement("div"));document.body.appendChild(ml.dom);ml.position("absolute");ml.setLeftTop(-1000,-1000);ml.hide();}el=Ext.fly(el);ml.setStyle({"font-size":el.getStyle("font-size"),"font-style":el.getStyle("font-style"),"font-weight":el.getStyle("font-weight"),"font-family":el.getStyle("font-family")});if(_1a6){mi.setWidth(_1a6);}ml.update(text);var s=ml.getSize();ml.update("");if(_1a6){mi.setWidth("auto");}return s;};})();Ext.enableFx=true;Ext.Fx={slideIn:function(_1,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_1=_1||"t";this.fixDisplay();var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var _6=this.fxWrap(r.pos,o,"hidden");var st=this.dom.style;st.visibility="visible";st.position="absolute";var _8=function(){el.fxUnwrap(_6,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o);};var a,pt={to:[b.x,b.y]},bw={to:b.width},bh={to:b.height};switch(_1.toLowerCase()){case"t":_6.setSize(b.width,0);st.left=st.bottom="0";a={height:bh};break;case"l":_6.setSize(0,b.height);st.right=st.top="0";a={width:bw};break;case"r":_6.setSize(0,b.height);_6.setX(b.right);st.left=st.top="0";a={width:bw,points:pt};break;case"b":_6.setSize(b.width,0);_6.setY(b.bottom);st.left=st.top="0";a={height:bh,points:pt};break;case"tl":_6.setSize(0,0);st.right=st.bottom="0";a={width:bw,height:bh};break;case"bl":_6.setSize(0,0);_6.setY(b.y+b.height);st.right=st.top="0";a={width:bw,height:bh,points:pt};break;case"br":_6.setSize(0,0);_6.setXY([b.right,b.bottom]);st.left=st.top="0";a={width:bw,height:bh,points:pt};break;case"tr":_6.setSize(0,0);_6.setX(b.x+b.width);st.left=st.bottom="0";a={width:bw,height:bh,points:pt};break;}this.dom.style.visibility="visible";_6.show();arguments.callee.anim=_6.fxanim(a,o,"motion",0.5,"easeOut",_8);});return this;},slideOut:function(_d,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_d=_d||"t";var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var _12=this.fxWrap(r.pos,o,"visible");var st=this.dom.style;st.visibility="visible";st.position="absolute";_12.setSize(b);var _14=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.fxUnwrap(_12,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o);};var a,_16={to:0};switch(_d.toLowerCase()){case"t":st.left=st.bottom="0";a={height:_16};break;case"l":st.right=st.top="0";a={width:_16};break;case"r":st.left=st.top="0";a={width:_16,points:{to:[b.right,b.y]}};break;case"b":st.left=st.top="0";a={height:_16,points:{to:[b.x,b.bottom]}};break;case"tl":st.right=st.bottom="0";a={width:_16,height:_16};break;case"bl":st.right=st.top="0";a={width:_16,height:_16,points:{to:[b.x,b.bottom]}};break;case"br":st.left=st.top="0";a={width:_16,height:_16,points:{to:[b.x+b.width,b.bottom]}};break;case"tr":st.left=st.bottom="0";a={width:_16,height:_16,points:{to:[b.right,b.y]}};break;}arguments.callee.anim=_12.fxanim(a,o,"motion",0.5,"easeOut",_14);});return this;},puff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.show();var r=this.getFxRestore();var st=this.dom.style;var _1b=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;st.fontSize="";el.afterFx(o);};var _1c=this.getWidth();var _1d=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(_1c*2)},height:{to:this.adjustHeight(_1d*2)},points:{by:[-(_1c*0.5),-(_1d*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},o,"motion",0.5,"easeOut",_1b);});return this;},switchOff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.clip();var r=this.getFxRestore();var st=this.dom.style;var _22=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},o,"motion",0.3,"easeIn",_22);}).defer(100,this);});});return this;},highlight:function(_23,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_23=_23||"ffff9c";attr=o.attr||"backgroundColor";this.clearOpacity();this.show();var _26=this.getColor(attr);var _27=this.dom.style[attr];endColor=(o.endColor||_26)||"ffffff";var _28=function(){el.dom.style[attr]=_27;el.afterFx(o);};var a={};a[attr]={from:_23,to:endColor};arguments.callee.anim=this.fxanim(a,o,"color",1,"easeIn",_28);});return this;},frame:function(_2a,_2b,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_2a=_2a||"#C3DAF9";if(_2a.length==6){_2a="#"+_2a;}_2b=_2b||1;duration=o.duration||1;this.show();var b=this.getBox();var _2f=function(){var _30=this.createProxy({tag:"div",style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+_2a}});var _31=Ext.isBorderBox?2:1;_30.animate({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*_31))},width:{from:b.width,to:(b.width+(20*_31))}},duration,function(){_30.remove();});if(--_2b>0){_2f.defer((duration/2)*1000,this);}else{el.afterFx(o);}};_2f.call(this);});return this;},pause:function(_32){var el=this.getFxEl();var o={};el.queueFx(o,function(){setTimeout(function(){el.afterFx(o);},_32*1000);});return this;},fadeIn:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var to=o.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,0.5,"easeOut",function(){if(to==1){this.clearOpacity();}el.afterFx(o);});});return this;},fadeOut:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){arguments.callee.anim=this.fxanim({opacity:{to:o.endOpacity||0}},o,null,0.5,"easeOut",function(){if(this.visibilityMode==Ext.Element.DISPLAY||o.useDisplay){this.dom.style.display="none";}else{this.dom.style.visibility="hidden";}this.clearOpacity();el.afterFx(o);});});return this;},scale:function(w,h,o){this.shift(Ext.apply({},o,{width:w,height:h}));return this;},shift:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){var a={},w=o.width,h=o.height,x=o.x,y=o.y,op=o.opacity;if(w!==undefined){a.width={to:this.adjustWidth(w)};}if(h!==undefined){a.height={to:this.adjustHeight(h)};}if(x!==undefined||y!==undefined){a.points={to:[x!==undefined?x:this.getX(),y!==undefined?y:this.getY()]};}if(op!==undefined){a.opacity={to:op};}if(o.xy!==undefined){a.points={to:o.xy};}arguments.callee.anim=this.fxanim(a,o,"motion",0.35,"easeOut",function(){el.afterFx(o);});});return this;},ghost:function(_45,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_45=_45||"b";var r=this.getFxRestore();var w=this.getWidth(),h=this.getHeight();var st=this.dom.style;var _4c=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);};var a={opacity:{to:0},points:{}},pt=a.points;switch(_45.toLowerCase()){case"t":pt.by=[0,-h];break;case"l":pt.by=[-w,0];break;case"r":pt.by=[w,0];break;case"b":pt.by=[0,h];break;case"tl":pt.by=[-w,-h];break;case"bl":pt.by=[-w,h];break;case"br":pt.by=[w,h];break;case"tr":pt.by=[w,-h];break;}arguments.callee.anim=this.fxanim(a,o,"motion",0.5,"easeOut",_4c);});return this;},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this;},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this;},nextFx:function(){var ef=this.fxQueue[0];if(ef){ef.call(this);}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0];},stopFx:function(){if(this.hasActiveFx()){var cur=this.fxQueue[0];if(cur&&cur.anim&&cur.anim.isAnimated()){this.fxQueue=[cur];cur.anim.stop(true);}}return this;},beforeFx:function(o){if(this.hasActiveFx()&&!o.concurrent){if(o.stopFx){this.stopFx();return true;}return false;}return true;},hasFxBlock:function(){var q=this.fxQueue;return q&&q[0]&&q[0].block;},queueFx:function(o,fn){if(!this.fxQueue){this.fxQueue=[];}if(!this.hasFxBlock()){Ext.applyIf(o,this.fxDefaults);if(!o.concurrent){var run=this.beforeFx(o);fn.block=o.block;this.fxQueue.push(fn);if(run){this.nextFx();}}else{fn.call(this);}}return this;},fxWrap:function(pos,o,vis){var _59;if(!o.wrap||!(_59=Ext.get(o.wrap))){var _5a;if(o.fixPosition){_5a=this.getXY();}var div=document.createElement("div");div.style.visibility=vis;_59=Ext.get(this.dom.parentNode.insertBefore(div,this.dom));_59.setPositioning(pos);if(_59.getStyle("position")=="static"){_59.position("relative");}this.clearPositioning("auto");_59.clip();_59.dom.appendChild(this.dom);if(_5a){_59.setXY(_5a);}}return _59;},fxUnwrap:function(_5c,pos,o){this.clearPositioning();this.setPositioning(pos);if(!o.wrap){_5c.dom.parentNode.insertBefore(this.dom,_5c.dom);_5c.remove();}},getFxRestore:function(){var st=this.dom.style;return{pos:this.getPositioning(),width:st.width,height:st.height};},afterFx:function(o){if(o.afterStyle){this.applyStyles(o.afterStyle);}if(o.remove===true){this.remove();}Ext.callback(o.callback,o.scope,[this]);if(!o.concurrent){this.fxQueue.shift();this.nextFx();}},getFxEl:function(){return Ext.get(this.dom);},fxanim:function(_61,opt,_63,_64,_65,cb){_63=_63||"run";opt=opt||{};var _67=Ext.lib.Anim[_63](this.dom,_61,(opt.duration||_64)||0.35,(opt.easing||_65)||"easeOut",function(){Ext.callback(cb,this);},this);opt.anim=_67;return _67;}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);Ext.CompositeElement=function(_1){this.elements=[];this.addElements(_1);};Ext.CompositeElement.prototype={isComposite:true,addElements:function(_2){if(!_2){return this;}if(typeof _2=="string"){_2=Ext.Element.selectorFunction(_2);}var _3=this.elements;var _4=_3.length-1;for(var i=0,_6=_2.length;i<_6;i++){_3[++_4]=Ext.get(_2[i],true);}return this;},invoke:function(fn,_8){var _9=this.elements;for(var i=0,_b=_9.length;i<_b;i++){Ext.Element.prototype[fn].apply(_9[i],_8);}return this;},add:function(_c){if(typeof _c=="string"){this.addElements(Ext.Element.selectorFunction(string));}else{if(_c.length!==undefined){this.addElements(_c);}else{this.addElements([_c]);}}return this;},each:function(fn,_e){var _f=this.elements;for(var i=0,len=_f.length;i<len;i++){if(fn.call(_e||_f[i],_f[i],this,i)===false){break;}}return this;},item:function(_12){return this.elements[_12];}};(function(){Ext.CompositeElement.createCall=function(_13,_14){if(!_13[_14]){_13[_14]=function(){return this.invoke(_14,arguments);};}};for(var _15 in Ext.Element.prototype){if(typeof Ext.Element.prototype[_15]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,_15);}}})();Ext.CompositeElementLite=function(els){Ext.CompositeElementLite.superclass.constructor.call(this,els);var _17=function(){};_17.prototype=Ext.Element.prototype;this.el=new Ext.Element.Flyweight();};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(els){if(els){if(els instanceof Array){this.elements=this.elements.concat(els);}else{var _19=this.elements;var _1a=_19.length-1;for(var i=0,len=els.length;i<len;i++){_19[++_1a]=els[i];}}}return this;},invoke:function(fn,_1e){var els=this.elements;var el=this.el;for(var i=0,len=els.length;i<len;i++){el.dom=els[i];Ext.Element.prototype[fn].apply(el,_1e);}return this;},item:function(_23){this.el.dom=this.elements[_23];return this.el;},addListener:function(_24,_25,_26,opt){var els=this.elements;for(var i=0,len=els.length;i<len;i++){Ext.EventManager.on(els[i],_24,_25,_26||els[i],opt);}return this;},each:function(fn,_2c){var els=this.elements;var el=this.el;for(var i=0,len=els.length;i<len;i++){el.dom=els[i];if(fn.call(_2c||el,el,this,i)===false){break;}}return this;}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select;}Ext.Element.select=function(_31,_32){var els;if(typeof _31=="string"){els=Ext.Element.selectorFunction(_31);}else{if(_31.length!==undefined){els=_31;}else{throw"Invalid selector";}}if(_32===true){return new Ext.CompositeElement(els);}else{return new Ext.CompositeElementLite(els);}};Ext.select=Ext.Element.select;Ext.UpdateManager=function(el,_2){el=Ext.get(el);if(!_2&&el.updateManager){return el.updateManager;}this.el=el;this.defaultUrl=null;this.events={"beforeupdate":true,"update":true,"failure":true};var d=Ext.UpdateManager.defaults;this.sslBlankUrl=d.sslBlankUrl;this.disableCaching=d.disableCaching;this.indicatorText=d.indicatorText;this.showLoadIndicator=d.showLoadIndicator;this.timeout=d.timeout;this.loadScripts=d.loadScripts;this.transaction=null;this.autoRefreshProcId=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);this.successDelegate=this.processSuccess.createDelegate(this);this.failureDelegate=this.processFailure.createDelegate(this);this.renderer=new Ext.UpdateManager.BasicRenderer();};Ext.extend(Ext.UpdateManager,Ext.util.Observable,{getEl:function(){return this.el;},update:function(_4,_5,_6,_7){if(this.fireEvent("beforeupdate",this.el,_4,_5)!==false){var _8=this.method;if(typeof _4=="object"){var _9=_4;_4=_9.url;_5=_5||_9.params;_6=_6||_9.callback;_7=_7||_9.discardUrl;if(_6&&_9.scope){_6=_6.createDelegate(_9.scope);}if(typeof _9.method!="undefined"){_8=_9.method;}if(typeof _9.nocache!="undefined"){this.disableCaching=_9.nocache;}if(typeof _9.text!="undefined"){this.indicatorText="<div class=\"loading-indicator\">"+_9.text+"</div>";}if(typeof _9.scripts!="undefined"){this.loadScripts=_9.scripts;}if(typeof _9.timeout!="undefined"){this.timeout=_9.timeout;}}this.showLoading();if(!_7){this.defaultUrl=_4;}if(typeof _4=="function"){_4=_4.call(this);}if(typeof _5=="function"){_5=_5();}if(_5&&typeof _5!="string"){var _a=[];for(var _b in _5){if(typeof _5[_b]!="function"){_a.push(encodeURIComponent(_b),"=",encodeURIComponent(_5[_b]),"&");}}delete _a[_a.length-1];_5=_a.join("");}var cb={success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":_4,"form":null,"callback":_6,"params":_5}};_8=_8||(_5?"POST":"GET");if(_8=="GET"){_4=this.prepareUrl(_4);}this.transaction=Ext.lib.Ajax.request(_8,_4,cb,_5);}},formUpdate:function(_d,_e,_f,_10){if(this.fireEvent("beforeupdate",this.el,_d,_e)!==false){formEl=Ext.getDom(_d);if(typeof _e=="function"){_e=_e.call(this);}if(typeof params=="function"){params=params();}_e=_e||formEl.action;var cb={success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":_e,"form":formEl,"callback":_10,"reset":_f}};var _12=false;var _13=formEl.getAttribute("enctype");if(_13&&_13.toLowerCase()=="multipart/form-data"){_12=true;cb.upload=this.successDelegate;}this.transaction=Ext.lib.Ajax.formRequest(_d,_e,cb,null,_12,this.sslBlankUrl);this.showLoading.defer(1,this);}},refresh:function(_14){if(this.defaultUrl==null){return;}this.update(this.defaultUrl,null,_14,true);},startAutoRefresh:function(_15,url,_17,_18,_19){if(_19){this.update(url||this.defaultUrl,_17,_18,true);}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[url||this.defaultUrl,_17,_18,true]),_15*1000);},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId;}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false;},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText);}},prepareUrl:function(url){if(this.disableCaching){var _1b="_dc="+(new Date().getTime());if(url.indexOf("?")!==-1){url+="&"+_1b;}else{url+="?"+_1b;}}return url;},processSuccess:function(_1c){this.transaction=null;if(_1c.argument.form&&_1c.argument.reset){try{_1c.argument.form.reset();}catch(e){}}if(this.loadScripts){this.renderer.render(this.el,_1c,this,this.updateComplete.createDelegate(this,[_1c]));}else{this.renderer.render(this.el,_1c,this);this.updateComplete(_1c);}},updateComplete:function(_1d){this.fireEvent("update",this.el,_1d);if(typeof _1d.argument.callback=="function"){_1d.argument.callback(this.el,true,_1d);}},processFailure:function(_1e){this.transaction=null;this.fireEvent("failure",this.el,_1e);if(typeof _1e.argument.callback=="function"){_1e.argument.callback(this.el,false,_1e);}},setRenderer:function(_1f){this.renderer=_1f;},getRenderer:function(){return this.renderer;},setDefaultUrl:function(_20){this.defaultUrl=_20;},abort:function(){if(this.transaction){Ext.lib.Ajax.abort(this.transaction);}},isUpdating:function(){if(this.transaction){return Ext.lib.Ajax.isCallInProgress(this.transaction);}return false;}});Ext.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:"<div class=\"loading-indicator\">Loading...</div>"};Ext.UpdateManager.updateElement=function(el,url,_23,_24){var um=Ext.get(el,true).getUpdateManager();Ext.apply(um,_24);um.update(url,_23,_24?_24.callback:null);};Ext.UpdateManager.update=Ext.UpdateManager.updateElement;Ext.UpdateManager.BasicRenderer=function(){};Ext.UpdateManager.BasicRenderer.prototype={render:function(el,_27,_28,_29){el.update(_27.responseText,_28.loadScripts,_29);}};Ext.util.DelayedTask=function(fn,_2,_3){var id=null,d,t;var _7=function(){var _8=new Date().getTime();if(_8-t>=d){clearInterval(id);id=null;fn.apply(_2,_3||[]);}};this.delay=function(_9,_a,_b,_c){if(id&&_9!=d){this.cancel();}d=_9;t=new Date().getTime();fn=_a||fn;_2=_b||_2;_3=_c||_3;if(!id){id=setInterval(_7,d);}};this.cancel=function(){if(id){clearInterval(id);id=null;}};};

Ext.util.CSS=function(){var rules=null;var doc=document;var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf("-")>-1){property=convert(property);}
return property;};return{createStyleSheet:function(cssText){var ss;if(Ext.isIE){ss=doc.createStyleSheet();ss.cssText=cssText;}else{var head=doc.getElementsByTagName("head")[0];var rules=doc.createElement("style");rules.setAttribute("type","text/css");try{rules.appendChild(doc.createTextNode(cssText));}catch(e){rules.cssText=cssText;}
head.appendChild(rules);ss=rules.styleSheet?rules.styleSheet:(rules.sheet||doc.styleSheets[doc.styleSheets.length-1]);}
this.cacheStyleSheet(ss);return ss;},removeStyleSheet:function(id){var existing=doc.getElementById(id);if(existing){existing.parentNode.removeChild(existing);}},swapStyleSheet:function(id,url){this.removeStyleSheet(id);var ss=doc.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",url);doc.getElementsByTagName("head")[0].appendChild(ss);},refreshCache:function(){return this.getRules(true);},cacheStyleSheet:function(ss){if(!rules){rules={};}
try{var ssRules=ss.cssRules||ss.rules;for(var j=ssRules.length-1;j>=0;--j){rules[ssRules[j].selectorText]=ssRules[j];}}catch(e){}},getRules:function(refreshCache){if(rules==null||refreshCache){rules={};var ds=doc.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{this.cacheStyleSheet(ds[i]);}catch(e){}}}
return rules;},getRule:function(selector,refreshCache){var rs=this.getRules(refreshCache);if(!(selector instanceof Array)){return rs[selector];}
for(var i=0;i<selector.length;i++){if(rs[selector[i]]){return rs[selector[i]];}}
return null;},updateRule:function(selector,property,value){if(!(selector instanceof Array)){var rule=this.getRule(selector);if(rule){rule.style[toCamel(property)]=value;return true;}}else{for(var i=0;i<selector.length;i++){if(this.updateRule(selector[i],property,value)){return true;}}}
return false;},apply:function(el,selector){if(!(selector instanceof Array)){var rule=this.getRule(selector);if(rule){var s=rule.style;for(var key in s){if(typeof s[key]!="function"){if(s[key]&&String(s[key]).indexOf(":")<0&&s[key]!="false"){try{el.style[key]=s[key];}catch(e){}}}}
return true;}}else{for(var i=0;i<selector.length;i++){if(this.apply(el,selector[i])){return true;}}}
return false;},applyFirst:function(el,id,selector){var selectors=["#"+id+" "+selector,selector];return this.apply(el,selectors);},revert:function(el,selector){if(!(selector instanceof Array)){var rule=this.getRule(selector);if(rule){for(key in rule.style){if(rule.style[key]&&String(rule.style[key]).indexOf(":")<0&&rule.style[key]!="false"){try{el.style[key]="";}catch(e){}}}
return true;}}else{for(var i=0;i<selector.length;i++){if(this.revert(el,selector[i])){return true;}}}
return false;},revertFirst:function(el,id,selector){var selectors=["#"+id+" "+selector,selector];return this.revert(el,selectors);}};}();

Ext.KeyNav=function(el,config){this.el=Ext.get(el);Ext.apply(this,config);if(!this.disabled){this.disabled=true;this.enable();}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",prepareEvent:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(Ext.isSafari&&h&&k>=37&&k<=40){e.stopEvent();}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]();}}},doRelay:function(e,h,hname){return h.call(this.scope||this,e);},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(Ext.isIE){this.el.on("keydown",this.relay,this);}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this);}
this.disabled=false;}},disable:function(){if(!this.disabled){if(Ext.isIE){this.el.un("keydown",this.relay);}else{this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay);}
this.disabled=true;}}};

Ext.KeyMap=function(el,config,eventName){this.el=Ext.get(el);this.eventName=eventName||"keydown";this.bindings=[];if(config instanceof Array){for(var i=0,len=config.length;i<len;i++){this.addBinding(config[i]);}}else{this.addBinding(config);}
this.keyDownDelegate=Ext.EventManager.wrap(this.handleKeyDown,this,true);this.enable();};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(config){var keyCode=config.key,shift=config.shift,ctrl=config.ctrl,alt=config.alt,fn=config.fn,scope=config.scope;if(typeof keyCode=="string"){var ks=[];var keyString=keyCode.toUpperCase();for(var j=0,len=keyString.length;j<len;j++){ks.push(keyString.charCodeAt(j));}
keyCode=ks;}
var keyArray=keyCode instanceof Array;var handler=function(e){if((!shift||e.shiftKey)&&(!ctrl||e.ctrlKey)&&(!alt||e.altKey)){var k=e.getKey();if(keyArray){for(var i=0,len=keyCode.length;i<len;i++){if(keyCode[i]==k){if(this.stopEvent){e.stopEvent();}
fn.call(scope||window,k,e);return;}}}else{if(k==keyCode){if(this.stopEvent){e.stopEvent();}
fn.call(scope||window,k,e);}}}};this.bindings.push(handler);},handleKeyDown:function(e){if(this.enabled){var b=this.bindings;for(var i=0,len=b.length;i<len;i++){b[i].call(this,e);}}},isEnabled:function(){return this.enabled;},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.keyDownDelegate);this.enabled=true;}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.keyDownDelegate);this.enabled=false;}}};

Ext.util.MixedCollection=function(allowFunctions,keyFn){this.items=[];this.map={};this.keys=[];this.length=0;this.events={"clear":true,"add":true,"replace":true,"remove":true,"sort":true};this.allowFunctions=allowFunctions===true;if(keyFn){this.getKey=keyFn;}};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(key,o){if(arguments.length==1){o=arguments[0];key=this.getKey(o);}
if(typeof key=="undefined"||key===null){this.length++;this.items.push(o);this.keys.push(null);}else{var old=this.map[key];if(old){return this.replace(key,o);}
this.length++;this.items.push(o);this.map[key]=o;this.keys.push(key);}
this.fireEvent("add",this.length-1,o,key);return o;},getKey:function(o){return o.id;},replace:function(key,o){if(arguments.length==1){o=arguments[0];key=this.getKey(o);}
var old=this.item(key);if(typeof key=="undefined"||key===null||typeof old=="undefined"){return this.add(key,o);}
var index=this.indexOfKey(key);this.items[index]=o;this.map[key]=o;this.fireEvent("replace",key,old,o);return o;},addAll:function(objs){if(arguments.length>1||objs instanceof Array){var args=arguments.length>1?arguments:objs;for(var i=0,len=args.length;i<len;i++){this.add(args[i]);}}else{for(var key in objs){if(this.allowFunctions||typeof objs[key]!="function"){this.add(objs[key],key);}}}},each:function(fn,scope){var items=[].concat(this.items);for(var i=0,len=items.length;i<len;i++){if(fn.call(scope||items[i],items[i])===false){break;}}},eachKey:function(fn,scope){for(var i=0,len=this.keys.length;i<len;i++){fn.call(scope||window,this.keys[i],this.items[i]);}},find:function(fn,scope){for(var i=0,len=this.items.length;i<len;i++){if(fn.call(scope||window,this.items[i],this.keys[i])){return this.items[i];}}
return null;},insert:function(index,key,o){if(arguments.length==2){o=arguments[1];key=this.getKey(o);}
if(index>=this.length){return this.add(key,o);}
this.length++;this.items.splice(index,0,o);if(typeof key!="undefined"&&key!=null){this.map[key]=o;}
this.keys.splice(index,0,key);this.fireEvent("add",index,o,key);return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(index){if(index<this.length&&index>=0){this.length--;var o=this.items[index];this.items.splice(index,1);var key=this.keys[index];if(typeof key!="undefined"){delete this.map[key];}
this.keys.splice(index,1);this.fireEvent("remove",o,key);}},removeKey:function(key){return this.removeAt(this.indexOfKey(key));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,len=this.items.length;i<len;i++){if(this.items[i]==o)return i;}
return-1;}else{return this.items.indexOf(o);}},indexOfKey:function(key){if(!this.keys.indexOf){for(var i=0,len=this.keys.length;i<len;i++){if(this.keys[i]==key)return i;}
return-1;}else{return this.keys.indexOf(key);}},item:function(key){return typeof this.map[key]!="undefined"?this.map[key]:this.items[key];},itemAt:function(index){return this.items[index];},key:function(key){return this.map[key];},contains:function(o){return this.indexOf(o)!=-1;},containsKey:function(key){return typeof this.map[key]!="undefined";},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear");},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},_sort:function(property,dir,fn){var dsc=String(dir).toUpperCase()=="DESC"?-1:1;fn=fn||function(a,b){return a-b;};var c=[],k=this.keys,items=this.items;for(var i=0,len=items.length;i<len;i++){c[c.length]={key:k[i],value:items[i],index:i};}
c.sort(function(a,b){var v=fn(a[property],b[property])*dsc;if(v==0){v=(a.index<b.index?-1:1);}
return v;});for(var i=0,len=c.length;i<len;i++){items[i]=c[i].value;k[i]=c[i].key;}
this.fireEvent("sort",this);},sort:function(dir,fn){this._sort("value",dir,fn);},keySort:function(dir,fn){this._sort("key",dir,fn||function(a,b){return String(a).toUpperCase()-String(b).toUpperCase();});},getRange:function(start,end){var items=this.items;if(items.length<1){return[];}
if(start>=items.length)
return[];start=start||0;end=Math.min(typeof end=="undefined"?this.length-1:end,this.length-1);var r=[];if(start<=end){for(var i=start;i<=end;i++){r[r.length]=items[i];}}else{for(var i=start;i>=end;i--){r[r.length]=items[i];}}
return r;},filter:function(property,value){if(!value.exec){value=String(value);if(value.length==0){return this.clone();}
value=new RegExp("^"+Ext.escapeRe(value),"i");}
return this.filterBy(function(o){return o&&value.test(o[property]);});},filterBy:function(fn,scope){var r=new Ext.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,len=it.length;i<len;i++){if(fn.call(scope||this,it[i],k[i])){r.add(k[i],it[i]);}}
return r;},clone:function(){var r=new Ext.util.MixedCollection();var k=this.keys,it=this.items;for(var i=0,len=it.length;i<len;i++){r.add(k[i],it[i]);}
r.getKey=this.getKey;return r;}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;

Ext.util.JSON=new(function(){var useHasOwn={}.hasOwnProperty?true:false;var pad=function(n){return n<10?"0"+n:n;};var m={"\b":'\\b',"\t":'\\t',"\n":'\\n',"\f":'\\f',"\r":'\\r','"':'\\"',"\\":'\\\\'};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return"\\u00"+
Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"';}
return'"'+s+'"';};var encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(',');}
a.push(v===null?"null":Ext.util.JSON.encode(v));b=true;}}
a.push("]");return a.join("");};var encodeDate=function(o){return'"'+o.getFullYear()+"-"+
pad(o.getMonth()+1)+"-"+
pad(o.getDate())+"T"+
pad(o.getHours())+":"+
pad(o.getMinutes())+":"+
pad(o.getSeconds())+'"';};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null";}else if(o instanceof Array){return encodeArray(o);}else if(o instanceof Date){return encodeDate(o);}else if(typeof o=="string"){return encodeString(o);}else if(typeof o=="number"){return isFinite(o)?String(o):"null";}else if(typeof o=="boolean"){return String(o);}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(',');}
a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true;}}}
a.push("}");return a.join("");}};this.decode=function(json){return eval("("+json+')');};})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;

Ext.util.Format=function(){var trimRe=/^\s*(.*)\s*$/;return{ellipsis:function(value,len){if(value&&value.length>len){return value.substr(0,len-3)+"...";}
return value;},undef:function(value){return typeof value!="undefined"?value:"";},htmlEncode:function(value){return!value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;");},trim:function(value){return String(value).replace(trimRe,"$1");},substr:function(value,start,length){return String(value).substr(start,length);},lowercase:function(value){return String(value).toLowerCase();},uppercase:function(value){return String(value).toUpperCase();},capitalize:function(value){return!value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args);}else{return eval(fn).call(window,value);}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);return"$"+v;},date:function(v,format){if(!v){return"";}
if(!(v instanceof Date)){v=new Date(Date.parse(v));}
return v.dateFormat(format||"m/d/Y");},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return!v?v:String(v).replace(this.stripTagsRE,"");}};}();

Ext.util.DelayedTask=function(fn,scope,args){var id=null,d,t;var call=function(){var now=new Date().getTime();if(now-t>=d){clearInterval(id);id=null;fn.apply(scope,args||[]);}};this.delay=function(delay,newFn,newScope,newArgs){if(id&&delay!=d){this.cancel();}
d=delay;t=new Date().getTime();fn=newFn||fn;scope=newScope||scope;args=newArgs||args;if(!id){id=setInterval(call,d);}};this.cancel=function(){if(id){clearInterval(id);id=null;}};};

Ext.data.Connection=function(config){Ext.apply(this,config);this.events={"beforerequest":true,"requestcomplete":true,"requestexception":true};};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,request:function(options){if(this.fireEvent("beforerequest",this,options)!==false){var p=options.params;if(typeof p=="object"){p=Ext.urlEncode(Ext.apply(options.params,this.extraParams));}
var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:options},timeout:this.timeout};var method=options.method||this.method||(p?"POST":"GET");var url=options.url||this.url;if(this.autoAbort!==false){this.abort();}
if(method=='GET'&&p){url+=(url.indexOf('?')!=-1?'&':'?')+p;p='';}
this.transId=Ext.lib.Ajax.request(method,url,cb,p);}else{if(typeof options.callback=="function"){options.callback.call(options.scope||window,options,null,null);}}},isLoading:function(){return this.transId?true:false;},abort:function(){if(this.isLoading()){Ext.lib.Ajax.abort(this.transId);}},handleResponse:function(response){this.transId=false;var options=response.argument.options;this.fireEvent("requestcomplete",this,response,options);if(typeof options.callback=="function"){options.callback.call(options.scope||window,options,true,response);}},handleFailure:function(response,e){this.transId=false;var options=response.argument.options;this.fireEvent("requestexception",this,response,options,e);if(typeof options.callback=="function"){options.callback.call(options.scope||window,options,false,response);}}});

Ext.data.Field=function(config){if(typeof config=="string"){config={name:config};}
Ext.apply(this,config);if(!this.type){this.type="auto";}
var st=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=st[this.sortType];}
if(!this.sortType){switch(this.type){case"string":this.sortType=st.asUCString;break;case"date":this.sortType=st.asDate;break;default:this.sortType=st.none;}}
if(!this.convert){var cv,dateFormat=this.dateFormat;switch(this.type){case"":case"auto":case undefined:cv=function(v){return v;};break;case"string":cv=function(v){return String(v);};break;case"int":cv=function(v){return parseInt(String(v).replace(/[\$,%]/g,""),10);};break;case"float":cv=function(v){return parseFloat(String(v).replace(/[\$,%]/g,""));};break;case"bool":case"boolean":cv=function(v){return v===true||v==="true"||v==1;};break;case"date":cv=function(v){if(!v){return null;}
if(v instanceof Date){return v;}
if(dateFormat){if(dateFormat=="timestamp"){return new Date(v*1000);}
return Date.parseDate(v,dateFormat);}
var parsed=Date.parse(v);return parsed?new Date(parsed):null;};break;}
this.convert=cv;}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};

Ext.data.DataProxy=function(){this.events={beforeload:true,load:true,loadexception:true};};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);

Ext.data.DataReader=function(meta,recordType){this.meta=meta;this.recordType=recordType instanceof Array?Ext.data.Record.create(recordType):recordType;};Ext.data.DataReader.prototype={};

Ext.data.MemoryProxy=function(data){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=data;};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(params,reader,callback,scope,arg){params=params||{};var result;try{result=reader.readRecords(this.data);}catch(e){this.fireEvent("loadexception",this,arg,null,e);callback.call(scope,null,arg,false);return;}
callback.call(scope,result,arg,true);},update:function(params,records){}});

Ext.data.HttpProxy=function(conn){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=conn.events?conn:new Ext.data.Connection(conn);};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.conn;},load:function(params,reader,callback,scope,arg){if(this.fireEvent("beforeload",this,params)!==false){this.conn.request({params:params||{},request:{callback:callback,scope:scope,arg:arg},reader:reader,callback:this.loadResponse,scope:this});}else{callback.call(scope||this,null,arg,false);}},loadResponse:function(o,success,response){if(!success){this.fireEvent("loadexception",this,o,response);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}
var result;try{result=o.reader.read(response);}catch(e){this.fireEvent("loadexception",this,o,response,e);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}
o.request.callback.call(o.request.scope,result,o.request.arg,true);},update:function(dataSet){},updateResponse:function(dataSet){}});

Ext.data.JsonReader=function(meta,recordType){Ext.data.JsonReader.superclass.constructor.call(this,meta,recordType);};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(response){var json=response.responseText;var o=eval("("+json+")");if(!o){throw{message:"JsonReader.read: Json object not found"};}
return this.readRecords(o);},readRecords:function(o){this.jsonData=o;var s=this.meta;var sid=s.id;var recordType=this.recordType,fields=recordType.prototype.fields;var totalRecords=0;if(s.totalProperty){var v=parseInt(eval("o."+s.totalProperty),10);if(!isNaN(v)){totalRecords=v;}}
var records=[];var root=s.root?eval("o."+s.root):o;for(var i=0;i<root.length;i++){var n=root[i];var values={};var id=(n[sid]!==undefined&&n[sid]!==""?n[sid]:null);for(var j=0,jlen=fields.length;j<jlen;j++){var f=fields.items[j];var map=f.mapping||f.name;var v=n[map]!==undefined?n[map]:f.defaultValue;v=f.convert(v);values[f.name]=v;}
var record=new recordType(values,id);record.json=n;records[records.length]=record;}
return{records:records,totalRecords:totalRecords||records.length};}});

Ext.data.Record=function(data,id){this.id=(id||id===0)?id:++Ext.data.Record.AUTO_ID;this.data=data;};Ext.data.Record.create=function(o){var f=function(){f.superclass.constructor.apply(this,arguments);};Ext.extend(f,Ext.data.Record);var p=f.prototype;p.fields=new Ext.util.MixedCollection(false,function(field){return field.name;});for(var i=0,len=o.length;i<len;i++){p.fields.add(new Ext.data.Field(o[i]));}
f.getField=function(name){return p.fields.get(name);};return f;};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT='edit';Ext.data.Record.REJECT='reject';Ext.data.Record.COMMIT='commit';Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(store){this.store=store;},set:function(name,value){if(this.data[name]==value){return;}
this.dirty=true;if(!this.modified){this.modified={};}
if(typeof this.modified[name]=='undefined'){this.modified[name]=this.data[name];}
this.data[name]=value;if(!this.editing){this.store.afterEdit(this);}},get:function(name){return this.data[name];},beginEdit:function(){this.editing=true;this.modified={};},cancelEdit:function(){this.editing=false;delete this.modified;},endEdit:function(){this.editing=false;if(this.dirty){this.store.afterEdit(this);}},reject:function(){var m=this.modified;for(var n in m){if(typeof m[n]!="function"){this.data[n]=m[n];}}
this.dirty=false;delete this.modified;this.editing=false;this.store.afterReject(this);},commit:function(){this.dirty=false;delete this.modified;this.editing=false;this.store.afterCommit(this);},hasError:function(){return this.error!=null;},clearError:function(){this.error=null;}};

Ext.data.SortTypes={none:function(s){return s;},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();},asDate:function(s){if(s instanceof Date){return s.getTime();}
return Date.parse(String(s));},asFloat:function(s){var val=parseFloat(String(s).replace(/,/g,""));if(isNaN(val))val=0;return val;},asInt:function(s){var val=parseInt(String(s).replace(/,/g,""));if(isNaN(val))val=0;return val;}};

Ext.data.Store=function(config){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(o){return o.id;};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir"};Ext.apply(this,config);if(this.reader&&!this.recordType){this.recordType=this.reader.recordType;}
this.fields=this.recordType.prototype.fields;this.modified=[];this.events={datachanged:true,add:true,remove:true,update:true,clear:true,beforeload:true,load:true,loadexception:true};if(this.proxy){this.relayEvents(this.proxy,["loadexception"]);}
this.sortToggle={};};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,lastOptions:null,add:function(records){records=[].concat(records);for(var i=0,len=records.length;i<len;i++){records[i].join(this);}
var index=this.data.length;this.data.addAll(records);this.fireEvent("add",this,records,index);},remove:function(record){var index=this.data.indexOf(record);this.data.removeAt(index);this.fireEvent("remove",this,record,index);},removeAll:function(){this.data.clear();this.fireEvent("clear",this);},insert:function(index,records){records=[].concat(records);for(var i=0,len=records.length;i<len;i++){this.data.insert(index,records[i]);records[i].join(this);}
this.fireEvent("add",this,records,index);},indexOf:function(record){return this.data.indexOf(record);},indexOfId:function(id){return this.data.indexOfKey(id);},getById:function(id){return this.data.key(id);},getAt:function(index){return this.data.itemAt(index);},getRange:function(start,end){return this.data.getRange(start,end);},storeOptions:function(o){o=Ext.apply({},o);delete o.callback;delete o.scope;this.lastOptions=o;},load:function(options){options=options||{};if(this.fireEvent("beforeload",this,options)!==false){this.storeOptions(options);var p=Ext.apply(options.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn["sort"]]=this.sortInfo.field;p[pn["dir"]]=this.sortInfo.direction;}
this.proxy.load(p,this.reader,this.loadRecords,this,options);}},reload:function(options){this.load(Ext.applyIf(options||{},this.lastOptions));},loadRecords:function(o,options,success){if(!o||!success){if(success){this.fireEvent("load",this,[],options);}
if(options.callback){options.callback.call(options.scope||this,[],options,false);}
return;}
var r=o.records,t=o.totalRecords||r.length;for(var i=0,len=r.length;i<len;i++){r[i].join(this);}
if(options.add!==true){this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else{var index=this.data.length;this.data.addAll(r);this.totalLength=Math.max(t,this.data.length);if(r.length>0)
this.fireEvent("add",this,r,index);}
this.fireEvent("load",this,r,options);if(options.callback){options.callback.call(options.scope||this,r,options,true);}},loadData:function(o,append){var r=this.reader.readRecords(o);this.loadRecords(r,{add:append},true);},getCount:function(){return this.data.length||0;},getTotalCount:function(){return this.totalLength||0;},getSortState:function(){return this.sortInfo;},applySort:function(){if(this.sortInfo&&!this.remoteSort){var s=this.sortInfo,f=s.field;var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0);};this.data.sort(s.direction,fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(s.direction,fn);}}},setDefaultSort:function(field,dir){this.sortInfo={field:field,direction:dir?dir.toUpperCase():"ASC"};},sort:function(fieldName,dir){var f=this.fields.get(fieldName);if(!dir){if(this.sortInfo&&this.sortInfo.field==f.name){dir=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC");}else{dir=f.sortDir;}}
this.sortToggle[f.name]=dir;this.sortInfo={field:f.name,direction:dir};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this);}else{this.load(this.lastOptions);}},each:function(fn,scope){this.data.each(fn,scope);},getModifiedRecords:function(){return this.modified;},filter:function(property,value){if(!value.exec){value=String(value);if(value.length==0){return this.clearFilter();}
value=new RegExp("^"+Ext.escapeRe(value),"i");}
this.filterBy(function(r){return value.test(r.data[property]);});},filterBy:function(fn,scope){var data=this.snapshot||this.data;this.snapshot=data;this.data=data.filterBy(fn,scope);this.fireEvent("datachanged",this);},clearFilter:function(){if(this.snapshot&&this.snapshot!=this.data){this.data=this.snapshot;delete this.snapshot;this.fireEvent("datachanged",this);}},afterEdit:function(record){if(this.modified.indexOf(record)==-1){this.modified.push(record);}
this.fireEvent("update",this,record,Ext.data.Record.EDIT);},afterReject:function(record){this.modified.remove(record);this.fireEvent("update",this,record,Ext.data.Record.REJECT);},afterCommit:function(record){this.modified.remove(record);this.fireEvent("update",this,record,Ext.data.Record.COMMIT);},commitChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].commit();}},rejectChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].reject();}}});

Ext.SplitBar=function(dragElement,resizingElement,orientation,placement,existingProxy){this.el=Ext.get(dragElement,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(resizingElement,true);this.orientation=orientation||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!existingProxy){this.proxy=Ext.SplitBar.createProxy(this.orientation);}else{this.proxy=Ext.get(existingProxy).dom;}
this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=placement||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h");}else{this.placement=placement||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v");}
this.events={"resize":true,"moved":true,"beforeresize":true};};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(x,y){this.fireEvent("beforeresize",this);if(!this.overlay){var o=Ext.DomHelper.insertFirst(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);o.unselectable();o.enableDisplayMode("block");Ext.SplitBar.prototype.overlay=o;}
this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var size=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();;this.activeMaxSize=this.getMaximumSize();;var c1=size-this.activeMinSize;var c2=Math.max(this.activeMaxSize-size,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?c1:c2,this.placement==Ext.SplitBar.LEFT?c2:c1);this.dd.setYConstraint(0,0);}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?c1:c2,this.placement==Ext.SplitBar.TOP?c2:c1);}
this.dragSpecs.startSize=size;this.dragSpecs.startPoint=[x,y];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);},onEndProxyDrag:function(e){Ext.get(this.proxy).setDisplayed(false);var endPoint=Ext.lib.Event.getXY(e);if(this.overlay){this.overlay.hide();}
var newSize;if(this.orientation==Ext.SplitBar.HORIZONTAL){newSize=this.dragSpecs.startSize+
(this.placement==Ext.SplitBar.LEFT?endPoint[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-endPoint[0]);}else{newSize=this.dragSpecs.startSize+
(this.placement==Ext.SplitBar.TOP?endPoint[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-endPoint[1]);}
newSize=Math.min(Math.max(newSize,this.activeMinSize),this.activeMaxSize);if(newSize!=this.dragSpecs.startSize){this.adapter.setElementSize(this,newSize);this.fireEvent("moved",this,newSize);this.fireEvent("resize",this,newSize);}},getAdapter:function(){return this.adapter;},setAdapter:function(adapter){this.adapter=adapter;this.adapter.init(this);},getMinimumSize:function(){return this.minSize;},setMinimumSize:function(minSize){this.minSize=minSize;},getMaximumSize:function(){return this.maxSize;},setMaximumSize:function(maxSize){this.maxSize=maxSize;},setCurrentSize:function(size){var oldAnimate=this.animate;this.animate=false;this.adapter.setElementSize(this,size);this.animate=oldAnimate;},destroy:function(removeEl){if(this.shim){this.shim.remove();}
this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(removeEl){this.el.remove();}}});Ext.SplitBar.createProxy=function(dir){var proxy=new Ext.Element(document.createElement("div"));proxy.unselectable();var cls='x-splitbar-proxy';proxy.addClass(cls+' '+(dir==Ext.SplitBar.HORIZONTAL?cls+'-h':cls+'-v'));document.body.appendChild(proxy.dom);return proxy.dom;};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Ext.SplitBar.HORIZONTAL){return s.resizingEl.getWidth();}else{return s.resizingEl.getHeight();}},setElementSize:function(s,newSize,onComplete){if(s.orientation==Ext.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(newSize);if(onComplete){onComplete(s,newSize);}}else{s.resizingEl.setWidth(newSize,true,.1,onComplete,'easeOut');}}else{if(!s.animate){s.resizingEl.setHeight(newSize);if(onComplete){onComplete(s,newSize);}}else{s.resizingEl.setHeight(newSize,true,.1,onComplete,'easeOut');}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(container){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(container);};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s);},getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,newSize,onComplete){this.basic.setElementSize(s,newSize,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var yes=Ext.SplitBar;switch(s.placement){case yes.LEFT:s.el.setX(s.resizingEl.getRight());break;case yes.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case yes.TOP:s.el.setY(s.resizingEl.getBottom());break;case yes.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;

Ext.state.Provider=function(){Ext.state.Provider.superclass.constructor.call(this);this.events={"statechange":true};this.state={};};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(name,defaultValue){return typeof this.state[name]=="undefined"?defaultValue:this.state[name];},clear:function(name){delete this.state[name];this.fireEvent("statechange",this,name,null);},set:function(name,value){this.state[name]=value;this.fireEvent("statechange",this,name,value);},decodeValue:function(cookie){var re=/^(a|n|d|b|s|o)\:(.*)$/;var matches=re.exec(unescape(cookie));if(!matches||!matches[1])return;var type=matches[1];var v=matches[2];switch(type){case"n":return parseFloat(v);case"d":return new Date(Date.parse(v));case"b":return(v=="1");case"a":var all=[];var values=v.split("^");for(var i=0,len=values.length;i<len;i++){all.push(this.decodeValue(values[i]));}
return all;case"o":var all={};var values=v.split("^");for(var i=0,len=values.length;i<len;i++){var kv=values[i].split("=");all[kv[0]]=this.decodeValue(kv[1]);}
return all;default:return v;}},encodeValue:function(v){var enc;if(typeof v=="number"){enc="n:"+v;}else if(typeof v=="boolean"){enc="b:"+(v?"1":"0");}else if(v instanceof Date){enc="d:"+v.toGMTString();}else if(v instanceof Array){var flat="";for(var i=0,len=v.length;i<len;i++){flat+=this.encodeValue(v[i]);if(i!=len-1)flat+="^";}
enc="a:"+flat;}else if(typeof v=="object"){var flat="";for(var key in v){if(typeof v[key]!="function"){flat+=key+"="+this.encodeValue(v[key])+"^";}}
enc="o:"+flat.substring(0,flat.length-1);}else{enc="s:"+v;}
return escape(enc);}});Ext.state.Manager=function(){var provider=new Ext.state.Provider();return{setProvider:function(stateProvider){provider=stateProvider;},get:function(key,defaultValue){return provider.get(key,defaultValue);},set:function(key,value){provider.set(key,value);},clear:function(key){provider.clear(key);},getProvider:function(){return provider;}};}();Ext.state.CookieProvider=function(config){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,config);this.state=this.readCookies();};Ext.extend(Ext.state.CookieProvider,Ext.state.Provider,{set:function(name,value){if(typeof value=="undefined"||value===null){this.clear(name);return;}
this.setCookie(name,value);Ext.state.CookieProvider.superclass.set.call(this,name,value);},clear:function(name){this.clearCookie(name);Ext.state.CookieProvider.superclass.clear.call(this,name);},readCookies:function(){var cookies={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var matches;while((matches=re.exec(c))!=null){var name=matches[1];var value=matches[2];if(name&&name.substring(0,3)=="ys-"){cookies[name.substr(3)]=this.decodeValue(value);}}
return cookies;},setCookie:function(name,value){document.cookie="ys-"+name+"="+this.encodeValue(value)+
((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+
((this.path==null)?"":("; path="+this.path))+
((this.domain==null)?"":("; domain="+this.domain))+
((this.secure==true)?"; secure":"");},clearCookie:function(name){document.cookie="ys-"+name+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+
((this.path==null)?"":("; path="+this.path))+
((this.domain==null)?"":("; domain="+this.domain))+
((this.secure==true)?"; secure":"");}});

(function(){Ext.Layer=function(config,existingEl){config=config||{};var dh=Ext.DomHelper;var cp=config.parentEl,pel=cp?Ext.getDom(cp):document.body;if(existingEl){this.dom=Ext.getDom(existingEl);}
if(!this.dom){var o=config.dh||{tag:"div",cls:"x-layer"};this.dom=dh.append(pel,o);}
if(config.cls){this.addClass(config.cls);}
this.constrain=config.constrain!==false;this.visibilityMode=Ext.Element.VISIBILITY;if(config.id){this.id=this.dom.id=config.id;}else{this.id=Ext.id(this.dom);}
var zindex=(config.zindex||parseInt(this.getStyle("z-index"),10))||11000;this.position("absolute",zindex);if(config.shadow){this.shadowOffset=config.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:config.shadow});}else{this.shadowOffset=0;}
if(config.shim!==false&&Ext.useShims){this.shim=this.createShim();this.shim.setOpacity(0);this.shim.position("absolute",zindex-2);}
this.useDisplay=config.useDisplay;this.hide();};var supr=Ext.Element.prototype;Ext.extend(Ext.Layer,Ext.Element,{sync:function(doShow){var sw=this.shadow,sh=this.shim;if(this.isVisible()&&(sw||sh)){var w=this.getWidth(),h=this.getHeight();var l=this.getLeft(true),t=this.getTop(true);if(sw){if(doShow&&!sw.isVisible()){sw.show(this);}else{sw.realign(l,t,w,h);}
if(sh){if(doShow){sh.show();}
var a=sw.adjusts,s=sh.dom.style;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";s.width=(w+a.w)+"px";s.height=(h+a.h)+"px";}}else if(sh){if(doShow){sh.show();}
sh.setSize(w,h);sh.setLeftTop(l,t);}}},hideUnders:function(negOffset){if(this.shadow){this.shadow.hide();}
if(this.shim){this.shim.hide();if(negOffset){this.shim.setLeftTop(-10000,-10000);}}},constrainXY:function(){if(this.constrain){var vw=Ext.lib.Dom.getViewWidth(),vh=Ext.lib.Dom.getViewHeight();var s=Ext.get(document).getScroll();xy=this.getXY();var x=xy[0],y=xy[1];var w=this.dom.offsetWidth+this.shadowOffset,h=this.dom.offsetHeight+this.shadowOffset;var moved=false;if((x+w)>vw+s.left){x=vw-w-this.shadowOffset;moved=true;}
if((y+h)>vh+s.top){y=vh-h-this.shadowOffset;moved=true;}
if(x<s.left){x=s.left;moved=true;}
if(y<s.top){y=s.top;moved=true;}
if(moved){xy=[x,y];this.lastXY=xy;supr.setXY.call(this,xy);this.sync();}}},showAction:function(){if(this.useDisplay===true){this.setDisplayed("");}else if(this.lastXY){supr.setXY.call(this,this.lastXY);}},hideAction:function(){if(this.useDisplay===true){this.setDisplayed(false);}else{this.setLeftTop(-10000,-10000);}},setVisible:function(v,a,d,c,e){this.showAction();if(a&&v){var cb=function(){this.sync(true);if(c){c();}}.createDelegate(this);supr.setVisible.call(this,true,true,d,cb,e);}else{if(!v){this.hideUnders(true);}
var cb=c;if(a){cb=function(){this.hideAction();if(c){c();}}.createDelegate(this);}
supr.setVisible.call(this,v,a,d,cb,e);if(v){this.sync(true);}else if(!a){this.hideAction();}}},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments);},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible());},beforeAction:function(){if(this.shadow){this.shadow.hide();}},setXY:function(xy,a,d,c,e){this.fixDisplay();this.beforeAction();this.lastXY=xy;var cb=this.createCB(c);supr.setXY.call(this,xy,a,d,cb,e);if(!a){cb();}},createCB:function(c){var el=this;return function(){el.constrainXY();el.sync(true);if(c){c();}};},setX:function(x,a,d,c,e){this.setXY([x,this.getY()],a,d,c,e);},setY:function(y,a,d,c,e){this.setXY([this.getX(),y],a,d,c,e);},setSize:function(w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);supr.setSize.call(this,w,h,a,d,cb,e);if(!a){cb();}},setWidth:function(w,a,d,c,e){this.beforeAction();var cb=this.createCB(c);supr.setWidth.call(this,w,a,d,cb,e);if(!a){cb();}},setHeight:function(h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);supr.setHeight.call(this,h,a,d,cb,e);if(!a){cb();}},setBounds:function(x,y,w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);if(!a){supr.setXY.call(this,[x,y]);supr.setSize.call(this,w,h,a,d,cb,e);cb();}else{supr.setBounds.call(this,x,y,w,h,a,d,cb,e);}
return this;},setZIndex:function(zindex){this.setStyle("z-index",zindex+2);if(this.shadow){this.shadow.setZIndex(zindex+1);}
if(this.shim){this.shim.setStyle("z-index",zindex);}}});})();

(function(){var _1=Ext.EventManager;var _2=Ext.lib.Dom;Ext.dd.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5);}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(_1d,pad,_1f){if(typeof pad=="number"){pad={left:pad,right:pad,top:pad,bottom:pad};}pad=pad||this.defaultPadding;var b=Ext.get(this.getEl()).getBox();var ce=Ext.get(_1d);var c=ce.dom==document.body?{x:0,y:0,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}:ce.getBox(_1f||false);var _23=b.y-c.y;var _24=b.x-c.x;this.resetConstraints();this.setXConstraint(_24-(pad.left||0),c.width-_24-b.width-(pad.right||0));this.setYConstraint(_23-(pad.top||0),c.height-_23-b.height-(pad.bottom||0));},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id);}return this._domRef;},getDragEl:function(){return Ext.getDom(this.dragElId);},init:function(id,_26,_27){this.initTarget(id,_26,_27);_1.on(this.id,"mousedown",this.handleMouseDown,this);},initTarget:function(id,_29,_2a){this.config=_2a||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof id!=="string"){id=Ext.id(id);}this.id=id;this.addToGroup((_29)?_29:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(_2b,_2c,_2d,_2e){if(!_2c&&0!==_2c){this.padding=[_2b,_2b,_2b,_2b];}else{if(!_2d&&0!==_2d){this.padding=[_2b,_2c,_2b,_2c];}else{this.padding=[_2b,_2c,_2d,_2e];}}},setInitPosition:function(_2f,_30){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_2f||0;var dy=_30||0;var p=_2.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_37){this.groups[_37]=true;this.DDM.regDragDrop(this,_37);},removeFromGroup:function(_38){if(this.groups[_38]){delete this.groups[_38];}this.DDM.removeDDFromGroup(this,_38);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id);}this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id);}_1.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){_1.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){if(this.primaryButtonOnly&&e.button!=0){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new Ext.lib.Point(Ext.lib.Event.getPageX(e),Ext.lib.Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var _40=Ext.lib.Event.getTarget(e);return(this.isValidHandleChild(_40)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_40,this.id)));},addInvalidHandleType:function(_41){var _42=_41.toUpperCase();this.invalidHandleTypes[_42]=_42;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_44){this.invalidHandleClasses.push(_44);},removeInvalidHandleType:function(_45){var _46=_45.toUpperCase();delete this.invalidHandleTypes[_46];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_48){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_48){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_4b){var _4c=true;var _4d;try{_4d=_4b.nodeName.toUpperCase();}catch(e){_4d=_4b.nodeName;}_4c=_4c&&!this.invalidHandleTypes[_4d];_4c=_4c&&!this.invalidHandleIds[_4b.id];for(var i=0,len=this.invalidHandleClasses.length;_4c&&i<len;++i){_4c=!_2.hasClass(_4b,this.invalidHandleClasses[i]);}return _4c;},setXTicks:function(_50,_51){this.xTicks=[];this.xTickSize=_51;var _52={};for(var i=this.initPageX;i>=this.minX;i=i-_51){if(!_52[i]){this.xTicks[this.xTicks.length]=i;_52[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_51){if(!_52[i]){this.xTicks[this.xTicks.length]=i;_52[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_54,_55){this.yTicks=[];this.yTickSize=_55;var _56={};for(var i=this.initPageY;i>=this.minY;i=i-_55){if(!_56[i]){this.yTicks[this.yTicks.length]=i;_56[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_55){if(!_56[i]){this.yTicks[this.yTicks.length]=i;_56[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_58,_59,_5a){this.leftConstraint=_58;this.rightConstraint=_59;this.minX=this.initPageX-_58;this.maxX=this.initPageX+_59;if(_5a){this.setXTicks(this.initPageX,_5a);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,_5c,_5d){this.topConstraint=iUp;this.bottomConstraint=_5c;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_5c;if(_5d){this.setYTicks(this.initPageY,_5d);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,_61){if(!_61){return val;}else{if(_61[0]>=val){return _61[0];}else{for(var i=0,len=_61.length;i<len;++i){var _64=i+1;if(_61[_64]&&_61[_64]>=val){var _65=val-_61[i];var _66=_61[_64]-val;return(_66>_65)?_61[i]:_61[_64];}}return _61[_61.length-1];}}},toString:function(){return("DragDrop "+this.id);}};})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var _67=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_68,_69){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}oDD[_68].apply(oDD,_69);}}},_onLoad:function(){this.init();_67.on(document,"mouseup",this.handleMouseUp,this,true);_67.on(document,"mousemove",this.handleMouseMove,this,true);_67.on(window,"unload",this._onUnload,this,true);_67.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,_6f){if(!this.initialized){this.init();}if(!this.ids[_6f]){this.ids[_6f]={};}this.ids[_6f][oDD.id]=oDD;},removeDDFromGroup:function(oDD,_71){if(!this.ids[_71]){this.ids[_71]={};}var obj=this.ids[_71];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}delete this.handleIds[oDD.id];},regHandle:function(_75,_76){if(!this.handleIds[_75]){this.handleIds[_75]={};}this.handleIds[_75][_76]=_76;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(_78,_79){var _7a=[];for(var i in _78.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_79||dd.isTarget){_7a[_7a.length]=dd;}}}return _7a;},isLegalTarget:function(oDD,_7e){var _7f=this.getRelated(oDD,true);for(var i=0,len=_7f.length;i<len;++i){if(_7f[i].id==_7e.id){return true;}}return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(_83,_84){return(this.handleIds[_83]&&this.handleIds[_83][_84]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,oDD){this.currentTarget=Ext.lib.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=Ext.lib.Event.getPageX(e);this.startY=Ext.lib.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=Ext.dd.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){Ext.lib.Event.stopPropagation(e);}if(this.preventDefault){Ext.lib.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(Ext.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _91=Math.abs(this.startX-Ext.lib.Event.getPageX(e));var _92=Math.abs(this.startY-Ext.lib.Event.getPageY(e));if(_91>this.clickPixelThresh||_92>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;},fireEvents:function(e,_94){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var x=Ext.lib.Event.getPageX(e);var y=Ext.lib.Event.getPageY(e);var pt=new Ext.lib.Point(x,y);var _99=[];var _9a=[];var _9b=[];var _9c=[];var _9d=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_9a.push(ddo);}_99[i]=true;delete this.dragOvers[i];}for(var _a0 in dc.groups){if("string"!=typeof _a0){continue;}for(i in this.ids[_a0]){var oDD=this.ids[_a0][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_94){_9c.push(oDD);}else{if(!_99[oDD.id]){_9d.push(oDD);}else{_9b.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_9a.length){dc.b4DragOut(e,_9a);dc.onDragOut(e,_9a);}if(_9d.length){dc.onDragEnter(e,_9d);}if(_9b.length){dc.b4DragOver(e,_9b);dc.onDragOver(e,_9b);}if(_9c.length){dc.b4DragDrop(e,_9c);dc.onDragDrop(e,_9c);}}else{var len=0;for(i=0,len=_9a.length;i<len;++i){dc.b4DragOut(e,_9a[i].id);dc.onDragOut(e,_9a[i].id);}for(i=0,len=_9d.length;i<len;++i){dc.onDragEnter(e,_9d[i].id);}for(i=0,len=_9b.length;i<len;++i){dc.b4DragOver(e,_9b[i].id);dc.onDragOver(e,_9b[i].id);}for(i=0,len=_9c.length;i<len;++i){dc.b4DragDrop(e,_9c[i].id);dc.onDragDrop(e,_9c[i].id);}}if(_94&&!_9c.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var _a4=null;var len=dds.length;if(len==1){_a4=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_a4=dd;break;}else{if(!_a4||_a4.overlap.getArea()<dd.overlap.getArea()){_a4=dd;}}}}return _a4;},refreshCache:function(_a8){for(var _a9 in _a8){if("string"!=typeof _a9){continue;}for(var i in this.ids[_a9]){var oDD=this.ids[_a9][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var _ae=el.offsetParent;if(_ae){return true;}}}catch(e){}return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=Ext.lib.Dom.getXY(el);}catch(e){}if(!pos){return null;}x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new Ext.lib.Region(t,r,b,l);},isOverTarget:function(pt,_bb,_bc){var loc=this.locationCache[_bb.id];if(!loc||!this.useCache){loc=this.getLocation(_bb);this.locationCache[_bb.id]=loc;}if(!loc){return false;}_bb.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_bc&&!dc.constrainX&&!dc.constrainY)){return _bb.cursorIsOver;}_bb.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _c1=new Ext.lib.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _c2=_c1.intersect(loc);if(_c2){_bb.overlap=_c2;return(_bc)?true:_bb.cursorIsOver;}else{return false;}},_onUnload:function(e,me){Ext.dd.DragDropMgr.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var _c6=this.elementCache[id];if(!_c6||!_c6.el){_c6=this.elementCache[id]=new this.ElementWrapper(Ext.getDom(id));}return _c6;},getElement:function(id){return Ext.getDom(id);},getCss:function(id){var el=Ext.getDom(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return Ext.lib.Dom.getX(el);},getPosY:function(el){return Ext.lib.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else{if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else{if(db){t=db.scrollTop;l=db.scrollLeft;}else{}}return{top:t,left:l};},getStyle:function(el,_d6){return Ext.fly(el).getStyle(_d6);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(_d7,_d8){var _d9=Ext.lib.Dom.getXY(_d8);Ext.lib.Dom.setXY(_d7,_d9);},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=Ext.dd.DDM;if(Ext.lib.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(_dd,id){if(this.isHandle(id,_dd.id)){return true;}else{var p=_dd.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;}};}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners();}Ext.dd.DD=function(id,_e1,_e2){if(id){this.init(id,_e1,_e2);}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(_e3,_e4){var x=_e3-this.startPageX;var y=_e4-this.startPageY;this.setDelta(x,y);},setDelta:function(_e7,_e8){this.deltaX=_e7;this.deltaY=_e8;},setDragElPos:function(_e9,_ea){var el=this.getDragEl();this.alignElWithMouse(el,_e9,_ea);},alignElWithMouse:function(el,_ed,_ee){var _ef=this.getTargetCoord(_ed,_ee);var fly=Ext.fly(el);if(!this.deltaSetXY){var _f1=[_ef.x,_ef.y];fly.setXY(_f1);var _f2=fly.getLeft(true);var _f3=fly.getTop(true);this.deltaSetXY=[_f2-_ef.x,_f3-_ef.y];}else{fly.setLeftTop(_ef.x+this.deltaSetXY[0],_ef.y+this.deltaSetXY[1]);}this.cachePosition(_ef.x,_ef.y);this.autoScroll(_ef.x,_ef.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(_f4,_f5){if(_f4){this.lastPageX=_f4;this.lastPageY=_f5;}else{var _f6=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=_f6[0];this.lastPageY=_f6[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var _fb=Ext.lib.Dom.getViewWidth();var _fc=Ext.lib.Dom.getViewHeight();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _100=w+x;var _101=(_fb+st-y-this.deltaY);var _102=(_fc+sl-x-this.deltaX);var _103=40;var _104=(document.all)?80:30;if(bot>_fb&&_101<_103){window.scrollTo(sl,st+_104);}if(y<st&&st>0&&y-st<_103){window.scrollTo(sl,st-_104);}if(_100>_fc&&_102<_103){window.scrollTo(sl+_104,st);}if(x<sl&&sl>0&&x-sl<_103){window.scrollTo(sl-_104,st);}}},getTargetCoord:function(_105,_106){var x=_105-this.deltaX;var y=_106-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(Ext.lib.Event.getPageX(e),Ext.lib.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(Ext.lib.Event.getPageX(e),Ext.lib.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});Ext.dd.DDProxy=function(id,_10c,_10d){if(id){this.init(id,_10c,_10d);this.initFrame();}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId);},showFrame:function(_112,_113){var el=this.getEl();var _115=this.getDragEl();var s=_115.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_112,_113);Ext.fly(_115).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Ext.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown:function(e){var x=Ext.lib.Event.getPageX(e);var y=Ext.lib.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){Ext.fly(this.getDragEl()).hide();},endDrag:function(e){var lel=this.getEl();var del=this.getDragEl();del.style.visibility="";lel.style.visibility="hidden";Ext.dd.DDM.moveToEl(lel,del);del.style.visibility="hidden";lel.style.visibility="";},toString:function(){return("DDProxy "+this.id);}});Ext.dd.DDTarget=function(id,_122,_123){if(id){this.initTarget(id,_122,_123);}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{toString:function(){return("DDTarget "+this.id);}});Ext.dd.ScrollManager=function(){var _1=Ext.dd.DragDropMgr;var _2={};var _3=null;var _4={};var _5=function(e){_3=null;_7();};var _8=function(){if(_1.dragCurrent){_1.refreshCache(_1.dragCurrent.groups);}};var _9=function(){if(_1.dragCurrent){var _a=Ext.dd.ScrollManager;if(!_a.animate){if(_4.el.scroll(_4.dir,_a.increment)){_8();}}else{_4.el.scroll(_4.dir,_a.increment,true,_a.animDuration,_8);}}};var _7=function(){if(_4.id){clearInterval(_4.id);}_4.id=0;_4.el=null;_4.dir="";};var _b=function(el,_d){_7();_4.el=el;_4.dir=_d;_4.id=setInterval(_9,Ext.dd.ScrollManager.frequency);};var _e=function(e,_10){if(_10||!_1.dragCurrent){return;}var dds=Ext.dd.ScrollManager;if(!_3||_3!=_1.dragCurrent){_3=_1.dragCurrent;dds.refreshCache();}var xy=Ext.lib.Event.getXY(e);var pt=new Ext.lib.Point(xy[0],xy[1]);for(var id in _2){var el=_2[id],r=el._region;if(r.contains(pt)&&el.isScrollable()){if(r.bottom-pt.y<=dds.thresh){if(_4.el!=el){_b(el,"down");}return;}else{if(r.right-pt.x<=dds.thresh){if(_4.el!=el){_b(el,"left");}return;}else{if(pt.y-r.top<=dds.thresh){if(_4.el!=el){_b(el,"up");}return;}else{if(pt.x-r.left<=dds.thresh){if(_4.el!=el){_b(el,"right");}return;}}}}}}_7();};_1.fireEvents=_1.fireEvents.createSequence(_e,_1);_1.stopDrag=_1.stopDrag.createSequence(_5,_1);return{register:function(el){if(el instanceof Array){for(var i=0,len=el.length;i<len;i++){this.register(el[i]);}}else{el=Ext.get(el);_2[el.id]=el;}},unregister:function(el){if(el instanceof Array){for(var i=0,len=el.length;i<len;i++){this.unregister(el[i]);}}else{el=Ext.get(el);delete _2[el.id];}},thresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var id in _2){_2[id]._region=_2[id].getRegion();}}};}();Ext.dd.Registry=function(){var _1={};var _2={};var _3=0;var _4=function(el,_6){if(typeof el=="string"){return el;}var id=el.id;if(!id&&_6!==false){id="yddgen-"+(++_3);el.id=id;}return id;};return{register:function(el,_9){_9=_9||{};if(typeof el=="string"){el=document.getElementById(el);}_9.ddel=el;_1[_4(el)]=_9;if(_9.isHandle!==false){_2[_9.ddel.id]=_9;}if(_9.handles){var hs=_9.handles;for(var i=0,_c=hs.length;i<_c;i++){_2[_4(hs[i])]=_9;}}},unregister:function(el){var id=_4(el,false);var _f=_1[id];if(_f){delete _1[id];if(_f.handles){var hs=_f.handles;for(var i=0,len=hs.length;i<len;i++){delete _2[_4(hs[i],false)];}}}},getHandle:function(id){if(typeof id!="string"){id=id.id;}return _2[id];},getHandleFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);return t?_2[t.id]:null;},getTarget:function(id){if(typeof id!="string"){id=id.id;}return _1[id];},getTargetFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);return t?_1[t.id]||_2[t.id]:null;}};}();Ext.dd.StatusProxy=function(_1){Ext.apply(this,_1);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!_1||_1.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed;};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(_2){_2=_2||this.dropNotAllowed;if(this.dropStatus!=_2){this.el.replaceClass(this.dropStatus,_2);this.dropStatus=_2;}},reset:function(_3){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(_3){this.ghost.update("");}},update:function(_4){if(typeof _4=="string"){this.ghost.update(_4);}else{this.ghost.update("");_4.style.margin="0";this.ghost.dom.appendChild(_4);}},getEl:function(){return this.el;},getGhost:function(){return this.ghost;},hide:function(_5){this.el.hide();if(_5){this.reset(true);}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop();}},show:function(){this.el.show();},sync:function(){this.el.sync();},repair:function(xy,_7,_8){this.callback=_7;this.scope=_8;if(xy&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:xy,stopFx:true,callback:this.afterRepair,scope:this});}else{this.afterRepair();}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this);}this.callback==null;this.scope==null;}};Ext.dd.DragSource=function(el,_2){this.el=Ext.get(el);this.dragData={};Ext.apply(this,_2);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy();}this.el.on("mouseup",this.handleMouseUp);Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false;};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(e){return this.dragData;},onDragEnter:function(e,id){var _6=Ext.dd.DragDropMgr.getDDById(id);this.cachedTarget=_6;if(this.beforeDragEnter(_6,e,id)!==false){if(_6.isNotifyTarget){var _7=_6.notifyEnter(this,e,this.dragData);this.proxy.setStatus(_7);}else{this.proxy.setStatus(this.dropAllowed);}if(this.afterDragEnter){this.afterDragEnter(_6,e,id);}}},beforeDragEnter:function(_8,e,id){return true;},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync();},onDragOver:function(e,id){var _d=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragOver(_d,e,id)!==false){if(_d.isNotifyTarget){var _e=_d.notifyOver(this,e,this.dragData);this.proxy.setStatus(_e);}if(this.afterDragOver){this.afterDragOver(_d,e,id);}}},beforeDragOver:function(_f,e,id){return true;},onDragOut:function(e,id){var _14=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragOut(_14,e,id)!==false){if(_14.isNotifyTarget){_14.notifyOut(this,e,this.dragData);}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(_14,e,id);}}this.cachedTarget=null;},beforeDragOut:function(_15,e,id){return true;},onDragDrop:function(e,id){var _1a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragDrop(_1a,e,id)!==false){if(_1a.isNotifyTarget){if(_1a.notifyDrop(this,e,this.dragData)){this.onValidDrop(_1a,e,id);}else{this.onInvalidDrop(_1a,e,id);}}else{this.onValidDrop(_1a,e,id);}if(this.afterDragDrop){this.afterDragDrop(_1a,e,id);}}},beforeDragDrop:function(_1b,e,id){return true;},onValidDrop:function(_1e,e,id){this.hideProxy();},getRepairXY:function(e,_22){return this.el.getXY();},onInvalidDrop:function(_23,e,id){this.beforeInvalidDrop(_23,e,id);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,e,this.dragData);}this.cacheTarget=null;}this.proxy.repair(this.getRepairXY(e,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(e,id);}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9");}this.dragging=false;},beforeInvalidDrop:function(_26,e,id){return true;},handleMouseDown:function(e){if(this.dragging){return;}if(Ext.QuickTips){Ext.QuickTips.disable();}var _2a=this.getDragData(e);if(_2a&&this.onBeforeDrag(_2a,e)!==false){this.dragData=_2a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments);}},handleMouseUp:function(e){if(Ext.QuickTips){Ext.QuickTips.enable();}},onBeforeDrag:function(_2c,e){return true;},onStartDrag:Ext.emptyFn,startDrag:function(e){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(e);this.proxy.show();},onInitDrag:function(e){var _30=this.el.dom.cloneNode(true);_30.id=Ext.id();this.proxy.update(_30);this.onStartDrag(e);return true;},getProxy:function(){return this.proxy;},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false;},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups);},b4EndDrag:function(e){},endDrag:function(e){this.onEndDrag(this.dragData,e);},onEndDrag:function(_33,e){},autoOffset:function(x,y){this.setDelta(-12,-20);}});Ext.dd.DropTarget=function(el,_2){this.el=Ext.get(el);Ext.apply(this,_2);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el);}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true});};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{isTarget:true,isNotifyTarget:true,dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",notifyEnter:function(dd,e,_5){if(this.overClass){this.el.addClass(this.overClass);}return this.dropAllowed;},notifyOver:function(dd,e,_8){return this.dropAllowed;},notifyOut:function(dd,e,_b){if(this.overClass){this.el.removeClass(this.overClass);}},notifyDrop:function(dd,e,_e){return false;}});Ext.dd.DragZone=function(el,_2){Ext.dd.DragZone.superclass.constructor.call(this,el,_2);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el);}};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(e){return Ext.dd.Registry.getHandleFromEvent(e);},onInitDrag:function(e){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(e);return true;},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9");}this.dragging=false;},getRepairXY:function(e){return Ext.Element.fly(this.dragData.ddel).getXY();}});Ext.dd.DropZone=function(el,_2){Ext.dd.DropZone.superclass.constructor.call(this,el,_2);};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(e){return Ext.dd.Registry.getTargetFromEvent(e);},onNodeEnter:function(n,dd,e,_7){},onNodeOver:function(n,dd,e,_b){return this.dropAllowed;},onNodeOut:function(n,dd,e,_f){},onNodeDrop:function(n,dd,e,_13){return false;},onContainerOver:function(dd,e,_16){return this.dropNotAllowed;},onContainerDrop:function(dd,e,_19){return false;},notifyEnter:function(dd,e,_1c){return this.dropNotAllowed;},notifyOver:function(dd,e,_1f){var n=this.getTargetFromEvent(e);if(!n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_1f);this.lastOverNode=null;}return this.onContainerOver(dd,e,_1f);}if(this.lastOverNode!=n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_1f);}this.onNodeEnter(n,dd,e,_1f);this.lastOverNode=n;}return this.onNodeOver(n,dd,e,_1f);},notifyOut:function(dd,e,_23){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_23);this.lastOverNode=null;}},notifyDrop:function(dd,e,_26){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_26);this.lastOverNode=null;}var n=this.getTargetFromEvent(e);return n?this.onNodeDrop(n,dd,e,_26):this.onContainerDrop(dd,e,_26);},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups);}});

Ext.LayoutManager=function(_1){Ext.LayoutManager.superclass.constructor.call(this);this.el=Ext.get(_1);if(this.el.dom==document.body&&Ext.isIE){document.body.scroll="no";}else{if(this.el.dom!=document.body&&this.el.getStyle("position")=="static"){this.el.position("relative");}}this.id=this.el.id;this.el.addClass("x-layout-container");this.monitorWindowResize=true;this.regions={};this.events={"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true};this.updating=false;Ext.EventManager.onWindowResize(this.onWindowResize,this,true);};Ext.extend(Ext.LayoutManager,Ext.util.Observable,{isUpdating:function(){return this.updating;},beginUpdate:function(){this.updating=true;},endUpdate:function(_2){this.updating=false;if(!_2){this.layout();}},layout:function(){},onRegionResized:function(_3,_4){this.fireEvent("regionresized",_3,_4);this.layout();},onRegionCollapsed:function(_5){this.fireEvent("regioncollapsed",_5);},onRegionExpanded:function(_6){this.fireEvent("regionexpanded",_6);},getViewSize:function(){var _7;if(this.el.dom!=document.body){_7=this.el.getSize();}else{_7={width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()};}_7.width-=this.el.getBorderWidth("lr")-this.el.getPadding("lr");_7.height-=this.el.getBorderWidth("tb")-this.el.getPadding("tb");return _7;},getEl:function(){return this.el;},getRegion:function(_8){return this.regions[_8.toLowerCase()];},onWindowResize:function(){if(this.monitorWindowResize){this.layout();}}});Ext.BorderLayout=function(_1,_2){_2=_2||{};Ext.BorderLayout.superclass.constructor.call(this,_1);this.factory=_2.factory||Ext.BorderLayout.RegionFactory;for(var i=0,_4=this.factory.validRegions.length;i<_4;i++){var _5=this.factory.validRegions[i];if(_2[_5]){this.addRegion(_5,_2[_5]);}}};Ext.extend(Ext.BorderLayout,Ext.LayoutManager,{addRegion:function(_6,_7){if(!this.regions[_6]){var r=this.factory.create(_6,this,_7);this.regions[_6]=r;r.on("visibilitychange",this.layout,this);r.on("paneladded",this.layout,this);r.on("panelremoved",this.layout,this);r.on("invalidated",this.layout,this);r.on("resized",this.onRegionResized,this);r.on("collapsed",this.onRegionCollapsed,this);r.on("expanded",this.onRegionExpanded,this);}return this.regions[_6];},layout:function(){if(this.updating){return;}var _9=this.getViewSize();var w=_9.width,h=_9.height;var _c=w,_d=h,_e=0,_f=0;var rs=this.regions;var n=rs["north"],s=rs["south"],_13=rs["west"],e=rs["east"],c=rs["center"];if(this.hideOnLayout){c.el.setStyle("display","none");}if(n&&n.isVisible()){var b=n.getBox();var m=n.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;_e=b.height+b.y+m.bottom;_d-=_e;n.updateBox(this.safeBox(b));}if(s&&s.isVisible()){var b=s.getBox();var m=s.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var _18=(b.height+m.top+m.bottom);b.y=h-_18+m.top;_d-=_18;s.updateBox(this.safeBox(b));}if(_13&&_13.isVisible()){var b=_13.getBox();var m=_13.getMargins();b.height=_d-(m.top+m.bottom);b.x=m.left;b.y=_e+m.top;var _19=(b.width+m.left+m.right);_f+=_19;_c-=_19;_13.updateBox(this.safeBox(b));}if(e&&e.isVisible()){var b=e.getBox();var m=e.getMargins();b.height=_d-(m.top+m.bottom);var _19=(b.width+m.left+m.right);b.x=w-_19+m.left;b.y=_e+m.top;_c-=_19;e.updateBox(this.safeBox(b));}if(c){var m=c.getMargins();var _1a={x:_f+m.left,y:_e+m.top,width:_c-(m.left+m.right),height:_d-(m.top+m.bottom)};if(this.hideOnLayout){c.el.setStyle("display","block");}c.updateBox(this.safeBox(_1a));}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(box){box.width=Math.max(0,box.width);box.height=Math.max(0,box.height);return box;},add:function(_1c,_1d){_1c=_1c.toLowerCase();return this.regions[_1c].add(_1d);},remove:function(_1e,_1f){_1e=_1e.toLowerCase();return this.regions[_1e].remove(_1f);},findPanel:function(_20){var rs=this.regions;for(var _22 in rs){if(typeof rs[_22]!="function"){var p=rs[_22].getPanel(_20);if(p){return p;}}}return null;},showPanel:function(_24){var rs=this.regions;for(var _26 in rs){var r=rs[_26];if(typeof r!="function"){if(r.hasPanel(_24)){return r.showPanel(_24);}}}return null;},restoreState:function(_28){if(!_28){_28=Ext.state.Manager;}var sm=new Ext.LayoutStateManager();sm.init(this,_28);}});Ext.BorderLayout.create=function(_2a,_2b){var _2c=new Ext.BorderLayout(_2b||document.body,_2a);_2c.beginUpdate();var _2d=Ext.BorderLayout.RegionFactory.validRegions;for(var j=0,_2f=_2d.length;j<_2f;j++){var lr=_2d[j];if(_2c.regions[lr]&&_2a[lr].panels){var r=_2c.regions[lr];var ps=_2a[lr].panels;for(var i=0,len=ps.length;i<len;i++){var p=ps[i];if(typeof p=="string"){r.add(new Ext.ContentPanel(p));}else{if(!p.events){var el=p.el;delete p.el;r.add(new Ext.ContentPanel(el,p));}else{r.add(p);}}}}}_2c.endUpdate();return _2c;};Ext.BorderLayout.RegionFactory={validRegions:["north","south","east","west","center"],create:function(_37,mgr,_39){_37=_37.toLowerCase();if(_39.lightweight||_39.basic){return new Ext.BasicLayoutRegion(mgr,_39,_37);}switch(_37){case"north":return new Ext.NorthLayoutRegion(mgr,_39);case"south":return new Ext.SouthLayoutRegion(mgr,_39);case"east":return new Ext.EastLayoutRegion(mgr,_39);case"west":return new Ext.WestLayoutRegion(mgr,_39);case"center":return new Ext.CenterLayoutRegion(mgr,_39);}throw"Layout region \""+_37+"\" not supported.";}};Ext.BasicLayoutRegion=function(_1,_2,_3,_4){this.mgr=_1;this.position=_3;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true};this.panels=new Ext.util.MixedCollection();this.panels.getKey=this.getPanelId.createDelegate(this);this.box=null;this.activePanel=null;if(_4!==true){this.applyConfig(_2);}};Ext.extend(Ext.BasicLayoutRegion,Ext.util.Observable,{getPanelId:function(p){return p.getId();},applyConfig:function(_6){this.margins=_6.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.config=_6;},resizeTo:function(_7){if(this.activePanel){var el=this.activePanel.getEl();switch(this.position){case"east":case"west":el.setWidth(_7);this.fireEvent("resized",this,_7);break;case"north":case"south":el.setHeight(_7);this.fireEvent("resized",this,_7);break;}}},getBox:function(){return this.activePanel?this.activePanel.getEl().getBox(false,true):null;},getMargins:function(){return this.margins;},updateBox:function(_9){this.box=_9;var el=this.activePanel.getEl();el.dom.style.left=_9.x+"px";el.dom.style.top=_9.y+"px";el.setSize(_9.width,_9.height);},getEl:function(){return this.activePanel;},isVisible:function(){return this.activePanel?true:false;},setActivePanel:function(_b){_b=this.getPanel(_b);if(this.activePanel&&this.activePanel!=_b){this.activePanel.setActiveState(false);this.activePanel.getEl().setStyle({left:-10000,right:-10000});}this.activePanel=_b;_b.setActiveState(true);if(this.box){_b.setSize(this.box.width,this.box.height);}this.fireEvent("panelactivated",this,_b);this.fireEvent("invalidated");},showPanel:function(_c){if(_c=this.getPanel(_c)){this.setActivePanel(_c);}return _c;},getActivePanel:function(){return this.activePanel;},add:function(_d){if(arguments.length>1){for(var i=0,_f=arguments.length;i<_f;i++){this.add(arguments[i]);}return null;}if(this.hasPanel(_d)){this.showPanel(_d);return _d;}var el=_d.getEl();if(el.dom.parentNode!=this.mgr.el.dom){this.mgr.el.dom.appendChild(el.dom);}_d.setRegion(this);this.panels.add(_d);el.setStyle("position","absolute");if(!_d.background){this.setActivePanel(_d);if(this.config.initialSize&&this.panels.getCount()==1){this.resizeTo(this.config.initialSize);}}this.fireEvent("paneladded",this,_d);return _d;},hasPanel:function(_11){if(typeof _11=="object"){_11=_11.getId();}return this.getPanel(_11)?true:false;},remove:function(_12,_13){_12=this.getPanel(_12);if(!_12){return null;}var e={};this.fireEvent("beforeremove",this,_12,e);if(e.cancel===true){return null;}var _15=_12.getId();this.panels.removeKey(_15);return _12;},getPanel:function(id){if(typeof id=="object"){return id;}return this.panels.get(id);},getPosition:function(){return this.position;}});Ext.LayoutRegion=function(_1,_2,_3){Ext.LayoutRegion.superclass.constructor.call(this,_1,_2,_3,true);var dh=Ext.DomHelper;this.el=dh.append(_1.el.dom,{tag:"div",cls:"x-layout-panel x-layout-panel-"+this.position},true);this.titleEl=dh.append(this.el.dom,{tag:"div",unselectable:"on",cls:"x-unselectable x-layout-panel-hd x-layout-title-"+this.position,children:[{tag:"span",cls:"x-unselectable x-layout-panel-hd-text",unselectable:"on",html:"&#160;"},{tag:"div",cls:"x-unselectable x-layout-panel-hd-tools",unselectable:"on"}]},true);this.titleEl.enableDisplayMode();this.titleTextEl=this.titleEl.dom.firstChild;this.tools=Ext.get(this.titleEl.dom.childNodes[1],true);this.closeBtn=this.createTool(this.tools.dom,"x-layout-close");this.closeBtn.enableDisplayMode();this.closeBtn.on("click",this.closeClicked,this);this.closeBtn.hide();this.bodyEl=dh.append(this.el.dom,{tag:"div",cls:"x-layout-panel-body"},true);this.visible=false;this.collapsed=false;this.hide();this.on("paneladded",this.validateVisibility,this);this.on("panelremoved",this.validateVisibility,this);this.applyConfig(_2);};Ext.extend(Ext.LayoutRegion,Ext.BasicLayoutRegion,{applyConfig:function(c){if(c.collapsible&&this.position!="center"&&!this.collapsedEl){var dh=Ext.DomHelper;this.collapseBtn=this.createTool(this.tools.dom,"x-layout-collapse-"+this.position);this.collapseBtn.on("click",this.collapse,this);this.collapseBtn.enableDisplayMode();this.collapsedEl=dh.append(this.mgr.el.dom,{cls:"x-layout-collapsed x-layout-collapsed-"+this.position,children:[{cls:"x-layout-collapsed-tools",children:[{cls:"x-layout-ctools-inner"}]}]},true);if(c.floatable!==false){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.collapseClick,this);}if(c.showPin===true||this.showPin==true){this.stickBtn=this.createTool(this.tools.dom,"x-layout-stick");this.stickBtn.enableDisplayMode();this.stickBtn.on("click",this.expand,this);this.stickBtn.hide();}if(c.collapsedTitle&&(this.position=="north"||this.position=="south")){this.collapsedTitleTextEl=dh.append(this.collapsedEl.dom,{tag:"div",cls:"x-unselectable x-layout-panel-hd-text",id:"message",unselectable:"on",style:{"float":"left"}});this.collapsedTitleTextEl.innerHTML=c.collapsedTitle;}this.expandBtn=this.createTool(this.collapsedEl.dom.firstChild.firstChild,"x-layout-expand-"+this.position);this.expandBtn.on("click",this.expand,this);}if(this.collapseBtn){this.collapseBtn.setVisible(c.collapsible==true);}this.cmargins=c.cmargins||this.cmargins||(this.position=="west"||this.position=="east"?{top:0,left:2,right:2,bottom:0}:{top:2,left:0,right:0,bottom:2});this.margins=c.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.bottomTabs=c.tabPosition!="top";this.autoScroll=c.autoScroll||false;if(this.autoScroll){this.bodyEl.setStyle("overflow","auto");}else{this.bodyEl.setStyle("overflow","hidden");}if((!c.titlebar&&!c.title)||c.titlebar===false){this.titleEl.hide();}else{this.titleEl.show();if(c.title){this.titleTextEl.innerHTML=c.title;}}this.duration=c.duration||0.3;this.slideDuration=c.slideDuration||0.45;this.config=c;if(c.collapsed){this.collapse(true);}},isVisible:function(){return this.visible;},setCollapsedTitle:function(_7){_7=_7||"&#160;";if(this.collapsedTitleTextEl){this.collapsedTitleTextEl.innerHTML=_7;}},getBox:function(){var b;if(!this.collapsed){b=this.el.getBox(false,true);}else{b=this.collapsedEl.getBox(false,true);}return b;},getMargins:function(){return this.collapsed?this.cmargins:this.margins;},highlight:function(){this.el.addClass("x-layout-panel-dragover");},unhighlight:function(){this.el.removeClass("x-layout-panel-dragover");},updateBox:function(_9){this.box=_9;if(!this.collapsed){this.el.dom.style.left=_9.x+"px";this.el.dom.style.top=_9.y+"px";this.updateBody(_9.width,_9.height);}else{this.collapsedEl.dom.style.left=_9.x+"px";this.collapsedEl.dom.style.top=_9.y+"px";this.collapsedEl.setSize(_9.width,_9.height);}if(this.tabs){this.tabs.autoSizeTabs();}},updateBody:function(w,h){if(w!==null){this.el.setWidth(w);w-=this.el.getBorderWidth("rl");}if(h!==null){this.el.setHeight(h);h=this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h;h-=this.el.getBorderWidth("tb");this.bodyEl.setHeight(h);if(this.tabs){h=this.tabs.syncHeight(h);}}if(this.panelSize){w=w!==null?w:this.panelSize.width;h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl();w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);}if(Ext.isIE&&this.tabs){this.tabs.el.repaint();}},getEl:function(){return this.el;},hide:function(){if(!this.collapsed){this.el.dom.style.left="-2000px";this.el.hide();}else{this.collapsedEl.dom.style.left="-2000px";this.collapsedEl.hide();}this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){if(!this.collapsed){this.el.show();}else{this.collapsedEl.show();}this.visible=true;this.fireEvent("visibilitychange",this,true);},closeClicked:function(){if(this.activePanel){this.remove(this.activePanel);}},collapseClick:function(e){if(this.isSlid){e.stopPropagation();this.slideIn();}else{e.stopPropagation();this.slideOut();}},collapse:function(_e){if(this.collapsed){return;}this.collapsed=true;if(this.split){this.split.el.hide();}if(this.config.animate&&_e!==true){this.fireEvent("invalidated",this);this.animateCollapse();}else{this.el.setLocation(-20000,-20000);this.el.hide();this.collapsedEl.show();this.fireEvent("collapsed",this);this.fireEvent("invalidated",this);}},animateCollapse:function(){},expand:function(e,_10){if(e){e.stopPropagation();}if(!this.collapsed){return;}if(this.isSlid){this.afterSlideIn();_10=true;}this.collapsed=false;if(this.config.animate&&_10!==true){this.animateExpand();}else{this.el.show();if(this.split){this.split.el.show();}this.collapsedEl.setLocation(-2000,-2000);this.collapsedEl.hide();this.fireEvent("invalidated",this);this.fireEvent("expanded",this);}},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");var ts=new Ext.TabPanel(this.bodyEl.dom,this.bottomTabs);if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass("x-layout-tabs-body");this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(_12){var ti=this.tabs.addTab(_12.getEl().id,_12.getTitle(),null,this.config.closeOnTab&&_12.isClosable());if(_12.tabTip){ti.setTooltip(_12.tabTip);}ti.on("activate",function(){this.setActivePanel(_12);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(_12);},this);}return ti;},updatePanelTitle:function(_16,_17){if(this.activePanel==_16){this.updateTitle(_17);}if(this.tabs){var ti=this.tabs.getTab(_16.getEl().id);ti.setText(_17);if(_16.tabTip){ti.setTooltip(_16.tabTip);}}},updateTitle:function(_19){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof _19!="undefined"&&_19.length>0?_19:"&#160;");}},setActivePanel:function(_1a){_1a=this.getPanel(_1a);if(this.activePanel&&this.activePanel!=_1a){this.activePanel.setActiveState(false);}this.activePanel=_1a;_1a.setActiveState(true);if(this.panelSize){_1a.setSize(this.panelSize.width,this.panelSize.height);}this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&_1a.isClosable());this.updateTitle(_1a.getTitle());if(this.tabs){this.fireEvent("invalidated",this);}this.fireEvent("panelactivated",this,_1a);},showPanel:function(_1b){if(_1b=this.getPanel(_1b)){if(this.tabs){this.tabs.activate(_1b.getEl().id);}else{this.setActivePanel(_1b);}}return _1b;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle("&#160;");this.closeBtn.hide();this.hide();}else{if(!this.isVisible()){this.show();}}},add:function(_1c){if(arguments.length>1){for(var i=0,len=arguments.length;i<len;i++){this.add(arguments[i]);}return null;}if(this.hasPanel(_1c)){this.showPanel(_1c);return _1c;}_1c.setRegion(this);this.panels.add(_1c);if(this.panels.getCount()==1&&!this.config.alwaysShowTabs){this.bodyEl.dom.appendChild(_1c.getEl().dom);if(_1c.background!==true){this.setActivePanel(_1c);}this.fireEvent("paneladded",this,_1c);return _1c;}if(!this.tabs){this.initTabs();}else{this.initPanelAsTab(_1c);}if(_1c.background!==true){this.tabs.activate(_1c.getEl().id);}this.fireEvent("paneladded",this,_1c);return _1c;},hidePanel:function(_1f){if(this.tabs&&(_1f=this.getPanel(_1f))){this.tabs.hideTab(_1f.getEl().id);}},unhidePanel:function(_20){if(this.tabs&&(_20=this.getPanel(_20))){this.tabs.unhideTab(_20.getEl().id);}},clearPanels:function(){while(this.panels.getCount()>0){this.remove(this.panels.first());}},remove:function(_21,_22){_21=this.getPanel(_21);if(!_21){return null;}var e={};this.fireEvent("beforeremove",this,_21,e);if(e.cancel===true){return null;}_22=(typeof _22!="undefined"?_22:(this.config.preservePanels===true||_21.preserve===true));var _24=_21.getId();this.panels.removeKey(_24);if(_22){document.body.appendChild(_21.getEl().dom);}if(this.tabs){this.tabs.removeTab(_21.getEl().id);}else{if(!_22){this.bodyEl.dom.removeChild(_21.getEl().dom);}}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var _26=document.createElement("span");_26.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);_26=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);}_21.setRegion(null);if(this.activePanel==_21){this.activePanel=null;}if(this.config.autoDestroy!==false&&_22!==true){try{_21.destroy();}catch(e){}}this.fireEvent("panelremoved",this,_21);return _21;},getTabs:function(){return this.tabs;},createTool:function(_27,_28){var btn=Ext.DomHelper.append(_27,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"x-layout-tools-button-inner "+_28,html:"&#160;"}]},true);btn.addClassOnOver("x-layout-tools-button-over");return btn;}});Ext.SplitLayoutRegion=function(_1,_2,_3,_4){this.cursor=_4;Ext.SplitLayoutRegion.superclass.constructor.call(this,_1,_2,_3);if(_2.split){this.hide();}};Ext.extend(Ext.SplitLayoutRegion,Ext.LayoutRegion,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(_5){Ext.SplitLayoutRegion.superclass.applyConfig.call(this,_5);if(_5.split){if(!this.split){var _6=Ext.DomHelper.append(this.mgr.el.dom,{tag:"div",id:this.el.id+"-split",cls:"x-layout-split x-layout-split-"+this.position,html:"&#160;"});this.split=new Ext.SplitBar(_6,this.el,this.orientation);this.split.on("moved",this.onSplitMove,this);this.split.useShim=_5.useShim===true;this.split.getMaximumSize=this.getMaxSize.createDelegate(this);if(this.useSplitTips){this.split.el.dom.title=_5.collapsible?this.collapsibleSplitTip:this.splitTip;}if(_5.collapsible){this.split.el.on("dblclick",this.collapse,this);}}if(typeof _5.minSize!="undefined"){this.split.minSize=_5.minSize;}if(typeof _5.maxSize!="undefined"){this.split.maxSize=_5.maxSize;}}},getMaxSize:function(){var _7=this.config.maxSize||10000;var _8=this.mgr.getRegion("center");return Math.min(_7,(this.el.getWidth()+_8.getEl().getWidth())-_8.getMinWidth());},onSplitMove:function(_9,_a){this.fireEvent("resized",this,_a);},getSplitBar:function(){return this.split;},hide:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}Ext.SplitLayoutRegion.superclass.hide.call(this);},show:function(){if(this.split){this.split.el.show();}Ext.SplitLayoutRegion.superclass.show.call(this);},beforeSlide:function(){if(Ext.isGecko){this.bodyEl.clip();if(this.tabs){this.tabs.bodyEl.clip();}if(this.activePanel){this.activePanel.getEl().clip();if(this.activePanel.beforeSlide){this.activePanel.beforeSlide();}}}},afterSlide:function(){if(Ext.isGecko){this.bodyEl.unclip();if(this.tabs){this.tabs.bodyEl.unclip();}if(this.activePanel){this.activePanel.getEl().unclip();if(this.activePanel.afterSlide){this.activePanel.afterSlide();}}}},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var st=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={"mouseout":function(e){if(!e.within(this.el,true)){st.delay(500);}},"mouseover":function(e){st.cancel();},scope:this};}this.el.on(this.autoHideHd);}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);}},clearMonitor:function(){Ext.get(document).un("click",this.slideInIf,this);},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return;}this.isSlid=true;if(this.collapseBtn){this.collapseBtn.hide();}this.closeBtnState=this.closeBtn.getStyle("display");this.closeBtn.hide();if(this.stickBtn){this.stickBtn.show();}this.el.show();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getAlignAdj());this.beforeSlide();this.el.setStyle("z-index",20000);this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.get(document).on("click",this.slideInIf,this);this.fireEvent("slideshow",this);},scope:this,block:true});},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");if(this.collapseBtn){this.collapseBtn.show();}this.closeBtn.setStyle("display",this.closeBtnState);if(this.stickBtn){this.stickBtn.hide();}this.fireEvent("slidehide",this);},slideIn:function(cb){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(cb);return;}this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);this.afterSlide();this.afterSlideIn();Ext.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var _10=this.getSlideAnchor();this.el.slideOut(_10,{callback:function(){this.el.setStyle("z-index","");this.collapsedEl.slideIn(_10,{duration:0.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:0.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();}this.fireEvent("invalidated",this);this.fireEvent("expanded",this);},scope:this,block:true});},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position];},getCollapseAnchor:function(){return this.canchors[this.position];},getSlideAnchor:function(){return this.sanchors[this.position];},getAlignAdj:function(){var cm=this.cmargins;switch(this.position){case"west":return[-cm.right,-cm.top];break;case"east":return[cm.left,-cm.top];break;case"north":return[-cm.left,-cm.bottom];break;case"south":return[-cm.left,cm.top];break;}},getExpandAdj:function(){var c=this.collapsedEl,cm=this.cmargins;switch(this.position){case"west":return[-(cm.right+c.getWidth()+cm.left),-cm.top];break;case"east":return[cm.right+c.getWidth()+cm.left,-cm.top];break;case"north":return[-cm.right,-(cm.top+cm.bottom+c.getHeight())];break;case"south":return[-cm.right,cm.top+cm.bottom+c.getHeight()];break;}}});Ext.CenterLayoutRegion=function(_1,_2){Ext.CenterLayoutRegion.superclass.constructor.call(this,_1,_2,"center");this.visible=true;this.minWidth=_2.minWidth||20;this.minHeight=_2.minHeight||20;};Ext.extend(Ext.CenterLayoutRegion,Ext.LayoutRegion,{hide:function(){},show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Ext.NorthLayoutRegion=function(_3,_4){Ext.NorthLayoutRegion.superclass.constructor.call(this,_3,_4,"north","n-resize");if(this.split){this.split.placement=Ext.SplitBar.TOP;this.split.orientation=Ext.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var _5=_4.initialSize||_4.height;if(typeof _5!="undefined"){this.el.setHeight(_5);}};Ext.extend(Ext.NorthLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var _6=this.el.getBox();if(this.split){_6.height+=this.split.el.getHeight();}return _6;},updateBox:function(_7){if(this.split&&!this.collapsed){_7.height-=this.split.el.getHeight();this.split.el.setLeft(_7.x);this.split.el.setTop(_7.y+_7.height);this.split.el.setWidth(_7.width);}if(this.collapsed){this.updateBody(_7.width,null);}Ext.NorthLayoutRegion.superclass.updateBox.call(this,_7);}});Ext.SouthLayoutRegion=function(_8,_9){Ext.SouthLayoutRegion.superclass.constructor.call(this,_8,_9,"south","s-resize");if(this.split){this.split.placement=Ext.SplitBar.BOTTOM;this.split.orientation=Ext.SplitBar.VERTICAL;this.split.el.addClass("x-layout-split-v");}var _a=_9.initialSize||_9.height;if(typeof _a!="undefined"){this.el.setHeight(_a);}};Ext.extend(Ext.SouthLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var _b=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();_b.height+=sh;_b.y-=sh;}return _b;},updateBox:function(_d){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();_d.height-=sh;_d.y+=sh;this.split.el.setLeft(_d.x);this.split.el.setTop(_d.y-sh);this.split.el.setWidth(_d.width);}if(this.collapsed){this.updateBody(_d.width,null);}Ext.SouthLayoutRegion.superclass.updateBox.call(this,_d);}});Ext.EastLayoutRegion=function(_f,_10){Ext.EastLayoutRegion.superclass.constructor.call(this,_f,_10,"east","e-resize");if(this.split){this.split.placement=Ext.SplitBar.RIGHT;this.split.orientation=Ext.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var _11=_10.initialSize||_10.width;if(typeof _11!="undefined"){this.el.setWidth(_11);}};Ext.extend(Ext.EastLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var box=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();box.width+=sw;box.x-=sw;}return box;},updateBox:function(box){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();box.width-=sw;this.split.el.setLeft(box.x);this.split.el.setTop(box.y);this.split.el.setHeight(box.height);box.x+=sw;}if(this.collapsed){this.updateBody(null,box.height);}Ext.EastLayoutRegion.superclass.updateBox.call(this,box);}});Ext.WestLayoutRegion=function(mgr,_17){Ext.WestLayoutRegion.superclass.constructor.call(this,mgr,_17,"west","w-resize");if(this.split){this.split.placement=Ext.SplitBar.LEFT;this.split.orientation=Ext.SplitBar.HORIZONTAL;this.split.el.addClass("x-layout-split-h");}var _18=_17.initialSize||_17.width;if(typeof _18!="undefined"){this.el.setWidth(_18);}};Ext.extend(Ext.WestLayoutRegion,Ext.SplitLayoutRegion,{orientation:Ext.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var box=this.el.getBox();if(this.split){box.width+=this.split.el.getWidth();}return box;},updateBox:function(box){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();box.width-=sw;this.split.el.setLeft(box.x+box.width);this.split.el.setTop(box.y);this.split.el.setHeight(box.height);}if(this.collapsed){this.updateBody(null,box.height);}Ext.WestLayoutRegion.superclass.updateBox.call(this,box);}});Ext.LayoutStateManager=function(_1){this.state={north:{},south:{},east:{},west:{}};};Ext.LayoutStateManager.prototype={init:function(_2,_3){this.provider=_3;var _4=_3.get(_2.id+"-layout-state");if(_4){var _5=_2.isUpdating();if(!_5){_2.beginUpdate();}for(var _6 in _4){if(typeof _4[_6]!="function"){var _7=_4[_6];var r=_2.getRegion(_6);if(r&&_7){if(_7.size){r.resizeTo(_7.size);}if(_7.collapsed==true){r.collapse(true);}else{r.expand(null,true);}}}}if(!_5){_2.endUpdate();}this.state=_4;}this.layout=_2;_2.on("regionresized",this.onRegionResized,this);_2.on("regioncollapsed",this.onRegionCollapsed,this);_2.on("regionexpanded",this.onRegionExpanded,this);},storeState:function(){this.provider.set(this.layout.id+"-layout-state",this.state);},onRegionResized:function(_9,_a){this.state[_9.getPosition()].size=_a;this.storeState();},onRegionCollapsed:function(_b){this.state[_b.getPosition()].collapsed=true;this.storeState();},onRegionExpanded:function(_c){this.state[_c.getPosition()].collapsed=false;this.storeState();}};Ext.ContentPanel=function(el,_2,_3){Ext.ContentPanel.superclass.constructor.call(this);if(el.autoCreate){_2=el;el=Ext.id();}this.el=Ext.get(el,true);if(!this.el&&_2&&_2.autoCreate){if(typeof _2.autoCreate=="object"){if(!_2.autoCreate.id){_2.autoCreate.id=el;}this.el=Ext.DomHelper.append(document.body,_2.autoCreate,true);}else{this.el=Ext.DomHelper.append(document.body,{tag:"div",cls:"x-layout-inactive-content",id:el},true);}}this.closable=false;this.loaded=false;this.active=false;if(typeof _2=="string"){this.title=_2;}else{Ext.apply(this,_2);}if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl,true);}else{this.resizeEl=this.el;}this.events={"activate":true,"deactivate":true};if(this.autoScroll){this.resizeEl.setStyle("overflow","auto");}_3=_3||this.content;if(_3){this.setContent(_3);}if(_2&&_2.url){this.setUrl(this.url,this.params,this.loadOnce);}};Ext.extend(Ext.ContentPanel,Ext.util.Observable,{setRegion:function(_4){this.region=_4;if(_4){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else{this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(_5){this.active=_5;if(!_5){this.fireEvent("deactivate",this);}else{this.fireEvent("activate",this);}},setContent:function(_6,_7){this.el.update(_6,_7);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},setUrl:function(_a,_b,_c){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);}this.refreshDelegate=this._handleRefresh.createDelegate(this,[_a,_b,_c]);this.on("activate",this._handleRefresh.createDelegate(this,[_a,_b,_c]));return this.el.getUpdateManager();},_handleRefresh:function(_d,_e,_f){if(!_f||!this.loaded){var _10=this.el.getUpdateManager();_10.update(_d,_e,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.el;},adjustForComponents:function(_11,_12){if(this.toolbar){var te=this.toolbar.getEl();_12-=te.getHeight();te.setWidth(_11);}if(this.adjustments){_11+=this.adjustments[0];_12+=this.adjustments[1];}return{"width":_11,"height":_12};},setSize:function(_14,_15){if(this.fitToFrame&&!this.ignoreResize(_14,_15)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(_14,_15);}var _16=this.adjustForComponents(_14,_15);this.resizeEl.setSize(this.autoWidth?"auto":_16.width,_16.height);}},getTitle:function(){return this.title;},setTitle:function(_17){this.title=_17;if(this.region){this.region.updatePanelTitle(this,_17);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var _18=document.createElement("span");_18.appendChild(this.el.dom);_18.innerHTML="";this.el.remove();this.el=null;}});Ext.GridPanel=function(_19,_1a){this.wrapper=Ext.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(_19.container.dom);Ext.GridPanel.superclass.constructor.call(this,this.wrapper,_1a);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}_19.monitorWindowResize=false;_19.autoHeight=false;_19.autoWidth=false;this.grid=_19;this.grid.container.replaceClass("x-layout-inactive-content","x-layout-component-panel");};Ext.extend(Ext.GridPanel,Ext.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(_1b,_1c){if(!this.ignoreResize(_1b,_1c)){var _1d=this.grid;var _1e=this.adjustForComponents(_1b,_1c);_1d.container.setSize(_1e.width,_1e.height);_1d.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.getView().unplugDataModel(this.grid.getDataModel());this.grid.container.removeAllListeners();Ext.GridPanel.superclass.destroy.call(this);}});Ext.NestedLayoutPanel=function(_1f,_20){Ext.NestedLayoutPanel.superclass.constructor.call(this,_1f.getEl(),_20);_1f.monitorWindowResize=false;this.layout=_1f;this.layout.getEl().addClass("x-layout-nested-layout");};Ext.extend(Ext.NestedLayoutPanel,Ext.ContentPanel,{setSize:function(_21,_22){if(!this.ignoreResize(_21,_22)){var _23=this.adjustForComponents(_21,_22);this.layout.getEl().setSize(_23.width,_23.height);this.layout.layout();}},getLayout:function(){return this.layout;}});Ext.ScrollPanel=function(el,_25,_26){_25=_25||{};_25.fitToFrame=true;Ext.ScrollPanel.superclass.constructor.call(this,el,_25,_26);this.el.dom.style.overflow="hidden";var _27=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=_27.createChild({cls:"x-scroller-up",html:"&#160;"},this.el.dom);var _29=_27.createChild({cls:"x-scroller-down",html:"&#160;"});up.unselectable();_29.unselectable();up.on("click",this.scrollUp,this);_29.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");_29.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");_29.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+_29.getHeight())];this.resizeEl=this.el;this.el=_27;this.up=up;this.down=_29;};Ext.extend(Ext.ScrollPanel,Ext.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Ext.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(_30,_31){this.resizeEl.update(_30,_31);}});

Ext.ComponentMgr=function(){var all=new Ext.util.MixedCollection();return{register:function(c){all.add(c);},unregister:function(c){all.remove(c);},get:function(id){return all.get(id);},onAvailable:function(id,fn,scope){all.on("add",function(index,o){if(o.id==id){fn.call(scope||o,o);all.un("add",fn,scope);}});}};}();Ext.Component=function(config){config=config||{};if(config.tagName||config.dom||typeof config=="string"){config={el:config,id:config.id||config};}
Ext.apply(this,config);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true});if(!this.id){this.id="ext-comp-"+(++Ext.Component.AUTO_ID);}
Ext.ComponentMgr.register(this);};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{hidden:false,disabled:false,disabledClass:"x-item-disabled",rendered:false,ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode];},render:function(container){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){this.container=Ext.get(container);this.rendered=true;this.onRender(this.container);if(this.cls){this.el.addClass(this.cls);delete this.cls;}
this.fireEvent("render",this);if(this.hidden){this.hide();}
if(this.disabled){this.disable();}
this.afterRender(this.container);}},onRender:function(ct){this.el=Ext.get(this.el);ct.dom.appendChild(this.el.dom);},afterRender:Ext.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.purgeListeners();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove();}}
Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);}},getEl:function(){return this.el;},focus:function(selectText){if(this.rendered){this.el.focus();if(selectText===true){this.el.dom.select();}}},blur:function(){if(this.rendered){this.el.blur();}},disable:function(){if(this.rendered){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true;}
this.disabled=true;this.fireEvent("disable",this);},enable:function(){if(this.rendered){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false;}
this.disabled=false;this.fireEvent("enable",this);},setDisabled:function(disabled){this[disabled?"disable":"enable"]();},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.rendered){this.onShow();}
this.fireEvent("show",this);}},onShow:function(){var st=this.getActionEl().dom.style;st.display="";st.visibility="visible";},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide();}
this.fireEvent("hide",this);}},onHide:function(){this.getActionEl().dom.style.display="none";},setVisible:function(visible){if(visible){this.show();}else{this.hide();}}});

Ext.QuickTips=function(){var el,tipBody,tipTitle,tm,cfg,close,tagEls={},esc,removeCls=null;var ce,bd,xy,dd;var visible=false,disabled=true,inited=false;var showProc=1,hideProc=1,dismissProc=1,locks=[];var onOver=function(e){if(disabled){return;}
var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return;}
if(ce&&t==ce.el){clearTimeout(hideProc);return;}
if(t&&tagEls[t.id]){tagEls[t.id].el=t;showProc=show.defer(tm.showDelay,tm,[tagEls[t.id]]);return;}
var ttp,et=Ext.fly(t);var ns=cfg.namespace;if(tm.interceptTitles&&t.title){ttp=t.title;t.qtip=ttp;t.removeAttribute("title");e.preventDefault();}else{ttp=t.qtip||et.getAttributeNS(ns,cfg.attribute);}
if(ttp){showProc=show.defer(tm.showDelay,tm,[{el:t,text:ttp,width:et.getAttributeNS(ns,cfg.width),autoHide:et.getAttributeNS(ns,cfg.hide)!="user",title:et.getAttributeNS(ns,cfg.title),cls:et.getAttributeNS(ns,cfg.cls)}]);}};var onOut=function(e){clearTimeout(showProc);var t=e.getTarget();if(t&&ce&&ce.el==t&&(tm.autoHide&&ce.autoHide!==false)){hideProc=setTimeout(hide,tm.hideDelay);}};var onMove=function(e){if(disabled){return;}
xy=e.getXY();xy[1]+=18;if(tm.trackMouse&&ce){el.setXY(xy);}};var onDown=function(e){clearTimeout(showProc);clearTimeout(hideProc);if(!e.within(el)){if(tm.hideOnClick&&ce&&ce.autoHide!==false){hide();tm.disable();}}};var onUp=function(e){tm.enable();};var show=function(o){if(disabled){return;}
clearTimeout(dismissProc);ce=o;if(removeCls){el.removeClass(removeCls);removeCls=null;}
if(ce.cls){el.addClass(ce.cls);removeCls=ce.cls;}
if(ce.title){tipTitleText.update(ce.title);tipTitle.show();}else{tipTitle.hide();}
tipBody.update(o.text);if(!ce.width){if(tipBody.dom.style.width){tipBody.dom.style.width="";}
if(tipBody.dom.offsetWidth>tm.maxWidth){tipBody.setWidth(tm.maxWidth);}
if(tipBody.dom.offsetWidth<tm.minWidth){tipBody.setWidth(tm.minWidth);}}else{tipBody.setWidth(ce.width);}
if(!ce.autoHide){close.setDisplayed(true);if(dd){dd.unlock();}}else{close.setDisplayed(false);if(dd){dd.lock();}}
if(xy){el.setXY(xy);}
if(tm.animate){el.setOpacity(.1);el.setStyle("visibility","visible");el.fadeIn({callback:afterShow});}else{afterShow();}};var afterShow=function(){if(ce){el.show();esc.enable();if(tm.autoDismiss&&ce.autoHide!==false){dismissProc=setTimeout(hide,tm.autoDismissDelay);}}};var hide=function(noanim){clearTimeout(dismissProc);clearTimeout(hideProc);ce=null;if(el.isVisible()){esc.disable();if(noanim!==true&&tm.animate){el.fadeOut({callback:afterHide});}else{afterHide();}}};var afterHide=function(){el.hide();if(removeCls){el.removeClass(removeCls);removeCls=null;}};return{init:function(){tm=Ext.QuickTips;cfg=tm.tagConfig;if(!inited){el=new Ext.Layer({cls:"x-tip",shadow:"sides",shim:true,constrain:true});el.fxDefaults={stopFx:true};el.update('<div class="x-tip-hd-left"><div class="x-tip-hd-right"><div class="x-tip-hd"></div></div></div>');tipTitle=Ext.get(el.dom.firstChild);tipTitleText=Ext.get(el.dom.firstChild.firstChild.firstChild);tipTitle.enableDisplayMode("block");tipBody=el.createChild({tag:"div",cls:"x-tip-bd"});close=el.createChild({tag:"div",cls:"x-tip-close"});close.on("click",hide);d=Ext.get(document);d.on("mousedown",onDown);d.on("mouseup",onUp);d.on("mouseover",onOver);d.on("mouseout",onOut);d.on("mousemove",onMove);esc=d.addKeyListener(27,hide);esc.disable();if(Ext.dd.DD){dd=el.initDD("default",null,{onDrag:function(){el.sync();}});dd.setHandleElId(tipTitleText.id);dd.lock();}
inited=true;}
this.enable();},tips:function(config){var cs=config instanceof Array?config:arguments;for(var i=0,len=cs.length;i<len;i++){var c=cs[i];var target=c.target;if(target){if(target instanceof Array){for(var j=0,jlen=target.length;j<jlen;j++){tagEls[target[j]]=c;}}else{tagEls[target]=c;}}}},enable:function(){if(inited){locks.pop();if(locks.length<1){disabled=false;}}},disable:function(){disabled=true;clearTimeout(showProc);clearTimeout(hideProc);clearTimeout(dismissProc);if(ce){hide(true);}
locks.push(1);},isEnabled:function(){return!disabled;},tagConfig:{namespace:"ext",attribute:"qtip",width:"width",target:"target",title:"qtitle",hide:"hide",cls:"qclass"},minWidth:75,maxWidth:300,interceptTitles:true,trackMouse:false,hideOnClick:true,showDelay:500,hideDelay:200,autoHide:true,autoDismiss:true,autoDismissDelay:5000,animate:false};}();

Ext.menu.BaseItem=function(config){Ext.menu.BaseItem.superclass.constructor.call(this,config);this.addEvents({click:true,activate:true,deactivate:true});if(this.handler){this.on("click",this.handler,this.scope,true);}};Ext.extend(Ext.menu.BaseItem,Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,hideDelay:100,ctype:"Ext.menu.BaseItem",actionMode:"container",render:function(container,parentMenu){this.parentMenu=parentMenu;Ext.menu.BaseItem.superclass.render.call(this,container);this.container.menuItemId=this.id;},onRender:function(container){this.el=Ext.get(this.el);container.dom.appendChild(this.el.dom);},onClick:function(e){if(!this.disabled&&this.fireEvent("click",this,e)!==false&&this.parentMenu.fireEvent("itemclick",this,e)!==false){this.handleClick(e);}else{e.stopEvent();}},activate:function(){if(this.disabled){return false;}
var li=this.container;li.addClass(this.activeClass);this.region=li.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true;},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this);},shouldDeactivate:function(e){return!this.region||!this.region.contains(e.getPoint());},handleClick:function(e){if(this.hideOnClick){this.parentMenu.hide.defer(this.hideDelay,this.parentMenu,[true]);}},expandMenu:function(autoActivate){},hideMenu:function(){}});

Ext.menu.Item=function(config){Ext.menu.Item.superclass.constructor.call(this,config);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu);}};Ext.extend(Ext.menu.Item,Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,ctype:"Ext.menu.Item",onRender:function(container){var el=document.createElement("a");el.hideFocus=true;el.unselectable="on";el.href=this.href||"#";if(this.hrefTarget){el.target=this.hrefTarget;}
el.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");el.innerHTML=String.format('<img src="{0}" class="x-menu-item-icon">{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text);this.el=el;Ext.menu.Item.superclass.onRender.call(this,container);},setText:function(text){this.text=text;if(this.rendered){this.el.update(String.format('<img src="{0}" class="x-menu-item-icon">{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text));this.parentMenu.autoWidth();}},handleClick:function(e){if(!this.href){e.stopEvent();}
Ext.menu.Item.superclass.handleClick.apply(this,arguments);},activate:function(autoExpand){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(autoExpand){this.expandMenu();}}
return true;},shouldDeactivate:function(e){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return!this.menu.getEl().getRegion().contains(e.getPoint());}
return true;}
return false;},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu();},expandMenu:function(autoActivate){if(!this.disabled&&this.menu){if(!this.menu.isVisible()){this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);}
if(autoActivate){this.menu.tryActivate(0,1);}}},hideMenu:function(){if(this.menu&&this.menu.isVisible()){this.menu.hide();}}});

Ext.menu.Menu=function(config){Ext.apply(this,config);this.id=this.id||Ext.id();this.events={beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true};Ext.menu.MenuMgr.register(this);var mis=this.items;this.items=new Ext.util.MixedCollection();if(mis){this.add.apply(this,mis);}};Ext.extend(Ext.menu.Menu,Ext.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,render:function(){if(this.el){return;}
var el=this.el=new Ext.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body});this.keyNav=new Ext.menu.MenuNav(this);if(this.plain){el.addClass("x-menu-plain");}
if(this.cls){el.addClass(this.cls);}
this.focusEl=el.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"});var ul=el.createChild({tag:"ul",cls:"x-menu-list"});ul.on("click",this.onClick,this);ul.on("mouseover",this.onMouseOver,this);ul.on("mouseout",this.onMouseOut,this);this.items.each(function(item){var li=document.createElement("li");li.className="x-menu-list-item";ul.dom.appendChild(li);item.render(li,this);},this);this.ul=ul;this.autoWidth();},autoWidth:function(){var el=this.el,ul=this.ul;if(!el){return;}
var w=this.width;if(w){el.setWidth(w);}else if(Ext.isIE){el.setWidth(this.minWidth);var t=el.dom.offsetWidth;el.setWidth(ul.getWidth()+el.getFrameWidth("lr"));}},delayAutoWidth:function(){if(this.rendered){if(!this.awTask){this.awTask=new Ext.util.DelayedTask(this.autoWidth,this);}
this.awTask.delay(20);}},findTargetItem:function(e){var t=e.getTarget(".x-menu-list-item",this.ul,true);if(t&&t.menuItemId){return this.items.get(t.menuItemId);}},onClick:function(e){var t;if(t=this.findTargetItem(e)){t.onClick(e);this.fireEvent("click",this,t,e);}},setActiveItem:function(item,autoExpand){if(item!=this.activeItem){if(this.activeItem){this.activeItem.deactivate();}
this.activeItem=item;item.activate(autoExpand);}else if(autoExpand){item.expandMenu();}},tryActivate:function(start,step){var items=this.items;for(var i=start,len=items.length;i>=0&&i<len;i+=step){var item=items.get(i);if(!item.disabled&&item.canActivate){this.setActiveItem(item,false);return item;}}
return false;},onMouseOver:function(e){var t;if(t=this.findTargetItem(e)){if(t.canActivate&&!t.disabled){this.setActiveItem(t,true);}}
this.fireEvent("mouseover",this,e,t);},onMouseOut:function(e){var t;if(t=this.findTargetItem(e)){if(t==this.activeItem&&t.shouldDeactivate(e)){this.activeItem.deactivate();delete this.activeItem;}}
this.fireEvent("mouseout",this,e,t);},isVisible:function(){return this.el&&this.el.isVisible();},show:function(el,pos,parentMenu){this.parentMenu=parentMenu;if(!this.el){this.render();}
this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(el,pos||this.defaultAlign),parentMenu,false);},showAt:function(xy,parentMenu,_fireBefore){this.parentMenu=parentMenu;if(!this.el){this.render();}
if(_fireBefore!==false){this.fireEvent("beforeshow",this);}
this.el.setXY(xy);this.el.show();this.focusEl.focus.defer(50,this.focusEl);this.fireEvent("show",this);},hide:function(deep){if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}
this.el.hide();this.fireEvent("hide",this);}
if(deep===true&&this.parentMenu){this.parentMenu.hide(true);}},add:function(){var a=arguments,l=a.length,item;for(var i=0;i<l;i++){var el=a[i];if(el.render){item=this.addItem(el);}else if(typeof el=="string"){if(el=="separator"||el=="-"){item=this.addSeparator();}else{item=this.addText(el);}}else if(el.tagName||el.el){item=this.addElement(el);}else if(typeof el=="object"){item=this.addMenuItem(el);}}
return item;},getEl:function(){if(!this.el){this.render();}
return this.el;},addSeparator:function(){return this.addItem(new Ext.menu.Separator());},addElement:function(el){return this.addItem(new Ext.menu.BaseItem(el));},addItem:function(item){this.items.add(item);if(this.ul){var li=document.createElement("li");li.className="x-menu-list-item";this.ul.dom.appendChild(li);item.render(li,this);this.delayAutoWidth();}
return item;},addMenuItem:function(config){if(!(config instanceof Ext.menu.Item)){config=new Ext.menu.Item(config);}
return this.addItem(config);},addText:function(text){return this.addItem(new Ext.menu.TextItem(text));},insert:function(index,item){this.items.insert(index,item);if(this.ul){var li=document.createElement("li");li.className="x-menu-list-item";this.ul.dom.insertBefore(li,this.ul.dom.childNodes[index]);item.render(li,this);this.delayAutoWidth();}
return item;},remove:function(item){this.items.removeKey(item.id);item.destroy();},removeAll:function(){var f;while(f=this.items.first()){this.remove(f);}}});Ext.menu.MenuNav=function(menu){Ext.menu.MenuNav.superclass.constructor.call(this,menu.el);this.scope=this.menu=menu;};Ext.extend(Ext.menu.MenuNav,Ext.KeyNav,{doRelay:function(e,h){var k=e.getKey();if(!this.menu.activeItem&&e.isNavKeyPress()&&k!=e.SPACE&&k!=e.RETURN){this.menu.tryActivate(0,1);return false;}
return h.call(this.scope||this,e,this.menu);},up:function(e,m){if(!m.tryActivate(m.items.indexOf(m.activeItem)-1,-1)){m.tryActivate(m.items.length-1,-1);}},down:function(e,m){if(!m.tryActivate(m.items.indexOf(m.activeItem)+1,1)){m.tryActivate(0,1);}},right:function(e,m){if(m.activeItem){m.activeItem.expandMenu(true);}},left:function(e,m){m.hide();if(m.parentMenu&&m.parentMenu.activeItem){m.parentMenu.activeItem.activate();}},enter:function(e,m){if(m.activeItem){e.stopPropagation();m.activeItem.onClick(e);m.fireEvent("click",this,m.activeItem);return true;}}});

Ext.menu.MenuMgr=function(){var menus,active,groups={};function init(){menus={},active=new Ext.util.MixedCollection();Ext.get(document).addKeyListener(27,function(){if(active.length>0){hideAll();}});}
function hideAll(){if(active.length>0){var c=active.clone();c.each(function(m){m.hide();});}}
function onHide(m){active.remove(m);if(active.length<1){Ext.get(document).un("mousedown",onMouseDown);}}
function onShow(m){var last=active.last();active.add(m);if(active.length==1){Ext.get(document).on("mousedown",onMouseDown);}
if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m;}else if(last&&last.isVisible()){m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"),10)+3);}}
function onBeforeHide(m){if(m.activeChild){m.activeChild.hide();}
if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}
function onBeforeShow(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){hideAll();}else if(pm&&pm.activeChild){pm.activeChild.hide();}}
function onMouseDown(e){if(active.length>0&&!e.getTarget(".x-menu")){hideAll();}}
function onBeforeCheck(mi,state){if(state){var g=groups[mi.group];for(var i=0,l=g.length;i<l;i++){if(g[i]!=mi){g[i].setChecked(false);}}}}
return{register:function(menu){if(!menus){init();}
menus[menu.id]=menu;menu.on("beforehide",onBeforeHide);menu.on("hide",onHide);menu.on("beforeshow",onBeforeShow);menu.on("show",onShow);var g=menu.group;if(g&&menu.events["checkchange"]){if(!groups[g]){groups[g]=[];}
groups[g].push(menu);menu.on("checkchange",onCheck);}},get:function(menu){if(typeof menu=="string"){return menus[menu];}else if(menu.events){return menu;}else{return new Ext.menu.Menu(menu);}},unregister:function(menu){delete menus[menu.id];menu.un("beforehide",onBeforeHide);menu.un("hide",onHide);menu.un("beforeshow",onBeforeShow);menu.un("show",onShow);var g=menu.group;if(g&&menu.events["checkchange"]){groups[g].remove(menu);menu.un("checkchange",onCheck);}},registerCheckable:function(menuItem){var g=menuItem.group;if(g){if(!groups[g]){groups[g]=[];}
groups[g].push(menuItem);menuItem.on("beforecheckchange",onBeforeCheck);}},unregisterCheckable:function(menuItem){var g=menuItem.group;if(g){groups[g].remove(menuItem);menuItem.un("beforecheckchange",onBeforeCheck);}}};}();

Ext.menu.Separator=function(){Ext.menu.Separator.superclass.constructor.call(this);};Ext.extend(Ext.menu.Separator,Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,onRender:function(li){var s=document.createElement("span");s.className=this.itemCls;s.innerHTML="&#160;";this.el=s;li.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments);}});

Ext.form.Field=function(config){Ext.form.Field.superclass.constructor.call(this,config);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true});};Ext.extend(Ext.form.Field,Ext.Component,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",hasFocus:false,msgTarget:'qtip',msgFx:'normal',applyTo:function(target){this.target=target;this.el=Ext.get(target);this.render(this.el.dom.parentNode);return this;},onRender:function(ct){if(this.el){this.el=Ext.get(this.el);if(!this.target){ct.dom.appendChild(this.el.dom);}}else{var cfg=typeof this.autoCreate=="object"?this.autoCreate:this.defaultAutoCreate;if(this.id&!cfg.id){cfg.id=this.id;}
if(!cfg.name){cfg.name=this.name||this.id;}
this.el=ct.createChild(cfg);}
var type=this.el.dom.type;if(type){if(type=='password'){type='text';}
this.el.addClass('x-form-'+type);}
if(!this.customSize&&(this.width||this.height)){this.setSize(this.width||"",this.height||"");}
if(this.style){this.el.applyStyles(this.style);delete this.style;}
if(this.readOnly){this.el.dom.readOnly=true;}
this.el.addClass([this.fieldClass,this.cls]);this.initValue();},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},afterRender:function(){this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},initEvents:function(){this.el.on(Ext.isIE?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);},onFocus:function(){if(!Ext.isOpera){this.el.addClass(this.focusClass);}
this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);},onBlur:function(){this.el.removeClass(this.focusClass);this.hasFocus=false;if(this.validationEvent!="blur"){this.validate();}
var v=this.getValue();if(v!=this.startValue){this.fireEvent('change',this,v,this.startValue);}
this.fireEvent("blur",this);},setSize:function(w,h){if(!this.rendered){this.width=w;this.height=h;return;}
if(w){this.el.setWidth(w);}
if(h){this.el.setHeight(h);}
var h=this.el.dom.offsetHeight;},isValid:function(){return this.validateValue(this.getValue());},validate:function(){if(this.validateValue(this.getRawValue())){this.clearInvalid();}},validateValue:function(value){return true;},markInvalid:function(msg){if(!this.rendered){return;}
this.el.addClass(this.invalidClass);msg=msg||this.invalidText;switch(this.msgTarget){case'qtip':this.el.dom.qtip=msg;break;case'title':this.el.dom.title=msg;break;case'under':if(!this.errorEl){var elp=this.el.findParent('.x-form-element',5,true);this.errorEl=elp.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(elp.getWidth()-20);}
this.errorEl.update(msg);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;default:var t=Ext.getDom(this.msgTarget);t.innerHTML=msg;t.style.display=this.msgDisplay;break;}
this.fireEvent('invalid',this,msg);},clearInvalid:function(){if(!this.rendered){return;}
this.el.removeClass(this.invalidClass);switch(this.msgTarget){case'qtip':this.el.dom.qtip='';break;case'title':this.el.dom.title='';break;case'under':if(this.errorEl){var p=this.el.findParent('.x-form-item',5,true);if(p){p.removeClass('x-form-item-msg');Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);}}
break;default:var t=Ext.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;}
this.fireEvent('valid',this);},getRawValue:function(){return this.el.getValue();},getValue:function(){return this.el.getValue();},setRawValue:function(v){return this.el.dom.value=v;},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=v;this.validate();}}});Ext.form.Field.msgFx={normal:{show:function(msgEl,f){msgEl.setDisplayed('block');},hide:function(msgEl,f){msgEl.setDisplayed(false).update('');}},slide:{show:function(msgEl,f){msgEl.slideIn('t',{stopFx:true});},hide:function(msgEl,f){msgEl.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(msgEl,f){msgEl.fixDisplay();msgEl.alignTo(f.el,'tl-tr');msgEl.slideIn('l',{stopFx:true});},hide:function(msgEl,f){msgEl.slideOut('l',{stopFx:true,useDisplay:true});}}};

Ext.form.TextField=function(config){Ext.form.TextField.superclass.constructor.call(this,config);};Ext.extend(Ext.form.TextField,Ext.form.Field,{initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay});if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);if(this.emptyText){this.on('blur',this.postBlur,this);if(!this.value&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}}}
if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}},preFocus:function(){if(this.emptyText){if(this.getRawValue()==this.emptyText){this.setRawValue('');}
this.el.removeClass(this.emptyClass);}
if(this.selectOnFocus){this.el.dom.select();}},postBlur:function(){if(this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass);}},filterKeys:function(e){var k=e.getKey();if(!Ext.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||k==e.DELETE)){return;}
var c=e.getCharCode();if(!this.maskRe.test(String.fromCharCode(c)||'')){e.stopEvent();}},validateValue:function(value){if(value.length<1){if(this.allowBlank){this.clearInvalid();return true;}else{this.markInvalid(this.blankText);return false;}}
if(value.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false;}
if(value.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}
if(this.vtype){var vt=Ext.form.VTypes;if(!vt[this.vtype](value)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}
if(typeof this.validator=="function"){var msg=this.validator(value);if(msg!==true){this.markInvalid(msg);return false;}}
if(this.regex&&!this.regex.test(value)){this.markInvalid(this.regexText);return false;}
return true;},selectText:function(start,end){var v=this.getRawValue();if(v.length>0){start=start===undefined?0:start;end=end===undefined?v.length:end;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(start,end);}else if(d.createTextRange){var range=d.createTextRange();range.moveStart("character",start);range.moveEnd("character",v.length-end);range.select();}}},vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:'x-form-empty-field'});

Ext.form.VTypes=function(){var alpha=/^[a-zA-Z_]+$/;var alphanum=/^[a-zA-Z0-9_]+$/;var email=/^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;var url=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{'email':function(v){return email.test(v);},'emailText':'This field should be an e-mail address in the format "user@domain.com"','emailMask':/[a-z0-9_\.\-@]/i,'url':function(v){return url.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.domain.com"','alpha':function(v){return alpha.test(v);},'alphaText':'This field should only contain letters and _','alphaMask':/[a-z_]/i,'alphanum':function(v){return alphanum.test(v);},'alphanumText':'This field should only contain letters, numbers and _','alphanumMask':/[a-z0-9_]/i};}();

Ext.form.TriggerField=function(config){Ext.form.TriggerField.superclass.constructor.call(this,config);this.mimicing=false;};Ext.extend(Ext.form.TriggerField,Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},customSize:true,hideTrigger:false,setSize:function(w,h){if(!this.wrap){this.width=w;this.height=h;return;}
if(w){var wrapWidth=w;w=w-this.trigger.getWidth();Ext.form.TriggerField.superclass.setSize.call(this,w,h);this.wrap.setWidth(wrapWidth);if(this.onResize){this.onResize(wrapWidth,h);}}else{Ext.form.TriggerField.superclass.setSize.call(this,w,h);this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());}},onRender:function(ct){Ext.form.TriggerField.superclass.onRender.call(this,ct);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver('x-form-trigger-over');this.trigger.addClassOnClick('x-form-trigger-click');if(this.hideTrigger){this.trigger.setDisplayed(false);}
this.setSize(this.width||'',this.height||'');},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.mimicing=true;Ext.get(document).on("mousedown",this.mimicBlur,this);this.el.on("keydown",this.checkTab,this);}},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur();}},onBlur:function(){},mimicBlur:function(e,t){if(!this.wrap.contains(t)&&this.validateBlur()){this.triggerBlur();}},triggerBlur:function(){this.mimicing=false;Ext.get(document).un("mousedown",this.mimicBlur);this.el.un("keydown",this.checkTab,this);Ext.form.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onTriggerClick:Ext.emptyFn});

Ext.form.ComboBox=function(config){Ext.form.ComboBox.superclass.constructor.call(this,config);this.addEvents({'expand':true,'collapse':true,'beforeselect':true,'select':true,'beforequery':true});if(this.transform){var s=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=s.name;}
if(!this.store){this.mode='local';var d=[],opts=s.options;for(var i=0,len=opts.length;i<len;i++){var o=opts[i];var value=(Ext.isIE?o.getAttributeNode('value').specified:o.hasAttribute('value'))?o.value:o.text;if(o.selected){this.value=value;}
d.push([value,o.text]);}
this.store=new Ext.data.SimpleStore({'id':0,fields:['value','text'],data:d});this.valueField='value';this.displayField='text';}
s.name=Ext.id();if(!this.lazyRender){this.el=Ext.DomHelper.insertBefore(s,this.autoCreate||this.defaultAutoCreate);s.parentNode.removeChild(s);this.render(this.el.parentNode);}else{s.parentNode.removeChild(s);}}
this.selectedIndex=-1;if(this.mode=='local'){if(config.queryDelay===undefined){this.queryDelay=10;}
if(config.minChars===undefined){this.minChars=0;}}};Ext.extend(Ext.form.ComboBox,Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listWidth:undefined,displayField:undefined,valueField:undefined,hiddenName:undefined,listClass:'',selectedClass:'x-combo-selected',triggerClass:'x-form-arrow-trigger',shadow:'sides',listAlign:'tl-bl',maxHeight:300,triggerAction:'query',minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:'query',loadingText:'Loading...',resizable:false,handleHeight:8,editable:true,allQuery:'',mode:'remote',minListWidth:70,forceSelection:false,typeAheadDelay:250,valueNotFoundText:undefined,onRender:function(ct){Ext.form.ComboBox.superclass.onRender.call(this,ct);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:this.hiddenName},'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value;}
if(Ext.isGecko){this.el.dom.setAttribute('autocomplete','off');}
var cls='x-combo-list';this.list=new Ext.Layer({shadow:this.shadow,cls:[cls,this.listClass].join(' '),constrain:false});this.list.setWidth(this.listWidth||this.wrap.getWidth());this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:cls+'-hd',html:this.title});this.assetHeight+=this.header.getHeight();}
this.innerList=this.list.createChild({cls:cls+'-inner'});this.innerList.on('mouseover',this.onViewOver,this);this.innerList.on('mousemove',this.onViewMove,this);if(this.pageSize){this.footer=this.list.createChild({cls:cls+'-ft'});this.pageTb=new Ext.PagingToolbar(this.footer,this.store,{pageSize:this.pageSize});this.assetHeight+=this.footer.getHeight();}
if(!this.tpl){this.tpl='<div class="'+cls+'-item">{'+this.displayField+'}</div>';}
this.view=new Ext.View(this.innerList,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.collapse,this);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:'se'});this.resizer.on('resize',function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;this.listWidth=w;this.restrictHeight();},this);this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom',this.handleHeight+'px');}
if(!this.editable){this.editable=true;this.setEditable(false);}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else{this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.onViewClick();return true;},"esc":function(e){this.collapse();},"tab":function(e){this.onViewClick(false);return true;},scope:this,doRelay:function(foo,bar,hname){if(hname=='down'||this.scope.isExpanded()){return Ext.KeyNav.prototype.doRelay.apply(this,arguments);}
return true;}});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this);}
if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this);}
if(this.forceSelection){this.on('blur',this.doForce,this);}},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){if(this.list&&this.listWidth===undefined){this.list.setWidth(Math.max(w,this.minListWidth));}},setEditable:function(value){if(value==this.editable){return;}
if(!value){this.el.dom.setAttribute('readOnly',true);this.el.on('mousedown',this.onTriggerClick,this);this.el.addClass('x-combo-noedit');}else{this.el.dom.setAttribute('readOnly',false);this.el.un('mousedown',this.onTriggerClick,this);this.el.removeClass('x-combo-noedit');}},onBeforeLoad:function(){if(!this.hasFocus){return;}
this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+'</div>':'');this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){if(!this.hasFocus){return;}
if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.listAlign.indexOf('?')!=-1){this.list.alignTo(this.el,this.listAlign);}
if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select();}
if(!this.selectByValue(this.value,true)){this.select(0,true);}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay);}}}else{this.onEmptyResults();}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var newValue=r.data[this.displayField];var len=newValue.length;var selStart=this.getRawValue().length;if(selStart!=len){this.setRawValue(newValue);this.selectText(selStart,newValue.length);}}},onSelect:function(record,index){if(this.fireEvent('beforeselect',this,record,index)!==false){this.setValue(record.data[this.valueField||this.displayField]);this.collapse();this.fireEvent('select',this,record,index);}},getValue:function(){if(this.valueField){return this.value;}else{return Ext.form.ComboBox.superclass.getValue.call(this);}},setValue:function(v){var text=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){text=r.data[this.displayField];}else if(this.valueNotFoundText){text=this.valueNotFoundText;}}
this.lastSelectionText=text;if(this.hiddenField){this.hiddenField.value=v;}
Ext.form.ComboBox.superclass.setValue.call(this,text);this.value=v;},findRecord:function(prop,value){var record;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[prop]==value){record=r;return false;}});}
return record;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}
var item=this.view.findItemFromChild(t);if(item){var index=this.view.indexOf(item);this.select(index,false);}},onViewClick:function(doFocus){var index=this.view.getSelectedIndexes()[0];var r=this.store.getAt(index);if(r){this.onSelect(r,index);}
if(doFocus!==false){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var inner=this.innerList.dom;var h=Math.max(inner.clientHeight,inner.offsetHeight,inner.scrollHeight);this.innerList.setHeight(h<this.maxHeight?'auto':this.maxHeight);this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);this.list.sync();},onEmptyResults:function(){this.collapse();},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,scrollIntoView){if(this.value!==undefined&&this.value!==null){var r=this.findRecord(this.valueField||this.displayField,v);if(r){this.select(this.store.indexOf(r),true);return true;}}
return false;},select:function(index,scrollIntoView){this.selectedIndex=index;this.view.select(index);if(scrollIntoView!==false){var el=this.view.getNode(index);if(el){this.innerList.scrollChildIntoView(el);}}},selectNext:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return!this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;}},doQuery:function(q,forceAll){if(q===undefined||q===null){q='';}
var qe={query:q,forceAll:forceAll,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}
q=qe.query;forceAll=qe.forceAll;if(forceAll===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(forceAll){this.store.clearFilter();}else{this.store.filter(this.displayField,q);}
this.onLoad();}else{this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand();}}else{this.onLoad();}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;}
return p;},collapse:function(){if(!this.isExpanded()){return;}
this.list.hide();Ext.get(document).un('mousedown',this.collapseIf,this);this.fireEvent('collapse',this);},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse();}},expand:function(){if(this.isExpanded()){return;}
this.list.alignTo(this.el,this.listAlign);this.list.show();Ext.get(document).on('mousedown',this.collapseIf,this);this.fireEvent('expand',this);},onTriggerClick:function(){if(this.disabled){return;}
if(this.isExpanded()){this.collapse();this.el.focus();}else{this.hasFocus=true;this.doQuery(this.triggerAction=='all'?this.doQuery(this.allQuery,true):this.doQuery(this.getRawValue()));this.el.focus();}}});

Ext.grid.AbstractGridView=function(){this.grid=null;this.events={"beforerowremoved":true,"beforerowsinserted":true,"beforerefresh":true,"rowremoved":true,"rowsinserted":true,"rowupdated":true,"refresh":true};};Ext.extend(Ext.grid.AbstractGridView,Ext.util.Observable,{rowClass:"x-grid-row",cellClass:"x-grid-cell",tdClass:"x-grid-td",hdClass:"x-grid-hd",splitClass:"x-grid-hd-split",init:function(grid){this.grid=grid;var cid=this.grid.container.id;this.colSelector="#"+cid+" ."+this.cellClass+"-";this.tdSelector="#"+cid+" ."+this.tdClass+"-";this.hdSelector="#"+cid+" ."+this.hdClass+"-";this.splitSelector="#"+cid+" ."+this.splitClass+"-";},getColumnRenderers:function(){var renderers=[];var cm=this.grid.colModel;var colCount=cm.getColumnCount();for(var i=0;i<colCount;i++){renderers[i]=cm.getRenderer(i);}
return renderers;},getColumnIds:function(){var ids=[];var cm=this.grid.colModel;var colCount=cm.getColumnCount();for(var i=0;i<colCount;i++){ids[i]=cm.getColumnId(i);}
return ids;},buildIndexMap:function(){var colToData={};var dataToCol={};var cm=this.grid.colModel;var dm=this.grid.dataSource;for(var i=0,len=cm.getColumnCount();i<len;i++){var di=cm.getDataIndex(i);var trueDataIndex=dm.getIndex(di);colToData[i]=trueDataIndex;dataToCol[trueDataIndex]=i;}
return{"colToData":colToData,"dataToCol":dataToCol};},getDataIndexes:function(){if(!this.indexMap){this.indexMap=this.buildIndexMap();}
return this.indexMap.colToData;},getColumnIndexByDataIndex:function(dataIndex){if(!this.indexMap){this.indexMap=this.buildIndexMap();}
return this.indexMap.dataToCol[dataIndex];},setCSSStyle:function(colIndex,name,value){var selector="#"+this.grid.id+" .x-grid-col-"+colIndex;Ext.util.CSS.updateRule(selector,name,value);},generateRules:function(cm){var ruleBuf=[];for(var i=0,len=cm.getColumnCount();i<len;i++){var cid=cm.getColumnId(i);ruleBuf.push(this.colSelector,cid," {\n",cm.config[i].css,"}\n",this.tdSelector,cid," {\n}\n",this.hdSelector,cid," {\n}\n",this.splitSelector,cid," {\n}\n");}
return Ext.util.CSS.createStyleSheet(ruleBuf.join(""));}});

Ext.grid.AbstractSelectionModel=function(){this.locked=false;};Ext.extend(Ext.grid.AbstractSelectionModel,Ext.util.Observable,{init:function(grid){this.grid=grid;this.initEvents();},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});

Ext.grid.CellSelectionModel=function(config){Ext.apply(this,config);this.selection=null;this.events={"beforecellselect":true,"cellselect":true,"selectionchange":true};};Ext.extend(Ext.grid.CellSelectionModel,Ext.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("mousedown",this.handleMouseDown,this);this.grid.container.on(Ext.isIE?"keydown":"keypress",this.handleKeyDown,this);var view=this.grid.view;view.on("refresh",this.onViewChange,this);view.on("rowupdated",this.onRowUpdated,this);view.on("beforerowremoved",this.clearSelections,this);view.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this);}},beforeEdit:function(e){this.select(e.row,e.column,false,true,e.record);},onRowUpdated:function(v,index,r){if(this.selection&&this.selection.record==r){v.onCellSelect(index,this.selection.cell[1]);}},onViewChange:function(){this.clearSelections(true);},getSelectedCell:function(){return this.selection?this.selection.cell:null;},clearSelections:function(preventNotify){var s=this.selection;if(s){if(preventNotify!==true){this.grid.view.onCellDeselect(s.cell[0],s.cell[1]);}
this.selection=null;this.fireEvent("selectionchange",this,null);}},hasSelection:function(){return this.selection?true:false;},handleMouseDown:function(e,t){var v=this.grid.getView();if(this.isLocked()){return;};var row=v.findRowIndex(t);var cell=v.findCellIndex(t);if(row!==false&&cell!==false){this.select(row,cell);}},select:function(rowIndex,colIndex,preventViewNotify,preventFocus,r){if(this.fireEvent("beforecellselect",this,rowIndex,colIndex)!==false){this.clearSelections();r=r||this.grid.dataSource.getAt(rowIndex);this.selection={record:r,cell:[rowIndex,colIndex]};if(!preventViewNotify){var v=this.grid.getView();v.onCellSelect(rowIndex,colIndex);if(preventFocus!==true){v.focusCell(rowIndex,colIndex);}}
this.fireEvent("cellselect",this,rowIndex,colIndex);this.fireEvent("selectionchange",this,this.selection);}},isSelectable:function(rowIndex,colIndex,cm){return!cm.isHidden(colIndex);},handleKeyDown:function(e){if(!e.isNavKeyPress()){return;}
var g=this.grid,s=this.selection;if(!s){e.stopEvent();var cell=g.walkCells(0,0,1,this.isSelectable,this);if(cell){this.select(cell[0],cell[1]);}
return;}
var sm=this;var walk=function(row,col,step){return g.walkCells(row,col,step,sm.isSelectable,sm);};var k=e.getKey(),r=s.cell[0],c=s.cell[1];var newCell;switch(k){case e.TAB:if(e.shiftKey){newCell=walk(r,c-1,-1);}else{newCell=walk(r,c+1,1);}
break;case e.DOWN:newCell=walk(r+1,c,1);break;case e.UP:newCell=walk(r-1,c,-1);break;case e.RIGHT:newCell=walk(r,c+1,1);break;case e.LEFT:newCell=walk(r,c-1,-1);break;case e.ENTER:if(g.isEditor&&!g.editing){g.startEditing(r,c);e.stopEvent();return;}
break;};if(newCell){this.select(newCell[0],newCell[1]);e.stopEvent();}},acceptsNav:function(row,col,cm){return!cm.isHidden(col)&&cm.isCellEditable(col,row);},onEditorKey:function(field,e){var k=e.getKey(),newCell,g=this.grid,ed=g.activeEditor;if(k==e.TAB){if(e.shiftKey){newCell=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{newCell=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}
e.stopEvent();}else if(k==e.ENTER&&!e.ctrlKey){ed.completeEdit();e.stopEvent();}else if(k==e.ESC){ed.cancelEdit();}
if(newCell){g.startEditing(newCell[0],newCell[1]);}}});

Ext.grid.ColumnModel=function(config){Ext.grid.ColumnModel.superclass.constructor.call(this);this.config=config;this.lookup={};for(var i=0,len=config.length;i<len;i++){if(typeof config[i].dataIndex=="undefined"){config[i].dataIndex=i;}
if(typeof config[i].renderer=="string"){config[i].renderer=Ext.util.Format[config[i].renderer];}
if(typeof config[i].id=="undefined"){config[i].id=i;}
this.lookup[config[i].id]=config[i];}
this.defaultWidth=100;this.defaultSortable=false;this.events={"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true};};Ext.extend(Ext.grid.ColumnModel,Ext.util.Observable,{getColumnId:function(index){return this.config[index].id;},getColumnById:function(id){return this.lookup[id];},getIndexById:function(id){for(var i=0,len=this.config.length;i<len;i++){if(this.config[i].id==id){return i;}}
return-1;},moveColumn:function(oldIndex,newIndex){var c=this.config[oldIndex];this.config.splice(oldIndex,1);this.config.splice(newIndex,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,oldIndex,newIndex);},isLocked:function(colIndex){return this.config[colIndex].locked===true;},setLocked:function(colIndex,value,suppressEvent){if(this.isLocked(colIndex)==value){return;}
this.config[colIndex].locked=value;if(!suppressEvent){this.fireEvent("columnlockchange",this,colIndex,value);}},getTotalLockedWidth:function(){var totalWidth=0;for(var i=0;i<this.config.length;i++){if(this.isLocked(i)&&!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}
return totalWidth;},getLockedCount:function(){for(var i=0,len=this.config.length;i<len;i++){if(!this.isLocked(i)){return i;}}},getColumnCount:function(visibleOnly){if(visibleOnly==true){var c=0;for(var i=0,len=this.config.length;i<len;i++){if(!this.isHidden(i)){c++;}}
return c;}
return this.config.length;},isSortable:function(col){if(typeof this.config[col].sortable=="undefined"){return this.defaultSortable;}
return this.config[col].sortable;},getRenderer:function(col){if(!this.config[col].renderer){return Ext.grid.ColumnModel.defaultRenderer;}
return this.config[col].renderer;},setRenderer:function(col,fn){this.config[col].renderer=fn;},getColumnWidth:function(col){return this.config[col].width||this.defaultWidth;},setColumnWidth:function(col,width,suppressEvent){this.config[col].width=width;this.totalWidth=null;if(!suppressEvent){this.fireEvent("widthchange",this,col,width);}},getTotalWidth:function(includeHidden){if(!this.totalWidth){this.totalWidth=0;for(var i=0,len=this.config.length;i<len;i++){if(includeHidden||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}}
return this.totalWidth;},getColumnHeader:function(col){return this.config[col].header;},setColumnHeader:function(col,header){this.config[col].header=header;this.fireEvent("headerchange",this,col,header);},getColumnTooltip:function(col){return this.config[col].tooltip;},setColumnTooltip:function(col,tooltip){this.config[col].tooltip=tooltip;},getDataIndex:function(col){return this.config[col].dataIndex;},setDataIndex:function(col,dataIndex){this.config[col].dataIndex=dataIndex;},findColumnIndex:function(dataIndex){var c=this.config;for(var i=0,len=c.length;i<len;i++){if(c[i].dataIndex==dataIndex){return i;}}
return-1;},isCellEditable:function(colIndex,rowIndex){return(this.config[colIndex].editable||(typeof this.config[colIndex].editable=="undefined"&&this.config[colIndex].editor))?true:false;},getCellEditor:function(colIndex,rowIndex){return this.config[colIndex].editor;},setEditable:function(col,editable){this.config[col].editable=editable;},isHidden:function(colIndex){return this.config[colIndex].hidden;},isFixed:function(colIndex){return this.config[colIndex].fixed;},isResizable:function(colIndex){return this.config[colIndex].resizable!==false;},setHidden:function(colIndex,hidden){this.config[colIndex].hidden=hidden;this.totalWidth=null;this.fireEvent("hiddenchange",this,colIndex,hidden);},setEditor:function(col,editor){this.config[col].editor=editor;}});Ext.grid.ColumnModel.defaultRenderer=function(value){if(typeof value=="string"&&value.length<1){return"&#160;";}
return value;};Ext.grid.DefaultColumnModel=Ext.grid.ColumnModel;

Ext.grid.Grid=function(container,config){this.container=Ext.get(container);this.container.update("");this.container.setStyle("overflow","hidden");this.container.addClass('x-grid-container');this.id=this.container.id;Ext.apply(this,config);if(this.ds){this.dataSource=this.ds;delete this.ds;}
if(this.cm){this.colModel=this.cm;delete this.cm;}
if(this.sm){this.selModel=this.sm;delete this.sm;}
if(this.width){this.container.setWidth(this.width);}
if(this.height){this.container.setHeight(this.height);}
this.events={"click":true,"dblclick":true,"contextmenu":true,"mousedown":true,"mouseup":true,"mouseover":true,"mouseout":true,"keypress":true,"keydown":true,"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"headerclick":true,"headerdblclick":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"bodyscroll":true,"columnresize":true,"columnmove":true,"startdrag":true,"enddrag":true,"dragdrop":true,"dragover":true,"dragenter":true,"dragout":true};};Ext.extend(Ext.grid.Grid,Ext.util.Observable,{minColumnWidth:25,autoSizeColumns:false,autoSizeHeaders:true,monitorWindowResize:true,maxRowsToMeasure:0,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableRowHeightSync:false,stripeRows:true,autoHeight:false,autoExpandColumn:false,view:null,allowTextSelectionPattern:/INPUT|TEXTAREA|SELECT/i,render:function(){var c=this.container;if((!c.dom.offsetHeight||c.dom.offsetHeight<20)||c.getStyle("height")=="auto"){this.autoHeight=true;}
var view=this.getView();view.init(this);c.on("click",this.onClick,this);c.on("dblclick",this.onDblClick,this);c.on("contextmenu",this.onContextMenu,this);c.on("keydown",this.onKeyDown,this);this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);view.render();return this;},reconfigure:function(dataSource,colModel){this.view.bind(dataSource,colModel);this.dataSource=dataSource;this.colModel=colModel;this.view.refresh(true);},onKeyDown:function(e){this.fireEvent("keydown",e);},destroy:function(removeEl,keepListeners){var c=this.container;c.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();if(!keepListeners){this.purgeListeners();}
c.update("");if(removeEl===true){c.remove();}},processEvent:function(name,e){this.fireEvent(name,e);var t=e.getTarget();var v=this.view;var header=v.findHeaderIndex(t);if(header!==false){this.fireEvent("header"+name,this,header,e);}else{var row=v.findRowIndex(t);var cell=v.findCellIndex(t);if(row!==false){this.fireEvent("row"+name,this,row,e);if(cell!==false){this.fireEvent("cell"+name,this,row,cell,e);}}}},onClick:function(e){this.processEvent("click",e);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},onDblClick:function(e){this.processEvent("dblclick",e);},walkCells:function(row,col,step,fn,scope){var cm=this.colModel,clen=cm.getColumnCount();var ds=this.dataSource,rlen=ds.getCount(),first=true;if(step<0){if(col<0){row--;first=false;}
while(row>=0){if(!first){col=clen-1;}
first=false;while(col>=0){if(fn.call(scope||this,row,col,cm)===true){return[row,col];}
col--;}
row--;}}else{if(col>=clen){row++;first=false;}
while(row<rlen){if(!first){col=0;}
first=false;while(col<clen){if(fn.call(scope||this,row,col,cm)===true){return[row,col];}
col++;}
row++;}}
return null;},getSelections:function(){return this.selModel.getSelections();},autoSize:function(){if(this.view){this.view.layout();if(this.view.adjustForScroll){this.view.adjustForScroll();}}},stopEditing:function(){},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel();}
return this.selModel;},getDataSource:function(){return this.dataSource;},getColumnModel:function(){return this.colModel;},getView:function(){if(!this.view){this.view=new Ext.grid.GridView();}
return this.view;},getDragDropText:function(){return this.ddText.replace("%0",this.selModel.getCount());}});Ext.grid.Grid.prototype.ddText="%0 selected row(s)";

Ext.grid.GridView=function(config){Ext.grid.GridView.superclass.constructor.call(this);this.el=null;Ext.apply(this,config);};Ext.extend(Ext.grid.GridView,Ext.grid.AbstractGridView,{rowClass:"x-grid-row",cellClass:"x-grid-col",tdClass:"x-grid-td",hdClass:"x-grid-hd",splitClass:"x-grid-split",sortClasses:["sort-asc","sort-desc"],enableMoveAnim:false,hlColor:"C3DAF9",dh:Ext.DomHelper,fly:Ext.Element.fly,css:Ext.util.CSS,borderWidth:1,splitOffset:3,scrollIncrement:22,cellRE:/(?:.*?)x-grid-(?:hd|cell|csplit)-(?:[\d]+)-([\d]+)(?:.*?)/,findRE:/\s?(?:x-grid-hd|x-grid-col|x-grid-csplit)\s/,init:function(grid){Ext.grid.GridView.superclass.init.call(this,grid);this.bind(grid.dataSource,grid.colModel);grid.on("headerclick",this.handleHeaderClick,this);if(grid.trackMouseOver){grid.on("mouseover",this.onRowOver,this);grid.on("mouseout",this.onRowOut,this);}
grid.cancelTextSelection=function(){};this.gridId=grid.id;var tpls=this.templates||{};if(!tpls.master){tpls.master=new Ext.Template('<div class="x-grid" hidefocus="true">','<div class="x-grid-topbar"></div>','<div class="x-grid-scroller"><div></div></div>','<div class="x-grid-locked">','<div class="x-grid-header">{lockedHeader}</div>','<div class="x-grid-body">{lockedBody}</div>',"</div>",'<div class="x-grid-viewport">','<div class="x-grid-header">{header}</div>','<div class="x-grid-body">{body}</div>',"</div>",'<div class="x-grid-bottombar"></div>','<a href="#" class="x-grid-focus" tabIndex="-1"></a>','<div class="x-grid-resize-proxy">&#160;</div>',"</div>");tpls.master.disableformats=true;}
if(!tpls.header){tpls.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0">','<tbody><tr class="x-grid-hd-row">{cells}</tr></tbody>',"</table>{splits}");tpls.header.disableformats=true;}
tpls.header.compile();if(!tpls.hcell){tpls.hcell=new Ext.Template('<td class="x-grid-hd x-grid-td-{id} {cellId}"><div title="{title}" class="x-grid-hd-inner x-grid-hd-{id}">','<div class="x-grid-hd-text" unselectable="on">{value}<img class="x-grid-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" /></div>',"</div></td>");tpls.hcell.disableFormats=true;}
tpls.hcell.compile();if(!tpls.hsplit){tpls.hsplit=new Ext.Template('<div class="x-grid-split {splitId} x-grid-split-{id}" unselectable="on">&#160;</div>');tpls.hsplit.disableFormats=true;}
tpls.hsplit.compile();if(!tpls.body){tpls.body=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0">',"<tbody>{rows}</tbody>","</table>");tpls.body.disableFormats=true;}
tpls.body.compile();if(!tpls.row){tpls.row=new Ext.Template('<tr class="x-grid-row {alt}">{cells}</tr>');tpls.row.disableFormats=true;}
tpls.row.compile();if(!tpls.cell){tpls.cell=new Ext.Template('<td class="x-grid-col x-grid-td-{id} {cellId} {css}" tabIndex="0">','<div class="x-grid-col-{id} x-grid-cell-inner"><div class="x-grid-cell-text" unselectable="on" {attr}>{value}</div></div>',"</td>");tpls.cell.disableFormats=true;}
if(!tpls.rowMarker){tpls.rowMarker=new Ext.Template('<td class="x-grid-row-marker">','<div class="x-grid-col-{id} x-grid-cell-inner"><div class="x-grid-cell-text" unselectable="on" {attr}>{value}</div></div>',"</td>");tpls.cell.disableFormats=true;}
tpls.cell.compile();this.templates=tpls;},bind:function(ds,cm){if(this.ds){this.ds.un("load",this.scrollToTop,this);this.ds.un("datachanged",this.onDataChange);this.ds.un("add",this.onAdd);this.ds.un("remove",this.onRemove);this.ds.un("update",this.onUpdate);this.ds.un("clear",this.onClear);}
if(ds){ds.on("load",this.scrollToTop,this);ds.on("datachanged",this.onDataChange,this);ds.on("add",this.onAdd,this);ds.on("remove",this.onRemove,this);ds.on("update",this.onUpdate,this);ds.on("clear",this.onClear,this);}
this.ds=ds;if(this.cm){this.cm.un("widthchange",this.updateColumns,this);this.cm.un("headerchange",this.updateHeaders,this);this.cm.un("hiddenchange",this.handleHiddenChange,this);this.cm.un("columnmoved",this.handleColumnMove,this);this.cm.un("columnlockchange",this.handleLockChange,this);}
if(cm){this.generateRules(cm);cm.on("widthchange",this.updateColumns,this);cm.on("headerchange",this.updateHeaders,this);cm.on("hiddenchange",this.handleHiddenChange,this);cm.on("columnmoved",this.handleColumnMove,this);cm.on("columnlockchange",this.handleLockChange,this);}
this.cm=cm;},onDataChange:function(){this.refresh();this.updateHeaderSortState();},onClear:function(){this.refresh();},onUpdate:function(ds,record){this.refreshRow(record);},refreshRow:function(record){var ds=this.ds,index;if(typeof record=='number'){index=record;record=ds.getAttribute(index);}else{index=ds.indexOf(record);}
var rows=this.getRowComposite(index);var cls=[];this.insertRows(ds,index,index,true);this.onRemove(ds,record,index+1,true);this.syncRowHeights(index,index);this.layout();this.fireEvent("rowupdated",this,index,record);},onAdd:function(ds,records,index){this.insertRows(ds,index,index+(records.length-1));},onRemove:function(ds,record,index,isUpdate){if(isUpdate!==true){this.fireEvent("beforerowremoved",this,index,record);}
var bt=this.getBodyTable(),lt=this.getLockedTable();if(bt.rows[index]){bt.firstChild.removeChild(bt.rows[index]);}
if(lt.rows[index]){lt.firstChild.removeChild(lt.rows[index]);}
if(isUpdate!==true){this.stripeRows(index);this.syncRowHeights(index,index);this.layout();this.fireEvent("rowremoved",this,index,record);}},scrollToTop:function(){if(this.scroller){this.scroller.dom.scrollTop=0;this.syncScroll();}},getHeaderPanel:function(doShow){if(doShow){this.headerPanel.show();}
return this.headerPanel;},getFooterPanel:function(doShow){if(doShow){this.footerPanel.show();}
return this.footerPanel;},initElements:function(){var E=Ext.Element;var el=this.grid.container.dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.headerPanel=new E(el.firstChild);this.headerPanel.enableDisplayMode("block");this.scroller=new E(cs[1]);this.scrollSizer=new E(this.scroller.dom.firstChild);this.lockedWrap=new E(cs[2]);this.lockedHd=new E(this.lockedWrap.dom.firstChild);this.lockedBody=new E(this.lockedWrap.dom.childNodes[1]);this.mainWrap=new E(cs[3]);this.mainHd=new E(this.mainWrap.dom.firstChild);this.mainBody=new E(this.mainWrap.dom.childNodes[1]);this.footerPanel=new E(cs[4]);this.footerPanel.enableDisplayMode("block");this.focusEl=new E(cs[5]);this.focusEl.swallowEvent("click",true);this.resizeProxy=new E(cs[6]);this.headerSelector=String.format('#{0} td.x-grid-hd, #{1} td.x-grid-hd',this.lockedHd.id,this.mainHd.id);this.splitterSelector=String.format('#{0} div.x-grid-split, #{1} div.x-grid-split',this.lockedHd.id,this.mainHd.id);},getHeaderCell:function(index){return Ext.DomQuery.select(this.headerSelector)[index];},getHeaderCellMeasure:function(index){return this.getHeaderCell(index).firstChild;},getHeaderCellText:function(index){return this.getHeaderCell(index).firstChild.firstChild;},getLockedTable:function(){return this.lockedBody.dom.firstChild;},getBodyTable:function(){return this.mainBody.dom.firstChild;},getLockedRow:function(index){return this.getLockedTable().rows[index];},getRow:function(index){return this.getBodyTable().rows[index];},getRowComposite:function(index){if(!this.rowEl){this.rowEl=new Ext.CompositeElementLite();}
var els=[],lrow,mrow;if(lrow=this.getLockedRow(index)){els.push(lrow);}
if(mrow=this.getRow(index)){els.push(mrow);}
this.rowEl.elements=els;return this.rowEl;},getCell:function(rowIndex,colIndex){var locked=this.cm.getLockedCount();var source;if(colIndex<locked){source=this.lockedBody.dom.firstChild;}else{source=this.mainBody.dom.firstChild;colIndex-=locked;}
return source.rows[rowIndex].childNodes[colIndex];},getCellText:function(rowIndex,colIndex){return this.getCell(rowIndex,colIndex).firstChild.firstChild;},getCellBox:function(cell){var b=this.fly(cell).getBox();if(Ext.isOpera){b.y=cell.offsetTop+this.mainBody.getY();}
return b;},getCellIndex:function(cell){var id=String(cell.className).match(this.cellRE);if(id){return parseInt(id[1],10);}
return 0;},findHeaderIndex:function(n){var r=Ext.fly(n).findParent("td."+this.hdClass,6);return r?this.getCellIndex(r):false;},findHeaderCell:function(n){var r=Ext.fly(n).findParent("td."+this.hdClass,6);return r?r:false;},findRowIndex:function(n){var r=Ext.fly(n).findParent("tr."+this.rowClass,6);return r?r.rowIndex:false;},findCellIndex:function(node){var stop=this.el.dom;while(node&&node!=stop){if(this.findRE.test(node.className)){return this.getCellIndex(node);}
node=node.parentNode;}
return false;},getColumnId:function(index){return this.cm.getColumnId(index);},getSplitters:function(){if(this.splitterSelector){return Ext.DomQuery.select(this.splitterSelector);}else{return null;}},getSplitter:function(index){return this.getSplitters()[index];},onRowOver:function(e,t){var row;if((row=this.findRowIndex(t))!==false){this.getRowComposite(row).addClass("x-grid-row-over");}},onRowOut:function(e,t){var row;if((row=this.findRowIndex(t))!==false&&row!==this.findRowIndex(e.getRelatedTarget())){this.getRowComposite(row).removeClass("x-grid-row-over");}},renderHeaders:function(){var cm=this.cm;var ct=this.templates.hcell,ht=this.templates.header,st=this.templates.hsplit;var cb=[],lb=[],sb=[],lsb=[],p={};for(var i=0,len=cm.getColumnCount();i<len;i++){p.cellId="x-grid-hd-0-"+i;p.splitId="x-grid-csplit-0-"+i;p.id=cm.getColumnId(i);p.title=cm.getColumnTooltip(i)||"";p.value=cm.getColumnHeader(i)||"";if(!cm.isLocked(i)){cb[cb.length]=ct.apply(p);sb[sb.length]=st.apply(p);}else{lb[lb.length]=ct.apply(p);lsb[lsb.length]=st.apply(p);}}
return[ht.apply({cells:lb.join(""),splits:lsb.join("")}),ht.apply({cells:cb.join(""),splits:sb.join("")})];},updateHeaders:function(){var html=this.renderHeaders();this.lockedHd.update(html[0]);this.mainHd.update(html[1]);},focusRow:function(row){var x=this.scroller.dom.scrollLeft;this.focusCell(row,0,false);this.scroller.dom.scrollLeft=x;},focusCell:function(row,col,hscroll){var el=this.ensureVisible(row,col,hscroll);this.focusEl.alignTo(el,"tl-tl");this.focusEl.focus.defer(1,this.focusEl);},ensureVisible:function(row,col,hscroll){if(typeof row!="number"){row=row.rowIndex;}
if(row<0&&row>=this.ds.getCount()){return;}
col=(col!==undefined?col:0);var cm=this.grid.colModel;while(cm.isHidden(col)){col++;}
var el=this.getCell(row,col);if(!el){return;}
var c=this.scroller.dom;var ctop=parseInt(el.offsetTop,10);var cleft=parseInt(el.offsetLeft,10);var cbot=ctop+el.offsetHeight;var cright=cleft+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var stop=parseInt(c.scrollTop,10);var sleft=parseInt(c.scrollLeft,10);var sbot=stop+ch;var sright=sleft+c.clientWidth;if(ctop<stop){c.scrollTop=ctop;}else if(cbot>sbot){c.scrollTop=cbot-ch;}
if(hscroll!==false){if(cleft<sleft){c.scrollLeft=cleft;}else if(cright>sright){c.scrollLeft=cright-c.clientWidth;}}
return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,colIds=this.getColumnIds();var pos=0;for(var i=0,len=cm.getColumnCount();i<len;i++){var w=cm.getColumnWidth(i);this.css.updateRule(this.colSelector+colIds[i],"width",(w-this.borderWidth)+"px");this.css.updateRule(this.hdSelector+colIds[i],"width",(w-this.borderWidth)+"px");}
this.updateSplitters();},updateSplitters:function(){var cm=this.cm,s=this.getSplitters();if(s){var pos=0,locked=true;for(var i=0,len=cm.getColumnCount();i<len;i++){if(cm.isHidden(i))continue;var w=cm.getColumnWidth(i);if(!cm.isLocked(i)&&locked){pos=0;locked=false;}
pos+=w;s[i].style.left=(pos-this.splitOffset)+"px";}}},handleHiddenChange:function(colModel,colIndex,hidden){if(hidden){this.hideColumn(colIndex);}else{this.unhideColumn(colIndex);}},hideColumn:function(colIndex){var cid=this.getColumnId(colIndex);this.css.updateRule(this.tdSelector+cid,"display","none");this.css.updateRule(this.splitSelector+cid,"display","none");if(Ext.isSafari){this.updateHeaders();}
this.updateSplitters();this.layout();},unhideColumn:function(colIndex){var cid=this.getColumnId(colIndex);this.css.updateRule(this.tdSelector+cid,"display","");this.css.updateRule(this.splitSelector+cid,"display","");if(Ext.isSafari){this.updateHeaders();}
this.updateSplitters();this.layout();},insertRows:function(dm,firstRow,lastRow,isUpdate){if(firstRow==0&&lastRow==dm.getCount()-1){this.refresh();}else{if(!isUpdate){this.fireEvent("beforerowsinserted",this,firstRow,lastRow);}
var s=this.getScrollState();var markup=this.renderRows(firstRow,lastRow);this.bufferRows(markup[0],this.getLockedTable(),firstRow);this.bufferRows(markup[1],this.getBodyTable(),firstRow);this.restoreScroll(s);if(!isUpdate){this.fireEvent("rowsinserted",this,firstRow,lastRow);this.syncRowHeights(firstRow,lastRow);this.stripeRows(firstRow);this.layout();}}},bufferRows:function(markup,target,index){var before=null,trows=target.rows,tbody=target.tBodies[0];if(index<trows.length){before=trows[index];}
var b=document.createElement("div");b.innerHTML="<table><tbody>"+markup+"</tbody></table>";var rows=b.firstChild.rows;for(var i=0,len=rows.length;i<len;i++){if(before){tbody.insertBefore(rows[0],before);}else{tbody.appendChild(rows[0]);}}
b.innerHTML="";b=null;},deleteRows:function(dm,firstRow,lastRow){if(dm.getRowCount()<1){this.fireEvent("beforerefresh",this);this.mainBody.update("");this.lockedBody.update("");this.fireEvent("refresh",this);}else{this.fireEvent("beforerowsdeleted",this,firstRow,lastRow);var bt=this.getBodyTable();var tbody=bt.firstChild;var rows=bt.rows;for(var rowIndex=firstRow;rowIndex<=lastRow;rowIndex++){tbody.removeChild(rows[firstRow]);}
this.stripeRows(firstRow);this.fireEvent("rowsdeleted",this,firstRow,lastRow);}},updateRows:function(dataSource,firstRow,lastRow){var s=this.getScrollState();this.refresh();this.restoreScroll(s);},handleSort:function(dataSource,sortColumnIndex,sortDir,noRefresh){if(!noRefresh){this.refresh();}
this.updateHeaderSortState();},getScrollState:function(){var sb=this.scroller.dom;return{left:sb.scrollLeft,top:sb.scrollTop};},stripeRows:function(startRow){if(!this.grid.stripeRows||this.ds.getCount()<1){return;}
startRow=startRow||0;var rows=this.getBodyTable().rows;var lrows=this.getLockedTable().rows;var cls=' x-grid-row-alt ';for(var i=startRow,len=rows.length;i<len;i++){var row=rows[i],lrow=lrows[i];var isAlt=((i+1)%2==0);var hasAlt=(' '+row.className+' ').indexOf(cls)!=-1;if(isAlt==hasAlt){continue;}
if(isAlt){row.className+=" x-grid-row-alt";}else{row.className=row.className.replace("x-grid-row-alt","");}
if(lrow){lrow.className=row.className;}}},restoreScroll:function(state){var sb=this.scroller.dom;sb.scrollLeft=state.left;sb.scrollTop=state.top;this.syncScroll();},syncScroll:function(){var sb=this.scroller.dom;var sh=this.mainHd.dom;var bs=this.mainBody.dom;var lv=this.lockedBody.dom;sh.scrollLeft=bs.scrollLeft=sb.scrollLeft;lv.scrollTop=bs.scrollTop=sb.scrollTop;},handleScroll:function(e){this.syncScroll();var sb=this.scroller.dom;this.grid.fireEvent("bodyscroll",sb.scrollLeft,sb.scrollTop);e.stopEvent();},handleWheel:function(e){var d=e.getWheelDelta();this.scroller.dom.scrollTop-=d*22;this.lockedBody.dom.scrollTop=this.mainBody.dom.scrollTop=this.scroller.dom.scrollTop;e.stopEvent();},renderRows:function(startRow,endRow){var g=this.grid,cm=g.colModel,ds=g.dataSource,stripe=g.stripeRows;var colCount=cm.getColumnCount();if(ds.getCount()<1){return["",""];}
var cs=[];for(var i=0;i<colCount;i++){var name=cm.getDataIndex(i);cs[i]={name:typeof name=='undefined'?ds.fields.get(i).name:name,renderer:cm.getRenderer(i),id:cm.getColumnId(i),locked:cm.isLocked(i)};}
startRow=startRow||0;endRow=typeof endRow=="undefined"?ds.getCount()-1:endRow;var rs=ds.getRange(startRow,endRow);return this.doRender(cs,rs,ds,startRow,colCount,stripe);},doRender:Ext.isGecko?function(cs,rs,ds,startRow,colCount,stripe){var ts=this.templates,ct=ts.cell,rt=ts.row;var buf="",lbuf="",cb,lcb,c,p={},rp={},r;for(var j=0,len=rs.length;j<len;j++){r=rs[j],cb="",lcb="",rowIndex=(j+startRow);for(var i=0;i<colCount;i++){c=cs[i];p.cellId="x-grid-cell-"+rowIndex+"-"+i;p.id=c.id;p.css=p.attr="";p.value=c.renderer(r.data[c.name],p,r,rowIndex,i,ds);if(p.value==undefined||p.value==="")p.value="&#160;";if(r.dirty&&typeof r.modified[c.name]!=='undefined'){p.css+=p.css?' x-grid-dirty-cell':'x-grid-dirty-cell';}
var markup=ct.apply(p);if(!c.locked){cb+=markup;}else{lcb+=markup;}}
var alt=[];if(stripe&&((rowIndex+1)%2==0)){alt[0]="x-grid-row-alt";}
if(r.dirty){alt[1]=" x-grid-dirty-row";}
rp.cells=lcb;if(this.getRowClass){alt[2]=this.getRowClass(r,rowIndex);}
rp.alt=alt.join(" ");lbuf+=rt.apply(rp);rp.cells=cb;buf+=rt.apply(rp);}
return[lbuf,buf];}:function(cs,rs,ds,startRow,colCount,stripe){var ts=this.templates,ct=ts.cell,rt=ts.row;var buf=[],lbuf=[],cb,lcb,c,p={},rp={},r;for(var j=0,len=rs.length;j<len;j++){r=rs[j],cb=[],lcb=[],rowIndex=(j+startRow);for(var i=0;i<colCount;i++){c=cs[i];p.cellId="x-grid-cell-"+rowIndex+"-"+i;p.id=c.id;p.css=p.attr="";p.value=c.renderer(r.data[c.name],p,r,rowIndex,i,ds);if(p.value==undefined||p.value==="")p.value="&#160;";if(r.dirty&&typeof r.modified[c.name]!=='undefined'){p.css+=p.css?' x-grid-dirty-cell':'x-grid-dirty-cell';}
var markup=ct.apply(p);if(!c.locked){cb[cb.length]=markup;}else{lcb[lcb.length]=markup;}}
var alt=[];if(stripe&&((rowIndex+1)%2==0)){alt[0]="x-grid-row-alt";}
if(r.dirty){alt[1]=" x-grid-dirty-row";}
rp.cells=lcb;if(this.getRowClass){alt[2]=this.getRowClass(r,rowIndex);}
rp.alt=alt.join(" ");rp.cells=lcb.join("");lbuf[lbuf.length]=rt.apply(rp);rp.cells=cb.join("");buf[buf.length]=rt.apply(rp);}
return[lbuf.join(""),buf.join("")];},renderBody:function(){var markup=this.renderRows();var bt=this.templates.body;return[bt.apply({rows:markup[0]}),bt.apply({rows:markup[1]})];},refresh:function(headersToo){this.fireEvent("beforerefresh",this);this.grid.stopEditing();var result=this.renderBody();this.lockedBody.update(result[0]);this.mainBody.update(result[1]);if(headersToo===true){this.updateHeaders();this.updateColumns();this.updateSplitters();this.updateHeaderSortState();}
this.syncRowHeights();this.layout();this.fireEvent("refresh",this);},handleColumnMove:function(cm,oldIndex,newIndex){this.indexMap=null;var s=this.getScrollState();this.refresh(true);this.restoreScroll(s);this.afterMove(newIndex);},afterMove:function(colIndex){if(this.enableMoveAnim&&Ext.enableFx){this.fly(this.getHeaderCell(colIndex).firstChild).highlight(this.hlColor);}},updateCell:function(dm,rowIndex,dataIndex){var colIndex=this.getColumnIndexByDataIndex(dataIndex);if(typeof colIndex=="undefined"){return;}
var cm=this.grid.colModel;var cell=this.getCell(rowIndex,colIndex);var cellText=this.getCellText(rowIndex,colIndex);var p={cellId:"x-grid-cell-"+rowIndex+"-"+colIndex,id:cm.getColumnId(colIndex),css:colIndex==cm.getColumnCount()-1?"x-grid-col-last":""};var renderer=cm.getRenderer(colIndex);var val=renderer(dm.getValueAt(rowIndex,dataIndex),p,rowIndex,colIndex,dm);if(typeof val=="undefined"||val==="")val="&#160;";cellText.innerHTML=val;cell.className=this.cellClass+" "+p.cellId+" "+p.css;this.syncRowHeights(rowIndex,rowIndex);},calcColumnWidth:function(colIndex,maxRowsToMeasure){var maxWidth=0;if(this.grid.autoSizeHeaders){var h=this.getHeaderCellMeasure(colIndex);maxWidth=Math.max(maxWidth,h.scrollWidth);}
var tb,index;if(this.cm.isLocked(colIndex)){tb=this.getLockedTable();index=colIndex;}else{tb=this.getBodyTable();index=colIndex-this.cm.getLockedCount();}
if(tb&&tb.rows){var rows=tb.rows;var stopIndex=Math.min(maxRowsToMeasure||rows.length,rows.length);for(var i=0;i<stopIndex;i++){var cell=rows[i].childNodes[index].firstChild;maxWidth=Math.max(maxWidth,cell.scrollWidth);}}
return maxWidth+5;},autoSizeColumn:function(colIndex,forceMinSize,suppressEvent){if(this.cm.isHidden(colIndex)){return;}
if(forceMinSize){var cid=this.cm.getColumnId(colIndex);this.css.updateRule(this.colSelector+cid,"width",this.grid.minColumnWidth+"px");if(this.grid.autoSizeHeaders){this.css.updateRule(this.hdSelector+cid,"width",this.grid.minColumnWidth+"px");}}
var newWidth=this.calcColumnWidth(colIndex);this.cm.setColumnWidth(colIndex,Math.max(this.grid.minColumnWidth,newWidth),suppressEvent);if(!suppressEvent){this.grid.fireEvent("columnresize",colIndex,newWidth);}},autoSizeColumns:function(){var cm=this.grid.colModel;var colCount=cm.getColumnCount();for(var i=0;i<colCount;i++){this.autoSizeColumn(i,true,true);}
if(cm.getTotalWidth()<this.scroller.dom.clientWidth){this.fitColumns();}else{this.updateColumns();this.layout();}},fitColumns:function(reserveScrollSpace){var cm=this.grid.colModel;var colCount=cm.getColumnCount();var cols=[];var width=0;var i,w;for(i=0;i<colCount;i++){if(!cm.isHidden(i)&&!cm.isFixed(i)){w=cm.getColumnWidth(i);cols.push(i);cols.push(w);width+=w;}}
var avail=Math.min(this.scroller.dom.clientWidth,this.el.getWidth());if(reserveScrollSpace){avail-=17;}
var frac=(avail-cm.getTotalWidth())/width;while(cols.length){w=cols.pop();i=cols.pop();cm.setColumnWidth(i,Math.floor(w+w*frac),true);}
this.updateColumns();this.layout();},onRowSelect:function(rowIndex){var row=this.getRowComposite(rowIndex);row.addClass("x-grid-row-selected");},onRowDeselect:function(rowIndex){var row=this.getRowComposite(rowIndex);row.removeClass("x-grid-row-selected");},onCellSelect:function(row,col){var cell=this.getCell(row,col);if(cell){Ext.fly(cell).addClass("x-grid-cell-selected");}},onCellDeselect:function(row,col){var cell=this.getCell(row,col);if(cell){Ext.fly(cell).removeClass("x-grid-cell-selected");}},updateHeaderSortState:function(){var state=this.ds.getSortState();if(!state){return;}
this.sortState=state;var sortColumn=this.cm.findColumnIndex(state.field);if(sortColumn!=-1){var sortDir=state.direction;var sc=this.sortClasses;var hds=this.el.select(this.headerSelector).removeClass(sc);hds.item(sortColumn).addClass(sc[sortDir=="DESC"?1:0]);}},handleHeaderClick:function(g,index){if(this.headersDisabled){return;}
var dm=g.dataSource,cm=g.colModel;if(!cm.isSortable(index)){return;}
g.stopEditing();dm.sort(cm.getDataIndex(index));},destroy:function(){this.bind(null,null);},handleLockChange:function(){this.refresh(true);},onDenyColumnLock:function(){},onDenyColumnHide:function(){},handleHdMenuClick:function(item){var index=this.hdCtxIndex;var cm=this.cm,ds=this.ds;switch(item.id){case"asc":ds.sort(cm.getDataIndex(index),"ASC");break;case"desc":ds.sort(cm.getDataIndex(index),"DESC");break;case"lock":var lc=cm.getLockedCount();if(cm.getColumnCount(true)<=lc+1){this.onDenyColumnLock();return;}
if(lc!=index){cm.setLocked(index,true,true);cm.moveColumn(index,lc);this.grid.fireEvent("columnmove",index,lc);}else{cm.setLocked(index,true);}
break;case"unlock":var lc=cm.getLockedCount();if((lc-1)!=index){cm.setLocked(index,false,true);cm.moveColumn(index,lc-1);this.grid.fireEvent("columnmove",index,lc-1);}else{cm.setLocked(index,false);}
break;default:index=cm.getIndexById(item.id.substr(4));if(index!=-1){if(item.checked&&cm.getColumnCount(true)<=1){this.onDenyColumnHide();return false;}
cm.setHidden(index,item.checked);}}
return true;},beforeColMenuShow:function(){var cm=this.cm,colCount=cm.getColumnCount();this.colMenu.removeAll();for(var i=0;i<colCount;i++){this.colMenu.add(new Ext.menu.CheckItem({id:"col-"+cm.getColumnId(i),text:cm.getColumnHeader(i),checked:!cm.isHidden(i),hideOnClick:false}));}},handleHdCtx:function(g,index,e){e.stopEvent();var hd=this.getHeaderCell(index);this.hdCtxIndex=index;var ms=this.hmenu.items,cm=this.cm;ms.get("asc").setDisabled(!cm.isSortable(index));ms.get("desc").setDisabled(!cm.isSortable(index));if(this.grid.enableColLock!==false){ms.get("lock").setDisabled(cm.isLocked(index));ms.get("unlock").setDisabled(!cm.isLocked(index));}
this.hmenu.show(hd,"tl-bl");},handleHdOver:function(e){var hd=this.findHeaderCell(e.getTarget());if(hd&&!this.headersDisabled){if(this.grid.colModel.isSortable(this.getCellIndex(hd))){this.fly(hd).addClass("x-grid-hd-over");}}},handleHdOut:function(e){var hd=this.findHeaderCell(e.getTarget());if(hd){this.fly(hd).removeClass("x-grid-hd-over");}},handleSplitDblClick:function(e,t){var i=this.getCellIndex(t);this.autoSizeColumn(i,true);this.layout();},render:function(){var cm=this.cm;var colCount=cm.getColumnCount();if(this.grid.monitorWindowResize===true){Ext.EventManager.onWindowResize(this.onWindowResize,this,true);}
var header=this.renderHeaders();var body=this.templates.body.apply({rows:""});var html=this.templates.master.apply({lockedBody:body,body:body,lockedHeader:header[0],header:header[1]});this.updateColumns();this.grid.container.dom.innerHTML=html;this.initElements();this.scroller.on("scroll",this.handleScroll,this);this.lockedBody.on("mousewheel",this.handleWheel,this);this.mainBody.on("mousewheel",this.handleWheel,this);this.mainHd.on("mouseover",this.handleHdOver,this);this.mainHd.on("mouseout",this.handleHdOut,this);this.mainHd.on("dblclick",this.handleSplitDblClick,this,{delegate:"."+this.splitClass});this.lockedHd.on("mouseover",this.handleHdOver,this);this.lockedHd.on("mouseout",this.handleHdOut,this);this.lockedHd.on("dblclick",this.handleSplitDblClick,this,{delegate:"."+this.splitClass});if(this.grid.enableColumnResize!==false){new Ext.grid.SplitDragZone(this.grid,this.lockedHd.dom,this.mainHd.dom);}
this.updateSplitters();if(this.grid.enableColumnMove){new Ext.grid.HeaderDragZone(this.grid,this.lockedHd.dom,this.mainHd.dom);new Ext.grid.HeaderDropZone(this.grid,this.lockedHd.dom,this.mainHd.dom);}
if(this.grid.enableCtxMenu!==false){this.colMenu=new Ext.menu.Menu({id:this.grid.id+"-hcols-menu"});this.colMenu.on("beforeshow",this.beforeColMenuShow,this);this.colMenu.on("itemclick",this.handleHdMenuClick,this);this.hmenu=new Ext.menu.Menu({id:this.grid.id+"-hctx"});this.hmenu.add({id:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{id:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"},"separator");if(this.grid.enableColLock!==false){this.hmenu.add({id:"lock",text:this.lockText,cls:"xg-hmenu-lock"},{id:"unlock",text:this.unlockText,cls:"xg-hmenu-unlock"},"separator");}
this.hmenu.add({id:"columns",text:this.columnsText,menu:this.colMenu});this.hmenu.on("itemclick",this.handleHdMenuClick,this);this.grid.on("headercontextmenu",this.handleHdCtx,this);}
for(var i=0;i<colCount;i++){if(cm.isHidden(i)){this.hideColumn(i);}
if(cm.config[i].align){this.css.updateRule(this.colSelector+i,"textAlign",cm.config[i].align);this.css.updateRule(this.hdSelector+i,"textAlign",cm.config[i].align);}}
this.updateHeaderSortState();this.beforeInitialResize();this.layout(true);this.renderPhase2.defer(1,this);},renderPhase2:function(){this.refresh();if(this.grid.autoSizeColumns){this.autoSizeColumns();}},beforeInitialResize:function(){},onColumnSplitterMoved:function(i,w){this.userResized=true;var cm=this.grid.colModel;cm.setColumnWidth(i,w,true);var cid=cm.getColumnId(i);this.css.updateRule(this.colSelector+cid,"width",(w-this.borderWidth)+"px");this.css.updateRule(this.hdSelector+cid,"width",(w-this.borderWidth)+"px");this.updateSplitters();this.layout();this.grid.fireEvent("columnresize",i,w);},syncRowHeights:function(startIndex,endIndex){if(this.grid.enableRowHeightSync===true&&this.cm.getLockedCount()>0){startIndex=startIndex||0;var mrows=this.getBodyTable().rows;var lrows=this.getLockedTable().rows;var len=mrows.length-1;endIndex=Math.min(endIndex||len,len);for(var i=startIndex;i<=endIndex;i++){var m=mrows[i],l=lrows[i];var h=Math.max(m.offsetHeight,l.offsetHeight);m.style.height=l.style.height=h+"px";}}},layout:function(initialRender){var auto=this.grid.autoHeight;var scrollOffset=16;var c=this.grid.container,cm=this.cm,expandCol=this.grid.autoExpandColumn,gv=this;var hasLock=this.cm.isLocked(0);var tbh=this.headerPanel.getHeight();var bbh=this.footerPanel.getHeight();if(auto){var ch=this.getBodyTable().offsetHeight+tbh+bbh+this.mainHd.getHeight();c.setHeight(ch+c.getBorderWidth("tb"));}
if(this.grid.autoWidth){c.setWidth(cm.getTotalWidth()+c.getBorderWidth('lr'));}
var s=this.scroller;var csize=c.getSize(true);this.el.setSize(csize.width,csize.height);this.headerPanel.setWidth(csize.width);this.footerPanel.setWidth(csize.width);var hdHeight=this.mainHd.getHeight();var vw=csize.width;var vh=csize.height-(tbh+bbh);s.setSize(vw,vh);var bt=this.getBodyTable();var ltWidth=hasLock?Math.max(this.getLockedTable().offsetWidth,this.lockedHd.dom.firstChild.offsetWidth):0;var scrollHeight=bt.offsetHeight;var scrollWidth=ltWidth+bt.offsetWidth;var vscroll=false,hscroll=false;this.scrollSizer.setSize(scrollWidth,scrollHeight+hdHeight);var lw=this.lockedWrap,mw=this.mainWrap;var lb=this.lockedBody,mb=this.mainBody;setTimeout(function(){var t=s.dom.offsetTop;var w=s.dom.clientWidth,h=s.dom.clientHeight;lw.setTop(t);lw.setSize(ltWidth,h);mw.setLeftTop(ltWidth,t);mw.setSize(w-ltWidth,h);lb.setHeight(h-hdHeight);mb.setHeight(h-hdHeight);var tw;if(!gv.userResized&&expandCol&&gv.ds.getCount()>0&&w>(tw=cm.getTotalWidth(false))){var ci=cm.getIndexById(expandCol);var cw=((w-tw)+cm.getColumnWidth(ci)-2)-(w<=s.dom.offsetWidth?0:18);cm.setColumnWidth(ci,cw,true);gv.css.updateRule(gv.colSelector+expandCol,"width",(cw-gv.borderWidth)+"px");gv.css.updateRule(gv.hdSelector+expandCol,"width",(cw-gv.borderWidth)+"px");gv.updateSplitters();gv.layout();}
if(initialRender){lw.show();mw.show();}},10);},onWindowResize:function(){if(!this.grid.monitorWindowResize||this.grid.autoHeight){return;}
this.layout();},appendFooter:function(parentEl){return null;},sortAscText:"Sort Ascending",sortDescText:"Sort Descending",lockText:"Lock Column",unlockText:"Unlock Column",columnsText:"Columns"});if(Ext.dd.DragZone){Ext.grid.HeaderDragZone=function(grid,hd,hd2){this.grid=grid;this.view=grid.getView();this.ddGroup="gridHeader"+this.grid.container.id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,hd);this.setHandleElId(Ext.id(hd));this.setOuterHandleElId(Ext.id(hd2));this.scroll=false;};Ext.extend(Ext.grid.HeaderDragZone,Ext.dd.DragZone,{maxDragWidth:120,getDragData:function(e){var t=Ext.lib.Event.getTarget(e);var h=this.view.findHeaderCell(t);if(h){return{ddel:h.firstChild,header:h};}
return false;},onInitDrag:function(e){var clone=this.dragData.ddel.cloneNode(true);clone.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(clone);return true;}});Ext.grid.SplitDragZone=function(grid,hd,hd2){this.grid=grid;this.view=grid.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.container.id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(hd));this.setOuterHandleElId(Ext.id(hd2));this.scroll=false;};Ext.extend(Ext.grid.SplitDragZone,Ext.dd.DDProxy,{fly:Ext.Element.fly,b4StartDrag:function(x,y){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var w=this.cm.getColumnWidth(this.cellIndex);var minw=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(minw,1000);this.setYConstraint(0,0);this.minX=x-minw;this.maxX=x+1000;this.startPos=x;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,x,y);},handleMouseDown:function(e){ev=Ext.EventObject.setEvent(e);var t=this.fly(ev.getTarget());if(t.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(t.dom);this.split=t.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments);}}},endDrag:function(e){this.view.headersDisabled=false;var endX=Math.max(this.minX,Ext.lib.Event.getPageX(e));var diff=endX-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+diff);},autoOffset:function(){this.setDelta(0,0);}});Ext.grid.HeaderDropZone=function(grid,hd,hd2){this.grid=grid;this.view=grid.getView();this.proxyTop=Ext.DomHelper.append(document.body,{tag:"div",cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{tag:"div",cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden");};this.ddGroup="gridHeader"+this.grid.container.id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,grid.container.dom);};Ext.extend(Ext.grid.HeaderDropZone,Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,getTargetFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);var cindex=this.view.findCellIndex(t);if(cindex!==false){return this.view.getHeaderCell(cindex);}},nextVisible:function(h){var v=this.view,cm=this.grid.colModel;h=h.nextSibling;while(h){if(!cm.isHidden(v.getCellIndex(h))){return h;}
h=h.nextSibling;}
return null;},prevVisible:function(h){var v=this.view,cm=this.grid.colModel;h=h.prevSibling;while(h){if(!cm.isHidden(v.getCellIndex(h))){return h;}
h=h.prevSibling;}
return null;},positionIndicator:function(h,n,e){var x=Ext.lib.Event.getPageX(e);var r=Ext.lib.Dom.getRegion(n.firstChild);var px,pt,py=r.top+this.proxyOffsets[1];if((r.right-x)<=(r.right-r.left)/2){px=r.right+this.view.borderWidth;pt="after";}else{px=r.left;pt="before";}
var oldIndex=this.view.getCellIndex(h);var newIndex=this.view.getCellIndex(n);var locked=this.grid.colModel.isLocked(newIndex);if(pt=="after"){newIndex++;}
if(oldIndex<newIndex){newIndex--;}
if(oldIndex==newIndex&&(locked==this.grid.colModel.isLocked(oldIndex))){return false;}
px+=this.proxyOffsets[0];this.proxyTop.setLeftTop(px,py);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight();}
this.proxyBottom.setLeftTop(px,py+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return pt;},onNodeEnter:function(n,dd,e,data){if(data.header!=n){this.positionIndicator(data.header,n,e);}},onNodeOver:function(n,dd,e,data){var result=false;if(data.header!=n){result=this.positionIndicator(data.header,n,e);}
if(!result){this.proxyTop.hide();this.proxyBottom.hide();}
return result?this.dropAllowed:this.dropNotAllowed;},onNodeOut:function(n,dd,e,data){this.proxyTop.hide();this.proxyBottom.hide();},onNodeDrop:function(n,dd,e,data){var h=data.header;if(h!=n){var cm=this.grid.colModel;var x=Ext.lib.Event.getPageX(e);var r=Ext.lib.Dom.getRegion(n.firstChild);var pt=(r.right-x)<=((r.right-r.left)/2)?"after":"before";var oldIndex=this.view.getCellIndex(h);var newIndex=this.view.getCellIndex(n);var locked=cm.isLocked(newIndex);if(pt=="after"){newIndex++;}
if(oldIndex<newIndex){newIndex--;}
if(oldIndex==newIndex&&(locked==cm.isLocked(oldIndex))){return false;}
cm.setLocked(oldIndex,locked,true);cm.moveColumn(oldIndex,newIndex);this.grid.fireEvent("columnmove",oldIndex,newIndex);return true;}
return false;}});}

Ext.grid.RowSelectionModel=function(config){Ext.apply(this,config);this.selections=new Ext.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.events={"selectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true};this.locked=false;};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){this.grid.on("mousedown",this.handleMouseDown,this);this.rowNav=new Ext.KeyNav(this.grid.container,{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var last=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(last!==false){this.last=last;}}else{this.selectFirstRow();}},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var last=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(last!==false){this.last=last;}}else{this.selectFirstRow();}},scope:this});var view=this.grid.view;view.on("refresh",this.onRefresh,this);view.on("rowupdated",this.onRowUpdated,this);view.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.dataSource,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);}else{s.remove(r);}});},onRemove:function(v,index,r){this.selections.remove(r);},onRowUpdated:function(v,index,r){if(this.isSelected(r)){v.onRowSelect(index);}},selectRecords:function(records,keepExisting){if(!keepExisting){this.clearSelections();}
var ds=this.grid.dataSource;for(var i=0,len=records.length;i<len;i++){this.selectRow(ds.indexOf(records[i]));}},getCount:function(){return this.selections.length;},selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(keepExisting){this.selectRow(this.grid.dataSource.getCount()-1,keepExisting);},selectNext:function(keepExisting){if(this.last!==false&&(this.last+1)<this.grid.dataSource.getCount()){this.selectRow(this.last+1,keepExisting);this.grid.getView().focusRow(this.last);}},selectPrevious:function(keepExisting){if(this.last){this.selectRow(this.last-1,keepExisting);this.grid.getView().focusRow(this.last);}},getSelections:function(){return[].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);},clearSelections:function(fast){if(this.locked)return;if(fast!==true){var ds=this.grid.dataSource;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));},this);s.clear();}else{this.selections.clear();}
this.last=false;},selectAll:function(){if(this.locked)return;this.selections.clear();for(var i=0,len=this.grid.dataSource.getCount();i<len;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;},isSelected:function(index){var r=typeof index=="number"?this.grid.dataSource.getAt(index):index;return(r&&this.selections.key(r.id)?true:false);},isIdSelected:function(id){return(this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var view=this.grid.getView(),rowIndex;if(this.isLocked()||(rowIndex=view.findRowIndex(t))===false){return;};if(e.shiftKey&&this.last!==false){var last=this.last;this.selectRange(last,rowIndex,e.ctrlKey);this.last=last;view.focusRow(rowIndex);}else{if(e.ctrlKey&&this.isSelected(rowIndex)){this.deselectRow(rowIndex);}else{this.selectRow(rowIndex,e.hasModifier());view.focusRow(rowIndex);}}},selectRows:function(rows,keepExisting){if(!keepExisting){this.clearSelections();}
for(var i=0,len=rows.length;i<len;i++){this.selectRow(rows[i],true);}},selectRange:function(startRow,endRow,keepExisting){if(this.locked)return;if(!keepExisting){this.clearSelections();}
if(startRow<=endRow){for(var i=startRow;i<=endRow;i++){this.selectRow(i,true);}}else{for(var i=startRow;i>=endRow;i--){this.selectRow(i,true);}}},deselectRange:function(startRow,endRow,preventViewNotify){if(this.locked)return;for(var i=startRow;i<=endRow;i++){this.deselectRow(i,preventViewNotify);}},selectRow:function(index,keepExisting,preventViewNotify){if(this.locked||(index<0||index>=this.grid.dataSource.getCount()))return;if(this.fireEvent("beforerowselect",this,index,keepExisting)!==false){if(!keepExisting||this.singleSelect){this.clearSelections();}
var r=this.grid.dataSource.getAt(index);this.selections.add(r);this.last=this.lastActive=index;if(!preventViewNotify){this.grid.getView().onRowSelect(index);}
this.fireEvent("rowselect",this,index,r);this.fireEvent("selectionchange",this);}},deselectRow:function(index,preventViewNotify){if(this.locked)return;if(this.last==index){this.last=false;}
if(this.lastActive==index){this.lastActive=false;}
var r=this.grid.dataSource.getAt(index);this.selections.remove(r);if(!preventViewNotify){this.grid.getView().onRowDeselect(index);}
this.fireEvent("rowdeselect",this,index);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(row,col,cm){return!cm.isHidden(col)&&cm.isCellEditable(col,row);},onEditorKey:function(field,e){var k=e.getKey(),newCell,g=this.grid,ed=g.activeEditor;if(k==e.TAB){ed.completeEdit();if(e.shiftKey){newCell=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{newCell=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}
e.stopEvent();}else if(k==e.ENTER&&!e.ctrlKey){ed.completeEdit();if(e.shiftKey){newCell=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{newCell=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}
e.stopEvent();}else if(k==e.ESC){ed.cancelEdit();}
if(newCell){g.startEditing(newCell[0],newCell[1]);}}});

Ext.TabPanel=function(container,config){this.el=Ext.get(container,true);if(config){if(typeof config=="boolean"){this.tabPosition=config?"bottom":"top";}else{Ext.apply(this,config);}}
if(this.tabPosition=="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-bottom");}
this.stripWrap=Ext.get(this.createStrip(this.el.dom),true);this.stripEl=Ext.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Ext.get(this.stripWrap.dom.firstChild.firstChild,true);if(Ext.isIE){Ext.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden");}
if(this.tabPosition!="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top");}
this.items=[];this.bodyEl.setStyle("position","relative");if(!this.items.indexOf){this.items.indexOf=function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}
return-1;};}
this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.events={"tabchange":true,"beforetabchange":true};Ext.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;};Ext.extend(Ext.TabPanel,Ext.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,addTab:function(id,text,content,closable){var item=new Ext.TabPanelItem(this,id,text,closable);this.addTabItem(item);if(content){item.setContent(content);}
return item;},getTab:function(id){return this.items[id];},hideTab:function(id){var t=this.items[id];if(!t.isHidden()){t.setHidden(true);this.hiddenCount++;this.autoSizeTabs();}},unhideTab:function(id){var t=this.items[id];if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(item){this.items[item.id]=item;this.items.push(item);if(this.resizeTabs){item.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs();}else{item.autoSize();}},removeTab:function(id){var items=this.items;var tab=items[id];if(!tab)return;var index=items.indexOf(tab);if(this.active==tab&&items.length>1){var newTab=this.getNextAvailable(index);if(newTab)newTab.activate();}
this.stripEl.dom.removeChild(tab.pnode.dom);if(tab.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(tab.bodyEl.dom);}
items.splice(index,1);delete this.items[tab.id];tab.fireEvent("close",tab);tab.purgeListeners();this.autoSizeTabs();},getNextAvailable:function(start){var items=this.items;var index=start;while(index<items.length){var item=items[++index];if(item&&!item.isHidden()){return item;}}
index=start;while(index>=0){var item=items[--index];if(item&&!item.isHidden()){return item;}}
return null;},disableTab:function(id){var tab=this.items[id];if(tab&&this.active!=tab){tab.disable();}},enableTab:function(id){var tab=this.items[id];tab.enable();},activate:function(id){var tab=this.items[id];if(!tab){return null;}
if(tab==this.active){return tab;}
var e={};this.fireEvent("beforetabchange",this,e,tab);if(e.cancel!==true&&!tab.disabled){if(this.active){this.active.hide();}
this.active=this.items[id];this.active.show();this.fireEvent("tabchange",this,this.active);}
return tab;},getActiveTab:function(){return this.active;},syncHeight:function(targetHeight){var height=(targetHeight||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var bm=this.bodyEl.getMargins();var newHeight=height-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);this.bodyEl.setHeight(newHeight);return newHeight;},onResize:function(){if(this.monitorResize){this.autoSizeTabs();}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();},autoSizeTabs:function(){var count=this.items.length;var vcount=count-this.hiddenCount;if(!this.resizeTabs||count<1||vcount<1||this.updating)return;var w=Math.max(this.el.getWidth()-this.cpad,10);var availWidth=Math.floor(w/vcount);var b=this.stripBody;if(b.getWidth()>w){var tabs=this.items;this.setTabWidth(Math.max(availWidth,this.minTabWidth)-2);if(availWidth<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(availWidth,this.preferredTabWidth)-2);}}},getCount:function(){return this.items.length;},setTabWidth:function(width){this.currentTabWidth=width;for(var i=0,len=this.items.length;i<len;i++){if(!this.items[i].isHidden())this.items[i].setWidth(width);}},destroy:function(removeEl){Ext.EventManager.removeResizeListener(this.onResize,this);for(var i=0,len=this.items.length;i<len;i++){this.items[i].purgeListeners();}
if(removeEl===true){this.el.update("");this.el.remove();}}});Ext.TabPanelItem=function(tabPanel,id,text,closable){this.tabPanel=tabPanel;this.id=id;this.disabled=false;this.text=text;this.loaded=false;this.closable=closable;this.bodyEl=Ext.get(tabPanel.createItemBody(tabPanel.bodyEl.dom,id));this.bodyEl.setVisibilityMode(Ext.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var els=tabPanel.createStripElements(tabPanel.stripEl.dom,text,closable);this.el=Ext.get(els.el,true);this.inner=Ext.get(els.inner,true);this.textEl=Ext.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Ext.get(els.el.parentNode,true);this.el.on("click",this.onTabClick,this);if(closable){var c=Ext.get(els.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}
this.events={"activate":true,"beforeclose":true,"close":true,"deactivate":true};this.hidden=false;};Ext.extend(Ext.TabPanelItem,Ext.util.Observable,{purgeListeners:function(){Ext.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners();},show:function(){this.pnode.addClass("on");this.showAction();if(Ext.isOpera){this.tabPanel.stripWrap.repaint();}
this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(text){this.textEl.dom.title=text;},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);},getWidth:function(){return this.inner.getWidth();},setWidth:function(width){var iwidth=width-this.pnode.getPadding("lr");this.inner.setWidth(iwidth);this.textEl.setWidth(iwidth-this.inner.getPadding("lr"));this.pnode.setWidth(width);},setHidden:function(hidden){this.hidden=hidden;this.pnode.setStyle("display",hidden?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text;},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"));},setText:function(text){this.text=text;this.textEl.update(text);this.textEl.dom.title=text;if(!this.tabPanel.resizeTabs){this.autoSize();}},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled");},setContent:function(content,loadScripts){this.bodyEl.update(content,loadScripts);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(url,params,loadOnce){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);}
this.refreshDelegate=this._handleRefresh.createDelegate(this,[url,params,loadOnce]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(url,params,loadOnce){if(!loadOnce||!this.loaded){var updater=this.bodyEl.getUpdateManager();updater.update(url,params,this._setLoaded.createDelegate(this));}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);}},closeText:"Close this tab"});Ext.TabPanel.prototype.createStrip=function(container){var strip=document.createElement("div");strip.className="x-tabs-wrap";container.appendChild(strip);return strip;};Ext.TabPanel.prototype.createStripList=function(strip){strip.innerHTML='<div class="x-tabs-strip-wrap"><table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr></tr></tbody></table></div>';return strip.firstChild.firstChild.firstChild.firstChild;};Ext.TabPanel.prototype.createBody=function(container){var body=document.createElement("div");Ext.id(body,"tab-body");Ext.fly(body).addClass("x-tabs-body");container.appendChild(body);return body;};Ext.TabPanel.prototype.createItemBody=function(bodyEl,id){var body=Ext.getDom(id);if(!body){body=document.createElement("div");body.id=id;}
Ext.fly(body).addClass("x-tabs-item-body");bodyEl.insertBefore(body,bodyEl.firstChild);return body;};Ext.TabPanel.prototype.createStripElements=function(stripEl,text,closable){var td=document.createElement("td");stripEl.appendChild(td);if(closable){td.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Ext.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on" title="{text}" class="x-tabs-text">{text}</span>'+'<div unselectable="on" class="close-icon">&#160;</div></em></span></a>');}
var el=this.closeTpl.overwrite(td,{"text":text});var close=el.getElementsByTagName("div")[0];var inner=el.getElementsByTagName("em")[0];return{"el":el,"close":close,"inner":inner};}else{if(!this.tabTpl){this.tabTpl=new Ext.Template('<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">'+'<span unselectable="on" title="{text}" class="x-tabs-text">{text}</span></em></span></a>');}
var el=this.tabTpl.overwrite(td,{"text":text});var inner=el.getElementsByTagName("em")[0];return{"el":el,"inner":inner};}};

Ext.Resizable=function(el,config){this.el=Ext.get(el);if(config&&config.wrap){config.resizeChild=this.el;this.el=this.el.wrap(typeof config.wrap=="object"?config.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=config.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(config.resizeChild.getPositioning());config.resizeChild.clearPositioning();if(!config.width||!config.height){var csize=config.resizeChild.getSize();this.el.setSize(csize.width,csize.height);}
if(config.pinned&&!config.adjustments){config.adjustments="auto";}}
this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"});this.proxy.unselectable();this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"});this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this);Ext.apply(this,config);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned");}
var position=this.el.getStyle("position");if(position!="absolute"&&position!="fixed"){this.el.setStyle("position","relative");}
if(!this.handles){this.handles='s,e,se';if(this.multiDirectional){this.handles+=',n,w';}}
if(this.handles=="all"){this.handles="n s e w ne nw se sw";}
var hs=this.handles.split(/\s*?[,;]\s*?| /);var ps=Ext.Resizable.positions;for(var i=0,len=hs.length;i<len;i++){if(hs[i]&&ps[hs[i]]){var pos=ps[hs[i]];this[pos]=new Ext.Resizable.Handle(this,pos,this.disableTrackOver,this.transparent);}}
this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true;}
this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true);}else{this.resizeChild=Ext.get(this.resizeChild,true);}}
if(this.adjustments=="auto"){var rc=this.resizeChild;var hw=this.west,he=this.east,hn=this.north,hs=this.south;if(rc&&(hw||hn)){rc.position("relative");rc.setLeft(hw?hw.el.getWidth():0);rc.setTop(hn?hn.el.getHeight():0);}
this.adjustments=[(he?-he.el.getWidth():0)+(hw?-hw.el.getWidth():0),(hn?-hn.el.getHeight():0)+(hs?-hs.el.getHeight():0)-1];}
if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);}
this.events={"beforeresize":true,"resize":true};if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height);}else{this.updateChildSize();}};Ext.extend(Ext.Resizable,Ext.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:'easeOutStrong',widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,resizeTo:function(width,height){this.el.setSize(width,height);this.updateChildSize();this.fireEvent("resize",this,width,height,null);},startSizing:function(e){this.fireEvent("beforeresize",this,e);if(this.enabled){this.resizing=true;this.startBox=this.el.getBox();this.startPoint=e.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.proxy.setBox(this.startBox);this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(!this.dynamic){this.proxy.show();}}},onMouseDown:function(handle,e){if(this.enabled){e.stopEvent();this.activeHandle=handle;this.overlay.setStyle("cursor",handle.el.getStyle("cursor"));this.startSizing(e);}},onMouseUp:function(e){var size=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.fireEvent("resize",this,size.width,size.height,e);},updateChildSize:function(){if(this.resizeChild){var el=this.el;var child=this.resizeChild;var adj=this.adjustments;if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}
if(Ext.isIE){setTimeout(function(){if(el.dom.offsetWidth){var b=el.getSize(true);child.setSize(b.width+adj[0],b.height+adj[1]);}},10);}}},snap:function(value,inc,min){if(!inc||!value)return value;var newValue=value;var m=value%inc;if(m>0){if(m>(inc/2)){newValue=value+(inc-m);}else{newValue=value-m;}}
return Math.max(min,newValue);},resizeElement:function(){var box=this.proxy.getBox();if(this.updateBox){this.el.setBox(box,false,this.animate,this.duration,null,this.easing);}else{this.el.setSize(box.width,box.height,this.animate,this.duration,null,this.easing);}
this.updateChildSize();this.proxy.hide();return box;},constrain:function(v,diff,m,mx){if(v-diff<m){diff=v-m;}else if(v-diff>mx){diff=mx-v;}
return diff;},onMouseMove:function(e){if(this.enabled){try{var curSize=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=curSize.width,h=curSize.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var eventXY=e.getXY();var diffX=-(this.startPoint[0]-Math.max(this.minX,eventXY[0]));var diffY=-(this.startPoint[1]-Math.max(this.minY,eventXY[1]));var pos=this.activeHandle.position;switch(pos){case"east":w+=diffX;w=Math.min(Math.max(mw,w),mxw);break;case"south":h+=diffY;h=Math.min(Math.max(mh,h),mxh);break;case"southeast":w+=diffX;h+=diffY;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case"north":diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case"west":diffX=this.constrain(w,diffX,mw,mxw);x+=diffX;w-=diffX;break;case"northeast":w+=diffX;w=Math.min(Math.max(mw,w),mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;break;case"northwest":diffX=this.constrain(w,diffX,mw,mxw);diffY=this.constrain(h,diffY,mh,mxh);y+=diffY;h-=diffY;x+=diffX;w-=diffX;break;case"southwest":diffX=this.constrain(w,diffX,mw,mxw);h+=diffY;h=Math.min(Math.max(mh,h),mxh);x+=diffX;w-=diffX;break;}
var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case"northeast":y-=sh-h;break;case"north":y-=sh-h;break;case"southwest":x-=sw-w;break;case"west":x-=sw-w;break;case"northwest":x-=sw-w;y-=sh-h;break;}
w=sw;h=sh;}
if(this.preserveRatio){switch(pos){case"southeast":case"east":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);break;case"south":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case"northeast":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case"north":var tw=w;w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);x+=(tw-w)/2;break;case"southwest":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);var tw=w;w=ow*(h/oh);x+=tw-w;break;case"west":var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);y+=(th-h)/2;var tw=w;w=ow*(h/oh);x+=tw-w;break;case"northwest":var tw=w;var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);y+=th-h;x+=tw-w;break;}}
this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement();}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over");}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over");}},getEl:function(){return this.el;},getResizeChild:function(){return this.resizeChild;},destroy:function(removeEl){this.proxy.remove();this.overlay.removeAllListeners();this.overlay.remove();var ps=Ext.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){var h=this[ps[k]];h.el.removeAllListeners();h.el.remove();}}
if(removeEl){this.el.update("");this.el.remove();}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=function(rz,pos,disableTrackOver,transparent){if(!this.tpl){var tpl=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Ext.Resizable.Handle.prototype.tpl=tpl;}
this.position=pos;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(transparent){this.el.setOpacity(0);}
this.el.on("mousedown",this.onMouseDown,this);if(!disableTrackOver){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);}};Ext.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e);},onMouseOver:function(e){this.rz.handleOver(this,e);},onMouseOut:function(e){this.rz.handleOut(this,e);}};

Ext.BasicDialog=function(el,config){this.el=Ext.get(el);var dh=Ext.DomHelper;if(!this.el&&config&&config.autoCreate){if(typeof config.autoCreate=="object"){if(!config.autoCreate.id){config.autoCreate.id=el;}
this.el=dh.append(document.body,config.autoCreate,true);}else{this.el=dh.append(document.body,{tag:"div",id:el,style:'visibility:hidden;'},true);}}
el=this.el;el.setDisplayed(true);el.hide=this.hideAction;this.id=el.id;el.addClass("x-dlg");Ext.apply(this,config);this.proxy=el.createProxy("x-dlg-proxy");this.proxy.hide=this.hideAction;this.proxy.setOpacity(.5);this.proxy.hide();if(config.width){el.setWidth(config.width);}
if(config.height){el.setHeight(config.height);}
this.size=el.getSize();if(typeof config.x!="undefined"&&typeof config.y!="undefined"){this.xy=[config.x,config.y];}else{this.xy=el.getCenterXY(true);}
this.header=el.child("/.x-dlg-hd");this.body=el.child("/.x-dlg-bd");this.footer=el.child("/.x-dlg-ft");if(!this.header){this.header=el.createChild({tag:"div",cls:"x-dlg-hd",html:"&#160;"},this.body?this.body.dom:null);}
if(!this.body){this.body=el.createChild({tag:"div",cls:"x-dlg-bd"});}
this.header.unselectable();if(this.title){this.header.update(this.title);}
this.focusEl=el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1"});this.focusEl.swallowEvent("click",true);this.header.wrap({cls:"x-dlg-hd-right"}).wrap({cls:"x-dlg-hd-left"},true);this.bwrap=this.body.wrap({tag:"div",cls:"x-dlg-dlg-body"});if(this.footer){this.bwrap.dom.appendChild(this.footer.dom);}
this.bg=this.el.createChild({tag:"div",cls:"x-dlg-bg",html:'<div class="x-dlg-bg-left"><div class="x-dlg-bg-right"><div class="x-dlg-bg-center">&#160;</div></div></div>'});this.centerBg=this.bg.child("div.x-dlg-bg-center");if(this.autoScroll!==false&&!this.autoTabs){this.body.setStyle("overflow","auto");}
this.toolbox=this.el.createChild({cls:"x-dlg-toolbox"});if(this.closable!==false){this.el.addClass("x-dlg-closable");this.close=this.toolbox.createChild({cls:"x-dlg-close"});this.close.on("click",this.closeClick,this);this.close.addClassOnOver("x-dlg-close-over");}
if(this.collapsible!==false){this.collapseBtn=this.toolbox.createChild({cls:"x-dlg-collapse"});this.collapseBtn.on("click",this.collapseClick,this);this.collapseBtn.addClassOnOver("x-dlg-collapse-over");this.header.on("dblclick",this.collapseClick,this);}
if(this.resizable!==false){this.el.addClass("x-dlg-resizable");this.resizer=new Ext.Resizable(el,{minWidth:this.minWidth||80,minHeight:this.minHeight||80,handles:this.resizeHandles||"all",pinned:true});this.resizer.on("beforeresize",this.beforeResize,this);this.resizer.on("resize",this.onResize,this);}
if(this.draggable!==false){el.addClass("x-dlg-draggable");if(!this.proxyDrag){var dd=new Ext.dd.DD(el.dom.id,"WindowDrag");}
else{var dd=new Ext.dd.DDProxy(el.dom.id,"WindowDrag",{dragElId:this.proxy.id});}
dd.setHandleElId(this.header.id);dd.endDrag=this.endMove.createDelegate(this);dd.startDrag=this.startMove.createDelegate(this);dd.onDrag=this.onDrag.createDelegate(this);this.dd=dd;}
if(this.modal){this.mask=dh.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.mask.enableDisplayMode("block");this.mask.hide();this.el.addClass("x-dlg-modal");}
if(this.shadow){this.shadow=new Ext.Shadow({mode:typeof this.shadow=="string"?this.shadow:"sides",offset:this.shadowOffset});}else{this.shadowOffset=0;}
if(Ext.useShims&&this.shim!==false){this.shim=this.el.createShim();this.shim.hide=this.hideAction;this.shim.hide();}else{this.shim=false;}
if(this.autoTabs){this.initTabs();}
this.syncBodyHeight();this.events={"keydown":true,"move":true,"resize":true,"beforehide":true,"hide":true,"beforeshow":true,"show":true};el.on("keydown",this.onKeyDown,this);el.on("mousedown",this.toFront,this);Ext.EventManager.onWindowResize(this.adjustViewport,this,true);this.el.hide();Ext.DialogManager.register(this);};Ext.extend(Ext.BasicDialog,Ext.util.Observable,{shadowOffset:5,minHeight:80,minWidth:200,minButtonWidth:75,defaultButton:null,buttonAlign:"right",tabTag:'div',setTitle:function(text){this.header.update(text);return this;},closeClick:function(){this.hide();},collapseClick:function(){this[this.collapsed?"expand":"collapse"]();},collapse:function(){if(!this.collapsed){this.collapsed=true;this.el.addClass("x-dlg-collapsed");this.restoreHeight=this.el.getHeight();this.resizeTo(this.el.getWidth(),this.header.getHeight());}},expand:function(){if(this.collapsed){this.collapsed=false;this.el.removeClass("x-dlg-collapsed");this.resizeTo(this.el.getWidth(),this.restoreHeight);}},initTabs:function(){var tabs=this.getTabs();while(tabs.getTab(0)){tabs.removeTab(0);}
this.el.select(this.tabTag+'.x-dlg-tab').each(function(el){var dom=el.dom;tabs.addTab(Ext.id(dom),dom.title);dom.title="";});tabs.activate(0);return tabs;},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getHeaderFooterHeight(true)+40);},onResize:function(){this.refreshSize();this.syncBodyHeight();this.adjustAssets();this.focus();this.fireEvent("resize",this,this.size.width,this.size.height);},onKeyDown:function(e){if(this.isVisible()){this.fireEvent("keydown",this,e);}},resizeTo:function(width,height){this.el.setSize(width,height);this.size={width:width,height:height};this.syncBodyHeight();if(this.fixedcenter){this.center();}
if(this.isVisible()){this.constrainXY();this.adjustAssets();}
this.fireEvent("resize",this,width,height);return this;},setContentSize:function(w,h){h+=this.getHeaderFooterHeight()+this.body.getMargins("tb");w+=this.body.getMargins("lr")+this.bwrap.getMargins("lr")+this.centerBg.getPadding("lr");h+=this.body.getPadding("tb")+this.bwrap.getBorderWidth("tb")+this.body.getBorderWidth("tb")+this.el.getBorderWidth("tb");w+=this.body.getPadding("lr")+this.bwrap.getBorderWidth("lr")+this.body.getBorderWidth("lr")+this.bwrap.getPadding("lr")+this.el.getBorderWidth("lr");if(this.tabs){h+=this.tabs.stripWrap.getHeight()+this.tabs.bodyEl.getMargins("tb")+this.tabs.bodyEl.getPadding("tb");w+=this.tabs.bodyEl.getMargins("lr")+this.tabs.bodyEl.getPadding("lr");}
this.resizeTo(w,h);return this;},addKeyListener:function(key,fn,scope){var keyCode,shift,ctrl,alt;if(typeof key=="object"&&!(key instanceof Array)){keyCode=key["key"];shift=key["shift"];ctrl=key["ctrl"];alt=key["alt"];}else{keyCode=key;}
var handler=function(dlg,e){if((!shift||e.shiftKey)&&(!ctrl||e.ctrlKey)&&(!alt||e.altKey)){var k=e.getKey();if(keyCode instanceof Array){for(var i=0,len=keyCode.length;i<len;i++){if(keyCode[i]==k){fn.call(scope||window,dlg,k,e);return;}}}else{if(k==keyCode){fn.call(scope||window,dlg,k,e);}}}};this.on("keydown",handler);return this;},getTabs:function(){if(!this.tabs){this.el.addClass("x-dlg-auto-tabs");this.body.addClass(this.tabPosition=="bottom"?"x-tabs-bottom":"x-tabs-top");this.tabs=new Ext.TabPanel(this.body.dom,this.tabPosition=="bottom");}
return this.tabs;},addButton:function(config,handler,scope){var dh=Ext.DomHelper;if(!this.footer){this.footer=dh.append(this.bwrap,{tag:"div",cls:"x-dlg-ft"},true);}
if(!this.btnContainer){var tb=this.footer.createChild({tag:"div",cls:"x-dlg-btns x-dlg-btns-"+this.buttonAlign,html:'<table cellspacing="0"><tbody><tr></tr></tbody></table>'},null,true);this.btnContainer=tb.firstChild.firstChild.firstChild;}
var bconfig={handler:handler,scope:scope,minWidth:this.minButtonWidth,hideParent:true};if(typeof config=="string"){bconfig.text=config;}else{if(config.tag){bconfig.dhconfig=config;}else{Ext.apply(bconfig,config);}}
var btn=new Ext.Button(this.btnContainer.appendChild(document.createElement("td")),bconfig);this.footer.setHeight(this.btnContainer.parentNode.parentNode.offsetHeight+this.footer.getPadding("tb"));this.syncBodyHeight();if(!this.buttons){this.buttons=[];}
this.buttons.push(btn);return btn;},setDefaultButton:function(btn){this.defaultButton=btn;return this;},getHeaderFooterHeight:function(safe){var height=0;if(this.header){height+=this.header.getHeight();}
if(this.footer){var fm=this.footer.getMargins();height+=(this.footer.getHeight()+fm.top+fm.bottom);}
height+=this.bwrap.getPadding("tb")+this.bwrap.getBorderWidth("tb");height+=this.centerBg.getPadding("tb");return height;},syncBodyHeight:function(){var bd=this.body,cb=this.centerBg,bw=this.bwrap;var height=this.size.height-this.getHeaderFooterHeight(false);bd.setHeight(height-bd.getMargins("tb"));var hh=this.header.getHeight();var h=this.size.height-hh;cb.setHeight(h);bw.setLeftTop(cb.getPadding("l"),hh+cb.getPadding("t"));bw.setHeight(h-cb.getPadding("tb"));bw.setWidth(this.el.getWidth(true)-cb.getPadding("lr"));bd.setWidth(bw.getWidth(true));if(this.tabs){this.tabs.syncHeight();if(Ext.isIE){this.tabs.el.repaint();}}},restoreState:function(){var box=Ext.state.Manager.get(this.stateId||(this.el.id+"-state"));if(box&&box.width){this.xy=[box.x,box.y];this.resizeTo(box.width,box.height);}
return this;},beforeShow:function(){this.expand();if(this.fixedcenter){this.xy=this.el.getCenterXY(true);}
if(this.modal){Ext.get(document.body).addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show();}
this.constrainXY();},animShow:function(){var b=Ext.get(this.animateTarget,true).getBox();this.proxy.setSize(b.width,b.height);this.proxy.setLocation(b.x,b.y);this.proxy.show();this.proxy.setBounds(this.xy[0],this.xy[1],this.size.width,this.size.height,true,.35,this.showEl.createDelegate(this));},show:function(animateTarget){if(this.fireEvent("beforeshow",this)===false){return;}
if(this.syncHeightBeforeShow){this.syncBodyHeight();}
this.animateTarget=animateTarget||this.animateTarget;if(!this.el.isVisible()){this.beforeShow();if(this.animateTarget){this.animShow();}else{this.showEl();}}
return this;},showEl:function(){this.proxy.hide();this.el.setXY(this.xy);this.el.show();this.adjustAssets(true);this.toFront();this.focus();this.fireEvent("show",this);},focus:function(){if(this.defaultButton){this.defaultButton.focus();}else{this.focusEl.focus();}},constrainXY:function(){if(this.constraintoviewport!==false){if(!this.viewSize){if(this.container){var s=this.container.getSize();this.viewSize=[s.width,s.height];}else{this.viewSize=[Ext.lib.Dom.getViewWidth(),Ext.lib.Dom.getViewHeight()];}}
var s=Ext.get(this.container||document).getScroll();var x=this.xy[0],y=this.xy[1];var w=this.size.width,h=this.size.height;var vw=this.viewSize[0],vh=this.viewSize[1];var moved=false;if(x+w>vw+s.left){x=vw-w;moved=true;}
if(y+h>vh+s.top){y=vh-h;moved=true;}
if(x<s.left){x=s.left;moved=true;}
if(y<s.top){y=s.top;moved=true;}
if(moved){this.xy=[x,y];if(this.isVisible()){this.el.setLocation(x,y);this.adjustAssets();}}}},onDrag:function(){if(!this.proxyDrag){this.xy=this.el.getXY();this.adjustAssets();}},adjustAssets:function(doShow){var x=this.xy[0],y=this.xy[1];var w=this.size.width,h=this.size.height;if(doShow===true){if(this.shadow){this.shadow.show(this.el);}
if(this.shim){this.shim.show();}}
if(this.shadow&&this.shadow.isVisible()){this.shadow.show(this.el);}
if(this.shim&&this.shim.isVisible()){this.shim.setBounds(x,y,w,h);}},adjustViewport:function(w,h){if(!w||!h){w=Ext.lib.Dom.getViewWidth();h=Ext.lib.Dom.getViewHeight();}
this.viewSize=[w,h];if(this.modal&&this.mask.isVisible()){this.mask.setSize(w,h);this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));}
if(this.isVisible()){this.constrainXY();}},destroy:function(removeEl){Ext.EventManager.removeResizeListener(this.adjustViewport,this);if(this.tabs){this.tabs.destroy(removeEl);}
if(this.shim){this.shim.remove();}
if(this.proxy){this.proxy.remove();}
if(this.resizer){this.resizer.destroy();}
if(this.close){this.close.removeAllListeners();this.close.remove();}
if(this.mask){this.mask.remove();}
if(this.dd){this.dd.unreg();}
if(this.buttons){for(var i=0,len=this.buttons.length;i<len;i++){this.buttons[i].destroy();}}
this.el.removeAllListeners();if(removeEl===true){this.el.update("");this.el.remove();}
Ext.DialogManager.unregister(this);},startMove:function(){if(this.proxyDrag){this.proxy.show();}
if(this.constraintoviewport!==false){this.dd.constrainTo(document.body,{right:this.shadowOffset,bottom:this.shadowOffset});}},endMove:function(){if(!this.proxyDrag){Ext.dd.DD.prototype.endDrag.apply(this.dd,arguments);}else{Ext.dd.DDProxy.prototype.endDrag.apply(this.dd,arguments);this.proxy.hide();}
this.refreshSize();this.adjustAssets();this.focus();this.fireEvent("move",this,this.xy[0],this.xy[1]);},toFront:function(){Ext.DialogManager.bringToFront(this);return this;},toBack:function(){Ext.DialogManager.sendToBack(this);return this;},center:function(){var xy=this.el.getCenterXY(true);this.moveTo(xy[0],xy[1]);return this;},moveTo:function(x,y){this.xy=[x,y];if(this.isVisible()){this.el.setXY(this.xy);this.adjustAssets();}
return this;},isVisible:function(){return this.el.isVisible();},animHide:function(callback){var b=Ext.get(this.animateTarget).getBox();this.proxy.show();this.proxy.setBounds(this.xy[0],this.xy[1],this.size.width,this.size.height);this.el.hide();this.proxy.setBounds(b.x,b.y,b.width,b.height,true,.35,this.hideEl.createDelegate(this,[callback]));},hide:function(callback){if(this.fireEvent("beforehide",this)===false)
return;if(this.shadow){this.shadow.hide();}
if(this.shim){this.shim.hide();}
if(this.animateTarget){this.animHide(callback);}else{this.el.hide();this.hideEl(callback);}
return this;},hideEl:function(callback){this.proxy.hide();if(this.modal){this.mask.hide();Ext.get(document.body).removeClass("x-body-masked");}
this.fireEvent("hide",this);if(typeof callback=="function"){callback();}},hideAction:function(){this.setLeft("-10000px");this.setTop("-10000px");this.setStyle("visibility","hidden");},refreshSize:function(){this.size=this.el.getSize();this.xy=this.el.getXY();Ext.state.Manager.set(this.stateId||this.el.id+"-state",this.el.getBox());},setZIndex:function(index){if(this.modal){this.mask.setStyle("z-index",index);}
if(this.shim){this.shim.setStyle("z-index",++index);}
if(this.shadow){this.shadow.setZIndex(++index);}
this.el.setStyle("z-index",++index);if(this.proxy){this.proxy.setStyle("z-index",++index);}
if(this.resizer){this.resizer.proxy.setStyle("z-index",++index);}
this.lastZIndex=index;},getEl:function(){return this.el;}});Ext.DialogManager=function(){var list={};var accessList=[];var front=null;var sortDialogs=function(d1,d2){return(!d1._lastAccess||d1._lastAccess<d2._lastAccess)?-1:1;};var orderDialogs=function(){accessList.sort(sortDialogs);var seed=Ext.DialogManager.zseed;for(var i=0,len=accessList.length;i<len;i++){if(accessList[i]){accessList[i].setZIndex(seed+(i*10));}}};return{zseed:10000,register:function(dlg){list[dlg.id]=dlg;accessList.push(dlg);},unregister:function(dlg){delete list[dlg.id];if(!accessList.indexOf){for(var i=0,len=accessList.length;i<len;i++){if(accessList[i]==dlg){accessList.splice(i,1);return;}}}else{var i=accessList.indexOf(dlg);if(i!=-1){accessList.splice(i,1);}}},get:function(id){return typeof id=="object"?id:list[id];},bringToFront:function(dlg){dlg=this.get(dlg);if(dlg!=front){front=dlg;dlg._lastAccess=new Date().getTime();orderDialogs();}
return dlg;},sendToBack:function(dlg){dlg=this.get(dlg);dlg._lastAccess=-(new Date().getTime());orderDialogs();return dlg;},hideAll:function(){for(var id in list){if(list[id]&&typeof list[id]!="function"&&list[id].isVisible()){list[id].hide();}}}};}();Ext.LayoutDialog=function(el,config){config.autoTabs=false;Ext.LayoutDialog.superclass.constructor.call(this,el,config);this.body.setStyle({overflow:"hidden",position:"relative"});this.layout=new Ext.BorderLayout(this.body.dom,config);this.layout.monitorWindowResize=false;this.el.addClass("x-dlg-auto-layout");this.center=Ext.BasicDialog.prototype.center;this.on("show",this.layout.layout,this.layout,true);};Ext.extend(Ext.LayoutDialog,Ext.BasicDialog,{endUpdate:function(){this.layout.endUpdate();},beginUpdate:function(){this.layout.beginUpdate();},getLayout:function(){return this.layout;},syncBodyHeight:function(){Ext.LayoutDialog.superclass.syncBodyHeight.call(this);if(this.layout)this.layout.layout();}});

Ext.Button=function(renderTo,config){Ext.apply(this,config);this.events={"click":true,"toggle":true,'mouseover':true,'mouseout':true};if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu);}
if(renderTo){this.render(renderTo);}};Ext.extend(Ext.Button,Ext.util.Observable,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",menuClassTarget:'tr',render:function(renderTo){var btn;if(this.hideParent){this.parentEl=Ext.get(renderTo);}
if(!this.dhconfig){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>','<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em><button class="x-btn-text" ext:qtip="{1:htmlEncode}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',"</tr></tbody></table>");}
this.template=Ext.Button.buttonTemplate;}
btn=this.template.append(renderTo,[this.text||'&#160;',this.tooltip||""],true);if(this.cls){btn.addClass(this.cls);}
if(this.icon){btn.child("button:first").setStyle('background-image','url('+this.icon+')');}}else{btn=Ext.DomHelper.append(Ext.get(renderTo).dom,this.dhconfig,true);}
this.el=btn;if(this.id){this.el.dom.id=this.el.id=this.id;}
if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);}
if(Ext.isIE&&!Ext.isIE7){this.autoWidth.defer(1,this);}else{this.autoWidth();}
btn.addClass("x-btn");btn.on("click",this.onClick,this);btn.on("mouseover",this.onMouseOver,this);btn.on("mouseout",this.onMouseOut,this);btn.on("mousedown",this.onMouseDown,this);btn.on("mouseup",this.onMouseUp,this);if(this.hidden){this.hide();}
if(this.disabled){this.disable();}
Ext.ButtonToggleMgr.register(this);if(this.pressed){this.el.addClass("x-btn-pressed");}
if(this.repeat){var repeater=new Ext.util.ClickRepeater(btn,typeof this.repeat=="object"?this.repeat:{});repeater.on("click",this.onClick,this);}},getEl:function(){return this.el;},destroy:function(){Ext.ButtonToggleMgr.unregister(this);this.el.removeAllListeners();this.purgeListeners();this.el.remove();},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.el.child('button');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.Element.measureText(ib,this.text).width+ib.getFrameWidth('lr'));}}
if(this.minWidth){if(this.hidden){this.el.beginMeasure();}
if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth);}
if(this.hidden){this.el.endMeasure();}}}},setHandler:function(handler,scope){this.handler=handler;this.scope=scope;},setText:function(text){this.text=text;this.el.child("td.x-btn-center button.x-btn-text").update(text);this.autoWidth();},getText:function(){return this.text;},show:function(){this.hidden=false;this[this.hideParent?'parentEl':'el'].setStyle("display","");},hide:function(){this.hidden=true;this[this.hideParent?'parentEl':'el'].setStyle("display","none");},setVisible:function(visible){if(visible){this.show();}else{this.hide();}},toggle:function(state){state=state===undefined?!this.pressed:state;if(state!=this.pressed){if(state){this.el.addClass("x-btn-pressed");this.pressed=true;this.fireEvent("toggle",this,true);}else{this.el.removeClass("x-btn-pressed");this.pressed=false;this.fireEvent("toggle",this,false);}
if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,state);}}},focus:function(){this.el.child('button:first').focus();},disable:function(){this.el.addClass("x-btn-disabled");this.disabled=true;},enable:function(){this.el.removeClass("x-btn-disabled");this.disabled=false;},setDisabled:function(v){this[v!==true?"enable":"disable"]();},onClick:function(e){if(e){e.preventDefault();}
if(!this.disabled){if(this.enableToggle){this.toggle();}
if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign);}
this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e);}}},onMouseOver:function(e){if(!this.disabled){this.el.addClass("x-btn-over");this.fireEvent('mouseover',this,e);}},onMouseOut:function(e){if(!e.within(this.el,true)){this.el.removeClass("x-btn-over");this.fireEvent('mouseout',this,e);}},onMouseDown:function(){if(!this.disabled){this.el.addClass("x-btn-click");}},onMouseUp:function(){this.el.removeClass("x-btn-click");},onMenuShow:function(e){this.el.addClass("x-btn-menu-active");},onMenuHide:function(e){this.el.removeClass("x-btn-menu-active");}});Ext.ButtonToggleMgr=function(){var groups={};function toggleGroup(btn,state){if(state){var g=groups[btn.toggleGroup];for(var i=0,l=g.length;i<l;i++){if(g[i]!=btn){g[i].toggle(false);}}}}
return{register:function(btn){if(!btn.toggleGroup){return;}
var g=groups[btn.toggleGroup];if(!g){g=groups[btn.toggleGroup]=[];}
g.push(btn);btn.on("toggle",toggleGroup);},unregister:function(btn){if(!btn.toggleGroup){return;}
var g=groups[btn.toggleGroup];if(g){g.remove(btn);btn.un("toggle",toggleGroup);}}};}();

Ext.MenuButton=function(renderTo,config){Ext.MenuButton.superclass.constructor.call(this,renderTo,config);this.events["arrowclick"]=true;};Ext.extend(Ext.MenuButton,Ext.Button,{render:function(renderTo){var tpl=new Ext.Template('<table cellspacing="0" cellpadding="0" class="x-btn-menu-wrap x-btn"><tr><td>','<table cellspacing="0" cellpadding="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>','<tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><button class="x-btn-text" ext:qtip="{1:htmlEncode}">{0}</button></td></tr>',"</tbody></table></td><td>",'<table cellspacing="0" cellpadding="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>','<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" ext:qtip="{2:htmlEncode}">&#160;</button></td><td class="x-btn-right"><i>&#160;</i></td></tr>',"</tbody></table></td></tr></table>");var btn=tpl.append(renderTo,[this.text,this.tooltip||"",this.arrowTooltip||""],true);if(this.cls){btn.addClass(this.cls);}
if(this.icon){btn.child("button").setStyle('background-image','url('+this.icon+')');}
this.el=btn;this.autoWidth();btn.on("click",this.onClick,this);btn.on("mouseover",this.onMouseOver,this);btn.on("mouseout",this.onMouseOut,this);btn.on("mousedown",this.onMouseDown,this);btn.on("mouseup",this.onMouseUp,this);if(this.hidden){this.hide();}
if(this.disabled){this.disable();}
if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);}},autoWidth:function(){if(this.el){var tbl=this.el.child("table:first");var tbl2=this.el.child("table:last");this.el.setWidth("auto");tbl.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.el.child('button:first');if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.Element.measureText(ib,this.text).width+ib.getFrameWidth('lr'));}}
if(this.minWidth){if(this.hidden){this.el.beginMeasure();}
if((tbl.getWidth()+tbl2.getWidth())<this.minWidth){tbl.setWidth(this.minWidth-tbl2.getWidth());}
if(this.hidden){this.el.endMeasure();}}
this.el.setWidth(tbl.getWidth()+tbl2.getWidth());}},setHandler:function(handler,scope){this.handler=handler;this.scope=scope;},setArrowHandler:function(handler,scope){this.arrowHandler=handler;this.scope=scope;},focus:function(){this.el.child("a:first").focus();},onClick:function(e){e.preventDefault();if(!this.disabled){if(e.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign);}
this.fireEvent("arrowclick",this,e);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,e);}}else{this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e);}}}},onMouseDown:function(e){if(!this.disabled){Ext.fly(e.getTarget("table")).addClass("x-btn-click");}},onMouseUp:function(e){Ext.fly(e.getTarget("table")).removeClass("x-btn-click");}});

Ext.Shadow=function(config){Ext.apply(this,config);if(typeof this.mode!="string"){this.mode=this.defaultMode;}
var o=this.offset,a={h:0};switch(this.mode.toLowerCase()){case"drop":a.w=0;a.l=a.t=o;break;case"sides":a.w=(o*2);a.l=-o;a.t=o;break;case"frame":a.w=a.h=(o*2);a.l=a.t=-o;break;};this.adjusts=a;};Ext.Shadow.prototype={defaultMode:"drop",offset:4,show:function(target){target=Ext.get(target);if(!this.el){this.el=Ext.Shadow.Pool.pull();this.el.insertBefore(target);}
this.el.setStyle("z-index",this.zIndex||parseInt(target.getStyle("z-index"),10)-1);this.realign(target.getLeft(true),target.getTop(true),target.getWidth(),target.getHeight());this.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,w,h){var a=this.adjusts,d=this.el.dom,s=d.style;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),sws=sw+"px",shs=sh+"px";if(s.width!=sws||s.height!=shs){s.width=sws;s.height=shs;var cn=d.childNodes;var sww=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=sww;cn[1].childNodes[1].style.width=sww;cn[2].childNodes[1].style.width=sww;cn[1].style.height=Math.max(0,(sh-12))+"px";}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}}};Ext.Shadow.Pool=function(){var p=[];var markup='<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var sh=p.shift();if(!sh){sh=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,markup));if(Ext.isIE&&!Ext.isIE7){sh.setOpacity(.3);}}
return sh;},push:function(sh){p.push(sh);}};}();

Ext.MessageBox=function(){var dlg,opt,mask;var bodyEl,msgEl,textboxEl,textareaEl,progressEl,pp;var buttons,activeTextEl,bwidth;var handleButton=function(button){dlg.hide();Ext.callback(opt.fn,opt.scope||window,[button,activeTextEl.dom.value],1);};var handleHide=function(){if(opt&&opt.cls){dlg.el.removeClass(cls);}};var updateButtons=function(b){var width=0;if(!b){buttons["ok"].hide();buttons["cancel"].hide();buttons["yes"].hide();buttons["no"].hide();return width;}
for(var k in buttons){if(typeof buttons[k]!="function"){if(b[k]){buttons[k].show();buttons[k].setText(typeof b[k]=="string"?b[k]:Ext.MessageBox.buttonText[k]);width+=buttons[k].el.getWidth()+15;}else{buttons[k].hide();}}}
return width;};return{getDialog:function(){if(!dlg){dlg=new Ext.BasicDialog("x-msg-box",{autoCreate:true,shadow:true,draggable:true,resizable:false,constraintoviewport:false,fixedcenter:true,collapsible:false,shim:true,modal:true,width:400,height:100,buttonAlign:"center",closeClick:function(){if(opt&&opt.buttons&&opt.buttons.no&&!opt.buttons.cancel){handleButton("no");}else{handleButton("cancel");}}});dlg.on("hide",handleHide);mask=dlg.mask;dlg.addKeyListener(27,dlg.hide,dlg);buttons={};var bt=this.buttonText;buttons["ok"]=dlg.addButton(bt["ok"],handleButton.createCallback("ok"));buttons["yes"]=dlg.addButton(bt["yes"],handleButton.createCallback("yes"));buttons["no"]=dlg.addButton(bt["no"],handleButton.createCallback("no"));buttons["cancel"]=dlg.addButton(bt["cancel"],handleButton.createCallback("cancel"));bodyEl=dlg.body.createChild({tag:"div",html:'<span class="ext-mb-text"></span><br /><input type="text" class="ext-mb-input"><textarea class="ext-mb-textarea"></textarea><div class="ext-mb-progress-wrap"><div class="ext-mb-progress"><div class="ext-mb-progress-bar">&#160;</div></div></div>'});msgEl=bodyEl.dom.firstChild;textboxEl=Ext.get(bodyEl.dom.childNodes[2]);textboxEl.enableDisplayMode();textboxEl.addKeyListener([10,13],function(){if(dlg.isVisible()&&opt&&opt.buttons){if(opt.buttons.ok){handleButton("ok");}else if(opt.buttons.yes){handleButton("yes");}}});textareaEl=Ext.get(bodyEl.dom.childNodes[3]);textareaEl.enableDisplayMode();progressEl=Ext.get(bodyEl.dom.childNodes[4]);progressEl.enableDisplayMode();var pf=progressEl.dom.firstChild;pp=Ext.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}
return dlg;},updateText:function(text){if(!dlg.isVisible()&&!opt.width){dlg.resizeTo(this.maxWidth,100);}
msgEl.innerHTML=text||'&#160;';var w=Math.max(Math.min(opt.width||msgEl.offsetWidth,this.maxWidth),Math.max(opt.minWidth||this.minWidth,bwidth));if(opt.prompt){activeTextEl.setWidth(w);}
if(dlg.isVisible()){dlg.fixedcenter=false;}
dlg.setContentSize(w,bodyEl.getHeight());if(dlg.isVisible()){dlg.fixedcenter=true;}
return this;},updateProgress:function(value,text){if(text){this.updateText(text);}
pp.setWidth(Math.floor(value*progressEl.dom.firstChild.offsetWidth));return this;},isVisible:function(){return dlg&&dlg.isVisible();},hide:function(){if(this.isVisible()){dlg.hide();}},show:function(options){var d=this.getDialog();opt=options;d.setTitle(opt.title||"&#160;");d.close.setDisplayed(opt.closable!==false);activeTextEl=textboxEl;opt.prompt=opt.prompt||(opt.multiline?true:false);if(opt.prompt){if(opt.multiline){textboxEl.hide();textareaEl.show();textareaEl.setHeight(typeof opt.multiline=="number"?opt.multiline:this.defaultTextHeight);activeTextEl=textareaEl;}else{textboxEl.show();textareaEl.hide();}}else{textboxEl.hide();textareaEl.hide();}
progressEl.setDisplayed(opt.progress===true);this.updateProgress(0);activeTextEl.dom.value=opt.value||"";if(opt.prompt){dlg.setDefaultButton(activeTextEl);}else{var bs=opt.buttons;var db=null;if(bs&&bs.ok){db=buttons["ok"];}else if(bs&&bs.yes){db=buttons["yes"];}
dlg.setDefaultButton(db);}
bwidth=updateButtons(opt.buttons);this.updateText(opt.msg);if(opt.cls){d.el.addClass(opt.cls);}
d.proxyDrag=opt.proxyDrag===true;d.modal=opt.modal!==false;d.mask=opt.modal!==false?mask:false;if(!d.isVisible()){d.animateTarget=null;d.show(options.animEl);}
return this;},progress:function(title,msg){this.show({title:title,msg:msg,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth});return this;},alert:function(title,msg,fn,scope){this.show({title:title,msg:msg,buttons:this.OK,fn:fn,scope:scope});return this;},confirm:function(title,msg,fn,scope){this.show({title:title,msg:msg,buttons:this.YESNO,fn:fn,scope:scope});return this;},prompt:function(title,msg,fn,scope,multiline){this.show({title:title,msg:msg,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:scope,prompt:true,multiline:multiline});return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Ext.Msg=Ext.MessageBox;

Ext.View=function(container,tpl,config){this.el=Ext.get(container,true);if(typeof tpl=="string"){tpl=new Ext.Template(tpl);}
tpl.compile();this.tpl=tpl;Ext.apply(this,config);this.events={"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true};this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});this.selections=[];this.nodes=[];this.cmp=new Ext.CompositeElementLite([]);if(this.store){this.setStore(this.store,true);}};Ext.extend(Ext.View,Ext.util.Observable,{selectedClass:"x-view-selected",emptyText:"",getEl:function(){return this.el;},refresh:function(){var t=this.tpl;this.clearSelections();this.el.update("");var html=[];var records=this.store.getRange();if(records.length<1){this.el.update(this.emptyText);return;}
for(var i=0,len=records.length;i<len;i++){var data=this.prepareData(records[i].data,i,records[i]);html[html.length]=t.apply(data);}
this.el.update(html.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},prepareData:function(data,index){return data;},onUpdate:function(ds,record){this.clearSelections();var index=this.store.indexOf(record);var n=this.nodes[index];this.tpl.insertBefore(n,this.prepareData(record.data));n.parentNode.removeChild(n);this.updateIndexes(index,index);},onAdd:function(ds,records,index){this.clearSelections();if(this.nodes.length==0){this.refresh();return;}
var n=this.nodes[index];for(var i=0,len=records.length;i<len;i++){var d=this.prepareData(records[i].data);if(n){this.tpl.insertBefore(n,d);}else{this.tpl.append(this.el,d);}}
this.updateIndexes(index);},onRemove:function(ds,record,index){this.clearSelections();this.el.dom.removeChild(this.nodes[index]);this.updateIndexes(index);},refreshNode:function(index){this.onUpdate(this.store,this.store.getAt(index));},updateIndexes:function(startIndex,endIndex){var ns=this.nodes;startIndex=startIndex||0;endIndex=endIndex||ns.length-1;for(var i=startIndex;i<=endIndex;i++){ns[i].nodeIndex=i;}},setStore:function(store,initial){if(!initial&&this.store){this.store.un("datachanged",this.refresh);this.store.un("add",this.onAdd);this.store.un("remove",this.onRemove);this.store.un("update",this.onUpdate);this.store.un("clear",this.refresh);}
if(store){store.on("datachanged",this.refresh,this);store.on("add",this.onAdd,this);store.on("remove",this.onRemove,this);store.on("update",this.onUpdate,this);store.on("clear",this.refresh,this);}
this.store=store;this.refresh();},findItemFromChild:function(node){var el=this.el.dom;if(!node||node.parentNode==el){return node;}
var p=node.parentNode;while(p&&p!=el){if(p.parentNode==el){return p;}
p=p.parentNode;}
return null;},onClick:function(e){var item=this.findItemFromChild(e.getTarget());if(item){var index=this.indexOf(item);if(this.onItemClick(item,index,e)!==false){this.fireEvent("click",this,index,item,e);}}else{this.clearSelections();}},onContextMenu:function(e){var item=this.findItemFromChild(e.getTarget());if(item){this.fireEvent("contextmenu",this,this.indexOf(item),item,e);}},onDblClick:function(e){var item=this.findItemFromChild(e.getTarget());if(item){this.fireEvent("dblclick",this,this.indexOf(item),item,e);}},onItemClick:function(item,index,e){if(this.fireEvent("beforeclick",this,index,item,e)===false){return false;}
if(this.multiSelect||this.singleSelect){if(this.multiSelect&&e.shiftKey&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),index),false);}else{this.select(item,this.multiSelect&&e.ctrlKey);this.lastSelection=item;}
e.preventDefault();}
return true;},getSelectionCount:function(){return this.selections.length;},getSelectedNodes:function(){return this.selections;},getSelectedIndexes:function(){var indexes=[],s=this.selections;for(var i=0,len=s.length;i<len;i++){indexes.push(s[i].nodeIndex);}
return indexes;},clearSelections:function(suppressEvent){if(this.nodes&&(this.multiSelect||this.singleSelect)){this.cmp.elements=this.selections;this.cmp.removeClass(this.selectedClass);this.selections=[];if(!suppressEvent){this.fireEvent("selectionchange",this,this.selections);}}},isSelected:function(node){var s=this.selections;if(s.length<1){return false;}
node=this.getNode(node);return s.indexOf(node)!==-1;},select:function(nodeInfo,keepExisting,suppressEvent){if(nodeInfo instanceof Array){if(!keepExisting){this.clearSelections(true);}
for(var i=0,len=nodeInfo.length;i<len;i++){this.select(nodeInfo[i],true,true);}}else{var node=this.getNode(nodeInfo);if(node&&!this.isSelected(node)){if(!keepExisting){this.clearSelections(true);}
if(this.fireEvent("beforeselect",this,node,this.selections)!==false){Ext.fly(node).addClass(this.selectedClass);this.selections.push(node);if(!suppressEvent){this.fireEvent("selectionchange",this,this.selections);}}}}},getNode:function(nodeInfo){if(typeof nodeInfo=="string"){return document.getElementById(nodeInfo);}else if(typeof nodeInfo=="number"){return this.nodes[nodeInfo];}
return nodeInfo;},getNodes:function(start,end){var ns=this.nodes;start=start||0;end=typeof end=="undefined"?ns.length-1:end;var nodes=[];if(start<=end){for(var i=start;i<=end;i++){nodes.push(ns[i]);}}else{for(var i=start;i>=end;i--){nodes.push(ns[i]);}}
return nodes;},indexOf:function(node){node=this.getNode(node);if(typeof node.nodeIndex=="number"){return node.nodeIndex;}
var ns=this.nodes;for(var i=0,len=ns.length;i<len;i++){if(ns[i]==node){return i;}}
return-1;}});Ext.JsonView=function(container,tpl,config){Ext.JsonView.superclass.constructor.call(this,container,tpl,config);var um=this.el.getUpdateManager();um.setRenderer(this);um.on("update",this.onLoad,this);um.on("failure",this.onLoadException,this);this.events["beforerender"]=true;this.events["load"]=true;this.events["loadexception"]=true;};Ext.extend(Ext.JsonView,Ext.View,{jsonRoot:"",refresh:function(){this.clearSelections();this.el.update("");var html=[];var o=this.jsonData;if(o&&o.length>0){for(var i=0,len=o.length;i<len;i++){var data=this.prepareData(o[i],i,o);html[html.length]=this.tpl.apply(data);}}else{html.push(this.emptyText);}
this.el.update(html.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);},render:function(el,response){this.clearSelections();this.el.update("");var o;try{o=Ext.util.JSON.decode(response.responseText);if(this.jsonRoot){o=eval("o."+this.jsonRoot);}}catch(e){}
this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(node){if(node instanceof Array){var data=[];for(var i=0,len=node.length;i<len;i++){data.push(this.getNodeData(node[i]));}
return data;}
return this.jsonData[this.indexOf(node)]||null;},beforeRender:function(){this.snapshot=this.jsonData;if(this.sortInfo){this.sort.apply(this,this.sortInfo);}
this.fireEvent("beforerender",this,this.jsonData);},onLoad:function(el,o){this.fireEvent("load",this,this.jsonData,o);},onLoadException:function(el,o){this.fireEvent("loadexception",this,o);},filter:function(property,value){if(this.jsonData){var data=[];var ss=this.snapshot;if(typeof value=="string"){var vlen=value.length;if(vlen==0){this.clearFilter();return;}
value=value.toLowerCase();for(var i=0,len=ss.length;i<len;i++){var o=ss[i];if(o[property].substr(0,vlen).toLowerCase()==value){data.push(o);}}}else if(value.exec){for(var i=0,len=ss.length;i<len;i++){var o=ss[i];if(value.test(o[property])){data.push(o);}}}else{return;}
this.jsonData=data;this.refresh();}},filterBy:function(fn,scope){if(this.jsonData){var data=[];var ss=this.snapshot;for(var i=0,len=ss.length;i<len;i++){var o=ss[i];if(fn.call(scope||this,o)){data.push(o);}}
this.jsonData=data;this.refresh();}},clearFilter:function(){if(this.snapshot&&this.jsonData!=this.snapshot){this.jsonData=this.snapshot;this.refresh();}},sort:function(property,dir,sortType){this.sortInfo=Array.prototype.slice.call(arguments,0);if(this.jsonData){var p=property;var dsc=dir&&dir.toLowerCase()=="desc";var f=function(o1,o2){var v1=sortType?sortType(o1[p]):o1[p];var v2=sortType?sortType(o2[p]):o2[p];;if(v1<v2){return dsc?+1:-1;}else if(v1>v2){return dsc?-1:+1;}else{return 0;}};this.jsonData.sort(f);this.refresh();if(this.jsonData!=this.snapshot){this.snapshot.sort(f);}}}});

if(typeof Globimages=="undefined")
{var Globimages=new Object();}
Globimages._hashmanager=null;Globimages._gnsfinder=null;Globimages._strings=null;Globimages._locale="fr";Globimages.__months=["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"];Globimages.__days=["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"];Globimages._msgdlg=null;Globimages._swfevents=null;Globimages._username=null;Globimages._sessionid=null;Globimages._userspots=null;Globimages._events=null;Globimages.simpleRequest=function(url,callback,scope,params,method)
{var conn=new Ext.data.Connection();conn.request({url:url,scope:scope,method:method?method:"GET",callback:callback,params:params});};Globimages.namespace=function(s)
{var o,i,j,tokens;tokens=s.split(".");o=Globimages;var s=(tokens[0]=="Globimages")?1:0
for(j=s;j<tokens.length;j++)
{o[tokens[j]]=o[tokens[j]]||{};o=o[tokens[j]];}
return o;};Globimages.getBrowser=function()
{var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("opera")!=-1)
return"opera";if(ua.indexOf("msie")!=-1)
return"msie";if(ua.indexOf("safari")!=-1)
return"safari";if(ua.indexOf("gecko")!=-1)
return"gecko";return null;}
Globimages.delegate=function(df,context,conf)
{var f=function()
{var target=arguments.callee.target;var func=arguments.callee.func;func.config=conf;return func.apply(target,arguments);};f.target=context;f.func=df;f.conf=conf;return f;}
Globimages.formatPosition=function(lng,lat,deg)
{var s="";if(lat!=null)
s+=Globimages.toDegMinutes(lat,true,deg);if(lng!=null)
{if(lat!=null)
s+=" ";s+=Globimages.toDegMinutes(lng,false,deg);}
return s;}
Globimages.formatScale=function(scale)
{return"1 / "+scale;}
Globimages.toDegMinutes=function(d,lat,deg)
{var ns;if(lat==true)
{if(d>=0)ns="N";else ns="S";}
else
if(d>=0)ns="E";else ns="W";var d2=Math.abs(d);var degrees=Math.floor(d2);var m=(d2-degrees)*60;var minutes=Math.floor(m);var dec=Math.floor((m-minutes)*1000);if(lat==true)
return Globimages.pad2Zeroes(degrees,2,false)+(!deg?"&deg;":deg)+Globimages.pad2Zeroes(minutes,2,false)+"."+Globimages.pad2Zeroes(dec,3,true)+" "+ns;return Globimages.pad2Zeroes(degrees,3,false)+(!deg?"&deg;":deg)+Globimages.pad2Zeroes(minutes,2,false)+"."+Globimages.pad2Zeroes(dec,3,true)+" "+ns;}
Globimages.pad2Zeroes=function(val,num,after)
{var str=val.toString();if(num<=str.length)
return str;var l=str.length;for(var i=0;i<num-l;i++)
{if(!after)
str="0"+str;else
str+="0";}
return str;}
Globimages.parseJSONString=function(s)
{while(s.length>0&&(s.charAt(0)!="{")&&(s.charAt(0)!="["))
s=s.substring(1,s.length);if(s.length>0)
{var e=Math.max(s.lastIndexOf("]"),s.lastIndexOf("}"));s=s.substring(0,e+1);return eval("("+s+")");}
return null;}
Globimages.setDigits=function(n,nbdigits)
{var str=new String(n);var l=str.length;if(l==nbdigits)
return str;if(l>nbdigits)
return str.substring(str.length-nbdigits);for(var i=0;i<nbdigits-l;i++)
str="0"+str;return str;}
Globimages.toHex=function(v,minlength)
{if(v==undefined||isNaN(v))
return undefined;var tokens="0123456789abcdef";var str="";var a=v,d,r;while(true)
{d=Math.floor(a/16);r=a%16;str=tokens.charAt(r)+str;if(d<16)
{if(d!=0)
str=tokens.charAt(d)+str;break;}
a=d;}
if(minlength==undefined||str.length>=minlength)
return str;var prefix="";for(var i=0;i<minlength-str.length;i++)
prefix+="0";return prefix+str;}
Globimages.initStrings=function(urls)
{Globimages._strings=new Globimages.Strings(urls);}
Globimages.loadStrings=function()
{Globimages._strings.load();}
Globimages.getString=function(id)
{if(Globimages._strings!=null)
return Globimages._strings.getString(id,Globimages._locale);return"";}
Globimages.replace=function(str,tok,newtok)
{if(str==undefined||str.length==0||tok==undefined||tok.length==0)
return str;var sstr,estr;var idx;for(idx=str.indexOf(tok,idx);idx>=0;idx=str.indexOf(tok,idx+1))
{sstr=str.substr(0,idx);estr=str.substr(idx+tok.length);if(newtok!=undefined)
str=sstr+newtok+estr;else
str=sstr+estr;}
return str;}
Globimages.formatDate=function(date,formatstr)
{if(date==undefined)
return null;if(formatstr==undefined||formatstr.length==0)
return date.toString();var datestr=new String(formatstr);var val=date.getFullYear();if(datestr.indexOf("YYYY")>=0)
datestr=Globimages.replace(datestr,"YYYY",String(val));else
if(datestr.indexOf("YY")>=0)
datestr=Globimages.replace(datestr,"YY",Globimages.setDigits(val,2));val=date.getMonth();if(datestr.indexOf("MMMM")>=0)
datestr=Globimages.replace(datestr,"MMMM",Globimages.getMonthLabel(val));else
if(datestr.indexOf("MMM")>=0)
datestr=Globimages.replace(datestr,"MMM",Globimages.getMonthLabel(val).substr(0,3));else
if(datestr.indexOf("MM")>=0)
datestr=Globimages.replace(datestr,"MM",Globimages.setDigits(val+1,2));val=date.getDay();if(datestr.indexOf("dddd")>=0)
datestr=Globimages.replace(datestr,"dddd",Globimages.getDayLabel(val));else
if(datestr.indexOf("ddd")>=0)
datestr=Globimages.replace(datestr,"ddd",Globimages.getDayLabel(val).substr(0,3));if(datestr.indexOf("z")>=0)
datestr=Globimages.replace(datestr,"z",Globimages.getTimezoneString(date));val=date.getDate();datestr=Globimages.replace(datestr,"DD",Globimages.setDigits(val,2));val=date.getHours();datestr=Globimages.replace(datestr,"hh",Globimages.setDigits(val,2));val=date.getMinutes();datestr=Globimages.replace(datestr,"mm",Globimages.setDigits(val,2));val=date.getSeconds();datestr=Globimages.replace(datestr,"ss",Globimages.setDigits(val,2));return datestr;}
Globimages.getMonthLabel=function(n)
{if(n<0||n>=Globimages.__months.length)
return null;return Globimages.getString(Globimages.__months[n]);}
Globimages.getDayLabel=function(n)
{if(n<0||n>=Globimages.__days.length)
return null;return Globimages.getString(Globimages.__days[n]);}
Globimages.getTimezoneString=function(date)
{var i=date.getTimezoneOffset();if(i==0)
return"GMT";var plus=(i>=0)?true:false;var ret=plus?"GMT -":"GMT +";if(!plus)i*=-1;var m=i%60;var h=(i-m)/60;return ret+Globimages.setDigits((h*100)+m,4);}
Globimages.openSocialBookmarkURL=function(url)
{url=Globimages.replace(url,"{link}",escape(document.location));var title=Globimages.getDocumentTitle(true)+" - "+Globimages.getSpotName(true," ");url=Globimages.replace(url,"{title}",escape(title));window.open(url,'','scrollbars=yes,menubar=yes,height=600,width=750,resizable=yes,toolbar=yes,location=yes,status=yes',false);return false;};Globimages.getCookie=function(name)
{var cookies={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var matches;while((matches=re.exec(c))!=null)
{var n=matches[1];var value=matches[2];if(n=="GLOBIMAGES-"+name)
return value;}
return"";};Globimages.setCookie=function(name,value)
{document.cookie="GLOBIMAGES-"+name+"="+value+";"+"expires="+new Date(new Date().getTime()+(3600000*24*93)).toGMTString()+";path=/;";};Globimages.alert=function(idtitle,message,callback,idok,idcancel)
{Globimages.MessageDialog.show(idtitle,message,callback,idok,idcancel);};Globimages.afterLoad=function()
{if(Globimages._events)
Globimages._events.fireEvent("afterload");};Globimages.beforeLoad=function()
{if(Globimages._events)
Globimages._events.fireEvent("beforeload");};

Globimages.namespace("HashManager");Globimages.HashManager=function(callback)
{if(Globimages._hashmanager!=null)
return;Globimages._hashmanager=this;this._browser=Globimages.getBrowser();this._ready=false;this._callback=callback;this._currenthash=this._getHash();if(this._currenthash=="")
{this._currenthash=Globimages.getCookie("weather-state");if(this._currenthash!="")
document.location.hash=this._currenthash;}
else
Globimages.setCookie("weather-state",this._currenthash);}
Ext.extend(Globimages.HashManager,Object,{_ready:false,_browser:null,_currenthash:null,_callback:null,_ieframe:null,run:function()
{if(this._ready)
return;if(this._browser=="msie")
{document.write('<iframe id="glb_hmanager_frame" src="" style="position:absolute;visibility:hidden;"></iframe>');this._ieframe=document.getElementById("glb_hmanager_frame");this._writeIEFrame(this._currenthash);}
this._runHashWatcher();},getHash:function()
{return this._decode(this._currenthash);},setHash:function(h)
{if(h==null)
h="";h=this._encode(h);Globimages.setCookie("weather-state",h);this._ieframe=document.getElementById("glb_hmanager_frame");if(this._ieframe)
{document.location.hash=h;this._writeIEFrame(h);}
else
{document.location.hash=h;}},_writeIEFrame:function(h)
{try
{var d=this._ieframe.contentWindow.document;d.open();d.write('<html><body><script type="text\/javascript">window._hash="'+h+'";'+'window.onload=parent.Globimages._hashmanager._syncHash;<\/script><\/body><\/html>');d.close();}
catch(e)
{}},_syncHash:function()
{var h=document.location.href;var i=h.indexOf("#");h=i>=0?h.substr(i+1):"";if(this._hash!=h)
{document.location.hash=this._hash;}},_runHashWatcher:function()
{window.setInterval(function()
{var manager=Globimages._hashmanager;var h=manager._getHash();if(h!=manager._currenthash)
{manager._currenthash=h;manager._callback.call(manager,manager._decode(h));}},250);},_getHash:function()
{var h=top.location.href;var i=h.indexOf("#");return i>=0?h.substr(i+1):"";},_encode:function(h)
{if(!h)
return;h=h.replace(/[\{\[]/g,"(");h=h.replace(/[\}\]]/g,")");h=h.replace(/\,/g,"!");h=h.replace(/\:/g,"~");h=h.replace(/\"/g,"\'");return encodeURIComponent(h);},_decode:function(h)
{if(!h)
return;h=decodeURIComponent(h);h=h.replace(/\'/g,"\"");h=h.replace(/\!/g,",");h=h.replace(/\~/g,":");var re=/\(([^\:]+?[\,\)])/gi;h=h.replace(re,"[$1");re=/([\,\[][^\:^\)]*?)\)/gi;h=h.replace(re,"$1]");h=h.replace(/\(/g,"{");h=h.replace(/\)/g,"}");return h;}});

Globimages.namespace("PropertyBox");Globimages.PropertyBox=function(config,nostate)
{this._initProperties(config);if(!nostate)
this._connectToBrowserHistory();this._defaultstate=this.getCurrentStateString();if(Globimages._strings)
Globimages._strings.addListener("stringsloaded",this._stringsLoaded,this);};Ext.extend(Globimages.PropertyBox,Object,{_properties:null,_listeners:null,_currstate:null,_hashmanager:null,_defaultstate:null,_initProperties:function(config)
{if(!config)
return;this._properties={};this._currstate={};var e;for(var i=0;i<config.length;i++)
{e=config[i];this._properties[e.name]=new Globimages.PropertyBox.Property(e.name,e.value,e.instate,e.equals);if(e.instate)
this._currstate[e.name]=e.value;}},_stringsLoaded:function(success)
{if(success)
{window.onfocus=Globimages.delegate(this.updateDocumentTitle,this);window.onblur=Globimages.delegate(this.updateDocumentTitle,this);}},_connectToBrowserHistory:function()
{this._hashmanager=new Globimages.HashManager(Globimages.delegate(this._onStateChange,this));var oldstate=this._computeCurrentState();var str=this._hashmanager.getHash();this._updateState(oldstate,str);this._hashmanager.run();},_onStateChange:function(str)
{if(!str)
str=this._defaultstate;var oldstate=this._computeCurrentState();if(this._updateState(oldstate,str))
this._notifyStateChange(oldstate,this._currstate);this.updateDocumentTitle();},_updateState:function(oldstate,str)
{if(!str||!oldstate||!Globimages.parseJSONString)
return false;var state=Globimages.parseJSONString(str);if(!state)
return false;this._currstate={};var v;var modified=false;for(var p in oldstate)
{v=state[p];if(v==undefined)
v=oldstate[p];if(this._properties[p].modify(v,null,true))
modified=true;this._currstate[p]=this._properties[p].getValue();}
return modified;},_notifyStateChange:function(oldstate,newstate)
{if(!this._listeners)
return;var listener;for(var i=0;i<this._listeners.length;i++)
{listener=this._listeners[i];if(listener.onStateChange)
{var f=Globimages.delegate(listener.onStateChange,listener);f.call(listener,oldstate,newstate);}}},_computeCurrentState:function()
{if(!this._properties)
return;var state={};for(var p in this._properties)
{if(this._properties[p].isInState())
state[p]=this._properties[p].getValue();}
return state;},getCurrentState:function()
{return _computeCurrentState();},getCurrentStateString:function()
{if(!this._properties)
return;var state="";var first=true;for(var n in this._properties)
{if(!this._properties[n].isInState())
continue;state+=first?"{":",";if(first)first=false;state+=n+":"+this._properties[n].getState();}
state+="}";return state;},addListener:function(prop,obj,callback)
{if(!this.hasListener(obj)&&obj.onStateChange!=undefined)
{if(this._listeners==null)
this._listeners=new Array();this._listeners.push(obj);}
if(!prop)
return;var p=this._properties[prop]
if(p)
p.addListener(obj,callback);},hasListener:function(obj)
{if(this._listeners==null||obj==null)
return false;for(var i=0;i<this._listeners.length;i++)
if(this._listeners[i]==obj)
return true;return false;},removeListener:function(prop,obj)
{var p=this._properties[prop]
if(!p)
return;p.removeListener(obj);},getValue:function(prop)
{var p=this._properties[prop]
if(!p)
return;return p.getValue();},changeState:function(props,values,obj)
{var oldstate=this._computeCurrentState();var modified=this.modify(props,values,obj,true);if(modified)
{var newstate=this._computeCurrentState();this._notifyStateChange(oldstate,newstate);}},modify:function(props,values,obj,changestate)
{var modified;if(typeof props=="object")
{if(!(typeof values=="object"||values.length!=props.length))
return false;for(var i=0;i<props.length;i++)
if(this._modify(props[i],values[i],obj,changestate))
modified=true;}
else
modified=this._modify(props,values,obj,changestate);if(modified)
this._stateModified();return modified;},_modify:function(prop,value,obj,changingstate)
{var p=this._properties[prop]
if(!p)
return false;if(p.modify(value,obj,changingstate))
{this._currstate[prop]=p.getValue();return p.isInState();}
return false;},_stateModified:function()
{if(this._hashmanager)
this._hashmanager.setHash(this.getCurrentStateString());},updateDocumentTitle:function()
{if(Globimages.getDocumentTitle)
window.document.title=Globimages.getDocumentTitle();}});Globimages.namespace("PropertyBox.Property");Globimages.PropertyBox.Property=function(name,value,instate,equals)
{this._name=name;this._value=this._decode(value);this._instate=instate;this.__equals=equals;};Ext.extend(Globimages.PropertyBox.Property,Object,{_name:null,_value:null,_listeners:null,_instate:false,addListener:function(obj,callback)
{if(!obj||!callback)
return false;if(this._listeners==null)
this._listeners=new Array();var e=this._getListenerEntry(obj);if(e!=null)
e.callback=Globimages.delegate(callback,obj);else
this._listeners.push({obj:obj,callback:Globimages.delegate(callback,obj)});return true;},removeListener:function(obj)
{if(!this._listeners)
return;for(var i=0;i<this._listeners.length;i++)
if(this._listeners[i].obj==obj)
{this._listeners.splice(i,1);break;}},hasListener:function(obj)
{return this._getListenerEntry(obj)!=null;},_getListenerEntry:function(obj)
{if(!this._listeners)
return null;for(var i=0;i<this._listeners.length;i++)
if(this._listeners[i].obj==obj)
return this._listeners[i];return null;},isInState:function()
{return this._instate;},getValue:function()
{return this._value;},modify:function(value,initiator,changingstate)
{if(changingstate)
value=this._decode(value);if(this._equals(this._value,value))
return false;this._value=value;this._notifyExcept(initiator,changingstate);return true;},_decode:function(v)
{if(typeof this._value=="string")
return unescape(v);if(this._value instanceof Array)
{for(var i=0;i<v.length;i++)
{if(typeof v[i]=="string")
v[i]=unescape(v[i]);}
return v;}
if(typeof this._value=="object")
{for(var n in v)
{if(typeof v[n]=="string")
v[n]=unescape(v[n]);}
return v;}
return v;},_equals:function(v0,v1)
{if(this.__equals)
return this.__equals.call(this,v0,v1);if(!v0&&!v1)
return true;if(v0 instanceof Array)
{if(!(v1 instanceof Array)||v1.length!=v0.length)
return false;for(var i=0;i<v0.length;i++)
{if(v1[i]!=v0[i])
return false;}
return true;}
if(typeof v0=="object")
{if(typeof v1!="object")
return false;for(var n in v0)
{if(v1[n]!=v0[n])
return false;}
for(var n in v1)
{if(v1[n]!=v0[n])
return false;}
return true;}
return v0==v1;},getState:function()
{if(typeof this._value=="string")
escape(this._value[n]);if(typeof this._value!="object")
return this._value;if(this._value instanceof Array)
{var state="[";var first=true;for(var i=0;i<this._value.length;i++)
{state+=first?"":",";if(first)first=false;if(typeof this._value[i]=="string")
state+='"'+escape(this._value[i])+'"';else
state+=this._value[i];}
state+="]";return state;}
var state="";var first=true;for(var n in this._value)
{state+=first?"{":",";if(first)first=false;if(typeof this._value[n]=="string")
state+=n+':"'+escape(this._value[n])+'"';else
state+=n+':'+this._value[n];}
state+="}";return state;},_notifyExcept:function(initiator,changingstate)
{if(!this._listeners)
return;var entry;for(var i=0;i<this._listeners.length;i++)
{entry=this._listeners[i];if(!entry.callback||!entry.obj||(initiator&&(entry.obj==initiator))||(changingstate&&entry.obj.onStateChange))
continue;entry.callback.call(this,this._value);}}});

Globimages.namespace("Strings");Globimages.Strings=function(urls)
{Globimages.Strings.superclass.constructor.call(this);if(!urls||urls.length==0)
return;var entries=[];for(var i=0;i<urls.length;i++)
entries.push({url:urls[i],loaded:false,success:false});this._urls=entries;this.addEvents({stringsloaded:true});}
Ext.extend(Globimages.Strings,Ext.util.Observable,{_strings:null,_defaultlocale:null,_urls:null,_tobeloaded:0,load:function()
{var urls=this._urls;if(urls==null)
return;this._tobeloaded=urls.length;for(var i=0;i<urls.length;i++)
Globimages.simpleRequest(urls[i].url,this._loaded,this);},_loaded:function(options,success,rsp)
{this._tobeloaded--;var urls=this._urls;for(var i=0;i<urls.length;i++)
if(options.url==urls[i].url)
{urls[i].loaded=true;urls[i].success=success;break;}
if(rsp.responseText!=undefined)
this._parse(rsp.responseXML.documentElement);if(this._tobeloaded==0)
{var ok=true;for(var i=0;i<urls.length;i++)
if(!urls[i].success)
{ok=false;break;}
this.fireEvent("stringsloaded",ok);}},isLoaded:function(url)
{var urls=this._urls;for(var i=0;i<urls.length;i++)
if(urls[i]==url)
return(urls[i].loaded&&urls[i].success);},isNotFound:function(url)
{var urls=this._urls;for(var i=0;i<urls.length;i++)
if(urls[i]==url)
return(urls[i].loaded&&!urls[i].success);},_parse:function(node)
{if(node==undefined||node.nodeName.toLowerCase()!="strings")
return;var strings=node.getElementsByTagName("string");var id,type,item,value,n;for(var i=0;i<strings.length;i++)
{n=strings[i];id=n.getAttribute("id");if(id==undefined)
continue;item=null;var nn;var items=n.getElementsByTagName("lang");for(var j=0;j<items.length;j++)
{nn=items[j];type=nn.getAttribute("type");if(type==undefined)
continue;value=nn.firstChild.nodeValue;if(value==undefined)
return;if(item==undefined)
item=new Object();item[type]=value;}
if(this._strings==null)
this._strings=new Object();this._strings[id]=item;}},getString:function(id,locale)
{if(id==undefined||this._strings==null)
return null;var type=(locale!=undefined)?locale:this._defaultlocale;if(type==undefined)
return null;var item=this._strings[id];if(item==undefined)
return null;return item[type];}});

Globimages.namespace("MessageDialog");Globimages.MessageDialog=function(idtitle,message,callback,idok,idcancel)
{Globimages.MessageDialog._instance=this;var conf={autoCreate:true,title:Globimages.getString(idtitle),width:200,height:150,resizable:false,collapsible:false,modal:true,autoScroll:false,closable:true,syncHeightBeforeShow:true,shadow:"drop",buttonAlign:"center",minButtonWidth:60};this._callback=callback;Globimages.MessageDialog.superclass.constructor.call(this,"",conf);this.addKeyListener(27,this._cancel,this);this.el.addClass("glb-messagedial");var old=Ext.DomHelper.useDom;Ext.DomHelper.useDom=true;this.body.addClass("glb-messagedial-message")
this._message=this.body.createChild({tag:"span"});this._message.update(message);this._cancelbut=this.addButton(Globimages.getString("IDS_CANCEL"),this._cancel,this);this._okbut=this.addButton(Globimages.getString("IDS_OK"),this._ok,this);this._enableButtons(idok,idcancel);Ext.DomHelper.useDom=old;}
Globimages.MessageDialog._instance=null;Globimages.MessageDialog.show=function(idtitle,message,callback,idok,idcancel)
{var dlg=Globimages.MessageDialog._instance;if(!dlg)
dlg=Globimages.MessageDialog._instance=new Globimages.MessageDialog(idtitle,message,callback,idok,idcancel);else
dlg.init(idtitle,message,callback,idok,idcancel);dlg.show();};Ext.extend(Globimages.MessageDialog,Ext.BasicDialog,{_okbut:null,_cancelbut:null,_message:null,_callback:null,init:function(idtitle,message,callback,idok,idcancel)
{this._callback=callback;this._message.update(message);this.setTitle(Globimages.getString(idtitle));this._enableButtons(idok,idcancel);},_enableButtons:function(idok,idcancel)
{if(!idok&&!idcancel)
{this._okbut.setText(Globimages.getString("IDS_CLOSE"));this._okbut.show();this._okbut[this._okbut.hideParent?'parentEl':'el'].setStyle("visibility","");this._cancelbut.hide();return;}
if(idcancel)
{this._cancelbut.setText(Globimages.getString(idcancel));this._cancelbut.show();this._cancelbut[this._cancelbut.hideParent?'parentEl':'el'].setStyle("visibility","");}
else
this._cancelbut.hide();if(idok)
{this._okbut.setText(Globimages.getString(idok));this._okbut.show();this._okbut[this._okbut.hideParent?'parentEl':'el'].setStyle("visibility","");}
else
this._okbut.hide();},_ok:function()
{this.hide();if(this._callback)
this._callback.call(this,true);},_cancel:function()
{this.hide();if(this._callback)
this._callback.call(this,false);}});

Globimages.namespace("GNSFinder");Globimages.GNSFinder=function(baseurl,dataurl)
{if(Globimages._gnsfinder!=null)
return;Globimages._gnsfinder=this;this._baseurl=baseurl;this._dataurl=dataurl;var conf={proxy:new Ext.data.HttpProxy({url:this._dataurl,method:'GET'}),reader:new Ext.data.JsonReader({root:'data',id:'uid'},[{name:'name'},{name:'lng'},{name:'lat'},{name:'type',mapping:'dsgid',convert:Globimages.delegate(this.getGroupLabelFromDsg,this)},{name:'country',mapping:'ccid',convert:Globimages.delegate(this.getCountryName,this)},{name:'ccid'}])};Globimages.GNSFinder.superclass.constructor.call(this,conf);this.addEvents({ongnsfinderready:true,onrequesttotal:true});this.addListener("beforeload",this._onBeforeLoad,this);this._loadMetadata();Globimages._strings.addListener("stringsloaded",this._onStringsLoaded,this);}
Ext.extend(Globimages.GNSFinder,Ext.data.Store,{_baseurl:null,_dataurl:null,_tobeloaded:4,_cc:null,_dsg:null,_grp:null,_limit:50,_ready:false,_datasource:null,_metaerror:false,_from:0,_rqparams:0,_grid:null,_rqtotal:-1,_at:null,_loadMetadata:function()
{this._tobeloaded=4;this._metaerror=false;Globimages.simpleRequest(this._baseurl+"/conf/countries.json",this._ccLoaded,this);Globimages.simpleRequest(this._baseurl+"/conf/designations.json",this._dsgLoaded,this);Globimages.simpleRequest(this._baseurl+"/conf/groups.json",this._grpLoaded,this);},_init:function()
{if(Globimages._initial)
{var cnt=this.getCountryFromName(Globimages._initial);if(cnt)
{var pos={x:cnt.lng,y:cnt.lat};var spot={x:cnt.lng,y:cnt.lat,c:cnt.name};Globimages.BlackBox.changeState(["p","s","z"],[pos,spot,cnt.scale],this);}}
this._grp["i10"].label=Globimages.getString("IDS_DATAGROUP_POPULATEDPLACES");this._grp["i9"].label=Globimages.getString("IDS_DATAGROUP_LAKES");this._grp["i8"].label=Globimages.getString("IDS_DATAGROUP_REEFS");this._grp["i7"].label=Globimages.getString("IDS_DATAGROUP_BAYS");this._grp["i6"].label=Globimages.getString("IDS_DATAGROUP_ISLANDS");this._grp["i5"].label=Globimages.getString("IDS_DATAGROUP_ISLANDSGROUPS");this._grp["i4"].label=Globimages.getString("IDS_DATAGROUP_SEAS");this._grp["i3"].label=Globimages.getString("IDS_DATAGROUP_BIGCITIES");this._grp["i2"].label=Globimages.getString("IDS_DATAGROUP_CAPITALS");this._grp["i1"].label=Globimages.getString("IDS_DATAGROUP_COUNTRIES");this._grp["i0"].label=Globimages.getString("IDS_DATAGROUP_OCEANS");this._ready=true;this.fireEvent("onGNSFinderReady");},_onStringsLoaded:function(success)
{this._tobeloaded--;if(!success)
this._metaerror=true;if(this._tobeloaded==0)
this._init();},_ccLoaded:function(options,success,rsp)
{if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o!=null&&o.data!=undefined&&o.data.length>0)
{this._cc={};var data=o.data;var item;for(var i=0;i<data.length;i++)
{item=data[i];this._cc["i"+item.id]={name:item.name,lng:item.lng,lat:item.lat,id:item.id,scale:item.scale};}}}
else
this._metaerror=true;this._tobeloaded--;if(this._tobeloaded==0)
this._init();},_dsgLoaded:function(options,success,rsp)
{if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o!=null&&o.data!=undefined&&o.data.length>0)
{this._dsg={};var data=o.data;var item;for(var i=0;i<data.length;i++)
{item=data[i];this._dsg["i"+item.id]={grp:item.grp,name:item.name};}}}
else
this._metaerror=true;this._tobeloaded--;if(this._tobeloaded==0)
this._init();},_grpLoaded:function(options,success,rsp)
{if(rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o!=null&&o.data!=undefined&&o.data.length>0)
{this._grp={};var data=o.data;var item;for(var i=0;i<data.length;i++)
{item=data[i];this._grp["i"+item.id]={name:item.name,id:item.id};}}}
else
this._metaerror=true;this._tobeloaded--;if(this._tobeloaded==0)
this._init();},isReady:function()
{return this._ready&&!this._metaerror;},getCountries:function()
{return this._cc;},getSortedCountries:function()
{var a=[];for(var c in this._cc)
a.push(this._cc[c]);a.sort(function(a,b)
{if(a.name<b.name)
return-1;if(a.name>b.name)
return 1;return 0;});return a;},getCountryName:function(ccid)
{if(ccid==null)
return"";try
{return this._cc["i"+ccid].name;}
catch(e)
{return"";}},getCountryFromName:function(name)
{if(name==null||name.length==0)
return null;for(var id in this._cc)
{if(this._cc[id].name==name)
return this._cc[id];}
return null;},getCountryScale:function(ccid)
{if(ccid==null)
return"";try
{return this._cc["i"+ccid].scale;}
catch(e)
{return"";}},getCountry:function(ccid)
{if(ccid==null)
return"";try
{return this._cc["i"+ccid];}
catch(e)
{return{name:"",lng:0,lat:0};}},getGroupLabelFromDsg:function(dsgid)
{if(dsgid==null)
return"";try
{return this._grp["i"+this._dsg["i"+dsgid].grp].label;}
catch(e)
{return"";}},getGroupLabel:function(id)
{try
{return this._grp["i"+id].label;}
catch(e)
{return"";}},getGroups:function()
{return this._grp;},_onBeforeLoad:function(options)
{if(this._loading)
return false;this._loading=true;return true;},isLoading:function()
{return this._loading;},loadRecords:function(o,options,success)
{Globimages.GNSFinder.superclass.loadRecords.call(this,o,options,success);if(success)
{this._from=(o.records.length==0)?-1:this.getCount();if(this._rqtotal>0&&this._from>=this._rqtotal)
this._from=-1;}
this._loading=false;this._showResults();},findRequestTotal:function()
{var params={};Ext.apply(params,this._rqparams);params.count=true;delete params.limit;delete params.from;Globimages.simpleRequest(this._dataurl,this._requestTotal,this,params);},_requestTotal:function(options,success,rsp)
{if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o!=null&&o.data!=undefined&&o.data.length>0)
{var count=o.data[0].count;if(count!=undefined)
{this._rqtotal=count;this.fireEvent("onrequesttotal",count);}}}},getRequestParameters:function()
{var rq={};Ext.apply(rq,this._rqparams)
return rq;},find:function(at,search,stype,ccid,grpid,zone)
{if(!this._ready||search==undefined)
{this._rqparams=null;return;}
this._at=at;this._from=0;this._rqtotal=-1;var params=this._rqparams={};params.search=search;if(stype!=undefined)params.stype=stype;if(ccid!=undefined)params.cc=""+ccid;if(grpid!=undefined)params.group=""+grpid;params.limit=""+this._limit;params.json="true";params.action="findInZone";if(zone!=undefined)
{if(zone.xMin!=undefined)
params.minx=""+zone.xMin;if(zone.xMax!=undefined)
params.maxx=""+zone.xMax;if(zone.yMin!=undefined)
params.miny=""+zone.yMin;if(zone.yMax!=undefined)
params.maxy=""+zone.yMax;}
this.findMore();this.findRequestTotal();},isFinished:function()
{return this._from<0;},findMore:function()
{if(!this._ready||this._rqparams==null||this._from<0)
return;this._rqparams.from=this._from;if(this._from==0)
this.load({params:this._rqparams});else
this.load({add:true,params:this._rqparams});},_showResults:function()
{var n=this.getCount();if(n==1&&this._from<=1)
{var record=this.getAt(0);var pos={x:record.get('lng'),y:record.get('lat')};var spot={x:record.get('lng'),y:record.get('lat'),n:record.get('name'),c:record.get('country')};var scale=this.getCountryScale(record.get('ccid'));if(scale!=0)
Globimages.BlackBox.changeState(["p","s","z"],[pos,spot,scale],this);else
Globimages.BlackBox.modify(["p","s"],[pos,spot],this);return;}
this.showDialog();if(n==0)
{Globimages.alert.defer(1000,window,["IDS_MESSAGE",Globimages.getString("IDS_GNSNOTFOUND")]);}},showDialog:function(animtarget)
{this._at=animtarget?animtarget:this._at;if(this._grid==null)
this._grid=new Globimages.GNSFinderResultsDialog(this._at);else
{if(this._grid.isVisible())
this._grid.expand();else
this._grid.show(this._at);}},getRequestTotal:function()
{return this._rqtotal;}});Globimages.namespace("GNSFinderResultsDialog");Globimages.GNSFinderResultsDialog=function(animtarget)
{this._finder=Globimages._gnsfinder;var conf={autoCreate:true,autoTabs:false,width:350,height:300,shadow:"drop",resizable:true,resizeHandles:"se",autoScroll:false,modal:false,syncHeightBeforeShow:true,title:Globimages.getString("IDS_GNSSEARCHTITLE"),center:{autoScroll:false,titleBar:false,collapsible:false,tabPosition:"top",resizeTabs:true,floatable:false},south:{height:20,autoScroll:false,titleBar:false,collapsible:false,floatable:false}}
Globimages.GNSFinderResultsDialog.superclass.constructor.call(this,"",conf);this.el.addClass("glb-gns-results-dial");var layout=this.getLayout();var cp=new Ext.ContentPanel("",{title:Globimages.getString("IDS_GNSRESULTSTAB"),autoCreate:true,fitToFrame:true});var el=cp.getEl();this._idresults=cp.getId();el.addClass("glb-gns-results");el.setStyle("overflow","hidden");el.setHeight("300");this._grid=new Globimages.GNSFinderResults(el);var sf=new Ext.ContentPanel("",{title:Globimages.getString("IDS_GNSSEARCHTAB"),autoCreate:true,fitToFrame:true});var el=sf.getEl();this._idsearch=sf.getId();new Globimages.GNSForm(el,false);var cpmsg=new Ext.ContentPanel("",{autoCreate:true});this._msgel=cpmsg.getEl();this._msgel.addClass("glb-gns-results-footer");this.updateMessage();layout.beginUpdate();layout.add("center",sf);layout.add("center",cp);layout.add("south",cpmsg);layout.endUpdate();this.addKeyListener(27,this.hide,this);this.show(animtarget);}
Ext.extend(Globimages.GNSFinderResultsDialog,Ext.LayoutDialog,{_grid:null,_msgel:null,_finder:null,_idsearch:null,_idresults:null,onResize:function()
{Globimages.GNSFinderResultsDialog.superclass.onResize.call(this);this._grid.autoSize();},expand:function()
{Globimages.GNSFinderResultsDialog.superclass.expand.call(this);this._grid.autoSize();},show:function(animtarget)
{Globimages.GNSFinderResultsDialog.superclass.show.call(this,animtarget);this.showResults();this._finder.addListener("load",this.showResults,this,true);this._finder.addListener("onrequesttotal",this.updateMessage,this,true);},hide:function(callback)
{this.resetMessage();Globimages.GNSFinderResultsDialog.superclass.hide.call(this,callback);this._finder.removeAll();this._finder.removeListener("load",this.updateMessage,this);this._finder.removeListener("onrequesttotal",this.updateMessage,this);},resetMessage:function()
{if(!this._msgel)
return;this._msgel.update("");},showResults:function()
{this.updateMessage();if(this._finder.getCount()>0)
this.layout.showPanel(this._idresults);else
this.layout.showPanel(this._idsearch);},updateMessage:function()
{if(!this._msgel)
return;var found=this._finder.getRequestTotal();var loaded=this._finder.getCount();if(found<=0||loaded<=0)
{this._msgel.update(Globimages.getString("IDS_GNSSTATUS_NORESULTS"));return;}
var lfound=Globimages.getString("IDS_GNSFOUNDITEM"+(found>1?"S":""));var lloaded=Globimages.getString("IDS_GNSLOADEDITEM"+(loaded>1?"S":""));var str=loaded+"&nbsp;"+lloaded+"&nbsp;/&nbsp;"+found+"&nbsp;"+lfound;this._msgel.update(str);}});

Globimages.namespace("LoadingIndicator");Globimages.LoadingIndicator=function(div)
{if(!div||(typeof(div)=="string"&&div.length==0))
return;this._cntr=Ext.get(div);if(!this._cntr)
return;this._init();}
Ext.extend(Globimages.LoadingIndicator,Object,{_cntr:null,_indicator:null,_init:function()
{this._cntr.addClass("glb-loading-indicator-cntr");this._indicator=this._cntr.createChild({tag:"label",cls:"glb-loading-indicator",style:"vertical-align:top;"});this._indicator.setVisible(false,false);this._indicator.update("&nbsp;");Globimages._events.addListener("beforeload",this._beforeLoad,this);Globimages._events.addListener("afterload",this._afterLoad,this);},_beforeLoad:function()
{this._indicator.setVisible(true,false);},_afterLoad:function()
{this._indicator.setVisible(false,false);}});

Globimages.namespace("LocationField");Globimages.LocationField=function(div)
{if(!Globimages._gnsfinder||!div||(typeof(div)=="string"&&div.length==0))
return;this._cntr=Ext.get(div);if(!this._cntr)
return;Globimages._strings.addListener("stringsloaded",this._init,this);}
Ext.extend(Globimages.LocationField,Object,{_cntr:null,_field:null,_init:function()
{this._field=this._cntr.createChild({tag:"label",cls:"glb-locationfield-label"});var spot=Globimages.BlackBox.getValue("s");this._onSpotChange(spot);Globimages.BlackBox.addListener("s",this,this._onSpotChange);},_onSpotChange:function(spot)
{if(!spot)
return;var str=Globimages.getSpotName();this._field.update(str);}});

Globimages.namespace("GNSForm");Globimages.GNSForm=function(div,simple)
{if(!Globimages._gnsfinder||!div||(typeof(div)=="string"&&div.length==0))
return;this._simple=simple;this._cntr=Ext.get(div);if(!this._cntr)
return;this._finder=Globimages._gnsfinder;this._init();}
Globimages.GNSForm.SIMPLE_FORM="glb-gnssf";Globimages.GNSForm.SIMPLE_LABEL_CELL="glb-gnssf-label-cell";Globimages.GNSForm.SIMPLE_INPUT_CELL="glb-gnssf-input-cell";Globimages.GNSForm.SIMPLE_LABEL="glb-gnssf-label";Globimages.GNSForm.SIMPLE_INPUT="glb-gnssf-input";Globimages.GNSForm.SIMPLE_INPUT_TD="glb-gnssf-input-td";Globimages.GNSForm.SIMPLE_SUBMIT="glb-gnssf-submit"
Globimages.GNSForm.CNTR="glb-gnsff-cntr";Globimages.GNSForm.TABLE="glb-gnsff-table";Globimages.GNSForm.TH="glb-gnsff-th";Globimages.GNSForm.TI="glb-gnsff-ti";Globimages.GNSForm.TDL="glb-gnsff-tdl";Globimages.GNSForm.TDR="glb-gnsff-tdr";Globimages.GNSForm.TDF="glb-gnsff-tdf";Globimages.GNSForm.TR="glb-gnsff-tr";Globimages.GNSForm.LABEL="glb-gnsff-label";Globimages.GNSForm.INPUT="glb-gnsff-input";Globimages.GNSForm.SELECT="glb-gnsff-select";Globimages.GNSForm.SUBMIT="glb-gnsff-submit"
Ext.extend(Globimages.GNSForm,Object,{_inputelem:null,_subbut:null,_finder:null,_cntr:null,_simple:true,_stype:null,_grpid:null,_ccid:null,_buildSimple:function(cntr)
{cntr=cntr.createChild({tag:"div",cls:Globimages.GNSForm.SIMPLE_FORM});var div=cntr.createChild({tag:"div",cls:Globimages.GNSForm.SIMPLE_LABEL_CELL});var label=div.createChild({tag:"label",cls:Globimages.GNSForm.SIMPLE_LABEL});label.update(Globimages.getString("IDS_GNSSEARCHLABEL"));div=cntr.createChild({tag:"div",cls:Globimages.GNSForm.SIMPLE_INPUT_CELL});var t=div.createChild({tag:"table",cellpadding:0,cellspacing:0});var tab=t.createChild({tag:"tbody"});var row=tab.createChild({tag:"tr"});var td=row.createChild({tag:"td",cls:Globimages.GNSForm.SIMPLE_INPUT_TD});var input=td.createChild({tag:"input",cls:Globimages.GNSForm.SIMPLE_INPUT});this._inputelem=new Ext.form.TextField({minLength:0,maxLength:80,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._inputelem.applyTo(input);this._inputelem.addListener("specialkey",function(t,e)
{if(e.getKey()==e.RETURN)
this._onSubmit();},this);this._inputelem.addListener("invalid",this._enableDisable,this);this._inputelem.addListener("valid",this._enableDisable,this);},_buildFull:function(cntr)
{var old=Ext.DomHelper.useDom;Ext.DomHelper.useDom=true;cntr=cntr.createChild({tag:"div",cls:Globimages.GNSForm.CNTR});var div=cntr.createChild({tag:"div",cls:Globimages.GNSForm.TI});new Globimages.LoadingIndicator(div);var div=cntr.createChild({tag:"div",cls:Globimages.GNSForm.TH});var label=div.createChild({tag:"label",cls:Globimages.GNSForm.LABEL});label.update(Globimages.getString("IDS_QUERYLABEL"));var t=cntr.createChild({tag:"table",cls:Globimages.GNSForm.TABLE,cellpadding:0,cellspacing:0});var tab=t.createChild({tag:"tbody",cls:Globimages.GNSForm.TABLE,cellpadding:0,cellspacing:0});row=tab.createChild({tag:"tr",cls:Globimages.GNSForm.TR});td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDL,width:"100px"});div=td.createChild({tag:"div"});this._stype=div.createChild({tag:"select",cls:Globimages.GNSForm.SELECT});var o=this._stype.createChild({id:Ext.id(),tag:"option",value:""});o.update(Globimages.getString("IDS_QUERYEXACT"));o=this._stype.createChild({tag:"option",value:"start",selected:"true"});o.update(Globimages.getString("IDS_QUERYSTARTSWITH"));o=this._stype.createChild({tag:"option",value:"contains"});o.update(Globimages.getString("IDS_QUERYCONTAINS"));this._stype.addListener("change",function()
{var type=this._stype.dom.options[this._stype.dom.selectedIndex].value;if(type=="start")
this._inputelem.minLength=2;else
{if(type=="contains")
this._inputelem.minLength=3;else
this._inputelem.minLength=0;}
this._inputelem.validate();},this);td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDR});var input=td.createChild({tag:"input",type:"text",cls:Globimages.GNSForm.INPUT});this._inputelem=new Ext.form.TextField({minLength:0,maxLength:80,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._inputelem.applyTo(input);this._inputelem.addListener("specialkey",function(t,e)
{if(e.getKey()==e.RETURN)
this._onSubmit();},this);this._inputelem.addListener("invalid",this._enableDisable,this);this._inputelem.addListener("valid",this._enableDisable,this);row=tab.createChild({tag:"tr",cls:Globimages.GNSForm.TR});td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDL,width:"100px"});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.GNSForm.LABEL});label.update(Globimages.getString("IDS_QUERYPLACESTYPE"));td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDR});this._grpid=td.createChild({tag:"select",cls:Globimages.GNSForm.SELECT});var o=this._grpid.createChild({tag:"option",value:-1,selected:"true"});o.update(Globimages.getString("IDS_QUERYNOTYPE"));var groups=this._finder.getGroups();for(var i in groups)
{o=this._grpid.createChild({tag:"option",value:groups[i].id});o.update(groups[i].label);}
row=tab.createChild({tag:"tr",cls:Globimages.GNSForm.TR});td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDL,width:"100px"});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.GNSForm.LABEL});label.update(Globimages.getString("IDS_QUERYCOUNTRIES"));td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDR});this._ccid=td.createChild({tag:"select",cls:Globimages.GNSForm.SELECT});var o=this._ccid.createChild({tag:"option",value:-1,selected:"true"});o.update(Globimages.getString("IDS_QUERYNOCOUNTRY"));var countries=this._finder.getSortedCountries();for(var i=0;i<countries.length;i++)
{o=this._ccid.createChild({tag:"option",value:countries[i].id});o.update(countries[i].name);}
row=tab.createChild({tag:"tr",cls:Globimages.GNSForm.TR});td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDF,width:"100px"});td=row.createChild({tag:"td",cls:Globimages.GNSForm.TDF});div=td.createChild({tag:"div"});Ext.DomHelper.useDom=old;this._subbut=new Ext.Button(div,{handler:this._onSubmit,scope:this,minWidth:60,text:Globimages.getString("IDS_GNSSEARCH"),hideParent:true});},_initForm:function()
{var rq=this._finder.getRequestParameters();if(!rq)
return;this._inputelem.setValue(rq.search||"");if(this._simple)
return;if(rq.stype=="start")
this._stype.dom.selectedIndex=1;else
if(rq.stype=="contains")
this._stype.dom.selectedIndex=2;var idx=-1;for(var i=0;i<this._grpid.dom.options.length;i++)
if(this._grpid.dom.options[i].value==rq.group)
{idx=i;break;}
if(idx>=0)
this._grpid.dom.selectIndex=idx;else
this._grpid.dom.selectIndex=0;idx=-1;for(var i=0;i<this._ccid.dom.options.length;i++)
if(this._ccid.dom.options[i].value==rq.cc)
{idx=i;break;}
if(idx>=0)
this._ccid.dom.selectIndex=idx;else
this._grpid.dom.selectIndex=0;},_init:function()
{if(!this._finder.isReady())
{this._finder.addListener("onGNSFinderReady",this._init,this);return;}
var cntr=this._cntr;if(cntr==undefined)
return;cntr.addClass(Globimages.GNSForm.CLASS_CNTR);if(this._simple)
this._buildSimple(cntr);else
this._buildFull(cntr);this._initForm();this._finder.addListener("load",this._afterLoad,this);this._finder.addListener("loadexception",this._afterLoad,this);},_afterLoad:function()
{var rq=this._finder.getRequestParameters();if(rq)
this._initForm();},_onSubmit:function()
{if(!this._inputelem.isValid())
return;if(this._finder.isReady()&&!this._finder.isLoading())
{var search=this._inputelem.getValue();var re=/^\s*(.+?)\s*$/gi;search=search.replace(re,"$1");if(this._simple)
{var rq=this._finder.getRequestParameters();this._finder.find(this._inputelem.el,search,"start");return;}
var stype=this._stype.dom.options[this._stype.dom.selectedIndex].value;var grpid=this._grpid.dom.options[this._grpid.dom.selectedIndex].value;var ccid=this._ccid.dom.options[this._ccid.dom.selectedIndex].value;stype=(stype=="")?undefined:stype;grpid=(grpid<0)?undefined:grpid;ccid=(ccid<0)?undefined:ccid;this._finder.find(this._inputelem.el,search,stype,ccid,grpid);}},_enableDisable:function()
{var inv=this._inputelem.el.hasClass(this._inputelem.invalidClass);if(this._subbut!=null)
this._subbut.setDisabled(inv);}});

Globimages.namespace("CountriesCombo");Globimages.CountriesCombo=function(div)
{if(!Globimages._gnsfinder||!div||(typeof(div)=="string"&&div.length==0))
return;this._cntr=Ext.get(div);if(!this._cntr)
return;this._finder=Globimages._gnsfinder;this._init();}
Globimages.CountriesCombo.CNTR="glb-cntcombo-cntr";Globimages.CountriesCombo.CELL="glb-cntcombo-cell";Globimages.CountriesCombo.LABEL="glb-cntcombo-label";Globimages.CountriesCombo.COMBO="glb-cntcombo-combo";Globimages.CountriesCombo.LIST="glb-cntcombo-list";Ext.extend(Globimages.CountriesCombo,Ext.form.ComboBox,{_init:function()
{if(!this._finder.isReady())
{this._finder.addListener("onGNSFinderReady",this._init,this);return;}
this._cntr.addClass(Globimages.CountriesCombo.CNTR);var div=this._cntr.createChild({tag:"div",cls:Globimages.CountriesCombo.CELL});var label=div.createChild({tag:"label",cls:Globimages.CountriesCombo.LABEL});label.update(Globimages.getString("IDS_GNSSEARCHCOUNTRIES"));var e=this._cntr.createChild({tag:"input",type:"text",width:"100px"});var store=new Ext.data.Store({reader:new Ext.data.JsonReader({id:'id'},[{name:'name'},{name:'lng'},{name:'lat'},{name:'scale'}]),proxy:new Ext.data.MemoryProxy(this._finder.getSortedCountries())});var conf={store:store,displayField:'name',typeAhead:true,mode:'local',triggerAction:'all',listWidth:200,listClass:Globimages.CountriesCombo.LIST,selectOnFocus:true};Globimages.CountriesCombo.superclass.constructor.call(this,conf);this.applyTo(e);e.addClass(Globimages.CountriesCombo.COMBO);store.load();},onSelect:function(record,index)
{Globimages.CountriesCombo.superclass.onSelect.call(this,record,index);var pos={x:record.get('lng'),y:record.get('lat')};var spot={x:record.get('lng'),y:record.get('lat'),c:record.get('name')};var scale=record.get('scale');if(scale==0)
Globimages.BlackBox.modify(["p","s"],[pos,spot],this);else
Globimages.BlackBox.changeState(["p","s","z"],[pos,spot,scale],this);}});

Globimages.namespace("WeatherCombo");Globimages.WeatherCombo=function(div)
{this._cntr=Ext.get(div);if(!this._cntr)
return;this._basetime=Globimages.BlackBox.getValue("t");this._offset=Globimages.BlackBox.getValue("o");Globimages.BlackBox.addListener("o",this,this._onWeatherOffset)
if(this._basetime==0)
Globimages.BlackBox.addListener("t",this,this._onBaseTime)
else
this._init();}
Globimages.WeatherCombo.CNTR="glb-weathercombo-cntr";Globimages.WeatherCombo.CELL="glb-weathercombo-cell";Globimages.WeatherCombo.SELECT="glb-weathercombo-select";Ext.extend(Globimages.WeatherCombo,Object,{_cntr:null,_basetime:0,_offset:0,_select:null,_onBaseTime:function(t)
{if(this._basetime==t)
return;this._basetime=t;this._init();},_init:function()
{var fmt=Globimages.getString("IDS_FULLDATEFORMAT")
var old=Ext.DomHelper.useDom;Ext.DomHelper.useDom=true;var cntr=this._cntr.createChild({tag:"div",cls:Globimages.WeatherCombo.CNTR});var div=cntr.createChild({tag:"div",cls:Globimages.WeatherCombo.CELL});var sel=div.createChild({tag:"select",cls:Globimages.WeatherCombo.SELECT});var o,date,s,j=6;for(var i=0;i<=168;i+=j)
{date=new Date(this._basetime+(i*3600000));s=Globimages.formatDate(date,fmt);if(i==this._offset)
o=sel.createChild({id:Ext.id(),tag:"option",value:i,selected:true});else
o=sel.createChild({id:Ext.id(),tag:"option",value:i});o.update(s);if(i==72)j=12;if(i==120)j=24;}
Ext.DomHelper.useDom=old;this._select=sel;sel.addListener("change",function()
{var o=sel.dom.options[sel.dom.selectedIndex].value;Globimages.BlackBox.modify("o",o,this);});},_onWeatherOffset:function(o)
{this._offset=o;if(this._select==null)
return;var idx;if(o<=72)
idx=o/6;else
{if(o<=120)
idx=((o-72)/12)+12;else
idx=((o-120)/24)+16;}
this._select.dom.selectedIndex=idx;}});

Globimages.namespace("GNSFinderResults");Globimages.GNSFinderResults=function(div)
{this._finder=Globimages._gnsfinder;this._blackbox=Globimages.BlackBox;this._cntr=div;this._init();}
Ext.extend(Globimages.GNSFinderResults,Ext.grid.Grid,{_blackbox:null,_finder:null,_cntr:null,_lasttop:0,_dlmodify:null,_init:function()
{if(!this._finder.isReady())
{this._finder.addListener("onGNSFinderReady",this._init,this);return;}
var cm=new Ext.grid.ColumnModel([{header:Globimages.getString("IDS_QUERYHEADERNAME"),dataIndex:'name',width:100,sortable:true},{header:Globimages.getString("IDS_QUERYHEADERCOUNTRY"),dataIndex:'country',width:100,sortable:true},{header:Globimages.getString("IDS_QUERYHEADERTYPE"),dataIndex:'type',width:1500,sortable:true}]);var cnf={ds:this._finder,cm:cm,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:2,enableColumnMove:false};Globimages.GNSFinderResults.superclass.constructor.call(this,this._cntr,cnf);this.addListener("bodyscroll",this._onScroll,this);this.render();this._unbindScrollToTop();this.selModel.addListener("rowselect",this._onRowSelect,this);},_unbindScrollToTop:function()
{var view=this.getView();this._finder.un("load",view.scrollToTop,view);},_onScroll:function(left,top)
{var desc=(top>this._lasttop);this._lasttop=top;if(!desc||this._finder.isLoading()||this._finder.isFinished())
return;var view=this.getView();var sh=view.scroller.dom.scrollHeight;var p=view.mainWrap.getHeight(true);if(sh-top<(8*p))
this._finder.findMore();},_onRowSelect:function(row,index,record)
{if(!record)
return;var pos={x:record.get('lng'),y:record.get('lat')};var spot={x:record.get('lng'),y:record.get('lat'),n:record.get('name'),c:record.get('country')};var scale=this._finder.getCountryScale(record.get('ccid'));if(!this._dlmodify)
{this._dlmodify=new Ext.util.DelayedTask(this._delayedModify,this,[pos,spot,scale]);}
this._dlmodify.delay(100,null,null,[pos,spot,scale]);},_delayedModify:function(pos,spot,scale)
{if(scale>0)
Globimages.BlackBox.changeState(["p","s","z"],[pos,spot,scale],this);else
Globimages.BlackBox.modify(["p","s"],[pos,spot],this);}});

Globimages.namespace("SpotReader");Globimages.SpotReader=function()
{meta={root:'data'};recordtype=[{name:"feature"},{name:"sub"},{name:"order"},{name:"unit"},{name:"unittype"},{name:"lng"},{name:"lat"},{name:"f0"},{name:"f6"},{name:"f12"},{name:"f18"},{name:"f24"},{name:"f30"},{name:"f36"},{name:"f42"},{name:"f48"},{name:"f54"},{name:"f60"},{name:"f66"},{name:"f72"},{name:"f84"},{name:"f96"},{name:"f108"},{name:"f120"},{name:"f144"},{name:"f168"},{name:"footer"}];Globimages.SpotReader.superclass.constructor.call(this,meta,recordtype);};Globimages.SpotReader._acceptHandler=function(v)
{return v;}
Globimages.SpotReader._positiveHandler=function(v)
{if(v<0)
return null;return v;}
Globimages.SpotReader._datahandlers={PRMSL:{func:Globimages.SpotReader._acceptHandler,order:11,unittype:"press",unit:0},WNDA:{func:Globimages.SpotReader._acceptHandler,order:5,unittype:"dir",unit:2},WNDS:{func:Globimages.SpotReader._acceptHandler,order:6,unittype:"speed",unit:0},TMP:{func:Globimages.SpotReader._acceptHandler,order:3,unittype:"tmp",unit:0},TCDC:{func:Globimages.SpotReader._acceptHandler,order:1,unittype:"tcdc",unit:1},PRATE:{func:Globimages.SpotReader._acceptHandler,order:2,unittype:"prate",unit:1},RH:{func:Globimages.SpotReader._acceptHandler,order:4,unittype:"rh",unit:0},WW3HEIGHT:{func:Globimages.SpotReader._positiveHandler,order:8,unittype:"height",unit:0},WW3DIR:{func:Globimages.SpotReader._positiveHandler,order:7,unittype:"dir",unit:2},WW3SDIR:{func:Globimages.SpotReader._positiveHandler,order:10,unittype:"dir",unit:2},WW3PER:{func:Globimages.SpotReader._positiveHandler,order:9,unittype:"period",unit:0}};Ext.extend(Globimages.SpotReader,Ext.data.JsonReader,{_basetime:0,_lng:0,_lat:0,readRecords:function(o)
{this._basetime=o.basetime;this._processWeatherCellData(o.data);return Globimages.SpotReader.superclass.readRecords.call(this,o);},setSpot:function(spot)
{this._lng=spot.x;this._lat=spot.y;},_processWeatherCellData:function(data)
{data.sort(function(a,b)
{if(a.feature<b.feature)
return-1;if(a.feature>b.feature)
return 1;return 0;});this._resetMissingFlags();var spots=new Array();var fspots=new Array();var oldf=null,newf=null;var spot;for(var i=0;i<data.length;i++)
{newf=data[i].feature;if(oldf!=null)
{if(newf!=oldf)
{spot=this._interpolateWeatherCellData(spots);if(spot!=null)
fspots.push(spot);spots=new Array();}}
spots.push(data[i]);oldf=newf;if(i==data.length-1)
{spot=this._interpolateWeatherCellData(spots);if(spot!=null)
fspots.push(spot);}}
this._addMissingRecords(fspots);fspots.sort(function(a,b)
{if(a.order<b.order)
return-1;if(a.order>b.order)
return 1;return 0;});data.splice(0,data.length);for(var i=0;i<fspots.length;i++)
data.push(fspots[i]);data.push(this._buildFooterRecord());},_resetMissingFlags:function()
{var handlers=Globimages.SpotReader._datahandlers;for(var feature in handlers)
handlers[feature].missing=true;},_addMissingRecords:function(spots)
{var handlers=Globimages.SpotReader._datahandlers;var handler;for(var feature in handlers)
{handler=handlers[feature];if(handler.missing)
{spots.push(this._initSpot(feature,handler));handler.missing=false;}}},_initSpot:function(feature,handler)
{var r={};r.feature=feature;r.sub=feature;for(var i=0;i<=72;i+=6)
r["f"+i]="";for(var i=84;i<=120;i+=12)
r["f"+i]="";r["f144"]="";r["f168"]="";r.order=handler.order;r.unit=handler.unit;r.unittype=handler.unittype;return r;},_interpolateWeatherCellData:function(spots)
{if(spots==null||(spots.length!=4&&spots.length!=2))
return null;spots.sort(function(a,b)
{if(a.lat<b.lat)
return-1;if(a.lat>b.lat)
return 1;if(a.lng<b.lng)
return-1;if(a.lng>b.lng)
return 1;return 0;});var y0=spots[0].lat;var y1=spots[1].lat;if(y0!=y1)
return null;var x0=spots[0].lng;var x1=spots[1].lng;var rx=(this._lng-x0)/(x1-x0);if(spots.length==2)
{if(!this._interpolateValues(spots,rx))
return null;}
else
{var y0=spots[0].lat;var y1=spots[2].lat;var ry=(this._lat-y0)/(y1-y0);if(!this._interpolateValues(spots,rx,ry))
return null;}
return spots[0];},_interpolateValues:function(spots,rx,ry)
{if(spots==null||(spots.length!=2&&spots.length!=4)||(spots.length==4&&ry==null))
return false;var handler=Globimages.SpotReader._datahandlers[spots[0].feature];if(handler==null)
return false;handler.missing=false;var v,v0,v1,v00,v01,v10,v11;var linear=(spots.length==2);for(var p in spots[0])
{if(p=="feature"||p=="lng"||p=="lat")
continue;v00=spots[0][p];v01=spots[1][p];v0=v00+((v01-v00)*rx);if(v00==null||v01==null)
{spots[0][p]="";continue;}
if(linear)
{spots[0][p]=v0;continue;}
v10=spots[2][p];v11=spots[3][p];if(v10==null||v11==null)
{spots[0][p]="";continue;}
v1=v10+((v11-v10)*rx);v=v0+((v1-v0)*ry);spots[0][p]=(handler!=null)?handler.func.call(this,v):v;}
spots[0]["order"]=(handler!=null)?handler.order:1;spots[0]["sub"]=spots[0].feature;spots[0]["unit"]=(handler!=null)?handler.unit:undefined;spots[0]["unittype"]=(handler!=null)?handler.unittype:undefined;return true;},_buildFooterRecord:function()
{var footer={};footer.feature=Globimages.getString("IDS_WDT_FORECASTS");footer.sub="";for(var i=0;i<=72;i+=6)
{footer["f"+i]=Globimages.pad2Zeroes(i,2)+"h";}
for(var i=84;i<=120;i+=12)
{n=new Number(i);footer["f"+i]=i+"h";}
footer["f144"]="144h";footer["f168"]="168h";footer.unit=Globimages.getString("IDS_WDT_UNITS");footer.unittype="";footer.footer=true;return footer;}});

Globimages.namespace("SpotStore");Globimages.SpotStore=function(dataurl)
{this._dataurl=dataurl;var conf={proxy:new Ext.data.HttpProxy({url:this._dataurl,method:'GET'}),reader:new Globimages.SpotReader()};Globimages.SpotStore.superclass.constructor.call(this,conf);this.addEvents({firstload:true});Globimages.BlackBox.addListener("s",this,this._onSpotChange);};Globimages.SpotStore._units={press:1,dir:3,tmp:2,speed:4,tcdc:2,prate:2,height:2,rh:1,period:1};Ext.extend(Globimages.SpotStore,Ext.data.Store,{_dataurl:null,_reader:null,_spot:null,getBaseTime:function()
{if(!this.reader)
return null;return this.reader._basetime;},init:function()
{this._onSpotChange(Globimages.BlackBox.getValue("s"));},loadRecords:function(o,options,success)
{Globimages.SpotStore.superclass.loadRecords.call(this,o,options,success);this.fireEvent("firstload");this.loadRecords=Globimages.SpotStore.superclass.loadRecords;},_onSpotChange:function(spot)
{var params={action:"celldata",lng:spot.x,lat:spot.y,json:"true"};this.reader.setSpot(spot);this.load({params:params});},incUnit:function(i)
{var record=this.getAt(i);var nb=this._getNbUnits(record);if(!nb)
return;var u=this._getFeatureUnit(record.data.feature);u++;if(u>=nb)
u=0;this._setFeatureUnit(record.data.feature,u);record.data.unit=u;this.afterEdit(record);},_getNbUnits:function(record)
{return Globimages.SpotStore._units[record.data.unittype];},_getFeatureUnit:function(feature)
{return Globimages.SpotReader._datahandlers[feature].unit;},_setFeatureUnit:function(feature,u)
{Globimages.SpotReader._datahandlers[feature].unit=u;}});

Globimages.namespace("SpotColumns");Globimages.SpotColumns=function(grid,baseurl,colors)
{this._baseurl=baseurl;this._colors=colors;this._grid=grid;this._initColors();this._formatters={PRMSL:this._PRMSLFormatter,WNDA:this._WNDAFormatter,WNDS:this._WNDSFormatter,TMP:this._TMPFormatter,RH:this._RHFormatter,TCDC:this._TCDCFormatter,PRATE:this._PRATEFormatter,WW3HEIGHT:this._WW3HEIGHTFormatter,WW3DIR:this._WW3DIRFormatter,WW3PER:this._WW3PERFormatter,WW3SDIR:this._WW3SDIRFormatter};var conf=[];conf.push({dataIndex:"feature",header:"f",width:50,resizable:false,renderer:Globimages.delegate(this._featureNameFormatter,this)});conf.push({dataIndex:"sub",header:"s",width:50,resizable:false,renderer:Globimages.delegate(this._subFeatureNameFormatter,this)});for(var i=0;i<=72;i+=6)
conf.push({dataIndex:"f"+i,header:i+"",width:30,resizable:false,renderer:Globimages.delegate(this._featureFormatter,this)});for(var i=84;i<=120;i+=12)
conf.push({dataIndex:"f"+i,header:i+"",width:30,resizable:false,renderer:Globimages.delegate(this._featureFormatter,this)});conf.push({dataIndex:"f144",header:"144",width:30,resizable:false,renderer:Globimages.delegate(this._featureFormatter,this)});conf.push({dataIndex:"f168",header:"168",width:30,resizable:false,renderer:Globimages.delegate(this._featureFormatter,this)});conf.push({dataIndex:"unit",header:"Unit",width:50,resizable:false,renderer:Globimages.delegate(this._unitFormatter,this)});Globimages.SpotColumns.superclass.constructor.call(this,conf);};Globimages.SpotColumns.WS_MODE_KT=0;Globimages.SpotColumns.WS_MODE_MS=1;Globimages.SpotColumns.WS_MODE_KMH=2;Globimages.SpotColumns.WS_MODE_BFT=3;Globimages.SpotColumns.TMP_MODE_C=0;Globimages.SpotColumns.TMP_MODE_F=1;Globimages.SpotColumns.TCDC_MODE_PERCENT=0;Globimages.SpotColumns.TCDC_MODE_PIC=1;Globimages.SpotColumns.PRATE_MODE_MMPH=0;Globimages.SpotColumns.PRATE_MODE_PIC=1;Globimages.SpotColumns.DIR_MODE_DEG=0;Globimages.SpotColumns.DIR_MODE_CARD=1;Globimages.SpotColumns.DIR_MODE_PIC=2;Globimages.SpotColumns.HT_MODE_M=0;Globimages.SpotColumns.HT_MODE_F=1;Globimages.SpotColumns.CARDPOINTS=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"];Globimages.SpotColumns.BEAUFORT=[1,4,7,11,17,22,28,34,41,48,56,64];Globimages.SpotColumns.FOOTER_TD_CLASS="glb-wdt-footer-td";Globimages.SpotColumns.DATA_CLASS="glb-wdt-data";Globimages.SpotColumns.UNIT_CLASS="glb-wdt-unit";Globimages.SpotColumns.NOCLICK_CLASS="glb-wdt-noclick";Globimages.SpotColumns.MULTIUNIT_CLASS="glb-wdt-unit-multi";Ext.extend(Globimages.SpotColumns,Ext.grid.ColumnModel,{_baseurl:null,_colors:null,_unitFormatter:function(data,params,record,i,j)
{params.span="";if(record.data.footer)
params.css=Globimages.SpotColumns.FOOTER_TD_CLASS;else
params.css=Globimages.SpotColumns.UNIT_CLASS;var val;switch(record.data.unittype)
{case"tcdc":if(record.data.unit==Globimages.SpotColumns.TCDC_MODE_PERCENT)
val="%";else
val=Globimages.getString("IDS_WDT_PIC");params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;case"press":val="hPa";params.css+=" "+Globimages.SpotColumns.NOCLICK_CLASS;break;case"rh":val="%";params.css+=" "+Globimages.SpotColumns.NOCLICK_CLASS;break;case"period":val=Globimages.getString("IDS_WDT_SECONDS");params.css+=" "+Globimages.SpotColumns.NOCLICK_CLASS;break;case"prate":if(record.data.unit==Globimages.SpotColumns.PRATE_MODE_MMPH)
val="mm/24h";else
val=Globimages.getString("IDS_WDT_PIC");params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;case"height":if(record.data.unit==Globimages.SpotColumns.HT_MODE_M)
val=Globimages.getString("IDS_WDT_METERS");else
val=Globimages.getString("IDS_WDT_FEET");params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;case"dir":if(record.data.unit==Globimages.SpotColumns.DIR_MODE_DEG)
val=Globimages.getString("IDS_WDT_DEGREES");else
if(record.data.unit==Globimages.SpotColumns.DIR_MODE_CARD)
val=Globimages.getString("IDS_WDT_CARD");else
if(record.data.unit==Globimages.SpotColumns.DIR_MODE_PIC)
val=Globimages.getString("IDS_WDT_PIC");params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;case"tmp":if(record.data.unit==Globimages.SpotColumns.TMP_MODE_C)
val="C&deg;";else
val="F&deg;";params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;case"speed":if(record.data.unit==Globimages.SpotColumns.WS_MODE_KT)
val=Globimages.getString("IDS_WDT_KNOTS");else
if(record.data.unit==Globimages.SpotColumns.WS_MODE_KMH)
val=Globimages.getString("IDS_WDT_KMH");else
if(record.data.unit==Globimages.SpotColumns.WS_MODE_MS)
val=Globimages.getString("IDS_WDT_MS");else
if(record.data.unit==Globimages.SpotColumns.WS_MODE_BFT)
val=Globimages.getString("IDS_WDT_BEAUFORT");;params.css+=" "+Globimages.SpotColumns.MULTIUNIT_CLASS;break;default:val=record.data.unit;params.css+=" "+Globimages.SpotColumns.NOCLICK_CLASS;}
return val;},_featureNameFormatter:function(data,params,record,i,j)
{var val;params.span="";if(record.data.footer)
{params.span="colspan='2'"
params.css=Globimages.SpotColumns.FOOTER_TD_CLASS;val=(data!=null)?data:"";}
else
if(typeof data=="string"&&data.length>0)
{var s;switch(data)
{case"WNDS":s=Globimages.getString("IDS_WDT_WIND");params.span="style='display:none'"
break;case"WNDA":s=Globimages.getString("IDS_WDT_WIND");params.span="rowspan='2'"
break;case"WW3DIR":s=Globimages.getString("IDS_WDT_SWELL");params.span="rowspan='3'"
break;case"WW3HEIGHT":s=Globimages.getString("IDS_WDT_SWELL");params.span="style='display:none'"
break;case"WW3PER":s=Globimages.getString("IDS_WDT_SWELL");params.span="style='display:none'"
break;case"WW3SDIR":params.span="colspan='2'"
s=Globimages.getString("IDS_WDT_WAVES");break;default:params.span="colspan='2'"
s=Globimages.getString("IDS_WDT_"+data);}
val=(s!=null)?s:"";}
return val;},_subFeatureNameFormatter:function(data,params,record,i,j)
{params.span="";if(record.data.footer)
{params.span="style='display:none'"}
else
if(typeof data=="string"&&data.length>0)
{var s;switch(data)
{case"WW3DIR":case"WNDA":s=Globimages.getString("IDS_WDT_DIRECTION");break;case"WNDS":s=Globimages.getString("IDS_WDT_SPEED");break;case"WW3HEIGHT":s=Globimages.getString("IDS_WDT_HEIGHT");break;case"WW3PER":s=Globimages.getString("IDS_WDT_WW3PER");break;default:params.span="style='display:none'"
s="";}
val=(s!=null)?s:"";}
return val;},_featureFormatter:function(data,params,record,i,j)
{params.span="";if(record.data.footer)
{params.css=Globimages.SpotColumns.FOOTER_TD_CLASS;val=data;return val;}
val="";if(typeof data=="number")
{var s=null;var feature=record.data.feature;var formatter=this._formatters[feature];if(formatter!=null)
s=formatter.call(this,data,params,record,i,j);else
s=data+"";if(s!=null)
{var col=this._findColor(feature,data);if(col!=null)
params.attr+="background-color:"+col+";";}
if(params.attr!=null&&params.attr!="")
{params.span=" style=\""+params.attr+"\"";params.attr="";}
params.css=Globimages.SpotColumns.DATA_CLASS;val=(s!=null)?s:"";return val;}
return"-";},_PRMSLFormatter:function(v,params,record,i,j)
{return Math.round(v/100)+"";},_WW3PERFormatter:function(v,params,record,i,j)
{return Math.round(v)+"";},_WNDAFormatter:function(v,params,record,i,j)
{v+=180;if(v>=360)
v-=360;if(record.data.unit==Globimages.SpotColumns.DIR_MODE_DEG)
return Math.round(v);else
{var idx=Math.ceil(Math.floor(v/11.25)/2);if(idx==Globimages.SpotColumns.CARDPOINTS.length)idx=0;if(record.data.unit==Globimages.SpotColumns.DIR_MODE_CARD)
{return Globimages.getString("IDS_WDT_"+Globimages.SpotColumns.CARDPOINTS[idx]);}
else
{var pic=this._baseurl+"/assets/"+Globimages.SpotColumns.CARDPOINTS[idx]+"arrow.gif";params.attr="background-image:url("+pic+");"+"background-position:center center;"+"background-repeat:no-repeat;"+"background-color:#FFFFFF;";return null;}}},_TCDCFormatter:function(v,params,record,i,j)
{if(record.data.unit==Globimages.SpotColumns.TCDC_MODE_PERCENT)
{params.attr="height:25px;";return Math.round(v);}
else
{var idx=Math.round(v/20)*20;var pic=this._baseurl+"/assets/"+"sun"+idx+".png";params.attr="height:25px;"+"background-image:url("+pic+");"+"background-position:center center;"+"background-repeat:no-repeat;"+"background-color:#FFFFFF;";return null;}},_RHFormatter:function(v,params,record,i,j)
{return Math.round(v);},_PRATEFormatter:function(v,params,record,i,j)
{if(record.data.unit==Globimages.SpotColumns.PRATE_MODE_MMPH)
{params.attr="height:25px;";if(v<10)
return(Math.round(v*10)/10)+"";else
return Math.round(v)+"";}
else
{var idx=this._findColorIndex(record.data.feature,v)+1;if(idx<0)idx=0;else if(idx>5)idx=5;var pic=this._baseurl+"/assets/"+"rain"+idx+".gif";params.attr="height:25px;"+"background-image:url("+pic+");"+"background-position:center center;"+"background-repeat:no-repeat;"+"background-color:#FFFFFF;";return null;}},_WNDSFormatter:function(v,params,record,i,j)
{if(record.data.unit==Globimages.SpotColumns.WS_MODE_KT)
return(Math.round(v*10)/10)+"";if(record.data.unit==Globimages.SpotColumns.WS_MODE_KMH)
return Math.round(v*1.852)+"";if(record.data.unit==Globimages.SpotColumns.WS_MODE_MS)
return Math.round(v*1.852/3.6)+"";if(record.data.unit==Globimages.SpotColumns.WS_MODE_BFT)
{var count=Globimages.SpotColumns.BEAUFORT.length;for(var i=count-1;i>=0;i--)
if(v>=Globimages.SpotColumns.BEAUFORT[i])
return(i+1)+"";return"0";}},_TMPFormatter:function(v,params,record,i,j)
{if(record.data.unit==Globimages.SpotColumns.TMP_MODE_C)
return Math.round(v-273.15)+"";if(record.data.unit==Globimages.SpotColumns.TMP_MODE_F)
return Math.round((((v-273.15)*9)/5)+32)+"";},_WW3HEIGHTFormatter:function(v,params,record)
{if(v<0)
return"";else
{v=Math.round(v*10);if(record.data.unit==Globimages.SpotColumns.HT_MODE_M)
return(v/10)+"";else
return(Math.round((v*39.370079/12))/10)+"";}},_WW3DIRFormatter:function(v,params,record,i,j)
{if(v<0)
return"";if(record.data.unit==Globimages.SpotColumns.DIR_MODE_DEG)
return Math.round(v)+"";else
{var idx=Math.ceil(Math.floor(v/11.25)/2);if(idx==Globimages.SpotColumns.CARDPOINTS.length)idx=0;if(record.data.unit==Globimages.SpotColumns.DIR_MODE_CARD)
return Globimages.getString("IDS_WDT_"+Globimages.SpotColumns.CARDPOINTS[idx]);else
{var pic=this._baseurl+"/assets/"+Globimages.SpotColumns.CARDPOINTS[idx]+"arrow.gif";params.attr="background-image:url("+pic+");"+"background-position:center center;"+"background-repeat:no-repeat;"+"background-color:#FFFFFF;";return null;}}},_WW3SDIRFormatter:function(v,params,record,i,j)
{if(v<0)
return"";if(record.data.unit==Globimages.SpotColumns.DIR_MODE_DEG)
return Math.round(v)+"";else
{var idx=Math.ceil(Math.floor(v/11.25)/2);if(idx==Globimages.SpotColumns.CARDPOINTS.length)idx=0;if(record.data.unit==Globimages.SpotColumns.DIR_MODE_CARD)
return Globimages.getString("IDS_WDT_"+Globimages.SpotColumns.CARDPOINTS[idx]);else
{var pic=this._baseurl+"/assets/"+Globimages.SpotColumns.CARDPOINTS[idx]+"arrow.gif";params.attr="background-image:url("+pic+");"+"background-position:center center;"+"background-repeat:no-repeat;"+"background-color:#FFFFFF;";return null;}}},_initColors:function()
{if(this._colors==null)
return;for(var f in this._colors)
{var e=this._colors[f];var count=0;if(e.values==undefined)
{for(var i=0;i<e.steps.length;i++)
count+=e.steps[i];e.values=new Array(count+1);for(var i=0;i<=count;i++)
e.values[i]=e.minval+(i*e.spacing);}
count=e.colors.length;for(var i=0;i<=count;i++)
e.colors[i]="#"+Globimages.toHex(e.colors[i]&0xFFFFFF,6);}},_findColor:function(feature,v)
{if(this._colors==null||feature==null||v==undefined)
return null;var e=this._colors[feature];if(e==undefined)
return null;var count=e.values.length;for(var i=count-1;i>=0;i--)
{if(v<e.values[i])
continue;return e.colors[i];}
return null;},_findColorIndex:function(feature,v)
{if(this._colors==null||feature==null||v==undefined)
return null;var e=this._colors[feature];if(e==undefined)
return null;var count=e.values.length;for(var i=count-1;i>=0;i--)
{if(v<e.values[i])
continue;return i;}
return-1;},getColumnHeader:function(i)
{if(i==1)
return"";var time=this._grid.getBaseTime();if(time==null)
return"";if(i==0)
{var date=new Date(time);return Globimages.formatDate(date,"dddd<br>DD&nbsp;MMMM");}
else
{if(i==this.config.length-1)
return Globimages.getString("IDS_WDT_UNITS");}
var text=this.config[i].header;date=new Date(time+(text*3600000));return Globimages.formatDate(date,"ddd<br>hh"+"h");}});

Globimages.namespace("SpotGrid");Globimages.SpotGrid=function(cntr,baseurl,dataurl)
{this._baseurl=baseurl;this._dataurl=dataurl;this._cntr=Ext.getDom(cntr);Globimages._strings.addListener("stringsloaded",this._stringsLoaded,this);this._loadMetadata();};Ext.extend(Globimages.SpotGrid,Ext.grid.Grid,{_cntr:null,_baseurl:null,_dataurl:null,_metaerror:false,_colors:null,_tobeloaded:2,_colovrl:null,_maxoffset:168,_iid:null,_loadMetadata:function()
{this._tobeloaded=2;this._metaerror=false;Globimages.simpleRequest(this._baseurl+"/conf/fcolors.json",this._colorsLoaded,this);},_stringsLoaded:function(success)
{if(!success)
this._metaerror=true;this._tobeloaded--;if(this._tobeloaded==0)
this._init();},_colorsLoaded:function(options,success,rsp)
{if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o!=null)
this._colors=Globimages.parseJSONString(rsp.responseText);}
else
this._metaerror=true;this._tobeloaded--;if(this._tobeloaded==0)
this._init();},_init:function()
{var cm=new Globimages.SpotColumns(this,this._baseurl,this._colors);var ds=new Globimages.SpotStore(this._dataurl);var sm=new Ext.grid.RowSelectionModel();sm.initEvents=function(){};var cnf={autoWidth:true,trackMouseOver:false,enableColumnMove:false,enableColumnResize:false,ds:ds,cm:cm,sm:sm};Globimages.SpotGrid.superclass.constructor.call(this,this._cntr,cnf);this.addListener("cellclick",this._onCellClick,this);this.addListener("headerclick",this._onHeaderClick,this);ds.addListener("firstload",this._onFirstLoad,this);ds.init();},getBaseTime:function()
{return this.dataSource.getBaseTime();},getView:function()
{if(!this.view)
{var templates={};templates.cell=new Ext.Template('<td class="x-grid-col x-grid-td-{id} {cellId} {css}"  {span} tabIndex="0">','<div class="x-grid-col-{id} x-grid-cell-inner"><div class="x-grid-cell-text" unselectable="on" {attr}>{value}</div></div>',"</td>");templates.cell.disableFormats=true;this.view=new Ext.grid.GridView({templates:templates});}
return this.view;},_onCellClick:function(self,j,i)
{var idx=this.colModel.getDataIndex(i);if(idx=="unit")
{this.dataSource.incUnit(j);}
else
{if(i>=2)
this._offsetSelected(i);}},_onHeaderClick:function(self,i)
{var idx=this.colModel.getDataIndex(i);if(idx!="unit"&&i>=2)
this._offsetSelected(i);},_offsetSelected:function(i)
{var idx=this.colModel.getDataIndex(i);if(!idx||typeof(idx)!="string"||idx.charAt(0)!='f')
return;var o=idx?idx.substring(1):"";if(isNaN(o))
return;this._moveColumnOverlay(i,o);},_buildColumnOverlay:function()
{this._colovrl=this.container.createProxy("x-dlg-proxy",this.mainWrap);this._colovrl.hide=function(){this.setLeft("-10000px");this.setTop("-10000px");this.setStyle("visibility","hidden");};this._colovrl.setOpacity(.4);this._colovrl.hide();},_moveColumnOverlay:function(i,o,anim)
{if(!this.dataSource.getCount())
return;var hc=this.view.getHeaderCell(i);var fc=this.view.getCell(this.dataSource.getCount()-1,i)
var box=this.view.getCellBox(hc);var b=this.view.getCellBox(fc);box.height=(b.y+b.height)-box.y+10;box.x-=Ext.isIE?5:4;box.y-=Ext.isIE?5:4;box.width+=Ext.isIE?9:10;if(this._colovrl==null)
{this._buildColumnOverlay();this._colovrl.setBox(box);}
else
{if(o!=undefined&&o!=null)
this._colovrl.setBox(box,true,true,0.3,Globimages.delegate(this._setOffset,this,o));else
this._colovrl.setBox(box,true,(anim!=undefined)?anim:true);}
this._colovrl.show();},_setOffset:function()
{var o=arguments.callee.config;if(o==undefined)
return;Globimages.BlackBox.modify("o",o,this);},selectColumn:function(o,anim)
{if(isNaN(o)||o<0||!this.dataSource.getCount())
return;var i=this.colModel.findColumnIndex("f"+o);if(i>=0)
this._moveColumnOverlay(i,null,anim);},_onWeatherForecastChange:function(o)
{this.selectColumn(o,true);},_onFirstLoad:function()
{this.render();this._iid=setInterval(Globimages.delegate(this._onFirstRefresh,this),50);Globimages.BlackBox.modify("t",this.getBaseTime(),this);},_onFirstRefresh:function()
{if(!this.view||!this.view.mainWrap||!this.view.mainWrap.isVisible())
return;clearInterval(this._iid);this.selectColumn(Globimages.BlackBox.getValue("o"));Globimages.BlackBox.addListener("o",this,this._onWeatherForecastChange);this.container.setVisible(true);if(Globimages._swfevents)
Globimages._swfevents.addListener("oncontainerresize",this._onExternalResize,this);Ext.EventManager.onWindowResize(this._onExternalResize,this,true);},_onExternalResize:function()
{this.selectColumn(Globimages.BlackBox.getValue("o"),false);}});

if(typeof deconcept=="undefined")var deconcept=new Object();if(typeof deconcept.util=="undefined")deconcept.util=new Object();if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil=new Object();deconcept.SWFObject=function(swf,id,w,h,ver,c,useExpressInstall,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',useExpressInstall);this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={setAttribute:function(name,value){this.attributes[name]=value;},getAttribute:function(name){return this.attributes[name];},addParam:function(name,value){this.params[name]=value;},getParams:function(){return this.params;},addVariable:function(name,value){this.variables[name]=value;},getVariable:function(name){return this.variables[name];},getVariables:function(){return this.variables;},getVariablePairs:function(){var variablePairs=new Array();var key;var variables=this.getVariables();for(key in variables){variablePairs.push(key+"="+variables[key]);}
return variablePairs;},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'"';swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" >';swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";}
return swfNode;},write:function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}}
return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}
try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}
if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;}
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true;}
deconcept.util={getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all)return;var objects=document.getElementsByTagName("OBJECT");for(var i=0;i<objects.length;i++){objects[i].style.display='none';for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){};}}}}
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload=='function'){var oldUnload=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldUnload();}}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}}
if(typeof window.onbeforeunload=='function'){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload();}}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){Array.prototype.push=function(item){this[this.length]=item;return this.length;}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

function setFlashPlayerWidth(divid,w)
{document.getElementById(divid).style.width=w+"px";document.getElementById(divid+"_object").setAttribute("width",w);var provider=Globimages._swfevents;if(!provider)
return;provider.fireEvent("oncontainerresize");}
function setFlashPlayerHeight(divid,h)
{document.getElementById(divid).style.height=h+"px";document.getElementById(divid+"_object").setAttribute("height",h);var provider=Globimages._swfevents;if(!provider)
return;provider.fireEvent("oncontainerresize");}
function __fireFlashEvent(async,evname,args)
{var provider=Globimages._swfevents;if(!provider)
return;if(async)
provider.fireAsyncEvent(evname.toLowerCase(),args);else
provider.fireEvent(evname.toLowerCase(),args);}
Globimages.namespace("SWFEvents");Globimages.SWFEvents=function()
{Globimages.SWFEvents.superclass.constructor.call(this);Globimages._swfevents=this;this.addEvents({oncontainerresize:true,oncreated:true,oninit:true,ontranslated:true,onscalechanged:true,onweatherforecastchanged:true,onfeaturesloaded:true,oninfo:true});};Ext.extend(Globimages.SWFEvents,Ext.util.Observable,{createEvents:function(events)
{if(events==undefined||events.length==0)
return;for(var i=0;i<events.length;i++)
this.createEvent(events[i],{scope:this,silent:true});},fireAsyncEvent:function(type,args)
{var f=Globimages.delegate(function()
{window.clearTimeout(arguments.callee.toid);this.fireEvent.call(this,type,args);},this);f.toid=window.setTimeout(f,100);}});

Globimages.namespace("SWFMaps");Globimages.SWFMaps=function(file,baseurl,wrapper,timecontrol)
{this._wrapperid=wrapper;this._baseurl=baseurl;this._timecontrol=timecontrol;Globimages._swfevents.addListener("oncreated",this._onSWFCreated,this,true);Globimages._swfevents.addListener("oninit",this._onSWFInit,this,true);Globimages._swfevents.addListener("onfeaturesloaded",this._onSWFFeaturesLoaded,this,true);Globimages.SWFMaps.superclass.constructor.call(this,this._baseurl+"/"+file,wrapper+"_object","100%","100%",8);this._blackbox=Globimages.BlackBox;var el=this.getSWFWrapper();var bgcolor=el.style.backgroundColor;if(bgcolor!=undefined)
{var re=/rgb\((\s*[0-9]{1,3}\s*?)\,(\s*[0-9]{1,3}\s*?)\,(\s*[0-9]{1,3}\s*?)\)/gi;var a=re.exec(bgcolor);if(a&&a.length==4)
{var v=Number(a[1]*256*256)+Number(a[2]*256)+Number(a[3]);bgcolor="#"+Globimages.toHex(v,6);}}
this.addParam("base",this._baseurl);this.addParam("scale","noScale");this.addParam("SeamlessTabbing","false");this.addParam("allowScriptAccess","sameDomain");this.addParam("quality","best");this.addParam("bgcolor",bgcolor);this.addParam("wmode","opaque");this.addVariable("__divid",wrapper);if(Globimages._locale!=undefined)
this.addVariable("__locale",Globimages._locale);this.write();this._blackbox.addListener("o",this,this._onForecastChange);this._blackbox.addListener("p",this,this._onPositionChange);this._blackbox.addListener("z",this,this._onScaleChange);this._blackbox.addListener("s",this,this._onSpotChange);this._blackbox.addListener("f",this,this._onWeatherFeaturesChange);};Ext.extend(Globimages.SWFMaps,deconcept.SWFObject,{_wrapperid:null,_swfobject:null,_baseurl:null,write:function()
{Globimages.SWFMaps.superclass.write.call(this,this._wrapperid);},getSWFObject:function()
{return document.getElementById(this._wrapperid+"_object");},getSWFWrapper:function()
{return document.getElementById(this._wrapperid);},setCaret:function(v)
{if(!this._swfobject)
return;this._swfobject.setCaret(v);},_onSWFCreated:function()
{var pos=this._blackbox.getValue("p");var scale=this._blackbox.getValue("z");var features=this._blackbox.getValue("f");var o=this.getSWFObject();o.setPosition(pos.x,pos.y,scale);o.showFeatures("WeatherFeature",true,features);this._swfobject=o;o.init(5);o.onfocus=Globimages.delegate(this._blackbox.updateDocumentTitle,this._blackbox);this._blackbox.updateDocumentTitle();},_onSWFInit:function()
{var offset=Globimages.BlackBox.getValue("o");this._swfobject.selectWeatherForecast(offset);var spot=Globimages.BlackBox.getValue("s");this._swfobject.setCaretPosition(spot.x,spot.y);Globimages._swfevents.addListener("ontranslated",this._onSWFTranslated,this,true);Globimages._swfevents.addListener("oninfo",this._onSWFInfo,this,true);Globimages._swfevents.addListener("onweatherforecastchanged",this._onSWFForecastChanged,this,true);Globimages._swfevents.addListener("onscalechanged",this._onSWFScaleChanged,this,true);},_onSWFScaleChanged:function(args)
{if(args!=undefined&&args[0])
{args[0]=Math.round(args[0]);this._blackbox.modify("z",args[0],this);}},_onSWFTranslated:function(args)
{if(args!=undefined&&args[0]!=null)
{args[0].x=Math.round(args[0].x*10000)/10000;args[0].y=Math.round(args[0].y*10000)/10000;if(args[1]!=null)
{args[1].x=Math.round(args[1].x*10000)/10000;args[1].y=Math.round(args[1].y*10000)/10000;this._blackbox.modify(["p","s"],[args[0],args[1]],this);}
else
this._blackbox.modify("p",args[0],this);}},_onSWFInfo:function(args)
{if(args!=undefined&&args[0]!=null)
{args[0].x=Math.round(args[0].x*10000)/10000;args[0].y=Math.round(args[0].y*10000)/10000;this._blackbox.modify("s",args[0],this);}},_onSWFForecastChanged:function(args)
{if(args!=undefined&&args[0]!=null)
this._blackbox.modify("o",args[0],this);},_onSWFFeaturesLoaded:function(args)
{if(!this._swfobject)
return;var features=this._swfobject.getVisibleFeatureNames("WeatherFeature");if(features==null||features==undefined)
features=[];this._blackbox.modify("f",features,this);if(this._timecontrol)
{var t=this._swfobject.getWeatherBaseTime();this._blackbox.modify("t",t,this);}},onStateChange:function(oldstate,newstate)
{if(!this._swfobject)
return;var s=Globimages.BlackBox.getValue("z");var pos=Globimages.BlackBox.getValue("p");var offset=Globimages.BlackBox.getValue("o");var features=Globimages.BlackBox.getValue("f");var spot=Globimages.BlackBox.getValue("s");this._swfobject.setPosition(pos.x,pos.y,s);this._swfobject.selectWeatherForecast(offset);this._swfobject.showFeatures("WeatherFeature",true,features);this._swfobject.setCaretPosition(spot.x,spot.y);},_onForecastChange:function(offset)
{if(!this._swfobject)
return;this._swfobject.selectWeatherForecast(offset);},_onWeatherFeaturesChange:function(features)
{if(!this._swfobject)
return;this._swfobject.showFeatures("WeatherFeature",true,features);},_onPositionChange:function(pos)
{if(!this._swfobject)
return;this._swfobject.setPosition(pos.x,pos.y);},_onSpotChange:function(pos)
{if(!this._swfobject)
return;this._swfobject.setCaretPosition(pos.x,pos.y);},_onScaleChange:function(s)
{if(!this._swfobject)
return;var pos=Globimages.BlackBox.getValue("p");this._swfobject.setPosition(pos.x,pos.y,s);}});

Globimages.UserErrors=[null,"IDS_ERR_USERNAME_MISSING","IDS_ERR_SESSIONID_MISSING","IDS_ERR_USERNAME_NOTVALIDATED","IDS_ERR_SPOTNAME_MISSING","IDS_ERR_LNG_MISSING","IDS_ERR_LAT_MISSING","IDS_ERR_LAT_INVALID","IDS_ERR_DB_ERROR","IDS_ERR_SPOTID_MISSING","IDS_ERR_SPOTID_INVALID","IDS_ERR_SPOTNAME_EXISTS","IDS_ERR_SCALE_MISSING"];

Globimages.namespace("UserSpotsStore");Globimages.UserSpotsStore=function(dataurl)
{var conf={proxy:new Ext.data.HttpProxy({url:dataurl+"app/users/Users",method:'GET'}),reader:new Ext.data.JsonReader({root:'data',id:'id'},[{name:'name'},{name:'tags'},{name:'lng'},{name:'lat'},{name:'scale'},{name:'features'},{timestamp:'timestamp'}])};Globimages.UserSpotsStore.superclass.constructor.call(this,conf);Globimages._userspots=this;};Ext.extend(Globimages.UserSpotsStore,Ext.data.Store,{refresh:function()
{if(Globimages._username&&Globimages._sessionid)
this.load({params:{action:"getweatherspots",username:Globimages._username,sessionid:Globimages._sessionid,json:true}});},getData:function()
{var records=this.data;var arr=[];records.each(function(r)
{var item=r.data;item.id=r.id;arr.push(item);},this);return arr;},modifyRecord:function(spot)
{if(!spot||spot.id==undefined)
return;var r=this.getById(spot.id);if(!r)
return;r.data.name=spot.name;r.data.tags=spot.tags;r.data.lng=spot.lng;r.data.lat=spot.lat;r.data.scale=spot.scale;r.data.features=spot.features;r.data.timestamp=spot.timestamp;this.fireEvent("update",this,r,Ext.data.Record.EDIT);}});

Globimages.namespace("UserSpotsGrid")
Globimages.UserSpotsGrid=function(parent,div,appurl)
{this._dataurl=appurl;this._cntr=div;this._parent=parent;this._init();};Ext.extend(Globimages.UserSpotsGrid,Ext.grid.Grid,{_appurl:null,_cntr:null,_init:function()
{var cm=new Ext.grid.ColumnModel([{header:Globimages.getString("IDS_SPOTNAME"),dataIndex:'name',width:200,renderer:Globimages.delegate(this._nameRenderer,this),sortable:true},{header:Globimages.getString("IDS_SPOTTAGS"),dataIndex:'tags',width:1500,renderer:Globimages.delegate(this._tagsRenderer,this),sortable:true}]);var cnf={ds:Globimages._userspots,cm:cm,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),autoExpandColumn:1,enableColumnMove:false};Globimages.UserSpotsGrid.superclass.constructor.call(this,this._cntr,cnf);this.render();this.refreshData();},refreshData:function()
{this.dataSource.refresh();},_nameRenderer:function(data,params,record,i,j)
{return unescape(data);},_tagsRenderer:function(data,params,record,i,j)
{return unescape(data);},getSelectedIndex:function()
{var r=this.selModel.getSelected();if(!r)
return-1;return this.dataSource.indexOf(r);},getSelectedRecord:function()
{return this.selModel.getSelected();},hasSelection:function()
{return this.selModel.getCount()>0;},selectAt:function(idx)
{if(idx<0||idx==undefined)
return;var count=this.dataSource.getCount();if(idx>=count)
idx=count-1;this.selModel.selectRow(idx);}});

Globimages.namespace("UserSpotsDialog");Globimages.UserSpotsDialog=function(appurl,callback)
{this._appurl=appurl;this._callback=callback;this._init();};Ext.extend(Globimages.UserSpotsDialog,Ext.BasicDialog,{_appurl:null,_addbut:null,_editbut:null,_delbut:null,_init:function()
{this._title=Globimages.getString("IDS_MYSPOTS");var conf={autoCreate:true,title:this._title,width:450,height:250,resizable:true,resizeHandles:"se",modal:false,autoScroll:false,closable:true,syncHeightBeforeShow:true,shadow:"drop",buttonAlign:"right",minButtonWidth:60};Globimages.UserSpotsDialog.superclass.constructor.call(this,"",conf);this.el.addClass("glb-userspotdial");this.addKeyListener(27,this.hide,this);this._addbut=this.addButton(Globimages.getString("IDS_ADD"),this._addSpot,this);this._delbut=this.addButton(Globimages.getString("IDS_DELETE"),this._confirmDeleteSpot,this);this._editbut=this.addButton(Globimages.getString("IDS_EDIT"),this._editSpot,this);this.disable(true);this._grid=new Globimages.UserSpotsGrid(this,this.body,this._appurl);this._grid.addListener("celldblclick",this._editSpot,this)
this._grid.selModel.addListener("selectionchange",this._selectionChange,this)
this._grid.container.on(Ext.isIE?"keydown":"keypress",this._handleKeyDown,this);},refreshData:function()
{if(this._grid)
this._grid.refreshData();},onResize:function()
{Globimages.UserSpotsDialog.superclass.onResize.call(this);this._grid.autoSize();},expand:function()
{Globimages.UserSpotsDialog.superclass.expand.call(this);this._grid.autoSize();},_handleKeyDown:function(e)
{var k=e.getKey();if(k!=e.DELETE)
return;this._confirmDeleteSpot();},_addSpot:function()
{if(!Globimages._username||!Globimages._sessionid)
return;var spot=Globimages.BlackBox.getValue("s");var name=Globimages.getSpotName(true,unescape("%B0"));var features=Globimages.BlackBox.getValue("f");var scale=Globimages.BlackBox.getValue("z");var spot={name:name,lng:spot.x,lat:spot.y,scale:scale,features:features}
if(this._editdlg==null)
this._editdlg=new Globimages.SpotDialog(this._appurl,spot,0,Globimages.delegate(this._spotSaved,this));else
this._editdlg.init(spot,0,Globimages.delegate(this._spotSaved,this));this._editdlg.show();},_editSpot:function()
{if(!Globimages._username||!Globimages._sessionid)
return;var r=this._grid.getSelectedRecord();if(!r)
return;var spot={};spot.id=r.id;spot.name=r.data.name;spot.tags=r.data.tags;spot.lat=r.data.lat;spot.lng=r.data.lng;spot.features=r.data.features?r.data.features.split("|"):[];spot.scale=r.data.scale;if(this._editdlg==null)
this._editdlg=new Globimages.SpotDialog(this._appurl,spot,1,Globimages.delegate(this._spotModified,this));else
this._editdlg.init(spot,1,Globimages.delegate(this._spotModified,this));this._editdlg.show();},_confirmDeleteSpot:function()
{if(!Globimages._username||!Globimages._sessionid)
return;var message=Globimages.getString("IDS_CONFIRMDELETESPOT");Globimages.alert("IDS_MESSAGE",message,Globimages.delegate(this._deleteSpot,this),"IDS_YES","IDS_NO");},_deleteSpot:function(ok)
{if(!ok)
return;var r=this._grid.getSelectedRecord();if(!r)
return;var url=this._appurl+"app/users/Users";Globimages.beforeLoad();Globimages.simpleRequest(url,function(options,success,rsp)
{Globimages.afterLoad();if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o==null||(o.code!=undefined&&o.code<0))
{var idx=o.code*-1;var message;if(idx<Globimages.UserErrors.length)
message=Globimages.getString(Globimages.UserErrors[idx]);else
message=Globimages.getString("IDS_ERR_UNKNOWN");Globimages.alert("IDS_MESSAGE",message);}
else
{var idx=this._grid.getSelectedIndex();this._grid.dataSource.remove(r);this._grid.selectAt(idx);this.disable(!this._grid.hasSelection());}}
else
{message=Globimages.getString("IDS_ERR_UNKNOWN");Globimages.alert("IDS_MESSAGE",message);}},this,{action:"deleteweatherspot",username:Globimages._username,sessionid:Globimages._sessionid,id:r.id,json:true},"POST");},_spotSaved:function(spot)
{var rec=new Ext.data.Record(spot,spot.id);this._grid.dataSource.add(rec);},_spotModified:function(spot)
{this._grid.dataSource.modifyRecord(spot);},_selectionChange:function()
{this.disable(!this._grid.hasSelection());},disable:function(dis)
{this._delbut.setDisabled(dis);this._editbut.setDisabled(dis);},hide:function(callback)
{Globimages.UserSpotsDialog.superclass.hide.call(this,callback);if(this._callback)
this._callback.call(this);}});

Globimages.namespace("SpotDialog");Globimages.SpotDialog=function(appurl,spot,mode,callback)
{this._spot=spot;this._mode=mode;this._appurl=appurl;this._init();this._callback=callback;}
Globimages.SpotDialog.CNTR="glb-spotdial-cntr";Globimages.SpotDialog.TDR="glb-spotdial-tdr";Globimages.SpotDialog.TDL="glb-spotdial-tdl";Globimages.SpotDialog.LABEL="glb-spotdial-label";Globimages.SpotDialog.INPUT="glb-spotdial-input";Globimages.SpotDialog.INPUTCELL="glb-spotdial-input-cell";Globimages.SpotDialog.LONGINPUT="glb-spotdial-long-input";Globimages.SpotDialog.FEATURESBLOCK="glb-spotdial-features";Ext.extend(Globimages.SpotDialog,Ext.BasicDialog,{_title:"",_mode:0,_spot:null,_spotname:null,_features:null,_minscale:1400000,_maxscale:205500000,_appurl:null,_callback:null,_okbut:null,_init:function()
{this._title=(this._mode==0?Globimages.getString("IDS_SAVESPOT_TITLE"):Globimages.getString("IDS_MODIFYSPOT_TITLE"));var conf={autoCreate:true,title:this._title,width:350,height:350,resizable:false,modal:true,autoScroll:false,closable:true,collapsible:false,syncHeightBeforeShow:true,shadow:"drop",buttonAlign:"right",minButtonWidth:60};Globimages.SpotDialog.superclass.constructor.call(this,"",conf);this._initFeatures();this._createForm();this._initForm();this.addButton(Globimages.getString("IDS_CANCEL"),this._cancelDialog,this);this._okbut=this.addButton(this._mode==0?Globimages.getString("IDS_SAVESPOT"):Globimages.getString("IDS_MODIFYSPOT"),this._saveSpot,this);this.addKeyListener(27,this.hide,this);},_initFeatures:function()
{this._features={PRMSL:{label:Globimages.getString("IDS_WDT_PRMSL")},WINDS:{label:Globimages.getString("IDS_WDT_WIND")},TMP:{label:Globimages.getString("IDS_WDT_TMP")},TCDC:{label:Globimages.getString("IDS_WDT_TCDC")},PRATE:{label:Globimages.getString("IDS_WDT_PRATE")},WW3HEIGHT:{label:Globimages.getString("IDS_WDT_WW3HEIGHT")},WW3DIR:{label:Globimages.getString("IDS_WDT_WW3DIR")},WW3SDIR:{label:Globimages.getString("IDS_WDT_WW3SDIR")},ICEC:{label:Globimages.getString("IDS_WDT_ICEC")}};},_initForm:function()
{if(!this._spot)
return;this._spotname.setValue(this._spot.name?this._spot.name:"");this._spottags.setValue(this._spot.tags?this._spot.tags:"");this._spotlng.setValue(Globimages.toDegMinutes(this._spot.lng,false,unescape("%B0")));this._spotlat.setValue(Globimages.toDegMinutes(this._spot.lat,true,unescape("%B0")));this._spotscale.setValue(Globimages.formatScale(this._spot.scale));var nb=this._spot.features?this._spot.features.length:0;var feature;var found;for(var f in this._features)
{feature=this._features[f];found=false;if(nb)
for(var i=0;i<this._spot.features.length;i++)
if(this._spot.features[i]==f)
{found=true;break;}
feature.el.dom.checked=found;}},init:function(spot,mode,callback)
{this._spot=spot;this._mode=mode;this._callback=callback;this._title=(this._mode==0?Globimages.getString("IDS_SAVESPOT_TITLE"):Globimages.getString("IDS_MODIFYSPOT_TITLE"));this._okbut.setText(this._mode==0?Globimages.getString("IDS_SAVESPOT"):Globimages.getString("IDS_MODIFYSPOT"));this._initForm();},_createForm:function()
{var old=Ext.DomHelper.useDom;Ext.DomHelper.useDom=true;cntr=this.body.createChild({tag:"div",cls:Globimages.SpotDialog.CNTR});var t=cntr.createChild({tag:"table",cellpadding:0,cellspacing:0});var tab=t.createChild({tag:"tbody",cellpadding:0,cellspacing:0});var row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL,width:"100px"});var div=td.createChild({tag:"div"});var label=div.createChild({tag:"label",cls:Globimages.SpotDialog.LABEL});label.update(Globimages.getString("IDS_SPOTNAME"));td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.INPUTCELL});input=div.createChild({tag:"input",type:"text",maxlength:80,cls:Globimages.SpotDialog.LONGINPUT});this._spotname=new Ext.form.TextField({minLength:1,maxLength:80,selectOnFocus:true,hasFocus:true,allowBlank:false,msgTarget:'qtip',minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._spotname.applyTo(input);this._spotname.addListener("invalid",this._enableDisable,this);this._spotname.addListener("valid",this._enableDisable,this);row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.SpotDialog.LABEL});label.update(Globimages.getString("IDS_SPOTTAGS"));td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.INPUTCELL});input=div.createChild({tag:"input",maxlength:512,type:"text",cls:Globimages.SpotDialog.LONGINPUT});this._spottags=new Ext.form.TextField({minLength:1,maxLength:512,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._spottags.applyTo(input);this._spottags.addListener("invalid",this._enableDisable,this);this._spottags.addListener("valid",this._enableDisable,this);row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.SpotDialog.LABEL});label.update(Globimages.getString("IDS_LATITUDE"));td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.INPUTCELL});input=div.createChild({tag:"input",type:"text"});this._spotlat=new Ext.form.TextField({minLength:1,maxLength:80,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',validator:Globimages.delegate(this._validateLatitude,this),minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._spotlat.applyTo(input);this._spotlat.addListener("invalid",this._enableDisable,this);this._spotlat.addListener("valid",this._enableDisable,this);var row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.SpotDialog.LABEL});label.update(Globimages.getString("IDS_LONGITUDE"));td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.INPUTCELL});input=div.createChild({tag:"input",type:"text"});this._spotlng=new Ext.form.TextField({minLength:1,maxLength:80,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',validator:Globimages.delegate(this._validateLongitude,this),minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._spotlng.applyTo(input);this._spotlng.addListener("invalid",this._enableDisable,this);this._spotlng.addListener("valid",this._enableDisable,this);row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL});div=td.createChild({tag:"div"});label=div.createChild({tag:"label",cls:Globimages.SpotDialog.LABEL});label.update(Globimages.getString("IDS_SCALE"));td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.INPUTCELL});input=div.createChild({tag:"input",type:"text"});this._spotscale=new Ext.form.TextField({minLength:1,maxLength:80,selectOnFocus:true,hasFocus:true,msgTarget:'qtip',validator:Globimages.delegate(this._validateScale,this),minLengthText:Globimages.getString("IDS_GNSMINFIELDLENGTH"),maxLengthText:Globimages.getString("IDS_GNSMAXFIELDLENGTH")});this._spotscale.applyTo(input);this._spotscale.addListener("invalid",this._enableDisable,this);this._spotscale.addListener("valid",this._enableDisable,this);row=tab.createChild({tag:"tr"});td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDL});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.FEATURESBLOCK});var ul=div.createChild({tag:"ul"});var feature;var li,chk,span,i=0;for(var f in this._features)
{feature=this._features[f];li=ul.createChild({tag:"li"});feature.el=chk=li.createChild({tag:"input",type:"checkbox"});span=li.createChild({tag:"span"});span.update(feature.label);i++;if(i==5)
{td=row.createChild({tag:"td",cls:Globimages.SpotDialog.TDR});div=td.createChild({tag:"div",cls:Globimages.SpotDialog.FEATURESBLOCK});ul=div.createChild({tag:"ul"});}}
Ext.DomHelper.useDom=old;},_saveSpot:function()
{var name=escape(this._spotname.getValue());var tags=escape(this._spottags.getValue());var lng=this._parseLongitude(this._spotlng.getValue());var lat=this._parseLatitude(this._spotlat.getValue());var scale=this._parseScale(this._spotscale.getValue());var fstr="";var first=true;var feature;for(var f in this._features)
{feature=this._features[f];if(feature.el.dom.checked)
{if(!first)
fstr+="|";if(first)
first=false;fstr+=f;}}
var url=this._appurl+"app/users/Users";var params={action:(this._mode==0?"addweatherspot":"modifyweatherspot"),username:Globimages._username,sessionid:Globimages._sessionid,name:name,tags:tags,lng:lng,lat:lat,scale:scale,features:fstr,json:true};if(this._mode==1)
params.id=this._spot.id;Globimages.beforeLoad();Globimages.simpleRequest(url,function(options,success,rsp)
{Globimages.afterLoad();if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o==null||(o.code!=undefined&&o.code<0))
{var idx=o.code*-1;var message;if(idx<Globimages.UserErrors.length)
message=Globimages.getString(Globimages.UserErrors[idx]);else
message=Globimages.getString("IDS_ERR_UNKNOWN");Globimages.alert("IDS_MESSAGE",message);}
else
{if(o.data&&o.data.length)
{o.data[0].name=unescape(o.data[0].name);o.data[0].tags=unescape(o.data[0].tags);if(this._callback)
this._callback.call(this,o.data[0]);var message=o.data[0].name+" ";message=message.replace(/\xB0/g,"&deg;");message+=(this._mode==0?Globimages.getString("IDS_SPOTSAVED"):Globimages.getString("IDS_SPOTMODIFIED"));this.hide();Globimages.alert("IDS_MESSAGE",message);}}}
else
{message=Globimages.getString("IDS_ERR_UNKNOWN");Globimages.alert("IDS_MESSAGE",message);}},this,params,"POST");},_modifySpot:function()
{},_cancelDialog:function()
{this.hide();},_parseLongitude:function(val)
{var re=/^\s*([0-9]{1,3})\s*\xB0?\s*([0-9]{0,2})\s*[\.|\,]?\s*([0-9]{0,3})\s*([W|O|E])$/i;var res=val.match(re);var nb=res?res.length:0;if(nb<2)
return null;var d=isNaN(res[1])?0:Number(res[1]);if(d>180)
return null;var m=isNaN(res[2])?0:Number(res[2]);if(m>59)
return null;var dm=isNaN(res[3])?0:Number(res[3]);if(d==180&&(m>0||dm>0))
return null;var lng=d+(m/60);if(dm>0)
{var l=res[3].length;var i=dm/(Math.pow(10,l)*60);lng+=i;}
var s=res[4].toLowerCase();if(s=="o"||s=="w")
lng*=-1;return lng;},_parseLatitude:function(val)
{var re=/^\s*([0-9]{1,3})\s*\xB0?\s*([0-9]{0,2})\s*[\.|\,]?\s*([0-9]{0,3})\s*([N|S])$/i;var res=val.match(re);var nb=res?res.length:0;if(nb<2)
return null;var d=isNaN(res[1])?0:Number(res[1]);if(d>90)
return null;var m=isNaN(res[2])?0:Number(res[2]);if(m>59)
return null;var dm=isNaN(res[3])?0:Number(res[3]);if(d==90&&(m>0||dm>0))
return null;var lat=d+(m/60);if(dm>0)
{var l=res[3].length;var i=dm/(Math.pow(10,l)*60);lat+=i;}
var s=res[4].toLowerCase();if(s=="s")
lat*=-1;return lat;},_parseScale:function(val)
{val=val.replace(/\s/g,"");var re=/^\s*1\s*\/\s*([0-9]{5,9})\s*$/;var res=val.match(re);var nb=res?res.length:0;if(nb<2)
return null;var s=Number(res[1]);if(s<this._minscale||s>this._maxscale)
return null;return s;},_validateLongitude:function(val)
{return this._parseLongitude(val)!=null;},_validateLatitude:function(val)
{return this._parseLatitude(val)!=null;},_validateScale:function(val)
{return this._parseScale(val)!=null;},show:function(animtarget)
{Globimages.SpotDialog.superclass.show.call(this);},hide:function(callback)
{Globimages.SpotDialog.superclass.hide.call(this,callback);},_enableDisable:function()
{var inv=(this._spotname.el.hasClass(this._spotname.invalidClass)||this._spotlng.el.hasClass(this._spotlng.invalidClass)||this._spottags.el.hasClass(this._spottags.invalidClass)||this._spotlat.el.hasClass(this._spotlat.invalidClass)||this._spotscale.el.hasClass(this._spotscale.invalidClass));if(this._okbut!=null)
{this._okbut.setDisabled(inv);}}});

Globimages.namespace("SpotsMenu");Globimages.SpotsMenu=function(appurl,div)
{if(!div||(typeof(div)=="string"&&div.length==0))
return;this._cntr=Ext.get(div);this._appurl=appurl;this._store=Globimages._userspots;if(!this._store)
return;Globimages._strings.addListener("stringsloaded",this._init,this);};Ext.extend(Globimages.SpotsMenu,Object,{_cntr:null,_appurl:null,_userspots:null,_usertags:null,_untagged:null,_menu:null,_savedlg:null,_managedlg:null,_store:null,_additem:null,_manageitem:null,_logitem:null,_init:function()
{var cntr=this._cntr.createChild({tag:"div"});this._menu=new Ext.menu.Menu({id:'actionsmenu',cls:"glb-spotsmenu"});this._addStandardItems();var but=new Ext.MenuButton(cntr,{cls:"glb-spotsmenu-button",text:Globimages.getString("IDS_SPOTS"),menu:this._menu,handler:function()
{this.menu.show(this.el,this.menuAlign);}});this._store.on("load",this._refreshMenu,this);this._store.on("add",this._refreshMenu,this);this._store.on("remove",this._refreshMenu,this);this._store.on("clear",this._refreshMenu,this);this._store.on("update",this._refreshMenu,this);this._store.refresh();this._menu.on("beforeshow",this._beforeShow,this);},_addStandardItems:function()
{this._additem=this._menu.add({text:Globimages.getString("IDS_ADDASPOT"),handler:Globimages.delegate(this._saveSpot,this)});this._manageitem=this._menu.add({text:Globimages.getString("IDS_MANAGESPOTS"),handler:Globimages.delegate(this._manageSpots,this)});this._logitem=this._menu.add({id:"glb-spotsmenu-signin",text:"",handler:Globimages.delegate(this._signinSignout,this)});},_beforeShow:function()
{var logged=Globimages._username&&Globimages._sessionid;this._logitem.setText(logged?Globimages.getString("IDS_LOGOUT"):Globimages.getString("IDS_SIGNIN"));this._additem.setDisabled(!logged);this._manageitem.setDisabled(!logged);},_signinSignout:function()
{var logged=Globimages._username&&Globimages._sessionid;window.location.href=logged?"/process/":"/signin/";},_buildMenu:function()
{if(this._menu==null)
return;this._menu.removeAll();this._addStandardItems();if(this._userspots&&this._userspots.length>0)
this._menu.addSeparator();var utags=this._usertags;if(utags)
{var spots,spot,items;for(var tag in utags)
{var items=[];spots=utags[tag];for(var i=0;i<spots.length;i++)
{spot=spots[i];items.push({text:spot.name,uid:spot.id,handler:Globimages.delegate(this._spotClicked,this)});}
this._menu.add({text:tag,menu:{items:items,cls:"glb-spotsmenu"}});}}
var untagged=this._untagged;var nb=untagged?untagged.length:0;if(nb>0)
{var spot;for(var i=0;i<untagged.length;i++)
{spot=untagged[i];this._menu.add({text:spot.name,uid:spot.id,handler:Globimages.delegate(this._spotClicked,this)});}}},_parseTags:function()
{this._usertags={};this._untagged=[];var nb=this._userspots.length;if(!nb)
return;var spot;for(var i=0;i<nb;i++)
{spot=this._userspots[i];this._parseSpotTags(spot);}},_parseSpotTags:function(spot)
{if(!spot)
return;spot.name=unescape(spot.name);spot.tags=unescape(spot.tags);var tags=spot.tags.split(" ");if(spot.tags.length==0||!tags||tags.length==0)
{this._untagged.push(spot);return;}
var found=false;var tag;for(var j=0;j<tags.length;j++)
{tag=tags[j];if(tag.length==0)
continue;found=true;if(this._usertags[tag]!=undefined)
this._usertags[tag].push(spot);else
{this._usertags[tag]=[];this._usertags[tag].push(spot);}}
if(!found)
this._untagged.push(spot);},_signinFirst:function()
{var message=Globimages.getString("IDS_SIGNINBEFORESAVESPOT");Globimages.alert("IDS_MESSAGE",message,Globimages.delegate(this._signin,this),"IDS_SIGNIN");},_signin:function(ok)
{if(!ok)
return;window.location.href="/signin/";},_saveSpot:function()
{if(!Globimages._username||!Globimages._sessionid)
{this._signinFirst();return;}
var spot=Globimages.BlackBox.getValue("s");var name=Globimages.getSpotName(true,unescape("%B0"));var features=Globimages.BlackBox.getValue("f");var scale=Globimages.BlackBox.getValue("z");var spot={name:name,lng:spot.x,lat:spot.y,scale:scale,features:features}
if(this._savedlg==null)
this._savedlg=new Globimages.SpotDialog(this._appurl,spot,0,Globimages.delegate(this._addSpot,this));else
this._savedlg.init(spot,0,Globimages.delegate(this._addSpot,this));this._savedlg.show();},_manageSpots:function()
{if(!Globimages._username||!Globimages._sessionid)
{this._signinFirst();return;}
if(this._managedlg==null)
this._managedlg=new Globimages.UserSpotsDialog(this._appurl,Globimages.delegate(this._refreshMenu,this));else
this._managedlg.refreshData();this._managedlg.show();},_refreshMenu:function()
{this._userspots=this._store.getData();this._parseTags();this._buildMenu();},_addSpot:function(spot)
{var rec=new Ext.data.Record(spot,spot.id);this._store.add(rec);},_spotClicked:function(item)
{var spot=this._getSpot(item.uid);var s={x:spot.lng,y:spot.lat,n:spot.name};var p={x:spot.lng,y:spot.lat};var z=spot.scale;var props=["p","s","z"];var values=[p,s,z];var f=spot.features.length>0?spot.features.split("|"):[];props.push("f");values.push(f);Globimages.BlackBox.changeState(props,values);},_getSpot:function(id)
{if(!this._userspots)
return null;var nb=this._userspots.length;var spot=null;for(var i=0;i<nb;i++)
{spot=this._userspots[i];if(spot.id==id)
return spot;}
return null;}});

function __GlobimagesInit(username,sessionid,locale,baseurl,appurl,reqcountry)
{locale=locale?locale:"en";baseurl=baseurl?baseurl:".";appurl=appurl?appurl:"";Globimages._locale=locale;Globimages._initial=document.location.hash==""?reqcountry:null;Globimages._username=username;Globimages._sessionid=sessionid;Ext.BLANK_IMAGE_URL=baseurl+"/assets/blank.gif";Globimages.Events=function()
{this.events={beforeload:true,afterload:true}}
Ext.extend(Globimages.Events,Ext.util.Observable);Globimages._events=new Globimages.Events();Globimages.getDocumentTitle=function(noentities)
{if(!noentities)
return Globimages.getString("IDS_GLOBIMAGESWEATHERMAPS");else
return Globimages.getString("IDS_GLOBIMAGESWEATHERMAPS_NE");};Globimages.checkUser=function()
{if(!Globimages._username||!Globimages._sessionid)
return false;var url=appurl+"app/users/Users";Globimages.simpleRequest(url,function(options,success,rsp)
{if(success&&rsp.responseText!=undefined)
{var o=Globimages.parseJSONString(rsp.responseText);if(o==null||o.code<0)
{Globimages._username=null;Globimages._sessionid=null;}}
else
{Globimages._username=null;Globimages._sessionid=null;}},this,{username:Globimages._username,sessionid:Globimages._sessionid,action:"checkuser",json:true},"POST");};Globimages.getSpotName=function(shortf,degsymbol)
{var spot=Globimages.BlackBox.getValue("s");if(!spot)
return;var str="";if(spot.n&&spot.n.length>0)
str+=spot.n;if(spot.c&&spot.c.length>0)
{if(!spot.n||spot.n.length==0)
str+=spot.c;else
str+=" ("+spot.c+")";}
if(shortf&&str.length>0)
return str;if(str.length==0)
str+=Globimages.getString("IDS_CURRENTPOSITION");str+=" ";str+=Globimages.formatPosition(spot.x,spot.y,degsymbol);return str;};Globimages.initRelayedEvents=function()
{if(Globimages._gnsfinder)
{Globimages._gnsfinder.addListener("beforeload",Globimages.beforeLoad,window);Globimages._gnsfinder.addListener("load",Globimages.afterLoad,window);Globimages._gnsfinder.addListener("loadexception",Globimages.afterLoad,window);}
if(Globimages._userspots)
{Globimages._userspots.addListener("beforeload",Globimages.beforeLoad,window);Globimages._userspots.addListener("load",Globimages.afterLoad,window);Globimages._userspots.addListener("loadexception",Globimages.afterLoad,window);}};Globimages.__stringsLoaded=function()
{Globimages.createLinks();}
Globimages.createLinks=function()
{var div=Ext.get("gnsadvsearch");if(!div)
return;var old=Ext.DomHelper.useDom;Ext.DomHelper.useDom=true;var link=div.createChild({tag:"a",href:""});var span=link.createChild({tag:"span"});span.update(Globimages.getString("IDS_GNSSEARCHLINK"));link.dom.onclick=function()
{Globimages._gnsfinder.showDialog(link);return false;};Ext.DomHelper.useDom=old;};Globimages.initStrings([baseurl+"/conf/gnsfinderstrings.xml",baseurl+"/conf/wdtstrings.xml"]);Globimages.BlackBox=new Globimages.PropertyBox([{name:"p",value:{x:-3,y:45},instate:true},{name:"s",value:{x:-3,y:45,n:"",c:""},instate:true,equals:function(a,b)
{return Math.abs(a.x-b.x)<0.0001&&Math.abs(a.y-b.y)<0.0001}},{name:"o",value:0,instate:true},{name:"z",value:50000000,instate:true},{name:"f",value:["PRMSL"],instate:true},{name:"t",value:0,instate:false}]);Ext.onReady(function(){Globimages.checkUser();var gnsfinder=new Globimages.GNSFinder(baseurl,appurl+"app/gns/GNSFinder");new Globimages.SWFEvents();var uss=new Globimages.UserSpotsStore(appurl);new Globimages.SpotsMenu(appurl,"spotsmenu");var loadindic=new Globimages.LoadingIndicator("loadingindicator");new Globimages.LocationField("locationfield");new Globimages.SpotGrid("weathertable",baseurl,appurl+"app/weather/WeatherSpotFinder");new Globimages.GNSForm("gnssearchdiv",true);new Globimages.CountriesCombo("countriescombo");new Globimages.WeatherCombo("weathercombo");new Globimages.SWFMaps("weathermaps.swf",baseurl,"swfmapsdiv");Globimages._strings.addListener("stringsloaded",Globimages.__stringsLoaded,window);Globimages.loadStrings();Globimages.initRelayedEvents();});}
