1/***
2
3    MochiKit.MochiKit 1.4.2 : PACKED VERSION
4
5    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
6    diff against the source tree, not this file.
7
8    See <http://mochikit.com/> for documentation, downloads, license, etc.
9
10    (c) 2005 Bob Ippolito.  All rights Reserved.
11
12***/
13
14if(typeof (dojo)!="undefined"){
15dojo.provide("MochiKit.Base");
16}
17if(typeof (MochiKit)=="undefined"){
18MochiKit={};
19}
20if(typeof (MochiKit.Base)=="undefined"){
21MochiKit.Base={};
22}
23if(typeof (MochiKit.__export__)=="undefined"){
24MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
25}
26MochiKit.Base.VERSION="1.4.2";
27MochiKit.Base.NAME="MochiKit.Base";
28MochiKit.Base.update=function(_1,_2){
29if(_1===null||_1===undefined){
30_1={};
31}
32for(var i=1;i<arguments.length;i++){
33var o=arguments[i];
34if(typeof (o)!="undefined"&&o!==null){
35for(var k in o){
36_1[k]=o[k];
37}
38}
39}
40return _1;
41};
42MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
43return "["+this.NAME+" "+this.VERSION+"]";
44},toString:function(){
45return this.__repr__();
46},camelize:function(_6){
47var _7=_6.split("-");
48var cc=_7[0];
49for(var i=1;i<_7.length;i++){
50cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
51}
52return cc;
53},counter:function(n){
54if(arguments.length===0){
55n=1;
56}
57return function(){
58return n++;
59};
60},clone:function(_b){
61var me=arguments.callee;
62if(arguments.length==1){
63me.prototype=_b;
64return new me();
65}
66},_deps:function(_d,_e){
67if(!(_d in MochiKit)){
68MochiKit[_d]={};
69}
70if(typeof (dojo)!="undefined"){
71dojo.provide("MochiKit."+_d);
72}
73for(var i=0;i<_e.length;i++){
74if(typeof (dojo)!="undefined"){
75dojo.require("MochiKit."+_e[i]);
76}
77if(typeof (JSAN)!="undefined"){
78JSAN.use("MochiKit."+_e[i],[]);
79}
80if(!(_e[i] in MochiKit)){
81throw "MochiKit."+_d+" depends on MochiKit."+_e[i]+"!";
82}
83}
84},_flattenArray:function(res,lst){
85for(var i=0;i<lst.length;i++){
86var o=lst[i];
87if(o instanceof Array){
88arguments.callee(res,o);
89}else{
90res.push(o);
91}
92}
93return res;
94},flattenArray:function(lst){
95return MochiKit.Base._flattenArray([],lst);
96},flattenArguments:function(lst){
97var res=[];
98var m=MochiKit.Base;
99var _18=m.extend(null,arguments);
100while(_18.length){
101var o=_18.shift();
102if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
103for(var i=o.length-1;i>=0;i--){
104_18.unshift(o[i]);
105}
106}else{
107res.push(o);
108}
109}
110return res;
111},extend:function(_1b,obj,_1d){
112if(!_1d){
113_1d=0;
114}
115if(obj){
116var l=obj.length;
117if(typeof (l)!="number"){
118if(typeof (MochiKit.Iter)!="undefined"){
119obj=MochiKit.Iter.list(obj);
120l=obj.length;
121}else{
122throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
123}
124}
125if(!_1b){
126_1b=[];
127}
128for(var i=_1d;i<l;i++){
129_1b.push(obj[i]);
130}
131}
132return _1b;
133},updatetree:function(_20,obj){
134if(_20===null||_20===undefined){
135_20={};
136}
137for(var i=1;i<arguments.length;i++){
138var o=arguments[i];
139if(typeof (o)!="undefined"&&o!==null){
140for(var k in o){
141var v=o[k];
142if(typeof (_20[k])=="object"&&typeof (v)=="object"){
143arguments.callee(_20[k],v);
144}else{
145_20[k]=v;
146}
147}
148}
149}
150return _20;
151},setdefault:function(_26,obj){
152if(_26===null||_26===undefined){
153_26={};
154}
155for(var i=1;i<arguments.length;i++){
156var o=arguments[i];
157for(var k in o){
158if(!(k in _26)){
159_26[k]=o[k];
160}
161}
162}
163return _26;
164},keys:function(obj){
165var _2c=[];
166for(var _2d in obj){
167_2c.push(_2d);
168}
169return _2c;
170},values:function(obj){
171var _2f=[];
172for(var _30 in obj){
173_2f.push(obj[_30]);
174}
175return _2f;
176},items:function(obj){
177var _32=[];
178var e;
179for(var _34 in obj){
180var v;
181try{
182v=obj[_34];
183}
184catch(e){
185continue;
186}
187_32.push([_34,v]);
188}
189return _32;
190},_newNamedError:function(_36,_37,_38){
191_38.prototype=new MochiKit.Base.NamedError(_36.NAME+"."+_37);
192_36[_37]=_38;
193},operator:{truth:function(a){
194return !!a;
195},lognot:function(a){
196return !a;
197},identity:function(a){
198return a;
199},not:function(a){
200return ~a;
201},neg:function(a){
202return -a;
203},add:function(a,b){
204return a+b;
205},sub:function(a,b){
206return a-b;
207},div:function(a,b){
208return a/b;
209},mod:function(a,b){
210return a%b;
211},mul:function(a,b){
212return a*b;
213},and:function(a,b){
214return a&b;
215},or:function(a,b){
216return a|b;
217},xor:function(a,b){
218return a^b;
219},lshift:function(a,b){
220return a<<b;
221},rshift:function(a,b){
222return a>>b;
223},zrshift:function(a,b){
224return a>>>b;
225},eq:function(a,b){
226return a==b;
227},ne:function(a,b){
228return a!=b;
229},gt:function(a,b){
230return a>b;
231},ge:function(a,b){
232return a>=b;
233},lt:function(a,b){
234return a<b;
235},le:function(a,b){
236return a<=b;
237},seq:function(a,b){
238return a===b;
239},sne:function(a,b){
240return a!==b;
241},ceq:function(a,b){
242return MochiKit.Base.compare(a,b)===0;
243},cne:function(a,b){
244return MochiKit.Base.compare(a,b)!==0;
245},cgt:function(a,b){
246return MochiKit.Base.compare(a,b)==1;
247},cge:function(a,b){
248return MochiKit.Base.compare(a,b)!=-1;
249},clt:function(a,b){
250return MochiKit.Base.compare(a,b)==-1;
251},cle:function(a,b){
252return MochiKit.Base.compare(a,b)!=1;
253},logand:function(a,b){
254return a&&b;
255},logor:function(a,b){
256return a||b;
257},contains:function(a,b){
258return b in a;
259}},forwardCall:function(_76){
260return function(){
261return this[_76].apply(this,arguments);
262};
263},itemgetter:function(_77){
264return function(arg){
265return arg[_77];
266};
267},typeMatcher:function(){
268var _79={};
269for(var i=0;i<arguments.length;i++){
270var typ=arguments[i];
271_79[typ]=typ;
272}
273return function(){
274for(var i=0;i<arguments.length;i++){
275if(!(typeof (arguments[i]) in _79)){
276return false;
277}
278}
279return true;
280};
281},isNull:function(){
282for(var i=0;i<arguments.length;i++){
283if(arguments[i]!==null){
284return false;
285}
286}
287return true;
288},isUndefinedOrNull:function(){
289for(var i=0;i<arguments.length;i++){
290var o=arguments[i];
291if(!(typeof (o)=="undefined"||o===null)){
292return false;
293}
294}
295return true;
296},isEmpty:function(obj){
297return !MochiKit.Base.isNotEmpty.apply(this,arguments);
298},isNotEmpty:function(obj){
299for(var i=0;i<arguments.length;i++){
300var o=arguments[i];
301if(!(o&&o.length)){
302return false;
303}
304}
305return true;
306},isArrayLike:function(){
307for(var i=0;i<arguments.length;i++){
308var o=arguments[i];
309var typ=typeof (o);
310if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3||o.nodeType===4){
311return false;
312}
313}
314return true;
315},isDateLike:function(){
316for(var i=0;i<arguments.length;i++){
317var o=arguments[i];
318if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
319return false;
320}
321}
322return true;
323},xmap:function(fn){
324if(fn===null){
325return MochiKit.Base.extend(null,arguments,1);
326}
327var _8a=[];
328for(var i=1;i<arguments.length;i++){
329_8a.push(fn(arguments[i]));
330}
331return _8a;
332},map:function(fn,lst){
333var m=MochiKit.Base;
334var itr=MochiKit.Iter;
335var _90=m.isArrayLike;
336if(arguments.length<=2){
337if(!_90(lst)){
338if(itr){
339lst=itr.list(lst);
340if(fn===null){
341return lst;
342}
343}else{
344throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
345}
346}
347if(fn===null){
348return m.extend(null,lst);
349}
350var _91=[];
351for(var i=0;i<lst.length;i++){
352_91.push(fn(lst[i]));
353}
354return _91;
355}else{
356if(fn===null){
357fn=Array;
358}
359var _93=null;
360for(i=1;i<arguments.length;i++){
361if(!_90(arguments[i])){
362if(itr){
363return itr.list(itr.imap.apply(null,arguments));
364}else{
365throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
366}
367}
368var l=arguments[i].length;
369if(_93===null||_93>l){
370_93=l;
371}
372}
373_91=[];
374for(i=0;i<_93;i++){
375var _95=[];
376for(var j=1;j<arguments.length;j++){
377_95.push(arguments[j][i]);
378}
379_91.push(fn.apply(this,_95));
380}
381return _91;
382}
383},xfilter:function(fn){
384var _98=[];
385if(fn===null){
386fn=MochiKit.Base.operator.truth;
387}
388for(var i=1;i<arguments.length;i++){
389var o=arguments[i];
390if(fn(o)){
391_98.push(o);
392}
393}
394return _98;
395},filter:function(fn,lst,_9d){
396var _9e=[];
397var m=MochiKit.Base;
398if(!m.isArrayLike(lst)){
399if(MochiKit.Iter){
400lst=MochiKit.Iter.list(lst);
401}else{
402throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
403}
404}
405if(fn===null){
406fn=m.operator.truth;
407}
408if(typeof (Array.prototype.filter)=="function"){
409return Array.prototype.filter.call(lst,fn,_9d);
410}else{
411if(typeof (_9d)=="undefined"||_9d===null){
412for(var i=0;i<lst.length;i++){
413var o=lst[i];
414if(fn(o)){
415_9e.push(o);
416}
417}
418}else{
419for(i=0;i<lst.length;i++){
420o=lst[i];
421if(fn.call(_9d,o)){
422_9e.push(o);
423}
424}
425}
426}
427return _9e;
428},_wrapDumbFunction:function(_a2){
429return function(){
430switch(arguments.length){
431case 0:
432return _a2();
433case 1:
434return _a2(arguments[0]);
435case 2:
436return _a2(arguments[0],arguments[1]);
437case 3:
438return _a2(arguments[0],arguments[1],arguments[2]);
439}
440var _a3=[];
441for(var i=0;i<arguments.length;i++){
442_a3.push("arguments["+i+"]");
443}
444return eval("(func("+_a3.join(",")+"))");
445};
446},methodcaller:function(_a5){
447var _a6=MochiKit.Base.extend(null,arguments,1);
448if(typeof (_a5)=="function"){
449return function(obj){
450return _a5.apply(obj,_a6);
451};
452}else{
453return function(obj){
454return obj[_a5].apply(obj,_a6);
455};
456}
457},method:function(_a9,_aa){
458var m=MochiKit.Base;
459return m.bind.apply(this,m.extend([_aa,_a9],arguments,2));
460},compose:function(f1,f2){
461var _ae=[];
462var m=MochiKit.Base;
463if(arguments.length===0){
464throw new TypeError("compose() requires at least one argument");
465}
466for(var i=0;i<arguments.length;i++){
467var fn=arguments[i];
468if(typeof (fn)!="function"){
469throw new TypeError(m.repr(fn)+" is not a function");
470}
471_ae.push(fn);
472}
473return function(){
474var _b2=arguments;
475for(var i=_ae.length-1;i>=0;i--){
476_b2=[_ae[i].apply(this,_b2)];
477}
478return _b2[0];
479};
480},bind:function(_b4,_b5){
481if(typeof (_b4)=="string"){
482_b4=_b5[_b4];
483}
484var _b6=_b4.im_func;
485var _b7=_b4.im_preargs;
486var _b8=_b4.im_self;
487var m=MochiKit.Base;
488if(typeof (_b4)=="function"&&typeof (_b4.apply)=="undefined"){
489_b4=m._wrapDumbFunction(_b4);
490}
491if(typeof (_b6)!="function"){
492_b6=_b4;
493}
494if(typeof (_b5)!="undefined"){
495_b8=_b5;
496}
497if(typeof (_b7)=="undefined"){
498_b7=[];
499}else{
500_b7=_b7.slice();
501}
502m.extend(_b7,arguments,2);
503var _ba=function(){
504var _bb=arguments;
505var me=arguments.callee;
506if(me.im_preargs.length>0){
507_bb=m.concat(me.im_preargs,_bb);
508}
509var _bd=me.im_self;
510if(!_bd){
511_bd=this;
512}
513return me.im_func.apply(_bd,_bb);
514};
515_ba.im_self=_b8;
516_ba.im_func=_b6;
517_ba.im_preargs=_b7;
518return _ba;
519},bindLate:function(_be,_bf){
520var m=MochiKit.Base;
521if(typeof (_be)!="string"){
522return m.bind.apply(this,arguments);
523}
524var _c1=m.extend([],arguments,2);
525var _c2=function(){
526var _c3=arguments;
527var me=arguments.callee;
528if(me.im_preargs.length>0){
529_c3=m.concat(me.im_preargs,_c3);
530}
531var _c5=me.im_self;
532if(!_c5){
533_c5=this;
534}
535return _c5[me.im_func].apply(_c5,_c3);
536};
537_c2.im_self=_bf;
538_c2.im_func=_be;
539_c2.im_preargs=_c1;
540return _c2;
541},bindMethods:function(_c6){
542var _c7=MochiKit.Base.bind;
543for(var k in _c6){
544var _c9=_c6[k];
545if(typeof (_c9)=="function"){
546_c6[k]=_c7(_c9,_c6);
547}
548}
549},registerComparator:function(_ca,_cb,_cc,_cd){
550MochiKit.Base.comparatorRegistry.register(_ca,_cb,_cc,_cd);
551},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
552if(a==b){
553return 0;
554}
555var _d0=(typeof (a)=="undefined"||a===null);
556var _d1=(typeof (b)=="undefined"||b===null);
557if(_d0&&_d1){
558return 0;
559}else{
560if(_d0){
561return -1;
562}else{
563if(_d1){
564return 1;
565}
566}
567}
568var m=MochiKit.Base;
569var _d3=m._primitives;
570if(!(typeof (a) in _d3&&typeof (b) in _d3)){
571try{
572return m.comparatorRegistry.match(a,b);
573}
574catch(e){
575if(e!=m.NotFound){
576throw e;
577}
578}
579}
580if(a<b){
581return -1;
582}else{
583if(a>b){
584return 1;
585}
586}
587var _d4=m.repr;
588throw new TypeError(_d4(a)+" and "+_d4(b)+" can not be compared");
589},compareDateLike:function(a,b){
590return MochiKit.Base.compare(a.getTime(),b.getTime());
591},compareArrayLike:function(a,b){
592var _d9=MochiKit.Base.compare;
593var _da=a.length;
594var _db=0;
595if(_da>b.length){
596_db=1;
597_da=b.length;
598}else{
599if(_da<b.length){
600_db=-1;
601}
602}
603for(var i=0;i<_da;i++){
604var cmp=_d9(a[i],b[i]);
605if(cmp){
606return cmp;
607}
608}
609return _db;
610},registerRepr:function(_de,_df,_e0,_e1){
611MochiKit.Base.reprRegistry.register(_de,_df,_e0,_e1);
612},repr:function(o){
613if(typeof (o)=="undefined"){
614return "undefined";
615}else{
616if(o===null){
617return "null";
618}
619}
620try{
621if(typeof (o.__repr__)=="function"){
622return o.__repr__();
623}else{
624if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
625return o.repr();
626}
627}
628return MochiKit.Base.reprRegistry.match(o);
629}
630catch(e){
631if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
632return o.NAME;
633}
634}
635try{
636var _e3=(o+"");
637}
638catch(e){
639return "["+typeof (o)+"]";
640}
641if(typeof (o)=="function"){
642_e3=_e3.replace(/^\s+/,"").replace(/\s+/g," ");
643_e3=_e3.replace(/,(\S)/,", $1");
644var idx=_e3.indexOf("{");
645if(idx!=-1){
646_e3=_e3.substr(0,idx)+"{...}";
647}
648}
649return _e3;
650},reprArrayLike:function(o){
651var m=MochiKit.Base;
652return "["+m.map(m.repr,o).join(", ")+"]";
653},reprString:function(o){
654return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\v]/g,"\\v").replace(/[\r]/g,"\\r");
655},reprNumber:function(o){
656return o+"";
657},registerJSON:function(_e9,_ea,_eb,_ec){
658MochiKit.Base.jsonRegistry.register(_e9,_ea,_eb,_ec);
659},evalJSON:function(){
660return eval("("+MochiKit.Base._filterJSON(arguments[0])+")");
661},_filterJSON:function(s){
662var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
663if(m){
664return m[1];
665}
666return s;
667},serializeJSON:function(o){
668var _f0=typeof (o);
669if(_f0=="number"||_f0=="boolean"){
670return o+"";
671}else{
672if(o===null){
673return "null";
674}else{
675if(_f0=="string"){
676var res="";
677for(var i=0;i<o.length;i++){
678var c=o.charAt(i);
679if(c=="\""){
680res+="\\\"";
681}else{
682if(c=="\\"){
683res+="\\\\";
684}else{
685if(c=="\b"){
686res+="\\b";
687}else{
688if(c=="\f"){
689res+="\\f";
690}else{
691if(c=="\n"){
692res+="\\n";
693}else{
694if(c=="\r"){
695res+="\\r";
696}else{
697if(c=="\t"){
698res+="\\t";
699}else{
700if(o.charCodeAt(i)<=31){
701var hex=o.charCodeAt(i).toString(16);
702if(hex.length<2){
703hex="0"+hex;
704}
705res+="\\u00"+hex.toUpperCase();
706}else{
707res+=c;
708}
709}
710}
711}
712}
713}
714}
715}
716}
717return "\""+res+"\"";
718}
719}
720}
721var me=arguments.callee;
722var _f6;
723if(typeof (o.__json__)=="function"){
724_f6=o.__json__();
725if(o!==_f6){
726return me(_f6);
727}
728}
729if(typeof (o.json)=="function"){
730_f6=o.json();
731if(o!==_f6){
732return me(_f6);
733}
734}
735if(_f0!="function"&&typeof (o.length)=="number"){
736var res=[];
737for(var i=0;i<o.length;i++){
738var val=me(o[i]);
739if(typeof (val)!="string"){
740continue;
741}
742res.push(val);
743}
744return "["+res.join(", ")+"]";
745}
746var m=MochiKit.Base;
747try{
748_f6=m.jsonRegistry.match(o);
749if(o!==_f6){
750return me(_f6);
751}
752}
753catch(e){
754if(e!=m.NotFound){
755throw e;
756}
757}
758if(_f0=="undefined"){
759throw new TypeError("undefined can not be serialized as JSON");
760}
761if(_f0=="function"){
762return null;
763}
764res=[];
765for(var k in o){
766var _fa;
767if(typeof (k)=="number"){
768_fa="\""+k+"\"";
769}else{
770if(typeof (k)=="string"){
771_fa=me(k);
772}else{
773continue;
774}
775}
776val=me(o[k]);
777if(typeof (val)!="string"){
778continue;
779}
780res.push(_fa+":"+val);
781}
782return "{"+res.join(", ")+"}";
783},objEqual:function(a,b){
784return (MochiKit.Base.compare(a,b)===0);
785},arrayEqual:function(_fd,arr){
786if(_fd.length!=arr.length){
787return false;
788}
789return (MochiKit.Base.compare(_fd,arr)===0);
790},concat:function(){
791var _ff=[];
792var _100=MochiKit.Base.extend;
793for(var i=0;i<arguments.length;i++){
794_100(_ff,arguments[i]);
795}
796return _ff;
797},keyComparator:function(key){
798var m=MochiKit.Base;
799var _104=m.compare;
800if(arguments.length==1){
801return function(a,b){
802return _104(a[key],b[key]);
803};
804}
805var _107=m.extend(null,arguments);
806return function(a,b){
807var rval=0;
808for(var i=0;(rval===0)&&(i<_107.length);i++){
809var key=_107[i];
810rval=_104(a[key],b[key]);
811}
812return rval;
813};
814},reverseKeyComparator:function(key){
815var _10e=MochiKit.Base.keyComparator.apply(this,arguments);
816return function(a,b){
817return _10e(b,a);
818};
819},partial:function(func){
820var m=MochiKit.Base;
821return m.bind.apply(this,m.extend([func,undefined],arguments,1));
822},listMinMax:function(_113,lst){
823if(lst.length===0){
824return null;
825}
826var cur=lst[0];
827var _116=MochiKit.Base.compare;
828for(var i=1;i<lst.length;i++){
829var o=lst[i];
830if(_116(o,cur)==_113){
831cur=o;
832}
833}
834return cur;
835},objMax:function(){
836return MochiKit.Base.listMinMax(1,arguments);
837},objMin:function(){
838return MochiKit.Base.listMinMax(-1,arguments);
839},findIdentical:function(lst,_11a,_11b,end){
840if(typeof (end)=="undefined"||end===null){
841end=lst.length;
842}
843if(typeof (_11b)=="undefined"||_11b===null){
844_11b=0;
845}
846for(var i=_11b;i<end;i++){
847if(lst[i]===_11a){
848return i;
849}
850}
851return -1;
852},mean:function(){
853var sum=0;
854var m=MochiKit.Base;
855var args=m.extend(null,arguments);
856var _121=args.length;
857while(args.length){
858var o=args.shift();
859if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
860_121+=o.length-1;
861for(var i=o.length-1;i>=0;i--){
862sum+=o[i];
863}
864}else{
865sum+=o;
866}
867}
868if(_121<=0){
869throw new TypeError("mean() requires at least one argument");
870}
871return sum/_121;
872},median:function(){
873var data=MochiKit.Base.flattenArguments(arguments);
874if(data.length===0){
875throw new TypeError("median() requires at least one argument");
876}
877data.sort(compare);
878if(data.length%2==0){
879var _125=data.length/2;
880return (data[_125]+data[_125-1])/2;
881}else{
882return data[(data.length-1)/2];
883}
884},findValue:function(lst,_127,_128,end){
885if(typeof (end)=="undefined"||end===null){
886end=lst.length;
887}
888if(typeof (_128)=="undefined"||_128===null){
889_128=0;
890}
891var cmp=MochiKit.Base.compare;
892for(var i=_128;i<end;i++){
893if(cmp(lst[i],_127)===0){
894return i;
895}
896}
897return -1;
898},nodeWalk:function(node,_12d){
899var _12e=[node];
900var _12f=MochiKit.Base.extend;
901while(_12e.length){
902var res=_12d(_12e.shift());
903if(res){
904_12f(_12e,res);
905}
906}
907},nameFunctions:function(_131){
908var base=_131.NAME;
909if(typeof (base)=="undefined"){
910base="";
911}else{
912base=base+".";
913}
914for(var name in _131){
915var o=_131[name];
916if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
917try{
918o.NAME=base+name;
919}
920catch(e){
921}
922}
923}
924},queryString:function(_135,_136){
925if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_135)=="string"||(typeof (_135.nodeType)!="undefined"&&_135.nodeType>0))){
926var kv=MochiKit.DOM.formContents(_135);
927_135=kv[0];
928_136=kv[1];
929}else{
930if(arguments.length==1){
931if(typeof (_135.length)=="number"&&_135.length==2){
932return arguments.callee(_135[0],_135[1]);
933}
934var o=_135;
935_135=[];
936_136=[];
937for(var k in o){
938var v=o[k];
939if(typeof (v)=="function"){
940continue;
941}else{
942if(MochiKit.Base.isArrayLike(v)){
943for(var i=0;i<v.length;i++){
944_135.push(k);
945_136.push(v[i]);
946}
947}else{
948_135.push(k);
949_136.push(v);
950}
951}
952}
953}
954}
955var rval=[];
956var len=Math.min(_135.length,_136.length);
957var _13e=MochiKit.Base.urlEncode;
958for(var i=0;i<len;i++){
959v=_136[i];
960if(typeof (v)!="undefined"&&v!==null){
961rval.push(_13e(_135[i])+"="+_13e(v));
962}
963}
964return rval.join("&");
965},parseQueryString:function(_13f,_140){
966var qstr=(_13f.charAt(0)=="?")?_13f.substring(1):_13f;
967var _142=qstr.replace(/\+/g,"%20").split(/\&amp\;|\&\#38\;|\&#x26;|\&/);
968var o={};
969var _144;
970if(typeof (decodeURIComponent)!="undefined"){
971_144=decodeURIComponent;
972}else{
973_144=unescape;
974}
975if(_140){
976for(var i=0;i<_142.length;i++){
977var pair=_142[i].split("=");
978var name=_144(pair.shift());
979if(!name){
980continue;
981}
982var arr=o[name];
983if(!(arr instanceof Array)){
984arr=[];
985o[name]=arr;
986}
987arr.push(_144(pair.join("=")));
988}
989}else{
990for(i=0;i<_142.length;i++){
991pair=_142[i].split("=");
992var name=pair.shift();
993if(!name){
994continue;
995}
996o[_144(name)]=_144(pair.join("="));
997}
998}
999return o;
1000}});
1001MochiKit.Base.AdapterRegistry=function(){
1002this.pairs=[];
1003};
1004MochiKit.Base.AdapterRegistry.prototype={register:function(name,_14a,wrap,_14c){
1005if(_14c){
1006this.pairs.unshift([name,_14a,wrap]);
1007}else{
1008this.pairs.push([name,_14a,wrap]);
1009}
1010},match:function(){
1011for(var i=0;i<this.pairs.length;i++){
1012var pair=this.pairs[i];
1013if(pair[1].apply(this,arguments)){
1014return pair[2].apply(this,arguments);
1015}
1016}
1017throw MochiKit.Base.NotFound;
1018},unregister:function(name){
1019for(var i=0;i<this.pairs.length;i++){
1020var pair=this.pairs[i];
1021if(pair[0]==name){
1022this.pairs.splice(i,1);
1023return true;
1024}
1025}
1026return false;
1027}};
1028MochiKit.Base.EXPORT=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindLate","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"];
1029MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
1030MochiKit.Base._exportSymbols=function(_152,_153){
1031if(!MochiKit.__export__){
1032return;
1033}
1034var all=_153.EXPORT_TAGS[":all"];
1035for(var i=0;i<all.length;i++){
1036_152[all[i]]=_153[all[i]];
1037}
1038};
1039MochiKit.Base.__new__=function(){
1040var m=this;
1041m.noop=m.operator.identity;
1042m.forward=m.forwardCall;
1043m.find=m.findValue;
1044if(typeof (encodeURIComponent)!="undefined"){
1045m.urlEncode=function(_157){
1046return encodeURIComponent(_157).replace(/\'/g,"%27");
1047};
1048}else{
1049m.urlEncode=function(_158){
1050return escape(_158).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
1051};
1052}
1053m.NamedError=function(name){
1054this.message=name;
1055this.name=name;
1056};
1057m.NamedError.prototype=new Error();
1058m.update(m.NamedError.prototype,{repr:function(){
1059if(this.message&&this.message!=this.name){
1060return this.name+"("+m.repr(this.message)+")";
1061}else{
1062return this.name+"()";
1063}
1064},toString:m.forwardCall("repr")});
1065m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
1066m.listMax=m.partial(m.listMinMax,1);
1067m.listMin=m.partial(m.listMinMax,-1);
1068m.isCallable=m.typeMatcher("function");
1069m.isUndefined=m.typeMatcher("undefined");
1070m.merge=m.partial(m.update,null);
1071m.zip=m.partial(m.map,null);
1072m.average=m.mean;
1073m.comparatorRegistry=new m.AdapterRegistry();
1074m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
1075m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
1076m.reprRegistry=new m.AdapterRegistry();
1077m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
1078m.registerRepr("string",m.typeMatcher("string"),m.reprString);
1079m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
1080m.jsonRegistry=new m.AdapterRegistry();
1081var all=m.concat(m.EXPORT,m.EXPORT_OK);
1082m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
1083m.nameFunctions(this);
1084};
1085MochiKit.Base.__new__();
1086if(MochiKit.__export__){
1087compare=MochiKit.Base.compare;
1088compose=MochiKit.Base.compose;
1089serializeJSON=MochiKit.Base.serializeJSON;
1090mean=MochiKit.Base.mean;
1091median=MochiKit.Base.median;
1092}
1093MochiKit.Base._exportSymbols(this,MochiKit.Base);
1094MochiKit.Base._deps("Iter",["Base"]);
1095MochiKit.Iter.NAME="MochiKit.Iter";
1096MochiKit.Iter.VERSION="1.4.2";
1097MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
1098return "["+this.NAME+" "+this.VERSION+"]";
1099},toString:function(){
1100return this.__repr__();
1101},registerIteratorFactory:function(name,_15c,_15d,_15e){
1102MochiKit.Iter.iteratorRegistry.register(name,_15c,_15d,_15e);
1103},isIterable:function(o){
1104return o!=null&&(typeof (o.next)=="function"||typeof (o.iter)=="function");
1105},iter:function(_160,_161){
1106var self=MochiKit.Iter;
1107if(arguments.length==2){
1108return self.takewhile(function(a){
1109return a!=_161;
1110},_160);
1111}
1112if(typeof (_160.next)=="function"){
1113return _160;
1114}else{
1115if(typeof (_160.iter)=="function"){
1116return _160.iter();
1117}
1118}
1119try{
1120return self.iteratorRegistry.match(_160);
1121}
1122catch(e){
1123var m=MochiKit.Base;
1124if(e==m.NotFound){
1125e=new TypeError(typeof (_160)+": "+m.repr(_160)+" is not iterable");
1126}
1127throw e;
1128}
1129},count:function(n){
1130if(!n){
1131n=0;
1132}
1133var m=MochiKit.Base;
1134return {repr:function(){
1135return "count("+n+")";
1136},toString:m.forwardCall("repr"),next:m.counter(n)};
1137},cycle:function(p){
1138var self=MochiKit.Iter;
1139var m=MochiKit.Base;
1140var lst=[];
1141var _16b=self.iter(p);
1142return {repr:function(){
1143return "cycle(...)";
1144},toString:m.forwardCall("repr"),next:function(){
1145try{
1146var rval=_16b.next();
1147lst.push(rval);
1148return rval;
1149}
1150catch(e){
1151if(e!=self.StopIteration){
1152throw e;
1153}
1154if(lst.length===0){
1155this.next=function(){
1156throw self.StopIteration;
1157};
1158}else{
1159var i=-1;
1160this.next=function(){
1161i=(i+1)%lst.length;
1162return lst[i];
1163};
1164}
1165return this.next();
1166}
1167}};
1168},repeat:function(elem,n){
1169var m=MochiKit.Base;
1170if(typeof (n)=="undefined"){
1171return {repr:function(){
1172return "repeat("+m.repr(elem)+")";
1173},toString:m.forwardCall("repr"),next:function(){
1174return elem;
1175}};
1176}
1177return {repr:function(){
1178return "repeat("+m.repr(elem)+", "+n+")";
1179},toString:m.forwardCall("repr"),next:function(){
1180if(n<=0){
1181throw MochiKit.Iter.StopIteration;
1182}
1183n-=1;
1184return elem;
1185}};
1186},next:function(_171){
1187return _171.next();
1188},izip:function(p,q){
1189var m=MochiKit.Base;
1190var self=MochiKit.Iter;
1191var next=self.next;
1192var _177=m.map(self.iter,arguments);
1193return {repr:function(){
1194return "izip(...)";
1195},toString:m.forwardCall("repr"),next:function(){
1196return m.map(next,_177);
1197}};
1198},ifilter:function(pred,seq){
1199var m=MochiKit.Base;
1200seq=MochiKit.Iter.iter(seq);
1201if(pred===null){
1202pred=m.operator.truth;
1203}
1204return {repr:function(){
1205return "ifilter(...)";
1206},toString:m.forwardCall("repr"),next:function(){
1207while(true){
1208var rval=seq.next();
1209if(pred(rval)){
1210return rval;
1211}
1212}
1213return undefined;
1214}};
1215},ifilterfalse:function(pred,seq){
1216var m=MochiKit.Base;
1217seq=MochiKit.Iter.iter(seq);
1218if(pred===null){
1219pred=m.operator.truth;
1220}
1221return {repr:function(){
1222return "ifilterfalse(...)";
1223},toString:m.forwardCall("repr"),next:function(){
1224while(true){
1225var rval=seq.next();
1226if(!pred(rval)){
1227return rval;
1228}
1229}
1230return undefined;
1231}};
1232},islice:function(seq){
1233var self=MochiKit.Iter;
1234var m=MochiKit.Base;
1235seq=self.iter(seq);
1236var _183=0;
1237var stop=0;
1238var step=1;
1239var i=-1;
1240if(arguments.length==2){
1241stop=arguments[1];
1242}else{
1243if(arguments.length==3){
1244_183=arguments[1];
1245stop=arguments[2];
1246}else{
1247_183=arguments[1];
1248stop=arguments[2];
1249step=arguments[3];
1250}
1251}
1252return {repr:function(){
1253return "islice("+["...",_183,stop,step].join(", ")+")";
1254},toString:m.forwardCall("repr"),next:function(){
1255var rval;
1256while(i<_183){
1257rval=seq.next();
1258i++;
1259}
1260if(_183>=stop){
1261throw self.StopIteration;
1262}
1263_183+=step;
1264return rval;
1265}};
1266},imap:function(fun,p,q){
1267var m=MochiKit.Base;
1268var self=MochiKit.Iter;
1269var _18d=m.map(self.iter,m.extend(null,arguments,1));
1270var map=m.map;
1271var next=self.next;
1272return {repr:function(){
1273return "imap(...)";
1274},toString:m.forwardCall("repr"),next:function(){
1275return fun.apply(this,map(next,_18d));
1276}};
1277},applymap:function(fun,seq,self){
1278seq=MochiKit.Iter.iter(seq);
1279var m=MochiKit.Base;
1280return {repr:function(){
1281return "applymap(...)";
1282},toString:m.forwardCall("repr"),next:function(){
1283return fun.apply(self,seq.next());
1284}};
1285},chain:function(p,q){
1286var self=MochiKit.Iter;
1287var m=MochiKit.Base;
1288if(arguments.length==1){
1289return self.iter(arguments[0]);
1290}
1291var _198=m.map(self.iter,arguments);
1292return {repr:function(){
1293return "chain(...)";
1294},toString:m.forwardCall("repr"),next:function(){
1295while(_198.length>1){
1296try{
1297var _199=_198[0].next();
1298return _199;
1299}
1300catch(e){
1301if(e!=self.StopIteration){
1302throw e;
1303}
1304_198.shift();
1305var _199=_198[0].next();
1306return _199;
1307}
1308}
1309if(_198.length==1){
1310var arg=_198.shift();
1311this.next=m.bind("next",arg);
1312return this.next();
1313}
1314throw self.StopIteration;
1315}};
1316},takewhile:function(pred,seq){
1317var self=MochiKit.Iter;
1318seq=self.iter(seq);
1319return {repr:function(){
1320return "takewhile(...)";
1321},toString:MochiKit.Base.forwardCall("repr"),next:function(){
1322var rval=seq.next();
1323if(!pred(rval)){
1324this.next=function(){
1325throw self.StopIteration;
1326};
1327this.next();
1328}
1329return rval;
1330}};
1331},dropwhile:function(pred,seq){
1332seq=MochiKit.Iter.iter(seq);
1333var m=MochiKit.Base;
1334var bind=m.bind;
1335return {"repr":function(){
1336return "dropwhile(...)";
1337},"toString":m.forwardCall("repr"),"next":function(){
1338while(true){
1339var rval=seq.next();
1340if(!pred(rval)){
1341break;
1342}
1343}
1344this.next=bind("next",seq);
1345return rval;
1346}};
1347},_tee:function(_1a4,sync,_1a6){
1348sync.pos[_1a4]=-1;
1349var m=MochiKit.Base;
1350var _1a8=m.listMin;
1351return {repr:function(){
1352return "tee("+_1a4+", ...)";
1353},toString:m.forwardCall("repr"),next:function(){
1354var rval;
1355var i=sync.pos[_1a4];
1356if(i==sync.max){
1357rval=_1a6.next();
1358sync.deque.push(rval);
1359sync.max+=1;
1360sync.pos[_1a4]+=1;
1361}else{
1362rval=sync.deque[i-sync.min];
1363sync.pos[_1a4]+=1;
1364if(i==sync.min&&_1a8(sync.pos)!=sync.min){
1365sync.min+=1;
1366sync.deque.shift();
1367}
1368}
1369return rval;
1370}};
1371},tee:function(_1ab,n){
1372var rval=[];
1373var sync={"pos":[],"deque":[],"max":-1,"min":-1};
1374if(arguments.length==1||typeof (n)=="undefined"||n===null){
1375n=2;
1376}
1377var self=MochiKit.Iter;
1378_1ab=self.iter(_1ab);
1379var _tee=self._tee;
1380for(var i=0;i<n;i++){
1381rval.push(_tee(i,sync,_1ab));
1382}
1383return rval;
1384},list:function(_1b2){
1385var rval;
1386if(_1b2 instanceof Array){
1387return _1b2.slice();
1388}
1389if(typeof (_1b2)=="function"&&!(_1b2 instanceof Function)&&typeof (_1b2.length)=="number"){
1390rval=[];
1391for(var i=0;i<_1b2.length;i++){
1392rval.push(_1b2[i]);
1393}
1394return rval;
1395}
1396var self=MochiKit.Iter;
1397_1b2=self.iter(_1b2);
1398var rval=[];
1399var _1b6;
1400try{
1401while(true){
1402_1b6=_1b2.next();
1403rval.push(_1b6);
1404}
1405}
1406catch(e){
1407if(e!=self.StopIteration){
1408throw e;
1409}
1410return rval;
1411}
1412return undefined;
1413},reduce:function(fn,_1b8,_1b9){
1414var i=0;
1415var x=_1b9;
1416var self=MochiKit.Iter;
1417_1b8=self.iter(_1b8);
1418if(arguments.length<3){
1419try{
1420x=_1b8.next();
1421}
1422catch(e){
1423if(e==self.StopIteration){
1424e=new TypeError("reduce() of empty sequence with no initial value");
1425}
1426throw e;
1427}
1428i++;
1429}
1430try{
1431while(true){
1432x=fn(x,_1b8.next());
1433}
1434}
1435catch(e){
1436if(e!=self.StopIteration){
1437throw e;
1438}
1439}
1440return x;
1441},range:function(){
1442var _1bd=0;
1443var stop=0;
1444var step=1;
1445if(arguments.length==1){
1446stop=arguments[0];
1447}else{
1448if(arguments.length==2){
1449_1bd=arguments[0];
1450stop=arguments[1];
1451}else{
1452if(arguments.length==3){
1453_1bd=arguments[0];
1454stop=arguments[1];
1455step=arguments[2];
1456}else{
1457throw new TypeError("range() takes 1, 2, or 3 arguments!");
1458}
1459}
1460}
1461if(step===0){
1462throw new TypeError("range() step must not be 0");
1463}
1464return {next:function(){
1465if((step>0&&_1bd>=stop)||(step<0&&_1bd<=stop)){
1466throw MochiKit.Iter.StopIteration;
1467}
1468var rval=_1bd;
1469_1bd+=step;
1470return rval;
1471},repr:function(){
1472return "range("+[_1bd,stop,step].join(", ")+")";
1473},toString:MochiKit.Base.forwardCall("repr")};
1474},sum:function(_1c1,_1c2){
1475if(typeof (_1c2)=="undefined"||_1c2===null){
1476_1c2=0;
1477}
1478var x=_1c2;
1479var self=MochiKit.Iter;
1480_1c1=self.iter(_1c1);
1481try{
1482while(true){
1483x+=_1c1.next();
1484}
1485}
1486catch(e){
1487if(e!=self.StopIteration){
1488throw e;
1489}
1490}
1491return x;
1492},exhaust:function(_1c5){
1493var self=MochiKit.Iter;
1494_1c5=self.iter(_1c5);
1495try{
1496while(true){
1497_1c5.next();
1498}
1499}
1500catch(e){
1501if(e!=self.StopIteration){
1502throw e;
1503}
1504}
1505},forEach:function(_1c7,func,obj){
1506var m=MochiKit.Base;
1507var self=MochiKit.Iter;
1508if(arguments.length>2){
1509func=m.bind(func,obj);
1510}
1511if(m.isArrayLike(_1c7)&&!self.isIterable(_1c7)){
1512try{
1513for(var i=0;i<_1c7.length;i++){
1514func(_1c7[i]);
1515}
1516}
1517catch(e){
1518if(e!=self.StopIteration){
1519throw e;
1520}
1521}
1522}else{
1523self.exhaust(self.imap(func,_1c7));
1524}
1525},every:function(_1cd,func){
1526var self=MochiKit.Iter;
1527try{
1528self.ifilterfalse(func,_1cd).next();
1529return false;
1530}
1531catch(e){
1532if(e!=self.StopIteration){
1533throw e;
1534}
1535return true;
1536}
1537},sorted:function(_1d0,cmp){
1538var rval=MochiKit.Iter.list(_1d0);
1539if(arguments.length==1){
1540cmp=MochiKit.Base.compare;
1541}
1542rval.sort(cmp);
1543return rval;
1544},reversed:function(_1d3){
1545var rval=MochiKit.Iter.list(_1d3);
1546rval.reverse();
1547return rval;
1548},some:function(_1d5,func){
1549var self=MochiKit.Iter;
1550try{
1551self.ifilter(func,_1d5).next();
1552return true;
1553}
1554catch(e){
1555if(e!=self.StopIteration){
1556throw e;
1557}
1558return false;
1559}
1560},iextend:function(lst,_1d9){
1561var m=MochiKit.Base;
1562var self=MochiKit.Iter;
1563if(m.isArrayLike(_1d9)&&!self.isIterable(_1d9)){
1564for(var i=0;i<_1d9.length;i++){
1565lst.push(_1d9[i]);
1566}
1567}else{
1568_1d9=self.iter(_1d9);
1569try{
1570while(true){
1571lst.push(_1d9.next());
1572}
1573}
1574catch(e){
1575if(e!=self.StopIteration){
1576throw e;
1577}
1578}
1579}
1580return lst;
1581},groupby:function(_1dd,_1de){
1582var m=MochiKit.Base;
1583var self=MochiKit.Iter;
1584if(arguments.length<2){
1585_1de=m.operator.identity;
1586}
1587_1dd=self.iter(_1dd);
1588var pk=undefined;
1589var k=undefined;
1590var v;
1591function fetch(){
1592v=_1dd.next();
1593k=_1de(v);
1594}
1595function eat(){
1596var ret=v;
1597v=undefined;
1598return ret;
1599}
1600var _1e5=true;
1601var _1e6=m.compare;
1602return {repr:function(){
1603return "groupby(...)";
1604},next:function(){
1605while(_1e6(k,pk)===0){
1606fetch();
1607if(_1e5){
1608_1e5=false;
1609break;
1610}
1611}
1612pk=k;
1613return [k,{next:function(){
1614if(v==undefined){
1615fetch();
1616}
1617if(_1e6(k,pk)!==0){
1618throw self.StopIteration;
1619}
1620return eat();
1621}}];
1622}};
1623},groupby_as_array:function(_1e7,_1e8){
1624var m=MochiKit.Base;
1625var self=MochiKit.Iter;
1626if(arguments.length<2){
1627_1e8=m.operator.identity;
1628}
1629_1e7=self.iter(_1e7);
1630var _1eb=[];
1631var _1ec=true;
1632var _1ed;
1633var _1ee=m.compare;
1634while(true){
1635try{
1636var _1ef=_1e7.next();
1637var key=_1e8(_1ef);
1638}
1639catch(e){
1640if(e==self.StopIteration){
1641break;
1642}
1643throw e;
1644}
1645if(_1ec||_1ee(key,_1ed)!==0){
1646var _1f1=[];
1647_1eb.push([key,_1f1]);
1648}
1649_1f1.push(_1ef);
1650_1ec=false;
1651_1ed=key;
1652}
1653return _1eb;
1654},arrayLikeIter:function(_1f2){
1655var i=0;
1656return {repr:function(){
1657return "arrayLikeIter(...)";
1658},toString:MochiKit.Base.forwardCall("repr"),next:function(){
1659if(i>=_1f2.length){
1660throw MochiKit.Iter.StopIteration;
1661}
1662return _1f2[i++];
1663}};
1664},hasIterateNext:function(_1f4){
1665return (_1f4&&typeof (_1f4.iterateNext)=="function");
1666},iterateNextIter:function(_1f5){
1667return {repr:function(){
1668return "iterateNextIter(...)";
1669},toString:MochiKit.Base.forwardCall("repr"),next:function(){
1670var rval=_1f5.iterateNext();
1671if(rval===null||rval===undefined){
1672throw MochiKit.Iter.StopIteration;
1673}
1674return rval;
1675}};
1676}});
1677MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter"];
1678MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"];
1679MochiKit.Iter.__new__=function(){
1680var m=MochiKit.Base;
1681if(typeof (StopIteration)!="undefined"){
1682this.StopIteration=StopIteration;
1683}else{
1684this.StopIteration=new m.NamedError("StopIteration");
1685}
1686this.iteratorRegistry=new m.AdapterRegistry();
1687this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
1688this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
1689this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
1690m.nameFunctions(this);
1691};
1692MochiKit.Iter.__new__();
1693if(MochiKit.__export__){
1694reduce=MochiKit.Iter.reduce;
1695}
1696MochiKit.Base._exportSymbols(this,MochiKit.Iter);
1697MochiKit.Base._deps("Logging",["Base"]);
1698MochiKit.Logging.NAME="MochiKit.Logging";
1699MochiKit.Logging.VERSION="1.4.2";
1700MochiKit.Logging.__repr__=function(){
1701return "["+this.NAME+" "+this.VERSION+"]";
1702};
1703MochiKit.Logging.toString=function(){
1704return this.__repr__();
1705};
1706MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"];
1707MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"];
1708MochiKit.Logging.LogMessage=function(num,_1f9,info){
1709this.num=num;
1710this.level=_1f9;
1711this.info=info;
1712this.timestamp=new Date();
1713};
1714MochiKit.Logging.LogMessage.prototype={repr:function(){
1715var m=MochiKit.Base;
1716return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")";
1717},toString:MochiKit.Base.forwardCall("repr")};
1718MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1fc){
1719var self=MochiKit.Logging;
1720if(typeof (_1fc)=="string"){
1721_1fc=self.LogLevel[_1fc];
1722}
1723return function(msg){
1724var _1ff=msg.level;
1725if(typeof (_1ff)=="string"){
1726_1ff=self.LogLevel[_1ff];
1727}
1728return _1ff>=_1fc;
1729};
1730},isLogMessage:function(){
1731var _200=MochiKit.Logging.LogMessage;
1732for(var i=0;i<arguments.length;i++){
1733if(!(arguments[i] instanceof _200)){
1734return false;
1735}
1736}
1737return true;
1738},compareLogMessage:function(a,b){
1739return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
1740},alertListener:function(msg){
1741alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" "));
1742}});
1743MochiKit.Logging.Logger=function(_205){
1744this.counter=0;
1745if(typeof (_205)=="undefined"||_205===null){
1746_205=-1;
1747}
1748this.maxSize=_205;
1749this._messages=[];
1750this.listeners={};
1751this.useNativeConsole=false;
1752};
1753MochiKit.Logging.Logger.prototype={clear:function(){
1754this._messages.splice(0,this._messages.length);
1755},logToConsole:function(msg){
1756if(typeof (window)!="undefined"&&window.console&&window.console.log){
1757window.console.log(msg.replace(/%/g,"\uff05"));
1758}else{
1759if(typeof (opera)!="undefined"&&opera.postError){
1760opera.postError(msg);
1761}else{
1762if(typeof (printfire)=="function"){
1763printfire(msg);
1764}else{
1765if(typeof (Debug)!="undefined"&&Debug.writeln){
1766Debug.writeln(msg);
1767}else{
1768if(typeof (debug)!="undefined"&&debug.trace){
1769debug.trace(msg);
1770}
1771}
1772}
1773}
1774}
1775},dispatchListeners:function(msg){
1776for(var k in this.listeners){
1777var pair=this.listeners[k];
1778if(pair.ident!=k||(pair[0]&&!pair[0](msg))){
1779continue;
1780}
1781pair[1](msg);
1782}
1783},addListener:function(_20a,_20b,_20c){
1784if(typeof (_20b)=="string"){
1785_20b=MochiKit.Logging.logLevelAtLeast(_20b);
1786}
1787var _20d=[_20b,_20c];
1788_20d.ident=_20a;
1789this.listeners[_20a]=_20d;
1790},removeListener:function(_20e){
1791delete this.listeners[_20e];
1792},baseLog:function(_20f,_210){
1793if(typeof (_20f)=="number"){
1794if(_20f>=MochiKit.Logging.LogLevel.FATAL){
1795_20f="FATAL";
1796}else{
1797if(_20f>=MochiKit.Logging.LogLevel.ERROR){
1798_20f="ERROR";
1799}else{
1800if(_20f>=MochiKit.Logging.LogLevel.WARNING){
1801_20f="WARNING";
1802}else{
1803if(_20f>=MochiKit.Logging.LogLevel.INFO){
1804_20f="INFO";
1805}else{
1806_20f="DEBUG";
1807}
1808}
1809}
1810}
1811}
1812var msg=new MochiKit.Logging.LogMessage(this.counter,_20f,MochiKit.Base.extend(null,arguments,1));
1813this._messages.push(msg);
1814this.dispatchListeners(msg);
1815if(this.useNativeConsole){
1816this.logToConsole(msg.level+": "+msg.info.join(" "));
1817}
1818this.counter+=1;
1819while(this.maxSize>=0&&this._messages.length>this.maxSize){
1820this._messages.shift();
1821}
1822},getMessages:function(_212){
1823var _213=0;
1824if(!(typeof (_212)=="undefined"||_212===null)){
1825_213=Math.max(0,this._messages.length-_212);
1826}
1827return this._messages.slice(_213);
1828},getMessageText:function(_214){
1829if(typeof (_214)=="undefined"||_214===null){
1830_214=30;
1831}
1832var _215=this.getMessages(_214);
1833if(_215.length){
1834var lst=map(function(m){
1835return "\n  ["+m.num+"] "+m.level+": "+m.info.join(" ");
1836},_215);
1837lst.unshift("LAST "+_215.length+" MESSAGES:");
1838return lst.join("");
1839}
1840return "";
1841},debuggingBookmarklet:function(_218){
1842if(typeof (MochiKit.LoggingPane)=="undefined"){
1843alert(this.getMessageText());
1844}else{
1845MochiKit.LoggingPane.createLoggingPane(_218||false);
1846}
1847}};
1848MochiKit.Logging.__new__=function(){
1849this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
1850var m=MochiKit.Base;
1851m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
1852var _21a=m.partial;
1853var _21b=this.Logger;
1854var _21c=_21b.prototype.baseLog;
1855m.update(this.Logger.prototype,{debug:_21a(_21c,"DEBUG"),log:_21a(_21c,"INFO"),error:_21a(_21c,"ERROR"),fatal:_21a(_21c,"FATAL"),warning:_21a(_21c,"WARNING")});
1856var self=this;
1857var _21e=function(name){
1858return function(){
1859self.logger[name].apply(self.logger,arguments);
1860};
1861};
1862this.log=_21e("log");
1863this.logError=_21e("error");
1864this.logDebug=_21e("debug");
1865this.logFatal=_21e("fatal");
1866this.logWarning=_21e("warning");
1867this.logger=new _21b();
1868this.logger.useNativeConsole=true;
1869this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
1870m.nameFunctions(this);
1871};
1872if(typeof (printfire)=="undefined"&&typeof (document)!="undefined"&&document.createEvent&&typeof (dispatchEvent)!="undefined"){
1873printfire=function(){
1874printfire.args=arguments;
1875var ev=document.createEvent("Events");
1876ev.initEvent("printfire",false,true);
1877dispatchEvent(ev);
1878};
1879}
1880MochiKit.Logging.__new__();
1881MochiKit.Base._exportSymbols(this,MochiKit.Logging);
1882MochiKit.Base._deps("DateTime",["Base"]);
1883MochiKit.DateTime.NAME="MochiKit.DateTime";
1884MochiKit.DateTime.VERSION="1.4.2";
1885MochiKit.DateTime.__repr__=function(){
1886return "["+this.NAME+" "+this.VERSION+"]";
1887};
1888MochiKit.DateTime.toString=function(){
1889return this.__repr__();
1890};
1891MochiKit.DateTime.isoDate=function(str){
1892str=str+"";
1893if(typeof (str)!="string"||str.length===0){
1894return null;
1895}
1896var iso=str.split("-");
1897if(iso.length===0){
1898return null;
1899}
1900var date=new Date(iso[0],iso[1]-1,iso[2]);
1901date.setFullYear(iso[0]);
1902date.setMonth(iso[1]-1);
1903date.setDate(iso[2]);
1904return date;
1905};
1906MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
1907MochiKit.DateTime.isoTimestamp=function(str){
1908str=str+"";
1909if(typeof (str)!="string"||str.length===0){
1910return null;
1911}
1912var res=str.match(MochiKit.DateTime._isoRegexp);
1913if(typeof (res)=="undefined"||res===null){
1914return null;
1915}
1916var year,_227,day,hour,min,sec,msec;
1917year=parseInt(res[1],10);
1918if(typeof (res[2])=="undefined"||res[2]===""){
1919return new Date(year);
1920}
1921_227=parseInt(res[2],10)-1;
1922day=parseInt(res[3],10);
1923if(typeof (res[4])=="undefined"||res[4]===""){
1924return new Date(year,_227,day);
1925}
1926hour=parseInt(res[4],10);
1927min=parseInt(res[5],10);
1928sec=(typeof (res[6])!="undefined"&&res[6]!=="")?parseInt(res[6],10):0;
1929if(typeof (res[7])!="undefined"&&res[7]!==""){
1930msec=Math.round(1000*parseFloat("0."+res[7]));
1931}else{
1932msec=0;
1933}
1934if((typeof (res[8])=="undefined"||res[8]==="")&&(typeof (res[9])=="undefined"||res[9]==="")){
1935return new Date(year,_227,day,hour,min,sec,msec);
1936}
1937var ofs;
1938if(typeof (res[9])!="undefined"&&res[9]!==""){
1939ofs=parseInt(res[10],10)*3600000;
1940if(typeof (res[11])!="undefined"&&res[11]!==""){
1941ofs+=parseInt(res[11],10)*60000;
1942}
1943if(res[9]=="-"){
1944ofs=-ofs;
1945}
1946}else{
1947ofs=0;
1948}
1949return new Date(Date.UTC(year,_227,day,hour,min,sec,msec)-ofs);
1950};
1951MochiKit.DateTime.toISOTime=function(date,_22f){
1952if(typeof (date)=="undefined"||date===null){
1953return null;
1954}
1955var hh=date.getHours();
1956var mm=date.getMinutes();
1957var ss=date.getSeconds();
1958var lst=[((_22f&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
1959return lst.join(":");
1960};
1961MochiKit.DateTime.toISOTimestamp=function(date,_235){
1962if(typeof (date)=="undefined"||date===null){
1963return null;
1964}
1965var sep=_235?"T":" ";
1966var foot=_235?"Z":"";
1967if(_235){
1968date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
1969}
1970return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_235)+foot;
1971};
1972MochiKit.DateTime.toISODate=function(date){
1973if(typeof (date)=="undefined"||date===null){
1974return null;
1975}
1976var _239=MochiKit.DateTime._padTwo;
1977var _23a=MochiKit.DateTime._padFour;
1978return [_23a(date.getFullYear()),_239(date.getMonth()+1),_239(date.getDate())].join("-");
1979};
1980MochiKit.DateTime.americanDate=function(d){
1981d=d+"";
1982if(typeof (d)!="string"||d.length===0){
1983return null;
1984}
1985var a=d.split("/");
1986return new Date(a[2],a[0]-1,a[1]);
1987};
1988MochiKit.DateTime._padTwo=function(n){
1989return (n>9)?n:"0"+n;
1990};
1991MochiKit.DateTime._padFour=function(n){
1992switch(n.toString().length){
1993case 1:
1994return "000"+n;
1995break;
1996case 2:
1997return "00"+n;
1998break;
1999case 3:
2000return "0"+n;
2001break;
2002case 4:
2003default:
2004return n;
2005}
2006};
2007MochiKit.DateTime.toPaddedAmericanDate=function(d){
2008if(typeof (d)=="undefined"||d===null){
2009return null;
2010}
2011var _240=MochiKit.DateTime._padTwo;
2012return [_240(d.getMonth()+1),_240(d.getDate()),d.getFullYear()].join("/");
2013};
2014MochiKit.DateTime.toAmericanDate=function(d){
2015if(typeof (d)=="undefined"||d===null){
2016return null;
2017}
2018return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
2019};
2020MochiKit.DateTime.EXPORT=["isoDate","isoTimestamp","toISOTime","toISOTimestamp","toISODate","americanDate","toPaddedAmericanDate","toAmericanDate"];
2021MochiKit.DateTime.EXPORT_OK=[];
2022MochiKit.DateTime.EXPORT_TAGS={":common":MochiKit.DateTime.EXPORT,":all":MochiKit.DateTime.EXPORT};
2023MochiKit.DateTime.__new__=function(){
2024var base=this.NAME+".";
2025for(var k in this){
2026var o=this[k];
2027if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
2028try{
2029o.NAME=base+k;
2030}
2031catch(e){
2032}
2033}
2034}
2035};
2036MochiKit.DateTime.__new__();
2037if(typeof (MochiKit.Base)!="undefined"){
2038MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
2039}else{
2040(function(_245,_246){
2041if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
2042var all=_246.EXPORT_TAGS[":all"];
2043for(var i=0;i<all.length;i++){
2044_245[all[i]]=_246[all[i]];
2045}
2046}
2047})(this,MochiKit.DateTime);
2048}
2049MochiKit.Base._deps("Format",["Base"]);
2050MochiKit.Format.NAME="MochiKit.Format";
2051MochiKit.Format.VERSION="1.4.2";
2052MochiKit.Format.__repr__=function(){
2053return "["+this.NAME+" "+this.VERSION+"]";
2054};
2055MochiKit.Format.toString=function(){
2056return this.__repr__();
2057};
2058MochiKit.Format._numberFormatter=function(_249,_24a,_24b,_24c,_24d,_24e,_24f,_250,_251){
2059return function(num){
2060num=parseFloat(num);
2061if(typeof (num)=="undefined"||num===null||isNaN(num)){
2062return _249;
2063}
2064var _253=_24a;
2065var _254=_24b;
2066if(num<0){
2067num=-num;
2068}else{
2069_253=_253.replace(/-/,"");
2070}
2071var me=arguments.callee;
2072var fmt=MochiKit.Format.formatLocale(_24c);
2073if(_24d){
2074num=num*100;
2075_254=fmt.percent+_254;
2076}
2077num=MochiKit.Format.roundToFixed(num,_24e);
2078var _257=num.split(/\./);
2079var _258=_257[0];
2080var frac=(_257.length==1)?"":_257[1];
2081var res="";
2082while(_258.length<_24f){
2083_258="0"+_258;
2084}
2085if(_250){
2086while(_258.length>_250){
2087var i=_258.length-_250;
2088res=fmt.separator+_258.substring(i,_258.length)+res;
2089_258=_258.substring(0,i);
2090}
2091}
2092res=_258+res;
2093if(_24e>0){
2094while(frac.length<_251){
2095frac=frac+"0";
2096}
2097res=res+fmt.decimal+frac;
2098}
2099return _253+res+_254;
2100};
2101};
2102MochiKit.Format.numberFormatter=function(_25c,_25d,_25e){
2103if(typeof (_25d)=="undefined"){
2104_25d="";
2105}
2106var _25f=_25c.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
2107if(!_25f){
2108throw TypeError("Invalid pattern");
2109}
2110var _260=_25c.substr(0,_25f.index);
2111var _261=_25c.substr(_25f.index+_25f[0].length);
2112if(_260.search(/-/)==-1){
2113_260=_260+"-";
2114}
2115var _262=_25f[1];
2116var frac=(typeof (_25f[2])=="string"&&_25f[2]!="")?_25f[2]:"";
2117var _264=(typeof (_25f[3])=="string"&&_25f[3]!="");
2118var tmp=_262.split(/,/);
2119var _266;
2120if(typeof (_25e)=="undefined"){
2121_25e="default";
2122}
2123if(tmp.length==1){
2124_266=null;
2125}else{
2126_266=tmp[1].length;
2127}
2128var _267=_262.length-_262.replace(/0/g,"").length;
2129var _268=frac.length-frac.replace(/0/g,"").length;
2130var _269=frac.length;
2131var rval=MochiKit.Format._numberFormatter(_25d,_260,_261,_25e,_264,_269,_267,_266,_268);
2132var m=MochiKit.Base;
2133if(m){
2134var fn=arguments.callee;
2135var args=m.concat(arguments);
2136rval.repr=function(){
2137return [self.NAME,"(",map(m.repr,args).join(", "),")"].join("");
2138};
2139}
2140return rval;
2141};
2142MochiKit.Format.formatLocale=function(_26e){
2143if(typeof (_26e)=="undefined"||_26e===null){
2144_26e="default";
2145}
2146if(typeof (_26e)=="string"){
2147var rval=MochiKit.Format.LOCALE[_26e];
2148if(typeof (rval)=="string"){
2149rval=arguments.callee(rval);
2150MochiKit.Format.LOCALE[_26e]=rval;
2151}
2152return rval;
2153}else{
2154return _26e;
2155}
2156};
2157MochiKit.Format.twoDigitAverage=function(_270,_271){
2158if(_271){
2159var res=_270/_271;
2160if(!isNaN(res)){
2161return MochiKit.Format.twoDigitFloat(res);
2162}
2163}
2164return "0";
2165};
2166MochiKit.Format.twoDigitFloat=function(_273){
2167var res=roundToFixed(_273,2);
2168if(res.indexOf(".00")>0){
2169return res.substring(0,res.length-3);
2170}else{
2171if(res.charAt(res.length-1)=="0"){
2172return res.substring(0,res.length-1);
2173}else{
2174return res;
2175}
2176}
2177};
2178MochiKit.Format.lstrip=function(str,_276){
2179str=str+"";
2180if(typeof (str)!="string"){
2181return null;
2182}
2183if(!_276){
2184return str.replace(/^\s+/,"");
2185}else{
2186return str.replace(new RegExp("^["+_276+"]+"),"");
2187}
2188};
2189MochiKit.Format.rstrip=function(str,_278){
2190str=str+"";
2191if(typeof (str)!="string"){
2192return null;
2193}
2194if(!_278){
2195return str.replace(/\s+$/,"");
2196}else{
2197return str.replace(new RegExp("["+_278+"]+$"),"");
2198}
2199};
2200MochiKit.Format.strip=function(str,_27a){
2201var self=MochiKit.Format;
2202return self.rstrip(self.lstrip(str,_27a),_27a);
2203};
2204MochiKit.Format.truncToFixed=function(_27c,_27d){
2205var res=Math.floor(_27c).toFixed(0);
2206if(_27c<0){
2207res=Math.ceil(_27c).toFixed(0);
2208if(res.charAt(0)!="-"&&_27d>0){
2209res="-"+res;
2210}
2211}
2212if(res.indexOf("e")<0&&_27d>0){
2213var tail=_27c.toString();
2214if(tail.indexOf("e")>0){
2215tail=".";
2216}else{
2217if(tail.indexOf(".")<0){
2218tail=".";
2219}else{
2220tail=tail.substring(tail.indexOf("."));
2221}
2222}
2223if(tail.length-1>_27d){
2224tail=tail.substring(0,_27d+1);
2225}
2226while(tail.length-1<_27d){
2227tail+="0";
2228}
2229res+=tail;
2230}
2231return res;
2232};
2233MochiKit.Format.roundToFixed=function(_280,_281){
2234var _282=Math.abs(_280)+0.5*Math.pow(10,-_281);
2235var res=MochiKit.Format.truncToFixed(_282,_281);
2236if(_280<0){
2237res="-"+res;
2238}
2239return res;
2240};
2241MochiKit.Format.percentFormat=function(_284){
2242return MochiKit.Format.twoDigitFloat(100*_284)+"%";
2243};
2244MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
2245MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},pt_BR:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
2246MochiKit.Format.EXPORT_OK=[];
2247MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
2248MochiKit.Format.__new__=function(){
2249var base=this.NAME+".";
2250var k,v,o;
2251for(k in this.LOCALE){
2252o=this.LOCALE[k];
2253if(typeof (o)=="object"){
2254o.repr=function(){
2255return this.NAME;
2256};
2257o.NAME=base+"LOCALE."+k;
2258}
2259}
2260for(k in this){
2261o=this[k];
2262if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
2263try{
2264o.NAME=base+k;
2265}
2266catch(e){
2267}
2268}
2269}
2270};
2271MochiKit.Format.__new__();
2272if(typeof (MochiKit.Base)!="undefined"){
2273MochiKit.Base._exportSymbols(this,MochiKit.Format);
2274}else{
2275(function(_289,_28a){
2276if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
2277var all=_28a.EXPORT_TAGS[":all"];
2278for(var i=0;i<all.length;i++){
2279_289[all[i]]=_28a[all[i]];
2280}
2281}
2282})(this,MochiKit.Format);
2283}
2284MochiKit.Base._deps("Async",["Base"]);
2285MochiKit.Async.NAME="MochiKit.Async";
2286MochiKit.Async.VERSION="1.4.2";
2287MochiKit.Async.__repr__=function(){
2288return "["+this.NAME+" "+this.VERSION+"]";
2289};
2290MochiKit.Async.toString=function(){
2291return this.__repr__();
2292};
2293MochiKit.Async.Deferred=function(_28d){
2294this.chain=[];
2295this.id=this._nextId();
2296this.fired=-1;
2297this.paused=0;
2298this.results=[null,null];
2299this.canceller=_28d;
2300this.silentlyCancelled=false;
2301this.chained=false;
2302};
2303MochiKit.Async.Deferred.prototype={repr:function(){
2304var _28e;
2305if(this.fired==-1){
2306_28e="unfired";
2307}else{
2308if(this.fired===0){
2309_28e="success";
2310}else{
2311_28e="error";
2312}
2313}
2314return "Deferred("+this.id+", "+_28e+")";
2315},toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
2316var self=MochiKit.Async;
2317if(this.fired==-1){
2318if(this.canceller){
2319this.canceller(this);
2320}else{
2321this.silentlyCancelled=true;
2322}
2323if(this.fired==-1){
2324this.errback(new self.CancelledError(this));
2325}
2326}else{
2327if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){
2328this.results[0].cancel();
2329}
2330}
2331},_resback:function(res){
2332this.fired=((res instanceof Error)?1:0);
2333this.results[this.fired]=res;
2334this._fire();
2335},_check:function(){
2336if(this.fired!=-1){
2337if(!this.silentlyCancelled){
2338throw new MochiKit.Async.AlreadyCalledError(this);
2339}
2340this.silentlyCancelled=false;
2341return;
2342}
2343},callback:function(res){
2344this._check();
2345if(res instanceof MochiKit.Async.Deferred){
2346throw new Error("Deferred instances can only be chained if they are the result of a callback");
2347}
2348this._resback(res);
2349},errback:function(res){
2350this._check();
2351var self=MochiKit.Async;
2352if(res instanceof self.Deferred){
2353throw new Error("Deferred instances can only be chained if they are the result of a callback");
2354}
2355if(!(res instanceof Error)){
2356res=new self.GenericError(res);
2357}
2358this._resback(res);
2359},addBoth:function(fn){
2360if(arguments.length>1){
2361fn=MochiKit.Base.partial.apply(null,arguments);
2362}
2363return this.addCallbacks(fn,fn);
2364},addCallback:function(fn){
2365if(arguments.length>1){
2366fn=MochiKit.Base.partial.apply(null,arguments);
2367}
2368return this.addCallbacks(fn,null);
2369},addErrback:function(fn){
2370if(arguments.length>1){
2371fn=MochiKit.Base.partial.apply(null,arguments);
2372}
2373return this.addCallbacks(null,fn);
2374},addCallbacks:function(cb,eb){
2375if(this.chained){
2376throw new Error("Chained Deferreds can not be re-used");
2377}
2378this.chain.push([cb,eb]);
2379if(this.fired>=0){
2380this._fire();
2381}
2382return this;
2383},_fire:function(){
2384var _299=this.chain;
2385var _29a=this.fired;
2386var res=this.results[_29a];
2387var self=this;
2388var cb=null;
2389while(_299.length>0&&this.paused===0){
2390var pair=_299.shift();
2391var f=pair[_29a];
2392if(f===null){
2393continue;
2394}
2395try{
2396res=f(res);
2397_29a=((res instanceof Error)?1:0);
2398if(res instanceof MochiKit.Async.Deferred){
2399cb=function(res){
2400self._resback(res);
2401self.paused--;
2402if((self.paused===0)&&(self.fired>=0)){
2403self._fire();
2404}
2405};
2406this.paused++;
2407}
2408}
2409catch(err){
2410_29a=1;
2411if(!(err instanceof Error)){
2412err=new MochiKit.Async.GenericError(err);
2413}
2414res=err;
2415}
2416}
2417this.fired=_29a;
2418this.results[_29a]=res;
2419if(cb&&this.paused){
2420res.addBoth(cb);
2421res.chained=true;
2422}
2423}};
2424MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
2425return MochiKit.Base.evalJSON(req.responseText);
2426},succeed:function(_2a2){
2427var d=new MochiKit.Async.Deferred();
2428d.callback.apply(d,arguments);
2429return d;
2430},fail:function(_2a4){
2431var d=new MochiKit.Async.Deferred();
2432d.errback.apply(d,arguments);
2433return d;
2434},getXMLHttpRequest:function(){
2435var self=arguments.callee;
2436if(!self.XMLHttpRequest){
2437var _2a7=[function(){
2438return new XMLHttpRequest();
2439},function(){
2440return new ActiveXObject("Msxml2.XMLHTTP");
2441},function(){
2442return new ActiveXObject("Microsoft.XMLHTTP");
2443},function(){
2444return new ActiveXObject("Msxml2.XMLHTTP.4.0");
2445},function(){
2446throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
2447}];
2448for(var i=0;i<_2a7.length;i++){
2449var func=_2a7[i];
2450try{
2451self.XMLHttpRequest=func;
2452return func();
2453}
2454catch(e){
2455}
2456}
2457}
2458return self.XMLHttpRequest();
2459},_xhr_onreadystatechange:function(d){
2460var m=MochiKit.Base;
2461if(this.readyState==4){
2462try{
2463this.onreadystatechange=null;
2464}
2465catch(e){
2466try{
2467this.onreadystatechange=m.noop;
2468}
2469catch(e){
2470}
2471}
2472var _2ac=null;
2473try{
2474_2ac=this.status;
2475if(!_2ac&&m.isNotEmpty(this.responseText)){
2476_2ac=304;
2477}
2478}
2479catch(e){
2480}
2481if(_2ac==200||_2ac==201||_2ac==204||_2ac==304||_2ac==1223){
2482d.callback(this);
2483}else{
2484var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
2485if(err.number){
2486d.errback(err);
2487}else{
2488d.errback(err);
2489}
2490}
2491}
2492},_xhr_canceller:function(req){
2493try{
2494req.onreadystatechange=null;
2495}
2496catch(e){
2497try{
2498req.onreadystatechange=MochiKit.Base.noop;
2499}
2500catch(e){
2501}
2502}
2503req.abort();
2504},sendXMLHttpRequest:function(req,_2b0){
2505if(typeof (_2b0)=="undefined"||_2b0===null){
2506_2b0="";
2507}
2508var m=MochiKit.Base;
2509var self=MochiKit.Async;
2510var d=new self.Deferred(m.partial(self._xhr_canceller,req));
2511try{
2512req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
2513req.send(_2b0);
2514}
2515catch(e){
2516try{
2517req.onreadystatechange=null;
2518}
2519catch(ignore){
2520}
2521d.errback(e);
2522}
2523return d;
2524},doXHR:function(url,opts){
2525var self=MochiKit.Async;
2526return self.callLater(0,self._doXHR,url,opts);
2527},_doXHR:function(url,opts){
2528var m=MochiKit.Base;
2529opts=m.update({method:"GET",sendContent:""},opts);
2530var self=MochiKit.Async;
2531var req=self.getXMLHttpRequest();
2532if(opts.queryString){
2533var qs=m.queryString(opts.queryString);
2534if(qs){
2535url+="?"+qs;
2536}
2537}
2538if("username" in opts){
2539req.open(opts.method,url,true,opts.username,opts.password);
2540}else{
2541req.open(opts.method,url,true);
2542}
2543if(req.overrideMimeType&&opts.mimeType){
2544req.overrideMimeType(opts.mimeType);
2545}
2546req.setRequestHeader("X-Requested-With","XMLHttpRequest");
2547if(opts.headers){
2548var _2bd=opts.headers;
2549if(!m.isArrayLike(_2bd)){
2550_2bd=m.items(_2bd);
2551}
2552for(var i=0;i<_2bd.length;i++){
2553var _2bf=_2bd[i];
2554var name=_2bf[0];
2555var _2c1=_2bf[1];
2556req.setRequestHeader(name,_2c1);
2557}
2558}
2559return self.sendXMLHttpRequest(req,opts.sendContent);
2560},_buildURL:function(url){
2561if(arguments.length>1){
2562var m=MochiKit.Base;
2563var qs=m.queryString.apply(null,m.extend(null,arguments,1));
2564if(qs){
2565return url+"?"+qs;
2566}
2567}
2568return url;
2569},doSimpleXMLHttpRequest:function(url){
2570var self=MochiKit.Async;
2571url=self._buildURL.apply(self,arguments);
2572return self.doXHR(url);
2573},loadJSONDoc:function(url){
2574var self=MochiKit.Async;
2575url=self._buildURL.apply(self,arguments);
2576var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]});
2577d=d.addCallback(self.evalJSONRequest);
2578return d;
2579},wait:function(_2ca,_2cb){
2580var d=new MochiKit.Async.Deferred();
2581var m=MochiKit.Base;
2582if(typeof (_2cb)!="undefined"){
2583d.addCallback(function(){
2584return _2cb;
2585});
2586}
2587var _2ce=setTimeout(m.bind("callback",d),Math.floor(_2ca*1000));
2588d.canceller=function(){
2589try{
2590clearTimeout(_2ce);
2591}
2592catch(e){
2593}
2594};
2595return d;
2596},callLater:function(_2cf,func){
2597var m=MochiKit.Base;
2598var _2d2=m.partial.apply(m,m.extend(null,arguments,1));
2599return MochiKit.Async.wait(_2cf).addCallback(function(res){
2600return _2d2();
2601});
2602}});
2603MochiKit.Async.DeferredLock=function(){
2604this.waiting=[];
2605this.locked=false;
2606this.id=this._nextId();
2607};
2608MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
2609var d=new MochiKit.Async.Deferred();
2610if(this.locked){
2611this.waiting.push(d);
2612}else{
2613this.locked=true;
2614d.callback(this);
2615}
2616return d;
2617},release:function(){
2618if(!this.locked){
2619throw TypeError("Tried to release an unlocked DeferredLock");
2620}
2621this.locked=false;
2622if(this.waiting.length>0){
2623this.locked=true;
2624this.waiting.shift().callback(this);
2625}
2626},_nextId:MochiKit.Base.counter(),repr:function(){
2627var _2d5;
2628if(this.locked){
2629_2d5="locked, "+this.waiting.length+" waiting";
2630}else{
2631_2d5="unlocked";
2632}
2633return "DeferredLock("+this.id+", "+_2d5+")";
2634},toString:MochiKit.Base.forwardCall("repr")};
2635MochiKit.Async.DeferredList=function(list,_2d7,_2d8,_2d9,_2da){
2636MochiKit.Async.Deferred.apply(this,[_2da]);
2637this.list=list;
2638var _2db=[];
2639this.resultList=_2db;
2640this.finishedCount=0;
2641this.fireOnOneCallback=_2d7;
2642this.fireOnOneErrback=_2d8;
2643this.consumeErrors=_2d9;
2644var cb=MochiKit.Base.bind(this._cbDeferred,this);
2645for(var i=0;i<list.length;i++){
2646var d=list[i];
2647_2db.push(undefined);
2648d.addCallback(cb,i,true);
2649d.addErrback(cb,i,false);
2650}
2651if(list.length===0&&!_2d7){
2652this.callback(this.resultList);
2653}
2654};
2655MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
2656MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2df,_2e0,_2e1){
2657this.resultList[_2df]=[_2e0,_2e1];
2658this.finishedCount+=1;
2659if(this.fired==-1){
2660if(_2e0&&this.fireOnOneCallback){
2661this.callback([_2df,_2e1]);
2662}else{
2663if(!_2e0&&this.fireOnOneErrback){
2664this.errback(_2e1);
2665}else{
2666if(this.finishedCount==this.list.length){
2667this.callback(this.resultList);
2668}
2669}
2670}
2671}
2672if(!_2e0&&this.consumeErrors){
2673_2e1=null;
2674}
2675return _2e1;
2676};
2677MochiKit.Async.gatherResults=function(_2e2){
2678var d=new MochiKit.Async.DeferredList(_2e2,false,true,false);
2679d.addCallback(function(_2e4){
2680var ret=[];
2681for(var i=0;i<_2e4.length;i++){
2682ret.push(_2e4[i][1]);
2683}
2684return ret;
2685});
2686return d;
2687};
2688MochiKit.Async.maybeDeferred=function(func){
2689var self=MochiKit.Async;
2690var _2e9;
2691try{
2692var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
2693if(r instanceof self.Deferred){
2694_2e9=r;
2695}else{
2696if(r instanceof Error){
2697_2e9=self.fail(r);
2698}else{
2699_2e9=self.succeed(r);
2700}
2701}
2702}
2703catch(e){
2704_2e9=self.fail(e);
2705}
2706return _2e9;
2707};
2708MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"];
2709MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
2710MochiKit.Async.__new__=function(){
2711var m=MochiKit.Base;
2712var ne=m.partial(m._newNamedError,this);
2713ne("AlreadyCalledError",function(_2ed){
2714this.deferred=_2ed;
2715});
2716ne("CancelledError",function(_2ee){
2717this.deferred=_2ee;
2718});
2719ne("BrowserComplianceError",function(msg){
2720this.message=msg;
2721});
2722ne("GenericError",function(msg){
2723this.message=msg;
2724});
2725ne("XMLHttpRequestError",function(req,msg){
2726this.req=req;
2727this.message=msg;
2728try{
2729this.number=req.status;
2730}
2731catch(e){
2732}
2733});
2734this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
2735m.nameFunctions(this);
2736};
2737MochiKit.Async.__new__();
2738MochiKit.Base._exportSymbols(this,MochiKit.Async);
2739MochiKit.Base._deps("DOM",["Base"]);
2740MochiKit.DOM.NAME="MochiKit.DOM";
2741MochiKit.DOM.VERSION="1.4.2";
2742MochiKit.DOM.__repr__=function(){
2743return "["+this.NAME+" "+this.VERSION+"]";
2744};
2745MochiKit.DOM.toString=function(){
2746return this.__repr__();
2747};
2748MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","removeNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","insertSiblingNodesAfter","insertSiblingNodesBefore","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","H4","H5","H6","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","DL","DT","DD","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","computedStyle","escapeHTML","toHTML","emitHTML","scrapeText","getFirstParentByTagAndClassName","getFirstElementByTagAndClassName"];
2749MochiKit.DOM.EXPORT_OK=["domConverters"];
2750MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.getStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["getViewportDimensions","MochiKit.Style.getViewportDimensions","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["makeClipping","MochiKit.Style.makeClipping","1.4.1"],["makePositioned","MochiKit.Style.makePositioned","1.4.1"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["undoClipping","MochiKit.Style.undoClipping","1.4.1"],["undoPositioned","MochiKit.Style.undoPositioned","1.4.1"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
2751MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
2752return MochiKit.DOM._window;
2753},currentDocument:function(){
2754return MochiKit.DOM._document;
2755},withWindow:function(win,func){
2756var self=MochiKit.DOM;
2757var _2f6=self._document;
2758var _2f7=self._window;
2759var rval;
2760try{
2761self._window=win;
2762self._document=win.document;
2763rval=func();
2764}
2765catch(e){
2766self._window=_2f7;
2767self._document=_2f6;
2768throw e;
2769}
2770self._window=_2f7;
2771self._document=_2f6;
2772return rval;
2773},formContents:function(elem){
2774var _2fa=[];
2775var _2fb=[];
2776var m=MochiKit.Base;
2777var self=MochiKit.DOM;
2778if(typeof (elem)=="undefined"||elem===null){
2779elem=self._document.body;
2780}else{
2781elem=self.getElement(elem);
2782}
2783m.nodeWalk(elem,function(elem){
2784var name=elem.name;
2785if(m.isNotEmpty(name)){
2786var _300=elem.tagName.toUpperCase();
2787if(_300==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
2788return null;
2789}
2790if(_300==="SELECT"){
2791if(elem.type=="select-one"){
2792if(elem.selectedIndex>=0){
2793var opt=elem.options[elem.selectedIndex];
2794var v=opt.value;
2795if(!v){
2796var h=opt.outerHTML;
2797if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
2798v=opt.text;
2799}
2800}
2801_2fa.push(name);
2802_2fb.push(v);
2803return null;
2804}
2805_2fa.push(name);
2806_2fb.push("");
2807return null;
2808}else{
2809var opts=elem.options;
2810if(!opts.length){
2811_2fa.push(name);
2812_2fb.push("");
2813return null;
2814}
2815for(var i=0;i<opts.length;i++){
2816var opt=opts[i];
2817if(!opt.selected){
2818continue;
2819}
2820var v=opt.value;
2821if(!v){
2822var h=opt.outerHTML;
2823if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
2824v=opt.text;
2825}
2826}
2827_2fa.push(name);
2828_2fb.push(v);
2829}
2830return null;
2831}
2832}
2833if(_300==="FORM"||_300==="P"||_300==="SPAN"||_300==="DIV"){
2834return elem.childNodes;
2835}
2836_2fa.push(name);
2837_2fb.push(elem.value||"");
2838return null;
2839}
2840return elem.childNodes;
2841});
2842return [_2fa,_2fb];
2843},withDocument:function(doc,func){
2844var self=MochiKit.DOM;
2845var _309=self._document;
2846var rval;
2847try{
2848self._document=doc;
2849rval=func();
2850}
2851catch(e){
2852self._document=_309;
2853throw e;
2854}
2855self._document=_309;
2856return rval;
2857},registerDOMConverter:function(name,_30c,wrap,_30e){
2858MochiKit.DOM.domConverters.register(name,_30c,wrap,_30e);
2859},coerceToDOM:function(node,ctx){
2860var m=MochiKit.Base;
2861var im=MochiKit.Iter;
2862var self=MochiKit.DOM;
2863if(im){
2864var iter=im.iter;
2865var _315=im.repeat;
2866}
2867var map=m.map;
2868var _317=self.domConverters;
2869var _318=arguments.callee;
2870var _319=m.NotFound;
2871while(true){
2872if(typeof (node)=="undefined"||node===null){
2873return null;
2874}
2875if(typeof (node)=="function"&&typeof (node.length)=="number"&&!(node instanceof Function)){
2876node=im?im.list(node):m.extend(null,node);
2877}
2878if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
2879return node;
2880}
2881if(typeof (node)=="number"||typeof (node)=="boolean"){
2882node=node.toString();
2883}
2884if(typeof (node)=="string"){
2885return self._document.createTextNode(node);
2886}
2887if(typeof (node.__dom__)=="function"){
2888node=node.__dom__(ctx);
2889continue;
2890}
2891if(typeof (node.dom)=="function"){
2892node=node.dom(ctx);
2893continue;
2894}
2895if(typeof (node)=="function"){
2896node=node.apply(ctx,[ctx]);
2897continue;
2898}
2899if(im){
2900var _31a=null;
2901try{
2902_31a=iter(node);
2903}
2904catch(e){
2905}
2906if(_31a){
2907return map(_318,_31a,_315(ctx));
2908}
2909}else{
2910if(m.isArrayLike(node)){
2911var func=function(n){
2912return _318(n,ctx);
2913};
2914return map(func,node);
2915}
2916}
2917try{
2918node=_317.match(node,ctx);
2919continue;
2920}
2921catch(e){
2922if(e!=_319){
2923throw e;
2924}
2925}
2926return self._document.createTextNode(node.toString());
2927}
2928return undefined;
2929},isChildNode:function(node,_31e){
2930var self=MochiKit.DOM;
2931if(typeof (node)=="string"){
2932node=self.getElement(node);
2933}
2934if(typeof (_31e)=="string"){
2935_31e=self.getElement(_31e);
2936}
2937if(typeof (node)=="undefined"||node===null){
2938return false;
2939}
2940while(node!=null&&node!==self._document){
2941if(node===_31e){
2942return true;
2943}
2944node=node.parentNode;
2945}
2946return false;
2947},setNodeAttribute:function(node,attr,_322){
2948var o={};
2949o[attr]=_322;
2950try{
2951return MochiKit.DOM.updateNodeAttributes(node,o);
2952}
2953catch(e){
2954}
2955return null;
2956},getNodeAttribute:function(node,attr){
2957var self=MochiKit.DOM;
2958var _327=self.attributeArray.renames[attr];
2959var _328=self.attributeArray.ignoreAttr[attr];
2960node=self.getElement(node);
2961try{
2962if(_327){
2963return node[_327];
2964}
2965var _329=node.getAttribute(attr);
2966if(_329!=_328){
2967return _329;
2968}
2969}
2970catch(e){
2971}
2972return null;
2973},removeNodeAttribute:function(node,attr){
2974var self=MochiKit.DOM;
2975var _32d=self.attributeArray.renames[attr];
2976node=self.getElement(node);
2977try{
2978if(_32d){
2979return node[_32d];
2980}
2981return node.removeAttribute(attr);
2982}
2983catch(e){
2984}
2985return null;
2986},updateNodeAttributes:function(node,_32f){
2987var elem=node;
2988var self=MochiKit.DOM;
2989if(typeof (node)=="string"){
2990elem=self.getElement(node);
2991}
2992if(_32f){
2993var _332=MochiKit.Base.updatetree;
2994if(self.attributeArray.compliant){
2995for(var k in _32f){
2996var v=_32f[k];
2997if(typeof (v)=="object"&&typeof (elem[k])=="object"){
2998if(k=="style"&&MochiKit.Style){
2999MochiKit.Style.setStyle(elem,v);
3000}else{
3001_332(elem[k],v);
3002}
3003}else{
3004if(k.substring(0,2)=="on"){
3005if(typeof (v)=="string"){
3006v=new Function(v);
3007}
3008elem[k]=v;
3009}else{
3010elem.setAttribute(k,v);
3011}
3012}
3013if(typeof (elem[k])=="string"&&elem[k]!=v){
3014elem[k]=v;
3015}
3016}
3017}else{
3018var _335=self.attributeArray.renames;
3019for(var k in _32f){
3020v=_32f[k];
3021var _336=_335[k];
3022if(k=="style"&&typeof (v)=="string"){
3023elem.style.cssText=v;
3024}else{
3025if(typeof (_336)=="string"){
3026elem[_336]=v;
3027}else{
3028if(typeof (elem[k])=="object"&&typeof (v)=="object"){
3029if(k=="style"&&MochiKit.Style){
3030MochiKit.Style.setStyle(elem,v);
3031}else{
3032_332(elem[k],v);
3033}
3034}else{
3035if(k.substring(0,2)=="on"){
3036if(typeof (v)=="string"){
3037v=new Function(v);
3038}
3039elem[k]=v;
3040}else{
3041elem.setAttribute(k,v);
3042}
3043}
3044}
3045}
3046if(typeof (elem[k])=="string"&&elem[k]!=v){
3047elem[k]=v;
3048}
3049}
3050}
3051}
3052return elem;
3053},appendChildNodes:function(node){
3054var elem=node;
3055var self=MochiKit.DOM;
3056if(typeof (node)=="string"){
3057elem=self.getElement(node);
3058}
3059var _33a=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
3060var _33b=MochiKit.Base.concat;
3061while(_33a.length){
3062var n=_33a.shift();
3063if(typeof (n)=="undefined"||n===null){
3064}else{
3065if(typeof (n.nodeType)=="number"){
3066elem.appendChild(n);
3067}else{
3068_33a=_33b(n,_33a);
3069}
3070}
3071}
3072return elem;
3073},insertSiblingNodesBefore:function(node){
3074var elem=node;
3075var self=MochiKit.DOM;
3076if(typeof (node)=="string"){
3077elem=self.getElement(node);
3078}
3079var _340=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
3080var _341=elem.parentNode;
3081var _342=MochiKit.Base.concat;
3082while(_340.length){
3083var n=_340.shift();
3084if(typeof (n)=="undefined"||n===null){
3085}else{
3086if(typeof (n.nodeType)=="number"){
3087_341.insertBefore(n,elem);
3088}else{
3089_340=_342(n,_340);
3090}
3091}
3092}
3093return _341;
3094},insertSiblingNodesAfter:function(node){
3095var elem=node;
3096var self=MochiKit.DOM;
3097if(typeof (node)=="string"){
3098elem=self.getElement(node);
3099}
3100var _347=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
3101if(elem.nextSibling){
3102return self.insertSiblingNodesBefore(elem.nextSibling,_347);
3103}else{
3104return self.appendChildNodes(elem.parentNode,_347);
3105}
3106},replaceChildNodes:function(node){
3107var elem=node;
3108var self=MochiKit.DOM;
3109if(typeof (node)=="string"){
3110elem=self.getElement(node);
3111arguments[0]=elem;
3112}
3113var _34b;
3114while((_34b=elem.firstChild)){
3115elem.removeChild(_34b);
3116}
3117if(arguments.length<2){
3118return elem;
3119}else{
3120return self.appendChildNodes.apply(this,arguments);
3121}
3122},createDOM:function(name,_34d){
3123var elem;
3124var self=MochiKit.DOM;
3125var m=MochiKit.Base;
3126if(typeof (_34d)=="string"||typeof (_34d)=="number"){
3127var args=m.extend([name,null],arguments,1);
3128return arguments.callee.apply(this,args);
3129}
3130if(typeof (name)=="string"){
3131var _352=self._xhtml;
3132if(_34d&&!self.attributeArray.compliant){
3133var _353="";
3134if("name" in _34d){
3135_353+=" name=\""+self.escapeHTML(_34d.name)+"\"";
3136}
3137if(name=="input"&&"type" in _34d){
3138_353+=" type=\""+self.escapeHTML(_34d.type)+"\"";
3139}
3140if(_353){
3141name="<"+name+_353+">";
3142_352=false;
3143}
3144}
3145var d=self._document;
3146if(_352&&d===document){
3147elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
3148}else{
3149elem=d.createElement(name);
3150}
3151}else{
3152elem=name;
3153}
3154if(_34d){
3155self.updateNodeAttributes(elem,_34d);
3156}
3157if(arguments.length<=2){
3158return elem;
3159}else{
3160var args=m.extend([elem],arguments,2);
3161return self.appendChildNodes.apply(this,args);
3162}
3163},createDOMFunc:function(){
3164var m=MochiKit.Base;
3165return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
3166},removeElement:function(elem){
3167var self=MochiKit.DOM;
3168var e=self.coerceToDOM(self.getElement(elem));
3169e.parentNode.removeChild(e);
3170return e;
3171},swapDOM:function(dest,src){
3172var self=MochiKit.DOM;
3173dest=self.getElement(dest);
3174var _35c=dest.parentNode;
3175if(src){
3176src=self.coerceToDOM(self.getElement(src),_35c);
3177_35c.replaceChild(src,dest);
3178}else{
3179_35c.removeChild(dest);
3180}
3181return src;
3182},getElement:function(id){
3183var self=MochiKit.DOM;
3184if(arguments.length==1){
3185return ((typeof (id)=="string")?self._document.getElementById(id):id);
3186}else{
3187return MochiKit.Base.map(self.getElement,arguments);
3188}
3189},getElementsByTagAndClassName:function(_35f,_360,_361){
3190var self=MochiKit.DOM;
3191if(typeof (_35f)=="undefined"||_35f===null){
3192_35f="*";
3193}
3194if(typeof (_361)=="undefined"||_361===null){
3195_361=self._document;
3196}
3197_361=self.getElement(_361);
3198if(_361==null){
3199return [];
3200}
3201var _363=(_361.getElementsByTagName(_35f)||self._document.all);
3202if(typeof (_360)=="undefined"||_360===null){
3203return MochiKit.Base.extend(null,_363);
3204}
3205var _364=[];
3206for(var i=0;i<_363.length;i++){
3207var _366=_363[i];
3208var cls=_366.className;
3209if(typeof (cls)!="string"){
3210cls=_366.getAttribute("class");
3211}
3212if(typeof (cls)=="string"){
3213var _368=cls.split(" ");
3214for(var j=0;j<_368.length;j++){
3215if(_368[j]==_360){
3216_364.push(_366);
3217break;
3218}
3219}
3220}
3221}
3222return _364;
3223},_newCallStack:function(path,once){
3224var rval=function(){
3225var _36d=arguments.callee.callStack;
3226for(var i=0;i<_36d.length;i++){
3227if(_36d[i].apply(this,arguments)===false){
3228break;
3229}
3230}
3231if(once){
3232try{
3233this[path]=null;
3234}
3235catch(e){
3236}
3237}
3238};
3239rval.callStack=[];
3240return rval;
3241},addToCallStack:function(_36f,path,func,once){
3242var self=MochiKit.DOM;
3243var _374=_36f[path];
3244var _375=_374;
3245if(!(typeof (_374)=="function"&&typeof (_374.callStack)=="object"&&_374.callStack!==null)){
3246_375=self._newCallStack(path,once);
3247if(typeof (_374)=="function"){
3248_375.callStack.push(_374);
3249}
3250_36f[path]=_375;
3251}
3252_375.callStack.push(func);
3253},addLoadEvent:function(func){
3254var self=MochiKit.DOM;
3255self.addToCallStack(self._window,"onload",func,true);
3256},focusOnLoad:function(_378){
3257var self=MochiKit.DOM;
3258self.addLoadEvent(function(){
3259_378=self.getElement(_378);
3260if(_378){
3261_378.focus();
3262}
3263});
3264},setElementClass:function(_37a,_37b){
3265var self=MochiKit.DOM;
3266var obj=self.getElement(_37a);
3267if(self.attributeArray.compliant){
3268obj.setAttribute("class",_37b);
3269}else{
3270obj.setAttribute("className",_37b);
3271}
3272},toggleElementClass:function(_37e){
3273var self=MochiKit.DOM;
3274for(var i=1;i<arguments.length;i++){
3275var obj=self.getElement(arguments[i]);
3276if(!self.addElementClass(obj,_37e)){
3277self.removeElementClass(obj,_37e);
3278}
3279}
3280},addElementClass:function(_382,_383){
3281var self=MochiKit.DOM;
3282var obj=self.getElement(_382);
3283var cls=obj.className;
3284if(typeof (cls)!="string"){
3285cls=obj.getAttribute("class");
3286}
3287if(typeof (cls)!="string"||cls.length===0){
3288self.setElementClass(obj,_383);
3289return true;
3290}
3291if(cls==_383){
3292return false;
3293}
3294var _387=cls.split(" ");
3295for(var i=0;i<_387.length;i++){
3296if(_387[i]==_383){
3297return false;
3298}
3299}
3300self.setElementClass(obj,cls+" "+_383);
3301return true;
3302},removeElementClass:function(_389,_38a){
3303var self=MochiKit.DOM;
3304var obj=self.getElement(_389);
3305var cls=obj.className;
3306if(typeof (cls)!="string"){
3307cls=obj.getAttribute("class");
3308}
3309if(typeof (cls)!="string"||cls.length===0){
3310return false;
3311}
3312if(cls==_38a){
3313self.setElementClass(obj,"");
3314return true;
3315}
3316var _38e=cls.split(" ");
3317for(var i=0;i<_38e.length;i++){
3318if(_38e[i]==_38a){
3319_38e.splice(i,1);
3320self.setElementClass(obj,_38e.join(" "));
3321return true;
3322}
3323}
3324return false;
3325},swapElementClass:function(_390,_391,_392){
3326var obj=MochiKit.DOM.getElement(_390);
3327var res=MochiKit.DOM.removeElementClass(obj,_391);
3328if(res){
3329MochiKit.DOM.addElementClass(obj,_392);
3330}
3331return res;
3332},hasElementClass:function(_395,_396){
3333var obj=MochiKit.DOM.getElement(_395);
3334if(obj==null){
3335return false;
3336}
3337var cls=obj.className;
3338if(typeof (cls)!="string"){
3339cls=obj.getAttribute("class");
3340}
3341if(typeof (cls)!="string"){
3342return false;
3343}
3344var _399=cls.split(" ");
3345for(var i=1;i<arguments.length;i++){
3346var good=false;
3347for(var j=0;j<_399.length;j++){
3348if(_399[j]==arguments[i]){
3349good=true;
3350break;
3351}
3352}
3353if(!good){
3354return false;
3355}
3356}
3357return true;
3358},escapeHTML:function(s){
3359return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
3360},toHTML:function(dom){
3361return MochiKit.DOM.emitHTML(dom).join("");
3362},emitHTML:function(dom,lst){
3363if(typeof (lst)=="undefined"||lst===null){
3364lst=[];
3365}
3366var _3a1=[dom];
3367var self=MochiKit.DOM;
3368var _3a3=self.escapeHTML;
3369var _3a4=self.attributeArray;
3370while(_3a1.length){
3371dom=_3a1.pop();
3372if(typeof (dom)=="string"){
3373lst.push(dom);
3374}else{
3375if(dom.nodeType==1){
3376lst.push("<"+dom.tagName.toLowerCase());
3377var _3a5=[];
3378var _3a6=_3a4(dom);
3379for(var i=0;i<_3a6.length;i++){
3380var a=_3a6[i];
3381_3a5.push([" ",a.name,"=\"",_3a3(a.value),"\""]);
3382}
3383_3a5.sort();
3384for(i=0;i<_3a5.length;i++){
3385var _3a9=_3a5[i];
3386for(var j=0;j<_3a9.length;j++){
3387lst.push(_3a9[j]);
3388}
3389}
3390if(dom.hasChildNodes()){
3391lst.push(">");
3392_3a1.push("</"+dom.tagName.toLowerCase()+">");
3393var _3ab=dom.childNodes;
3394for(i=_3ab.length-1;i>=0;i--){
3395_3a1.push(_3ab[i]);
3396}
3397}else{
3398lst.push("/>");
3399}
3400}else{
3401if(dom.nodeType==3){
3402lst.push(_3a3(dom.nodeValue));
3403}
3404}
3405}
3406}
3407return lst;
3408},scrapeText:function(node,_3ad){
3409var rval=[];
3410(function(node){
3411var cn=node.childNodes;
3412if(cn){
3413for(var i=0;i<cn.length;i++){
3414arguments.callee.call(this,cn[i]);
3415}
3416}
3417var _3b2=node.nodeValue;
3418if(typeof (_3b2)=="string"){
3419rval.push(_3b2);
3420}
3421})(MochiKit.DOM.getElement(node));
3422if(_3ad){
3423return rval;
3424}else{
3425return rval.join("");
3426}
3427},removeEmptyTextNodes:function(_3b3){
3428_3b3=MochiKit.DOM.getElement(_3b3);
3429for(var i=0;i<_3b3.childNodes.length;i++){
3430var node=_3b3.childNodes[i];
3431if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
3432node.parentNode.removeChild(node);
3433}
3434}
3435},getFirstElementByTagAndClassName:function(_3b6,_3b7,_3b8){
3436var self=MochiKit.DOM;
3437if(typeof (_3b6)=="undefined"||_3b6===null){
3438_3b6="*";
3439}
3440if(typeof (_3b8)=="undefined"||_3b8===null){
3441_3b8=self._document;
3442}
3443_3b8=self.getElement(_3b8);
3444if(_3b8==null){
3445return null;
3446}
3447var _3ba=(_3b8.getElementsByTagName(_3b6)||self._document.all);
3448if(_3ba.length<=0){
3449return null;
3450}else{
3451if(typeof (_3b7)=="undefined"||_3b7===null){
3452return _3ba[0];
3453}
3454}
3455for(var i=0;i<_3ba.length;i++){
3456var _3bc=_3ba[i];
3457var cls=_3bc.className;
3458if(typeof (cls)!="string"){
3459cls=_3bc.getAttribute("class");
3460}
3461if(typeof (cls)=="string"){
3462var _3be=cls.split(" ");
3463for(var j=0;j<_3be.length;j++){
3464if(_3be[j]==_3b7){
3465return _3bc;
3466}
3467}
3468}
3469}
3470return null;
3471},getFirstParentByTagAndClassName:function(elem,_3c1,_3c2){
3472var self=MochiKit.DOM;
3473elem=self.getElement(elem);
3474if(typeof (_3c1)=="undefined"||_3c1===null){
3475_3c1="*";
3476}else{
3477_3c1=_3c1.toUpperCase();
3478}
3479if(typeof (_3c2)=="undefined"||_3c2===null){
3480_3c2=null;
3481}
3482if(elem){
3483elem=elem.parentNode;
3484}
3485while(elem&&elem.tagName){
3486var _3c4=elem.tagName.toUpperCase();
3487if((_3c1==="*"||_3c1==_3c4)&&(_3c2===null||self.hasElementClass(elem,_3c2))){
3488return elem;
3489}
3490elem=elem.parentNode;
3491}
3492return null;
3493},__new__:function(win){
3494var m=MochiKit.Base;
3495if(typeof (document)!="undefined"){
3496this._document=document;
3497var _3c7="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
3498this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_3c7);
3499}else{
3500if(MochiKit.MockDOM){
3501this._document=MochiKit.MockDOM.document;
3502}
3503}
3504this._window=win;
3505this.domConverters=new m.AdapterRegistry();
3506var _3c8=this._document.createElement("span");
3507var _3c9;
3508if(_3c8&&_3c8.attributes&&_3c8.attributes.length>0){
3509var _3ca=m.filter;
3510_3c9=function(node){
3511return _3ca(_3c9.ignoreAttrFilter,node.attributes);
3512};
3513_3c9.ignoreAttr={};
3514var _3cc=_3c8.attributes;
3515var _3cd=_3c9.ignoreAttr;
3516for(var i=0;i<_3cc.length;i++){
3517var a=_3cc[i];
3518_3cd[a.name]=a.value;
3519}
3520_3c9.ignoreAttrFilter=function(a){
3521return (_3c9.ignoreAttr[a.name]!=a.value);
3522};
3523_3c9.compliant=false;
3524_3c9.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor","cellspacing":"cellSpacing","cellpadding":"cellPadding"};
3525}else{
3526_3c9=function(node){
3527return node.attributes;
3528};
3529_3c9.compliant=true;
3530_3c9.ignoreAttr={};
3531_3c9.renames={};
3532}
3533this.attributeArray=_3c9;
3534var _3d2=function(_3d3,arr){
3535var _3d5=arr[0];
3536var _3d6=arr[1];
3537var _3d7=_3d6.split(".")[1];
3538var str="";
3539str+="if (!MochiKit."+_3d7+") { throw new Error(\"";
3540str+="This function has been deprecated and depends on MochiKit.";
3541str+=_3d7+".\");}";
3542str+="return "+_3d6+".apply(this, arguments);";
3543MochiKit[_3d3][_3d5]=new Function(str);
3544};
3545for(var i=0;i<MochiKit.DOM.DEPRECATED.length;i++){
3546_3d2("DOM",MochiKit.DOM.DEPRECATED[i]);
3547}
3548var _3d9=this.createDOMFunc;
3549this.UL=_3d9("ul");
3550this.OL=_3d9("ol");
3551this.LI=_3d9("li");
3552this.DL=_3d9("dl");
3553this.DT=_3d9("dt");
3554this.DD=_3d9("dd");
3555this.TD=_3d9("td");
3556this.TR=_3d9("tr");
3557this.TBODY=_3d9("tbody");
3558this.THEAD=_3d9("thead");
3559this.TFOOT=_3d9("tfoot");
3560this.TABLE=_3d9("table");
3561this.TH=_3d9("th");
3562this.INPUT=_3d9("input");
3563this.SPAN=_3d9("span");
3564this.A=_3d9("a");
3565this.DIV=_3d9("div");
3566this.IMG=_3d9("img");
3567this.BUTTON=_3d9("button");
3568this.TT=_3d9("tt");
3569this.PRE=_3d9("pre");
3570this.H1=_3d9("h1");
3571this.H2=_3d9("h2");
3572this.H3=_3d9("h3");
3573this.H4=_3d9("h4");
3574this.H5=_3d9("h5");
3575this.H6=_3d9("h6");
3576this.BR=_3d9("br");
3577this.HR=_3d9("hr");
3578this.LABEL=_3d9("label");
3579this.TEXTAREA=_3d9("textarea");
3580this.FORM=_3d9("form");
3581this.P=_3d9("p");
3582this.SELECT=_3d9("select");
3583this.OPTION=_3d9("option");
3584this.OPTGROUP=_3d9("optgroup");
3585this.LEGEND=_3d9("legend");
3586this.FIELDSET=_3d9("fieldset");
3587this.STRONG=_3d9("strong");
3588this.CANVAS=_3d9("canvas");
3589this.$=this.getElement;
3590this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
3591m.nameFunctions(this);
3592}});
3593MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
3594if(MochiKit.__export__){
3595withWindow=MochiKit.DOM.withWindow;
3596withDocument=MochiKit.DOM.withDocument;
3597}
3598MochiKit.Base._exportSymbols(this,MochiKit.DOM);
3599MochiKit.Base._deps("Selector",["Base","DOM","Iter"]);
3600MochiKit.Selector.NAME="MochiKit.Selector";
3601MochiKit.Selector.VERSION="1.4.2";
3602MochiKit.Selector.__repr__=function(){
3603return "["+this.NAME+" "+this.VERSION+"]";
3604};
3605MochiKit.Selector.toString=function(){
3606return this.__repr__();
3607};
3608MochiKit.Selector.EXPORT=["Selector","findChildElements","findDocElements","$$"];
3609MochiKit.Selector.EXPORT_OK=[];
3610MochiKit.Selector.Selector=function(_3da){
3611this.params={classNames:[],pseudoClassNames:[]};
3612this.expression=_3da.toString().replace(/(^\s+|\s+$)/g,"");
3613this.parseExpression();
3614this.compileMatcher();
3615};
3616MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
3617function abort(_3db){
3618throw "Parse error in selector: "+_3db;
3619}
3620if(this.expression==""){
3621abort("empty expression");
3622}
3623var repr=MochiKit.Base.repr;
3624var _3dd=this.params;
3625var expr=this.expression;
3626var _3df,_3e0,_3e1,rest;
3627while(_3df=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
3628_3dd.attributes=_3dd.attributes||[];
3629_3dd.attributes.push({name:_3df[2],operator:_3df[3],value:_3df[4]||_3df[5]||""});
3630expr=_3df[1];
3631}
3632if(expr=="*"){
3633return this.params.wildcard=true;
3634}
3635while(_3df=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
3636_3e0=_3df[1];
3637_3e1=_3df[2];
3638rest=_3df[3];
3639switch(_3e0){
3640case "#":
3641_3dd.id=_3e1;
3642break;
3643case ".":
3644_3dd.classNames.push(_3e1);
3645break;
3646case ":":
3647_3dd.pseudoClassNames.push(_3e1);
3648break;
3649case "":
3650case undefined:
3651_3dd.tagName=_3e1.toUpperCase();
3652break;
3653default:
3654abort(repr(expr));
3655}
3656expr=rest;
3657}
3658if(expr.length>0){
3659abort(repr(expr));
3660}
3661},buildMatchExpression:function(){
3662var repr=MochiKit.Base.repr;
3663var _3e4=this.params;
3664var _3e5=[];
3665var _3e6,i;
3666function childElements(_3e8){
3667return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_3e8+".childNodes)";
3668}
3669if(_3e4.wildcard){
3670_3e5.push("true");
3671}
3672if(_3e6=_3e4.id){
3673_3e5.push("element.id == "+repr(_3e6));
3674}
3675if(_3e6=_3e4.tagName){
3676_3e5.push("element.tagName.toUpperCase() == "+repr(_3e6));
3677}
3678if((_3e6=_3e4.classNames).length>0){
3679for(i=0;i<_3e6.length;i++){
3680_3e5.push("MochiKit.DOM.hasElementClass(element, "+repr(_3e6[i])+")");
3681}
3682}
3683if((_3e6=_3e4.pseudoClassNames).length>0){
3684for(i=0;i<_3e6.length;i++){
3685var _3e9=_3e6[i].match(/^([^(]+)(?:\((.*)\))?$/);
3686var _3ea=_3e9[1];
3687var _3eb=_3e9[2];
3688switch(_3ea){
3689case "root":
3690_3e5.push("element.nodeType == 9 || element === element.ownerDocument.documentElement");
3691break;
3692case "nth-child":
3693case "nth-last-child":
3694case "nth-of-type":
3695case "nth-last-of-type":
3696_3e9=_3eb.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
3697if(!_3e9){
3698throw "Invalid argument to pseudo element nth-child: "+_3eb;
3699}
3700var a,b;
3701if(_3e9[0]=="odd"){
3702a=2;
3703b=1;
3704}else{
3705if(_3e9[0]=="even"){
3706a=2;
3707b=0;
3708}else{
3709a=_3e9[2]&&parseInt(_3e9)||null;
3710b=parseInt(_3e9[3]);
3711}
3712}
3713_3e5.push("this.nthChild(element,"+a+","+b+","+!!_3ea.match("^nth-last")+","+!!_3ea.match("of-type$")+")");
3714break;
3715case "first-child":
3716_3e5.push("this.nthChild(element, null, 1)");
3717break;
3718case "last-child":
3719_3e5.push("this.nthChild(element, null, 1, true)");
3720break;
3721case "first-of-type":
3722_3e5.push("this.nthChild(element, null, 1, false, true)");
3723break;
3724case "last-of-type":
3725_3e5.push("this.nthChild(element, null, 1, true, true)");
3726break;
3727case "only-child":
3728_3e5.push(childElements("element.parentNode")+".length == 1");
3729break;
3730case "only-of-type":
3731_3e5.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1");
3732break;
3733case "empty":
3734_3e5.push("element.childNodes.length == 0");
3735break;
3736case "enabled":
3737_3e5.push("(this.isUIElement(element) && element.disabled === false)");
3738break;
3739case "disabled":
3740_3e5.push("(this.isUIElement(element) && element.disabled === true)");
3741break;
3742case "checked":
3743_3e5.push("(this.isUIElement(element) && element.checked === true)");
3744break;
3745case "not":
3746var _3ee=new MochiKit.Selector.Selector(_3eb);
3747_3e5.push("!( "+_3ee.buildMatchExpression()+")");
3748break;
3749}
3750}
3751}
3752if(_3e6=_3e4.attributes){
3753MochiKit.Base.map(function(_3ef){
3754var _3f0="MochiKit.DOM.getNodeAttribute(element, "+repr(_3ef.name)+")";
3755var _3f1=function(_3f2){
3756return _3f0+".split("+repr(_3f2)+")";
3757};
3758_3e5.push(_3f0+" != null");
3759switch(_3ef.operator){
3760case "=":
3761_3e5.push(_3f0+" == "+repr(_3ef.value));
3762break;
3763case "~=":
3764_3e5.push("MochiKit.Base.findValue("+_3f1(" ")+", "+repr(_3ef.value)+") > -1");
3765break;
3766case "^=":
3767_3e5.push(_3f0+".substring(0, "+_3ef.value.length+") == "+repr(_3ef.value));
3768break;
3769case "$=":
3770_3e5.push(_3f0+".substring("+_3f0+".length - "+_3ef.value.length+") == "+repr(_3ef.value));
3771break;
3772case "*=":
3773_3e5.push(_3f0+".match("+repr(_3ef.value)+")");
3774break;
3775case "|=":
3776_3e5.push(_3f1("-")+"[0].toUpperCase() == "+repr(_3ef.value.toUpperCase()));
3777break;
3778case "!=":
3779_3e5.push(_3f0+" != "+repr(_3ef.value));
3780break;
3781case "":
3782case undefined:
3783break;
3784default:
3785throw "Unknown operator "+_3ef.operator+" in selector";
3786}
3787},_3e6);
3788}
3789return _3e5.join(" && ");
3790},compileMatcher:function(){
3791var code="return (!element.tagName) ? false : "+this.buildMatchExpression()+";";
3792this.match=new Function("element",code);
3793},nthChild:function(_3f4,a,b,_3f7,_3f8){
3794var _3f9=MochiKit.Base.filter(function(node){
3795return node.nodeType==1;
3796},_3f4.parentNode.childNodes);
3797if(_3f8){
3798_3f9=MochiKit.Base.filter(function(node){
3799return node.tagName==_3f4.tagName;
3800},_3f9);
3801}
3802if(_3f7){
3803_3f9=MochiKit.Iter.reversed(_3f9);
3804}
3805if(a){
3806var _3fc=MochiKit.Base.findIdentical(_3f9,_3f4);
3807return ((_3fc+1-b)/a)%1==0;
3808}else{
3809return b==MochiKit.Base.findIdentical(_3f9,_3f4)+1;
3810}
3811},isUIElement:function(_3fd){
3812return MochiKit.Base.findValue(["input","button","select","option","textarea","object"],_3fd.tagName.toLowerCase())>-1;
3813},findElements:function(_3fe,axis){
3814var _400;
3815if(axis==undefined){
3816axis="";
3817}
3818function inScope(_401,_402){
3819if(axis==""){
3820return MochiKit.DOM.isChildNode(_401,_402);
3821}else{
3822if(axis==">"){
3823return _401.parentNode===_402;
3824}else{
3825if(axis=="+"){
3826return _401===nextSiblingElement(_402);
3827}else{
3828if(axis=="~"){
3829var _403=_402;
3830while(_403=nextSiblingElement(_403)){
3831if(_401===_403){
3832return true;
3833}
3834}
3835return false;
3836}else{
3837throw "Invalid axis: "+axis;
3838}
3839}
3840}
3841}
3842}
3843if(_400=MochiKit.DOM.getElement(this.params.id)){
3844if(this.match(_400)){
3845if(!_3fe||inScope(_400,_3fe)){
3846return [_400];
3847}
3848}
3849}
3850function nextSiblingElement(node){
3851node=node.nextSibling;
3852while(node&&node.nodeType!=1){
3853node=node.nextSibling;
3854}
3855return node;
3856}
3857if(axis==""){
3858_3fe=(_3fe||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||"*");
3859}else{
3860if(axis==">"){
3861if(!_3fe){
3862throw "> combinator not allowed without preceeding expression";
3863}
3864_3fe=MochiKit.Base.filter(function(node){
3865return node.nodeType==1;
3866},_3fe.childNodes);
3867}else{
3868if(axis=="+"){
3869if(!_3fe){
3870throw "+ combinator not allowed without preceeding expression";
3871}
3872_3fe=nextSiblingElement(_3fe)&&[nextSiblingElement(_3fe)];
3873}else{
3874if(axis=="~"){
3875if(!_3fe){
3876throw "~ combinator not allowed without preceeding expression";
3877}
3878var _406=[];
3879while(nextSiblingElement(_3fe)){
3880_3fe=nextSiblingElement(_3fe);
3881_406.push(_3fe);
3882}
3883_3fe=_406;
3884}
3885}
3886}
3887}
3888if(!_3fe){
3889return [];
3890}
3891var _407=MochiKit.Base.filter(MochiKit.Base.bind(function(_408){
3892return this.match(_408);
3893},this),_3fe);
3894return _407;
3895},repr:function(){
3896return "Selector("+this.expression+")";
3897},toString:MochiKit.Base.forwardCall("repr")};
3898MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_409,_40a){
3899var uniq=function(arr){
3900var res=[];
3901for(var i=0;i<arr.length;i++){
3902if(MochiKit.Base.findIdentical(res,arr[i])<0){
3903res.push(arr[i]);
3904}
3905}
3906return res;
3907};
3908return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_40f){
3909var _410="";
3910var _411=function(_412,expr){
3911if(match=expr.match(/^[>+~]$/)){
3912_410=match[0];
3913return _412;
3914}else{
3915var _414=new MochiKit.Selector.Selector(expr);
3916var _415=MochiKit.Iter.reduce(function(_416,_417){
3917return MochiKit.Base.extend(_416,_414.findElements(_417||_409,_410));
3918},_412,[]);
3919_410="";
3920return _415;
3921}
3922};
3923var _418=_40f.replace(/(^\s+|\s+$)/g,"").split(/\s+/);
3924return uniq(MochiKit.Iter.reduce(_411,_418,[null]));
3925},_40a));
3926},findDocElements:function(){
3927return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
3928},__new__:function(){
3929var m=MochiKit.Base;
3930this.$$=this.findDocElements;
3931this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
3932m.nameFunctions(this);
3933}});
3934MochiKit.Selector.__new__();
3935MochiKit.Base._exportSymbols(this,MochiKit.Selector);
3936MochiKit.Base._deps("Style",["Base","DOM"]);
3937MochiKit.Style.NAME="MochiKit.Style";
3938MochiKit.Style.VERSION="1.4.2";
3939MochiKit.Style.__repr__=function(){
3940return "["+this.NAME+" "+this.VERSION+"]";
3941};
3942MochiKit.Style.toString=function(){
3943return this.__repr__();
3944};
3945MochiKit.Style.EXPORT_OK=[];
3946MochiKit.Style.EXPORT=["setStyle","setOpacity","getStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","makePositioned","undoPositioned","makeClipping","undoClipping","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"];
3947MochiKit.Style.Dimensions=function(w,h){
3948this.w=w;
3949this.h=h;
3950};
3951MochiKit.Style.Dimensions.prototype.__repr__=function(){
3952var repr=MochiKit.Base.repr;
3953return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
3954};
3955MochiKit.Style.Dimensions.prototype.toString=function(){
3956return this.__repr__();
3957};
3958MochiKit.Style.Coordinates=function(x,y){
3959this.x=x;
3960this.y=y;
3961};
3962MochiKit.Style.Coordinates.prototype.__repr__=function(){
3963var repr=MochiKit.Base.repr;
3964return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
3965};
3966MochiKit.Style.Coordinates.prototype.toString=function(){
3967return this.__repr__();
3968};
3969MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_421){
3970var dom=MochiKit.DOM;
3971var d=dom._document;
3972elem=dom.getElement(elem);
3973_421=MochiKit.Base.camelize(_421);
3974if(!elem||elem==d){
3975return undefined;
3976}
3977if(_421=="opacity"&&typeof (elem.filters)!="undefined"){
3978var _424=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
3979if(_424&&_424[1]){
3980return parseFloat(_424[1])/100;
3981}
3982return 1;
3983}
3984if(_421=="float"||_421=="cssFloat"||_421=="styleFloat"){
3985if(elem.style["float"]){
3986return elem.style["float"];
3987}else{
3988if(elem.style.cssFloat){
3989return elem.style.cssFloat;
3990}else{
3991if(elem.style.styleFloat){
3992return elem.style.styleFloat;
3993}else{
3994return "none";
3995}
3996}
3997}
3998}
3999var _425=elem.style?elem.style[_421]:null;
4000if(!_425){
4001if(d.defaultView&&d.defaultView.getComputedStyle){
4002var css=d.defaultView.getComputedStyle(elem,null);
4003_421=_421.replace(/([A-Z])/g,"-$1").toLowerCase();
4004_425=css?css.getPropertyValue(_421):null;
4005}else{
4006if(elem.currentStyle){
4007_425=elem.currentStyle[_421];
4008if(/^\d/.test(_425)&&!/px$/.test(_425)&&_421!="fontWeight"){
4009var left=elem.style.left;
4010var _428=elem.runtimeStyle.left;
4011elem.runtimeStyle.left=elem.currentStyle.left;
4012elem.style.left=_425||0;
4013_425=elem.style.pixelLeft+"px";
4014elem.style.left=left;
4015elem.runtimeStyle.left=_428;
4016}
4017}
4018}
4019}
4020if(_421=="opacity"){
4021_425=parseFloat(_425);
4022}
4023if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.findValue(["left","top","right","bottom"],_421)!=-1)){
4024if(MochiKit.Style.getStyle(elem,"position")=="static"){
4025_425="auto";
4026}
4027}
4028return _425=="auto"?null:_425;
4029},setStyle:function(elem,_42a){
4030elem=MochiKit.DOM.getElement(elem);
4031for(var name in _42a){
4032switch(name){
4033case "opacity":
4034MochiKit.Style.setOpacity(elem,_42a[name]);
4035break;
4036case "float":
4037case "cssFloat":
4038case "styleFloat":
4039if(typeof (elem.style["float"])!="undefined"){
4040elem.style["float"]=_42a[name];
4041}else{
4042if(typeof (elem.style.cssFloat)!="undefined"){
4043elem.style.cssFloat=_42a[name];
4044}else{
4045elem.style.styleFloat=_42a[name];
4046}
4047}
4048break;
4049default:
4050elem.style[MochiKit.Base.camelize(name)]=_42a[name];
4051}
4052}
4053},setOpacity:function(elem,o){
4054elem=MochiKit.DOM.getElement(elem);
4055var self=MochiKit.Style;
4056if(o==1){
4057var _42f=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
4058elem.style["opacity"]=_42f?0.999999:1;
4059if(/MSIE/.test(navigator.userAgent)){
4060elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"");
4061}
4062}else{
4063if(o<0.00001){
4064o=0;
4065}
4066elem.style["opacity"]=o;
4067if(/MSIE/.test(navigator.userAgent)){
4068elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")";
4069}
4070}
4071},getElementPosition:function(elem,_431){
4072var self=MochiKit.Style;
4073var dom=MochiKit.DOM;
4074elem=dom.getElement(elem);
4075if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode===null||self.getStyle(elem,"display")=="none"))){
4076return undefined;
4077}
4078var c=new self.Coordinates(0,0);
4079var box=null;
4080var _436=null;
4081var d=MochiKit.DOM._document;
4082var de=d.documentElement;
4083var b=d.body;
4084if(!elem.parentNode&&elem.x&&elem.y){
4085c.x+=elem.x||0;
4086c.y+=elem.y||0;
4087}else{
4088if(elem.getBoundingClientRect){
4089box=elem.getBoundingClientRect();
4090c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
4091c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
4092}else{
4093if(elem.offsetParent){
4094c.x+=elem.offsetLeft;
4095c.y+=elem.offsetTop;
4096_436=elem.offsetParent;
4097if(_436!=elem){
4098while(_436){
4099c.x+=parseInt(_436.style.borderLeftWidth)||0;
4100c.y+=parseInt(_436.style.borderTopWidth)||0;
4101c.x+=_436.offsetLeft;
4102c.y+=_436.offsetTop;
4103_436=_436.offsetParent;
4104}
4105}
4106var ua=navigator.userAgent.toLowerCase();
4107if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("AppleWebKit")!=-1&&self.getStyle(elem,"position")=="absolute")){
4108c.x-=b.offsetLeft;
4109c.y-=b.offsetTop;
4110}
4111if(elem.parentNode){
4112_436=elem.parentNode;
4113}else{
4114_436=null;
4115}
4116while(_436){
4117var _43b=_436.tagName.toUpperCase();
4118if(_43b==="BODY"||_43b==="HTML"){
4119break;
4120}
4121var disp=self.getStyle(_436,"display");
4122if(disp.search(/^inline|table-row.*$/i)){
4123c.x-=_436.scrollLeft;
4124c.y-=_436.scrollTop;
4125}
4126if(_436.parentNode){
4127_436=_436.parentNode;
4128}else{
4129_436=null;
4130}
4131}
4132}
4133}
4134}
4135if(typeof (_431)!="undefined"){
4136_431=arguments.callee(_431);
4137if(_431){
4138c.x-=(_431.x||0);
4139c.y-=(_431.y||0);
4140}
4141}
4142return c;
4143},setElementPosition:function(elem,_43e,_43f){
4144elem=MochiKit.DOM.getElement(elem);
4145if(typeof (_43f)=="undefined"){
4146_43f="px";
4147}
4148var _440={};
4149var _441=MochiKit.Base.isUndefinedOrNull;
4150if(!_441(_43e.x)){
4151_440["left"]=_43e.x+_43f;
4152}
4153if(!_441(_43e.y)){
4154_440["top"]=_43e.y+_43f;
4155}
4156MochiKit.DOM.updateNodeAttributes(elem,{"style":_440});
4157},makePositioned:function(_442){
4158_442=MochiKit.DOM.getElement(_442);
4159var pos=MochiKit.Style.getStyle(_442,"position");
4160if(pos=="static"||!pos){
4161_442.style.position="relative";
4162if(/Opera/.test(navigator.userAgent)){
4163_442.style.top=0;
4164_442.style.left=0;
4165}
4166}
4167},undoPositioned:function(_444){
4168_444=MochiKit.DOM.getElement(_444);
4169if(_444.style.position=="relative"){
4170_444.style.position=_444.style.top=_444.style.left=_444.style.bottom=_444.style.right="";
4171}
4172},makeClipping:function(_445){
4173_445=MochiKit.DOM.getElement(_445);
4174var s=_445.style;
4175var _447={"overflow":s.overflow,"overflow-x":s.overflowX,"overflow-y":s.overflowY};
4176if((MochiKit.Style.getStyle(_445,"overflow")||"visible")!="hidden"){
4177_445.style.overflow="hidden";
4178_445.style.overflowX="hidden";
4179_445.style.overflowY="hidden";
4180}
4181return _447;
4182},undoClipping:function(_448,_449){
4183_448=MochiKit.DOM.getElement(_448);
4184if(typeof (_449)=="string"){
4185_448.style.overflow=_449;
4186}else{
4187if(_449!=null){
4188_448.style.overflow=_449["overflow"];
4189_448.style.overflowX=_449["overflow-x"];
4190_448.style.overflowY=_449["overflow-y"];
4191}
4192}
4193},getElementDimensions:function(elem,_44b){
4194var self=MochiKit.Style;
4195var dom=MochiKit.DOM;
4196if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
4197return new self.Dimensions(elem.w||0,elem.h||0);
4198}
4199elem=dom.getElement(elem);
4200if(!elem){
4201return undefined;
4202}
4203var disp=self.getStyle(elem,"display");
4204if(disp=="none"||disp==""||typeof (disp)=="undefined"){
4205var s=elem.style;
4206var _450=s.visibility;
4207var _451=s.position;
4208var _452=s.display;
4209s.visibility="hidden";
4210s.position="absolute";
4211s.display=self._getDefaultDisplay(elem);
4212var _453=elem.offsetWidth;
4213var _454=elem.offsetHeight;
4214s.display=_452;
4215s.position=_451;
4216s.visibility=_450;
4217}else{
4218_453=elem.offsetWidth||0;
4219_454=elem.offsetHeight||0;
4220}
4221if(_44b){
4222var _455="colSpan" in elem&&"rowSpan" in elem;
4223var _456=(_455&&elem.parentNode&&self.getStyle(elem.parentNode,"borderCollapse")=="collapse");
4224if(_456){
4225if(/MSIE/.test(navigator.userAgent)){
4226var _457=elem.previousSibling?0.5:1;
4227var _458=elem.nextSibling?0.5:1;
4228}else{
4229var _457=0.5;
4230var _458=0.5;
4231}
4232}else{
4233var _457=1;
4234var _458=1;
4235}
4236_453-=Math.round((parseFloat(self.getStyle(elem,"paddingLeft"))||0)+(parseFloat(self.getStyle(elem,"paddingRight"))||0)+_457*(parseFloat(self.getStyle(elem,"borderLeftWidth"))||0)+_458*(parseFloat(self.getStyle(elem,"borderRightWidth"))||0));
4237if(_455){
4238if(/Gecko|Opera/.test(navigator.userAgent)&&!/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent)){
4239var _459=0;
4240}else{
4241if(/MSIE/.test(navigator.userAgent)){
4242var _459=1;
4243}else{
4244var _459=_456?0.5:1;
4245}
4246}
4247}else{
4248var _459=1;
4249}
4250_454-=Math.round((parseFloat(self.getStyle(elem,"paddingTop"))||0)+(parseFloat(self.getStyle(elem,"paddingBottom"))||0)+_459*((parseFloat(self.getStyle(elem,"borderTopWidth"))||0)+(parseFloat(self.getStyle(elem,"borderBottomWidth"))||0)));
4251}
4252return new self.Dimensions(_453,_454);
4253},setElementDimensions:function(elem,_45b,_45c){
4254elem=MochiKit.DOM.getElement(elem);
4255if(typeof (_45c)=="undefined"){
4256_45c="px";
4257}
4258var _45d={};
4259var _45e=MochiKit.Base.isUndefinedOrNull;
4260if(!_45e(_45b.w)){
4261_45d["width"]=_45b.w+_45c;
4262}
4263if(!_45e(_45b.h)){
4264_45d["height"]=_45b.h+_45c;
4265}
4266MochiKit.DOM.updateNodeAttributes(elem,{"style":_45d});
4267},_getDefaultDisplay:function(elem){
4268var self=MochiKit.Style;
4269var dom=MochiKit.DOM;
4270elem=dom.getElement(elem);
4271if(!elem){
4272return undefined;
4273}
4274var _462=elem.tagName.toUpperCase();
4275return self._defaultDisplay[_462]||"block";
4276},setDisplayForElement:function(_463,_464){
4277var _465=MochiKit.Base.extend(null,arguments,1);
4278var _466=MochiKit.DOM.getElement;
4279for(var i=0;i<_465.length;i++){
4280_464=_466(_465[i]);
4281if(_464){
4282_464.style.display=_463;
4283}
4284}
4285},getViewportDimensions:function(){
4286var d=new MochiKit.Style.Dimensions();
4287var w=MochiKit.DOM._window;
4288var b=MochiKit.DOM._document.body;
4289if(w.innerWidth){
4290d.w=w.innerWidth;
4291d.h=w.innerHeight;
4292}else{
4293if(b&&b.parentElement&&b.parentElement.clientWidth){
4294d.w=b.parentElement.clientWidth;
4295d.h=b.parentElement.clientHeight;
4296}else{
4297if(b&&b.clientWidth){
4298d.w=b.clientWidth;
4299d.h=b.clientHeight;
4300}
4301}
4302}
4303return d;
4304},getViewportPosition:function(){
4305var c=new MochiKit.Style.Coordinates(0,0);
4306var d=MochiKit.DOM._document;
4307var de=d.documentElement;
4308var db=d.body;
4309if(de&&(de.scrollTop||de.scrollLeft)){
4310c.x=de.scrollLeft;
4311c.y=de.scrollTop;
4312}else{
4313if(db){
4314c.x=db.scrollLeft;
4315c.y=db.scrollTop;
4316}
4317}
4318return c;
4319},__new__:function(){
4320var m=MochiKit.Base;
4321var _470=["A","ABBR","ACRONYM","B","BASEFONT","BDO","BIG","BR","CITE","CODE","DFN","EM","FONT","I","IMG","KBD","LABEL","Q","S","SAMP","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","TEXTAREA","TT","U","VAR"];
4322this._defaultDisplay={"TABLE":"table","THEAD":"table-header-group","TBODY":"table-row-group","TFOOT":"table-footer-group","COLGROUP":"table-column-group","COL":"table-column","TR":"table-row","TD":"table-cell","TH":"table-cell","CAPTION":"table-caption","LI":"list-item","INPUT":"inline-block","SELECT":"inline-block"};
4323if(/MSIE/.test(navigator.userAgent)){
4324for(var k in this._defaultDisplay){
4325var v=this._defaultDisplay[k];
4326if(v.indexOf("table")==0){
4327this._defaultDisplay[k]="block";
4328}
4329}
4330}
4331for(var i=0;i<_470.length;i++){
4332this._defaultDisplay[_470[i]]="inline";
4333}
4334this.elementPosition=this.getElementPosition;
4335this.elementDimensions=this.getElementDimensions;
4336this.hideElement=m.partial(this.setDisplayForElement,"none");
4337this.showElement=m.partial(this.setDisplayForElement,"block");
4338this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
4339m.nameFunctions(this);
4340}});
4341MochiKit.Style.__new__();
4342MochiKit.Base._exportSymbols(this,MochiKit.Style);
4343MochiKit.Base._deps("LoggingPane",["Base","Logging"]);
4344MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
4345MochiKit.LoggingPane.VERSION="1.4.2";
4346MochiKit.LoggingPane.__repr__=function(){
4347return "["+this.NAME+" "+this.VERSION+"]";
4348};
4349MochiKit.LoggingPane.toString=function(){
4350return this.__repr__();
4351};
4352MochiKit.LoggingPane.createLoggingPane=function(_474){
4353var m=MochiKit.LoggingPane;
4354_474=!(!_474);
4355if(m._loggingPane&&m._loggingPane.inline!=_474){
4356m._loggingPane.closePane();
4357m._loggingPane=null;
4358}
4359if(!m._loggingPane||m._loggingPane.closed){
4360m._loggingPane=new m.LoggingPane(_474,MochiKit.Logging.logger);
4361}
4362return m._loggingPane;
4363};
4364MochiKit.LoggingPane.LoggingPane=function(_476,_477){
4365if(typeof (_477)=="undefined"||_477===null){
4366_477=MochiKit.Logging.logger;
4367}
4368this.logger=_477;
4369var _478=MochiKit.Base.update;
4370var _479=MochiKit.Base.updatetree;
4371var bind=MochiKit.Base.bind;
4372var _47b=MochiKit.Base.clone;
4373var win=window;
4374var uid="_MochiKit_LoggingPane";
4375if(typeof (MochiKit.DOM)!="undefined"){
4376win=MochiKit.DOM.currentWindow();
4377}
4378if(!_476){
4379var url=win.location.href.split("?")[0].replace(/[#:\/.><&%-]/g,"_");
4380var name=uid+"_"+url;
4381var nwin=win.open("",name,"dependent,resizable,height=200");
4382if(!nwin){
4383alert("Not able to open debugging window due to pop-up blocking.");
4384return undefined;
4385}
4386nwin.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" "+"\"http://www.w3.org/TR/html4/loose.dtd\">"+"<html><head><title>[MochiKit.LoggingPane]</title></head>"+"<body></body></html>");
4387nwin.document.close();
4388nwin.document.title+=" "+win.document.title;
4389win=nwin;
4390}
4391var doc=win.document;
4392this.doc=doc;
4393var _482=doc.getElementById(uid);
4394var _483=!!_482;
4395if(_482&&typeof (_482.loggingPane)!="undefined"){
4396_482.loggingPane.logger=this.logger;
4397_482.loggingPane.buildAndApplyFilter();
4398return _482.loggingPane;
4399}
4400if(_483){
4401var _484;
4402while((_484=_482.firstChild)){
4403_482.removeChild(_484);
4404}
4405}else{
4406_482=doc.createElement("div");
4407_482.id=uid;
4408}
4409_482.loggingPane=this;
4410var _485=doc.createElement("input");
4411var _486=doc.createElement("input");
4412var _487=doc.createElement("button");
4413var _488=doc.createElement("button");
4414var _489=doc.createElement("button");
4415var _48a=doc.createElement("button");
4416var _48b=doc.createElement("div");
4417var _48c=doc.createElement("div");
4418var _48d=uid+"_Listener";
4419this.colorTable=_47b(this.colorTable);
4420var _48e=[];
4421var _48f=null;
4422var _490=function(msg){
4423var _492=msg.level;
4424if(typeof (_492)=="number"){
4425_492=MochiKit.Logging.LogLevel[_492];
4426}
4427return _492;
4428};
4429var _493=function(msg){
4430return msg.info.join(" ");
4431};
4432var _495=bind(function(msg){
4433var _497=_490(msg);
4434var text=_493(msg);
4435var c=this.colorTable[_497];
4436var p=doc.createElement("span");
4437p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_497;
4438p.style.cssText="margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: "+c;
4439p.appendChild(doc.createTextNode(_497+": "+text));
4440_48c.appendChild(p);
4441_48c.appendChild(doc.createElement("br"));
4442if(_48b.offsetHeight>_48b.scrollHeight){
4443_48b.scrollTop=0;
4444}else{
4445_48b.scrollTop=_48b.scrollHeight;
4446}
4447},this);
4448var _49b=function(msg){
4449_48e[_48e.length]=msg;
4450_495(msg);
4451};
4452var _49d=function(){
4453var _49e,_49f;
4454try{
4455_49e=new RegExp(_485.value);
4456_49f=new RegExp(_486.value);
4457}
4458catch(e){
4459logDebug("Error in filter regex: "+e.message);
4460return null;
4461}
4462return function(msg){
4463return (_49e.test(_490(msg))&&_49f.test(_493(msg)));
4464};
4465};
4466var _4a1=function(){
4467while(_48c.firstChild){
4468_48c.removeChild(_48c.firstChild);
4469}
4470};
4471var _4a2=function(){
4472_48e=[];
4473_4a1();
4474};
4475var _4a3=bind(function(){
4476if(this.closed){
4477return;
4478}
4479this.closed=true;
4480if(MochiKit.LoggingPane._loggingPane==this){
4481MochiKit.LoggingPane._loggingPane=null;
4482}
4483this.logger.removeListener(_48d);
4484try{
4485try{
4486_482.loggingPane=null;
4487}
4488catch(e){
4489logFatal("Bookmarklet was closed incorrectly.");
4490}
4491if(_476){
4492_482.parentNode.removeChild(_482);
4493}else{
4494this.win.close();
4495}
4496}
4497catch(e){
4498}
4499},this);
4500var _4a4=function(){
4501_4a1();
4502for(var i=0;i<_48e.length;i++){
4503var msg=_48e[i];
4504if(_48f===null||_48f(msg)){
4505_495(msg);
4506}
4507}
4508};
4509this.buildAndApplyFilter=function(){
4510_48f=_49d();
4511_4a4();
4512this.logger.removeListener(_48d);
4513this.logger.addListener(_48d,_48f,_49b);
4514};
4515var _4a7=bind(function(){
4516_48e=this.logger.getMessages();
4517_4a4();
4518},this);
4519var _4a8=bind(function(_4a9){
4520_4a9=_4a9||window.event;
4521key=_4a9.which||_4a9.keyCode;
4522if(key==13){
4523this.buildAndApplyFilter();
4524}
4525},this);
4526var _4aa="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
4527if(_476){
4528_4aa+="; height: 10em; border-top: 2px solid black";
4529}else{
4530_4aa+="; height: 100%;";
4531}
4532_482.style.cssText=_4aa;
4533if(!_483){
4534doc.body.appendChild(_482);
4535}
4536_4aa={"cssText":"width: 33%; display: inline; font: "+this.logFont};
4537_479(_485,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_4a8,"style":_4aa});
4538_482.appendChild(_485);
4539_479(_486,{"value":".*","onkeypress":_4a8,"style":_4aa});
4540_482.appendChild(_486);
4541_4aa="width: 8%; display:inline; font: "+this.logFont;
4542_487.appendChild(doc.createTextNode("Filter"));
4543_487.onclick=bind("buildAndApplyFilter",this);
4544_487.style.cssText=_4aa;
4545_482.appendChild(_487);
4546_488.appendChild(doc.createTextNode("Load"));
4547_488.onclick=_4a7;
4548_488.style.cssText=_4aa;
4549_482.appendChild(_488);
4550_489.appendChild(doc.createTextNode("Clear"));
4551_489.onclick=_4a2;
4552_489.style.cssText=_4aa;
4553_482.appendChild(_489);
4554_48a.appendChild(doc.createTextNode("Close"));
4555_48a.onclick=_4a3;
4556_48a.style.cssText=_4aa;
4557_482.appendChild(_48a);
4558_48b.style.cssText="overflow: auto; width: 100%";
4559_48c.style.cssText="width: 100%; height: "+(_476?"8em":"100%");
4560_48b.appendChild(_48c);
4561_482.appendChild(_48b);
4562this.buildAndApplyFilter();
4563_4a7();
4564if(_476){
4565this.win=undefined;
4566}else{
4567this.win=win;
4568}
4569this.inline=_476;
4570this.closePane=_4a3;
4571this.closed=false;
4572return this;
4573};
4574MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
4575MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
4576MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
4577MochiKit.LoggingPane.__new__=function(){
4578this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
4579MochiKit.Base.nameFunctions(this);
4580MochiKit.LoggingPane._loggingPane=null;
4581};
4582MochiKit.LoggingPane.__new__();
4583MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
4584MochiKit.Base._deps("Color",["Base","DOM","Style"]);
4585MochiKit.Color.NAME="MochiKit.Color";
4586MochiKit.Color.VERSION="1.4.2";
4587MochiKit.Color.__repr__=function(){
4588return "["+this.NAME+" "+this.VERSION+"]";
4589};
4590MochiKit.Color.toString=function(){
4591return this.__repr__();
4592};
4593MochiKit.Color.Color=function(red,_4ac,blue,_4ae){
4594if(typeof (_4ae)=="undefined"||_4ae===null){
4595_4ae=1;
4596}
4597this.rgb={r:red,g:_4ac,b:blue,a:_4ae};
4598};
4599MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_4af){
4600var rgb=this.rgb;
4601var m=MochiKit.Color;
4602return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_4af);
4603},colorWithHue:function(hue){
4604var hsl=this.asHSL();
4605hsl.h=hue;
4606var m=MochiKit.Color;
4607return m.Color.fromHSL(hsl);
4608},colorWithSaturation:function(_4b5){
4609var hsl=this.asHSL();
4610hsl.s=_4b5;
4611var m=MochiKit.Color;
4612return m.Color.fromHSL(hsl);
4613},colorWithLightness:function(_4b8){
4614var hsl=this.asHSL();
4615hsl.l=_4b8;
4616var m=MochiKit.Color;
4617return m.Color.fromHSL(hsl);
4618},darkerColorWithLevel:function(_4bb){
4619var hsl=this.asHSL();
4620hsl.l=Math.max(hsl.l-_4bb,0);
4621var m=MochiKit.Color;
4622return m.Color.fromHSL(hsl);
4623},lighterColorWithLevel:function(_4be){
4624var hsl=this.asHSL();
4625hsl.l=Math.min(hsl.l+_4be,1);
4626var m=MochiKit.Color;
4627return m.Color.fromHSL(hsl);
4628},blendedColor:function(_4c1,_4c2){
4629if(typeof (_4c2)=="undefined"||_4c2===null){
4630_4c2=0.5;
4631}
4632var sf=1-_4c2;
4633var s=this.rgb;
4634var d=_4c1.rgb;
4635var df=_4c2;
4636return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df));
4637},compareRGB:function(_4c7){
4638var a=this.asRGB();
4639var b=_4c7.asRGB();
4640return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
4641},isLight:function(){
4642return this.asHSL().b>0.5;
4643},isDark:function(){
4644return (!this.isLight());
4645},toHSLString:function(){
4646var c=this.asHSL();
4647var ccc=MochiKit.Color.clampColorComponent;
4648var rval=this._hslString;
4649if(!rval){
4650var mid=(ccc(c.h,360).toFixed(0)+","+ccc(c.s,100).toPrecision(4)+"%"+","+ccc(c.l,100).toPrecision(4)+"%");
4651var a=c.a;
4652if(a>=1){
4653a=1;
4654rval="hsl("+mid+")";
4655}else{
4656if(a<=0){
4657a=0;
4658}
4659rval="hsla("+mid+","+a+")";
4660}
4661this._hslString=rval;
4662}
4663return rval;
4664},toRGBString:function(){
4665var c=this.rgb;
4666var ccc=MochiKit.Color.clampColorComponent;
4667var rval=this._rgbString;
4668if(!rval){
4669var mid=(ccc(c.r,255).toFixed(0)+","+ccc(c.g,255).toFixed(0)+","+ccc(c.b,255).toFixed(0));
4670if(c.a!=1){
4671rval="rgba("+mid+","+c.a+")";
4672}else{
4673rval="rgb("+mid+")";
4674}
4675this._rgbString=rval;
4676}
4677return rval;
4678},asRGB:function(){
4679return MochiKit.Base.clone(this.rgb);
4680},toHexString:function(){
4681var m=MochiKit.Color;
4682var c=this.rgb;
4683var ccc=MochiKit.Color.clampColorComponent;
4684var rval=this._hexString;
4685if(!rval){
4686rval=("#"+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
4687this._hexString=rval;
4688}
4689return rval;
4690},asHSV:function(){
4691var hsv=this.hsv;
4692var c=this.rgb;
4693if(typeof (hsv)=="undefined"||hsv===null){
4694hsv=MochiKit.Color.rgbToHSV(this.rgb);
4695this.hsv=hsv;
4696}
4697return MochiKit.Base.clone(hsv);
4698},asHSL:function(){
4699var hsl=this.hsl;
4700var c=this.rgb;
4701if(typeof (hsl)=="undefined"||hsl===null){
4702hsl=MochiKit.Color.rgbToHSL(this.rgb);
4703this.hsl=hsl;
4704}
4705return MochiKit.Base.clone(hsl);
4706},toString:function(){
4707return this.toRGBString();
4708},repr:function(){
4709var c=this.rgb;
4710var col=[c.r,c.g,c.b,c.a];
4711return this.__class__.NAME+"("+col.join(", ")+")";
4712}};
4713MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_4de,blue,_4e0){
4714var _4e1=MochiKit.Color.Color;
4715if(arguments.length==1){
4716var rgb=red;
4717red=rgb.r;
4718_4de=rgb.g;
4719blue=rgb.b;
4720if(typeof (rgb.a)=="undefined"){
4721_4e0=undefined;
4722}else{
4723_4e0=rgb.a;
4724}
4725}
4726return new _4e1(red,_4de,blue,_4e0);
4727},fromHSL:function(hue,_4e4,_4e5,_4e6){
4728var m=MochiKit.Color;
4729return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
4730},fromHSV:function(hue,_4e9,_4ea,_4eb){
4731var m=MochiKit.Color;
4732return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
4733},fromName:function(name){
4734var _4ee=MochiKit.Color.Color;
4735if(name.charAt(0)=="\""){
4736name=name.substr(1,name.length-2);
4737}
4738var _4ef=_4ee._namedColors[name.toLowerCase()];
4739if(typeof (_4ef)=="string"){
4740return _4ee.fromHexString(_4ef);
4741}else{
4742if(name=="transparent"){
4743return _4ee.transparentColor();
4744}
4745}
4746return null;
4747},fromString:function(_4f0){
4748var self=MochiKit.Color.Color;
4749var _4f2=_4f0.substr(0,3);
4750if(_4f2=="rgb"){
4751return self.fromRGBString(_4f0);
4752}else{
4753if(_4f2=="hsl"){
4754return self.fromHSLString(_4f0);
4755}else{
4756if(_4f0.charAt(0)=="#"){
4757return self.fromHexString(_4f0);
4758}
4759}
4760}
4761return self.fromName(_4f0);
4762},fromHexString:function(_4f3){
4763if(_4f3.charAt(0)=="#"){
4764_4f3=_4f3.substring(1);
4765}
4766var _4f4=[];
4767var i,hex;
4768if(_4f3.length==3){
4769for(i=0;i<3;i++){
4770hex=_4f3.substr(i,1);
4771_4f4.push(parseInt(hex+hex,16)/255);
4772}
4773}else{
4774for(i=0;i<6;i+=2){
4775hex=_4f3.substr(i,2);
4776_4f4.push(parseInt(hex,16)/255);
4777}
4778}
4779var _4f7=MochiKit.Color.Color;
4780return _4f7.fromRGB.apply(_4f7,_4f4);
4781},_fromColorString:function(pre,_4f9,_4fa,_4fb){
4782if(_4fb.indexOf(pre)===0){
4783_4fb=_4fb.substring(_4fb.indexOf("(",3)+1,_4fb.length-1);
4784}
4785var _4fc=_4fb.split(/\s*,\s*/);
4786var _4fd=[];
4787for(var i=0;i<_4fc.length;i++){
4788var c=_4fc[i];
4789var val;
4790var _501=c.substring(c.length-3);
4791if(c.charAt(c.length-1)=="%"){
4792val=0.01*parseFloat(c.substring(0,c.length-1));
4793}else{
4794if(_501=="deg"){
4795val=parseFloat(c)/360;
4796}else{
4797if(_501=="rad"){
4798val=parseFloat(c)/(Math.PI*2);
4799}else{
4800val=_4fa[i]*parseFloat(c);
4801}
4802}
4803}
4804_4fd.push(val);
4805}
4806return this[_4f9].apply(this,_4fd);
4807},fromComputedStyle:function(elem,_503){
4808var d=MochiKit.DOM;
4809var cls=MochiKit.Color.Color;
4810for(elem=d.getElement(elem);elem;elem=elem.parentNode){
4811var _506=MochiKit.Style.getStyle.apply(d,arguments);
4812if(!_506){
4813continue;
4814}
4815var _507=cls.fromString(_506);
4816if(!_507){
4817break;
4818}
4819if(_507.asRGB().a>0){
4820return _507;
4821}
4822}
4823return null;
4824},fromBackground:function(elem){
4825var cls=MochiKit.Color.Color;
4826return cls.fromComputedStyle(elem,"backgroundColor","background-color")||cls.whiteColor();
4827},fromText:function(elem){
4828var cls=MochiKit.Color.Color;
4829return cls.fromComputedStyle(elem,"color","color")||cls.blackColor();
4830},namedColors:function(){
4831return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
4832}});
4833MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_50d){
4834v*=_50d;
4835if(v<0){
4836return 0;
4837}else{
4838if(v>_50d){
4839return _50d;
4840}else{
4841return v;
4842}
4843}
4844},_hslValue:function(n1,n2,hue){
4845if(hue>6){
4846hue-=6;
4847}else{
4848if(hue<0){
4849hue+=6;
4850}
4851}
4852var val;
4853if(hue<1){
4854val=n1+(n2-n1)*hue;
4855}else{
4856if(hue<3){
4857val=n2;
4858}else{
4859if(hue<4){
4860val=n1+(n2-n1)*(4-hue);
4861}else{
4862val=n1;
4863}
4864}
4865}
4866return val;
4867},hsvToRGB:function(hue,_513,_514,_515){
4868if(arguments.length==1){
4869var hsv=hue;
4870hue=hsv.h;
4871_513=hsv.s;
4872_514=hsv.v;
4873_515=hsv.a;
4874}
4875var red;
4876var _518;
4877var blue;
4878if(_513===0){
4879red=_514;
4880_518=_514;
4881blue=_514;
4882}else{
4883var i=Math.floor(hue*6);
4884var f=(hue*6)-i;
4885var p=_514*(1-_513);
4886var q=_514*(1-(_513*f));
4887var t=_514*(1-(_513*(1-f)));
4888switch(i){
4889case 1:
4890red=q;
4891_518=_514;
4892blue=p;
4893break;
4894case 2:
4895red=p;
4896_518=_514;
4897blue=t;
4898break;
4899case 3:
4900red=p;
4901_518=q;
4902blue=_514;
4903break;
4904case 4:
4905red=t;
4906_518=p;
4907blue=_514;
4908break;
4909case 5:
4910red=_514;
4911_518=p;
4912blue=q;
4913break;
4914case 6:
4915case 0:
4916red=_514;
4917_518=t;
4918blue=p;
4919break;
4920}
4921}
4922return {r:red,g:_518,b:blue,a:_515};
4923},hslToRGB:function(hue,_520,_521,_522){
4924if(arguments.length==1){
4925var hsl=hue;
4926hue=hsl.h;
4927_520=hsl.s;
4928_521=hsl.l;
4929_522=hsl.a;
4930}
4931var red;
4932var _525;
4933var blue;
4934if(_520===0){
4935red=_521;
4936_525=_521;
4937blue=_521;
4938}else{
4939var m2;
4940if(_521<=0.5){
4941m2=_521*(1+_520);
4942}else{
4943m2=_521+_520-(_521*_520);
4944}
4945var m1=(2*_521)-m2;
4946var f=MochiKit.Color._hslValue;
4947var h6=hue*6;
4948red=f(m1,m2,h6+2);
4949_525=f(m1,m2,h6);
4950blue=f(m1,m2,h6-2);
4951}
4952return {r:red,g:_525,b:blue,a:_522};
4953},rgbToHSV:function(red,_52c,blue,_52e){
4954if(arguments.length==1){
4955var rgb=red;
4956red=rgb.r;
4957_52c=rgb.g;
4958blue=rgb.b;
4959_52e=rgb.a;
4960}
4961var max=Math.max(Math.max(red,_52c),blue);
4962var min=Math.min(Math.min(red,_52c),blue);
4963var hue;
4964var _533;
4965var _534=max;
4966if(min==max){
4967hue=0;
4968_533=0;
4969}else{
4970var _535=(max-min);
4971_533=_535/max;
4972if(red==max){
4973hue=(_52c-blue)/_535;
4974}else{
4975if(_52c==max){
4976hue=2+((blue-red)/_535);
4977}else{
4978hue=4+((red-_52c)/_535);
4979}
4980}
4981hue/=6;
4982if(hue<0){
4983hue+=1;
4984}
4985if(hue>1){
4986hue-=1;
4987}
4988}
4989return {h:hue,s:_533,v:_534,a:_52e};
4990},rgbToHSL:function(red,_537,blue,_539){
4991if(arguments.length==1){
4992var rgb=red;
4993red=rgb.r;
4994_537=rgb.g;
4995blue=rgb.b;
4996_539=rgb.a;
4997}
4998var max=Math.max(red,Math.max(_537,blue));
4999var min=Math.min(red,Math.min(_537,blue));
5000var hue;
5001var _53e;
5002var _53f=(max+min)/2;
5003var _540=max-min;
5004if(_540===0){
5005hue=0;
5006_53e=0;
5007}else{
5008if(_53f<=0.5){
5009_53e=_540/(max+min);
5010}else{
5011_53e=_540/(2-max-min);
5012}
5013if(red==max){
5014hue=(_537-blue)/_540;
5015}else{
5016if(_537==max){
5017hue=2+((blue-red)/_540);
5018}else{
5019hue=4+((red-_537)/_540);
5020}
5021}
5022hue/=6;
5023if(hue<0){
5024hue+=1;
5025}
5026if(hue>1){
5027hue-=1;
5028}
5029}
5030return {h:hue,s:_53e,l:_53f,a:_539};
5031},toColorPart:function(num){
5032num=Math.round(num);
5033var _542=num.toString(16);
5034if(num<16){
5035return "0"+_542;
5036}
5037return _542;
5038},__new__:function(){
5039var m=MochiKit.Base;
5040this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]);
5041this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]);
5042var _544=1/3;
5043var _545={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_544,_544,_544],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_544,2*_544,2*_544],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]};
5044var _546=function(name,r,g,b,a){
5045var rval=this.fromRGB(r,g,b,a);
5046this[name]=function(){
5047return rval;
5048};
5049return rval;
5050};
5051for(var k in _545){
5052var name=k+"Color";
5053var _54f=m.concat([_546,this.Color,name],_545[k]);
5054this.Color[name]=m.bind.apply(null,_54f);
5055}
5056var _550=function(){
5057for(var i=0;i<arguments.length;i++){
5058if(!(arguments[i] instanceof MochiKit.Color.Color)){
5059return false;
5060}
5061}
5062return true;
5063};
5064var _552=function(a,b){
5065return a.compareRGB(b);
5066};
5067m.nameFunctions(this);
5068m.registerComparator(this.Color.NAME,_550,_552);
5069this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
5070}});
5071MochiKit.Color.EXPORT=["Color"];
5072MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
5073MochiKit.Color.__new__();
5074MochiKit.Base._exportSymbols(this,MochiKit.Color);
5075MochiKit.Color.Color._namedColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
5076MochiKit.Base._deps("Signal",["Base","DOM","Style"]);
5077MochiKit.Signal.NAME="MochiKit.Signal";
5078MochiKit.Signal.VERSION="1.4.2";
5079MochiKit.Signal._observers=[];
5080MochiKit.Signal.Event=function(src,e){
5081this._event=e||window.event;
5082this._src=src;
5083};
5084MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
5085var repr=MochiKit.Base.repr;
5086var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target());
5087if(this.type()&&this.type().indexOf("key")===0||this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu"){
5088str+=", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}";
5089}
5090if(this.type()&&this.type().indexOf("key")===0){
5091str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
5092}
5093if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
5094str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
5095if(this.type()!="mousemove"&&this.type()!="mousewheel"){
5096str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}";
5097}
5098if(this.type()=="mousewheel"){
5099str+=", wheel: "+repr(this.mouse().wheel);
5100}
5101str+="}";
5102}
5103if(this.type()=="mouseover"||this.type()=="mouseout"||this.type()=="mouseenter"||this.type()=="mouseleave"){
5104str+=", relatedTarget(): "+repr(this.relatedTarget());
5105}
5106str+="}";
5107return str;
5108},toString:function(){
5109return this.__repr__();
5110},src:function(){
5111return this._src;
5112},event:function(){
5113return this._event;
5114},type:function(){
5115if(this._event.type==="DOMMouseScroll"){
5116return "mousewheel";
5117}else{
5118return this._event.type||undefined;
5119}
5120},target:function(){
5121return this._event.target||this._event.srcElement;
5122},_relatedTarget:null,relatedTarget:function(){
5123if(this._relatedTarget!==null){
5124return this._relatedTarget;
5125}
5126var elem=null;
5127if(this.type()=="mouseover"||this.type()=="mouseenter"){
5128elem=(this._event.relatedTarget||this._event.fromElement);
5129}else{
5130if(this.type()=="mouseout"||this.type()=="mouseleave"){
5131elem=(this._event.relatedTarget||this._event.toElement);
5132}
5133}
5134try{
5135if(elem!==null&&elem.nodeType!==null){
5136this._relatedTarget=elem;
5137return elem;
5138}
5139}
5140catch(ignore){
5141}
5142return undefined;
5143},_modifier:null,modifier:function(){
5144if(this._modifier!==null){
5145return this._modifier;
5146}
5147var m={};
5148m.alt=this._event.altKey;
5149m.ctrl=this._event.ctrlKey;
5150m.meta=this._event.metaKey||false;
5151m.shift=this._event.shiftKey;
5152m.any=m.alt||m.ctrl||m.shift||m.meta;
5153this._modifier=m;
5154return m;
5155},_key:null,key:function(){
5156if(this._key!==null){
5157return this._key;
5158}
5159var k={};
5160if(this.type()&&this.type().indexOf("key")===0){
5161if(this.type()=="keydown"||this.type()=="keyup"){
5162k.code=this._event.keyCode;
5163k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
5164this._key=k;
5165return k;
5166}else{
5167if(this.type()=="keypress"){
5168k.code=0;
5169k.string="";
5170if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
5171k.code=this._event.charCode;
5172k.string=String.fromCharCode(k.code);
5173}else{
5174if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
5175k.code=this._event.keyCode;
5176k.string=String.fromCharCode(k.code);
5177}
5178}
5179this._key=k;
5180return k;
5181}
5182}
5183}
5184return undefined;
5185},_mouse:null,mouse:function(){
5186if(this._mouse!==null){
5187return this._mouse;
5188}
5189var m={};
5190var e=this._event;
5191if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
5192m.client=new MochiKit.Style.Coordinates(0,0);
5193if(e.clientX||e.clientY){
5194m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
5195m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
5196}
5197m.page=new MochiKit.Style.Coordinates(0,0);
5198if(e.pageX||e.pageY){
5199m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
5200m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
5201}else{
5202var de=MochiKit.DOM._document.documentElement;
5203var b=MochiKit.DOM._document.body;
5204m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
5205m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
5206}
5207if(this.type()!="mousemove"&&this.type()!="mousewheel"){
5208m.button={};
5209m.button.left=false;
5210m.button.right=false;
5211m.button.middle=false;
5212if(e.which){
5213m.button.left=(e.which==1);
5214m.button.middle=(e.which==2);
5215m.button.right=(e.which==3);
5216}else{
5217m.button.left=!!(e.button&1);
5218m.button.right=!!(e.button&2);
5219m.button.middle=!!(e.button&4);
5220}
5221}
5222if(this.type()=="mousewheel"){
5223m.wheel=new MochiKit.Style.Coordinates(0,0);
5224if(e.wheelDeltaX||e.wheelDeltaY){
5225m.wheel.x=e.wheelDeltaX/-40||0;
5226m.wheel.y=e.wheelDeltaY/-40||0;
5227}else{
5228if(e.wheelDelta){
5229m.wheel.y=e.wheelDelta/-40;
5230}else{
5231m.wheel.y=e.detail||0;
5232}
5233}
5234}
5235this._mouse=m;
5236return m;
5237}
5238return undefined;
5239},stop:function(){
5240this.stopPropagation();
5241this.preventDefault();
5242},stopPropagation:function(){
5243if(this._event.stopPropagation){
5244this._event.stopPropagation();
5245}else{
5246this._event.cancelBubble=true;
5247}
5248},preventDefault:function(){
5249if(this._event.preventDefault){
5250this._event.preventDefault();
5251}else{
5252if(this._confirmUnload===null){
5253this._event.returnValue=false;
5254}
5255}
5256},_confirmUnload:null,confirmUnload:function(msg){
5257if(this.type()=="beforeunload"){
5258this._confirmUnload=msg;
5259this._event.returnValue=msg;
5260}
5261}});
5262MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"};
5263(function(){
5264var _561=MochiKit.Signal._specialMacKeys;
5265for(i=63236;i<=63242;i++){
5266_561[i]="KEY_F"+(i-63236+1);
5267}
5268})();
5269MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"};
5270(function(){
5271var _562=MochiKit.Signal._specialKeys;
5272for(var i=48;i<=57;i++){
5273_562[i]="KEY_"+(i-48);
5274}
5275for(i=65;i<=90;i++){
5276_562[i]="KEY_"+String.fromCharCode(i);
5277}
5278for(i=96;i<=105;i++){
5279_562[i]="KEY_NUM_PAD_"+(i-96);
5280}
5281for(i=112;i<=123;i++){
5282_562[i]="KEY_F"+(i-112+1);
5283}
5284})();
5285MochiKit.Signal.Ident=function(_564){
5286this.source=_564.source;
5287this.signal=_564.signal;
5288this.listener=_564.listener;
5289this.isDOM=_564.isDOM;
5290this.objOrFunc=_564.objOrFunc;
5291this.funcOrStr=_564.funcOrStr;
5292this.connected=_564.connected;
5293};
5294MochiKit.Signal.Ident.prototype={};
5295MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
5296return "["+this.NAME+" "+this.VERSION+"]";
5297},toString:function(){
5298return this.__repr__();
5299},_unloadCache:function(){
5300var self=MochiKit.Signal;
5301var _566=self._observers;
5302for(var i=0;i<_566.length;i++){
5303if(_566[i].signal!=="onload"&&_566[i].signal!=="onunload"){
5304self._disconnect(_566[i]);
5305}
5306}
5307},_listener:function(src,sig,func,obj,_56c){
5308var self=MochiKit.Signal;
5309var E=self.Event;
5310if(!_56c){
5311if(typeof (func.im_self)=="undefined"){
5312return MochiKit.Base.bindLate(func,obj);
5313}else{
5314return func;
5315}
5316}
5317obj=obj||src;
5318if(typeof (func)=="string"){
5319if(sig==="onload"||sig==="onunload"){
5320return function(_56f){
5321obj[func].apply(obj,[new E(src,_56f)]);
5322var _570=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
5323MochiKit.Signal._disconnect(_570);
5324};
5325}else{
5326return function(_571){
5327obj[func].apply(obj,[new E(src,_571)]);
5328};
5329}
5330}else{
5331if(sig==="onload"||sig==="onunload"){
5332return function(_572){
5333func.apply(obj,[new E(src,_572)]);
5334var _573=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
5335MochiKit.Signal._disconnect(_573);
5336};
5337}else{
5338return function(_574){
5339func.apply(obj,[new E(src,_574)]);
5340};
5341}
5342}
5343},_browserAlreadyHasMouseEnterAndLeave:function(){
5344return /MSIE/.test(navigator.userAgent);
5345},_browserLacksMouseWheelEvent:function(){
5346return /Gecko\//.test(navigator.userAgent);
5347},_mouseEnterListener:function(src,sig,func,obj){
5348var E=MochiKit.Signal.Event;
5349return function(_57a){
5350var e=new E(src,_57a);
5351try{
5352e.relatedTarget().nodeName;
5353}
5354catch(err){
5355return;
5356}
5357e.stop();
5358if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
5359return;
5360}
5361e.type=function(){
5362return sig;
5363};
5364if(typeof (func)=="string"){
5365return obj[func].apply(obj,[e]);
5366}else{
5367return func.apply(obj,[e]);
5368}
5369};
5370},_getDestPair:function(_57c,_57d){
5371var obj=null;
5372var func=null;
5373if(typeof (_57d)!="undefined"){
5374obj=_57c;
5375func=_57d;
5376if(typeof (_57d)=="string"){
5377if(typeof (_57c[_57d])!="function"){
5378throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
5379}
5380}else{
5381if(typeof (_57d)!="function"){
5382throw new Error("'funcOrStr' must be a function or string");
5383}
5384}
5385}else{
5386if(typeof (_57c)!="function"){
5387throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
5388}else{
5389func=_57c;
5390}
5391}
5392return [obj,func];
5393},connect:function(src,sig,_582,_583){
5394src=MochiKit.DOM.getElement(src);
5395var self=MochiKit.Signal;
5396if(typeof (sig)!="string"){
5397throw new Error("'sig' must be a string");
5398}
5399var _585=self._getDestPair(_582,_583);
5400var obj=_585[0];
5401var func=_585[1];
5402if(typeof (obj)=="undefined"||obj===null){
5403obj=src;
5404}
5405var _588=!!(src.addEventListener||src.attachEvent);
5406if(_588&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
5407var _589=self._mouseEnterListener(src,sig.substr(2),func,obj);
5408if(sig==="onmouseenter"){
5409sig="onmouseover";
5410}else{
5411sig="onmouseout";
5412}
5413}else{
5414if(_588&&sig=="onmousewheel"&&self._browserLacksMouseWheelEvent()){
5415var _589=self._listener(src,sig,func,obj,_588);
5416sig="onDOMMouseScroll";
5417}else{
5418var _589=self._listener(src,sig,func,obj,_588);
5419}
5420}
5421if(src.addEventListener){
5422src.addEventListener(sig.substr(2),_589,false);
5423}else{
5424if(src.attachEvent){
5425src.attachEvent(sig,_589);
5426}
5427}
5428var _58a=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_589,isDOM:_588,objOrFunc:_582,funcOrStr:_583,connected:true});
5429self._observers.push(_58a);
5430if(!_588&&typeof (src.__connect__)=="function"){
5431var args=MochiKit.Base.extend([_58a],arguments,1);
5432src.__connect__.apply(src,args);
5433}
5434return _58a;
5435},_disconnect:function(_58c){
5436if(!_58c.connected){
5437return;
5438}
5439_58c.connected=false;
5440var src=_58c.source;
5441var sig=_58c.signal;
5442var _58f=_58c.listener;
5443if(!_58c.isDOM){
5444if(typeof (src.__disconnect__)=="function"){
5445src.__disconnect__(_58c,sig,_58c.objOrFunc,_58c.funcOrStr);
5446}
5447return;
5448}
5449if(src.removeEventListener){
5450src.removeEventListener(sig.substr(2),_58f,false);
5451}else{
5452if(src.detachEvent){
5453src.detachEvent(sig,_58f);
5454}else{
5455throw new Error("'src' must be a DOM element");
5456}
5457}
5458},disconnect:function(_590){
5459var self=MochiKit.Signal;
5460var _592=self._observers;
5461var m=MochiKit.Base;
5462if(arguments.length>1){
5463var src=MochiKit.DOM.getElement(arguments[0]);
5464var sig=arguments[1];
5465var obj=arguments[2];
5466var func=arguments[3];
5467for(var i=_592.length-1;i>=0;i--){
5468var o=_592[i];
5469if(o.source===src&&o.signal===sig&&o.objOrFunc===obj&&o.funcOrStr===func){
5470self._disconnect(o);
5471if(!self._lock){
5472_592.splice(i,1);
5473}else{
5474self._dirty=true;
5475}
5476return true;
5477}
5478}
5479}else{
5480var idx=m.findIdentical(_592,_590);
5481if(idx>=0){
5482self._disconnect(_590);
5483if(!self._lock){
5484_592.splice(idx,1);
5485}else{
5486self._dirty=true;
5487}
5488return true;
5489}
5490}
5491return false;
5492},disconnectAllTo:function(_59b,_59c){
5493var self=MochiKit.Signal;
5494var _59e=self._observers;
5495var _59f=self._disconnect;
5496var _5a0=self._lock;
5497var _5a1=self._dirty;
5498if(typeof (_59c)==="undefined"){
5499_59c=null;
5500}
5501for(var i=_59e.length-1;i>=0;i--){
5502var _5a3=_59e[i];
5503if(_5a3.objOrFunc===_59b&&(_59c===null||_5a3.funcOrStr===_59c)){
5504_59f(_5a3);
5505if(_5a0){
5506_5a1=true;
5507}else{
5508_59e.splice(i,1);
5509}
5510}
5511}
5512self._dirty=_5a1;
5513},disconnectAll:function(src,sig){
5514src=MochiKit.DOM.getElement(src);
5515var m=MochiKit.Base;
5516var _5a7=m.flattenArguments(m.extend(null,arguments,1));
5517var self=MochiKit.Signal;
5518var _5a9=self._disconnect;
5519var _5aa=self._observers;
5520var i,_5ac;
5521var _5ad=self._lock;
5522var _5ae=self._dirty;
5523if(_5a7.length===0){
5524for(i=_5aa.length-1;i>=0;i--){
5525_5ac=_5aa[i];
5526if(_5ac.source===src){
5527_5a9(_5ac);
5528if(!_5ad){
5529_5aa.splice(i,1);
5530}else{
5531_5ae=true;
5532}
5533}
5534}
5535}else{
5536var sigs={};
5537for(i=0;i<_5a7.length;i++){
5538sigs[_5a7[i]]=true;
5539}
5540for(i=_5aa.length-1;i>=0;i--){
5541_5ac=_5aa[i];
5542if(_5ac.source===src&&_5ac.signal in sigs){
5543_5a9(_5ac);
5544if(!_5ad){
5545_5aa.splice(i,1);
5546}else{
5547_5ae=true;
5548}
5549}
5550}
5551}
5552self._dirty=_5ae;
5553},signal:function(src,sig){
5554var self=MochiKit.Signal;
5555var _5b3=self._observers;
5556src=MochiKit.DOM.getElement(src);
5557var args=MochiKit.Base.extend(null,arguments,2);
5558var _5b5=[];
5559self._lock=true;
5560for(var i=0;i<_5b3.length;i++){
5561var _5b7=_5b3[i];
5562if(_5b7.source===src&&_5b7.signal===sig&&_5b7.connected){
5563try{
5564_5b7.listener.apply(src,args);
5565}
5566catch(e){
5567_5b5.push(e);
5568}
5569}
5570}
5571self._lock=false;
5572if(self._dirty){
5573self._dirty=false;
5574for(var i=_5b3.length-1;i>=0;i--){
5575if(!_5b3[i].connected){
5576_5b3.splice(i,1);
5577}
5578}
5579}
5580if(_5b5.length==1){
5581throw _5b5[0];
5582}else{
5583if(_5b5.length>1){
5584var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
5585e.errors=_5b5;
5586throw e;
5587}
5588}
5589}});
5590MochiKit.Signal.EXPORT_OK=[];
5591MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll","disconnectAllTo"];
5592MochiKit.Signal.__new__=function(win){
5593var m=MochiKit.Base;
5594this._document=document;
5595this._window=win;
5596this._lock=false;
5597this._dirty=false;
5598try{
5599this.connect(window,"onunload",this._unloadCache);
5600}
5601catch(e){
5602}
5603this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
5604m.nameFunctions(this);
5605};
5606MochiKit.Signal.__new__(this);
5607if(MochiKit.__export__){
5608connect=MochiKit.Signal.connect;
5609disconnect=MochiKit.Signal.disconnect;
5610disconnectAll=MochiKit.Signal.disconnectAll;
5611signal=MochiKit.Signal.signal;
5612}
5613MochiKit.Base._exportSymbols(this,MochiKit.Signal);
5614MochiKit.Base._deps("Position",["Base","DOM","Style"]);
5615MochiKit.Position.NAME="MochiKit.Position";
5616MochiKit.Position.VERSION="1.4.2";
5617MochiKit.Position.__repr__=function(){
5618return "["+this.NAME+" "+this.VERSION+"]";
5619};
5620MochiKit.Position.toString=function(){
5621return this.__repr__();
5622};
5623MochiKit.Position.EXPORT_OK=[];
5624MochiKit.Position.EXPORT=[];
5625MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){
5626var _5bb=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
5627var _5bc=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
5628this.windowOffset=new MochiKit.Style.Coordinates(_5bb,_5bc);
5629},cumulativeOffset:function(_5bd){
5630var _5be=0;
5631var _5bf=0;
5632do{
5633_5be+=_5bd.offsetTop||0;
5634_5bf+=_5bd.offsetLeft||0;
5635_5bd=_5bd.offsetParent;
5636}while(_5bd);
5637return new MochiKit.Style.Coordinates(_5bf,_5be);
5638},realOffset:function(_5c0){
5639var _5c1=0;
5640var _5c2=0;
5641do{
5642_5c1+=_5c0.scrollTop||0;
5643_5c2+=_5c0.scrollLeft||0;
5644_5c0=_5c0.parentNode;
5645}while(_5c0);
5646return new MochiKit.Style.Coordinates(_5c2,_5c1);
5647},within:function(_5c3,x,y){
5648if(this.includeScrollOffsets){
5649return this.withinIncludingScrolloffsets(_5c3,x,y);
5650}
5651this.xcomp=x;
5652this.ycomp=y;
5653this.offset=this.cumulativeOffset(_5c3);
5654if(_5c3.style.position=="fixed"){
5655this.offset.x+=this.windowOffset.x;
5656this.offset.y+=this.windowOffset.y;
5657}
5658return (y>=this.offset.y&&y<this.offset.y+_5c3.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_5c3.offsetWidth);
5659},withinIncludingScrolloffsets:function(_5c6,x,y){
5660var _5c9=this.realOffset(_5c6);
5661this.xcomp=x+_5c9.x-this.windowOffset.x;
5662this.ycomp=y+_5c9.y-this.windowOffset.y;
5663this.offset=this.cumulativeOffset(_5c6);
5664return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_5c6.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_5c6.offsetWidth);
5665},overlap:function(mode,_5cb){
5666if(!mode){
5667return 0;
5668}
5669if(mode=="vertical"){
5670return ((this.offset.y+_5cb.offsetHeight)-this.ycomp)/_5cb.offsetHeight;
5671}
5672if(mode=="horizontal"){
5673return ((this.offset.x+_5cb.offsetWidth)-this.xcomp)/_5cb.offsetWidth;
5674}
5675},absolutize:function(_5cc){
5676_5cc=MochiKit.DOM.getElement(_5cc);
5677if(_5cc.style.position=="absolute"){
5678return;
5679}
5680MochiKit.Position.prepare();
5681var _5cd=MochiKit.Position.positionedOffset(_5cc);
5682var _5ce=_5cc.clientWidth;
5683var _5cf=_5cc.clientHeight;
5684var _5d0={"position":_5cc.style.position,"left":_5cd.x-parseFloat(_5cc.style.left||0),"top":_5cd.y-parseFloat(_5cc.style.top||0),"width":_5cc.style.width,"height":_5cc.style.height};
5685_5cc.style.position="absolute";
5686_5cc.style.top=_5cd.y+"px";
5687_5cc.style.left=_5cd.x+"px";
5688_5cc.style.width=_5ce+"px";
5689_5cc.style.height=_5cf+"px";
5690return _5d0;
5691},positionedOffset:function(_5d1){
5692var _5d2=0,_5d3=0;
5693do{
5694_5d2+=_5d1.offsetTop||0;
5695_5d3+=_5d1.offsetLeft||0;
5696_5d1=_5d1.offsetParent;
5697if(_5d1){
5698p=MochiKit.Style.getStyle(_5d1,"position");
5699if(p=="relative"||p=="absolute"){
5700break;
5701}
5702}
5703}while(_5d1);
5704return new MochiKit.Style.Coordinates(_5d3,_5d2);
5705},relativize:function(_5d4,_5d5){
5706_5d4=MochiKit.DOM.getElement(_5d4);
5707if(_5d4.style.position=="relative"){
5708return;
5709}
5710MochiKit.Position.prepare();
5711var top=parseFloat(_5d4.style.top||0)-(_5d5["top"]||0);
5712var left=parseFloat(_5d4.style.left||0)-(_5d5["left"]||0);
5713_5d4.style.position=_5d5["position"];
5714_5d4.style.top=top+"px";
5715_5d4.style.left=left+"px";
5716_5d4.style.width=_5d5["width"];
5717_5d4.style.height=_5d5["height"];
5718},clone:function(_5d8,_5d9){
5719_5d8=MochiKit.DOM.getElement(_5d8);
5720_5d9=MochiKit.DOM.getElement(_5d9);
5721_5d9.style.position="absolute";
5722var _5da=this.cumulativeOffset(_5d8);
5723_5d9.style.top=_5da.y+"px";
5724_5d9.style.left=_5da.x+"px";
5725_5d9.style.width=_5d8.offsetWidth+"px";
5726_5d9.style.height=_5d8.offsetHeight+"px";
5727},page:function(_5db){
5728var _5dc=0;
5729var _5dd=0;
5730var _5de=_5db;
5731do{
5732_5dc+=_5de.offsetTop||0;
5733_5dd+=_5de.offsetLeft||0;
5734if(_5de.offsetParent==document.body&&MochiKit.Style.getStyle(_5de,"position")=="absolute"){
5735break;
5736}
5737}while(_5de=_5de.offsetParent);
5738_5de=_5db;
5739do{
5740_5dc-=_5de.scrollTop||0;
5741_5dd-=_5de.scrollLeft||0;
5742}while(_5de=_5de.parentNode);
5743return new MochiKit.Style.Coordinates(_5dd,_5dc);
5744}});
5745MochiKit.Position.__new__=function(win){
5746var m=MochiKit.Base;
5747this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
5748m.nameFunctions(this);
5749};
5750MochiKit.Position.__new__(this);
5751MochiKit.Base._exportSymbols(this,MochiKit.Position);
5752MochiKit.Base._deps("Visual",["Base","DOM","Style","Color","Position"]);
5753MochiKit.Visual.NAME="MochiKit.Visual";
5754MochiKit.Visual.VERSION="1.4.2";
5755MochiKit.Visual.__repr__=function(){
5756return "["+this.NAME+" "+this.VERSION+"]";
5757};
5758MochiKit.Visual.toString=function(){
5759return this.__repr__();
5760};
5761MochiKit.Visual._RoundCorners=function(e,_5e2){
5762e=MochiKit.DOM.getElement(e);
5763this._setOptions(_5e2);
5764if(this.options.__unstable__wrapElement){
5765e=this._doWrap(e);
5766}
5767var _5e3=this.options.color;
5768var C=MochiKit.Color.Color;
5769if(this.options.color==="fromElement"){
5770_5e3=C.fromBackground(e);
5771}else{
5772if(!(_5e3 instanceof C)){
5773_5e3=C.fromString(_5e3);
5774}
5775}
5776this.isTransparent=(_5e3.asRGB().a<=0);
5777var _5e5=this.options.bgColor;
5778if(this.options.bgColor==="fromParent"){
5779_5e5=C.fromBackground(e.offsetParent);
5780}else{
5781if(!(_5e5 instanceof C)){
5782_5e5=C.fromString(_5e5);
5783}
5784}
5785this._roundCornersImpl(e,_5e3,_5e5);
5786};
5787MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
5788var _5e7=e.parentNode;
5789var doc=MochiKit.DOM.currentDocument();
5790if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
5791return e;
5792}
5793var _5e9=doc.defaultView.getComputedStyle(e,null);
5794if(typeof (_5e9)==="undefined"||_5e9===null){
5795return e;
5796}
5797var _5ea=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_5e9.getPropertyValue("padding-top"),marginRight:_5e9.getPropertyValue("padding-right"),marginBottom:_5e9.getPropertyValue("padding-bottom"),marginLeft:_5e9.getPropertyValue("padding-left"),padding:"0px"}});
5798_5ea.innerHTML=e.innerHTML;
5799e.innerHTML="";
5800e.appendChild(_5ea);
5801return e;
5802},_roundCornersImpl:function(e,_5ec,_5ed){
5803if(this.options.border){
5804this._renderBorder(e,_5ed);
5805}
5806if(this._isTopRounded()){
5807this._roundTopCorners(e,_5ec,_5ed);
5808}
5809if(this._isBottomRounded()){
5810this._roundBottomCorners(e,_5ec,_5ed);
5811}
5812},_renderBorder:function(el,_5ef){
5813var _5f0="1px solid "+this._borderColor(_5ef);
5814var _5f1="border-left: "+_5f0;
5815var _5f2="border-right: "+_5f0;
5816var _5f3="style='"+_5f1+";"+_5f2+"'";
5817el.innerHTML="<div "+_5f3+">"+el.innerHTML+"</div>";
5818},_roundTopCorners:function(el,_5f5,_5f6){
5819var _5f7=this._createCorner(_5f6);
5820for(var i=0;i<this.options.numSlices;i++){
5821_5f7.appendChild(this._createCornerSlice(_5f5,_5f6,i,"top"));
5822}
5823el.style.paddingTop=0;
5824el.insertBefore(_5f7,el.firstChild);
5825},_roundBottomCorners:function(el,_5fa,_5fb){
5826var _5fc=this._createCorner(_5fb);
5827for(var i=(this.options.numSlices-1);i>=0;i--){
5828_5fc.appendChild(this._createCornerSlice(_5fa,_5fb,i,"bottom"));
5829}
5830el.style.paddingBottom=0;
5831el.appendChild(_5fc);
5832},_createCorner:function(_5fe){
5833var dom=MochiKit.DOM;
5834return dom.DIV({style:{backgroundColor:_5fe.toString()}});
5835},_createCornerSlice:function(_600,_601,n,_603){
5836var _604=MochiKit.DOM.SPAN();
5837var _605=_604.style;
5838_605.backgroundColor=_600.toString();
5839_605.display="block";
5840_605.height="1px";
5841_605.overflow="hidden";
5842_605.fontSize="1px";
5843var _606=this._borderColor(_600,_601);
5844if(this.options.border&&n===0){
5845_605.borderTopStyle="solid";
5846_605.borderTopWidth="1px";
5847_605.borderLeftWidth="0px";
5848_605.borderRightWidth="0px";
5849_605.borderBottomWidth="0px";
5850_605.height="0px";
5851_605.borderColor=_606.toString();
5852}else{
5853if(_606){
5854_605.borderColor=_606.toString();
5855_605.borderStyle="solid";
5856_605.borderWidth="0px 1px";
5857}
5858}
5859if(!this.options.compact&&(n==(this.options.numSlices-1))){
5860_605.height="2px";
5861}
5862this._setMargin(_604,n,_603);
5863this._setBorder(_604,n,_603);
5864return _604;
5865},_setOptions:function(_607){
5866this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
5867MochiKit.Base.update(this.options,_607);
5868this.options.numSlices=(this.options.compact?2:4);
5869},_whichSideTop:function(){
5870var _608=this.options.corners;
5871if(this._hasString(_608,"all","top")){
5872return "";
5873}
5874var _609=(_608.indexOf("tl")!=-1);
5875var _60a=(_608.indexOf("tr")!=-1);
5876if(_609&&_60a){
5877return "";
5878}
5879if(_609){
5880return "left";
5881}
5882if(_60a){
5883return "right";
5884}
5885return "";
5886},_whichSideBottom:function(){
5887var _60b=this.options.corners;
5888if(this._hasString(_60b,"all","bottom")){
5889return "";
5890}
5891var _60c=(_60b.indexOf("bl")!=-1);
5892var _60d=(_60b.indexOf("br")!=-1);
5893if(_60c&&_60d){
5894return "";
5895}
5896if(_60c){
5897return "left";
5898}
5899if(_60d){
5900return "right";
5901}
5902return "";
5903},_borderColor:function(_60e,_60f){
5904if(_60e=="transparent"){
5905return _60f;
5906}else{
5907if(this.options.border){
5908return this.options.border;
5909}else{
5910if(this.options.blend){
5911return _60f.blendedColor(_60e);
5912}
5913}
5914}
5915return "";
5916},_setMargin:function(el,n,_612){
5917var _613=this._marginSize(n)+"px";
5918var _614=(_612=="top"?this._whichSideTop():this._whichSideBottom());
5919var _615=el.style;
5920if(_614=="left"){
5921_615.marginLeft=_613;
5922_615.marginRight="0px";
5923}else{
5924if(_614=="right"){
5925_615.marginRight=_613;
5926_615.marginLeft="0px";
5927}else{
5928_615.marginLeft=_613;
5929_615.marginRight=_613;
5930}
5931}
5932},_setBorder:function(el,n,_618){
5933var _619=this._borderSize(n)+"px";
5934var _61a=(_618=="top"?this._whichSideTop():this._whichSideBottom());
5935var _61b=el.style;
5936if(_61a=="left"){
5937_61b.borderLeftWidth=_619;
5938_61b.borderRightWidth="0px";
5939}else{
5940if(_61a=="right"){
5941_61b.borderRightWidth=_619;
5942_61b.borderLeftWidth="0px";
5943}else{
5944_61b.borderLeftWidth=_619;
5945_61b.borderRightWidth=_619;
5946}
5947}
5948},_marginSize:function(n){
5949if(this.isTransparent){
5950return 0;
5951}
5952var o=this.options;
5953if(o.compact&&o.blend){
5954var _61e=[1,0];
5955return _61e[n];
5956}else{
5957if(o.compact){
5958var _61f=[2,1];
5959return _61f[n];
5960}else{
5961if(o.blend){
5962var _620=[3,2,1,0];
5963return _620[n];
5964}else{
5965var _621=[5,3,2,1];
5966return _621[n];
5967}
5968}
5969}
5970},_borderSize:function(n){
5971var o=this.options;
5972var _624;
5973if(o.compact&&(o.blend||this.isTransparent)){
5974return 1;
5975}else{
5976if(o.compact){
5977_624=[1,0];
5978}else{
5979if(o.blend){
5980_624=[2,1,1,1];
5981}else{
5982if(o.border){
5983_624=[0,2,0,0];
5984}else{
5985if(this.isTransparent){
5986_624=[5,3,2,1];
5987}else{
5988return 0;
5989}
5990}
5991}
5992}
5993}
5994return _624[n];
5995},_hasString:function(str){
5996for(var i=1;i<arguments.length;i++){
5997if(str.indexOf(arguments[i])!=-1){
5998return true;
5999}
6000}
6001return false;
6002},_isTopRounded:function(){
6003return this._hasString(this.options.corners,"all","top","tl","tr");
6004},_isBottomRounded:function(){
6005return this._hasString(this.options.corners,"all","bottom","bl","br");
6006},_hasSingleTextChild:function(el){
6007return (el.childNodes.length==1&&el.childNodes[0].nodeType==3);
6008}};
6009MochiKit.Visual.roundElement=function(e,_629){
6010new MochiKit.Visual._RoundCorners(e,_629);
6011};
6012MochiKit.Visual.roundClass=function(_62a,_62b,_62c){
6013var _62d=MochiKit.DOM.getElementsByTagAndClassName(_62a,_62b);
6014for(var i=0;i<_62d.length;i++){
6015MochiKit.Visual.roundElement(_62d[i],_62c);
6016}
6017};
6018MochiKit.Visual.tagifyText=function(_62f,_630){
6019_630=_630||"position:relative";
6020if(/MSIE/.test(navigator.userAgent)){
6021_630+=";zoom:1";
6022}
6023_62f=MochiKit.DOM.getElement(_62f);
6024var ma=MochiKit.Base.map;
6025ma(function(_632){
6026if(_632.nodeType==3){
6027ma(function(_633){
6028_62f.insertBefore(MochiKit.DOM.SPAN({style:_630},_633==" "?String.fromCharCode(160):_633),_632);
6029},_632.nodeValue.split(""));
6030MochiKit.DOM.removeElement(_632);
6031}
6032},_62f.childNodes);
6033};
6034MochiKit.Visual.forceRerendering=function(_634){
6035try{
6036_634=MochiKit.DOM.getElement(_634);
6037var n=document.createTextNode(" ");
6038_634.appendChild(n);
6039_634.removeChild(n);
6040}
6041catch(e){
6042}
6043};
6044MochiKit.Visual.multiple=function(_636,_637,_638){
6045_638=MochiKit.Base.update({speed:0.1,delay:0},_638);
6046var _639=_638.delay;
6047var _63a=0;
6048MochiKit.Base.map(function(_63b){
6049_638.delay=_63a*_638.speed+_639;
6050new _637(_63b,_638);
6051_63a+=1;
6052},_636);
6053};
6054MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
6055MochiKit.Visual.toggle=function(_63c,_63d,_63e){
6056_63c=MochiKit.DOM.getElement(_63c);
6057_63d=(_63d||"appear").toLowerCase();
6058_63e=MochiKit.Base.update({queue:{position:"end",scope:(_63c.id||"global"),limit:1}},_63e);
6059var v=MochiKit.Visual;
6060v[MochiKit.Style.getStyle(_63c,"display")!="none"?v.PAIRS[_63d][1]:v.PAIRS[_63d][0]](_63c,_63e);
6061};
6062MochiKit.Visual.Transitions={};
6063MochiKit.Visual.Transitions.linear=function(pos){
6064return pos;
6065};
6066MochiKit.Visual.Transitions.sinoidal=function(pos){
6067return 0.5-Math.cos(pos*Math.PI)/2;
6068};
6069MochiKit.Visual.Transitions.reverse=function(pos){
6070return 1-pos;
6071};
6072MochiKit.Visual.Transitions.flicker=function(pos){
6073return 0.25-Math.cos(pos*Math.PI)/4+Math.random()/2;
6074};
6075MochiKit.Visual.Transitions.wobble=function(pos){
6076return 0.5-Math.cos(9*pos*Math.PI)/2;
6077};
6078MochiKit.Visual.Transitions.pulse=function(pos,_646){
6079if(_646){
6080pos*=2*_646;
6081}else{
6082pos*=10;
6083}
6084var _647=pos-Math.floor(pos);
6085return (Math.floor(pos)%2==0)?_647:1-_647;
6086};
6087MochiKit.Visual.Transitions.parabolic=function(pos){
6088return pos*pos;
6089};
6090MochiKit.Visual.Transitions.none=function(pos){
6091return 0;
6092};
6093MochiKit.Visual.Transitions.full=function(pos){
6094return 1;
6095};
6096MochiKit.Visual.ScopedQueue=function(){
6097var cls=arguments.callee;
6098if(!(this instanceof cls)){
6099return new cls();
6100}
6101this.__init__();
6102};
6103MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
6104this.effects=[];
6105this.interval=null;
6106},add:function(_64c){
6107var _64d=new Date().getTime();
6108var _64e=(typeof (_64c.options.queue)=="string")?_64c.options.queue:_64c.options.queue.position;
6109var ma=MochiKit.Base.map;
6110switch(_64e){
6111case "front":
6112ma(function(e){
6113if(e.state=="idle"){
6114e.startOn+=_64c.finishOn;
6115e.finishOn+=_64c.finishOn;
6116}
6117},this.effects);
6118break;
6119case "end":
6120var _651;
6121ma(function(e){
6122var i=e.finishOn;
6123if(i>=(_651||i)){
6124_651=i;
6125}
6126},this.effects);
6127_64d=_651||_64d;
6128break;
6129case "break":
6130ma(function(e){
6131e.finalize();
6132},this.effects);
6133break;
6134}
6135_64c.startOn+=_64d;
6136_64c.finishOn+=_64d;
6137if(!_64c.options.queue.limit||this.effects.length<_64c.options.queue.limit){
6138this.effects.push(_64c);
6139}
6140if(!this.interval){
6141this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
6142}
6143},startLoop:function(func,_656){
6144return setInterval(func,_656);
6145},remove:function(_657){
6146this.effects=MochiKit.Base.filter(function(e){
6147return e!=_657;
6148},this.effects);
6149if(!this.effects.length){
6150this.stopLoop(this.interval);
6151this.interval=null;
6152}
6153},stopLoop:function(_659){
6154clearInterval(_659);
6155},loop:function(){
6156var _65a=new Date().getTime();
6157MochiKit.Base.map(function(_65b){
6158_65b.loop(_65a);
6159},this.effects);
6160}});
6161MochiKit.Visual.Queues={instances:{},get:function(_65c){
6162if(typeof (_65c)!="string"){
6163return _65c;
6164}
6165if(!this.instances[_65c]){
6166this.instances[_65c]=new MochiKit.Visual.ScopedQueue();
6167}
6168return this.instances[_65c];
6169}};
6170MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global");
6171MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
6172MochiKit.Visual.Base=function(){
6173};
6174MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_65d){
6175var v=MochiKit.Visual;
6176this.options=MochiKit.Base.setdefault(_65d,v.DefaultOptions);
6177this.currentFrame=0;
6178this.state="idle";
6179this.startOn=this.options.delay*1000;
6180this.finishOn=this.startOn+(this.options.duration*1000);
6181this.event("beforeStart");
6182if(!this.options.sync){
6183v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this);
6184}
6185},loop:function(_65f){
6186if(_65f>=this.startOn){
6187if(_65f>=this.finishOn){
6188return this.finalize();
6189}
6190var pos=(_65f-this.startOn)/(this.finishOn-this.startOn);
6191var _661=Math.round(pos*this.options.fps*this.options.duration);
6192if(_661>this.currentFrame){
6193this.render(pos);
6194this.currentFrame=_661;
6195}
6196}
6197},render:function(pos){
6198if(this.state=="idle"){
6199this.state="running";
6200this.event("beforeSetup");
6201this.setup();
6202this.event("afterSetup");
6203}
6204if(this.state=="running"){
6205if(this.options.transition){
6206pos=this.options.transition(pos);
6207}
6208pos*=(this.options.to-this.options.from);
6209pos+=this.options.from;
6210this.event("beforeUpdate");
6211this.update(pos);
6212this.event("afterUpdate");
6213}
6214},cancel:function(){
6215if(!this.options.sync){
6216MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this);
6217}
6218this.state="finished";
6219},finalize:function(){
6220this.render(1);
6221this.cancel();
6222this.event("beforeFinish");
6223this.finish();
6224this.event("afterFinish");
6225},setup:function(){
6226},finish:function(){
6227},update:function(_663){
6228},event:function(_664){
6229if(this.options[_664+"Internal"]){
6230this.options[_664+"Internal"](this);
6231}
6232if(this.options[_664]){
6233this.options[_664](this);
6234}
6235},repr:function(){
6236return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
6237}};
6238MochiKit.Visual.Parallel=function(_665,_666){
6239var cls=arguments.callee;
6240if(!(this instanceof cls)){
6241return new cls(_665,_666);
6242}
6243this.__init__(_665,_666);
6244};
6245MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
6246MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_668,_669){
6247this.effects=_668||[];
6248this.start(_669);
6249},update:function(_66a){
6250MochiKit.Base.map(function(_66b){
6251_66b.render(_66a);
6252},this.effects);
6253},finish:function(){
6254MochiKit.Base.map(function(_66c){
6255_66c.finalize();
6256},this.effects);
6257}});
6258MochiKit.Visual.Sequence=function(_66d,_66e){
6259var cls=arguments.callee;
6260if(!(this instanceof cls)){
6261return new cls(_66d,_66e);
6262}
6263this.__init__(_66d,_66e);
6264};
6265MochiKit.Visual.Sequence.prototype=new MochiKit.Visual.Base();
6266MochiKit.Base.update(MochiKit.Visual.Sequence.prototype,{__class__:MochiKit.Visual.Sequence,__init__:function(_670,_671){
6267var defs={transition:MochiKit.Visual.Transitions.linear,duration:0};
6268this.effects=_670||[];
6269MochiKit.Base.map(function(_673){
6270defs.duration+=_673.options.duration;
6271},this.effects);
6272MochiKit.Base.setdefault(_671,defs);
6273this.start(_671);
6274},update:function(_674){
6275var time=_674*this.options.duration;
6276for(var i=0;i<this.effects.length;i++){
6277var _677=this.effects[i];
6278if(time<=_677.options.duration){
6279_677.render(time/_677.options.duration);
6280break;
6281}else{
6282time-=_677.options.duration;
6283}
6284}
6285},finish:function(){
6286MochiKit.Base.map(function(_678){
6287_678.finalize();
6288},this.effects);
6289}});
6290MochiKit.Visual.Opacity=function(_679,_67a){
6291var cls=arguments.callee;
6292if(!(this instanceof cls)){
6293return new cls(_679,_67a);
6294}
6295this.__init__(_679,_67a);
6296};
6297MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
6298MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_67c,_67d){
6299var b=MochiKit.Base;
6300var s=MochiKit.Style;
6301this.element=MochiKit.DOM.getElement(_67c);
6302if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
6303s.setStyle(this.element,{zoom:1});
6304}
6305_67d=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_67d);
6306this.start(_67d);
6307},update:function(_680){
6308MochiKit.Style.setStyle(this.element,{"opacity":_680});
6309}});
6310MochiKit.Visual.Move=function(_681,_682){
6311var cls=arguments.callee;
6312if(!(this instanceof cls)){
6313return new cls(_681,_682);
6314}
6315this.__init__(_681,_682);
6316};
6317MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
6318MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_684,_685){
6319this.element=MochiKit.DOM.getElement(_684);
6320_685=MochiKit.Base.update({x:0,y:0,mode:"relative"},_685);
6321this.start(_685);
6322},setup:function(){
6323MochiKit.Style.makePositioned(this.element);
6324var s=this.element.style;
6325var _687=s.visibility;
6326var _688=s.display;
6327if(_688=="none"){
6328s.visibility="hidden";
6329s.display="";
6330}
6331this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0");
6332this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0");
6333if(this.options.mode=="absolute"){
6334this.options.x-=this.originalLeft;
6335this.options.y-=this.originalTop;
6336}
6337if(_688=="none"){
6338s.visibility=_687;
6339s.display=_688;
6340}
6341},update:function(_689){
6342MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_689+this.originalLeft)+"px",top:Math.round(this.options.y*_689+this.originalTop)+"px"});
6343}});
6344MochiKit.Visual.Scale=function(_68a,_68b,_68c){
6345var cls=arguments.callee;
6346if(!(this instanceof cls)){
6347return new cls(_68a,_68b,_68c);
6348}
6349this.__init__(_68a,_68b,_68c);
6350};
6351MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
6352MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_68e,_68f,_690){
6353this.element=MochiKit.DOM.getElement(_68e);
6354_690=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_68f},_690);
6355this.start(_690);
6356},setup:function(){
6357this.restoreAfterFinish=this.options.restoreAfterFinish||false;
6358this.elementPositioning=MochiKit.Style.getStyle(this.element,"position");
6359var ma=MochiKit.Base.map;
6360var b=MochiKit.Base.bind;
6361this.originalStyle={};
6362ma(b(function(k){
6363this.originalStyle[k]=this.element.style[k];
6364},this),["top","left","width","height","fontSize"]);
6365this.originalTop=this.element.offsetTop;
6366this.originalLeft=this.element.offsetLeft;
6367var _694=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
6368ma(b(function(_695){
6369if(_694.indexOf(_695)>0){
6370this.fontSize=parseFloat(_694);
6371this.fontSizeType=_695;
6372}
6373},this),["em","px","%"]);
6374this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
6375if(/^content/.test(this.options.scaleMode)){
6376this.dims=[this.element.scrollHeight,this.element.scrollWidth];
6377}else{
6378if(this.options.scaleMode=="box"){
6379this.dims=[this.element.offsetHeight,this.element.offsetWidth];
6380}else{
6381this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
6382}
6383}
6384},update:function(_696){
6385var _697=(this.options.scaleFrom/100)+(this.factor*_696);
6386if(this.options.scaleContent&&this.fontSize){
6387MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_697+this.fontSizeType});
6388}
6389this.setDimensions(this.dims[0]*_697,this.dims[1]*_697);
6390},finish:function(){
6391if(this.restoreAfterFinish){
6392MochiKit.Style.setStyle(this.element,this.originalStyle);
6393}
6394},setDimensions:function(_698,_699){
6395var d={};
6396var r=Math.round;
6397if(/MSIE/.test(navigator.userAgent)){
6398r=Math.ceil;
6399}
6400if(this.options.scaleX){
6401d.width=r(_699)+"px";
6402}
6403if(this.options.scaleY){
6404d.height=r(_698)+"px";
6405}
6406if(this.options.scaleFromCenter){
6407var topd=(_698-this.dims[0])/2;
6408var _69d=(_699-this.dims[1])/2;
6409if(this.elementPositioning=="absolute"){
6410if(this.options.scaleY){
6411d.top=this.originalTop-topd+"px";
6412}
6413if(this.options.scaleX){
6414d.left=this.originalLeft-_69d+"px";
6415}
6416}else{
6417if(this.options.scaleY){
6418d.top=-topd+"px";
6419}
6420if(this.options.scaleX){
6421d.left=-_69d+"px";
6422}
6423}
6424}
6425MochiKit.Style.setStyle(this.element,d);
6426}});
6427MochiKit.Visual.Highlight=function(_69e,_69f){
6428var cls=arguments.callee;
6429if(!(this instanceof cls)){
6430return new cls(_69e,_69f);
6431}
6432this.__init__(_69e,_69f);
6433};
6434MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
6435MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_6a1,_6a2){
6436this.element=MochiKit.DOM.getElement(_6a1);
6437_6a2=MochiKit.Base.update({startcolor:"#ffff99"},_6a2);
6438this.start(_6a2);
6439},setup:function(){
6440var b=MochiKit.Base;
6441var s=MochiKit.Style;
6442if(s.getStyle(this.element,"display")=="none"){
6443this.cancel();
6444return;
6445}
6446this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")};
6447s.setStyle(this.element,{backgroundImage:"none"});
6448if(!this.options.endcolor){
6449this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
6450}
6451if(b.isUndefinedOrNull(this.options.restorecolor)){
6452this.options.restorecolor=s.getStyle(this.element,"background-color");
6453}
6454this._base=b.map(b.bind(function(i){
6455return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
6456},this),[0,1,2]);
6457this._delta=b.map(b.bind(function(i){
6458return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
6459},this),[0,1,2]);
6460},update:function(_6a7){
6461var m="#";
6462MochiKit.Base.map(MochiKit.Base.bind(function(i){
6463m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_6a7));
6464},this),[0,1,2]);
6465MochiKit.Style.setStyle(this.element,{backgroundColor:m});
6466},finish:function(){
6467MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
6468}});
6469MochiKit.Visual.ScrollTo=function(_6aa,_6ab){
6470var cls=arguments.callee;
6471if(!(this instanceof cls)){
6472return new cls(_6aa,_6ab);
6473}
6474this.__init__(_6aa,_6ab);
6475};
6476MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
6477MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_6ad,_6ae){
6478this.element=MochiKit.DOM.getElement(_6ad);
6479this.start(_6ae);
6480},setup:function(){
6481var p=MochiKit.Position;
6482p.prepare();
6483var _6b0=p.cumulativeOffset(this.element);
6484if(this.options.offset){
6485_6b0.y+=this.options.offset;
6486}
6487var max;
6488if(window.innerHeight){
6489max=window.innerHeight-window.height;
6490}else{
6491if(document.documentElement&&document.documentElement.clientHeight){
6492max=document.documentElement.clientHeight-document.body.scrollHeight;
6493}else{
6494if(document.body){
6495max=document.body.clientHeight-document.body.scrollHeight;
6496}
6497}
6498}
6499this.scrollStart=p.windowOffset.y;
6500this.delta=(_6b0.y>max?max:_6b0.y)-this.scrollStart;
6501},update:function(_6b2){
6502var p=MochiKit.Position;
6503p.prepare();
6504window.scrollTo(p.windowOffset.x,this.scrollStart+(_6b2*this.delta));
6505}});
6506MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
6507MochiKit.Visual.Morph=function(_6b4,_6b5){
6508var cls=arguments.callee;
6509if(!(this instanceof cls)){
6510return new cls(_6b4,_6b5);
6511}
6512this.__init__(_6b4,_6b5);
6513};
6514MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
6515MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_6b7,_6b8){
6516this.element=MochiKit.DOM.getElement(_6b7);
6517this.start(_6b8);
6518},setup:function(){
6519var b=MochiKit.Base;
6520var _6ba=this.options.style;
6521this.styleStart={};
6522this.styleEnd={};
6523this.units={};
6524var _6bb,unit;
6525for(var s in _6ba){
6526_6bb=_6ba[s];
6527s=b.camelize(s);
6528if(MochiKit.Visual.CSS_LENGTH.test(_6bb)){
6529var _6be=_6bb.match(/^([\+\-]?[0-9\.]+)(.*)$/);
6530_6bb=parseFloat(_6be[1]);
6531unit=(_6be.length==3)?_6be[2]:null;
6532this.styleEnd[s]=_6bb;
6533this.units[s]=unit;
6534_6bb=MochiKit.Style.getStyle(this.element,s);
6535_6be=_6bb.match(/^([\+\-]?[0-9\.]+)(.*)$/);
6536_6bb=parseFloat(_6be[1]);
6537this.styleStart[s]=_6bb;
6538}else{
6539if(/[Cc]olor$/.test(s)){
6540var c=MochiKit.Color.Color;
6541_6bb=c.fromString(_6bb);
6542if(_6bb){
6543this.units[s]="color";
6544this.styleEnd[s]=_6bb.toHexString();
6545_6bb=MochiKit.Style.getStyle(this.element,s);
6546this.styleStart[s]=c.fromString(_6bb).toHexString();
6547this.styleStart[s]=b.map(b.bind(function(i){
6548return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16);
6549},this),[0,1,2]);
6550this.styleEnd[s]=b.map(b.bind(function(i){
6551return parseInt(this.styleEnd[s].slice(i*2+1,i*2+3),16);
6552},this),[0,1,2]);
6553}
6554}else{
6555this.element.style[s]=_6bb;
6556}
6557}
6558}
6559},update:function(_6c2){
6560var _6c3;
6561for(var s in this.styleStart){
6562if(this.units[s]=="color"){
6563var m="#";
6564var _6c6=this.styleStart[s];
6565var end=this.styleEnd[s];
6566MochiKit.Base.map(MochiKit.Base.bind(function(i){
6567m+=MochiKit.Color.toColorPart(Math.round(_6c6[i]+(end[i]-_6c6[i])*_6c2));
6568},this),[0,1,2]);
6569this.element.style[s]=m;
6570}else{
6571_6c3=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_6c2*1000)/1000+this.units[s];
6572this.element.style[s]=_6c3;
6573}
6574}
6575}});
6576MochiKit.Visual.fade=function(_6c9,_6ca){
6577var s=MochiKit.Style;
6578var _6cc=s.getStyle(_6c9,"opacity");
6579_6ca=MochiKit.Base.update({from:s.getStyle(_6c9,"opacity")||1,to:0,afterFinishInternal:function(_6cd){
6580if(_6cd.options.to!==0){
6581return;
6582}
6583s.hideElement(_6cd.element);
6584s.setStyle(_6cd.element,{"opacity":_6cc});
6585}},_6ca);
6586return new MochiKit.Visual.Opacity(_6c9,_6ca);
6587};
6588MochiKit.Visual.appear=function(_6ce,_6cf){
6589var s=MochiKit.Style;
6590var v=MochiKit.Visual;
6591_6cf=MochiKit.Base.update({from:(s.getStyle(_6ce,"display")=="none"?0:s.getStyle(_6ce,"opacity")||0),to:1,afterFinishInternal:function(_6d2){
6592v.forceRerendering(_6d2.element);
6593},beforeSetupInternal:function(_6d3){
6594s.setStyle(_6d3.element,{"opacity":_6d3.options.from});
6595s.showElement(_6d3.element);
6596}},_6cf);
6597return new v.Opacity(_6ce,_6cf);
6598};
6599MochiKit.Visual.puff=function(_6d4,_6d5){
6600var s=MochiKit.Style;
6601var v=MochiKit.Visual;
6602_6d4=MochiKit.DOM.getElement(_6d4);
6603var _6d8=MochiKit.Style.getElementDimensions(_6d4,true);
6604var _6d9={position:s.getStyle(_6d4,"position"),top:_6d4.style.top,left:_6d4.style.left,width:_6d4.style.width,height:_6d4.style.height,opacity:s.getStyle(_6d4,"opacity")};
6605_6d5=MochiKit.Base.update({beforeSetupInternal:function(_6da){
6606MochiKit.Position.absolutize(_6da.effects[0].element);
6607},afterFinishInternal:function(_6db){
6608s.hideElement(_6db.effects[0].element);
6609s.setStyle(_6db.effects[0].element,_6d9);
6610},scaleContent:true,scaleFromCenter:true},_6d5);
6611return new v.Parallel([new v.Scale(_6d4,200,{sync:true,scaleFromCenter:_6d5.scaleFromCenter,scaleMode:{originalHeight:_6d8.h,originalWidth:_6d8.w},scaleContent:_6d5.scaleContent,restoreAfterFinish:true}),new v.Opacity(_6d4,{sync:true,to:0})],_6d5);
6612};
6613MochiKit.Visual.blindUp=function(_6dc,_6dd){
6614var d=MochiKit.DOM;
6615var s=MochiKit.Style;
6616_6dc=d.getElement(_6dc);
6617var _6e0=s.getElementDimensions(_6dc,true);
6618var _6e1=s.makeClipping(_6dc);
6619_6dd=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_6e0.h,originalWidth:_6e0.w},restoreAfterFinish:true,afterFinishInternal:function(_6e2){
6620s.hideElement(_6e2.element);
6621s.undoClipping(_6e2.element,_6e1);
6622}},_6dd);
6623return new MochiKit.Visual.Scale(_6dc,0,_6dd);
6624};
6625MochiKit.Visual.blindDown=function(_6e3,_6e4){
6626var d=MochiKit.DOM;
6627var s=MochiKit.Style;
6628_6e3=d.getElement(_6e3);
6629var _6e7=s.getElementDimensions(_6e3,true);
6630var _6e8;
6631_6e4=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6e7.h,originalWidth:_6e7.w},restoreAfterFinish:true,afterSetupInternal:function(_6e9){
6632_6e8=s.makeClipping(_6e9.element);
6633s.setStyle(_6e9.element,{height:"0px"});
6634s.showElement(_6e9.element);
6635},afterFinishInternal:function(_6ea){
6636s.undoClipping(_6ea.element,_6e8);
6637}},_6e4);
6638return new MochiKit.Visual.Scale(_6e3,100,_6e4);
6639};
6640MochiKit.Visual.switchOff=function(_6eb,_6ec){
6641var d=MochiKit.DOM;
6642var s=MochiKit.Style;
6643_6eb=d.getElement(_6eb);
6644var _6ef=s.getElementDimensions(_6eb,true);
6645var _6f0=s.getStyle(_6eb,"opacity");
6646var _6f1;
6647_6ec=MochiKit.Base.update({duration:0.7,restoreAfterFinish:true,beforeSetupInternal:function(_6f2){
6648s.makePositioned(_6eb);
6649_6f1=s.makeClipping(_6eb);
6650},afterFinishInternal:function(_6f3){
6651s.hideElement(_6eb);
6652s.undoClipping(_6eb,_6f1);
6653s.undoPositioned(_6eb);
6654s.setStyle(_6eb,{"opacity":_6f0});
6655}},_6ec);
6656var v=MochiKit.Visual;
6657return new v.Sequence([new v.appear(_6eb,{sync:true,duration:0.57*_6ec.duration,from:0,transition:v.Transitions.flicker}),new v.Scale(_6eb,1,{sync:true,duration:0.43*_6ec.duration,scaleFromCenter:true,scaleX:false,scaleMode:{originalHeight:_6ef.h,originalWidth:_6ef.w},scaleContent:false,restoreAfterFinish:true})],_6ec);
6658};
6659MochiKit.Visual.dropOut=function(_6f5,_6f6){
6660var d=MochiKit.DOM;
6661var s=MochiKit.Style;
6662_6f5=d.getElement(_6f5);
6663var _6f9={top:s.getStyle(_6f5,"top"),left:s.getStyle(_6f5,"left"),opacity:s.getStyle(_6f5,"opacity")};
6664_6f6=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6fa){
6665s.makePositioned(_6fa.effects[0].element);
6666},afterFinishInternal:function(_6fb){
6667s.hideElement(_6fb.effects[0].element);
6668s.undoPositioned(_6fb.effects[0].element);
6669s.setStyle(_6fb.effects[0].element,_6f9);
6670}},_6f6);
6671var v=MochiKit.Visual;
6672return new v.Parallel([new v.Move(_6f5,{x:0,y:_6f6.distance,sync:true}),new v.Opacity(_6f5,{sync:true,to:0})],_6f6);
6673};
6674MochiKit.Visual.shake=function(_6fd,_6fe){
6675var d=MochiKit.DOM;
6676var v=MochiKit.Visual;
6677var s=MochiKit.Style;
6678_6fd=d.getElement(_6fd);
6679var _702={top:s.getStyle(_6fd,"top"),left:s.getStyle(_6fd,"left")};
6680_6fe=MochiKit.Base.update({duration:0.5,afterFinishInternal:function(_703){
6681s.undoPositioned(_6fd);
6682s.setStyle(_6fd,_702);
6683}},_6fe);
6684return new v.Sequence([new v.Move(_6fd,{sync:true,duration:0.1*_6fe.duration,x:20,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:-40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:-40,y:0}),new v.Move(_6fd,{sync:true,duration:0.2*_6fe.duration,x:40,y:0}),new v.Move(_6fd,{sync:true,duration:0.1*_6fe.duration,x:-20,y:0})],_6fe);
6685};
6686MochiKit.Visual.slideDown=function(_704,_705){
6687var d=MochiKit.DOM;
6688var b=MochiKit.Base;
6689var s=MochiKit.Style;
6690_704=d.getElement(_704);
6691if(!_704.firstChild){
6692throw new Error("MochiKit.Visual.slideDown must be used on a element with a child");
6693}
6694d.removeEmptyTextNodes(_704);
6695var _709=s.getStyle(_704.firstChild,"bottom")||0;
6696var _70a=s.getElementDimensions(_704,true);
6697var _70b;
6698_705=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_70a.h,originalWidth:_70a.w},restoreAfterFinish:true,afterSetupInternal:function(_70c){
6699s.makePositioned(_70c.element);
6700s.makePositioned(_70c.element.firstChild);
6701if(/Opera/.test(navigator.userAgent)){
6702s.setStyle(_70c.element,{top:""});
6703}
6704_70b=s.makeClipping(_70c.element);
6705s.setStyle(_70c.element,{height:"0px"});
6706s.showElement(_70c.element);
6707},afterUpdateInternal:function(_70d){
6708var _70e=s.getElementDimensions(_70d.element,true);
6709s.setStyle(_70d.element.firstChild,{bottom:(_70d.dims[0]-_70e.h)+"px"});
6710},afterFinishInternal:function(_70f){
6711s.undoClipping(_70f.element,_70b);
6712if(/MSIE/.test(navigator.userAgent)){
6713s.undoPositioned(_70f.element);
6714s.undoPositioned(_70f.element.firstChild);
6715}else{
6716s.undoPositioned(_70f.element.firstChild);
6717s.undoPositioned(_70f.element);
6718}
6719s.setStyle(_70f.element.firstChild,{bottom:_709});
6720}},_705);
6721return new MochiKit.Visual.Scale(_704,100,_705);
6722};
6723MochiKit.Visual.slideUp=function(_710,_711){
6724var d=MochiKit.DOM;
6725var b=MochiKit.Base;
6726var s=MochiKit.Style;
6727_710=d.getElement(_710);
6728if(!_710.firstChild){
6729throw new Error("MochiKit.Visual.slideUp must be used on a element with a child");
6730}
6731d.removeEmptyTextNodes(_710);
6732var _715=s.getStyle(_710.firstChild,"bottom");
6733var _716=s.getElementDimensions(_710,true);
6734var _717;
6735_711=b.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_716.h,originalWidth:_716.w},scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_718){
6736s.makePositioned(_718.element);
6737s.makePositioned(_718.element.firstChild);
6738if(/Opera/.test(navigator.userAgent)){
6739s.setStyle(_718.element,{top:""});
6740}
6741_717=s.makeClipping(_718.element);
6742s.showElement(_718.element);
6743},afterUpdateInternal:function(_719){
6744var _71a=s.getElementDimensions(_719.element,true);
6745s.setStyle(_719.element.firstChild,{bottom:(_719.dims[0]-_71a.h)+"px"});
6746},afterFinishInternal:function(_71b){
6747s.hideElement(_71b.element);
6748s.undoClipping(_71b.element,_717);
6749s.undoPositioned(_71b.element.firstChild);
6750s.undoPositioned(_71b.element);
6751s.setStyle(_71b.element.firstChild,{bottom:_715});
6752}},_711);
6753return new MochiKit.Visual.Scale(_710,0,_711);
6754};
6755MochiKit.Visual.squish=function(_71c,_71d){
6756var d=MochiKit.DOM;
6757var b=MochiKit.Base;
6758var s=MochiKit.Style;
6759var _721=s.getElementDimensions(_71c,true);
6760var _722;
6761_71d=b.update({restoreAfterFinish:true,scaleMode:{originalHeight:_721.w,originalWidth:_721.h},beforeSetupInternal:function(_723){
6762_722=s.makeClipping(_723.element);
6763},afterFinishInternal:function(_724){
6764s.hideElement(_724.element);
6765s.undoClipping(_724.element,_722);
6766}},_71d);
6767return new MochiKit.Visual.Scale(_71c,/Opera/.test(navigator.userAgent)?1:0,_71d);
6768};
6769MochiKit.Visual.grow=function(_725,_726){
6770var d=MochiKit.DOM;
6771var v=MochiKit.Visual;
6772var s=MochiKit.Style;
6773_725=d.getElement(_725);
6774_726=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_726);
6775var _72a={top:_725.style.top,left:_725.style.left,height:_725.style.height,width:_725.style.width,opacity:s.getStyle(_725,"opacity")};
6776var dims=s.getElementDimensions(_725,true);
6777var _72c,_72d;
6778var _72e,_72f;
6779switch(_726.direction){
6780case "top-left":
6781_72c=_72d=_72e=_72f=0;
6782break;
6783case "top-right":
6784_72c=dims.w;
6785_72d=_72f=0;
6786_72e=-dims.w;
6787break;
6788case "bottom-left":
6789_72c=_72e=0;
6790_72d=dims.h;
6791_72f=-dims.h;
6792break;
6793case "bottom-right":
6794_72c=dims.w;
6795_72d=dims.h;
6796_72e=-dims.w;
6797_72f=-dims.h;
6798break;
6799case "center":
6800_72c=dims.w/2;
6801_72d=dims.h/2;
6802_72e=-dims.w/2;
6803_72f=-dims.h/2;
6804break;
6805}
6806var _730=MochiKit.Base.update({beforeSetupInternal:function(_731){
6807s.setStyle(_731.effects[0].element,{height:"0px"});
6808s.showElement(_731.effects[0].element);
6809},afterFinishInternal:function(_732){
6810s.undoClipping(_732.effects[0].element);
6811s.undoPositioned(_732.effects[0].element);
6812s.setStyle(_732.effects[0].element,_72a);
6813}},_726);
6814return new v.Move(_725,{x:_72c,y:_72d,duration:0.01,beforeSetupInternal:function(_733){
6815s.hideElement(_733.element);
6816s.makeClipping(_733.element);
6817s.makePositioned(_733.element);
6818},afterFinishInternal:function(_734){
6819new v.Parallel([new v.Opacity(_734.element,{sync:true,to:1,from:0,transition:_726.opacityTransition}),new v.Move(_734.element,{x:_72e,y:_72f,sync:true,transition:_726.moveTransition}),new v.Scale(_734.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_726.scaleTransition,scaleContent:_726.scaleContent,scaleFromCenter:_726.scaleFromCenter,restoreAfterFinish:true})],_730);
6820}});
6821};
6822MochiKit.Visual.shrink=function(_735,_736){
6823var d=MochiKit.DOM;
6824var v=MochiKit.Visual;
6825var s=MochiKit.Style;
6826_735=d.getElement(_735);
6827_736=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_736);
6828var _73a={top:_735.style.top,left:_735.style.left,height:_735.style.height,width:_735.style.width,opacity:s.getStyle(_735,"opacity")};
6829var dims=s.getElementDimensions(_735,true);
6830var _73c,_73d;
6831switch(_736.direction){
6832case "top-left":
6833_73c=_73d=0;
6834break;
6835case "top-right":
6836_73c=dims.w;
6837_73d=0;
6838break;
6839case "bottom-left":
6840_73c=0;
6841_73d=dims.h;
6842break;
6843case "bottom-right":
6844_73c=dims.w;
6845_73d=dims.h;
6846break;
6847case "center":
6848_73c=dims.w/2;
6849_73d=dims.h/2;
6850break;
6851}
6852var _73e;
6853var _73f=MochiKit.Base.update({beforeStartInternal:function(_740){
6854s.makePositioned(_740.effects[0].element);
6855_73e=s.makeClipping(_740.effects[0].element);
6856},afterFinishInternal:function(_741){
6857s.hideElement(_741.effects[0].element);
6858s.undoClipping(_741.effects[0].element,_73e);
6859s.undoPositioned(_741.effects[0].element);
6860s.setStyle(_741.effects[0].element,_73a);
6861}},_736);
6862return new v.Parallel([new v.Opacity(_735,{sync:true,to:0,from:1,transition:_736.opacityTransition}),new v.Scale(_735,/Opera/.test(navigator.userAgent)?1:0,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,transition:_736.scaleTransition,scaleContent:_736.scaleContent,scaleFromCenter:_736.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_735,{x:_73c,y:_73d,sync:true,transition:_736.moveTransition})],_73f);
6863};
6864MochiKit.Visual.pulsate=function(_742,_743){
6865var d=MochiKit.DOM;
6866var v=MochiKit.Visual;
6867var b=MochiKit.Base;
6868var _747=MochiKit.Style.getStyle(_742,"opacity");
6869_743=b.update({duration:3,from:0,afterFinishInternal:function(_748){
6870MochiKit.Style.setStyle(_748.element,{"opacity":_747});
6871}},_743);
6872var _749=_743.transition||v.Transitions.sinoidal;
6873_743.transition=function(pos){
6874return _749(1-v.Transitions.pulse(pos,_743.pulses));
6875};
6876return new v.Opacity(_742,_743);
6877};
6878MochiKit.Visual.fold=function(_74b,_74c){
6879var d=MochiKit.DOM;
6880var v=MochiKit.Visual;
6881var s=MochiKit.Style;
6882_74b=d.getElement(_74b);
6883var _750=s.getElementDimensions(_74b,true);
6884var _751={top:_74b.style.top,left:_74b.style.left,width:_74b.style.width,height:_74b.style.height};
6885var _752=s.makeClipping(_74b);
6886_74c=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_750.h,originalWidth:_750.w},afterFinishInternal:function(_753){
6887new v.Scale(_74b,1,{scaleContent:false,scaleY:false,scaleMode:{originalHeight:_750.h,originalWidth:_750.w},afterFinishInternal:function(_754){
6888s.hideElement(_754.element);
6889s.undoClipping(_754.element,_752);
6890s.setStyle(_754.element,_751);
6891}});
6892}},_74c);
6893return new v.Scale(_74b,5,_74c);
6894};
6895MochiKit.Visual.Color=MochiKit.Color.Color;
6896MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
6897MochiKit.Visual.__new__=function(){
6898var m=MochiKit.Base;
6899m.nameFunctions(this);
6900this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
6901};
6902MochiKit.Visual.EXPORT=["roundElement","roundClass","tagifyText","multiple","toggle","Parallel","Sequence","Opacity","Move","Scale","Highlight","ScrollTo","Morph","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"];
6903MochiKit.Visual.EXPORT_OK=["Base","PAIRS"];
6904MochiKit.Visual.__new__();
6905MochiKit.Base._exportSymbols(this,MochiKit.Visual);
6906MochiKit.Base._deps("DragAndDrop",["Base","Iter","DOM","Signal","Visual","Position"]);
6907MochiKit.DragAndDrop.NAME="MochiKit.DragAndDrop";
6908MochiKit.DragAndDrop.VERSION="1.4.2";
6909MochiKit.DragAndDrop.__repr__=function(){
6910return "["+this.NAME+" "+this.VERSION+"]";
6911};
6912MochiKit.DragAndDrop.toString=function(){
6913return this.__repr__();
6914};
6915MochiKit.DragAndDrop.EXPORT=["Droppable","Draggable"];
6916MochiKit.DragAndDrop.EXPORT_OK=["Droppables","Draggables"];
6917MochiKit.DragAndDrop.Droppables={drops:[],remove:function(_756){
6918this.drops=MochiKit.Base.filter(function(d){
6919return d.element!=MochiKit.DOM.getElement(_756);
6920},this.drops);
6921},register:function(drop){
6922this.drops.push(drop);
6923},unregister:function(drop){
6924this.drops=MochiKit.Base.filter(function(d){
6925return d!=drop;
6926},this.drops);
6927},prepare:function(_75b){
6928MochiKit.Base.map(function(drop){
6929if(drop.isAccepted(_75b)){
6930if(drop.options.activeclass){
6931MochiKit.DOM.addElementClass(drop.element,drop.options.activeclass);
6932}
6933drop.options.onactive(drop.element,_75b);
6934}
6935},this.drops);
6936},findDeepestChild:function(_75d){
6937deepest=_75d[0];
6938for(i=1;i<_75d.length;++i){
6939if(MochiKit.DOM.isChildNode(_75d[i].element,deepest.element)){
6940deepest=_75d[i];
6941}
6942}
6943return deepest;
6944},show:function(_75e,_75f){
6945if(!this.drops.length){
6946return;
6947}
6948var _760=[];
6949if(this.last_active){
6950this.last_active.deactivate();
6951}
6952MochiKit.Iter.forEach(this.drops,function(drop){
6953if(drop.isAffected(_75e,_75f)){
6954_760.push(drop);
6955}
6956});
6957if(_760.length>0){
6958drop=this.findDeepestChild(_760);
6959MochiKit.Position.within(drop.element,_75e.page.x,_75e.page.y);
6960drop.options.onhover(_75f,drop.element,MochiKit.Position.overlap(drop.options.overlap,drop.element));
6961drop.activate();
6962}
6963},fire:function(_762,_763){
6964if(!this.last_active){
6965return;
6966}
6967MochiKit.Position.prepare();
6968if(this.last_active.isAffected(_762.mouse(),_763)){
6969this.last_active.options.ondrop(_763,this.last_active.element,_762);
6970}
6971},reset:function(_764){
6972MochiKit.Base.map(function(drop){
6973if(drop.options.activeclass){
6974MochiKit.DOM.removeElementClass(drop.element,drop.options.activeclass);
6975}
6976drop.options.ondesactive(drop.element,_764);
6977},this.drops);
6978if(this.last_active){
6979this.last_active.deactivate();
6980}
6981}};
6982MochiKit.DragAndDrop.Droppable=function(_766,_767){
6983var cls=arguments.callee;
6984if(!(this instanceof cls)){
6985return new cls(_766,_767);
6986}
6987this.__init__(_766,_767);
6988};
6989MochiKit.DragAndDrop.Droppable.prototype={__class__:MochiKit.DragAndDrop.Droppable,__init__:function(_769,_76a){
6990var d=MochiKit.DOM;
6991var b=MochiKit.Base;
6992this.element=d.getElement(_769);
6993this.options=b.update({greedy:true,hoverclass:null,activeclass:null,hoverfunc:b.noop,accept:null,onactive:b.noop,ondesactive:b.noop,onhover:b.noop,ondrop:b.noop,containment:[],tree:false},_76a);
6994this.options._containers=[];
6995b.map(MochiKit.Base.bind(function(c){
6996this.options._containers.push(d.getElement(c));
6997},this),this.options.containment);
6998MochiKit.Style.makePositioned(this.element);
6999MochiKit.DragAndDrop.Droppables.register(this);
7000},isContained:function(_76e){
7001if(this.options._containers.length){
7002var _76f;
7003if(this.options.tree){
7004_76f=_76e.treeNode;
7005}else{
7006_76f=_76e.parentNode;
7007}
7008return MochiKit.Iter.some(this.options._containers,function(c){
7009return _76f==c;
7010});
7011}else{
7012return true;
7013}
7014},isAccepted:function(_771){
7015return ((!this.options.accept)||MochiKit.Iter.some(this.options.accept,function(c){
7016return MochiKit.DOM.hasElementClass(_771,c);
7017}));
7018},isAffected:function(_773,_774){
7019return ((this.element!=_774)&&this.isContained(_774)&&this.isAccepted(_774)&&MochiKit.Position.within(this.element,_773.page.x,_773.page.y));
7020},deactivate:function(){
7021if(this.options.hoverclass){
7022MochiKit.DOM.removeElementClass(this.element,this.options.hoverclass);
7023}
7024this.options.hoverfunc(this.element,false);
7025MochiKit.DragAndDrop.Droppables.last_active=null;
7026},activate:function(){
7027if(this.options.hoverclass){
7028MochiKit.DOM.addElementClass(this.element,this.options.hoverclass);
7029}
7030this.options.hoverfunc(this.element,true);
7031MochiKit.DragAndDrop.Droppables.last_active=this;
7032},destroy:function(){
7033MochiKit.DragAndDrop.Droppables.unregister(this);
7034},repr:function(){
7035return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
7036}};
7037MochiKit.DragAndDrop.Draggables={drags:[],register:function(_775){
7038if(this.drags.length===0){
7039var conn=MochiKit.Signal.connect;
7040this.eventMouseUp=conn(document,"onmouseup",this,this.endDrag);
7041this.eventMouseMove=conn(document,"onmousemove",this,this.updateDrag);
7042this.eventKeypress=conn(document,"onkeypress",this,this.keyPress);
7043}
7044this.drags.push(_775);
7045},unregister:function(_777){
7046this.drags=MochiKit.Base.filter(function(d){
7047return d!=_777;
7048},this.drags);
7049if(this.drags.length===0){
7050var disc=MochiKit.Signal.disconnect;
7051disc(this.eventMouseUp);
7052disc(this.eventMouseMove);
7053disc(this.eventKeypress);
7054}
7055},activate:function(_77a){
7056window.focus();
7057this.activeDraggable=_77a;
7058},deactivate:function(){
7059this.activeDraggable=null;
7060},updateDrag:function(_77b){
7061if(!this.activeDraggable){
7062return;
7063}
7064var _77c=_77b.mouse();
7065if(this._lastPointer&&(MochiKit.Base.repr(this._lastPointer.page)==MochiKit.Base.repr(_77c.page))){
7066return;
7067}
7068this._lastPointer=_77c;
7069this.activeDraggable.updateDrag(_77b,_77c);
7070},endDrag:function(_77d){
7071if(!this.activeDraggable){
7072return;
7073}
7074this._lastPointer=null;
7075this.activeDraggable.endDrag(_77d);
7076this.activeDraggable=null;
7077},keyPress:function(_77e){
7078if(this.activeDraggable){
7079this.activeDraggable.keyPress(_77e);
7080}
7081},notify:function(_77f,_780,_781){
7082MochiKit.Signal.signal(this,_77f,_780,_781);
7083}};
7084MochiKit.DragAndDrop.Draggable=function(_782,_783){
7085var cls=arguments.callee;
7086if(!(this instanceof cls)){
7087return new cls(_782,_783);
7088}
7089this.__init__(_782,_783);
7090};
7091MochiKit.DragAndDrop.Draggable.prototype={__class__:MochiKit.DragAndDrop.Draggable,__init__:function(_785,_786){
7092var v=MochiKit.Visual;
7093var b=MochiKit.Base;
7094_786=b.update({handle:false,starteffect:function(_789){
7095this._savedOpacity=MochiKit.Style.getStyle(_789,"opacity")||1;
7096new v.Opacity(_789,{duration:0.2,from:this._savedOpacity,to:0.7});
7097},reverteffect:function(_78a,_78b,_78c){
7098var dur=Math.sqrt(Math.abs(_78b^2)+Math.abs(_78c^2))*0.02;
7099return new v.Move(_78a,{x:-_78c,y:-_78b,duration:dur});
7100},endeffect:function(_78e){
7101new v.Opacity(_78e,{duration:0.2,from:0.7,to:this._savedOpacity});
7102},onchange:b.noop,zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false},_786);
7103var d=MochiKit.DOM;
7104this.element=d.getElement(_785);
7105if(_786.handle&&(typeof (_786.handle)=="string")){
7106this.handle=d.getFirstElementByTagAndClassName(null,_786.handle,this.element);
7107}
7108if(!this.handle){
7109this.handle=d.getElement(_786.handle);
7110}
7111if(!this.handle){
7112this.handle=this.element;
7113}
7114if(_786.scroll&&!_786.scroll.scrollTo&&!_786.scroll.outerHTML){
7115_786.scroll=d.getElement(_786.scroll);
7116this._isScrollChild=MochiKit.DOM.isChildNode(this.element,_786.scroll);
7117}
7118MochiKit.Style.makePositioned(this.element);
7119this.delta=this.currentDelta();
7120this.options=_786;
7121this.dragging=false;
7122this.eventMouseDown=MochiKit.Signal.connect(this.handle,"onmousedown",this,this.initDrag);
7123MochiKit.DragAndDrop.Draggables.register(this);
7124},destroy:function(){
7125MochiKit.Signal.disconnect(this.eventMouseDown);
7126MochiKit.DragAndDrop.Draggables.unregister(this);
7127},currentDelta:function(){
7128var s=MochiKit.Style.getStyle;
7129return [parseInt(s(this.element,"left")||"0"),parseInt(s(this.element,"top")||"0")];
7130},initDrag:function(_791){
7131if(!_791.mouse().button.left){
7132return;
7133}
7134var src=_791.target();
7135var _793=(src.tagName||"").toUpperCase();
7136if(_793==="INPUT"||_793==="SELECT"||_793==="OPTION"||_793==="BUTTON"||_793==="TEXTAREA"){
7137return;
7138}
7139if(this._revert){
7140this._revert.cancel();
7141this._revert=null;
7142}
7143var _794=_791.mouse();
7144var pos=MochiKit.Position.cumulativeOffset(this.element);
7145this.offset=[_794.page.x-pos.x,_794.page.y-pos.y];
7146MochiKit.DragAndDrop.Draggables.activate(this);
7147_791.stop();
7148},startDrag:function(_796){
7149this.dragging=true;
7150if(this.options.selectclass){
7151MochiKit.DOM.addElementClass(this.element,this.options.selectclass);
7152}
7153if(this.options.zindex){
7154this.originalZ=parseInt(MochiKit.Style.getStyle(this.element,"z-index")||"0");
7155this.element.style.zIndex=this.options.zindex;
7156}
7157if(this.options.ghosting){
7158this._clone=this.element.cloneNode(true);
7159this.ghostPosition=MochiKit.Position.absolutize(this.element);
7160this.element.parentNode.insertBefore(this._clone,this.element);
7161}
7162if(this.options.scroll){
7163if(this.options.scroll==window){
7164var _797=this._getWindowScroll(this.options.scroll);
7165this.originalScrollLeft=_797.left;
7166this.originalScrollTop=_797.top;
7167}else{
7168this.originalScrollLeft=this.options.scroll.scrollLeft;
7169this.originalScrollTop=this.options.scroll.scrollTop;
7170}
7171}
7172MochiKit.DragAndDrop.Droppables.prepare(this.element);
7173MochiKit.DragAndDrop.Draggables.notify("start",this,_796);
7174if(this.options.starteffect){
7175this.options.starteffect(this.element);
7176}
7177},updateDrag:function(_798,_799){
7178if(!this.dragging){
7179this.startDrag(_798);
7180}
7181MochiKit.Position.prepare();
7182MochiKit.DragAndDrop.Droppables.show(_799,this.element);
7183MochiKit.DragAndDrop.Draggables.notify("drag",this,_798);
7184this.draw(_799);
7185this.options.onchange(this);
7186if(this.options.scroll){
7187this.stopScrolling();
7188var p,q;
7189if(this.options.scroll==window){
7190var s=this._getWindowScroll(this.options.scroll);
7191p=new MochiKit.Style.Coordinates(s.left,s.top);
7192q=new MochiKit.Style.Coordinates(s.left+s.width,s.top+s.height);
7193}else{
7194p=MochiKit.Position.page(this.options.scroll);
7195p.x+=this.options.scroll.scrollLeft;
7196p.y+=this.options.scroll.scrollTop;
7197p.x+=(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0);
7198p.y+=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);
7199q=new MochiKit.Style.Coordinates(p.x+this.options.scroll.offsetWidth,p.y+this.options.scroll.offsetHeight);
7200}
7201var _79d=[0,0];
7202if(_799.page.x>(q.x-this.options.scrollSensitivity)){
7203_79d[0]=_799.page.x-(q.x-this.options.scrollSensitivity);
7204}else{
7205if(_799.page.x<(p.x+this.options.scrollSensitivity)){
7206_79d[0]=_799.page.x-(p.x+this.options.scrollSensitivity);
7207}
7208}
7209if(_799.page.y>(q.y-this.options.scrollSensitivity)){
7210_79d[1]=_799.page.y-(q.y-this.options.scrollSensitivity);
7211}else{
7212if(_799.page.y<(p.y+this.options.scrollSensitivity)){
7213_79d[1]=_799.page.y-(p.y+this.options.scrollSensitivity);
7214}
7215}
7216this.startScrolling(_79d);
7217}
7218if(/AppleWebKit/.test(navigator.appVersion)){
7219window.scrollBy(0,0);
7220}
7221_798.stop();
7222},finishDrag:function(_79e,_79f){
7223var dr=MochiKit.DragAndDrop;
7224this.dragging=false;
7225if(this.options.selectclass){
7226MochiKit.DOM.removeElementClass(this.element,this.options.selectclass);
7227}
7228if(this.options.ghosting){
7229MochiKit.Position.relativize(this.element,this.ghostPosition);
7230MochiKit.DOM.removeElement(this._clone);
7231this._clone=null;
7232}
7233if(_79f){
7234dr.Droppables.fire(_79e,this.element);
7235}
7236dr.Draggables.notify("end",this,_79e);
7237var _7a1=this.options.revert;
7238if(_7a1&&typeof (_7a1)=="function"){
7239_7a1=_7a1(this.element);
7240}
7241var d=this.currentDelta();
7242if(_7a1&&this.options.reverteffect){
7243this._revert=this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);
7244}else{
7245this.delta=d;
7246}
7247if(this.options.zindex){
7248this.element.style.zIndex=this.originalZ;
7249}
7250if(this.options.endeffect){
7251this.options.endeffect(this.element);
7252}
7253dr.Draggables.deactivate();
7254dr.Droppables.reset(this.element);
7255},keyPress:function(_7a3){
7256if(_7a3.key().string!="KEY_ESCAPE"){
7257return;
7258}
7259this.finishDrag(_7a3,false);
7260_7a3.stop();
7261},endDrag:function(_7a4){
7262if(!this.dragging){
7263return;
7264}
7265this.stopScrolling();
7266this.finishDrag(_7a4,true);
7267_7a4.stop();
7268},draw:function(_7a5){
7269var pos=MochiKit.Position.cumulativeOffset(this.element);
7270var d=this.currentDelta();
7271pos.x-=d[0];
7272pos.y-=d[1];
7273if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){
7274pos.x-=this.options.scroll.scrollLeft-this.originalScrollLeft;
7275pos.y-=this.options.scroll.scrollTop-this.originalScrollTop;
7276}
7277var p=[_7a5.page.x-pos.x-this.offset[0],_7a5.page.y-pos.y-this.offset[1]];
7278if(this.options.snap){
7279if(typeof (this.options.snap)=="function"){
7280p=this.options.snap(p[0],p[1]);
7281}else{
7282if(this.options.snap instanceof Array){
7283var i=-1;
7284p=MochiKit.Base.map(MochiKit.Base.bind(function(v){
7285i+=1;
7286return Math.round(v/this.options.snap[i])*this.options.snap[i];
7287},this),p);
7288}else{
7289p=MochiKit.Base.map(MochiKit.Base.bind(function(v){
7290return Math.round(v/this.options.snap)*this.options.snap;
7291},this),p);
7292}
7293}
7294}
7295var _7ac=this.element.style;
7296if((!this.options.constraint)||(this.options.constraint=="horizontal")){
7297_7ac.left=p[0]+"px";
7298}
7299if((!this.options.constraint)||(this.options.constraint=="vertical")){
7300_7ac.top=p[1]+"px";
7301}
7302if(_7ac.visibility=="hidden"){
7303_7ac.visibility="";
7304}
7305},stopScrolling:function(){
7306if(this.scrollInterval){
7307clearInterval(this.scrollInterval);
7308this.scrollInterval=null;
7309MochiKit.DragAndDrop.Draggables._lastScrollPointer=null;
7310}
7311},startScrolling:function(_7ad){
7312if(!_7ad[0]&&!_7ad[1]){
7313return;
7314}
7315this.scrollSpeed=[_7ad[0]*this.options.scrollSpeed,_7ad[1]*this.options.scrollSpeed];
7316this.lastScrolled=new Date();
7317this.scrollInterval=setInterval(MochiKit.Base.bind(this.scroll,this),10);
7318},scroll:function(){
7319var _7ae=new Date();
7320var _7af=_7ae-this.lastScrolled;
7321this.lastScrolled=_7ae;
7322if(this.options.scroll==window){
7323var s=this._getWindowScroll(this.options.scroll);
7324if(this.scrollSpeed[0]||this.scrollSpeed[1]){
7325var dm=_7af/1000;
7326this.options.scroll.scrollTo(s.left+dm*this.scrollSpeed[0],s.top+dm*this.scrollSpeed[1]);
7327}
7328}else{
7329this.options.scroll.scrollLeft+=this.scrollSpeed[0]*_7af/1000;
7330this.options.scroll.scrollTop+=this.scrollSpeed[1]*_7af/1000;
7331}
7332var d=MochiKit.DragAndDrop;
7333MochiKit.Position.prepare();
7334d.Droppables.show(d.Draggables._lastPointer,this.element);
7335d.Draggables.notify("drag",this);
7336if(this._isScrollChild){
7337d.Draggables._lastScrollPointer=d.Draggables._lastScrollPointer||d.Draggables._lastPointer;
7338d.Draggables._lastScrollPointer.x+=this.scrollSpeed[0]*_7af/1000;
7339d.Draggables._lastScrollPointer.y+=this.scrollSpeed[1]*_7af/1000;
7340if(d.Draggables._lastScrollPointer.x<0){
7341d.Draggables._lastScrollPointer.x=0;
7342}
7343if(d.Draggables._lastScrollPointer.y<0){
7344d.Draggables._lastScrollPointer.y=0;
7345}
7346this.draw(d.Draggables._lastScrollPointer);
7347}
7348this.options.onchange(this);
7349},_getWindowScroll:function(win){
7350var vp,w,h;
7351MochiKit.DOM.withWindow(win,function(){
7352vp=MochiKit.Style.getViewportPosition(win.document);
7353});
7354if(win.innerWidth){
7355w=win.innerWidth;
7356h=win.innerHeight;
7357}else{
7358if(win.document.documentElement&&win.document.documentElement.clientWidth){
7359w=win.document.documentElement.clientWidth;
7360h=win.document.documentElement.clientHeight;
7361}else{
7362w=win.document.body.offsetWidth;
7363h=win.document.body.offsetHeight;
7364}
7365}
7366return {top:vp.y,left:vp.x,width:w,height:h};
7367},repr:function(){
7368return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
7369}};
7370MochiKit.DragAndDrop.__new__=function(){
7371MochiKit.Base.nameFunctions(this);
7372this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
7373};
7374MochiKit.DragAndDrop.__new__();
7375MochiKit.Base._exportSymbols(this,MochiKit.DragAndDrop);
7376MochiKit.Base._deps("Sortable",["Base","Iter","DOM","Position","DragAndDrop"]);
7377MochiKit.Sortable.NAME="MochiKit.Sortable";
7378MochiKit.Sortable.VERSION="1.4.2";
7379MochiKit.Sortable.__repr__=function(){
7380return "["+this.NAME+" "+this.VERSION+"]";
7381};
7382MochiKit.Sortable.toString=function(){
7383return this.__repr__();
7384};
7385MochiKit.Sortable.EXPORT=[];
7386MochiKit.Sortable.EXPORT_OK=[];
7387MochiKit.Base.update(MochiKit.Sortable,{sortables:{},_findRootElement:function(_7b7){
7388while(_7b7.tagName.toUpperCase()!="BODY"){
7389if(_7b7.id&&MochiKit.Sortable.sortables[_7b7.id]){
7390return _7b7;
7391}
7392_7b7=_7b7.parentNode;
7393}
7394},_createElementId:function(_7b8){
7395if(_7b8.id==null||_7b8.id==""){
7396var d=MochiKit.DOM;
7397var id;
7398var _7bb=1;
7399while(d.getElement(id="sortable"+_7bb)!=null){
7400_7bb+=1;
7401}
7402d.setNodeAttribute(_7b8,"id",id);
7403}
7404},options:function(_7bc){
7405_7bc=MochiKit.Sortable._findRootElement(MochiKit.DOM.getElement(_7bc));
7406if(!_7bc){
7407return;
7408}
7409return MochiKit.Sortable.sortables[_7bc.id];
7410},destroy:function(_7bd){
7411var s=MochiKit.Sortable.options(_7bd);
7412var b=MochiKit.Base;
7413var d=MochiKit.DragAndDrop;
7414if(s){
7415MochiKit.Signal.disconnect(s.startHandle);
7416MochiKit.Signal.disconnect(s.endHandle);
7417b.map(function(dr){
7418d.Droppables.remove(dr);
7419},s.droppables);
7420b.map(function(dr){
7421dr.destroy();
7422},s.draggables);
7423delete MochiKit.Sortable.sortables[s.element.id];
7424}
7425},create:function(_7c3,_7c4){
7426_7c3=MochiKit.DOM.getElement(_7c3);
7427var self=MochiKit.Sortable;
7428self._createElementId(_7c3);
7429_7c4=MochiKit.Base.update({element:_7c3,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:[_7c3],handle:false,only:false,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:/^[^_]*_(.*)$/,onChange:MochiKit.Base.noop,onUpdate:MochiKit.Base.noop,accept:null},_7c4);
7430self.destroy(_7c3);
7431var _7c6={revert:true,ghosting:_7c4.ghosting,scroll:_7c4.scroll,scrollSensitivity:_7c4.scrollSensitivity,scrollSpeed:_7c4.scrollSpeed,constraint:_7c4.constraint,handle:_7c4.handle};
7432if(_7c4.starteffect){
7433_7c6.starteffect=_7c4.starteffect;
7434}
7435if(_7c4.reverteffect){
7436_7c6.reverteffect=_7c4.reverteffect;
7437}else{
7438if(_7c4.ghosting){
7439_7c6.reverteffect=function(_7c7){
7440_7c7.style.top=0;
7441_7c7.style.left=0;
7442};
7443}
7444}
7445if(_7c4.endeffect){
7446_7c6.endeffect=_7c4.endeffect;
7447}
7448if(_7c4.zindex){
7449_7c6.zindex=_7c4.zindex;
7450}
7451var _7c8={overlap:_7c4.overlap,containment:_7c4.containment,hoverclass:_7c4.hoverclass,onhover:self.onHover,tree:_7c4.tree,accept:_7c4.accept};
7452var _7c9={onhover:self.onEmptyHover,overlap:_7c4.overlap,containment:_7c4.containment,hoverclass:_7c4.hoverclass,accept:_7c4.accept};
7453MochiKit.DOM.removeEmptyTextNodes(_7c3);
7454_7c4.draggables=[];
7455_7c4.droppables=[];
7456if(_7c4.dropOnEmpty||_7c4.tree){
7457new MochiKit.DragAndDrop.Droppable(_7c3,_7c9);
7458_7c4.droppables.push(_7c3);
7459}
7460MochiKit.Base.map(function(e){
7461var _7cb=_7c4.handle?MochiKit.DOM.getFirstElementByTagAndClassName(null,_7c4.handle,e):e;
7462_7c4.draggables.push(new MochiKit.DragAndDrop.Draggable(e,MochiKit.Base.update(_7c6,{handle:_7cb})));
7463new MochiKit.DragAndDrop.Droppable(e,_7c8);
7464if(_7c4.tree){
7465e.treeNode=_7c3;
7466}
7467_7c4.droppables.push(e);
7468},(self.findElements(_7c3,_7c4)||[]));
7469if(_7c4.tree){
7470MochiKit.Base.map(function(e){
7471new MochiKit.DragAndDrop.Droppable(e,_7c9);
7472e.treeNode=_7c3;
7473_7c4.droppables.push(e);
7474},(self.findTreeElements(_7c3,_7c4)||[]));
7475}
7476self.sortables[_7c3.id]=_7c4;
7477_7c4.lastValue=self.serialize(_7c3);
7478_7c4.startHandle=MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables,"start",MochiKit.Base.partial(self.onStart,_7c3));
7479_7c4.endHandle=MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables,"end",MochiKit.Base.partial(self.onEnd,_7c3));
7480},onStart:function(_7cd,_7ce){
7481var self=MochiKit.Sortable;
7482var _7d0=self.options(_7cd);
7483_7d0.lastValue=self.serialize(_7d0.element);
7484},onEnd:function(_7d1,_7d2){
7485var self=MochiKit.Sortable;
7486self.unmark();
7487var _7d4=self.options(_7d1);
7488if(_7d4.lastValue!=self.serialize(_7d4.element)){
7489_7d4.onUpdate(_7d4.element);
7490}
7491},findElements:function(_7d5,_7d6){
7492return MochiKit.Sortable.findChildren(_7d5,_7d6.only,_7d6.tree,_7d6.tag);
7493},findTreeElements:function(_7d7,_7d8){
7494return MochiKit.Sortable.findChildren(_7d7,_7d8.only,_7d8.tree?true:false,_7d8.treeTag);
7495},findChildren:function(_7d9,only,_7db,_7dc){
7496if(!_7d9.hasChildNodes()){
7497return null;
7498}
7499_7dc=_7dc.toUpperCase();
7500if(only){
7501only=MochiKit.Base.flattenArray([only]);
7502}
7503var _7dd=[];
7504MochiKit.Base.map(function(e){
7505if(e.tagName&&e.tagName.toUpperCase()==_7dc&&(!only||MochiKit.Iter.some(only,function(c){
7506return MochiKit.DOM.hasElementClass(e,c);
7507}))){
7508_7dd.push(e);
7509}
7510if(_7db){
7511var _7e0=MochiKit.Sortable.findChildren(e,only,_7db,_7dc);
7512if(_7e0&&_7e0.length>0){
7513_7dd=_7dd.concat(_7e0);
7514}
7515}
7516},_7d9.childNodes);
7517return _7dd;
7518},onHover:function(_7e1,_7e2,_7e3){
7519if(MochiKit.DOM.isChildNode(_7e2,_7e1)){
7520return;
7521}
7522var self=MochiKit.Sortable;
7523if(_7e3>0.33&&_7e3<0.66&&self.options(_7e2).tree){
7524return;
7525}else{
7526if(_7e3>0.5){
7527self.mark(_7e2,"before");
7528if(_7e2.previousSibling!=_7e1){
7529var _7e5=_7e1.parentNode;
7530_7e1.style.visibility="hidden";
7531_7e2.parentNode.insertBefore(_7e1,_7e2);
7532if(_7e2.parentNode!=_7e5){
7533self.options(_7e5).onChange(_7e1);
7534}
7535self.options(_7e2.parentNode).onChange(_7e1);
7536}
7537}else{
7538self.mark(_7e2,"after");
7539var _7e6=_7e2.nextSibling||null;
7540if(_7e6!=_7e1){
7541var _7e5=_7e1.parentNode;
7542_7e1.style.visibility="hidden";
7543_7e2.parentNode.insertBefore(_7e1,_7e6);
7544if(_7e2.parentNode!=_7e5){
7545self.options(_7e5).onChange(_7e1);
7546}
7547self.options(_7e2.parentNode).onChange(_7e1);
7548}
7549}
7550}
7551},_offsetSize:function(_7e7,type){
7552if(type=="vertical"||type=="height"){
7553return _7e7.offsetHeight;
7554}else{
7555return _7e7.offsetWidth;
7556}
7557},onEmptyHover:function(_7e9,_7ea,_7eb){
7558var _7ec=_7e9.parentNode;
7559var self=MochiKit.Sortable;
7560var _7ee=self.options(_7ea);
7561if(!MochiKit.DOM.isChildNode(_7ea,_7e9)){
7562var _7ef;
7563var _7f0=self.findElements(_7ea,{tag:_7ee.tag,only:_7ee.only});
7564var _7f1=null;
7565if(_7f0){
7566var _7f2=self._offsetSize(_7ea,_7ee.overlap)*(1-_7eb);
7567for(_7ef=0;_7ef<_7f0.length;_7ef+=1){
7568if(_7f2-self._offsetSize(_7f0[_7ef],_7ee.overlap)>=0){
7569_7f2-=self._offsetSize(_7f0[_7ef],_7ee.overlap);
7570}else{
7571if(_7f2-(self._offsetSize(_7f0[_7ef],_7ee.overlap)/2)>=0){
7572_7f1=_7ef+1<_7f0.length?_7f0[_7ef+1]:null;
7573break;
7574}else{
7575_7f1=_7f0[_7ef];
7576break;
7577}
7578}
7579}
7580}
7581_7ea.insertBefore(_7e9,_7f1);
7582self.options(_7ec).onChange(_7e9);
7583_7ee.onChange(_7e9);
7584}
7585},unmark:function(){
7586var m=MochiKit.Sortable._marker;
7587if(m){
7588MochiKit.Style.hideElement(m);
7589}
7590},mark:function(_7f4,_7f5){
7591var d=MochiKit.DOM;
7592var self=MochiKit.Sortable;
7593var _7f8=self.options(_7f4.parentNode);
7594if(_7f8&&!_7f8.ghosting){
7595return;
7596}
7597if(!self._marker){
7598self._marker=d.getElement("dropmarker")||document.createElement("DIV");
7599MochiKit.Style.hideElement(self._marker);
7600d.addElementClass(self._marker,"dropmarker");
7601self._marker.style.position="absolute";
7602document.getElementsByTagName("body").item(0).appendChild(self._marker);
7603}
7604var _7f9=MochiKit.Position.cumulativeOffset(_7f4);
7605self._marker.style.left=_7f9.x+"px";
7606self._marker.style.top=_7f9.y+"px";
7607if(_7f5=="after"){
7608if(_7f8.overlap=="horizontal"){
7609self._marker.style.left=(_7f9.x+_7f4.clientWidth)+"px";
7610}else{
7611self._marker.style.top=(_7f9.y+_7f4.clientHeight)+"px";
7612}
7613}
7614MochiKit.Style.showElement(self._marker);
7615},_tree:function(_7fa,_7fb,_7fc){
7616var self=MochiKit.Sortable;
7617var _7fe=self.findElements(_7fa,_7fb)||[];
7618for(var i=0;i<_7fe.length;++i){
7619var _800=_7fe[i].id.match(_7fb.format);
7620if(!_800){
7621continue;
7622}
7623var _801={id:encodeURIComponent(_800?_800[1]:null),element:_7fa,parent:_7fc,children:[],position:_7fc.children.length,container:self._findChildrenElement(_7fe[i],_7fb.treeTag.toUpperCase())};
7624if(_801.container){
7625self._tree(_801.container,_7fb,_801);
7626}
7627_7fc.children.push(_801);
7628}
7629return _7fc;
7630},_findChildrenElement:function(_802,_803){
7631if(_802&&_802.hasChildNodes){
7632_803=_803.toUpperCase();
7633for(var i=0;i<_802.childNodes.length;++i){
7634if(_802.childNodes[i].tagName.toUpperCase()==_803){
7635return _802.childNodes[i];
7636}
7637}
7638}
7639return null;
7640},tree:function(_805,_806){
7641_805=MochiKit.DOM.getElement(_805);
7642var _807=MochiKit.Sortable.options(_805);
7643_806=MochiKit.Base.update({tag:_807.tag,treeTag:_807.treeTag,only:_807.only,name:_805.id,format:_807.format},_806||{});
7644var root={id:null,parent:null,children:new Array,container:_805,position:0};
7645return MochiKit.Sortable._tree(_805,_806,root);
7646},setSequence:function(_809,_80a,_80b){
7647var self=MochiKit.Sortable;
7648var b=MochiKit.Base;
7649_809=MochiKit.DOM.getElement(_809);
7650_80b=b.update(self.options(_809),_80b||{});
7651var _80e={};
7652b.map(function(n){
7653var m=n.id.match(_80b.format);
7654if(m){
7655_80e[m[1]]=[n,n.parentNode];
7656}
7657n.parentNode.removeChild(n);
7658},self.findElements(_809,_80b));
7659b.map(function(_811){
7660var n=_80e[_811];
7661if(n){
7662n[1].appendChild(n[0]);
7663delete _80e[_811];
7664}
7665},_80a);
7666},_constructIndex:function(node){
7667var _814="";
7668do{
7669if(node.id){
7670_814="["+node.position+"]"+_814;
7671}
7672}while((node=node.parent)!=null);
7673return _814;
7674},sequence:function(_815,_816){
7675_815=MochiKit.DOM.getElement(_815);
7676var self=MochiKit.Sortable;
7677var _816=MochiKit.Base.update(self.options(_815),_816||{});
7678return MochiKit.Base.map(function(item){
7679return item.id.match(_816.format)?item.id.match(_816.format)[1]:"";
7680},MochiKit.DOM.getElement(self.findElements(_815,_816)||[]));
7681},serialize:function(_819,_81a){
7682_819=MochiKit.DOM.getElement(_819);
7683var self=MochiKit.Sortable;
7684_81a=MochiKit.Base.update(self.options(_819),_81a||{});
7685var name=encodeURIComponent(_81a.name||_819.id);
7686if(_81a.tree){
7687return MochiKit.Base.flattenArray(MochiKit.Base.map(function(item){
7688return [name+self._constructIndex(item)+"[id]="+encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
7689},self.tree(_819,_81a).children)).join("&");
7690}else{
7691return MochiKit.Base.map(function(item){
7692return name+"[]="+encodeURIComponent(item);
7693},self.sequence(_819,_81a)).join("&");
7694}
7695}});
7696MochiKit.Sortable.Sortable=MochiKit.Sortable;
7697MochiKit.Sortable.__new__=function(){
7698MochiKit.Base.nameFunctions(this);
7699this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
7700};
7701MochiKit.Sortable.__new__();
7702MochiKit.Base._exportSymbols(this,MochiKit.Sortable);
7703if(typeof (MochiKit)=="undefined"){
7704MochiKit={};
7705}
7706if(typeof (MochiKit.MochiKit)=="undefined"){
7707MochiKit.MochiKit={};
7708}
7709MochiKit.MochiKit.NAME="MochiKit.MochiKit";
7710MochiKit.MochiKit.VERSION="1.4.2";
7711MochiKit.MochiKit.__repr__=function(){
7712return "["+this.NAME+" "+this.VERSION+"]";
7713};
7714MochiKit.MochiKit.toString=function(){
7715return this.__repr__();
7716};
7717MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","Selector","Style","LoggingPane","Color","Signal","Position","Visual","DragAndDrop","Sortable"];
7718if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
7719if(typeof (dojo)!="undefined"){
7720dojo.provide("MochiKit.MochiKit");
7721(function(lst){
7722for(var i=0;i<lst.length;i++){
7723dojo.require("MochiKit."+lst[i]);
7724}
7725})(MochiKit.MochiKit.SUBMODULES);
7726}
7727if(typeof (JSAN)!="undefined"){
7728(function(lst){
7729for(var i=0;i<lst.length;i++){
7730JSAN.use("MochiKit."+lst[i],[]);
7731}
7732})(MochiKit.MochiKit.SUBMODULES);
7733}
7734(function(){
7735var _823=MochiKit.Base.extend;
7736var self=MochiKit.MochiKit;
7737var _825=self.SUBMODULES;
7738var _826=[];
7739var _827=[];
7740var _828={};
7741var i,k,m,all;
7742for(i=0;i<_825.length;i++){
7743m=MochiKit[_825[i]];
7744_823(_826,m.EXPORT);
7745_823(_827,m.EXPORT_OK);
7746for(k in m.EXPORT_TAGS){
7747_828[k]=_823(_828[k],m.EXPORT_TAGS[k]);
7748}
7749all=m.EXPORT_TAGS[":all"];
7750if(!all){
7751all=_823(null,m.EXPORT,m.EXPORT_OK);
7752}
7753var j;
7754for(j=0;j<all.length;j++){
7755k=all[j];
7756self[k]=m[k];
7757}
7758}
7759self.EXPORT=_826;
7760self.EXPORT_OK=_827;
7761self.EXPORT_TAGS=_828;
7762}());
7763}else{
7764if(typeof (MochiKit.__compat__)=="undefined"){
7765MochiKit.__compat__=true;
7766}
7767(function(){
7768if(typeof (document)=="undefined"){
7769return;
7770}
7771var _82e=document.getElementsByTagName("script");
7772var _82f="http://www.w3.org/1999/xhtml";
7773var _830="http://www.w3.org/2000/svg";
7774var _831="http://www.w3.org/1999/xlink";
7775var _832="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
7776var base=null;
7777var _834=null;
7778var _835={};
7779var i;
7780var src;
7781for(i=0;i<_82e.length;i++){
7782src=null;
7783switch(_82e[i].namespaceURI){
7784case _830:
7785src=_82e[i].getAttributeNS(_831,"href");
7786break;
7787default:
7788src=_82e[i].getAttribute("src");
7789break;
7790}
7791if(!src){
7792continue;
7793}
7794_835[src]=true;
7795if(src.match(/MochiKit.js(\?.*)?$/)){
7796base=src.substring(0,src.lastIndexOf("MochiKit.js"));
7797_834=_82e[i];
7798}
7799}
7800if(base===null){
7801return;
7802}
7803var _838=MochiKit.MochiKit.SUBMODULES;
7804for(var i=0;i<_838.length;i++){
7805if(MochiKit[_838[i]]){
7806continue;
7807}
7808var uri=base+_838[i]+".js";
7809if(uri in _835){
7810continue;
7811}
7812if(_834.namespaceURI==_830||_834.namespaceURI==_832){
7813var s=document.createElementNS(_834.namespaceURI,"script");
7814s.setAttribute("id","MochiKit_"+base+_838[i]);
7815if(_834.namespaceURI==_830){
7816s.setAttributeNS(_831,"href",uri);
7817}else{
7818s.setAttribute("src",uri);
7819}
7820s.setAttribute("type","application/x-javascript");
7821_834.parentNode.appendChild(s);
7822}else{
7823document.write("<"+_834.nodeName+" src=\""+uri+"\" type=\"text/javascript\"></script>");
7824}
7825}
7826})();
7827}
7828
7829
7830