/*
 * Ext JS Library 1.1.1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */

Ext.QuickTips=function(){var C,H,T,E,G,M,V,f={},a,B=null,D,A;var U,K,L,Z;var F=false,J=true,W=false;var e=1,O=1,d=1,Y=[];var S=function(k){if(J){return }var g=k.getTarget();if(!g||g.nodeType!==1||g==document||g==document.body){return }if(U&&g==U.el){clearTimeout(O);return }if(g&&f[g.id]){f[g.id].el=g;e=X.defer(G.showDelay,G,[f[g.id]]);return }var i,j=Ext.fly(g);var h=M.namespace;if(G.interceptTitles&&g.title){i=g.title;g.qtip=i;g.removeAttribute("title");k.preventDefault()}else{i=g.qtip||j.getAttributeNS(h,M.attribute)}if(i){e=X.defer(G.showDelay,G,[{el:g,text:i,width:j.getAttributeNS(h,M.width),autoHide:j.getAttributeNS(h,M.hide)!="user",title:j.getAttributeNS(h,M.title),cls:j.getAttributeNS(h,M.cls)}])}};var c=function(h){clearTimeout(e);var g=h.getTarget();if(g&&U&&U.el==g&&(G.autoHide&&U.autoHide!==false)){O=setTimeout(Q,G.hideDelay)}};var P=function(g){if(J){return }L=g.getXY();L[1]+=18;if(G.trackMouse&&U){C.setXY(L)}};var I=function(g){clearTimeout(e);clearTimeout(O);if(!g.within(C)){if(G.hideOnClick){Q();G.disable();G.enable.defer(100,G)}}};var N=function(){return D.getPadding("l")+A.getPadding("r")};var X=function(j){if(J){return }clearTimeout(d);U=j;if(B){C.removeClass(B);B=null}if(U.cls){C.addClass(U.cls);B=U.cls}if(U.title){E.update(U.title);E.show()}else{E.update("");E.hide()}C.dom.style.width=G.maxWidth+"px";T.update(j.text);var i=N(),g=U.width;if(!g){var k=T.dom;var h=Math.max(k.offsetWidth,k.clientWidth,k.scrollWidth);if(h>G.maxWidth){g=G.maxWidth}else{if(h<G.minWidth){g=G.minWidth}else{g=h}}}C.setWidth(parseInt(g,10)+i);if(U.autoHide===false){V.setDisplayed(true);if(Z){Z.unlock()}}else{V.setDisplayed(false);if(Z){Z.lock()}}if(L){C.avoidY=L[1]-18;C.setXY(L)}if(G.animate){C.setOpacity(0.1);C.setStyle("visibility","visible");C.fadeIn({callback:b})}else{b()}};var b=function(){if(U){C.show();a.enable();if(G.autoDismiss&&U.autoHide!==false){d=setTimeout(Q,G.autoDismissDelay)}}};var Q=function(g){clearTimeout(d);clearTimeout(O);U=null;if(C.isVisible()){a.disable();if(g!==true&&G.animate){C.fadeOut({callback:R})}else{R()}}};var R=function(){C.hide();if(B){C.removeClass(B);B=null}};return{minWidth:40,maxWidth:300,interceptTitles:false,trackMouse:false,hideOnClick:true,showDelay:500,hideDelay:200,autoHide:true,autoDismiss:true,autoDismissDelay:5000,animate:false,init:function(){G=Ext.QuickTips;M=G.tagConfig;if(!W){if(!Ext.isReady){Ext.onReady(Ext.QuickTips.init,Ext.QuickTips);return }C=new Ext.Layer({cls:"x-tip",shadow:"drop",shim:true,constrain:true,shadowOffset:4});C.fxDefaults={stopFx:true};C.update("<div class=\"x-tip-top-left\"><div class=\"x-tip-top-right\"><div class=\"x-tip-top\"></div></div></div><div class=\"x-tip-bd-left\"><div class=\"x-tip-bd-right\"><div class=\"x-tip-bd\"><div class=\"x-tip-close\"></div><h3></h3><div class=\"x-tip-bd-inner\"></div><div class=\"x-clear\"></div></div></div></div><div class=\"x-tip-ft-left\"><div class=\"x-tip-ft-right\"><div class=\"x-tip-ft\"></div></div></div>");E=C.child("h3");E.enableDisplayMode("block");H=C.child("div.x-tip-bd");T=C.child("div.x-tip-bd-inner");D=C.child("div.x-tip-bd-left");A=C.child("div.x-tip-bd-right");V=C.child("div.x-tip-close");V.enableDisplayMode("block");V.on("click",Q);var g=Ext.get(document);g.on("mousedown",I);g.on("mouseover",S);g.on("mouseout",c);g.on("mousemove",P);a=g.addKeyListener(27,Q);a.disable();if(Ext.dd.DD){Z=C.initDD("default",null,{onDrag:function(){C.sync()}});Z.setHandleElId(E.id);Z.lock()}W=true}this.enable()},register:function(l){var n=l instanceof Array?l:arguments;for(var m=0,g=n.length;m<g;m++){var p=n[m];var o=p.target;if(o){if(o instanceof Array){for(var k=0,h=o.length;k<h;k++){f[o[k]]=p}}else{f[typeof o=="string"?o:Ext.id(o)]=p}}}},unregister:function(g){delete f[Ext.id(g)]},enable:function(){if(W&&J){Y.pop();if(Y.length<1){J=false}}},disable:function(){J=true;clearTimeout(e);clearTimeout(O);clearTimeout(d);if(U){Q(true)}Y.push(1)},isEnabled:function(){return !J},tagConfig:{namespace:"ext",attribute:"qtip",width:"width",target:"target",title:"qtitle",hide:"hide",cls:"qclass"}}}();Ext.QuickTips.tips=Ext.QuickTips.register;
