Upgrade to ExtJS 3.2.2 - Released 06/02/2010
[extjs.git] / adapter / ext / ext-base-debug.js
1
2
3 window.undefined = window.undefined;
4
5
6
7 Ext = {
8     
9     version : '3.2.2',
10     versionDetail : {
11         major: 3,
12         minor: 2,
13         patch: 2
14     }
15 };
16
17
18 Ext.apply = function(o, c, defaults){
19     
20     if(defaults){
21         Ext.apply(o, defaults);
22     }
23     if(o && c && typeof c == 'object'){
24         for(var p in c){
25             o[p] = c[p];
26         }
27     }
28     return o;
29 };
30
31 (function(){
32     var idSeed = 0,
33         toString = Object.prototype.toString,
34         ua = navigator.userAgent.toLowerCase(),
35         check = function(r){
36             return r.test(ua);
37         },
38         DOC = document,
39         isStrict = DOC.compatMode == "CSS1Compat",
40         isOpera = check(/opera/),
41         isChrome = check(/\bchrome\b/),
42         isWebKit = check(/webkit/),
43         isSafari = !isChrome && check(/safari/),
44         isSafari2 = isSafari && check(/applewebkit\/4/), 
45         isSafari3 = isSafari && check(/version\/3/),
46         isSafari4 = isSafari && check(/version\/4/),
47         isIE = !isOpera && check(/msie/),
48         isIE7 = isIE && check(/msie 7/),
49         isIE8 = isIE && check(/msie 8/),
50         isIE6 = isIE && !isIE7 && !isIE8,
51         isGecko = !isWebKit && check(/gecko/),
52         isGecko2 = isGecko && check(/rv:1\.8/),
53         isGecko3 = isGecko && check(/rv:1\.9/),
54         isBorderBox = isIE && !isStrict,
55         isWindows = check(/windows|win32/),
56         isMac = check(/macintosh|mac os x/),
57         isAir = check(/adobeair/),
58         isLinux = check(/linux/),
59         isSecure = /^https/i.test(window.location.protocol);
60
61     
62     if(isIE6){
63         try{
64             DOC.execCommand("BackgroundImageCache", false, true);
65         }catch(e){}
66     }
67
68     Ext.apply(Ext, {
69         
70         SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
71         
72         isStrict : isStrict,
73         
74         isSecure : isSecure,
75         
76         isReady : false,
77
78         
79
80         
81         enableGarbageCollector : true,
82
83         
84         enableListenerCollection : false,
85
86         
87         enableNestedListenerRemoval : false,
88
89         
90         USE_NATIVE_JSON : false,
91
92         
93         applyIf : function(o, c){
94             if(o){
95                 for(var p in c){
96                     if(!Ext.isDefined(o[p])){
97                         o[p] = c[p];
98                     }
99                 }
100             }
101             return o;
102         },
103
104         
105         id : function(el, prefix){
106             el = Ext.getDom(el, true) || {};
107             if (!el.id) {
108                 el.id = (prefix || "ext-gen") + (++idSeed);
109             }
110             return el.id;
111         },
112
113         
114         extend : function(){
115             
116             var io = function(o){
117                 for(var m in o){
118                     this[m] = o[m];
119                 }
120             };
121             var oc = Object.prototype.constructor;
122
123             return function(sb, sp, overrides){
124                 if(typeof sp == 'object'){
125                     overrides = sp;
126                     sp = sb;
127                     sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};
128                 }
129                 var F = function(){},
130                     sbp,
131                     spp = sp.prototype;
132
133                 F.prototype = spp;
134                 sbp = sb.prototype = new F();
135                 sbp.constructor=sb;
136                 sb.superclass=spp;
137                 if(spp.constructor == oc){
138                     spp.constructor=sp;
139                 }
140                 sb.override = function(o){
141                     Ext.override(sb, o);
142                 };
143                 sbp.superclass = sbp.supr = (function(){
144                     return spp;
145                 });
146                 sbp.override = io;
147                 Ext.override(sb, overrides);
148                 sb.extend = function(o){return Ext.extend(sb, o);};
149                 return sb;
150             };
151         }(),
152
153         
154         override : function(origclass, overrides){
155             if(overrides){
156                 var p = origclass.prototype;
157                 Ext.apply(p, overrides);
158                 if(Ext.isIE && overrides.hasOwnProperty('toString')){
159                     p.toString = overrides.toString;
160                 }
161             }
162         },
163
164         
165         namespace : function(){
166             var o, d;
167             Ext.each(arguments, function(v) {
168                 d = v.split(".");
169                 o = window[d[0]] = window[d[0]] || {};
170                 Ext.each(d.slice(1), function(v2){
171                     o = o[v2] = o[v2] || {};
172                 });
173             });
174             return o;
175         },
176
177         
178         urlEncode : function(o, pre){
179             var empty,
180                 buf = [],
181                 e = encodeURIComponent;
182
183             Ext.iterate(o, function(key, item){
184                 empty = Ext.isEmpty(item);
185                 Ext.each(empty ? key : item, function(val){
186                     buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : '');
187                 });
188             });
189             if(!pre){
190                 buf.shift();
191                 pre = '';
192             }
193             return pre + buf.join('');
194         },
195
196         
197         urlDecode : function(string, overwrite){
198             if(Ext.isEmpty(string)){
199                 return {};
200             }
201             var obj = {},
202                 pairs = string.split('&'),
203                 d = decodeURIComponent,
204                 name,
205                 value;
206             Ext.each(pairs, function(pair) {
207                 pair = pair.split('=');
208                 name = d(pair[0]);
209                 value = d(pair[1]);
210                 obj[name] = overwrite || !obj[name] ? value :
211                             [].concat(obj[name]).concat(value);
212             });
213             return obj;
214         },
215
216         
217         urlAppend : function(url, s){
218             if(!Ext.isEmpty(s)){
219                 return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
220             }
221             return url;
222         },
223
224         
225          toArray : function(){
226              return isIE ?
227                  function(a, i, j, res){
228                      res = [];
229                      for(var x = 0, len = a.length; x < len; x++) {
230                          res.push(a[x]);
231                      }
232                      return res.slice(i || 0, j || res.length);
233                  } :
234                  function(a, i, j){
235                      return Array.prototype.slice.call(a, i || 0, j || a.length);
236                  };
237          }(),
238
239         isIterable : function(v){
240             
241             if(Ext.isArray(v) || v.callee){
242                 return true;
243             }
244             
245             if(/NodeList|HTMLCollection/.test(toString.call(v))){
246                 return true;
247             }
248             
249             
250             return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length));
251         },
252
253         
254         each : function(array, fn, scope){
255             if(Ext.isEmpty(array, true)){
256                 return;
257             }
258             if(!Ext.isIterable(array) || Ext.isPrimitive(array)){
259                 array = [array];
260             }
261             for(var i = 0, len = array.length; i < len; i++){
262                 if(fn.call(scope || array[i], array[i], i, array) === false){
263                     return i;
264                 };
265             }
266         },
267
268         
269         iterate : function(obj, fn, scope){
270             if(Ext.isEmpty(obj)){
271                 return;
272             }
273             if(Ext.isIterable(obj)){
274                 Ext.each(obj, fn, scope);
275                 return;
276             }else if(typeof obj == 'object'){
277                 for(var prop in obj){
278                     if(obj.hasOwnProperty(prop)){
279                         if(fn.call(scope || obj, prop, obj[prop], obj) === false){
280                             return;
281                         };
282                     }
283                 }
284             }
285         },
286
287         
288         getDom : function(el, strict){
289             if(!el || !DOC){
290                 return null;
291             }
292             if (el.dom){
293                 return el.dom;
294             } else {
295                 if (typeof el == 'string') {
296                     var e = DOC.getElementById(el);
297                     
298                     
299                     if (e && isIE && strict) {
300                         if (el == e.getAttribute('id')) {
301                             return e;
302                         } else {
303                             return null;
304                         }
305                     }
306                     return e;
307                 } else {
308                     return el;
309                 }
310             }
311         },
312
313         
314         getBody : function(){
315             return Ext.get(DOC.body || DOC.documentElement);
316         },
317         
318         
319         getHead : function() {
320             var head;
321             
322             return function() {
323                 if (head == undefined) {
324                     head = Ext.get(DOC.getElementsByTagName("head")[0]);
325                 }
326                 
327                 return head;
328             };
329         }(),
330
331         
332         
333         removeNode : isIE && !isIE8 ? function(){
334             var d;
335             return function(n){
336                 if(n && n.tagName != 'BODY'){
337                     (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
338                     d = d || DOC.createElement('div');
339                     d.appendChild(n);
340                     d.innerHTML = '';
341                     delete Ext.elCache[n.id];
342                 }
343             };
344         }() : function(n){
345             if(n && n.parentNode && n.tagName != 'BODY'){
346                 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
347                 n.parentNode.removeChild(n);
348                 delete Ext.elCache[n.id];
349             }
350         },
351
352         
353         isEmpty : function(v, allowBlank){
354             return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
355         },
356
357         
358         isArray : function(v){
359             return toString.apply(v) === '[object Array]';
360         },
361
362         
363         isDate : function(v){
364             return toString.apply(v) === '[object Date]';
365         },
366
367         
368         isObject : function(v){
369             return !!v && Object.prototype.toString.call(v) === '[object Object]';
370         },
371
372         
373         isPrimitive : function(v){
374             return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
375         },
376
377         
378         isFunction : function(v){
379             return toString.apply(v) === '[object Function]';
380         },
381
382         
383         isNumber : function(v){
384             return typeof v === 'number' && isFinite(v);
385         },
386
387         
388         isString : function(v){
389             return typeof v === 'string';
390         },
391
392         
393         isBoolean : function(v){
394             return typeof v === 'boolean';
395         },
396
397         
398         isElement : function(v) {
399             return v ? !!v.tagName : false;
400         },
401
402         
403         isDefined : function(v){
404             return typeof v !== 'undefined';
405         },
406
407         
408         isOpera : isOpera,
409         
410         isWebKit : isWebKit,
411         
412         isChrome : isChrome,
413         
414         isSafari : isSafari,
415         
416         isSafari3 : isSafari3,
417         
418         isSafari4 : isSafari4,
419         
420         isSafari2 : isSafari2,
421         
422         isIE : isIE,
423         
424         isIE6 : isIE6,
425         
426         isIE7 : isIE7,
427         
428         isIE8 : isIE8,
429         
430         isGecko : isGecko,
431         
432         isGecko2 : isGecko2,
433         
434         isGecko3 : isGecko3,
435         
436         isBorderBox : isBorderBox,
437         
438         isLinux : isLinux,
439         
440         isWindows : isWindows,
441         
442         isMac : isMac,
443         
444         isAir : isAir
445     });
446
447     
448     Ext.ns = Ext.namespace;
449 })();
450
451 Ext.ns("Ext.util", "Ext.lib", "Ext.data");
452
453 Ext.elCache = {};
454
455
456 Ext.apply(Function.prototype, {
457      
458     createInterceptor : function(fcn, scope){
459         var method = this;
460         return !Ext.isFunction(fcn) ?
461                 this :
462                 function() {
463                     var me = this,
464                         args = arguments;
465                     fcn.target = me;
466                     fcn.method = method;
467                     return (fcn.apply(scope || me || window, args) !== false) ?
468                             method.apply(me || window, args) :
469                             null;
470                 };
471     },
472
473      
474     createCallback : function(){
475         
476         var args = arguments,
477             method = this;
478         return function() {
479             return method.apply(window, args);
480         };
481     },
482
483     
484     createDelegate : function(obj, args, appendArgs){
485         var method = this;
486         return function() {
487             var callArgs = args || arguments;
488             if (appendArgs === true){
489                 callArgs = Array.prototype.slice.call(arguments, 0);
490                 callArgs = callArgs.concat(args);
491             }else if (Ext.isNumber(appendArgs)){
492                 callArgs = Array.prototype.slice.call(arguments, 0); 
493                 var applyArgs = [appendArgs, 0].concat(args); 
494                 Array.prototype.splice.apply(callArgs, applyArgs); 
495             }
496             return method.apply(obj || window, callArgs);
497         };
498     },
499
500     
501     defer : function(millis, obj, args, appendArgs){
502         var fn = this.createDelegate(obj, args, appendArgs);
503         if(millis > 0){
504             return setTimeout(fn, millis);
505         }
506         fn();
507         return 0;
508     }
509 });
510
511
512 Ext.applyIf(String, {
513     
514     format : function(format){
515         var args = Ext.toArray(arguments, 1);
516         return format.replace(/\{(\d+)\}/g, function(m, i){
517             return args[i];
518         });
519     }
520 });
521
522
523 Ext.applyIf(Array.prototype, {
524     
525     indexOf : function(o, from){
526         var len = this.length;
527         from = from || 0;
528         from += (from < 0) ? len : 0;
529         for (; from < len; ++from){
530             if(this[from] === o){
531                 return from;
532             }
533         }
534         return -1;
535     },
536
537     
538     remove : function(o){
539         var index = this.indexOf(o);
540         if(index != -1){
541             this.splice(index, 1);
542         }
543         return this;
544     }
545 });
546
547
548 Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
549        "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
550     
551
552 Ext.apply(Ext, function(){
553     var E = Ext,
554         idSeed = 0,
555         scrollWidth = null;
556
557     return {
558         
559         emptyFn : function(){},
560
561         
562         BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ?
563                             'http:/' + '/www.extjs.com/s.gif' :
564                             'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
565
566         extendX : function(supr, fn){
567             return Ext.extend(supr, fn(supr.prototype));
568         },
569
570         
571         getDoc : function(){
572             return Ext.get(document);
573         },
574
575         
576         num : function(v, defaultValue){
577             v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v);
578             return isNaN(v) ? defaultValue : v;
579         },
580
581         
582         value : function(v, defaultValue, allowBlank){
583             return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
584         },
585
586         
587         escapeRe : function(s) {
588             return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
589         },
590
591         sequence : function(o, name, fn, scope){
592             o[name] = o[name].createSequence(fn, scope);
593         },
594
595         
596         addBehaviors : function(o){
597             if(!Ext.isReady){
598                 Ext.onReady(function(){
599                     Ext.addBehaviors(o);
600                 });
601             } else {
602                 var cache = {}, 
603                     parts,
604                     b,
605                     s;
606                 for (b in o) {
607                     if ((parts = b.split('@'))[1]) { 
608                         s = parts[0];
609                         if(!cache[s]){
610                             cache[s] = Ext.select(s);
611                         }
612                         cache[s].on(parts[1], o[b]);
613                     }
614                 }
615                 cache = null;
616             }
617         },
618
619         
620         getScrollBarWidth: function(force){
621             if(!Ext.isReady){
622                 return 0;
623             }
624
625             if(force === true || scrollWidth === null){
626                     
627                 var div = Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
628                     child = div.child('div', true);
629                 var w1 = child.offsetWidth;
630                 div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
631                 var w2 = child.offsetWidth;
632                 div.remove();
633                 
634                 scrollWidth = w1 - w2 + 2;
635             }
636             return scrollWidth;
637         },
638
639
640         
641         combine : function(){
642             var as = arguments, l = as.length, r = [];
643             for(var i = 0; i < l; i++){
644                 var a = as[i];
645                 if(Ext.isArray(a)){
646                     r = r.concat(a);
647                 }else if(a.length !== undefined && !a.substr){
648                     r = r.concat(Array.prototype.slice.call(a, 0));
649                 }else{
650                     r.push(a);
651                 }
652             }
653             return r;
654         },
655
656         
657         copyTo : function(dest, source, names){
658             if(typeof names == 'string'){
659                 names = names.split(/[,;\s]/);
660             }
661             Ext.each(names, function(name){
662                 if(source.hasOwnProperty(name)){
663                     dest[name] = source[name];
664                 }
665             }, this);
666             return dest;
667         },
668
669         
670         destroy : function(){
671             Ext.each(arguments, function(arg){
672                 if(arg){
673                     if(Ext.isArray(arg)){
674                         this.destroy.apply(this, arg);
675                     }else if(typeof arg.destroy == 'function'){
676                         arg.destroy();
677                     }else if(arg.dom){
678                         arg.remove();
679                     }
680                 }
681             }, this);
682         },
683
684         
685         destroyMembers : function(o, arg1, arg2, etc){
686             for(var i = 1, a = arguments, len = a.length; i < len; i++) {
687                 Ext.destroy(o[a[i]]);
688                 delete o[a[i]];
689             }
690         },
691
692         
693         clean : function(arr){
694             var ret = [];
695             Ext.each(arr, function(v){
696                 if(!!v){
697                     ret.push(v);
698                 }
699             });
700             return ret;
701         },
702
703         
704         unique : function(arr){
705             var ret = [],
706                 collect = {};
707
708             Ext.each(arr, function(v) {
709                 if(!collect[v]){
710                     ret.push(v);
711                 }
712                 collect[v] = true;
713             });
714             return ret;
715         },
716
717         
718         flatten : function(arr){
719             var worker = [];
720             function rFlatten(a) {
721                 Ext.each(a, function(v) {
722                     if(Ext.isArray(v)){
723                         rFlatten(v);
724                     }else{
725                         worker.push(v);
726                     }
727                 });
728                 return worker;
729             }
730             return rFlatten(arr);
731         },
732
733         
734         min : function(arr, comp){
735             var ret = arr[0];
736             comp = comp || function(a,b){ return a < b ? -1 : 1; };
737             Ext.each(arr, function(v) {
738                 ret = comp(ret, v) == -1 ? ret : v;
739             });
740             return ret;
741         },
742
743         
744         max : function(arr, comp){
745             var ret = arr[0];
746             comp = comp || function(a,b){ return a > b ? 1 : -1; };
747             Ext.each(arr, function(v) {
748                 ret = comp(ret, v) == 1 ? ret : v;
749             });
750             return ret;
751         },
752
753         
754         mean : function(arr){
755            return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined;
756         },
757
758         
759         sum : function(arr){
760            var ret = 0;
761            Ext.each(arr, function(v) {
762                ret += v;
763            });
764            return ret;
765         },
766
767         
768         partition : function(arr, truth){
769             var ret = [[],[]];
770             Ext.each(arr, function(v, i, a) {
771                 ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
772             });
773             return ret;
774         },
775
776         
777         invoke : function(arr, methodName){
778             var ret = [],
779                 args = Array.prototype.slice.call(arguments, 2);
780             Ext.each(arr, function(v,i) {
781                 if (v && typeof v[methodName] == 'function') {
782                     ret.push(v[methodName].apply(v, args));
783                 } else {
784                     ret.push(undefined);
785                 }
786             });
787             return ret;
788         },
789
790         
791         pluck : function(arr, prop){
792             var ret = [];
793             Ext.each(arr, function(v) {
794                 ret.push( v[prop] );
795             });
796             return ret;
797         },
798
799         
800         zip : function(){
801             var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
802                 arrs = parts[0],
803                 fn = parts[1][0],
804                 len = Ext.max(Ext.pluck(arrs, "length")),
805                 ret = [];
806
807             for (var i = 0; i < len; i++) {
808                 ret[i] = [];
809                 if(fn){
810                     ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
811                 }else{
812                     for (var j = 0, aLen = arrs.length; j < aLen; j++){
813                         ret[i].push( arrs[j][i] );
814                     }
815                 }
816             }
817             return ret;
818         },
819
820         
821         getCmp : function(id){
822             return Ext.ComponentMgr.get(id);
823         },
824
825         
826         useShims: E.isIE6 || (E.isMac && E.isGecko2),
827
828         
829         
830         type : function(o){
831             if(o === undefined || o === null){
832                 return false;
833             }
834             if(o.htmlElement){
835                 return 'element';
836             }
837             var t = typeof o;
838             if(t == 'object' && o.nodeName) {
839                 switch(o.nodeType) {
840                     case 1: return 'element';
841                     case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
842                 }
843             }
844             if(t == 'object' || t == 'function') {
845                 switch(o.constructor) {
846                     case Array: return 'array';
847                     case RegExp: return 'regexp';
848                     case Date: return 'date';
849                 }
850                 if(typeof o.length == 'number' && typeof o.item == 'function') {
851                     return 'nodelist';
852                 }
853             }
854             return t;
855         },
856
857         intercept : function(o, name, fn, scope){
858             o[name] = o[name].createInterceptor(fn, scope);
859         },
860
861         
862         callback : function(cb, scope, args, delay){
863             if(typeof cb == 'function'){
864                 if(delay){
865                     cb.defer(delay, scope, args || []);
866                 }else{
867                     cb.apply(scope, args || []);
868                 }
869             }
870         }
871     };
872 }());
873
874
875 Ext.apply(Function.prototype, {
876     
877     createSequence : function(fcn, scope){
878         var method = this;
879         return (typeof fcn != 'function') ?
880                 this :
881                 function(){
882                     var retval = method.apply(this || window, arguments);
883                     fcn.apply(scope || this || window, arguments);
884                     return retval;
885                 };
886     }
887 });
888
889
890
891 Ext.applyIf(String, {
892
893     
894     escape : function(string) {
895         return string.replace(/('|\\)/g, "\\$1");
896     },
897
898     
899     leftPad : function (val, size, ch) {
900         var result = String(val);
901         if(!ch) {
902             ch = " ";
903         }
904         while (result.length < size) {
905             result = ch + result;
906         }
907         return result;
908     }
909 });
910
911
912 String.prototype.toggle = function(value, other){
913     return this == value ? other : value;
914 };
915
916
917 String.prototype.trim = function(){
918     var re = /^\s+|\s+$/g;
919     return function(){ return this.replace(re, ""); };
920 }();
921
922
923
924 Date.prototype.getElapsed = function(date) {
925     return Math.abs((date || new Date()).getTime()-this.getTime());
926 };
927
928
929
930 Ext.applyIf(Number.prototype, {
931     
932     constrain : function(min, max){
933         return Math.min(Math.max(this, min), max);
934     }
935 });
936
937 Ext.util.TaskRunner = function(interval){
938     interval = interval || 10;
939     var tasks = [], 
940         removeQueue = [],
941         id = 0,
942         running = false,
943
944         
945         stopThread = function(){
946                 running = false;
947                 clearInterval(id);
948                 id = 0;
949             },
950
951         
952         startThread = function(){
953                 if(!running){
954                     running = true;
955                     id = setInterval(runTasks, interval);
956                 }
957             },
958
959         
960         removeTask = function(t){
961                 removeQueue.push(t);
962                 if(t.onStop){
963                     t.onStop.apply(t.scope || t);
964                 }
965             },
966             
967         
968         runTasks = function(){
969                 var rqLen = removeQueue.length,
970                         now = new Date().getTime();                                             
971             
972                 if(rqLen > 0){
973                     for(var i = 0; i < rqLen; i++){
974                         tasks.remove(removeQueue[i]);
975                     }
976                     removeQueue = [];
977                     if(tasks.length < 1){
978                         stopThread();
979                         return;
980                     }
981                 }               
982                 for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){
983                     t = tasks[i];
984                     itime = now - t.taskRunTime;
985                     if(t.interval <= itime){
986                         rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]);
987                         t.taskRunTime = now;
988                         if(rt === false || t.taskRunCount === t.repeat){
989                             removeTask(t);
990                             return;
991                         }
992                     }
993                     if(t.duration && t.duration <= (now - t.taskStartTime)){
994                         removeTask(t);
995                     }
996                 }
997             };
998
999     
1000     this.start = function(task){
1001         tasks.push(task);
1002         task.taskStartTime = new Date().getTime();
1003         task.taskRunTime = 0;
1004         task.taskRunCount = 0;
1005         startThread();
1006         return task;
1007     };
1008
1009     
1010     this.stop = function(task){
1011         removeTask(task);
1012         return task;
1013     };
1014
1015     
1016     this.stopAll = function(){
1017         stopThread();
1018         for(var i = 0, len = tasks.length; i < len; i++){
1019             if(tasks[i].onStop){
1020                 tasks[i].onStop();
1021             }
1022         }
1023         tasks = [];
1024         removeQueue = [];
1025     };
1026 };
1027
1028
1029 Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
1030         var libFlyweight;
1031         
1032         function fly(el) {
1033         if (!libFlyweight) {
1034             libFlyweight = new Ext.Element.Flyweight();
1035         }
1036         libFlyweight.dom = el;
1037         return libFlyweight;
1038     }
1039     
1040     (function(){
1041         var doc = document,
1042                 isCSS1 = doc.compatMode == "CSS1Compat",
1043                 MAX = Math.max,         
1044         ROUND = Math.round,
1045                 PARSEINT = parseInt;
1046                 
1047         Ext.lib.Dom = {
1048             isAncestor : function(p, c) {
1049                     var ret = false;
1050                         
1051                         p = Ext.getDom(p);
1052                         c = Ext.getDom(c);
1053                         if (p && c) {
1054                                 if (p.contains) {
1055                                         return p.contains(c);
1056                                 } else if (p.compareDocumentPosition) {
1057                                         return !!(p.compareDocumentPosition(c) & 16);
1058                                 } else {
1059                                         while (c = c.parentNode) {
1060                                                 ret = c == p || ret;                                    
1061                                         }
1062                                 }                   
1063                         }       
1064                         return ret;
1065                 },
1066                 
1067         getViewWidth : function(full) {
1068             return full ? this.getDocumentWidth() : this.getViewportWidth();
1069         },
1070
1071         getViewHeight : function(full) {
1072             return full ? this.getDocumentHeight() : this.getViewportHeight();
1073         },
1074
1075         getDocumentHeight: function() {            
1076             return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
1077         },
1078
1079         getDocumentWidth: function() {            
1080             return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
1081         },
1082
1083         getViewportHeight: function(){
1084                 return Ext.isIE ? 
1085                            (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
1086                            self.innerHeight;
1087         },
1088
1089         getViewportWidth : function() {
1090                 return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
1091                            Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
1092         },
1093         
1094         getY : function(el) {
1095             return this.getXY(el)[1];
1096         },
1097
1098         getX : function(el) {
1099             return this.getXY(el)[0];
1100         },
1101
1102         getXY : function(el) {
1103             var p, 
1104                 pe, 
1105                 b,
1106                 bt, 
1107                 bl,     
1108                 dbd,            
1109                 x = 0,
1110                 y = 0, 
1111                 scroll,
1112                 hasAbsolute, 
1113                 bd = (doc.body || doc.documentElement),
1114                 ret = [0,0];
1115                 
1116             el = Ext.getDom(el);
1117
1118             if(el != bd){
1119                     if (el.getBoundingClientRect) {
1120                         b = el.getBoundingClientRect();
1121                         scroll = fly(document).getScroll();
1122                         ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
1123                     } else {  
1124                             p = el;             
1125                             hasAbsolute = fly(el).isStyle("position", "absolute");
1126                 
1127                             while (p) {
1128                                     pe = fly(p);                
1129                                 x += p.offsetLeft;
1130                                 y += p.offsetTop;
1131                 
1132                                 hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
1133                                                 
1134                                 if (Ext.isGecko) {                                  
1135                                     y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
1136                                     x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;        
1137                 
1138                                     if (p != el && !pe.isStyle('overflow','visible')) {
1139                                         x += bl;
1140                                         y += bt;
1141                                     }
1142                                 }
1143                                 p = p.offsetParent;
1144                             }
1145                 
1146                             if (Ext.isSafari && hasAbsolute) {
1147                                 x -= bd.offsetLeft;
1148                                 y -= bd.offsetTop;
1149                             }
1150                 
1151                             if (Ext.isGecko && !hasAbsolute) {
1152                                 dbd = fly(bd);
1153                                 x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
1154                                 y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
1155                             }
1156                 
1157                             p = el.parentNode;
1158                             while (p && p != bd) {
1159                                 if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
1160                                     x -= p.scrollLeft;
1161                                     y -= p.scrollTop;
1162                                 }
1163                                 p = p.parentNode;
1164                             }
1165                             ret = [x,y];
1166                     }
1167                 }
1168             return ret
1169         },
1170
1171         setXY : function(el, xy) {
1172             (el = Ext.fly(el, '_setXY')).position();
1173             
1174             var pts = el.translatePoints(xy),
1175                 style = el.dom.style,
1176                 pos;                    
1177             
1178             for (pos in pts) {              
1179                     if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
1180             }
1181         },
1182
1183         setX : function(el, x) {
1184             this.setXY(el, [x, false]);
1185         },
1186
1187         setY : function(el, y) {
1188             this.setXY(el, [false, y]);
1189         }
1190     };
1191 })();Ext.lib.Dom.getRegion = function(el) {
1192     return Ext.lib.Region.getRegion(el);
1193 };Ext.lib.Event = function() {
1194     var loadComplete = false,
1195         unloadListeners = {},
1196         retryCount = 0,
1197         onAvailStack = [],
1198         _interval,
1199         locked = false,
1200         win = window,
1201         doc = document,
1202
1203         
1204         POLL_RETRYS = 200,
1205         POLL_INTERVAL = 20,
1206         TYPE = 0,
1207         FN = 1,
1208         OBJ = 2,
1209         ADJ_SCOPE = 3,
1210         SCROLLLEFT = 'scrollLeft',
1211         SCROLLTOP = 'scrollTop',
1212         UNLOAD = 'unload',
1213         MOUSEOVER = 'mouseover',
1214         MOUSEOUT = 'mouseout',
1215         
1216         doAdd = function() {
1217             var ret;
1218             if (win.addEventListener) {
1219                 ret = function(el, eventName, fn, capture) {
1220                     if (eventName == 'mouseenter') {
1221                         fn = fn.createInterceptor(checkRelatedTarget);
1222                         el.addEventListener(MOUSEOVER, fn, (capture));
1223                     } else if (eventName == 'mouseleave') {
1224                         fn = fn.createInterceptor(checkRelatedTarget);
1225                         el.addEventListener(MOUSEOUT, fn, (capture));
1226                     } else {
1227                         el.addEventListener(eventName, fn, (capture));
1228                     }
1229                     return fn;
1230                 };
1231             } else if (win.attachEvent) {
1232                 ret = function(el, eventName, fn, capture) {
1233                     el.attachEvent("on" + eventName, fn);
1234                     return fn;
1235                 };
1236             } else {
1237                 ret = function(){};
1238             }
1239             return ret;
1240         }(),
1241         
1242         doRemove = function(){
1243             var ret;
1244             if (win.removeEventListener) {
1245                 ret = function (el, eventName, fn, capture) {
1246                     if (eventName == 'mouseenter') {
1247                         eventName = MOUSEOVER;
1248                     } else if (eventName == 'mouseleave') {
1249                         eventName = MOUSEOUT;
1250                     }
1251                     el.removeEventListener(eventName, fn, (capture));
1252                 };
1253             } else if (win.detachEvent) {
1254                 ret = function (el, eventName, fn) {
1255                     el.detachEvent("on" + eventName, fn);
1256                 };
1257             } else {
1258                 ret = function(){};
1259             }
1260             return ret;
1261         }();
1262
1263     function checkRelatedTarget(e) {
1264         return !elContains(e.currentTarget, pub.getRelatedTarget(e));
1265     }
1266
1267     function elContains(parent, child) {
1268        if(parent && parent.firstChild){
1269          while(child) {
1270             if(child === parent) {
1271                 return true;
1272             }
1273             child = child.parentNode;
1274             if(child && (child.nodeType != 1)) {
1275                 child = null;
1276             }
1277           }
1278         }
1279         return false;
1280     }
1281
1282     
1283     function _tryPreloadAttach() {
1284         var ret = false,
1285             notAvail = [],
1286             element, i, v, override,
1287             tryAgain = !loadComplete || (retryCount > 0);
1288
1289         if(!locked){
1290             locked = true;
1291             
1292             for(i = 0; i < onAvailStack.length; ++i){
1293                 v = onAvailStack[i];
1294                 if(v && (element = doc.getElementById(v.id))){
1295                     if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
1296                         override = v.override;
1297                         element = override ? (override === true ? v.obj : override) : element;
1298                         v.fn.call(element, v.obj);
1299                         onAvailStack.remove(v);
1300                         --i;
1301                     }else{
1302                         notAvail.push(v);
1303                     }
1304                 }
1305             }
1306
1307             retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
1308
1309             if (tryAgain) {
1310                 startInterval();
1311             } else {
1312                 clearInterval(_interval);
1313                 _interval = null;
1314             }
1315             ret = !(locked = false);
1316         }
1317         return ret;
1318     }
1319
1320     
1321     function startInterval() {
1322         if(!_interval){
1323             var callback = function() {
1324                 _tryPreloadAttach();
1325             };
1326             _interval = setInterval(callback, POLL_INTERVAL);
1327         }
1328     }
1329
1330     
1331     function getScroll() {
1332         var dd = doc.documentElement,
1333             db = doc.body;
1334         if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){
1335             return [dd[SCROLLLEFT], dd[SCROLLTOP]];
1336         }else if(db){
1337             return [db[SCROLLLEFT], db[SCROLLTOP]];
1338         }else{
1339             return [0, 0];
1340         }
1341     }
1342
1343     
1344     function getPageCoord (ev, xy) {
1345         ev = ev.browserEvent || ev;
1346         var coord  = ev['page' + xy];
1347         if (!coord && coord !== 0) {
1348             coord = ev['client' + xy] || 0;
1349
1350             if (Ext.isIE) {
1351                 coord += getScroll()[xy == "X" ? 0 : 1];
1352             }
1353         }
1354
1355         return coord;
1356     }
1357
1358     var pub =  {
1359         extAdapter: true,
1360         onAvailable : function(p_id, p_fn, p_obj, p_override) {
1361             onAvailStack.push({
1362                 id:         p_id,
1363                 fn:         p_fn,
1364                 obj:        p_obj,
1365                 override:   p_override,
1366                 checkReady: false });
1367
1368             retryCount = POLL_RETRYS;
1369             startInterval();
1370         },
1371
1372         
1373         addListener: function(el, eventName, fn) {
1374             el = Ext.getDom(el);
1375             if (el && fn) {
1376                 if (eventName == UNLOAD) {
1377                     if (unloadListeners[el.id] === undefined) {
1378                         unloadListeners[el.id] = [];
1379                     }
1380                     unloadListeners[el.id].push([eventName, fn]);
1381                     return fn;
1382                 }
1383                 return doAdd(el, eventName, fn, false);
1384             }
1385             return false;
1386         },
1387
1388         
1389         removeListener: function(el, eventName, fn) {
1390             el = Ext.getDom(el);
1391             var i, len, li, lis;
1392             if (el && fn) {
1393                 if(eventName == UNLOAD){
1394                     if((lis = unloadListeners[el.id]) !== undefined){
1395                         for(i = 0, len = lis.length; i < len; i++){
1396                             if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
1397                                 unloadListeners[el.id].splice(i, 1);
1398                             }
1399                         }
1400                     }
1401                     return;
1402                 }
1403                 doRemove(el, eventName, fn, false);
1404             }
1405         },
1406
1407         getTarget : function(ev) {
1408             ev = ev.browserEvent || ev;
1409             return this.resolveTextNode(ev.target || ev.srcElement);
1410         },
1411
1412         resolveTextNode : Ext.isGecko ? function(node){
1413             if(!node){
1414                 return;
1415             }
1416             
1417             var s = HTMLElement.prototype.toString.call(node);
1418             if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){
1419                 return;
1420             }
1421             return node.nodeType == 3 ? node.parentNode : node;
1422         } : function(node){
1423             return node && node.nodeType == 3 ? node.parentNode : node;
1424         },
1425
1426         getRelatedTarget : function(ev) {
1427             ev = ev.browserEvent || ev;
1428             return this.resolveTextNode(ev.relatedTarget ||
1429                 (/(mouseout|mouseleave)/.test(ev.type) ? ev.toElement :
1430                  /(mouseover|mouseenter)/.test(ev.type) ? ev.fromElement : null));
1431         },
1432
1433         getPageX : function(ev) {
1434             return getPageCoord(ev, "X");
1435         },
1436
1437         getPageY : function(ev) {
1438             return getPageCoord(ev, "Y");
1439         },
1440
1441
1442         getXY : function(ev) {
1443             return [this.getPageX(ev), this.getPageY(ev)];
1444         },
1445
1446         stopEvent : function(ev) {
1447             this.stopPropagation(ev);
1448             this.preventDefault(ev);
1449         },
1450
1451         stopPropagation : function(ev) {
1452             ev = ev.browserEvent || ev;
1453             if (ev.stopPropagation) {
1454                 ev.stopPropagation();
1455             } else {
1456                 ev.cancelBubble = true;
1457             }
1458         },
1459
1460         preventDefault : function(ev) {
1461             ev = ev.browserEvent || ev;
1462             if (ev.preventDefault) {
1463                 ev.preventDefault();
1464             } else {
1465                 ev.returnValue = false;
1466             }
1467         },
1468
1469         getEvent : function(e) {
1470             e = e || win.event;
1471             if (!e) {
1472                 var c = this.getEvent.caller;
1473                 while (c) {
1474                     e = c.arguments[0];
1475                     if (e && Event == e.constructor) {
1476                         break;
1477                     }
1478                     c = c.caller;
1479                 }
1480             }
1481             return e;
1482         },
1483
1484         getCharCode : function(ev) {
1485             ev = ev.browserEvent || ev;
1486             return ev.charCode || ev.keyCode || 0;
1487         },
1488
1489         
1490         
1491         getListeners : function(el, eventName) {
1492             Ext.EventManager.getListeners(el, eventName);
1493         },
1494
1495         
1496         purgeElement : function(el, recurse, eventName) {
1497             Ext.EventManager.purgeElement(el, recurse, eventName);
1498         },
1499
1500         _load : function(e) {
1501             loadComplete = true;
1502             
1503             if (Ext.isIE && e !== true) {
1504                 
1505                 
1506                 doRemove(win, "load", arguments.callee);
1507             }
1508         },
1509
1510         _unload : function(e) {
1511              var EU = Ext.lib.Event,
1512                 i, v, ul, id, len, scope;
1513
1514             for (id in unloadListeners) {
1515                 ul = unloadListeners[id];
1516                 for (i = 0, len = ul.length; i < len; i++) {
1517                     v = ul[i];
1518                     if (v) {
1519                         try{
1520                             scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) :  win;
1521                             v[FN].call(scope, EU.getEvent(e), v[OBJ]);
1522                         }catch(ex){}
1523                     }
1524                 }
1525             };
1526
1527             Ext.EventManager._unload();
1528
1529             doRemove(win, UNLOAD, EU._unload);
1530         }
1531     };
1532
1533     
1534     pub.on = pub.addListener;
1535     pub.un = pub.removeListener;
1536     if (doc && doc.body) {
1537         pub._load(true);
1538     } else {
1539         doAdd(win, "load", pub._load);
1540     }
1541     doAdd(win, UNLOAD, pub._unload);
1542     _tryPreloadAttach();
1543
1544     return pub;
1545 }();
1546
1547 Ext.lib.Ajax = function() {
1548     var activeX = ['MSXML2.XMLHTTP.3.0',
1549                    'MSXML2.XMLHTTP',
1550                    'Microsoft.XMLHTTP'],
1551         CONTENTTYPE = 'Content-Type';
1552
1553     
1554     function setHeader(o) {
1555         var conn = o.conn,
1556             prop;
1557
1558         function setTheHeaders(conn, headers){
1559             for (prop in headers) {
1560                 if (headers.hasOwnProperty(prop)) {
1561                     conn.setRequestHeader(prop, headers[prop]);
1562                 }
1563             }
1564         }
1565
1566         if (pub.defaultHeaders) {
1567             setTheHeaders(conn, pub.defaultHeaders);
1568         }
1569
1570         if (pub.headers) {
1571             setTheHeaders(conn, pub.headers);
1572             delete pub.headers;
1573         }
1574     }
1575
1576     
1577     function createExceptionObject(tId, callbackArg, isAbort, isTimeout) {
1578         return {
1579             tId : tId,
1580             status : isAbort ? -1 : 0,
1581             statusText : isAbort ? 'transaction aborted' : 'communication failure',
1582             isAbort: isAbort,
1583             isTimeout: isTimeout,
1584             argument : callbackArg
1585         };
1586     }
1587
1588     
1589     function initHeader(label, value) {
1590         (pub.headers = pub.headers || {})[label] = value;
1591     }
1592
1593     
1594     function createResponseObject(o, callbackArg) {
1595         var headerObj = {},
1596             headerStr,
1597             conn = o.conn,
1598             t,
1599             s,
1600             
1601             isBrokenStatus = conn.status == 1223;
1602
1603         try {
1604             headerStr = o.conn.getAllResponseHeaders();
1605             Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){
1606                 t = v.indexOf(':');
1607                 if(t >= 0){
1608                     s = v.substr(0, t).toLowerCase();
1609                     if(v.charAt(t + 1) == ' '){
1610                         ++t;
1611                     }
1612                     headerObj[s] = v.substr(t + 1);
1613                 }
1614             });
1615         } catch(e) {}
1616
1617         return {
1618             tId : o.tId,
1619             
1620             status : isBrokenStatus ? 204 : conn.status,
1621             statusText : isBrokenStatus ? 'No Content' : conn.statusText,
1622             getResponseHeader : function(header){return headerObj[header.toLowerCase()];},
1623             getAllResponseHeaders : function(){return headerStr;},
1624             responseText : conn.responseText,
1625             responseXML : conn.responseXML,
1626             argument : callbackArg
1627         };
1628     }
1629
1630     
1631     function releaseObject(o) {
1632         if (o.tId) {
1633             pub.conn[o.tId] = null;
1634         }
1635         o.conn = null;
1636         o = null;
1637     }
1638
1639     
1640     function handleTransactionResponse(o, callback, isAbort, isTimeout) {
1641         if (!callback) {
1642             releaseObject(o);
1643             return;
1644         }
1645
1646         var httpStatus, responseObject;
1647
1648         try {
1649             if (o.conn.status !== undefined && o.conn.status != 0) {
1650                 httpStatus = o.conn.status;
1651             }
1652             else {
1653                 httpStatus = 13030;
1654             }
1655         }
1656         catch(e) {
1657             httpStatus = 13030;
1658         }
1659
1660         if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) {
1661             responseObject = createResponseObject(o, callback.argument);
1662             if (callback.success) {
1663                 if (!callback.scope) {
1664                     callback.success(responseObject);
1665                 }
1666                 else {
1667                     callback.success.apply(callback.scope, [responseObject]);
1668                 }
1669             }
1670         }
1671         else {
1672             switch (httpStatus) {
1673                 case 12002:
1674                 case 12029:
1675                 case 12030:
1676                 case 12031:
1677                 case 12152:
1678                 case 13030:
1679                     responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout);
1680                     if (callback.failure) {
1681                         if (!callback.scope) {
1682                             callback.failure(responseObject);
1683                         }
1684                         else {
1685                             callback.failure.apply(callback.scope, [responseObject]);
1686                         }
1687                     }
1688                     break;
1689                 default:
1690                     responseObject = createResponseObject(o, callback.argument);
1691                     if (callback.failure) {
1692                         if (!callback.scope) {
1693                             callback.failure(responseObject);
1694                         }
1695                         else {
1696                             callback.failure.apply(callback.scope, [responseObject]);
1697                         }
1698                     }
1699             }
1700         }
1701
1702         releaseObject(o);
1703         responseObject = null;
1704     }
1705
1706     
1707     function handleReadyState(o, callback){
1708     callback = callback || {};
1709         var conn = o.conn,
1710             tId = o.tId,
1711             poll = pub.poll,
1712             cbTimeout = callback.timeout || null;
1713
1714         if (cbTimeout) {
1715             pub.conn[tId] = conn;
1716             pub.timeout[tId] = setTimeout(function() {
1717                 pub.abort(o, callback, true);
1718             }, cbTimeout);
1719         }
1720
1721         poll[tId] = setInterval(
1722             function() {
1723                 if (conn && conn.readyState == 4) {
1724                     clearInterval(poll[tId]);
1725                     poll[tId] = null;
1726
1727                     if (cbTimeout) {
1728                         clearTimeout(pub.timeout[tId]);
1729                         pub.timeout[tId] = null;
1730                     }
1731
1732                     handleTransactionResponse(o, callback);
1733                 }
1734             },
1735             pub.pollInterval);
1736     }
1737
1738     
1739     function asyncRequest(method, uri, callback, postData) {
1740         var o = getConnectionObject() || null;
1741
1742         if (o) {
1743             o.conn.open(method, uri, true);
1744
1745             if (pub.useDefaultXhrHeader) {
1746                 initHeader('X-Requested-With', pub.defaultXhrHeader);
1747             }
1748
1749             if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){
1750                 initHeader(CONTENTTYPE, pub.defaultPostHeader);
1751             }
1752
1753             if (pub.defaultHeaders || pub.headers) {
1754                 setHeader(o);
1755             }
1756
1757             handleReadyState(o, callback);
1758             o.conn.send(postData || null);
1759         }
1760         return o;
1761     }
1762
1763     
1764     function getConnectionObject() {
1765         var o;
1766
1767         try {
1768             if (o = createXhrObject(pub.transactionId)) {
1769                 pub.transactionId++;
1770             }
1771         } catch(e) {
1772         } finally {
1773             return o;
1774         }
1775     }
1776
1777     
1778     function createXhrObject(transactionId) {
1779         var http;
1780
1781         try {
1782             http = new XMLHttpRequest();
1783         } catch(e) {
1784             for (var i = 0; i < activeX.length; ++i) {
1785                 try {
1786                     http = new ActiveXObject(activeX[i]);
1787                     break;
1788                 } catch(e) {}
1789             }
1790         } finally {
1791             return {conn : http, tId : transactionId};
1792         }
1793     }
1794
1795     var pub = {
1796         request : function(method, uri, cb, data, options) {
1797             if(options){
1798                 var me = this,
1799                     xmlData = options.xmlData,
1800                     jsonData = options.jsonData,
1801                     hs;
1802
1803                 Ext.applyIf(me, options);
1804
1805                 if(xmlData || jsonData){
1806                     hs = me.headers;
1807                     if(!hs || !hs[CONTENTTYPE]){
1808                         initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json');
1809                     }
1810                     data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData);
1811                 }
1812             }
1813             return asyncRequest(method || options.method || "POST", uri, cb, data);
1814         },
1815
1816         serializeForm : function(form) {
1817             var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements,
1818                 hasSubmit = false,
1819                 encoder = encodeURIComponent,
1820                 name,
1821                 data = '',
1822                 type;
1823
1824             Ext.each(fElements, function(element) {
1825                 name = element.name;
1826                 type = element.type;
1827
1828                 if (!element.disabled && name){
1829                     if(/select-(one|multiple)/i.test(type)) {
1830                         Ext.each(element.options, function(opt) {
1831                             if (opt.selected) {
1832                                 data += String.format("{0}={1}&", encoder(name), encoder((opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttribute('value') !== null) ? opt.value : opt.text));
1833                             }
1834                         });
1835                     } else if(!(/file|undefined|reset|button/i.test(type))) {
1836                             if(!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)){
1837
1838                                 data += encoder(name) + '=' + encoder(element.value) + '&';
1839                                 hasSubmit = /submit/i.test(type);
1840                             }
1841                     }
1842                 }
1843             });
1844             return data.substr(0, data.length - 1);
1845         },
1846
1847         useDefaultHeader : true,
1848         defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8',
1849         useDefaultXhrHeader : true,
1850         defaultXhrHeader : 'XMLHttpRequest',
1851         poll : {},
1852         timeout : {},
1853         conn: {},
1854         pollInterval : 50,
1855         transactionId : 0,
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884         abort : function(o, callback, isTimeout) {
1885             var me = this,
1886                 tId = o.tId,
1887                 isAbort = false;
1888
1889             if (me.isCallInProgress(o)) {
1890                 o.conn.abort();
1891                 clearInterval(me.poll[tId]);
1892                 me.poll[tId] = null;
1893                 clearTimeout(pub.timeout[tId]);
1894                 me.timeout[tId] = null;
1895
1896                 handleTransactionResponse(o, callback, (isAbort = true), isTimeout);
1897             }
1898             return isAbort;
1899         },
1900
1901         isCallInProgress : function(o) {
1902             
1903             return o.conn && !{0:true,4:true}[o.conn.readyState];
1904         }
1905     };
1906     return pub;
1907 }();    Ext.lib.Region = function(t, r, b, l) {
1908                 var me = this;
1909         me.top = t;
1910         me[1] = t;
1911         me.right = r;
1912         me.bottom = b;
1913         me.left = l;
1914         me[0] = l;
1915     };
1916
1917     Ext.lib.Region.prototype = {
1918         contains : function(region) {
1919                 var me = this;
1920             return ( region.left >= me.left &&
1921                      region.right <= me.right &&
1922                      region.top >= me.top &&
1923                      region.bottom <= me.bottom );
1924
1925         },
1926
1927         getArea : function() {
1928                 var me = this;
1929             return ( (me.bottom - me.top) * (me.right - me.left) );
1930         },
1931
1932         intersect : function(region) {
1933             var me = this,
1934                 t = Math.max(me.top, region.top),
1935                 r = Math.min(me.right, region.right),
1936                 b = Math.min(me.bottom, region.bottom),
1937                 l = Math.max(me.left, region.left);
1938
1939             if (b >= t && r >= l) {
1940                 return new Ext.lib.Region(t, r, b, l);
1941             }
1942         },
1943         
1944         union : function(region) {
1945                 var me = this,
1946                 t = Math.min(me.top, region.top),
1947                 r = Math.max(me.right, region.right),
1948                 b = Math.max(me.bottom, region.bottom),
1949                 l = Math.min(me.left, region.left);
1950
1951             return new Ext.lib.Region(t, r, b, l);
1952         },
1953
1954         constrainTo : function(r) {
1955                 var me = this;
1956             me.top = me.top.constrain(r.top, r.bottom);
1957             me.bottom = me.bottom.constrain(r.top, r.bottom);
1958             me.left = me.left.constrain(r.left, r.right);
1959             me.right = me.right.constrain(r.left, r.right);
1960             return me;
1961         },
1962
1963         adjust : function(t, l, b, r) {
1964                 var me = this;
1965             me.top += t;
1966             me.left += l;
1967             me.right += r;
1968             me.bottom += b;
1969             return me;
1970         }
1971     };
1972
1973     Ext.lib.Region.getRegion = function(el) {
1974         var p = Ext.lib.Dom.getXY(el),
1975                 t = p[1],
1976                 r = p[0] + el.offsetWidth,
1977                 b = p[1] + el.offsetHeight,
1978                 l = p[0];
1979
1980         return new Ext.lib.Region(t, r, b, l);
1981     };  Ext.lib.Point = function(x, y) {
1982         if (Ext.isArray(x)) {
1983             y = x[1];
1984             x = x[0];
1985         }
1986         var me = this;
1987         me.x = me.right = me.left = me[0] = x;
1988         me.y = me.top = me.bottom = me[1] = y;
1989     };
1990
1991     Ext.lib.Point.prototype = new Ext.lib.Region();
1992 (function(){
1993     var EXTLIB = Ext.lib,
1994         noNegatives = /width|height|opacity|padding/i,
1995         offsetAttribute = /^((width|height)|(top|left))$/,
1996         defaultUnit = /width|height|top$|bottom$|left$|right$/i,
1997         offsetUnit =  /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,
1998         isset = function(v){
1999             return typeof v !== 'undefined';
2000         },
2001         now = function(){
2002             return new Date();
2003         };
2004
2005     EXTLIB.Anim = {
2006         motion : function(el, args, duration, easing, cb, scope) {
2007             return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
2008         },
2009
2010         run : function(el, args, duration, easing, cb, scope, type) {
2011             type = type || Ext.lib.AnimBase;
2012             if (typeof easing == "string") {
2013                 easing = Ext.lib.Easing[easing];
2014             }
2015             var anim = new type(el, args, duration, easing);
2016             anim.animateX(function() {
2017                 if(Ext.isFunction(cb)){
2018                     cb.call(scope);
2019                 }
2020             });
2021             return anim;
2022         }
2023     };
2024
2025     EXTLIB.AnimBase = function(el, attributes, duration, method) {
2026         if (el) {
2027             this.init(el, attributes, duration, method);
2028         }
2029     };
2030
2031     EXTLIB.AnimBase.prototype = {
2032         doMethod: function(attr, start, end) {
2033             var me = this;
2034             return me.method(me.curFrame, start, end - start, me.totalFrames);
2035         },
2036
2037
2038         setAttr: function(attr, val, unit) {
2039             if (noNegatives.test(attr) && val < 0) {
2040                 val = 0;
2041             }
2042             Ext.fly(this.el, '_anim').setStyle(attr, val + unit);
2043         },
2044
2045
2046         getAttr: function(attr) {
2047             var el = Ext.fly(this.el),
2048                 val = el.getStyle(attr),
2049                 a = offsetAttribute.exec(attr) || [];
2050
2051             if (val !== 'auto' && !offsetUnit.test(val)) {
2052                 return parseFloat(val);
2053             }
2054
2055             return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0;
2056         },
2057
2058
2059         getDefaultUnit: function(attr) {
2060             return defaultUnit.test(attr) ? 'px' : '';
2061         },
2062
2063         animateX : function(callback, scope) {
2064             var me = this,
2065                 f = function() {
2066                 me.onComplete.removeListener(f);
2067                 if (Ext.isFunction(callback)) {
2068                     callback.call(scope || me, me);
2069                 }
2070             };
2071             me.onComplete.addListener(f, me);
2072             me.animate();
2073         },
2074
2075
2076         setRunAttr: function(attr) {
2077             var me = this,
2078                 a = this.attributes[attr],
2079                 to = a.to,
2080                 by = a.by,
2081                 from = a.from,
2082                 unit = a.unit,
2083                 ra = (this.runAttrs[attr] = {}),
2084                 end;
2085
2086             if (!isset(to) && !isset(by)){
2087                 return false;
2088             }
2089
2090             var start = isset(from) ? from : me.getAttr(attr);
2091             if (isset(to)) {
2092                 end = to;
2093             }else if(isset(by)) {
2094                 if (Ext.isArray(start)){
2095                     end = [];
2096                     for(var i=0,len=start.length; i<len; i++) {
2097                         end[i] = start[i] + by[i];
2098                     }
2099                 }else{
2100                     end = start + by;
2101                 }
2102             }
2103
2104             Ext.apply(ra, {
2105                 start: start,
2106                 end: end,
2107                 unit: isset(unit) ? unit : me.getDefaultUnit(attr)
2108             });
2109         },
2110
2111
2112         init: function(el, attributes, duration, method) {
2113             var me = this,
2114                 actualFrames = 0,
2115                 mgr = EXTLIB.AnimMgr;
2116
2117             Ext.apply(me, {
2118                 isAnimated: false,
2119                 startTime: null,
2120                 el: Ext.getDom(el),
2121                 attributes: attributes || {},
2122                 duration: duration || 1,
2123                 method: method || EXTLIB.Easing.easeNone,
2124                 useSec: true,
2125                 curFrame: 0,
2126                 totalFrames: mgr.fps,
2127                 runAttrs: {},
2128                 animate: function(){
2129                     var me = this,
2130                         d = me.duration;
2131
2132                     if(me.isAnimated){
2133                         return false;
2134                     }
2135
2136                     me.curFrame = 0;
2137                     me.totalFrames = me.useSec ? Math.ceil(mgr.fps * d) : d;
2138                     mgr.registerElement(me);
2139                 },
2140
2141                 stop: function(finish){
2142                     var me = this;
2143
2144                     if(finish){
2145                         me.curFrame = me.totalFrames;
2146                         me._onTween.fire();
2147                     }
2148                     mgr.stop(me);
2149                 }
2150             });
2151
2152             var onStart = function(){
2153                 var me = this,
2154                     attr;
2155
2156                 me.onStart.fire();
2157                 me.runAttrs = {};
2158                 for(attr in this.attributes){
2159                     this.setRunAttr(attr);
2160                 }
2161
2162                 me.isAnimated = true;
2163                 me.startTime = now();
2164                 actualFrames = 0;
2165             };
2166
2167
2168             var onTween = function(){
2169                 var me = this;
2170
2171                 me.onTween.fire({
2172                     duration: now() - me.startTime,
2173                     curFrame: me.curFrame
2174                 });
2175
2176                 var ra = me.runAttrs;
2177                 for (var attr in ra) {
2178                     this.setAttr(attr, me.doMethod(attr, ra[attr].start, ra[attr].end), ra[attr].unit);
2179                 }
2180
2181                 ++actualFrames;
2182             };
2183
2184             var onComplete = function() {
2185                 var me = this,
2186                     actual = (now() - me.startTime) / 1000,
2187                     data = {
2188                         duration: actual,
2189                         frames: actualFrames,
2190                         fps: actualFrames / actual
2191                     };
2192
2193                 me.isAnimated = false;
2194                 actualFrames = 0;
2195                 me.onComplete.fire(data);
2196             };
2197
2198             me.onStart = new Ext.util.Event(me);
2199             me.onTween = new Ext.util.Event(me);
2200             me.onComplete = new Ext.util.Event(me);
2201             (me._onStart = new Ext.util.Event(me)).addListener(onStart);
2202             (me._onTween = new Ext.util.Event(me)).addListener(onTween);
2203             (me._onComplete = new Ext.util.Event(me)).addListener(onComplete);
2204         }
2205     };
2206
2207
2208     Ext.lib.AnimMgr = new function() {
2209         var me = this,
2210             thread = null,
2211             queue = [],
2212             tweenCount = 0;
2213
2214
2215         Ext.apply(me, {
2216             fps: 1000,
2217             delay: 1,
2218             registerElement: function(tween){
2219                 queue.push(tween);
2220                 ++tweenCount;
2221                 tween._onStart.fire();
2222                 me.start();
2223             },
2224
2225             unRegister: function(tween, index){
2226                 tween._onComplete.fire();
2227                 index = index || getIndex(tween);
2228                 if (index != -1) {
2229                     queue.splice(index, 1);
2230                 }
2231
2232                 if (--tweenCount <= 0) {
2233                     me.stop();
2234                 }
2235             },
2236
2237             start: function(){
2238                 if(thread === null){
2239                     thread = setInterval(me.run, me.delay);
2240                 }
2241             },
2242
2243             stop: function(tween){
2244                 if(!tween){
2245                     clearInterval(thread);
2246                     for(var i = 0, len = queue.length; i < len; ++i){
2247                         if(queue[0].isAnimated){
2248                             me.unRegister(queue[0], 0);
2249                         }
2250                     }
2251
2252                     queue = [];
2253                     thread = null;
2254                     tweenCount = 0;
2255                 }else{
2256                     me.unRegister(tween);
2257                 }
2258             },
2259
2260             run: function(){
2261                 var tf, i, len, tween;
2262                 for(i = 0, len = queue.length; i<len; i++) {
2263                     tween = queue[i];
2264                     if(tween && tween.isAnimated){
2265                         tf = tween.totalFrames;
2266                         if(tween.curFrame < tf || tf === null){
2267                             ++tween.curFrame;
2268                             if(tween.useSec){
2269                                 correctFrame(tween);
2270                             }
2271                             tween._onTween.fire();
2272                         }else{
2273                             me.stop(tween);
2274                         }
2275                     }
2276                 }
2277             }
2278         });
2279
2280         var getIndex = function(anim) {
2281             var i, len;
2282             for(i = 0, len = queue.length; i<len; i++) {
2283                 if(queue[i] === anim) {
2284                     return i;
2285                 }
2286             }
2287             return -1;
2288         };
2289
2290         var correctFrame = function(tween) {
2291             var frames = tween.totalFrames,
2292                 frame = tween.curFrame,
2293                 duration = tween.duration,
2294                 expected = (frame * duration * 1000 / frames),
2295                 elapsed = (now() - tween.startTime),
2296                 tweak = 0;
2297
2298             if(elapsed < duration * 1000){
2299                 tweak = Math.round((elapsed / expected - 1) * frame);
2300             }else{
2301                 tweak = frames - (frame + 1);
2302             }
2303             if(tweak > 0 && isFinite(tweak)){
2304                 if(tween.curFrame + tweak >= frames){
2305                     tweak = frames - (frame + 1);
2306                 }
2307                 tween.curFrame += tweak;
2308             }
2309         };
2310     };
2311
2312     EXTLIB.Bezier = new function() {
2313
2314         this.getPosition = function(points, t) {
2315             var n = points.length,
2316                 tmp = [],
2317                 c = 1 - t,
2318                 i,
2319                 j;
2320
2321             for (i = 0; i < n; ++i) {
2322                 tmp[i] = [points[i][0], points[i][1]];
2323             }
2324
2325             for (j = 1; j < n; ++j) {
2326                 for (i = 0; i < n - j; ++i) {
2327                     tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
2328                     tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
2329                 }
2330             }
2331
2332             return [ tmp[0][0], tmp[0][1] ];
2333
2334         };
2335     };
2336
2337
2338     EXTLIB.Easing = {
2339         easeNone: function (t, b, c, d) {
2340             return c * t / d + b;
2341         },
2342
2343
2344         easeIn: function (t, b, c, d) {
2345             return c * (t /= d) * t + b;
2346         },
2347
2348
2349         easeOut: function (t, b, c, d) {
2350             return -c * (t /= d) * (t - 2) + b;
2351         }
2352     };
2353
2354     (function() {
2355         EXTLIB.Motion = function(el, attributes, duration, method) {
2356             if (el) {
2357                 EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method);
2358             }
2359         };
2360
2361         Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase);
2362
2363         var superclass = EXTLIB.Motion.superclass,
2364             pointsRe = /^points$/i;
2365
2366         Ext.apply(EXTLIB.Motion.prototype, {
2367             setAttr: function(attr, val, unit){
2368                 var me = this,
2369                     setAttr = superclass.setAttr;
2370
2371                 if (pointsRe.test(attr)) {
2372                     unit = unit || 'px';
2373                     setAttr.call(me, 'left', val[0], unit);
2374                     setAttr.call(me, 'top', val[1], unit);
2375                 } else {
2376                     setAttr.call(me, attr, val, unit);
2377                 }
2378             },
2379
2380             getAttr: function(attr){
2381                 var me = this,
2382                     getAttr = superclass.getAttr;
2383
2384                 return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr);
2385             },
2386
2387             doMethod: function(attr, start, end){
2388                 var me = this;
2389
2390                 return pointsRe.test(attr)
2391                         ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100)
2392                         : superclass.doMethod.call(me, attr, start, end);
2393             },
2394
2395             setRunAttr: function(attr){
2396                 if(pointsRe.test(attr)){
2397
2398                     var me = this,
2399                         el = this.el,
2400                         points = this.attributes.points,
2401                         control = points.control || [],
2402                         from = points.from,
2403                         to = points.to,
2404                         by = points.by,
2405                         DOM = EXTLIB.Dom,
2406                         start,
2407                         i,
2408                         end,
2409                         len,
2410                         ra;
2411
2412
2413                     if(control.length > 0 && !Ext.isArray(control[0])){
2414                         control = [control];
2415                     }else{
2416                         
2417                     }
2418
2419                     Ext.fly(el, '_anim').position();
2420                     DOM.setXY(el, isset(from) ? from : DOM.getXY(el));
2421                     start = me.getAttr('points');
2422
2423
2424                     if(isset(to)){
2425                         end = translateValues.call(me, to, start);
2426                         for (i = 0,len = control.length; i < len; ++i) {
2427                             control[i] = translateValues.call(me, control[i], start);
2428                         }
2429                     } else if (isset(by)) {
2430                         end = [start[0] + by[0], start[1] + by[1]];
2431
2432                         for (i = 0,len = control.length; i < len; ++i) {
2433                             control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
2434                         }
2435                     }
2436
2437                     ra = this.runAttrs[attr] = [start];
2438                     if (control.length > 0) {
2439                         ra = ra.concat(control);
2440                     }
2441
2442                     ra[ra.length] = end;
2443                 }else{
2444                     superclass.setRunAttr.call(this, attr);
2445                 }
2446             }
2447         });
2448
2449         var translateValues = function(val, start) {
2450             var pageXY = EXTLIB.Dom.getXY(this.el);
2451             return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]];
2452         };
2453     })();
2454 })();
2455 (function(){
2456     
2457     var abs = Math.abs,
2458         pi = Math.PI,
2459         asin = Math.asin,
2460         pow = Math.pow,
2461         sin = Math.sin,
2462         EXTLIB = Ext.lib;
2463
2464     Ext.apply(EXTLIB.Easing, {
2465
2466         easeBoth: function (t, b, c, d) {
2467             return ((t /= d / 2) < 1)  ?  c / 2 * t * t + b  :  -c / 2 * ((--t) * (t - 2) - 1) + b;
2468         },
2469
2470         easeInStrong: function (t, b, c, d) {
2471             return c * (t /= d) * t * t * t + b;
2472         },
2473
2474         easeOutStrong: function (t, b, c, d) {
2475             return -c * ((t = t / d - 1) * t * t * t - 1) + b;
2476         },
2477
2478         easeBothStrong: function (t, b, c, d) {
2479             return ((t /= d / 2) < 1)  ?  c / 2 * t * t * t * t + b  :  -c / 2 * ((t -= 2) * t * t * t - 2) + b;
2480         },
2481
2482         elasticIn: function (t, b, c, d, a, p) {
2483             if (t == 0 || (t /= d) == 1) {
2484                 return t == 0 ? b : b + c;
2485             }
2486             p = p || (d * .3);
2487
2488             var s;
2489             if (a >= abs(c)) {
2490                 s = p / (2 * pi) * asin(c / a);
2491             } else {
2492                 a = c;
2493                 s = p / 4;
2494             }
2495
2496             return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
2497
2498         },
2499
2500         elasticOut: function (t, b, c, d, a, p) {
2501             if (t == 0 || (t /= d) == 1) {
2502                 return t == 0 ? b : b + c;
2503             }
2504             p = p || (d * .3);
2505
2506             var s;
2507             if (a >= abs(c)) {
2508                 s = p / (2 * pi) * asin(c / a);
2509             } else {
2510                 a = c;
2511                 s = p / 4;
2512             }
2513
2514             return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
2515         },
2516
2517         elasticBoth: function (t, b, c, d, a, p) {
2518             if (t == 0 || (t /= d / 2) == 2) {
2519                 return t == 0 ? b : b + c;
2520             }
2521
2522             p = p || (d * (.3 * 1.5));
2523
2524             var s;
2525             if (a >= abs(c)) {
2526                 s = p / (2 * pi) * asin(c / a);
2527             } else {
2528                 a = c;
2529                 s = p / 4;
2530             }
2531
2532             return t < 1 ?
2533                     -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
2534                     a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
2535         },
2536
2537         backIn: function (t, b, c, d, s) {
2538             s = s ||  1.70158;
2539             return c * (t /= d) * t * ((s + 1) * t - s) + b;
2540         },
2541
2542
2543         backOut: function (t, b, c, d, s) {
2544             if (!s) {
2545                 s = 1.70158;
2546             }
2547             return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
2548         },
2549
2550
2551         backBoth: function (t, b, c, d, s) {
2552             s = s || 1.70158;
2553
2554             return ((t /= d / 2 ) < 1) ?
2555                     c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
2556                     c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
2557         },
2558
2559
2560         bounceIn: function (t, b, c, d) {
2561             return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
2562         },
2563
2564
2565         bounceOut: function (t, b, c, d) {
2566         if ((t /= d) < (1 / 2.75)) {
2567                 return c * (7.5625 * t * t) + b;
2568             } else if (t < (2 / 2.75)) {
2569                 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
2570             } else if (t < (2.5 / 2.75)) {
2571                 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
2572             }
2573             return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
2574         },
2575
2576
2577         bounceBoth: function (t, b, c, d) {
2578             return (t < d / 2) ?
2579                     EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
2580                     EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
2581         }
2582     });
2583 })();
2584
2585 (function() {
2586     var EXTLIB = Ext.lib;
2587     
2588     EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
2589         return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
2590     }
2591
2592     EXTLIB.ColorAnim = function(el, attributes, duration, method) {
2593         EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
2594     };
2595
2596     Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
2597
2598     var superclass = EXTLIB.ColorAnim.superclass,
2599         colorRE = /color$/i,
2600         transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
2601         rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
2602         hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
2603         hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
2604         isset = function(v){
2605             return typeof v !== 'undefined';
2606         };
2607
2608     
2609     function parseColor(s) {
2610         var pi = parseInt,
2611             base,
2612             out = null,
2613             c;
2614
2615         if (s.length == 3) {
2616             return s;
2617         }
2618
2619         Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
2620             base = (idx % 2 == 0) ? 16 : 10;
2621             c = re.exec(s);
2622             if(c && c.length == 4){
2623                 out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
2624                 return false;
2625             }
2626         });
2627         return out;
2628     }
2629
2630     Ext.apply(EXTLIB.ColorAnim.prototype, {
2631         getAttr : function(attr) {
2632             var me = this,
2633                 el = me.el,
2634                 val;
2635             if(colorRE.test(attr)){
2636                 while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
2637                     el = el.parentNode;
2638                     val = "fff";
2639                 }
2640             }else{
2641                 val = superclass.getAttr.call(me, attr);
2642             }
2643             return val;
2644         },
2645
2646         doMethod : function(attr, start, end) {
2647             var me = this,
2648                 val,
2649                 floor = Math.floor,
2650                 i,
2651                 len,
2652                 v;
2653
2654             if(colorRE.test(attr)){
2655                 val = [];
2656                 end = end || [];
2657
2658                 for(i = 0, len = start.length; i < len; i++) {
2659                     v = start[i];
2660                     val[i] = superclass.doMethod.call(me, attr, v, end[i]);
2661                 }
2662                 val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
2663             }else{
2664                 val = superclass.doMethod.call(me, attr, start, end);
2665             }
2666             return val;
2667         },
2668
2669         setRunAttr : function(attr) {
2670             var me = this,
2671                 a = me.attributes[attr],
2672                 to = a.to,
2673                 by = a.by,
2674                 ra;
2675
2676             superclass.setRunAttr.call(me, attr);
2677             ra = me.runAttrs[attr];
2678             if(colorRE.test(attr)){
2679                 var start = parseColor(ra.start),
2680                     end = parseColor(ra.end);
2681
2682                 if(!isset(to) && isset(by)){
2683                     end = parseColor(by);
2684                     for(var i=0,len=start.length; i<len; i++) {
2685                         end[i] = start[i] + end[i];
2686                     }
2687                 }
2688                 ra.start = start;
2689                 ra.end = end;
2690             }
2691         }
2692     });
2693 })();
2694
2695
2696 (function() {
2697     
2698     var EXTLIB = Ext.lib;
2699     EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
2700         return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
2701     };
2702
2703     EXTLIB.Scroll = function(el, attributes, duration, method) {
2704         if(el){
2705             EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
2706         }
2707     };
2708
2709     Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
2710
2711     var superclass = EXTLIB.Scroll.superclass,
2712         SCROLL = 'scroll';
2713
2714     Ext.apply(EXTLIB.Scroll.prototype, {
2715
2716         doMethod : function(attr, start, end) {
2717             var val,
2718                 me = this,
2719                 curFrame = me.curFrame,
2720                 totalFrames = me.totalFrames;
2721
2722             if(attr == SCROLL){
2723                 val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
2724                        me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
2725             }else{
2726                 val = superclass.doMethod.call(me, attr, start, end);
2727             }
2728             return val;
2729         },
2730
2731         getAttr : function(attr) {
2732             var me = this;
2733
2734             if (attr == SCROLL) {
2735                 return [me.el.scrollLeft, me.el.scrollTop];
2736             }else{
2737                 return superclass.getAttr.call(me, attr);
2738             }
2739         },
2740
2741         setAttr : function(attr, val, unit) {
2742             var me = this;
2743
2744             if(attr == SCROLL){
2745                 me.el.scrollLeft = val[0];
2746                 me.el.scrollTop = val[1];
2747             }else{
2748                 superclass.setAttr.call(me, attr, val, unit);
2749             }
2750         }
2751     });
2752 })();   
2753         if(Ext.isIE) {
2754         function fnCleanUp() {
2755             var p = Function.prototype;
2756             delete p.createSequence;
2757             delete p.defer;
2758             delete p.createDelegate;
2759             delete p.createCallback;
2760             delete p.createInterceptor;
2761
2762             window.detachEvent("onunload", fnCleanUp);
2763         }
2764         window.attachEvent("onunload", fnCleanUp);
2765     }
2766 })();