/*
 * Ext CoreTips
 */


Ext.ns('Ext.ux');Ext.ux.ToolTip=Ext.extend(Ext.util.Observable,{baseCls:'x-tip',minWidth:40,maxWidth:300,defaultAlign:"tl-bl?",hidden:true,showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,disabled:false,quickShowInterval:250,targetCounter:0,rendered:false,constructor:function(config){config=config||{};Ext.apply(this,config);this.addEvents('beforeshow','show','beforehide','hide','render');this.getId();Ext.ux.ToolTip.superclass.constructor.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor;this.shadowOffset=config.shadowOffset||4;this.shadow=new Ext.ux.ToolTip.Shadow({offset:this.shadowOffset});},initTarget:function(target){var t;if((t=Ext.get(target))){if(this.target){var tg=Ext.get(this.target);tg.un('mouseover',this.onTargetOver,this);tg.un('mouseout',this.onTargetOut,this);tg.un('mousemove',this.onMouseMove,this);}
t.on({mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=t;}
if(this.anchor){this.anchorTarget=this.target;}},hide:function(){if(this.fireEvent('beforehide',this)!==false){this.doHide();this.fireEvent('hide',this);this.clearTimer('dismiss');this.lastActive=new Date();if(this.anchorEl){this.anchorEl.hide();}
if(this.shadow){this.shadow.hide();}
delete this.triggerElement;}
return this;},show:function(){if(this.fireEvent('beforeshow',this)!==false){if(!this.rendered)
this.render();this.hidden=false;this.onShow();this.showAt(this.getTargetXY());if(this.anchor){this.syncAnchor();this.anchorEl.show();this.constrainPosition=this.origConstrainPosition;}else{this.anchorEl.hide();}
this.fireEvent('show',this);if(this.autoLoad)
this.doAutoLoad.defer(10,this);else
this.syncShadow(true);}
return this;},showAt:function(xy){this.lastActive=new Date();this.clearTimers();if(typeof this.width!='number')
this.doAutoWidth();if(this.constrainPosition){}
this.setPagePosition(xy);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this);}
if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show();}},showBy:function(el,pos){this.showAt(this.getAlignToXY(this.el,el,pos||this.defaultAlign));},getId:function(){return this.id||(this.id='x-tip-'+(++Ext.ux.ToolTip.AUTO_ID));},setPagePosition:function(xy){var x=xy[0],y=xy[1];if(x===undefined||y===undefined){return;}
var p=Ext.getBody().translatePoints(x,y);this.el.dom.style.left=p.left+"px";this.el.dom.style.top=p.top+"px";},onMouseMove:function(e){var t=this.delegate?e.getTarget(this.delegate):this.triggerElement=true;if(t){this.targetXY=e.getXY();if(t===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY());this.syncShadow();}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(e);}}else if(!this.closable&&this.isVisible()){this.hide();}},onTargetOver:function(e){if(e.within(this.target.dom,true)){return;}
var t=e.getTarget(this.delegate);if(t){this.triggerElement=t;this.clearTimer('hide');this.targetXY=e.getXY();this.delayShow();}},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show();}else{this.showTimer=this.show.defer(this.showDelay,this);}}
else if(!this.hidden&&this.autoHide!==false){this.show();}},onTargetOut:function(e){if(e.within(this.target.dom,true)){return;}
this.clearTimer('show');if(this.autoHide!==false){this.delayHide();}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this);}},doHide:function(){this.hidden=true;this.onHide();},onShow:function(){this.el.removeClass('x-hide-display');},onHide:function(){this.el.addClass('x-hide-display');},enable:function(){if(this.rendered){this.onEnable();}
this.disabled=false;this.fireEvent('enable',this);return this;},disable:function(silent){if(this.rendered){this.onDisable();}
this.disabled=true;if(silent!==true){this.fireEvent('disable',this);}
return this;},onDisable:function(){this.clearTimers();this.hide();},onEnable:function(){},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement;}
if(this.anchor){this.targetCounter++;var offsets=this.getOffsets(),xy=(this.anchorToTarget&&!this.trackMouse)?this.getAlignToXY(this.el,this.anchorTarget,this.getAnchorAlign()):this.targetXY,dw=Ext.lib.Dom.getViewWidth()-5,dh=Ext.lib.Dom.getViewHeight()-5,de=document.documentElement,bd=document.body,scrollX=(de.scrollLeft||bd.scrollLeft||0)+5,scrollY=(de.scrollTop||bd.scrollTop||0)+5,axy=[xy[0]+offsets[0],xy[1]+offsets[1]],sz={width:this.el.getWidth,height:this.el.getHeight()};this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(axy[0]<scrollX){if(this.anchorToTarget){this.defaultAlign='l-r';if(this.mouseOffset){this.mouseOffset[0]*=-1;}}
this.anchor='left';return this.getTargetXY();}
if(axy[0]+sz.width>dw){if(this.anchorToTarget){this.defaultAlign='r-l';if(this.mouseOffset){this.mouseOffset[0]*=-1;}}
this.anchor='right';return this.getTargetXY();}
if(axy[1]<scrollY){if(this.anchorToTarget){this.defaultAlign='t-b';if(this.mouseOffset){this.mouseOffset[1]*=-1;}}
this.anchor='top';return this.getTargetXY();}
if(axy[1]+sz.height>dh){if(this.anchorToTarget){this.defaultAlign='b-t';if(this.mouseOffset){this.mouseOffset[1]*=-1;}}
this.anchor='bottom';return this.getTargetXY();}}
this.anchorCls='x-tip-anchor-'+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return axy;}
else{var mouseOffset=this.getMouseOffset();return[this.targetXY[0]+mouseOffset[0],this.targetXY[1]+mouseOffset[1]];}},getMouseOffset:function(){var offset=this.anchor?[0,0]:[15,18];if(this.mouseOffset){offset[0]+=this.mouseOffset[0];offset[1]+=this.mouseOffset[1];}
return offset;},render:function(){if(!this.rendered&&this.fireEvent('beforerender',this)!==false){if(!this.el){this.el=document.createElement('div');}
if(!this.el.id){this.el.id=this.getId();}
if(this.el){this.el=Ext.get(this.el);}
Ext.getBody().appendChild(this.el);this.rendered=true;this.onRender();this.fireEvent('render',this);this.anchorEl.setStyle('z-index',(parseInt(this.el.getStyle('z-index'),10)||11000)+1);if(this.closable===true)
this.addCloseTool();this.onHide();if(this.width)
this.setWidth(this.width);}
return this;},onRender:function(){this.createClasses();var el=this.el,d=el.dom,bw,ts;el.addClass(this.baseCls);if(this.cls){el.addClass(this.cls);}
el.insertHtml('afterBegin',String.format(Ext.ux.ToolTip.boxMarkup,this.baseCls));this.createElement('header',d.firstChild.firstChild.firstChild);this.createElement('bwrap',d);bw=this.bwrap.dom;var ml=d.childNodes[1],bl=d.childNodes[2];bw.appendChild(ml);bw.appendChild(bl);var mc=bw.firstChild.firstChild.firstChild;this.createElement('body',mc);if(Ext.isDefined(this.padding)){this.body.setStyle('padding',this.body.addUnits(this.padding));}
this.bwrap.setVisibilityMode(Ext.Element.DISPLAY);this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+'</span>';if(this.title)
this.header.child('span').update(this.title);if(this.html){this.body.update(Ext.DomHelper.markup(this.html));delete this.html;}
if(this.contentEl){var ce=Ext.getDom(this.contentEl);Ext.fly(ce).removeClass(['x-hidden','x-hide-display']);this.body.appendChild(ce);}
this.anchorCls='x-tip-anchor-'+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:'x-tip-anchor '+this.anchorCls});},setTitle:function(title){this.header.child('span').update(title);},setWidth:function(w){this.width=w;this.el.setWidth(w);this.syncShadow();},getWidth:function(){if(this.width){return this.width;}
return this.getAutoWidth();},createElement:function(name,pnode){if(this[name]){pnode.appendChild(this[name].dom);return;}
if(this[name+'Cfg']){this[name]=Ext.fly(pnode).createChild(this[name+'Cfg']);}else{var el=document.createElement('div');el.className=this[name+'Cls'];this[name]=Ext.get(pnode.appendChild(el));}
if(this[name+'CssClass']){this[name].addClass(this[name+'CssClass']);}
if(this[name+'Style']){this[name].applyStyles(this[name+'Style']);}},createClasses:function(){this.headerCls=this.baseCls+'-header';this.headerTextCls=this.baseCls+'-header-text';this.bwrapCls=this.baseCls+'-bwrap';this.bodyCls=this.baseCls+'-body';this.footerCls=this.baseCls+'-footer';},addCloseTool:function(){var tt=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');tt.disableFormats=true;tt.compile();var tc={id:'close',hidden:false}
var overCls='x-tool-'+tc.id+'-over';var t=tt.insertFirst(this['header'],tc,true);t.setVisibilityMode(Ext.Element.DISPLAY);t.on('click',function(){t.removeClass(overCls);this.hide();},this);t.hover(function(){Ext.fly(t).addClass(overCls);},function(){Ext.fly(t).removeClass(overCls);});},getAnchorPosition:function(){if(this.anchor){this.tipAnchor=this.anchor.charAt(0);}else{var m=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw'AnchorTip.defaultAlign is invalid';}
this.tipAnchor=m[1].charAt(0);}
switch(this.tipAnchor){case't':return'top';case'b':return'bottom';case'r':return'right';}
return'left';},getAnchorAlign:function(){switch(this.anchor){case'top':return'tl-bl';case'left':return'tl-tr';case'right':return'tr-tl';default:return'bl-tl';}},getOffsets:function(){var offsets,ap=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse){switch(ap){case't':offsets=[0,9];break;case'b':offsets=[0,-13];break;case'r':offsets=[-13,0];break;default:offsets=[9,0];break;}}else{switch(ap){case't':offsets=[-15-this.anchorOffset,30];break;case'b':offsets=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case'r':offsets=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:offsets=[25,-13-this.anchorOffset];break;}}
var mouseOffset=this.getMouseOffset();offsets[0]+=mouseOffset[0];offsets[1]+=mouseOffset[1];return offsets;},syncAnchor:function(){var anchorPos,targetPos,offset;switch(this.tipAnchor.charAt(0)){case't':anchorPos='b';targetPos='tl';offset=[20+this.anchorOffset,2];break;case'r':anchorPos='l';targetPos='tr';offset=[-2,11+this.anchorOffset];break;case'b':anchorPos='t';targetPos='bl';offset=[20+this.anchorOffset,-2];break;default:anchorPos='r';targetPos='tl';offset=[2,11+this.anchorOffset];break;}
this.alignTo(this.anchorEl,this.el,anchorPos+'-'+targetPos,offset);},getAlignToXY:function(me,el,p,o){el=Ext.get(el);if(!el||!el.dom){throw"Element.alignToXY with an element that doesn't exist";}
o=o||[0,0];p=(!p||p=="?"?"tl-bl?":(!/-/.test(p)&&p!==""?"tl-"+p:p||"tl-bl")).toLowerCase();var me=me,d=me.dom,a1,a2,x,y,m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p;}
p1=m[1];p2=m[2];a1=this.getAnchorXY(me,p1,true);a2=this.getAnchorXY(el,p2,false);x=a2[0]-a1[0]+o[0];y=a2[1]-a1[1]+o[1];return[x,y];},getAnchorXY:function(el,anchor,local,s){anchor=(anchor||"tl").toLowerCase();s=s||{};var me=el,vp=me.dom==document.body||me.dom==document,w=s.width||vp?Ext.lib.Dom.getViewWidth():me.getWidth(),h=s.height||vp?Ext.lib.Dom.getViewHeight():me.getHeight(),xy,r=Math.round,o=me.getXY(),scroll=me.getScroll(),extraX=vp?scroll.left:!local?o[0]:0,extraY=vp?scroll.top:!local?o[1]:0,hash={c:[r(w*0.5),r(h*0.5)],t:[r(w*0.5),0],l:[0,r(h*0.5)],r:[w,r(h*0.5)],b:[r(w*0.5),h],tl:[0,0],bl:[0,h],br:[w,h],tr:[w,0]};xy=hash[anchor];return[xy[0]+extraX,xy[1]+extraY];},alignTo:function(target,element,position,offsets){var me=target;return me.setXY(this.getAlignToXY(me,element,position,offsets),false);},clearTimer:function(name){name=name+'Timer';clearTimeout(this[name]);delete this[name];},clearTimers:function(){this.clearTimer('show');this.clearTimer('dismiss');this.clearTimer('hide');},getFrameWidth:function(){var w=this.getFrameAdjusts(this.el,'lr')+this.getFrameAdjusts(this.bwrap,'lr');var l=this.bwrap.dom.firstChild;w+=(this.getFrameAdjusts(Ext.fly(l),'l')+this.getFrameAdjusts(Ext.fly(l.firstChild),'r'));w+=this.getFrameAdjusts(this.body,'lr');return w;},getFrameAdjusts:function(el,sides){return el.getPadding(sides)+el.getBorderWidth(sides);},doAutoLoad:function(){this.updater=new Ext.ux.ToolTip.Updater(this.body);this.updater.on('update',this.doAutoWidth,this);this.updater.update(this.autoLoad.url);},getAutoWidth:function(adjust){adjust=adjust||0;var bw=Ext.ux.ToolTip.TextMeasure.measure(this.body,this.body.dom.innerHTML).width;if(this.title){bw=Math.max(bw,Ext.ux.ToolTip.TextMeasure.measure(this.header.child('span'),this.title).width);}
bw+=this.getFrameWidth()+this.body.getPadding("lr")+adjust;bw+=5;return Math.min(Math.max(bw,this.minWidth),this.maxWidth);},doAutoWidth:function(adjust){this.el.setWidth(this.getAutoWidth());this.syncShadow();},syncShadow:function(doShow){var shadow=this.shadow;w=this.el.getWidth(),h=this.el.getHeight(),l=this.el.getLeft(true),t=this.el.getTop(true);if(shadow){if(doShow&&!shadow.isVisible()){shadow.show(this.el);}else{shadow.realign(l,t,w,h);}}},update:function(htmlOrData,loadScripts,cb){var html=Ext.isObject(htmlOrData)?Ext.DomHelper.markup(htmlOrData):htmlOrData;this.body.update(html,loadScripts,cb);},destroy:function(){if(!this.isDestroyed){this.destroying=true;this.beforeDestroy();if(this.rendered){this.el.remove();}
if(this.focusTask&&this.focusTask.cancel){this.focusTask.cancel();}
this.onDestroy();this.purgeListeners();this.destroying=false;this.isDestroyed=true;}},beforeDestroy:function(){this.clearTimers();this.anchorEl.remove();this.shadow.hide();delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;delete this.shadow;},onDestroy:function(){}});Ext.ux.ToolTip.Updater=Ext.extend(Ext.util.Observable,function(){function processSuccess(response){var me=this;me.transaction=null;me.el.update(response.responseText);this.fireEvent('update',response);}
function processFailure(response){this.fireEvent('failure',response);alert("Cannot load ToolTip text\n"+response.responseText);}
return{constructor:function(el){var me=this;el=Ext.get(el);this.addEvents('update','failure');me.el=el;me.transaction=null;},update:function(url){var me=this;me.showLoading();var o=Ext.apply({},{url:url,params:{},success:processSuccess,failure:processFailure,scope:this,callback:undefined,timeout:15000});me.transaction=Ext.Ajax.request(o);},showLoading:function(){this.el.dom.innerHTML='<div class="loading-indicator">Loading...</div>';}};}());Ext.ux.ToolTip.Shadow=function(config){Ext.apply(this,config);var o=this.offset,a={h:0};var rad=Math.floor(this.offset/2);a.w=0;a.l=a.t=o;a.t-=1;if(Ext.isIE){a.l-=this.offset+rad;a.t-=this.offset+rad;a.w-=rad;a.h-=rad;a.t+=1;}
this.adjusts=a;}
Ext.ux.ToolTip.Shadow.prototype={offset:4,show:function(target){target=Ext.get(target);if(!this.el){this.el=Ext.ux.ToolTip.Shadow.Pool.pull();if(this.el.dom.nextSibling!=target.dom){this.el.insertBefore(target);}}
this.el.setStyle("z-index",this.zIndex||parseInt(target.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";}
this.realign(target.getLeft(true),target.getTop(true),target.getWidth(),target.getHeight());this.el.dom.style.position="absolute";this.el.dom.style.display="block";},realign:function(l,t,w,h){if(!this.el){return;}
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;if(!Ext.isIE){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.ux.ToolTip.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}},isVisible:function(){return this.el?true:false;}}
Ext.ux.ToolTip.Shadow.Pool=function(){var p=[];var markup=Ext.isIE?'<div class="x-ie-shadow"></div>':'<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));sh.autoBoxAdjust=false;}
return sh;},push:function(sh){p.push(sh);}};}();Ext.ux.ToolTip.TextMeasure=function(){var shared;return{measure:function(el,text){if(!shared)
shared=Ext.ux.ToolTip.TextMeasure.Instance(el);shared.bind(el);return shared.getSize(text);}}}();Ext.ux.ToolTip.TextMeasure.Instance=function(bindTo){var ml=new Ext.Element(document.createElement('div'));document.body.appendChild(ml.dom);ml.position('absolute');ml.setLeft(-1000);ml.setTop(-1000);ml.hide();var instance={bind:function(el){Ext.each(['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'],function(v){var s=Ext.DomQuery.getStyle(el,v);if(s){ml.setStyle(v,s);}})},getSize:function(text){ml.update(text);var s={width:ml.getWidth(),height:ml.getHeight()};ml.update('');return s;}}
instance.bind(bindTo);return instance;};Ext.ux.ToolTip.AUTO_ID=1000;Ext.ux.ToolTip.boxMarkup='<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>';Ext.ux.QuickTip=Ext.extend(Ext.ux.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ti",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qcls",align:"qalign",anchor:"anchor"},constructor:function(){this.target=this.target||Ext.get(document);this.targets=this.targets||{};Ext.ux.QuickTip.superclass.constructor.call(this);},register:function(config){var cs=Ext.isArray(config)?config:arguments;for(var i=0,len=cs.length;i<len;i++){var c=cs[i];var target=c.target;if(target){if(Ext.isArray(target)){for(var j=0,jlen=target.length;j<jlen;j++){this.targets[Ext.id(target[j])]=c;}}else{this.targets[Ext.id(target)]=c;}}}},unregister:function(el){delete this.targets[Ext.id(el)];},getTipCfg:function(e){var t=e.getTarget(),ttp,cfg;if(this.interceptTitles&&t.title&&Ext.isString(t.title)){ttp=t.title;t.qtip=ttp;t.removeAttribute("title");e.preventDefault();}else{cfg=this.tagConfig;ttp=t.qtip||Ext.fly(t).getAttribute(cfg.attribute,cfg.namespace);}
return ttp;},onTargetOver:function(e){if(this.disabled){return;}
this.targetXY=e.getXY();var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return;}
if(this.activeTarget&&((t==this.activeTarget.el)||Ext.fly(this.activeTarget.el).contains(t))){this.clearTimer('hide');this.show();return;}
if(t&&this.targets[t.id]){this.activeTarget=this.targets[t.id];this.activeTarget.el=t;this.anchor=this.activeTarget.anchor;if(this.anchor){this.anchorTarget=t;}
this.delayShow();return;}
var ttp,et=Ext.fly(t),cfg=this.tagConfig,ns=cfg.namespace;if(ttp=this.getTipCfg(e)){var autoHide=et.getAttribute(cfg.hide,ns);this.activeTarget={el:t,text:ttp,width:parseInt(et.getAttribute(cfg.width,ns)),autoHide:autoHide!="user"&&autoHide!=='false',title:et.getAttribute(cfg.title,ns),cls:et.getAttribute(cfg.cls,ns),align:et.getAttribute(cfg.align,ns)};this.anchor=et.getAttribute(cfg.anchor,ns);if(this.anchor){this.anchorTarget=t;}
this.delayShow();}},onTargetOut:function(e){if(this.activeTarget&&e.within(this.activeTarget.el)&&!this.getTipCfg(e)){return;}
this.clearTimer('show');if(this.autoHide!==false){this.delayHide();}},showAt:function(xy){var t=this.activeTarget;if(t){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=t;}
if(t.width){this.setWidth(t.width);this.body.setWidth(t.width-this.getFrameWidth());this.measureWidth=false;}else{this.measureWidth=true;}
this.setTitle(t.title||'');this.body.update(t.text);this.autoHide=t.autoHide;this.dismissDelay=t.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls;}
if(t.cls){this.el.addClass(t.cls);this.lastCls=t.cls;}
if(this.anchor){this.constrainPosition=false;}else if(t.align){xy=this.el.getAlignToXY(t.el,t.align);this.constrainPosition=false;}else{this.constrainPosition=true;}}
Ext.ux.QuickTip.superclass.showAt.call(this,xy);},hide:function(){delete this.activeTarget;Ext.ux.QuickTip.superclass.hide.call(this);}});Ext.ux.QuickTips=function(){var tip,locks=[];return{init:function(autoRender){if(!tip){if(!Ext.isReady){Ext.onReady(function(){Ext.ux.QuickTips.init(autoRender);});return;}
tip=new Ext.ux.QuickTip();if(autoRender!==false){tip.render(Ext.getBody());}}},enable:function(){if(tip){locks.pop();if(locks.length<1){tip.enable();}}},disable:function(){if(tip){tip.disable();}
locks.push(1);},isEnabled:function(){return tip!==undefined&&!tip.disabled;},getQuickTip:function(){return tip;},register:function(){tip.register.apply(tip,arguments);},unregister:function(){tip.unregister.apply(tip,arguments);},tips:function(){tip.register.apply(tip,arguments);}}}();Date.prototype.getElapsed=function(date){return Math.abs((date||new Date()).getTime()-this.getTime());};

