3 MochiKit.MochiKit 1.4 : PACKED VERSION
5 THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
6 diff against the source tree, not this file.
8 See <http://mochikit.com/> for documentation, downloads, license, etc.
10 (c) 2005 Bob Ippolito. All rights Reserved.
14 if(typeof (dojo)!="undefined"){
15 dojo.provide("MochiKit.Base");
17 if(typeof (MochiKit)=="undefined"){
20 if(typeof (MochiKit.Base)=="undefined"){
23 if(typeof (MochiKit.__export__)=="undefined"){
24 MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
26 MochiKit.Base.VERSION="1.4";
27 MochiKit.Base.NAME="MochiKit.Base";
28 MochiKit.Base.update=function(_1,_2){
32 for(var i=1;i<arguments.length;i++){
34 if(typeof (o)!="undefined"&&o!==null){
42 MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
43 return "["+this.NAME+" "+this.VERSION+"]";
44 },toString:function(){
45 return this.__repr__();
46 },camelize:function(_6){
49 for(var i=1;i<_7.length;i++){
50 cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
53 },counter:function(n){
54 if(arguments.length===0){
61 var me=arguments.callee;
62 if(arguments.length==1){
66 },_flattenArray:function(_d,_e){
67 for(var i=0;i<_e.length;i++){
69 if(o instanceof Array){
70 arguments.callee(_d,o);
76 },flattenArray:function(lst){
77 return MochiKit.Base._flattenArray([],lst);
78 },flattenArguments:function(lst){
81 var _15=m.extend(null,arguments);
84 if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
85 for(var i=o.length-1;i>=0;i--){
93 },extend:function(_18,obj,_1a){
99 if(typeof (l)!="number"){
100 if(typeof (MochiKit.Iter)!="undefined"){
101 obj=MochiKit.Iter.list(obj);
104 throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
110 for(var i=_1a;i<l;i++){
115 },updatetree:function(_1d,obj){
119 for(var i=1;i<arguments.length;i++){
121 if(typeof (o)!="undefined"&&o!==null){
124 if(typeof (_1d[k])=="object"&&typeof (v)=="object"){
125 arguments.callee(_1d[k],v);
133 },setdefault:function(_23,obj){
137 for(var i=1;i<arguments.length;i++){
146 },keys:function(obj){
152 },values:function(obj){
158 },items:function(obj){
172 },_newNamedError:function(_33,_34,_35){
173 _35.prototype=new MochiKit.Base.NamedError(_33.NAME+"."+_34);
175 },operator:{truth:function(a){
177 },lognot:function(a){
179 },identity:function(a){
201 },lshift:function(a,b){
203 },rshift:function(a,b){
205 },zrshift:function(a,b){
224 return MochiKit.Base.compare(a,b)===0;
226 return MochiKit.Base.compare(a,b)!==0;
228 return MochiKit.Base.compare(a,b)==1;
230 return MochiKit.Base.compare(a,b)!=-1;
232 return MochiKit.Base.compare(a,b)==-1;
234 return MochiKit.Base.compare(a,b)!=1;
235 },logand:function(a,b){
237 },logor:function(a,b){
239 },contains:function(a,b){
241 }},forwardCall:function(_73){
243 return this[_73].apply(this,arguments);
245 },itemgetter:function(_74){
246 return function(arg){
249 },typeMatcher:function(){
251 for(var i=0;i<arguments.length;i++){
252 var typ=arguments[i];
256 for(var i=0;i<arguments.length;i++){
257 if(!(typeof (arguments[i]) in _76)){
264 for(var i=0;i<arguments.length;i++){
265 if(arguments[i]!==null){
270 },isUndefinedOrNull:function(){
271 for(var i=0;i<arguments.length;i++){
273 if(!(typeof (o)=="undefined"||o===null)){
278 },isEmpty:function(obj){
279 return !MochiKit.Base.isNotEmpty.apply(this,arguments);
280 },isNotEmpty:function(obj){
281 for(var i=0;i<arguments.length;i++){
288 },isArrayLike:function(){
289 for(var i=0;i<arguments.length;i++){
292 if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3){
297 },isDateLike:function(){
298 for(var i=0;i<arguments.length;i++){
300 if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
307 return MochiKit.Base.extend(null,arguments,1);
310 for(var i=1;i<arguments.length;i++){
311 _87.push(fn(arguments[i]));
314 },map:function(fn,lst){
316 var itr=MochiKit.Iter;
317 var _8d=m.isArrayLike;
318 if(arguments.length<=2){
326 throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
330 return m.extend(null,lst);
333 for(var i=0;i<lst.length;i++){
334 _8e.push(fn(lst[i]));
342 for(i=1;i<arguments.length;i++){
343 if(!_8d(arguments[i])){
345 return itr.list(itr.imap.apply(null,arguments));
347 throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
350 var l=arguments[i].length;
351 if(_90===null||_90>l){
358 for(var j=1;j<arguments.length;j++){
359 _92.push(arguments[j][i]);
361 _8e.push(fn.apply(this,_92));
365 },xfilter:function(fn){
368 fn=MochiKit.Base.operator.truth;
370 for(var i=1;i<arguments.length;i++){
377 },filter:function(fn,lst,_9a){
380 if(!m.isArrayLike(lst)){
382 lst=MochiKit.Iter.list(lst);
384 throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
390 if(typeof (Array.prototype.filter)=="function"){
391 return Array.prototype.filter.call(lst,fn,_9a);
393 if(typeof (_9a)=="undefined"||_9a===null){
394 for(var i=0;i<lst.length;i++){
401 for(i=0;i<lst.length;i++){
410 },_wrapDumbFunction:function(_9f){
412 switch(arguments.length){
416 return _9f(arguments[0]);
418 return _9f(arguments[0],arguments[1]);
420 return _9f(arguments[0],arguments[1],arguments[2]);
423 for(var i=0;i<arguments.length;i++){
424 _a0.push("arguments["+i+"]");
426 return eval("(func("+_a0.join(",")+"))");
428 },methodcaller:function(_a2){
429 var _a3=MochiKit.Base.extend(null,arguments,1);
430 if(typeof (_a2)=="function"){
431 return function(obj){
432 return _a2.apply(obj,_a3);
435 return function(obj){
436 return obj[_a2].apply(obj,_a3);
439 },method:function(_a6,_a7){
441 return m.bind.apply(this,m.extend([_a7,_a6],arguments,2));
442 },compose:function(f1,f2){
445 if(arguments.length===0){
446 throw new TypeError("compose() requires at least one argument");
448 for(var i=0;i<arguments.length;i++){
450 if(typeof (fn)!="function"){
451 throw new TypeError(m.repr(fn)+" is not a function");
457 for(var i=_ab.length-1;i>=0;i--){
458 _af=[_ab[i].apply(this,_af)];
462 },bind:function(_b1,_b2){
463 if(typeof (_b1)=="string"){
467 var _b4=_b1.im_preargs;
470 if(typeof (_b1)=="function"&&typeof (_b1.apply)=="undefined"){
471 _b1=m._wrapDumbFunction(_b1);
473 if(typeof (_b3)!="function"){
476 if(typeof (_b2)!="undefined"){
479 if(typeof (_b4)=="undefined"){
484 m.extend(_b4,arguments,2);
487 var me=arguments.callee;
488 if(me.im_preargs.length>0){
489 _b8=m.concat(me.im_preargs,_b8);
495 return me.im_func.apply(_ba,_b8);
501 },bindMethods:function(_bb){
502 var _bc=MochiKit.Base.bind;
505 if(typeof (_be)=="function"){
509 },registerComparator:function(_bf,_c0,_c1,_c2){
510 MochiKit.Base.comparatorRegistry.register(_bf,_c0,_c1,_c2);
511 },_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
515 var _c5=(typeof (a)=="undefined"||a===null);
516 var _c6=(typeof (b)=="undefined"||b===null);
529 var _c8=m._primitives;
530 if(!(typeof (a) in _c8&&typeof (b) in _c8)){
532 return m.comparatorRegistry.match(a,b);
548 throw new TypeError(_c9(a)+" and "+_c9(b)+" can not be compared");
549 },compareDateLike:function(a,b){
550 return MochiKit.Base.compare(a.getTime(),b.getTime());
551 },compareArrayLike:function(a,b){
552 var _ce=MochiKit.Base.compare;
563 for(var i=0;i<_cf;i++){
564 var cmp=_ce(a[i],b[i]);
570 },registerRepr:function(_d3,_d4,_d5,_d6){
571 MochiKit.Base.reprRegistry.register(_d3,_d4,_d5,_d6);
573 if(typeof (o)=="undefined"){
581 if(typeof (o.__repr__)=="function"){
584 if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
588 return MochiKit.Base.reprRegistry.match(o);
591 if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
599 return "["+typeof (o)+"]";
601 if(typeof (o)=="function"){
602 o=_d8.replace(/^\s+/,"");
603 var idx=o.indexOf("{");
605 o=o.substr(0,idx)+"{...}";
609 },reprArrayLike:function(o){
611 return "["+m.map(m.repr,o).join(", ")+"]";
612 },reprString:function(o){
613 return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
614 },reprNumber:function(o){
616 },registerJSON:function(_de,_df,_e0,_e1){
617 MochiKit.Base.jsonRegistry.register(_de,_df,_e0,_e1);
618 },evalJSON:function(){
619 return eval("("+arguments[0]+")");
620 },serializeJSON:function(o){
622 if(_e3=="number"||_e3=="boolean"){
630 var _e5=m.reprString;
634 var me=arguments.callee;
636 if(typeof (o.__json__)=="function"){
642 if(typeof (o.json)=="function"){
648 if(_e3!="function"&&typeof (o.length)=="number"){
650 for(var i=0;i<o.length;i++){
652 if(typeof (val)!="string"){
657 return "["+res.join(", ")+"]";
660 _e7=m.jsonRegistry.match(o);
670 if(_e3=="undefined"){
671 throw new TypeError("undefined can not be serialized as JSON");
679 if(typeof (k)=="number"){
682 if(typeof (k)=="string"){
689 if(typeof (val)!="string"){
692 res.push(_ec+":"+val);
694 return "{"+res.join(", ")+"}";
695 },objEqual:function(a,b){
696 return (MochiKit.Base.compare(a,b)===0);
697 },arrayEqual:function(_ef,arr){
698 if(_ef.length!=arr.length){
701 return (MochiKit.Base.compare(_ef,arr)===0);
704 var _f2=MochiKit.Base.extend;
705 for(var i=0;i<arguments.length;i++){
706 _f2(_f1,arguments[i]);
709 },keyComparator:function(key){
712 if(arguments.length==1){
713 return function(a,b){
714 return _f6(a[key],b[key]);
717 var _f9=m.extend(null,arguments);
718 return function(a,b){
720 for(var i=0;(_fc===0)&&(i<_f9.length);i++){
722 _fc=_f6(a[key],b[key]);
726 },reverseKeyComparator:function(key){
727 var _100=MochiKit.Base.keyComparator.apply(this,arguments);
728 return function(a,b){
731 },partial:function(func){
733 return m.bind.apply(this,m.extend([func,undefined],arguments,1));
734 },listMinMax:function(_105,lst){
739 var _108=MochiKit.Base.compare;
740 for(var i=1;i<lst.length;i++){
742 if(_108(o,cur)==_105){
748 return MochiKit.Base.listMinMax(1,arguments);
750 return MochiKit.Base.listMinMax(-1,arguments);
751 },findIdentical:function(lst,_10c,_10d,end){
752 if(typeof (end)=="undefined"||end===null){
755 if(typeof (_10d)=="undefined"||_10d===null){
758 for(var i=_10d;i<end;i++){
767 var args=m.extend(null,arguments);
768 var _113=args.length;
771 if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
773 for(var i=o.length-1;i>=0;i--){
781 throw new TypeError("mean() requires at least one argument");
785 var data=MochiKit.Base.flattenArguments(arguments);
787 throw new TypeError("median() requires at least one argument");
790 if(data.length%2==0){
791 var _117=data.length/2;
792 return (data[_117]+data[_117-1])/2;
794 return data[(data.length-1)/2];
796 },findValue:function(lst,_119,_11a,end){
797 if(typeof (end)=="undefined"||end===null){
800 if(typeof (_11a)=="undefined"||_11a===null){
803 var cmp=MochiKit.Base.compare;
804 for(var i=_11a;i<end;i++){
805 if(cmp(lst[i],_119)===0){
810 },nodeWalk:function(node,_11f){
812 var _121=MochiKit.Base.extend;
814 var res=_11f(_120.shift());
819 },nameFunctions:function(_123){
821 if(typeof (base)=="undefined"){
826 for(var name in _123){
828 if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
836 },queryString:function(_127,_128){
837 if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_127)=="string"||(typeof (_127.nodeType)!="undefined"&&_127.nodeType>0))){
838 var kv=MochiKit.DOM.formContents(_127);
842 if(arguments.length==1){
848 if(typeof (v)=="function"){
851 if(typeof (v)!="string"&&typeof (v.length)=="number"){
852 for(var i=0;i<v.length;i++){
865 var len=Math.min(_127.length,_128.length);
866 var _130=MochiKit.Base.urlEncode;
867 for(var i=0;i<len;i++){
869 if(typeof (v)!="undefined"&&v!==null){
870 rval.push(_130(_127[i])+"="+_130(v));
873 return rval.join("&");
874 },parseQueryString:function(_131,_132){
875 var qstr=(_131[0]=="?")?_131.substring(1):_131;
876 var _134=qstr.replace(/\+/g,"%20").split(/(\&\;|\&\#38\;|\&|\&)/);
879 if(typeof (decodeURIComponent)!="undefined"){
880 _136=decodeURIComponent;
885 for(var i=0;i<_134.length;i++){
886 var pair=_134[i].split("=");
890 var name=_136(pair[0]);
892 if(!(arr instanceof Array)){
896 arr.push(_136(pair[1]));
899 for(i=0;i<_134.length;i++){
900 pair=_134[i].split("=");
904 o[_136(pair[0])]=_136(pair[1]);
909 MochiKit.Base.AdapterRegistry=function(){
912 MochiKit.Base.AdapterRegistry.prototype={register:function(name,_13c,wrap,_13e){
914 this.pairs.unshift([name,_13c,wrap]);
916 this.pairs.push([name,_13c,wrap]);
919 for(var i=0;i<this.pairs.length;i++){
920 var pair=this.pairs[i];
921 if(pair[1].apply(this,arguments)){
922 return pair[2].apply(this,arguments);
925 throw MochiKit.Base.NotFound;
926 },unregister:function(name){
927 for(var i=0;i<this.pairs.length;i++){
928 var pair=this.pairs[i];
930 this.pairs.splice(i,1);
936 MochiKit.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","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"];
937 MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
938 MochiKit.Base._exportSymbols=function(_144,_145){
939 if(!MochiKit.__export__){
942 var all=_145.EXPORT_TAGS[":all"];
943 for(var i=0;i<all.length;i++){
944 _144[all[i]]=_145[all[i]];
947 MochiKit.Base.__new__=function(){
949 m.noop=m.operator.identity;
950 m.forward=m.forwardCall;
952 if(typeof (encodeURIComponent)!="undefined"){
953 m.urlEncode=function(_149){
954 return encodeURIComponent(_149).replace(/\'/g,"%27");
957 m.urlEncode=function(_14a){
958 return escape(_14a).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
961 m.NamedError=function(name){
965 m.NamedError.prototype=new Error();
966 m.update(m.NamedError.prototype,{repr:function(){
967 if(this.message&&this.message!=this.name){
968 return this.name+"("+m.repr(this.message)+")";
970 return this.name+"()";
972 },toString:m.forwardCall("repr")});
973 m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
974 m.listMax=m.partial(m.listMinMax,1);
975 m.listMin=m.partial(m.listMinMax,-1);
976 m.isCallable=m.typeMatcher("function");
977 m.isUndefined=m.typeMatcher("undefined");
978 m.merge=m.partial(m.update,null);
979 m.zip=m.partial(m.map,null);
981 m.comparatorRegistry=new m.AdapterRegistry();
982 m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
983 m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
984 m.reprRegistry=new m.AdapterRegistry();
985 m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
986 m.registerRepr("string",m.typeMatcher("string"),m.reprString);
987 m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
988 m.jsonRegistry=new m.AdapterRegistry();
989 var all=m.concat(m.EXPORT,m.EXPORT_OK);
990 m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
991 m.nameFunctions(this);
993 MochiKit.Base.__new__();
994 if(MochiKit.__export__){
995 compare=MochiKit.Base.compare;
996 compose=MochiKit.Base.compose;
997 serializeJSON=MochiKit.Base.serializeJSON;
999 MochiKit.Base._exportSymbols(this,MochiKit.Base);
1000 if(typeof (dojo)!="undefined"){
1001 dojo.provide("MochiKit.Iter");
1002 dojo.require("MochiKit.Base");
1004 if(typeof (JSAN)!="undefined"){
1005 JSAN.use("MochiKit.Base",[]);
1008 if(typeof (MochiKit.Base)=="undefined"){
1013 throw "MochiKit.Iter depends on MochiKit.Base!";
1015 if(typeof (MochiKit.Iter)=="undefined"){
1018 MochiKit.Iter.NAME="MochiKit.Iter";
1019 MochiKit.Iter.VERSION="1.4";
1020 MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
1021 return "["+this.NAME+" "+this.VERSION+"]";
1022 },toString:function(){
1023 return this.__repr__();
1024 },registerIteratorFactory:function(name,_14e,_14f,_150){
1025 MochiKit.Iter.iteratorRegistry.register(name,_14e,_14f,_150);
1026 },iter:function(_151,_152){
1027 var self=MochiKit.Iter;
1028 if(arguments.length==2){
1029 return self.takewhile(function(a){
1033 if(typeof (_151.next)=="function"){
1036 if(typeof (_151.iter)=="function"){
1041 return self.iteratorRegistry.match(_151);
1044 var m=MochiKit.Base;
1046 e=new TypeError(typeof (_151)+": "+m.repr(_151)+" is not iterable");
1050 },count:function(n){
1054 var m=MochiKit.Base;
1055 return {repr:function(){
1056 return "count("+n+")";
1057 },toString:m.forwardCall("repr"),next:m.counter(n)};
1058 },cycle:function(p){
1059 var self=MochiKit.Iter;
1060 var m=MochiKit.Base;
1062 var _15c=self.iter(p);
1063 return {repr:function(){
1064 return "cycle(...)";
1065 },toString:m.forwardCall("repr"),next:function(){
1067 var rval=_15c.next();
1072 if(e!=self.StopIteration){
1076 this.next=function(){
1077 throw self.StopIteration;
1081 this.next=function(){
1089 },repeat:function(elem,n){
1090 var m=MochiKit.Base;
1091 if(typeof (n)=="undefined"){
1092 return {repr:function(){
1093 return "repeat("+m.repr(elem)+")";
1094 },toString:m.forwardCall("repr"),next:function(){
1098 return {repr:function(){
1099 return "repeat("+m.repr(elem)+", "+n+")";
1100 },toString:m.forwardCall("repr"),next:function(){
1102 throw MochiKit.Iter.StopIteration;
1107 },next:function(_162){
1109 },izip:function(p,q){
1110 var m=MochiKit.Base;
1111 var self=MochiKit.Iter;
1113 var _168=m.map(self.iter,arguments);
1114 return {repr:function(){
1116 },toString:m.forwardCall("repr"),next:function(){
1117 return m.map(next,_168);
1119 },ifilter:function(pred,seq){
1120 var m=MochiKit.Base;
1121 seq=MochiKit.Iter.iter(seq);
1123 pred=m.operator.truth;
1125 return {repr:function(){
1126 return "ifilter(...)";
1127 },toString:m.forwardCall("repr"),next:function(){
1129 var rval=seq.next();
1136 },ifilterfalse:function(pred,seq){
1137 var m=MochiKit.Base;
1138 seq=MochiKit.Iter.iter(seq);
1140 pred=m.operator.truth;
1142 return {repr:function(){
1143 return "ifilterfalse(...)";
1144 },toString:m.forwardCall("repr"),next:function(){
1146 var rval=seq.next();
1153 },islice:function(seq){
1154 var self=MochiKit.Iter;
1155 var m=MochiKit.Base;
1161 if(arguments.length==2){
1164 if(arguments.length==3){
1173 return {repr:function(){
1174 return "islice("+["...",_174,stop,step].join(", ")+")";
1175 },toString:m.forwardCall("repr"),next:function(){
1182 throw self.StopIteration;
1187 },imap:function(fun,p,q){
1188 var m=MochiKit.Base;
1189 var self=MochiKit.Iter;
1190 var _17e=m.map(self.iter,m.extend(null,arguments,1));
1193 return {repr:function(){
1195 },toString:m.forwardCall("repr"),next:function(){
1196 return fun.apply(this,map(next,_17e));
1198 },applymap:function(fun,seq,self){
1199 seq=MochiKit.Iter.iter(seq);
1200 var m=MochiKit.Base;
1201 return {repr:function(){
1202 return "applymap(...)";
1203 },toString:m.forwardCall("repr"),next:function(){
1204 return fun.apply(self,seq.next());
1206 },chain:function(p,q){
1207 var self=MochiKit.Iter;
1208 var m=MochiKit.Base;
1209 if(arguments.length==1){
1210 return self.iter(arguments[0]);
1212 var _189=m.map(self.iter,arguments);
1213 return {repr:function(){
1214 return "chain(...)";
1215 },toString:m.forwardCall("repr"),next:function(){
1216 while(_189.length>1){
1218 return _189[0].next();
1221 if(e!=self.StopIteration){
1228 var arg=_189.shift();
1229 this.next=m.bind("next",arg);
1232 throw self.StopIteration;
1234 },takewhile:function(pred,seq){
1235 var self=MochiKit.Iter;
1237 return {repr:function(){
1238 return "takewhile(...)";
1239 },toString:MochiKit.Base.forwardCall("repr"),next:function(){
1240 var rval=seq.next();
1242 this.next=function(){
1243 throw self.StopIteration;
1249 },dropwhile:function(pred,seq){
1250 seq=MochiKit.Iter.iter(seq);
1251 var m=MochiKit.Base;
1253 return {"repr":function(){
1254 return "dropwhile(...)";
1255 },"toString":m.forwardCall("repr"),"next":function(){
1257 var rval=seq.next();
1262 this.next=bind("next",seq);
1265 },_tee:function(_194,sync,_196){
1267 var m=MochiKit.Base;
1269 return {repr:function(){
1270 return "tee("+_194+", ...)";
1271 },toString:m.forwardCall("repr"),next:function(){
1273 var i=sync.pos[_194];
1276 sync.deque.push(rval);
1280 rval=sync.deque[i-sync.min];
1282 if(i==sync.min&&_198(sync.pos)!=sync.min){
1289 },tee:function(_19b,n){
1291 var sync={"pos":[],"deque":[],"max":-1,"min":-1};
1292 if(arguments.length==1||typeof (n)=="undefined"||n===null){
1295 var self=MochiKit.Iter;
1296 _19b=self.iter(_19b);
1298 for(var i=0;i<n;i++){
1299 rval.push(_tee(i,sync,_19b));
1302 },list:function(_1a2){
1303 var m=MochiKit.Base;
1304 if(typeof (_1a2.slice)=="function"){
1305 return _1a2.slice();
1307 if(m.isArrayLike(_1a2)){
1308 return m.concat(_1a2);
1311 var self=MochiKit.Iter;
1312 _1a2=self.iter(_1a2);
1316 rval.push(_1a2.next());
1320 if(e!=self.StopIteration){
1326 },reduce:function(fn,_1a7,_1a8){
1329 var self=MochiKit.Iter;
1330 _1a7=self.iter(_1a7);
1331 if(arguments.length<3){
1336 if(e==self.StopIteration){
1337 e=new TypeError("reduce() of empty sequence with no initial value");
1345 x=fn(x,_1a7.next());
1349 if(e!=self.StopIteration){
1358 if(arguments.length==1){
1361 if(arguments.length==2){
1365 if(arguments.length==3){
1370 throw new TypeError("range() takes 1, 2, or 3 arguments!");
1375 throw new TypeError("range() step must not be 0");
1377 return {next:function(){
1378 if((step>0&&_1ac>=stop)||(step<0&&_1ac<=stop)){
1379 throw MochiKit.Iter.StopIteration;
1385 return "range("+[_1ac,stop,step].join(", ")+")";
1386 },toString:MochiKit.Base.forwardCall("repr")};
1387 },sum:function(_1b0,_1b1){
1388 if(typeof (_1b1)=="undefined"||_1b1===null){
1392 var self=MochiKit.Iter;
1393 _1b0=self.iter(_1b0);
1400 if(e!=self.StopIteration){
1405 },exhaust:function(_1b4){
1406 var self=MochiKit.Iter;
1407 _1b4=self.iter(_1b4);
1414 if(e!=self.StopIteration){
1418 },forEach:function(_1b6,func,self){
1419 var m=MochiKit.Base;
1420 if(arguments.length>2){
1421 func=m.bind(func,self);
1423 if(m.isArrayLike(_1b6)){
1425 for(var i=0;i<_1b6.length;i++){
1430 if(e!=MochiKit.Iter.StopIteration){
1436 self.exhaust(self.imap(func,_1b6));
1438 },every:function(_1bb,func){
1439 var self=MochiKit.Iter;
1441 self.ifilterfalse(func,_1bb).next();
1445 if(e!=self.StopIteration){
1450 },sorted:function(_1be,cmp){
1451 var rval=MochiKit.Iter.list(_1be);
1452 if(arguments.length==1){
1453 cmp=MochiKit.Base.compare;
1457 },reversed:function(_1c1){
1458 var rval=MochiKit.Iter.list(_1c1);
1461 },some:function(_1c3,func){
1462 var self=MochiKit.Iter;
1464 self.ifilter(func,_1c3).next();
1468 if(e!=self.StopIteration){
1473 },iextend:function(lst,_1c7){
1474 if(MochiKit.Base.isArrayLike(_1c7)){
1475 for(var i=0;i<_1c7.length;i++){
1479 var self=MochiKit.Iter;
1480 _1c7=self.iter(_1c7);
1483 lst.push(_1c7.next());
1487 if(e!=self.StopIteration){
1493 },groupby:function(_1ca,_1cb){
1494 var m=MochiKit.Base;
1495 var self=MochiKit.Iter;
1496 if(arguments.length<2){
1497 _1cb=m.operator.identity;
1499 _1ca=self.iter(_1ca);
1514 return {repr:function(){
1515 return "groupby(...)";
1517 while(_1d3(k,pk)===0){
1525 return [k,{next:function(){
1530 throw self.StopIteration;
1535 },groupby_as_array:function(_1d4,_1d5){
1536 var m=MochiKit.Base;
1537 var self=MochiKit.Iter;
1538 if(arguments.length<2){
1539 _1d5=m.operator.identity;
1541 _1d4=self.iter(_1d4);
1548 var _1dc=_1d4.next();
1552 if(e==self.StopIteration){
1557 if(_1d9||_1db(key,_1da)!==0){
1559 _1d8.push([key,_1de]);
1566 },arrayLikeIter:function(_1df){
1568 return {repr:function(){
1569 return "arrayLikeIter(...)";
1570 },toString:MochiKit.Base.forwardCall("repr"),next:function(){
1572 throw MochiKit.Iter.StopIteration;
1576 },hasIterateNext:function(_1e1){
1577 return (_1e1&&typeof (_1e1.iterateNext)=="function");
1578 },iterateNextIter:function(_1e2){
1579 return {repr:function(){
1580 return "iterateNextIter(...)";
1581 },toString:MochiKit.Base.forwardCall("repr"),next:function(){
1582 var rval=_1e2.iterateNext();
1583 if(rval===null||rval===undefined){
1584 throw MochiKit.Iter.StopIteration;
1589 MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter",];
1590 MochiKit.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"];
1591 MochiKit.Iter.__new__=function(){
1592 var m=MochiKit.Base;
1593 if(typeof (StopIteration)!="undefined"){
1594 this.StopIteration=StopIteration;
1596 this.StopIteration=new m.NamedError("StopIteration");
1598 this.iteratorRegistry=new m.AdapterRegistry();
1599 this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
1600 this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
1601 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
1602 m.nameFunctions(this);
1604 MochiKit.Iter.__new__();
1605 if(MochiKit.__export__){
1606 reduce=MochiKit.Iter.reduce;
1608 MochiKit.Base._exportSymbols(this,MochiKit.Iter);
1609 if(typeof (dojo)!="undefined"){
1610 dojo.provide("MochiKit.Logging");
1611 dojo.require("MochiKit.Base");
1613 if(typeof (JSAN)!="undefined"){
1614 JSAN.use("MochiKit.Base",[]);
1617 if(typeof (MochiKit.Base)=="undefined"){
1622 throw "MochiKit.Logging depends on MochiKit.Base!";
1624 if(typeof (MochiKit.Logging)=="undefined"){
1625 MochiKit.Logging={};
1627 MochiKit.Logging.NAME="MochiKit.Logging";
1628 MochiKit.Logging.VERSION="1.4";
1629 MochiKit.Logging.__repr__=function(){
1630 return "["+this.NAME+" "+this.VERSION+"]";
1632 MochiKit.Logging.toString=function(){
1633 return this.__repr__();
1635 MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"];
1636 MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"];
1637 MochiKit.Logging.LogMessage=function(num,_1e6,info){
1641 this.timestamp=new Date();
1643 MochiKit.Logging.LogMessage.prototype={repr:function(){
1644 var m=MochiKit.Base;
1645 return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")";
1646 },toString:MochiKit.Base.forwardCall("repr")};
1647 MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1e9){
1648 var self=MochiKit.Logging;
1649 if(typeof (_1e9)=="string"){
1650 _1e9=self.LogLevel[_1e9];
1652 return function(msg){
1654 if(typeof (_1ec)=="string"){
1655 _1ec=self.LogLevel[_1ec];
1659 },isLogMessage:function(){
1660 var _1ed=MochiKit.Logging.LogMessage;
1661 for(var i=0;i<arguments.length;i++){
1662 if(!(arguments[i] instanceof _1ed)){
1667 },compareLogMessage:function(a,b){
1668 return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
1669 },alertListener:function(msg){
1670 alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" "));
1672 MochiKit.Logging.Logger=function(_1f2){
1674 if(typeof (_1f2)=="undefined"||_1f2===null){
1680 this.useNativeConsole=false;
1682 MochiKit.Logging.Logger.prototype={clear:function(){
1683 this._messages.splice(0,this._messages.length);
1684 },logToConsole:function(msg){
1685 if(typeof (window)!="undefined"&&window.console&&window.console.log){
1686 window.console.log(msg.replace(/%/g,"\uff05"));
1688 if(typeof (opera)!="undefined"&&opera.postError){
1689 opera.postError(msg);
1691 if(typeof (printfire)=="function"){
1694 if(typeof (Debug)!="undefined"&&Debug.writeln){
1697 if(typeof (debug)!="undefined"&&debug.trace){
1704 },dispatchListeners:function(msg){
1705 for(var k in this.listeners){
1706 var pair=this.listeners[k];
1707 if(pair.ident!=k||(pair[0]&&!pair[0](msg))){
1712 },addListener:function(_1f7,_1f8,_1f9){
1713 if(typeof (_1f8)=="string"){
1714 _1f8=MochiKit.Logging.logLevelAtLeast(_1f8);
1716 var _1fa=[_1f8,_1f9];
1718 this.listeners[_1f7]=_1fa;
1719 },removeListener:function(_1fb){
1720 delete this.listeners[_1fb];
1721 },baseLog:function(_1fc,_1fd){
1722 var msg=new MochiKit.Logging.LogMessage(this.counter,_1fc,MochiKit.Base.extend(null,arguments,1));
1723 this._messages.push(msg);
1724 this.dispatchListeners(msg);
1725 if(this.useNativeConsole){
1726 this.logToConsole(msg.level+": "+msg.info.join(" "));
1729 while(this.maxSize>=0&&this._messages.length>this.maxSize){
1730 this._messages.shift();
1732 },getMessages:function(_1ff){
1734 if(!(typeof (_1ff)=="undefined"||_1ff===null)){
1735 _200=Math.max(0,this._messages.length-_1ff);
1737 return this._messages.slice(_200);
1738 },getMessageText:function(_201){
1739 if(typeof (_201)=="undefined"||_201===null){
1742 var _202=this.getMessages(_201);
1744 var lst=map(function(m){
1745 return "\n ["+m.num+"] "+m.level+": "+m.info.join(" ");
1747 lst.unshift("LAST "+_202.length+" MESSAGES:");
1748 return lst.join("");
1751 },debuggingBookmarklet:function(_205){
1752 if(typeof (MochiKit.LoggingPane)=="undefined"){
1753 alert(this.getMessageText());
1755 MochiKit.LoggingPane.createLoggingPane(_205||false);
1758 MochiKit.Logging.__new__=function(){
1759 this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
1760 var m=MochiKit.Base;
1761 m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
1763 var _208=this.Logger;
1764 var _209=_208.prototype.baseLog;
1765 m.update(this.Logger.prototype,{debug:_207(_209,"DEBUG"),log:_207(_209,"INFO"),error:_207(_209,"ERROR"),fatal:_207(_209,"FATAL"),warning:_207(_209,"WARNING")});
1767 var _20b=function(name){
1769 self.logger[name].apply(self.logger,arguments);
1772 this.log=_20b("log");
1773 this.logError=_20b("error");
1774 this.logDebug=_20b("debug");
1775 this.logFatal=_20b("fatal");
1776 this.logWarning=_20b("warning");
1777 this.logger=new _208();
1778 this.logger.useNativeConsole=true;
1779 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
1780 m.nameFunctions(this);
1782 if(typeof (printfire)=="undefined"&&typeof (document)!="undefined"&&document.createEvent&&typeof (dispatchEvent)!="undefined"){
1783 printfire=function(){
1784 printfire.args=arguments;
1785 var ev=document.createEvent("Events");
1786 ev.initEvent("printfire",false,true);
1790 MochiKit.Logging.__new__();
1791 MochiKit.Base._exportSymbols(this,MochiKit.Logging);
1792 if(typeof (dojo)!="undefined"){
1793 dojo.provide("MochiKit.DateTime");
1795 if(typeof (MochiKit)=="undefined"){
1798 if(typeof (MochiKit.DateTime)=="undefined"){
1799 MochiKit.DateTime={};
1801 MochiKit.DateTime.NAME="MochiKit.DateTime";
1802 MochiKit.DateTime.VERSION="1.4";
1803 MochiKit.DateTime.__repr__=function(){
1804 return "["+this.NAME+" "+this.VERSION+"]";
1806 MochiKit.DateTime.toString=function(){
1807 return this.__repr__();
1809 MochiKit.DateTime.isoDate=function(str){
1811 if(typeof (str)!="string"||str.length===0){
1814 var iso=str.split("-");
1818 return new Date(iso[0],iso[1]-1,iso[2]);
1820 MochiKit.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}))?)?)?)?)?/;
1821 MochiKit.DateTime.isoTimestamp=function(str){
1823 if(typeof (str)!="string"||str.length===0){
1826 var res=str.match(MochiKit.DateTime._isoRegexp);
1827 if(typeof (res)=="undefined"||res===null){
1830 var year,_213,day,hour,min,sec,msec;
1831 year=parseInt(res[1],10);
1832 if(typeof (res[2])=="undefined"||res[2]===""){
1833 return new Date(year);
1835 _213=parseInt(res[2],10)-1;
1836 day=parseInt(res[3],10);
1837 if(typeof (res[4])=="undefined"||res[4]===""){
1838 return new Date(year,_213,day);
1840 hour=parseInt(res[4],10);
1841 min=parseInt(res[5],10);
1842 sec=(typeof (res[6])!="undefined"&&res[6]!=="")?parseInt(res[6],10):0;
1843 if(typeof (res[7])!="undefined"&&res[7]!==""){
1844 msec=Math.round(1000*parseFloat("0."+res[7]));
1848 if((typeof (res[8])=="undefined"||res[8]==="")&&(typeof (res[9])=="undefined"||res[9]==="")){
1849 return new Date(year,_213,day,hour,min,sec,msec);
1852 if(typeof (res[9])!="undefined"&&res[9]!==""){
1853 ofs=parseInt(res[10],10)*3600000;
1854 if(typeof (res[11])!="undefined"&&res[11]!==""){
1855 ofs+=parseInt(res[11],10)*60000;
1863 return new Date(Date.UTC(year,_213,day,hour,min,sec,msec)-ofs);
1865 MochiKit.DateTime.toISOTime=function(date,_21b){
1866 if(typeof (date)=="undefined"||date===null){
1869 var hh=date.getHours();
1870 var mm=date.getMinutes();
1871 var ss=date.getSeconds();
1872 var lst=[((_21b&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
1873 return lst.join(":");
1875 MochiKit.DateTime.toISOTimestamp=function(date,_221){
1876 if(typeof (date)=="undefined"||date===null){
1879 var sep=_221?"T":" ";
1880 var foot=_221?"Z":"";
1882 date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
1884 return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_221)+foot;
1886 MochiKit.DateTime.toISODate=function(date){
1887 if(typeof (date)=="undefined"||date===null){
1890 var _225=MochiKit.DateTime._padTwo;
1891 return [date.getFullYear(),_225(date.getMonth()+1),_225(date.getDate())].join("-");
1893 MochiKit.DateTime.americanDate=function(d){
1895 if(typeof (d)!="string"||d.length===0){
1899 return new Date(a[2],a[0]-1,a[1]);
1901 MochiKit.DateTime._padTwo=function(n){
1902 return (n>9)?n:"0"+n;
1904 MochiKit.DateTime.toPaddedAmericanDate=function(d){
1905 if(typeof (d)=="undefined"||d===null){
1908 var _22a=MochiKit.DateTime._padTwo;
1909 return [_22a(d.getMonth()+1),_22a(d.getDate()),d.getFullYear()].join("/");
1911 MochiKit.DateTime.toAmericanDate=function(d){
1912 if(typeof (d)=="undefined"||d===null){
1915 return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
1917 MochiKit.DateTime.EXPORT=["isoDate","isoTimestamp","toISOTime","toISOTimestamp","toISODate","americanDate","toPaddedAmericanDate","toAmericanDate"];
1918 MochiKit.DateTime.EXPORT_OK=[];
1919 MochiKit.DateTime.EXPORT_TAGS={":common":MochiKit.DateTime.EXPORT,":all":MochiKit.DateTime.EXPORT};
1920 MochiKit.DateTime.__new__=function(){
1921 var base=this.NAME+".";
1924 if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
1933 MochiKit.DateTime.__new__();
1934 if(typeof (MochiKit.Base)!="undefined"){
1935 MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
1937 (function(_22f,_230){
1938 if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
1939 var all=_230.EXPORT_TAGS[":all"];
1940 for(var i=0;i<all.length;i++){
1941 _22f[all[i]]=_230[all[i]];
1944 })(this,MochiKit.DateTime);
1946 if(typeof (dojo)!="undefined"){
1947 dojo.provide("MochiKit.Format");
1949 if(typeof (MochiKit)=="undefined"){
1952 if(typeof (MochiKit.Format)=="undefined"){
1955 MochiKit.Format.NAME="MochiKit.Format";
1956 MochiKit.Format.VERSION="1.4";
1957 MochiKit.Format.__repr__=function(){
1958 return "["+this.NAME+" "+this.VERSION+"]";
1960 MochiKit.Format.toString=function(){
1961 return this.__repr__();
1963 MochiKit.Format._numberFormatter=function(_233,_234,_235,_236,_237,_238,_239,_23a,_23b){
1964 return function(num){
1965 num=parseFloat(num);
1966 if(typeof (num)=="undefined"||num===null||isNaN(num)){
1974 _23d=_23d.replace(/-/,"");
1976 var me=arguments.callee;
1977 var fmt=MochiKit.Format.formatLocale(_236);
1980 _23e=fmt.percent+_23e;
1982 num=MochiKit.Format.roundToFixed(num,_238);
1983 var _241=num.split(/\./);
1985 var frac=(_241.length==1)?"":_241[1];
1987 while(_242.length<_239){
1991 while(_242.length>_23a){
1992 var i=_242.length-_23a;
1993 res=fmt.separator+_242.substring(i,_242.length)+res;
1994 _242=_242.substring(0,i);
1999 while(frac.length<_23b){
2002 res=res+fmt.decimal+frac;
2004 return _23d+res+_23e;
2007 MochiKit.Format.numberFormatter=function(_246,_247,_248){
2008 if(typeof (_247)=="undefined"){
2011 var _249=_246.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
2013 throw TypeError("Invalid pattern");
2015 var _24a=_246.substr(0,_249.index);
2016 var _24b=_246.substr(_249.index+_249[0].length);
2017 if(_24a.search(/-/)==-1){
2021 var frac=(typeof (_249[2])=="string"&&_249[2]!="")?_249[2]:"";
2022 var _24e=(typeof (_249[3])=="string"&&_249[3]!="");
2023 var tmp=_24c.split(/,/);
2025 if(typeof (_248)=="undefined"){
2033 var _251=_24c.length-_24c.replace(/0/g,"").length;
2034 var _252=frac.length-frac.replace(/0/g,"").length;
2035 var _253=frac.length;
2036 var rval=MochiKit.Format._numberFormatter(_247,_24a,_24b,_248,_24e,_253,_251,_250,_252);
2037 var m=MochiKit.Base;
2039 var fn=arguments.callee;
2040 var args=m.concat(arguments);
2041 rval.repr=function(){
2042 return [self.NAME,"(",map(m.repr,args).join(", "),")"].join("");
2047 MochiKit.Format.formatLocale=function(_258){
2048 if(typeof (_258)=="undefined"||_258===null){
2051 if(typeof (_258)=="string"){
2052 var rval=MochiKit.Format.LOCALE[_258];
2053 if(typeof (rval)=="string"){
2054 rval=arguments.callee(rval);
2055 MochiKit.Format.LOCALE[_258]=rval;
2062 MochiKit.Format.twoDigitAverage=function(_25a,_25b){
2066 return MochiKit.Format.twoDigitFloat(_25a/_25b);
2071 MochiKit.Format.twoDigitFloat=function(_25d){
2072 var sign=(_25d<0?"-":"");
2073 var s=Math.floor(Math.abs(_25d)*100).toString();
2078 while(s.charAt(s.length-1)=="0"){
2079 s=s.substring(0,s.length-1);
2083 var head=sign+s.substring(0,s.length-2);
2084 var tail=s.substring(s.length-2,s.length);
2088 if(tail.charAt(1)=="0"){
2089 return head+"."+tail.charAt(0);
2091 return head+"."+tail;
2095 MochiKit.Format.lstrip=function(str,_263){
2097 if(typeof (str)!="string"){
2101 return str.replace(/^\s+/,"");
2103 return str.replace(new RegExp("^["+_263+"]+"),"");
2106 MochiKit.Format.rstrip=function(str,_265){
2108 if(typeof (str)!="string"){
2112 return str.replace(/\s+$/,"");
2114 return str.replace(new RegExp("["+_265+"]+$"),"");
2117 MochiKit.Format.strip=function(str,_267){
2118 var self=MochiKit.Format;
2119 return self.rstrip(self.lstrip(str,_267),_267);
2121 MochiKit.Format.truncToFixed=function(_269,_26a){
2122 _269=Math.floor(_269*Math.pow(10,_26a));
2123 var res=(_269*Math.pow(10,-_26a)).toFixed(_26a);
2124 if(res.charAt(0)=="."){
2129 MochiKit.Format.roundToFixed=function(_26c,_26d){
2130 return MochiKit.Format.truncToFixed(_26c+0.5*Math.pow(10,-_26d),_26d);
2132 MochiKit.Format.percentFormat=function(_26e){
2133 return MochiKit.Format.twoDigitFloat(100*_26e)+"%";
2135 MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
2136 MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
2137 MochiKit.Format.EXPORT_OK=[];
2138 MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
2139 MochiKit.Format.__new__=function(){
2140 var base=this.NAME+".";
2142 for(k in this.LOCALE){
2144 if(typeof (o)=="object"){
2148 o.NAME=base+"LOCALE."+k;
2153 if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
2162 MochiKit.Format.__new__();
2163 if(typeof (MochiKit.Base)!="undefined"){
2164 MochiKit.Base._exportSymbols(this,MochiKit.Format);
2166 (function(_273,_274){
2167 if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
2168 var all=_274.EXPORT_TAGS[":all"];
2169 for(var i=0;i<all.length;i++){
2170 _273[all[i]]=_274[all[i]];
2173 })(this,MochiKit.Format);
2175 if(typeof (dojo)!="undefined"){
2176 dojo.provide("MochiKit.Async");
2177 dojo.require("MochiKit.Base");
2179 if(typeof (JSAN)!="undefined"){
2180 JSAN.use("MochiKit.Base",[]);
2183 if(typeof (MochiKit.Base)=="undefined"){
2188 throw "MochiKit.Async depends on MochiKit.Base!";
2190 if(typeof (MochiKit.Async)=="undefined"){
2193 MochiKit.Async.NAME="MochiKit.Async";
2194 MochiKit.Async.VERSION="1.4";
2195 MochiKit.Async.__repr__=function(){
2196 return "["+this.NAME+" "+this.VERSION+"]";
2198 MochiKit.Async.toString=function(){
2199 return this.__repr__();
2201 MochiKit.Async.Deferred=function(_277){
2203 this.id=this._nextId();
2206 this.results=[null,null];
2207 this.canceller=_277;
2208 this.silentlyCancelled=false;
2211 MochiKit.Async.Deferred.prototype={repr:function(){
2222 return "Deferred("+this.id+", "+_278+")";
2223 },toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
2224 var self=MochiKit.Async;
2227 this.canceller(this);
2229 this.silentlyCancelled=true;
2232 this.errback(new self.CancelledError(this));
2235 if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){
2236 this.results[0].cancel();
2239 },_resback:function(res){
2240 this.fired=((res instanceof Error)?1:0);
2241 this.results[this.fired]=res;
2243 },_check:function(){
2245 if(!this.silentlyCancelled){
2246 throw new MochiKit.Async.AlreadyCalledError(this);
2248 this.silentlyCancelled=false;
2251 },callback:function(res){
2253 if(res instanceof MochiKit.Async.Deferred){
2254 throw new Error("Deferred instances can only be chained if they are the result of a callback");
2257 },errback:function(res){
2259 var self=MochiKit.Async;
2260 if(res instanceof self.Deferred){
2261 throw new Error("Deferred instances can only be chained if they are the result of a callback");
2263 if(!(res instanceof Error)){
2264 res=new self.GenericError(res);
2267 },addBoth:function(fn){
2268 if(arguments.length>1){
2269 fn=MochiKit.Base.partial.apply(null,arguments);
2271 return this.addCallbacks(fn,fn);
2272 },addCallback:function(fn){
2273 if(arguments.length>1){
2274 fn=MochiKit.Base.partial.apply(null,arguments);
2276 return this.addCallbacks(fn,null);
2277 },addErrback:function(fn){
2278 if(arguments.length>1){
2279 fn=MochiKit.Base.partial.apply(null,arguments);
2281 return this.addCallbacks(null,fn);
2282 },addCallbacks:function(cb,eb){
2284 throw new Error("Chained Deferreds can not be re-used");
2286 this.chain.push([cb,eb]);
2292 var _283=this.chain;
2293 var _284=this.fired;
2294 var res=this.results[_284];
2297 while(_283.length>0&&this.paused===0){
2298 var pair=_283.shift();
2305 _284=((res instanceof Error)?1:0);
2306 if(res instanceof MochiKit.Async.Deferred){
2310 if((self.paused===0)&&(self.fired>=0)){
2319 if(!(err instanceof Error)){
2320 err=new MochiKit.Async.GenericError(err);
2326 this.results[_284]=res;
2327 if(cb&&this.paused){
2332 MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){
2333 return eval("("+arguments[0].responseText+")");
2334 },succeed:function(_28b){
2335 var d=new MochiKit.Async.Deferred();
2336 d.callback.apply(d,arguments);
2338 },fail:function(_28d){
2339 var d=new MochiKit.Async.Deferred();
2340 d.errback.apply(d,arguments);
2342 },getXMLHttpRequest:function(){
2343 var self=arguments.callee;
2344 if(!self.XMLHttpRequest){
2345 var _290=[function(){
2346 return new XMLHttpRequest();
2348 return new ActiveXObject("Msxml2.XMLHTTP");
2350 return new ActiveXObject("Microsoft.XMLHTTP");
2352 return new ActiveXObject("Msxml2.XMLHTTP.4.0");
2354 throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
2356 for(var i=0;i<_290.length;i++){
2359 self.XMLHttpRequest=func;
2366 return self.XMLHttpRequest();
2367 },_xhr_onreadystatechange:function(d){
2368 var m=MochiKit.Base;
2369 if(this.readyState==4){
2371 this.onreadystatechange=null;
2375 this.onreadystatechange=m.noop;
2383 if(!_295&&m.isNotEmpty(this.responseText)){
2389 if(_295==200||_295==304){
2392 var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
2400 },_xhr_canceller:function(req){
2402 req.onreadystatechange=null;
2406 req.onreadystatechange=MochiKit.Base.noop;
2412 },sendXMLHttpRequest:function(req,_299){
2413 if(typeof (_299)=="undefined"||_299===null){
2416 var m=MochiKit.Base;
2417 var self=MochiKit.Async;
2418 var d=new self.Deferred(m.partial(self._xhr_canceller,req));
2420 req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
2425 req.onreadystatechange=null;
2432 },doXHR:function(url,opts){
2433 var m=MochiKit.Base;
2434 opts=m.update({method:"GET",sendContent:""},opts);
2435 var self=MochiKit.Async;
2436 var req=self.getXMLHttpRequest();
2437 if(opts.queryString){
2438 var qs=m.queryString(opts.queryString);
2443 req.open(opts.method,url,true,opts.username,opts.password);
2444 if(req.overrideMimeType&&opts.mimeType){
2445 req.overrideMimeType(opts.mimeType);
2448 var _2a3=opts.headers;
2449 if(!m.isArrayLike(_2a3)){
2452 for(var i=0;i<_2a3.length;i++){
2456 req.setRequestHeader(name,_2a7);
2459 return self.sendXMLHttpRequest(req,opts.sendContent);
2460 },_buildURL:function(url){
2461 if(arguments.length>1){
2462 var m=MochiKit.Base;
2463 var qs=m.queryString.apply(null,m.extend(null,arguments,1));
2469 },doSimpleXMLHttpRequest:function(url){
2470 var self=MochiKit.Async;
2471 url=self._buildURL.apply(self,arguments);
2472 return self.doXHR(url);
2473 },loadJSONDoc:function(url){
2474 var self=MochiKit.Async;
2475 url=self._buildURL.apply(self,arguments);
2476 var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]});
2477 d=d.addCallback(self.evalJSONRequest);
2479 },wait:function(_2b0,_2b1){
2480 var d=new MochiKit.Async.Deferred();
2481 var m=MochiKit.Base;
2482 if(typeof (_2b1)!="undefined"){
2483 d.addCallback(function(){
2487 var _2b4=setTimeout(m.bind("callback",d),Math.floor(_2b0*1000));
2488 d.canceller=function(){
2496 },callLater:function(_2b5,func){
2497 var m=MochiKit.Base;
2498 var _2b8=m.partial.apply(m,m.extend(null,arguments,1));
2499 return MochiKit.Async.wait(_2b5).addCallback(function(res){
2503 MochiKit.Async.DeferredLock=function(){
2506 this.id=this._nextId();
2508 MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
2509 var d=new MochiKit.Async.Deferred();
2511 this.waiting.push(d);
2517 },release:function(){
2519 throw TypeError("Tried to release an unlocked DeferredLock");
2522 if(this.waiting.length>0){
2524 this.waiting.shift().callback(this);
2526 },_nextId:MochiKit.Base.counter(),repr:function(){
2529 _2bb="locked, "+this.waiting.length+" waiting";
2533 return "DeferredLock("+this.id+", "+_2bb+")";
2534 },toString:MochiKit.Base.forwardCall("repr")};
2535 MochiKit.Async.DeferredList=function(list,_2bd,_2be,_2bf,_2c0){
2536 MochiKit.Async.Deferred.apply(this,[_2c0]);
2539 this.resultList=_2c1;
2540 this.finishedCount=0;
2541 this.fireOnOneCallback=_2bd;
2542 this.fireOnOneErrback=_2be;
2543 this.consumeErrors=_2bf;
2544 var cb=MochiKit.Base.bind(this._cbDeferred,this);
2545 for(var i=0;i<list.length;i++){
2547 _2c1.push(undefined);
2548 d.addCallback(cb,i,true);
2549 d.addErrback(cb,i,false);
2551 if(list.length===0&&!_2bd){
2552 this.callback(this.resultList);
2555 MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
2556 MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2c5,_2c6,_2c7){
2557 this.resultList[_2c5]=[_2c6,_2c7];
2558 this.finishedCount+=1;
2560 if(_2c6&&this.fireOnOneCallback){
2561 this.callback([_2c5,_2c7]);
2563 if(!_2c6&&this.fireOnOneErrback){
2566 if(this.finishedCount==this.list.length){
2567 this.callback(this.resultList);
2572 if(!_2c6&&this.consumeErrors){
2577 MochiKit.Async.gatherResults=function(_2c8){
2578 var d=new MochiKit.Async.DeferredList(_2c8,false,true,false);
2579 d.addCallback(function(_2ca){
2581 for(var i=0;i<_2ca.length;i++){
2582 ret.push(_2ca[i][1]);
2588 MochiKit.Async.maybeDeferred=function(func){
2589 var self=MochiKit.Async;
2592 var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
2593 if(r instanceof self.Deferred){
2596 if(r instanceof Error){
2599 _2cf=self.succeed(r);
2608 MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"];
2609 MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
2610 MochiKit.Async.__new__=function(){
2611 var m=MochiKit.Base;
2612 var ne=m.partial(m._newNamedError,this);
2613 ne("AlreadyCalledError",function(_2d3){
2616 ne("CancelledError",function(_2d4){
2619 ne("BrowserComplianceError",function(msg){
2622 ne("GenericError",function(msg){
2625 ne("XMLHttpRequestError",function(req,msg){
2629 this.number=req.status;
2634 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
2635 m.nameFunctions(this);
2637 MochiKit.Async.__new__();
2638 MochiKit.Base._exportSymbols(this,MochiKit.Async);
2639 if(typeof (dojo)!="undefined"){
2640 dojo.provide("MochiKit.DOM");
2641 dojo.require("MochiKit.Base");
2643 if(typeof (JSAN)!="undefined"){
2644 JSAN.use("MochiKit.Base",[]);
2647 if(typeof (MochiKit.Base)=="undefined"){
2652 throw "MochiKit.DOM depends on MochiKit.Base!";
2654 if(typeof (MochiKit.DOM)=="undefined"){
2657 MochiKit.DOM.NAME="MochiKit.DOM";
2658 MochiKit.DOM.VERSION="1.4";
2659 MochiKit.DOM.__repr__=function(){
2660 return "["+this.NAME+" "+this.VERSION+"]";
2662 MochiKit.DOM.toString=function(){
2663 return this.__repr__();
2665 MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","scrapeText"];
2666 MochiKit.DOM.EXPORT_OK=["domConverters"];
2667 MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.computedStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["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"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
2668 MochiKit.DOM.getViewportDimensions=new Function(""+"if (!MochiKit[\"Style\"]) {"+" throw new Error(\"This function has been deprecated and depends on MochiKit.Style.\");"+"}"+"return MochiKit.Style.getViewportDimensions.apply(this, arguments);");
2669 MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
2670 return MochiKit.DOM._window;
2671 },currentDocument:function(){
2672 return MochiKit.DOM._document;
2673 },withWindow:function(win,func){
2674 var self=MochiKit.DOM;
2675 var _2dc=self._document;
2680 self._document=win.document;
2685 self._document=_2dc;
2689 self._document=_2dc;
2691 },formContents:function(elem){
2694 var m=MochiKit.Base;
2695 var self=MochiKit.DOM;
2696 if(typeof (elem)=="undefined"||elem===null){
2697 elem=self._document;
2699 elem=self.getElement(elem);
2701 m.nodeWalk(elem,function(elem){
2703 if(m.isNotEmpty(name)){
2704 var _2e6=elem.tagName.toUpperCase();
2705 if(_2e6==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
2708 if(_2e6==="SELECT"){
2709 if(elem.type=="select-one"){
2710 if(elem.selectedIndex>=0){
2711 var opt=elem.options[elem.selectedIndex];
2713 _2e1.push(opt.value);
2720 var opts=elem.options;
2726 for(var i=0;i<opts.length;i++){
2732 _2e1.push(opt.value);
2737 if(_2e6==="FORM"||_2e6==="P"||_2e6==="SPAN"||_2e6==="DIV"){
2738 return elem.childNodes;
2741 _2e1.push(elem.value||"");
2744 return elem.childNodes;
2747 },withDocument:function(doc,func){
2748 var self=MochiKit.DOM;
2749 var _2ed=self._document;
2756 self._document=_2ed;
2759 self._document=_2ed;
2761 },registerDOMConverter:function(name,_2f0,wrap,_2f2){
2762 MochiKit.DOM.domConverters.register(name,_2f0,wrap,_2f2);
2763 },coerceToDOM:function(node,ctx){
2764 var m=MochiKit.Base;
2765 var im=MochiKit.Iter;
2766 var self=MochiKit.DOM;
2772 var _2fb=self.domConverters;
2773 var _2fc=arguments.callee;
2774 var _2fd=m.NotFound;
2776 if(typeof (node)=="undefined"||node===null){
2779 if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
2782 if(typeof (node)=="number"||typeof (node)=="boolean"){
2783 node=node.toString();
2785 if(typeof (node)=="string"){
2786 return self._document.createTextNode(node);
2788 if(typeof (node.__dom__)=="function"){
2789 node=node.__dom__(ctx);
2792 if(typeof (node.dom)=="function"){
2796 if(typeof (node)=="function"){
2797 node=node.apply(ctx,[ctx]);
2808 return map(_2fc,_2fe,_2f9(ctx));
2812 node=_2fb.match(node,ctx);
2820 return self._document.createTextNode(node.toString());
2823 },isChildNode:function(node,_300){
2824 var self=MochiKit.DOM;
2825 if(typeof (node)=="string"){
2826 node=self.getElement(node);
2828 if(typeof (_300)=="string"){
2829 _300=self.getElement(_300);
2834 while(node&&node.tagName.toUpperCase()!="BODY"){
2835 node=node.parentNode;
2841 },setNodeAttribute:function(node,attr,_304){
2845 return MochiKit.DOM.updateNodeAttributes(node,o);
2850 },getNodeAttribute:function(node,attr){
2851 var self=MochiKit.DOM;
2852 var _309=self.attributeArray.renames[attr];
2853 node=self.getElement(node);
2858 return node.getAttribute(attr);
2863 },updateNodeAttributes:function(node,_30b){
2865 var self=MochiKit.DOM;
2866 if(typeof (node)=="string"){
2867 elem=self.getElement(node);
2870 var _30e=MochiKit.Base.updatetree;
2871 if(self.attributeArray.compliant){
2874 if(typeof (v)=="object"&&typeof (elem[k])=="object"){
2877 if(k.substring(0,2)=="on"){
2878 if(typeof (v)=="string"){
2883 elem.setAttribute(k,v);
2888 var _311=self.attributeArray.renames;
2892 if(k=="style"&&typeof (v)=="string"){
2893 elem.style.cssText=v;
2895 if(typeof (_312)=="string"){
2898 if(typeof (elem[k])=="object"&&typeof (v)=="object"){
2901 if(k.substring(0,2)=="on"){
2902 if(typeof (v)=="string"){
2907 elem.setAttribute(k,v);
2916 },appendChildNodes:function(node){
2918 var self=MochiKit.DOM;
2919 if(typeof (node)=="string"){
2920 elem=self.getElement(node);
2922 var _316=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
2923 var _317=MochiKit.Base.concat;
2926 if(typeof (n)=="undefined"||n===null){
2928 if(typeof (n.nodeType)=="number"){
2929 elem.appendChild(n);
2936 },replaceChildNodes:function(node){
2938 var self=MochiKit.DOM;
2939 if(typeof (node)=="string"){
2940 elem=self.getElement(node);
2944 while((_31c=elem.firstChild)){
2945 elem.removeChild(_31c);
2947 if(arguments.length<2){
2950 return self.appendChildNodes.apply(this,arguments);
2952 },createDOM:function(name,_31e){
2954 var self=MochiKit.DOM;
2955 var m=MochiKit.Base;
2956 if(typeof (_31e)=="string"||typeof (_31e)=="number"){
2957 var args=m.extend([name,null],arguments,1);
2958 return arguments.callee.apply(this,args);
2960 if(typeof (name)=="string"){
2961 var _323=self._xhtml;
2962 if(_31e&&!self.attributeArray.compliant){
2965 _324+=" name=\""+self.escapeHTML(_31e.name)+"\"";
2967 if(name=="input"&&"type" in _31e){
2968 _324+=" type=\""+self.escapeHTML(_31e.type)+"\"";
2971 name="<"+name+_324+">";
2975 var d=self._document;
2976 if(_323&&d===document){
2977 elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
2979 elem=d.createElement(name);
2985 self.updateNodeAttributes(elem,_31e);
2987 if(arguments.length<=2){
2990 var args=m.extend([elem],arguments,2);
2991 return self.appendChildNodes.apply(this,args);
2993 },createDOMFunc:function(){
2994 var m=MochiKit.Base;
2995 return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
2996 },removeElement:function(elem){
2997 var e=MochiKit.DOM.getElement(elem);
2998 e.parentNode.removeChild(e);
3000 },swapDOM:function(dest,src){
3001 var self=MochiKit.DOM;
3002 dest=self.getElement(dest);
3003 var _32c=dest.parentNode;
3005 src=self.getElement(src);
3006 _32c.replaceChild(src,dest);
3008 _32c.removeChild(dest);
3011 },getElement:function(id){
3012 var self=MochiKit.DOM;
3013 if(arguments.length==1){
3014 return ((typeof (id)=="string")?self._document.getElementById(id):id);
3016 return MochiKit.Base.map(self.getElement,arguments);
3018 },getElementsByTagAndClassName:function(_32f,_330,_331){
3019 var self=MochiKit.DOM;
3020 if(typeof (_32f)=="undefined"||_32f===null){
3023 if(typeof (_331)=="undefined"||_331===null){
3024 _331=self._document;
3026 _331=self.getElement(_331);
3027 var _333=(_331.getElementsByTagName(_32f)||self._document.all);
3028 if(typeof (_330)=="undefined"||_330===null){
3029 return MochiKit.Base.extend(null,_333);
3032 for(var i=0;i<_333.length;i++){
3034 var cls=_336.className;
3038 var _338=cls.split(" ");
3039 for(var j=0;j<_338.length;j++){
3047 },_newCallStack:function(path,once){
3048 var rval=function(){
3049 var _33d=arguments.callee.callStack;
3050 for(var i=0;i<_33d.length;i++){
3051 if(_33d[i].apply(this,arguments)===false){
3065 },addToCallStack:function(_33f,path,func,once){
3066 var self=MochiKit.DOM;
3067 var _344=_33f[path];
3069 if(!(typeof (_344)=="function"&&typeof (_344.callStack)=="object"&&_344.callStack!==null)){
3070 _345=self._newCallStack(path,once);
3071 if(typeof (_344)=="function"){
3072 _345.callStack.push(_344);
3076 _345.callStack.push(func);
3077 },addLoadEvent:function(func){
3078 var self=MochiKit.DOM;
3079 self.addToCallStack(self._window,"onload",func,true);
3080 },focusOnLoad:function(_348){
3081 var self=MochiKit.DOM;
3082 self.addLoadEvent(function(){
3083 _348=self.getElement(_348);
3088 },setElementClass:function(_34a,_34b){
3089 var self=MochiKit.DOM;
3090 var obj=self.getElement(_34a);
3091 if(self.attributeArray.compliant){
3092 obj.setAttribute("class",_34b);
3094 obj.setAttribute("className",_34b);
3096 },toggleElementClass:function(_34e){
3097 var self=MochiKit.DOM;
3098 for(var i=1;i<arguments.length;i++){
3099 var obj=self.getElement(arguments[i]);
3100 if(!self.addElementClass(obj,_34e)){
3101 self.removeElementClass(obj,_34e);
3104 },addElementClass:function(_352,_353){
3105 var self=MochiKit.DOM;
3106 var obj=self.getElement(_352);
3107 var cls=obj.className;
3108 if(cls==undefined||cls.length===0){
3109 self.setElementClass(obj,_353);
3115 var _357=cls.split(" ");
3116 for(var i=0;i<_357.length;i++){
3121 self.setElementClass(obj,cls+" "+_353);
3123 },removeElementClass:function(_359,_35a){
3124 var self=MochiKit.DOM;
3125 var obj=self.getElement(_359);
3126 var cls=obj.className;
3127 if(cls==undefined||cls.length===0){
3131 self.setElementClass(obj,"");
3134 var _35e=cls.split(" ");
3135 for(var i=0;i<_35e.length;i++){
3138 self.setElementClass(obj,_35e.join(" "));
3143 },swapElementClass:function(_360,_361,_362){
3144 var obj=MochiKit.DOM.getElement(_360);
3145 var res=MochiKit.DOM.removeElementClass(obj,_361);
3147 MochiKit.DOM.addElementClass(obj,_362);
3150 },hasElementClass:function(_365,_366){
3151 var obj=MochiKit.DOM.getElement(_365);
3152 var cls=obj.className;
3156 var _369=cls.split(" ");
3157 for(var i=1;i<arguments.length;i++){
3159 for(var j=0;j<_369.length;j++){
3160 if(_369[j]==arguments[i]){
3170 },escapeHTML:function(s){
3171 return s.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");
3172 },toHTML:function(dom){
3173 return MochiKit.DOM.emitHTML(dom).join("");
3174 },emitHTML:function(dom,lst){
3175 if(typeof (lst)=="undefined"||lst===null){
3179 var self=MochiKit.DOM;
3180 var _373=self.escapeHTML;
3181 var _374=self.attributeArray;
3184 if(typeof (dom)=="string"){
3187 if(dom.nodeType==1){
3188 lst.push("<"+dom.tagName.toLowerCase());
3191 for(var i=0;i<_376.length;i++){
3193 _375.push([" ",a.name,"=\"",_373(a.value),"\""]);
3196 for(i=0;i<_375.length;i++){
3198 for(var j=0;j<_379.length;j++){
3202 if(dom.hasChildNodes()){
3204 _371.push("</"+dom.tagName.toLowerCase()+">");
3205 var _37b=dom.childNodes;
3206 for(i=_37b.length-1;i>=0;i--){
3213 if(dom.nodeType==3){
3214 lst.push(_373(dom.nodeValue));
3220 },scrapeText:function(node,_37d){
3223 var cn=node.childNodes;
3225 for(var i=0;i<cn.length;i++){
3226 arguments.callee.call(this,cn[i]);
3229 var _382=node.nodeValue;
3230 if(typeof (_382)=="string"){
3233 })(MochiKit.DOM.getElement(node));
3237 return rval.join("");
3239 },removeEmptyTextNodes:function(_383){
3240 _383=MochiKit.DOM.getElement(_383);
3241 for(var i=0;i<_383.childNodes.length;i++){
3242 var node=_383.childNodes[i];
3243 if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
3244 node.parentNode.removeChild(node);
3247 },__new__:function(win){
3248 var m=MochiKit.Base;
3249 if(typeof (document)!="undefined"){
3250 this._document=document;
3251 this._xhtml=document.createElementNS&&document.createElement("testname").localName=="testname";
3253 if(MochiKit.MockDOM){
3254 this._document=MochiKit.MockDOM.document;
3258 this.domConverters=new m.AdapterRegistry();
3259 var _388=this._document.createElement("span");
3261 if(_388&&_388.attributes&&_388.attributes.length>0){
3263 _389=function(node){
3264 return _38a(_389.ignoreAttrFilter,node.attributes);
3267 var _38c=_388.attributes;
3268 var _38d=_389.ignoreAttr;
3269 for(var i=0;i<_38c.length;i++){
3271 _38d[a.name]=a.value;
3273 _389.ignoreAttrFilter=function(a){
3274 return (_389.ignoreAttr[a.name]!=a.value);
3276 _389.compliant=false;
3277 _389.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor"};
3279 _389=function(node){
3280 return node.attributes;
3282 _389.compliant=true;
3285 this.attributeArray=_389;
3286 var _392=function(_393,arr){
3287 var _395=arr[1].split(".");
3290 str+="if (!MochiKit."+_395[1]+") { throw new Error(\"";
3291 str+="This function has been deprecated and depends on MochiKit.";
3292 str+=_395[1]+".\");}";
3293 str+="return MochiKit."+_395[1]+"."+arr[0];
3294 str+=".apply(this, arguments);";
3295 obj[_395[2]]=new Function(str);
3296 MochiKit.Base.update(MochiKit[_393],obj);
3298 for(var i;i<MochiKit.DOM.DEPRECATED.length;i++){
3299 _392("DOM",MochiKit.DOM.DEPRECATED[i]);
3301 var _398=this.createDOMFunc;
3307 this.TBODY=_398("tbody");
3308 this.THEAD=_398("thead");
3309 this.TFOOT=_398("tfoot");
3310 this.TABLE=_398("table");
3312 this.INPUT=_398("input");
3313 this.SPAN=_398("span");
3315 this.DIV=_398("div");
3316 this.IMG=_398("img");
3317 this.BUTTON=_398("button");
3319 this.PRE=_398("pre");
3325 this.LABEL=_398("label");
3326 this.TEXTAREA=_398("textarea");
3327 this.FORM=_398("form");
3329 this.SELECT=_398("select");
3330 this.OPTION=_398("option");
3331 this.OPTGROUP=_398("optgroup");
3332 this.LEGEND=_398("legend");
3333 this.FIELDSET=_398("fieldset");
3334 this.STRONG=_398("strong");
3335 this.CANVAS=_398("canvas");
3336 this.$=this.getElement;
3337 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
3338 m.nameFunctions(this);
3340 MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
3341 if(MochiKit.__export__){
3342 withWindow=MochiKit.DOM.withWindow;
3343 withDocument=MochiKit.DOM.withDocument;
3345 MochiKit.Base._exportSymbols(this,MochiKit.DOM);
3346 if(typeof (dojo)!="undefined"){
3347 dojo.provide("MochiKit.Style");
3348 dojo.require("MochiKit.Base");
3349 dojo.require("MochiKit.DOM");
3351 if(typeof (JSAN)!="undefined"){
3352 JSAN.use("MochiKit.Base",[]);
3355 if(typeof (MochiKit.Base)=="undefined"){
3360 throw "MochiKit.Style depends on MochiKit.Base!";
3363 if(typeof (MochiKit.DOM)=="undefined"){
3368 throw "MochiKit.Style depends on MochiKit.DOM!";
3370 if(typeof (MochiKit.Style)=="undefined"){
3373 MochiKit.Style.NAME="MochiKit.Style";
3374 MochiKit.Style.VERSION="1.4";
3375 MochiKit.Style.__repr__=function(){
3376 return "["+this.NAME+" "+this.VERSION+"]";
3378 MochiKit.Style.toString=function(){
3379 return this.__repr__();
3381 MochiKit.Style.EXPORT_OK=[];
3382 MochiKit.Style.EXPORT=["setOpacity","getOpacity","setStyle","getStyle","computedStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"];
3383 MochiKit.Style.Dimensions=function(w,h){
3387 MochiKit.Style.Dimensions.prototype.__repr__=function(){
3388 var repr=MochiKit.Base.repr;
3389 return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
3391 MochiKit.Style.Dimensions.prototype.toString=function(){
3392 return this.__repr__();
3394 MochiKit.Style.Coordinates=function(x,y){
3398 MochiKit.Style.Coordinates.prototype.__repr__=function(){
3399 var repr=MochiKit.Base.repr;
3400 return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
3402 MochiKit.Style.Coordinates.prototype.toString=function(){
3403 return this.__repr__();
3405 MochiKit.Base.update(MochiKit.Style,{computedStyle:function(elem,_3a0){
3406 var dom=MochiKit.DOM;
3407 var d=dom._document;
3408 elem=dom.getElement(elem);
3409 _3a0=MochiKit.Base.camelize(_3a0);
3413 if(_3a0=="opacity"&&elem.filters){
3415 return elem.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100;
3419 return elem.filters.item("alpha").opacity/100;
3425 if(elem.currentStyle){
3426 return elem.currentStyle[_3a0];
3428 if(typeof (d.defaultView)=="undefined"){
3431 if(d.defaultView===null){
3434 var _3a3=d.defaultView.getComputedStyle(elem,null);
3435 if(typeof (_3a3)=="undefined"||_3a3===null){
3438 var _3a4=_3a0.replace(/([A-Z])/g,"-$1").toLowerCase();
3439 return _3a3.getPropertyValue(_3a4);
3440 },getStyle:function(elem,_3a6){
3441 elem=MochiKit.DOM.getElement(elem);
3442 var _3a7=elem.style[MochiKit.Base.camelize(_3a6)];
3444 if(document.defaultView&&document.defaultView.getComputedStyle){
3445 var css=document.defaultView.getComputedStyle(elem,null);
3446 _3a7=css?css.getPropertyValue(_3a6):null;
3448 if(elem.currentStyle){
3449 _3a7=elem.currentStyle[MochiKit.Base.camelize(_3a6)];
3453 if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.find(["left","top","right","bottom"],_3a6)!=-1)){
3454 if(MochiKit.Style.getStyle(elem,"position")=="static"){
3458 return _3a7=="auto"?null:_3a7;
3459 },setStyle:function(elem,_3aa){
3460 elem=MochiKit.DOM.getElement(elem);
3462 elem.style[MochiKit.Base.camelize(name)]=_3aa[name];
3464 },getOpacity:function(elem){
3466 if(_3ac=MochiKit.Style.getStyle(elem,"opacity")){
3467 return parseFloat(_3ac);
3469 if(_3ac=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
3471 return parseFloat(_3ac[1])/100;
3475 },setOpacity:function(elem,o){
3476 elem=MochiKit.DOM.getElement(elem);
3477 var self=MochiKit.Style;
3479 var _3b0=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|Safari|KHTML/.test(navigator.userAgent));
3480 self.setStyle(elem,{opacity:_3b0?0.999999:1});
3481 if(/MSIE/.test(navigator.userAgent)){
3482 self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")});
3488 self.setStyle(elem,{opacity:o});
3489 if(/MSIE/.test(navigator.userAgent)){
3490 self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")"});
3493 },getElementPosition:function(elem,_3b2){
3494 var self=MochiKit.Style;
3495 var dom=MochiKit.DOM;
3496 elem=dom.getElement(elem);
3497 if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode==null||self.computedStyle(elem,"display")=="none"))){
3500 var c=new self.Coordinates(0,0);
3503 var d=MochiKit.DOM._document;
3504 var de=d.documentElement;
3506 if(!elem.parentNode&&elem.x&&elem.y){
3510 if(elem.getBoundingClientRect){
3511 box=elem.getBoundingClientRect();
3512 c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
3513 c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
3515 if(elem.offsetParent){
3516 c.x+=elem.offsetLeft;
3517 c.y+=elem.offsetTop;
3518 _3b7=elem.offsetParent;
3521 c.x+=_3b7.offsetLeft;
3522 c.y+=_3b7.offsetTop;
3523 _3b7=_3b7.offsetParent;
3526 var ua=navigator.userAgent.toLowerCase();
3527 if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){
3534 if(typeof (_3b2)!="undefined"){
3535 _3b2=arguments.callee(_3b2);
3541 if(elem.parentNode){
3542 _3b7=elem.parentNode;
3547 var _3bc=_3b7.tagName.toUpperCase();
3548 if(_3bc==="BODY"||_3bc==="HTML"){
3551 c.x-=_3b7.scrollLeft;
3552 c.y-=_3b7.scrollTop;
3553 if(_3b7.parentNode){
3554 _3b7=_3b7.parentNode;
3560 },setElementPosition:function(elem,_3be,_3bf){
3561 elem=MochiKit.DOM.getElement(elem);
3562 if(typeof (_3bf)=="undefined"){
3566 var _3c1=MochiKit.Base.isUndefinedOrNull;
3568 _3c0["left"]=_3be.x+_3bf;
3571 _3c0["top"]=_3be.y+_3bf;
3573 MochiKit.DOM.updateNodeAttributes(elem,{"style":_3c0});
3574 },getElementDimensions:function(elem){
3575 var self=MochiKit.Style;
3576 var dom=MochiKit.DOM;
3577 if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
3578 return new self.Dimensions(elem.w||0,elem.h||0);
3580 elem=dom.getElement(elem);
3584 var disp=self.computedStyle(elem,"display");
3585 if(disp!="none"&&disp!=""&&typeof (disp)!="undefined"){
3586 return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0);
3589 var _3c7=s.visibility;
3590 var _3c8=s.position;
3591 s.visibility="hidden";
3592 s.position="absolute";
3594 var _3c9=elem.offsetWidth;
3595 var _3ca=elem.offsetHeight;
3599 return new self.Dimensions(_3c9,_3ca);
3600 },setElementDimensions:function(elem,_3cc,_3cd){
3601 elem=MochiKit.DOM.getElement(elem);
3602 if(typeof (_3cd)=="undefined"){
3606 var _3cf=MochiKit.Base.isUndefinedOrNull;
3608 _3ce["width"]=_3cc.w+_3cd;
3611 _3ce["height"]=_3cc.h+_3cd;
3613 MochiKit.DOM.updateNodeAttributes(elem,{"style":_3ce});
3614 },setDisplayForElement:function(_3d0,_3d1){
3615 var _3d2=MochiKit.Base.extend(null,arguments,1);
3616 var _3d3=MochiKit.DOM.getElement;
3617 for(var i=0;i<_3d2.length;i++){
3618 var _3d1=_3d3(_3d2[i]);
3620 _3d1.style.display=_3d0;
3623 },getViewportDimensions:function(){
3624 var d=new MochiKit.Style.Dimensions();
3625 var w=MochiKit.DOM._window;
3626 var b=MochiKit.DOM._document.body;
3631 if(b.parentElement.clientWidth){
3632 d.w=b.parentElement.clientWidth;
3633 d.h=b.parentElement.clientHeight;
3635 if(b&&b.clientWidth){
3642 },getViewportPosition:function(){
3643 var c=new MochiKit.Style.Coordinates(0,0);
3644 var d=MochiKit.DOM._document;
3645 var de=d.documentElement;
3647 if(de&&(de.scrollTop||de.scrollLeft)){
3657 },__new__:function(){
3658 var m=MochiKit.Base;
3659 this.elementPosition=this.getElementPosition;
3660 this.elementDimensions=this.getElementDimensions;
3661 this.hideElement=m.partial(this.setDisplayForElement,"none");
3662 this.showElement=m.partial(this.setDisplayForElement,"block");
3663 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
3664 m.nameFunctions(this);
3666 MochiKit.Style.__new__();
3667 MochiKit.Base._exportSymbols(this,MochiKit.Style);
3668 if(typeof (dojo)!="undefined"){
3669 dojo.provide("MochiKit.LoggingPane");
3670 dojo.require("MochiKit.Logging");
3671 dojo.require("MochiKit.Base");
3673 if(typeof (JSAN)!="undefined"){
3674 JSAN.use("MochiKit.Logging",[]);
3675 JSAN.use("MochiKit.Base",[]);
3678 if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Logging)=="undefined"){
3683 throw "MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!";
3685 if(typeof (MochiKit.LoggingPane)=="undefined"){
3686 MochiKit.LoggingPane={};
3688 MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
3689 MochiKit.LoggingPane.VERSION="1.4";
3690 MochiKit.LoggingPane.__repr__=function(){
3691 return "["+this.NAME+" "+this.VERSION+"]";
3693 MochiKit.LoggingPane.toString=function(){
3694 return this.__repr__();
3696 MochiKit.LoggingPane.createLoggingPane=function(_3dd){
3697 var m=MochiKit.LoggingPane;
3699 if(m._loggingPane&&m._loggingPane.inline!=_3dd){
3700 m._loggingPane.closePane();
3701 m._loggingPane=null;
3703 if(!m._loggingPane||m._loggingPane.closed){
3704 m._loggingPane=new m.LoggingPane(_3dd,MochiKit.Logging.logger);
3706 return m._loggingPane;
3708 MochiKit.LoggingPane.LoggingPane=function(_3df,_3e0){
3709 if(typeof (_3e0)=="undefined"||_3e0===null){
3710 _3e0=MochiKit.Logging.logger;
3713 var _3e1=MochiKit.Base.update;
3714 var _3e2=MochiKit.Base.updatetree;
3715 var bind=MochiKit.Base.bind;
3716 var _3e4=MochiKit.Base.clone;
3718 var uid="_MochiKit_LoggingPane";
3719 if(typeof (MochiKit.DOM)!="undefined"){
3720 win=MochiKit.DOM.currentWindow();
3723 var url=win.location.href.split("?")[0].replace(/[#:\/.><&-]/g,"_");
3724 var name=uid+"_"+url;
3725 var nwin=win.open("",name,"dependent,resizable,height=200");
3727 alert("Not able to open debugging window due to pop-up blocking.");
3730 nwin.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>");
3731 nwin.document.close();
3732 nwin.document.title+=" "+win.document.title;
3735 var doc=win.document;
3737 var _3eb=doc.getElementById(uid);
3739 if(_3eb&&typeof (_3eb.loggingPane)!="undefined"){
3740 _3eb.loggingPane.logger=this.logger;
3741 _3eb.loggingPane.buildAndApplyFilter();
3742 return _3eb.loggingPane;
3746 while((_3ed=_3eb.firstChild)){
3747 _3eb.removeChild(_3ed);
3750 _3eb=doc.createElement("div");
3753 _3eb.loggingPane=this;
3754 var _3ee=doc.createElement("input");
3755 var _3ef=doc.createElement("input");
3756 var _3f0=doc.createElement("button");
3757 var _3f1=doc.createElement("button");
3758 var _3f2=doc.createElement("button");
3759 var _3f3=doc.createElement("button");
3760 var _3f4=doc.createElement("div");
3761 var _3f5=doc.createElement("div");
3762 var _3f6=uid+"_Listener";
3763 this.colorTable=_3e4(this.colorTable);
3766 var _3f9=function(msg){
3768 if(typeof (_3fb)=="number"){
3769 _3fb=MochiKit.Logging.LogLevel[_3fb];
3773 var _3fc=function(msg){
3774 return msg.info.join(" ");
3776 var _3fe=bind(function(msg){
3779 var c=this.colorTable[_400];
3780 var p=doc.createElement("span");
3781 p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_400;
3782 p.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;
3783 p.appendChild(doc.createTextNode(_400+": "+text));
3784 _3f5.appendChild(p);
3785 _3f5.appendChild(doc.createElement("br"));
3786 if(_3f4.offsetHeight>_3f4.scrollHeight){
3789 _3f4.scrollTop=_3f4.scrollHeight;
3792 var _404=function(msg){
3793 _3f7[_3f7.length]=msg;
3796 var _406=function(){
3799 _407=new RegExp(_3ee.value);
3800 _408=new RegExp(_3ef.value);
3803 logDebug("Error in filter regex: "+e.message);
3806 return function(msg){
3807 return (_407.test(_3f9(msg))&&_408.test(_3fc(msg)));
3810 var _40a=function(){
3811 while(_3f5.firstChild){
3812 _3f5.removeChild(_3f5.firstChild);
3815 var _40b=function(){
3819 var _40c=bind(function(){
3824 if(MochiKit.LoggingPane._loggingPane==this){
3825 MochiKit.LoggingPane._loggingPane=null;
3827 this.logger.removeListener(_3f6);
3828 _3eb.loggingPane=null;
3830 _3eb.parentNode.removeChild(_3eb);
3835 var _40d=function(){
3837 for(var i=0;i<_3f7.length;i++){
3839 if(_3f8===null||_3f8(msg)){
3844 this.buildAndApplyFilter=function(){
3847 this.logger.removeListener(_3f6);
3848 this.logger.addListener(_3f6,_3f8,_404);
3850 var _410=bind(function(){
3851 _3f7=this.logger.getMessages();
3854 var _411=bind(function(_412){
3855 _412=_412||window.event;
3856 key=_412.which||_412.keyCode;
3858 this.buildAndApplyFilter();
3861 var _413="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
3863 _413+="; height: 10em; border-top: 2px solid black";
3865 _413+="; height: 100%;";
3867 _3eb.style.cssText=_413;
3869 doc.body.appendChild(_3eb);
3871 _413={"cssText":"width: 33%; display: inline; font: "+this.logFont};
3872 _3e2(_3ee,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_411,"style":_413});
3873 _3eb.appendChild(_3ee);
3874 _3e2(_3ef,{"value":".*","onkeypress":_411,"style":_413});
3875 _3eb.appendChild(_3ef);
3876 _413="width: 8%; display:inline; font: "+this.logFont;
3877 _3f0.appendChild(doc.createTextNode("Filter"));
3878 _3f0.onclick=bind("buildAndApplyFilter",this);
3879 _3f0.style.cssText=_413;
3880 _3eb.appendChild(_3f0);
3881 _3f1.appendChild(doc.createTextNode("Load"));
3883 _3f1.style.cssText=_413;
3884 _3eb.appendChild(_3f1);
3885 _3f2.appendChild(doc.createTextNode("Clear"));
3887 _3f2.style.cssText=_413;
3888 _3eb.appendChild(_3f2);
3889 _3f3.appendChild(doc.createTextNode("Close"));
3891 _3f3.style.cssText=_413;
3892 _3eb.appendChild(_3f3);
3893 _3f4.style.cssText="overflow: auto; width: 100%";
3894 _3f5.style.cssText="width: 100%; height: "+(_3df?"8em":"100%");
3895 _3f4.appendChild(_3f5);
3896 _3eb.appendChild(_3f4);
3897 this.buildAndApplyFilter();
3905 this.closePane=_40c;
3909 MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
3910 MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
3911 MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
3912 MochiKit.LoggingPane.__new__=function(){
3913 this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
3914 MochiKit.Base.nameFunctions(this);
3915 MochiKit.LoggingPane._loggingPane=null;
3917 MochiKit.LoggingPane.__new__();
3918 MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
3919 if(typeof (dojo)!="undefined"){
3920 dojo.provide("MochiKit.Color");
3921 dojo.require("MochiKit.Base");
3922 dojo.require("MochiKit.DOM");
3923 dojo.require("MochiKit.Style");
3925 if(typeof (JSAN)!="undefined"){
3926 JSAN.use("MochiKit.Base",[]);
3927 JSAN.use("MochiKit.DOM",[]);
3928 JSAN.use("MochiKit.Style",[]);
3931 if(typeof (MochiKit.Base)=="undefined"){
3936 throw "MochiKit.Color depends on MochiKit.Base";
3939 if(typeof (MochiKit.Base)=="undefined"){
3944 throw "MochiKit.Color depends on MochiKit.DOM";
3947 if(typeof (MochiKit.Base)=="undefined"){
3952 throw "MochiKit.Color depends on MochiKit.Style";
3954 if(typeof (MochiKit.Color)=="undefined"){
3957 MochiKit.Color.NAME="MochiKit.Color";
3958 MochiKit.Color.VERSION="1.4";
3959 MochiKit.Color.__repr__=function(){
3960 return "["+this.NAME+" "+this.VERSION+"]";
3962 MochiKit.Color.toString=function(){
3963 return this.__repr__();
3965 MochiKit.Color.Color=function(red,_415,blue,_417){
3966 if(typeof (_417)=="undefined"||_417===null){
3969 this.rgb={r:red,g:_415,b:blue,a:_417};
3971 MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_418){
3973 var m=MochiKit.Color;
3974 return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_418);
3975 },colorWithHue:function(hue){
3976 var hsl=this.asHSL();
3978 var m=MochiKit.Color;
3979 return m.Color.fromHSL(hsl);
3980 },colorWithSaturation:function(_41e){
3981 var hsl=this.asHSL();
3983 var m=MochiKit.Color;
3984 return m.Color.fromHSL(hsl);
3985 },colorWithLightness:function(_421){
3986 var hsl=this.asHSL();
3988 var m=MochiKit.Color;
3989 return m.Color.fromHSL(hsl);
3990 },darkerColorWithLevel:function(_424){
3991 var hsl=this.asHSL();
3992 hsl.l=Math.max(hsl.l-_424,0);
3993 var m=MochiKit.Color;
3994 return m.Color.fromHSL(hsl);
3995 },lighterColorWithLevel:function(_427){
3996 var hsl=this.asHSL();
3997 hsl.l=Math.min(hsl.l+_427,1);
3998 var m=MochiKit.Color;
3999 return m.Color.fromHSL(hsl);
4000 },blendedColor:function(_42a,_42b){
4001 if(typeof (_42b)=="undefined"||_42b===null){
4008 return 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));
4009 },compareRGB:function(_430){
4012 return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
4013 },isLight:function(){
4014 return this.asHSL().b>0.5;
4015 },isDark:function(){
4016 return (!this.isLight());
4017 },toHSLString:function(){
4019 var ccc=MochiKit.Color.clampColorComponent;
4020 var rval=this._hslString;
4022 var mid=(ccc(c.h,360).toFixed(0)+","+ccc(c.s,100).toPrecision(4)+"%"+","+ccc(c.l,100).toPrecision(4)+"%");
4026 rval="hsl("+mid+")";
4031 rval="hsla("+mid+","+a+")";
4033 this._hslString=rval;
4036 },toRGBString:function(){
4038 var ccc=MochiKit.Color.clampColorComponent;
4039 var rval=this._rgbString;
4041 var mid=(ccc(c.r,255).toFixed(0)+","+ccc(c.g,255).toFixed(0)+","+ccc(c.b,255).toFixed(0));
4043 rval="rgba("+mid+","+c.a+")";
4045 rval="rgb("+mid+")";
4047 this._rgbString=rval;
4051 return MochiKit.Base.clone(this.rgb);
4052 },toHexString:function(){
4053 var m=MochiKit.Color;
4055 var ccc=MochiKit.Color.clampColorComponent;
4056 var rval=this._hexString;
4058 rval=("#"+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
4059 this._hexString=rval;
4065 if(typeof (hsv)=="undefined"||hsv===null){
4066 hsv=MochiKit.Color.rgbToHSV(this.rgb);
4069 return MochiKit.Base.clone(hsv);
4073 if(typeof (hsl)=="undefined"||hsl===null){
4074 hsl=MochiKit.Color.rgbToHSL(this.rgb);
4077 return MochiKit.Base.clone(hsl);
4078 },toString:function(){
4079 return this.toRGBString();
4082 var col=[c.r,c.g,c.b,c.a];
4083 return this.__class__.NAME+"("+col.join(", ")+")";
4085 MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_447,blue,_449){
4086 var _44a=MochiKit.Color.Color;
4087 if(arguments.length==1){
4092 if(typeof (rgb.a)=="undefined"){
4098 return new _44a(red,_447,blue,_449);
4099 },fromHSL:function(hue,_44d,_44e,_44f){
4100 var m=MochiKit.Color;
4101 return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
4102 },fromHSV:function(hue,_452,_453,_454){
4103 var m=MochiKit.Color;
4104 return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
4105 },fromName:function(name){
4106 var _457=MochiKit.Color.Color;
4107 if(name.charAt(0)=="\""){
4108 name=name.substr(1,name.length-2);
4110 var _458=_457._namedColors[name.toLowerCase()];
4111 if(typeof (_458)=="string"){
4112 return _457.fromHexString(_458);
4114 if(name=="transparent"){
4115 return _457.transparentColor();
4119 },fromString:function(_459){
4120 var self=MochiKit.Color.Color;
4121 var _45b=_459.substr(0,3);
4123 return self.fromRGBString(_459);
4126 return self.fromHSLString(_459);
4128 if(_459.charAt(0)=="#"){
4129 return self.fromHexString(_459);
4133 return self.fromName(_459);
4134 },fromHexString:function(_45c){
4135 if(_45c.charAt(0)=="#"){
4136 _45c=_45c.substring(1);
4142 hex=_45c.substr(i,1);
4143 _45d.push(parseInt(hex+hex,16)/255);
4147 hex=_45c.substr(i,2);
4148 _45d.push(parseInt(hex,16)/255);
4151 var _460=MochiKit.Color.Color;
4152 return _460.fromRGB.apply(_460,_45d);
4153 },_fromColorString:function(pre,_462,_463,_464){
4154 if(_464.indexOf(pre)===0){
4155 _464=_464.substring(_464.indexOf("(",3)+1,_464.length-1);
4157 var _465=_464.split(/\s*,\s*/);
4159 for(var i=0;i<_465.length;i++){
4162 var _46a=c.substring(c.length-3);
4163 if(c.charAt(c.length-1)=="%"){
4164 val=0.01*parseFloat(c.substring(0,c.length-1));
4167 val=parseFloat(c)/360;
4170 val=parseFloat(c)/(Math.PI*2);
4172 val=_463[i]*parseFloat(c);
4178 return this[_462].apply(this,_466);
4179 },fromComputedStyle:function(elem,_46c){
4181 var cls=MochiKit.Color.Color;
4182 for(elem=d.getElement(elem);elem;elem=elem.parentNode){
4183 var _46f=MochiKit.Style.computedStyle.apply(d,arguments);
4187 var _470=cls.fromString(_46f);
4191 if(_470.asRGB().a>0){
4196 },fromBackground:function(elem){
4197 var cls=MochiKit.Color.Color;
4198 return cls.fromComputedStyle(elem,"backgroundColor","background-color")||cls.whiteColor();
4199 },fromText:function(elem){
4200 var cls=MochiKit.Color.Color;
4201 return cls.fromComputedStyle(elem,"color","color")||cls.blackColor();
4202 },namedColors:function(){
4203 return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
4205 MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_476){
4216 },_hslValue:function(n1,n2,hue){
4232 val=n1+(n2-n1)*(4-hue);
4239 },hsvToRGB:function(hue,_47c,_47d,_47e){
4240 if(arguments.length==1){
4255 var i=Math.floor(hue*6);
4257 var p=_47d*(1-_47c);
4258 var q=_47d*(1-(_47c*f));
4259 var t=_47d*(1-(_47c*(1-f)));
4294 return {r:red,g:_481,b:blue,a:_47e};
4295 },hslToRGB:function(hue,_489,_48a,_48b){
4296 if(arguments.length==1){
4315 m2=_48a+_489-(_48a*_489);
4318 var f=MochiKit.Color._hslValue;
4324 return {r:red,g:_48e,b:blue,a:_48b};
4325 },rgbToHSV:function(red,_495,blue,_497){
4326 if(arguments.length==1){
4333 var max=Math.max(Math.max(red,_495),blue);
4334 var min=Math.min(Math.min(red,_495),blue);
4345 hue=(_495-blue)/_49e;
4348 hue=2+((blue-red)/_49e);
4350 hue=4+((red-_495)/_49e);
4361 return {h:hue,s:_49c,v:_49d,a:_497};
4362 },rgbToHSL:function(red,_4a0,blue,_4a2){
4363 if(arguments.length==1){
4370 var max=Math.max(red,Math.max(_4a0,blue));
4371 var min=Math.min(red,Math.min(_4a0,blue));
4374 var _4a8=(max+min)/2;
4381 _4a7=_4a9/(max+min);
4383 _4a7=_4a9/(2-max-min);
4386 hue=(_4a0-blue)/_4a9;
4389 hue=2+((blue-red)/_4a9);
4391 hue=4+((red-_4a0)/_4a9);
4402 return {h:hue,s:_4a7,l:_4a8,a:_4a2};
4403 },toColorPart:function(num){
4404 num=Math.round(num);
4405 var _4ab=num.toString(16);
4410 },__new__:function(){
4411 var m=MochiKit.Base;
4412 this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]);
4413 this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]);
4415 var _4ae={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_4ad,_4ad,_4ad],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_4ad,2*_4ad,2*_4ad],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]};
4416 var _4af=function(name,r,g,b,a){
4417 var rval=this.fromRGB(r,g,b,a);
4418 this[name]=function(){
4425 var _4b8=m.concat([_4af,this.Color,name],_4ae[k]);
4426 this.Color[name]=m.bind.apply(null,_4b8);
4428 var _4b9=function(){
4429 for(var i=0;i<arguments.length;i++){
4430 if(!(arguments[i] instanceof Color)){
4436 var _4bb=function(a,b){
4437 return a.compareRGB(b);
4439 m.nameFunctions(this);
4440 m.registerComparator(this.Color.NAME,_4b9,_4bb);
4441 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
4443 MochiKit.Color.EXPORT=["Color"];
4444 MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
4445 MochiKit.Color.__new__();
4446 MochiKit.Base._exportSymbols(this,MochiKit.Color);
4447 MochiKit.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"};
4448 if(typeof (dojo)!="undefined"){
4449 dojo.provide("MochiKit.Signal");
4450 dojo.require("MochiKit.Base");
4451 dojo.require("MochiKit.DOM");
4452 dojo.require("MochiKit.Style");
4454 if(typeof (JSAN)!="undefined"){
4455 JSAN.use("MochiKit.Base",[]);
4456 JSAN.use("MochiKit.DOM",[]);
4457 JSAN.use("MochiKit.Style",[]);
4460 if(typeof (MochiKit.Base)=="undefined"){
4465 throw "MochiKit.Signal depends on MochiKit.Base!";
4468 if(typeof (MochiKit.DOM)=="undefined"){
4473 throw "MochiKit.Signal depends on MochiKit.DOM!";
4476 if(typeof (MochiKit.Style)=="undefined"){
4481 throw "MochiKit.Signal depends on MochiKit.Style!";
4483 if(typeof (MochiKit.Signal)=="undefined"){
4486 MochiKit.Signal.NAME="MochiKit.Signal";
4487 MochiKit.Signal.VERSION="1.4";
4488 MochiKit.Signal._observers=[];
4489 MochiKit.Signal.Event=function(src,e){
4490 this._event=e||window.event;
4493 MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
4494 var repr=MochiKit.Base.repr;
4495 var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target())+", 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)+"}";
4496 if(this.type()&&this.type().indexOf("key")===0){
4497 str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
4499 if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
4500 str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
4501 if(this.type()!="mousemove"){
4502 str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}}";
4507 if(this.type()=="mouseover"||this.type()=="mouseout"){
4508 str+=", relatedTarget(): "+repr(this.relatedTarget());
4512 },toString:function(){
4513 return this.__repr__();
4519 return this._event.type||undefined;
4520 },target:function(){
4521 return this._event.target||this._event.srcElement;
4522 },_relatedTarget:null,relatedTarget:function(){
4523 if(this._relatedTarget!==null){
4524 return this._relatedTarget;
4527 if(this.type()=="mouseover"){
4528 elem=(this._event.relatedTarget||this._event.fromElement);
4530 if(this.type()=="mouseout"){
4531 elem=(this._event.relatedTarget||this._event.toElement);
4535 this._relatedTarget=elem;
4539 },_modifier:null,modifier:function(){
4540 if(this._modifier!==null){
4541 return this._modifier;
4544 m.alt=this._event.altKey;
4545 m.ctrl=this._event.ctrlKey;
4546 m.meta=this._event.metaKey||false;
4547 m.shift=this._event.shiftKey;
4548 m.any=m.alt||m.ctrl||m.shift||m.meta;
4551 },_key:null,key:function(){
4552 if(this._key!==null){
4556 if(this.type()&&this.type().indexOf("key")===0){
4557 if(this.type()=="keydown"||this.type()=="keyup"){
4558 k.code=this._event.keyCode;
4559 k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
4563 if(this.type()=="keypress"){
4566 if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
4567 k.code=this._event.charCode;
4568 k.string=String.fromCharCode(k.code);
4570 if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
4571 k.code=this._event.keyCode;
4572 k.string=String.fromCharCode(k.code);
4581 },_mouse:null,mouse:function(){
4582 if(this._mouse!==null){
4587 if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
4588 m.client=new MochiKit.Style.Coordinates(0,0);
4589 if(e.clientX||e.clientY){
4590 m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
4591 m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
4593 m.page=new MochiKit.Style.Coordinates(0,0);
4594 if(e.pageX||e.pageY){
4595 m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
4596 m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
4598 var de=MochiKit.DOM._document.documentElement;
4599 var b=MochiKit.DOM._document.body;
4600 m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
4601 m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
4603 if(this.type()!="mousemove"){
4605 m.button.left=false;
4606 m.button.right=false;
4607 m.button.middle=false;
4609 m.button.left=(e.which==1);
4610 m.button.middle=(e.which==2);
4611 m.button.right=(e.which==3);
4613 m.button.left=!!(e.button&1);
4614 m.button.right=!!(e.button&2);
4615 m.button.middle=!!(e.button&4);
4623 this.stopPropagation();
4624 this.preventDefault();
4625 },stopPropagation:function(){
4626 if(this._event.stopPropagation){
4627 this._event.stopPropagation();
4629 this._event.cancelBubble=true;
4631 },preventDefault:function(){
4632 if(this._event.preventDefault){
4633 this._event.preventDefault();
4635 if(this._confirmUnload===null){
4636 this._event.returnValue=false;
4639 },_confirmUnload:null,confirmUnload:function(msg){
4640 if(this.type()=="beforeunload"){
4641 this._confirmUnload=msg;
4642 this._event.returnValue=msg;
4645 MochiKit.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"};
4647 var _4ca=MochiKit.Signal._specialMacKeys;
4648 for(i=63236;i<=63242;i++){
4649 _4ca[i]="KEY_F"+(i-63236+1);
4652 MochiKit.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"};
4654 var _4cb=MochiKit.Signal._specialKeys;
4655 for(var i=48;i<=57;i++){
4656 _4cb[i]="KEY_"+(i-48);
4658 for(i=65;i<=90;i++){
4659 _4cb[i]="KEY_"+String.fromCharCode(i);
4661 for(i=96;i<=105;i++){
4662 _4cb[i]="KEY_NUM_PAD_"+(i-96);
4664 for(i=112;i<=123;i++){
4665 _4cb[i]="KEY_F"+(i-112+1);
4668 MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
4669 return "["+this.NAME+" "+this.VERSION+"]";
4670 },toString:function(){
4671 return this.__repr__();
4672 },_unloadCache:function(){
4673 var self=MochiKit.Signal;
4674 var _4ce=self._observers;
4675 for(var i=0;i<_4ce.length;i++){
4676 self._disconnect(_4ce[i]);
4678 delete self._observers;
4680 window.onload=undefined;
4685 window.onunload=undefined;
4689 },_listener:function(src,func,obj,_4d3){
4690 var self=MochiKit.Signal;
4693 return MochiKit.Base.bind(func,obj);
4696 if(typeof (func)=="string"){
4697 return function(_4d6){
4698 obj[func].apply(obj,[new E(src,_4d6)]);
4701 return function(_4d7){
4702 func.apply(obj,[new E(src,_4d7)]);
4705 },_browserAlreadyHasMouseEnterAndLeave:function(){
4706 return /MSIE/.test(navigator.userAgent);
4707 },_mouseEnterListener:function(src,sig,func,obj){
4708 var E=MochiKit.Signal.Event;
4709 return function(_4dd){
4710 var e=new E(src,_4dd);
4712 e.relatedTarget().nodeName;
4718 if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
4724 if(typeof (func)=="string"){
4725 return obj[func].apply(obj,[e]);
4727 return func.apply(obj,[e]);
4730 },_getDestPair:function(_4df,_4e0){
4733 if(typeof (_4e0)!="undefined"){
4736 if(typeof (_4e0)=="string"){
4737 if(typeof (_4df[_4e0])!="function"){
4738 throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
4741 if(typeof (_4e0)!="function"){
4742 throw new Error("'funcOrStr' must be a function or string");
4746 if(typeof (_4df)!="function"){
4747 throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
4753 },connect:function(src,sig,_4e5,_4e6){
4754 src=MochiKit.DOM.getElement(src);
4755 var self=MochiKit.Signal;
4756 if(typeof (sig)!="string"){
4757 throw new Error("'sig' must be a string");
4759 var _4e8=self._getDestPair(_4e5,_4e6);
4762 if(typeof (obj)=="undefined"||obj===null){
4765 var _4eb=!!(src.addEventListener||src.attachEvent);
4766 if(_4eb&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
4767 var _4ec=self._mouseEnterListener(src,sig.substr(2),func,obj);
4768 if(sig==="onmouseenter"){
4774 var _4ec=self._listener(src,func,obj,_4eb);
4776 if(src.addEventListener){
4777 src.addEventListener(sig.substr(2),_4ec,false);
4779 if(src.attachEvent){
4780 src.attachEvent(sig,_4ec);
4783 var _4ed=[src,sig,_4ec,_4eb,_4e5,_4e6,true];
4784 self._observers.push(_4ed);
4785 if(!_4eb&&typeof (src.__connect__)=="function"){
4786 var args=MochiKit.Base.extend([_4ed],arguments,1);
4787 src.__connect__.apply(src,args);
4790 },_disconnect:function(_4ef){
4801 if(src.removeEventListener){
4802 src.removeEventListener(sig.substr(2),_4f2,false);
4804 if(src.detachEvent){
4805 src.detachEvent(sig,_4f2);
4807 throw new Error("'src' must be a DOM element");
4810 },disconnect:function(_4f3){
4811 var self=MochiKit.Signal;
4812 var _4f5=self._observers;
4813 var m=MochiKit.Base;
4814 if(arguments.length>1){
4815 var src=MochiKit.DOM.getElement(arguments[0]);
4816 var sig=arguments[1];
4817 var obj=arguments[2];
4818 var func=arguments[3];
4819 for(var i=_4f5.length-1;i>=0;i--){
4821 if(o[0]===src&&o[1]===sig&&o[4]===obj&&o[5]===func){
4822 self._disconnect(o);
4832 var idx=m.findIdentical(_4f5,_4f3);
4834 self._disconnect(_4f3);
4844 },disconnectAllTo:function(_4fe,_4ff){
4845 var self=MochiKit.Signal;
4846 var _501=self._observers;
4847 var _502=self._disconnect;
4848 var _503=self._lock;
4849 var _504=self._dirty;
4850 if(typeof (_4ff)==="undefined"){
4853 for(var i=_501.length-1;i>=0;i--){
4855 if(_506[4]===_4fe&&(_4ff===null||_506[5]===_4ff)){
4865 },disconnectAll:function(src,sig){
4866 src=MochiKit.DOM.getElement(src);
4867 var m=MochiKit.Base;
4868 var _50a=m.flattenArguments(m.extend(null,arguments,1));
4869 var self=MochiKit.Signal;
4870 var _50c=self._disconnect;
4871 var _50d=self._observers;
4873 var _510=self._lock;
4874 var _511=self._dirty;
4875 if(_50a.length===0){
4876 for(i=_50d.length-1;i>=0;i--){
4889 for(i=0;i<_50a.length;i++){
4892 for(i=_50d.length-1;i>=0;i--){
4894 if(_50f[0]===src&&_50f[1] in sigs){
4905 },signal:function(src,sig){
4906 var self=MochiKit.Signal;
4907 var _516=self._observers;
4908 src=MochiKit.DOM.getElement(src);
4909 var args=MochiKit.Base.extend(null,arguments,2);
4912 for(var i=0;i<_516.length;i++){
4914 if(_51a[0]===src&&_51a[1]===sig){
4916 _51a[2].apply(src,args);
4926 for(var i=_516.length-1;i>=0;i--){
4936 var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
4942 MochiKit.Signal.EXPORT_OK=[];
4943 MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll","disconnectAllTo"];
4944 MochiKit.Signal.__new__=function(win){
4945 var m=MochiKit.Base;
4946 this._document=document;
4951 this.connect(window,"onunload",this._unloadCache);
4955 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
4956 m.nameFunctions(this);
4958 MochiKit.Signal.__new__(this);
4959 if(MochiKit.__export__){
4960 connect=MochiKit.Signal.connect;
4961 disconnect=MochiKit.Signal.disconnect;
4962 disconnectAll=MochiKit.Signal.disconnectAll;
4963 signal=MochiKit.Signal.signal;
4965 MochiKit.Base._exportSymbols(this,MochiKit.Signal);
4966 if(typeof (dojo)!="undefined"){
4967 dojo.provide("MochiKit.Visual");
4968 dojo.require("MochiKit.Base");
4969 dojo.require("MochiKit.DOM");
4970 dojo.require("MochiKit.Style");
4971 dojo.require("MochiKit.Color");
4973 if(typeof (JSAN)!="undefined"){
4974 JSAN.use("MochiKit.Base",[]);
4975 JSAN.use("MochiKit.DOM",[]);
4976 JSAN.use("MochiKit.Style",[]);
4977 JSAN.use("MochiKit.Color",[]);
4980 if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Style)==="undefined"||typeof (MochiKit.Color)==="undefined"){
4985 throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style and MochiKit.Color!";
4987 if(typeof (MochiKit.Visual)=="undefined"){
4990 MochiKit.Visual.NAME="MochiKit.Visual";
4991 MochiKit.Visual.VERSION="1.4";
4992 MochiKit.Visual.__repr__=function(){
4993 return "["+this.NAME+" "+this.VERSION+"]";
4995 MochiKit.Visual.toString=function(){
4996 return this.__repr__();
4998 MochiKit.Visual._RoundCorners=function(e,_51f){
4999 e=MochiKit.DOM.getElement(e);
5000 this._setOptions(_51f);
5001 if(this.options.__unstable__wrapElement){
5004 var _520=this.options.color;
5005 var C=MochiKit.Color.Color;
5006 if(this.options.color==="fromElement"){
5007 _520=C.fromBackground(e);
5009 if(!(_520 instanceof C)){
5010 _520=C.fromString(_520);
5013 this.isTransparent=(_520.asRGB().a<=0);
5014 var _522=this.options.bgColor;
5015 if(this.options.bgColor==="fromParent"){
5016 _522=C.fromBackground(e.offsetParent);
5018 if(!(_522 instanceof C)){
5019 _522=C.fromString(_522);
5022 this._roundCornersImpl(e,_520,_522);
5024 MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
5025 var _524=e.parentNode;
5026 var doc=MochiKit.DOM.currentDocument();
5027 if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
5030 var _526=doc.defaultView.getComputedStyle(e,null);
5031 if(typeof (_526)==="undefined"||_526===null){
5034 var _527=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_526.getPropertyValue("padding-top"),marginRight:_526.getPropertyValue("padding-right"),marginBottom:_526.getPropertyValue("padding-bottom"),marginLeft:_526.getPropertyValue("padding-left"),padding:"0px"}});
5035 _527.innerHTML=e.innerHTML;
5037 e.appendChild(_527);
5039 },_roundCornersImpl:function(e,_529,_52a){
5040 if(this.options.border){
5041 this._renderBorder(e,_52a);
5043 if(this._isTopRounded()){
5044 this._roundTopCorners(e,_529,_52a);
5046 if(this._isBottomRounded()){
5047 this._roundBottomCorners(e,_529,_52a);
5049 },_renderBorder:function(el,_52c){
5050 var _52d="1px solid "+this._borderColor(_52c);
5051 var _52e="border-left: "+_52d;
5052 var _52f="border-right: "+_52d;
5053 var _530="style='"+_52e+";"+_52f+"'";
5054 el.innerHTML="<div "+_530+">"+el.innerHTML+"</div>";
5055 },_roundTopCorners:function(el,_532,_533){
5056 var _534=this._createCorner(_533);
5057 for(var i=0;i<this.options.numSlices;i++){
5058 _534.appendChild(this._createCornerSlice(_532,_533,i,"top"));
5060 el.style.paddingTop=0;
5061 el.insertBefore(_534,el.firstChild);
5062 },_roundBottomCorners:function(el,_537,_538){
5063 var _539=this._createCorner(_538);
5064 for(var i=(this.options.numSlices-1);i>=0;i--){
5065 _539.appendChild(this._createCornerSlice(_537,_538,i,"bottom"));
5067 el.style.paddingBottom=0;
5068 el.appendChild(_539);
5069 },_createCorner:function(_53b){
5070 var dom=MochiKit.DOM;
5071 return dom.DIV({style:{backgroundColor:_53b.toString()}});
5072 },_createCornerSlice:function(_53d,_53e,n,_540){
5073 var _541=MochiKit.DOM.SPAN();
5074 var _542=_541.style;
5075 _542.backgroundColor=_53d.toString();
5076 _542.display="block";
5078 _542.overflow="hidden";
5079 _542.fontSize="1px";
5080 var _543=this._borderColor(_53d,_53e);
5081 if(this.options.border&&n===0){
5082 _542.borderTopStyle="solid";
5083 _542.borderTopWidth="1px";
5084 _542.borderLeftWidth="0px";
5085 _542.borderRightWidth="0px";
5086 _542.borderBottomWidth="0px";
5088 _542.borderColor=_543.toString();
5091 _542.borderColor=_543.toString();
5092 _542.borderStyle="solid";
5093 _542.borderWidth="0px 1px";
5096 if(!this.options.compact&&(n==(this.options.numSlices-1))){
5099 this._setMargin(_541,n,_540);
5100 this._setBorder(_541,n,_540);
5102 },_setOptions:function(_544){
5103 this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
5104 MochiKit.Base.update(this.options,_544);
5105 this.options.numSlices=(this.options.compact?2:4);
5106 },_whichSideTop:function(){
5107 var _545=this.options.corners;
5108 if(this._hasString(_545,"all","top")){
5111 var _546=(_545.indexOf("tl")!=-1);
5112 var _547=(_545.indexOf("tr")!=-1);
5123 },_whichSideBottom:function(){
5124 var _548=this.options.corners;
5125 if(this._hasString(_548,"all","bottom")){
5128 var _549=(_548.indexOf("bl")!=-1);
5129 var _54a=(_548.indexOf("br")!=-1);
5140 },_borderColor:function(_54b,_54c){
5141 if(_54b=="transparent"){
5144 if(this.options.border){
5145 return this.options.border;
5147 if(this.options.blend){
5148 return _54c.blendedColor(_54b);
5153 },_setMargin:function(el,n,_54f){
5154 var _550=this._marginSize(n)+"px";
5155 var _551=(_54f=="top"?this._whichSideTop():this._whichSideBottom());
5158 _552.marginLeft=_550;
5159 _552.marginRight="0px";
5162 _552.marginRight=_550;
5163 _552.marginLeft="0px";
5165 _552.marginLeft=_550;
5166 _552.marginRight=_550;
5169 },_setBorder:function(el,n,_555){
5170 var _556=this._borderSize(n)+"px";
5171 var _557=(_555=="top"?this._whichSideTop():this._whichSideBottom());
5174 _558.borderLeftWidth=_556;
5175 _558.borderRightWidth="0px";
5178 _558.borderRightWidth=_556;
5179 _558.borderLeftWidth="0px";
5181 _558.borderLeftWidth=_556;
5182 _558.borderRightWidth=_556;
5185 },_marginSize:function(n){
5186 if(this.isTransparent){
5190 if(o.compact&&o.blend){
5207 },_borderSize:function(n){
5210 if(o.compact&&(o.blend||this.isTransparent)){
5222 if(this.isTransparent){
5232 },_hasString:function(str){
5233 for(var i=1;i<arguments.length;i++){
5234 if(str.indexOf(arguments[i])!=-1){
5239 },_isTopRounded:function(){
5240 return this._hasString(this.options.corners,"all","top","tl","tr");
5241 },_isBottomRounded:function(){
5242 return this._hasString(this.options.corners,"all","bottom","bl","br");
5243 },_hasSingleTextChild:function(el){
5244 return (el.childNodes.length==1&&el.childNodes[0].nodeType==3);
5246 MochiKit.Visual.roundElement=function(e,_566){
5247 new MochiKit.Visual._RoundCorners(e,_566);
5249 MochiKit.Visual.roundClass=function(_567,_568,_569){
5250 var _56a=MochiKit.DOM.getElementsByTagAndClassName(_567,_568);
5251 for(var i=0;i<_56a.length;i++){
5252 MochiKit.Visual.roundElement(_56a[i],_569);
5255 MochiKit.Visual.tagifyText=function(_56c,_56d){
5256 var _56d=_56d||"position:relative";
5257 if(/MSIE/.test(navigator.userAgent)){
5260 _56c=MochiKit.DOM.getElement(_56c);
5261 var ma=MochiKit.Base.map;
5263 if(_56f.nodeType==3){
5265 _56c.insertBefore(MochiKit.DOM.SPAN({style:_56d},_570==" "?String.fromCharCode(160):_570),_56f);
5266 },_56f.nodeValue.split(""));
5267 MochiKit.DOM.removeElement(_56f);
5271 MochiKit.Visual.forceRerendering=function(_571){
5273 _571=MochiKit.DOM.getElement(_571);
5274 var n=document.createTextNode(" ");
5275 _571.appendChild(n);
5276 _571.removeChild(n);
5281 MochiKit.Visual.multiple=function(_573,_574,_575){
5282 _575=MochiKit.Base.update({speed:0.1,delay:0},_575||{});
5283 var _576=_575.delay;
5285 MochiKit.Base.map(function(_578){
5286 _575.delay=_577*_575.speed+_576;
5287 new _574(_578,_575);
5291 MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
5292 MochiKit.Visual.toggle=function(_579,_57a,_57b){
5293 _579=MochiKit.DOM.getElement(_579);
5294 _57a=(_57a||"appear").toLowerCase();
5295 _57b=MochiKit.Base.update({queue:{position:"end",scope:(_579.id||"global"),limit:1}},_57b||{});
5296 var v=MochiKit.Visual;
5297 v[_579.style.display!="none"?v.PAIRS[_57a][1]:v.PAIRS[_57a][0]](_579,_57b);
5299 MochiKit.Visual.Transitions={};
5300 MochiKit.Visual.Transitions.linear=function(pos){
5303 MochiKit.Visual.Transitions.sinoidal=function(pos){
5304 return (-Math.cos(pos*Math.PI)/2)+0.5;
5306 MochiKit.Visual.Transitions.reverse=function(pos){
5309 MochiKit.Visual.Transitions.flicker=function(pos){
5310 return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
5312 MochiKit.Visual.Transitions.wobble=function(pos){
5313 return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
5315 MochiKit.Visual.Transitions.pulse=function(pos){
5316 return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
5318 MochiKit.Visual.Transitions.none=function(pos){
5321 MochiKit.Visual.Transitions.full=function(pos){
5324 MochiKit.Visual.ScopedQueue=function(){
5327 MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
5330 },add:function(_585){
5331 var _586=new Date().getTime();
5332 var _587=(typeof (_585.options.queue)=="string")?_585.options.queue:_585.options.queue.position;
5333 var ma=MochiKit.Base.map;
5337 if(e.state=="idle"){
5338 e.startOn+=_585.finishOn;
5339 e.finishOn+=_585.finishOn;
5360 _585.finishOn+=_586;
5361 if(!_585.options.queue.limit||this.effects.length<_585.options.queue.limit){
5362 this.effects.push(_585);
5365 this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
5367 },startLoop:function(func,_58f){
5368 return setInterval(func,_58f);
5369 },remove:function(_590){
5370 this.effects=MochiKit.Base.filter(function(e){
5373 if(this.effects.length==0){
5374 this.stopLoop(this.interval);
5377 },stopLoop:function(_592){
5378 clearInterval(_592);
5380 var _593=new Date().getTime();
5381 MochiKit.Base.map(function(_594){
5385 MochiKit.Visual.Queues={instances:{},get:function(_595){
5386 if(typeof (_595)!="string"){
5389 if(!this.instances[_595]){
5390 this.instances[_595]=new MochiKit.Visual.ScopedQueue();
5392 return this.instances[_595];
5394 MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global");
5395 MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
5396 MochiKit.Visual.Base=function(){
5398 MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_596){
5399 var v=MochiKit.Visual;
5400 this.options=MochiKit.Base.setdefault(_596||{},v.DefaultOptions);
5401 this.currentFrame=0;
5403 this.startOn=this.options.delay*1000;
5404 this.finishOn=this.startOn+(this.options.duration*1000);
5405 this.event("beforeStart");
5406 if(!this.options.sync){
5407 v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this);
5409 },loop:function(_598){
5410 if(_598>=this.startOn){
5411 if(_598>=this.finishOn){
5412 return this.finalize();
5414 var pos=(_598-this.startOn)/(this.finishOn-this.startOn);
5415 var _59a=Math.round(pos*this.options.fps*this.options.duration);
5416 if(_59a>this.currentFrame){
5418 this.currentFrame=_59a;
5421 },render:function(pos){
5422 if(this.state=="idle"){
5423 this.state="running";
5424 this.event("beforeSetup");
5426 this.event("afterSetup");
5428 if(this.state=="running"){
5429 if(this.options.transition){
5430 pos=this.options.transition(pos);
5432 pos*=(this.options.to-this.options.from);
5433 pos+=this.options.from;
5434 this.event("beforeUpdate");
5436 this.event("afterUpdate");
5438 },cancel:function(){
5439 if(!this.options.sync){
5440 MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this);
5442 this.state="finished";
5443 },finalize:function(){
5446 this.event("beforeFinish");
5448 this.event("afterFinish");
5450 },finish:function(){
5451 },update:function(_59c){
5452 },event:function(_59d){
5453 if(this.options[_59d+"Internal"]){
5454 this.options[_59d+"Internal"](this);
5456 if(this.options[_59d]){
5457 this.options[_59d](this);
5460 return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
5462 MochiKit.Visual.Parallel=function(_59e,_59f){
5463 this.__init__(_59e,_59f);
5465 MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
5466 MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__init__:function(_5a0,_5a1){
5467 this.effects=_5a0||[];
5469 },update:function(_5a2){
5470 MochiKit.Base.map(function(_5a3){
5473 },finish:function(){
5474 MochiKit.Base.map(function(_5a4){
5478 MochiKit.Visual.Opacity=function(_5a5,_5a6){
5479 this.__init__(_5a5,_5a6);
5481 MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
5482 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__init__:function(_5a7,_5a8){
5483 var b=MochiKit.Base;
5484 var s=MochiKit.Style;
5485 this.element=MochiKit.DOM.getElement(_5a7);
5486 if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
5487 s.setStyle(this.element,{zoom:1});
5489 _5a8=b.update({from:s.getOpacity(this.element)||0,to:1},_5a8||{});
5491 },update:function(_5ab){
5492 MochiKit.Style.setOpacity(this.element,_5ab);
5494 MochiKit.Visual.Move=function(_5ac,_5ad){
5495 this.__init__(_5ac,_5ad);
5497 MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
5498 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__init__:function(_5ae,_5af){
5499 this.element=MochiKit.DOM.getElement(_5ae);
5500 _5af=MochiKit.Base.update({x:0,y:0,mode:"relative"},_5af||{});
5503 MochiKit.DOM.makePositioned(this.element);
5504 var s=this.element.style;
5505 var _5b1=s.visibility;
5508 s.visibility="hidden";
5511 this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0");
5512 this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0");
5513 if(this.options.mode=="absolute"){
5514 this.options.x-=this.originalLeft;
5515 this.options.y-=this.originalTop;
5521 },update:function(_5b3){
5522 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_5b3+this.originalLeft)+"px",top:Math.round(this.options.y*_5b3+this.originalTop)+"px"});
5524 MochiKit.Visual.Scale=function(_5b4,_5b5,_5b6){
5525 this.__init__(_5b4,_5b5,_5b6);
5527 MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
5528 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__init__:function(_5b7,_5b8,_5b9){
5529 this.element=MochiKit.DOM.getElement(_5b7);
5530 _5b9=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_5b8},_5b9||{});
5533 this.restoreAfterFinish=this.options.restoreAfterFinish||false;
5534 this.elementPositioning=MochiKit.Style.getStyle(this.element,"position");
5535 var ma=MochiKit.Base.map;
5536 var b=MochiKit.Base.bind;
5537 this.originalStyle={};
5539 this.originalStyle[k]=this.element.style[k];
5540 },this),["top","left","width","height","fontSize"]);
5541 this.originalTop=this.element.offsetTop;
5542 this.originalLeft=this.element.offsetLeft;
5543 var _5bd=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
5544 ma(b(function(_5be){
5545 if(_5bd.indexOf(_5be)>0){
5546 this.fontSize=parseFloat(_5bd);
5547 this.fontSizeType=_5be;
5549 },this),["em","px","%"]);
5550 this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
5551 if(/^content/.test(this.options.scaleMode)){
5552 this.dims=[this.element.scrollHeight,this.element.scrollWidth];
5554 if(this.options.scaleMode=="box"){
5555 this.dims=[this.element.offsetHeight,this.element.offsetWidth];
5557 this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
5560 },update:function(_5bf){
5561 var _5c0=(this.options.scaleFrom/100)+(this.factor*_5bf);
5562 if(this.options.scaleContent&&this.fontSize){
5563 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_5c0+this.fontSizeType});
5565 this.setDimensions(this.dims[0]*_5c0,this.dims[1]*_5c0);
5566 },finish:function(){
5567 if(this.restoreAfterFinish){
5568 MochiKit.Style.setStyle(this.element,this.originalStyle);
5570 },setDimensions:function(_5c1,_5c2){
5573 if(/MSIE/.test(navigator.userAgent)){
5576 if(this.options.scaleX){
5577 d.width=r(_5c2)+"px";
5579 if(this.options.scaleY){
5580 d.height=r(_5c1)+"px";
5582 if(this.options.scaleFromCenter){
5583 var topd=(_5c1-this.dims[0])/2;
5584 var _5c6=(_5c2-this.dims[1])/2;
5585 if(this.elementPositioning=="absolute"){
5586 if(this.options.scaleY){
5587 d.top=this.originalTop-topd+"px";
5589 if(this.options.scaleX){
5590 d.left=this.originalLeft-_5c6+"px";
5593 if(this.options.scaleY){
5596 if(this.options.scaleX){
5601 MochiKit.Style.setStyle(this.element,d);
5603 MochiKit.Visual.Highlight=function(_5c7,_5c8){
5604 this.__init__(_5c7,_5c8);
5606 MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
5607 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__init__:function(_5c9,_5ca){
5608 this.element=MochiKit.DOM.getElement(_5c9);
5609 _5ca=MochiKit.Base.update({startcolor:"#ffff99"},_5ca||{});
5612 var b=MochiKit.Base;
5613 var s=MochiKit.Style;
5614 if(s.getStyle(this.element,"display")=="none"){
5618 this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")};
5619 s.setStyle(this.element,{backgroundImage:"none"});
5620 if(!this.options.endcolor){
5621 this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
5623 if(b.isUndefinedOrNull(this.options.restorecolor)){
5624 this.options.restorecolor=s.getStyle(this.element,"background-color");
5626 this._base=b.map(b.bind(function(i){
5627 return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
5629 this._delta=b.map(b.bind(function(i){
5630 return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
5632 },update:function(_5cf){
5634 MochiKit.Base.map(MochiKit.Base.bind(function(i){
5635 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_5cf));
5637 MochiKit.Style.setStyle(this.element,{backgroundColor:m});
5638 },finish:function(){
5639 MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
5641 MochiKit.Visual.ScrollTo=function(_5d2,_5d3){
5642 this.__init__(_5d2,_5d3);
5644 MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
5645 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__init__:function(_5d4,_5d5){
5646 this.element=MochiKit.DOM.getElement(_5d4);
5647 this.start(_5d5||{});
5649 var p=MochiKit.Position;
5651 var _5d7=p.cumulativeOffset(this.element);
5652 if(this.options.offset){
5653 _5d7.y+=this.options.offset;
5656 if(window.innerHeight){
5657 max=window.innerHeight-window.height;
5659 if(document.documentElement&&document.documentElement.clientHeight){
5660 max=document.documentElement.clientHeight-document.body.scrollHeight;
5663 max=document.body.clientHeight-document.body.scrollHeight;
5667 this.scrollStart=p.windowOffset.y;
5668 this.delta=(_5d7.y>max?max:_5d7.y)-this.scrollStart;
5669 },update:function(_5d9){
5670 var p=MochiKit.Position;
5672 window.scrollTo(p.windowOffset.x,this.scrollStart+(_5d9*this.delta));
5674 MochiKit.Visual.fade=function(_5db,_5dc){
5675 var s=MochiKit.Style;
5676 var _5de=MochiKit.DOM.getElement(_5db).style.opacity||"";
5677 _5dc=MochiKit.Base.update({from:s.getOpacity(_5db)||1,to:0,afterFinishInternal:function(_5df){
5678 if(_5df.options.to!==0){
5681 s.hideElement(_5df.element);
5682 s.setStyle(_5df.element,{opacity:_5de});
5684 return new MochiKit.Visual.Opacity(_5db,_5dc);
5686 MochiKit.Visual.appear=function(_5e0,_5e1){
5687 var s=MochiKit.Style;
5688 var v=MochiKit.Visual;
5689 _5e1=MochiKit.Base.update({from:(s.getStyle(_5e0,"display")=="none"?0:s.getOpacity(_5e0)||0),to:1,afterFinishInternal:function(_5e4){
5690 v.forceRerendering(_5e4.element);
5691 },beforeSetupInternal:function(_5e5){
5692 s.setOpacity(_5e5.element,_5e5.options.from);
5693 s.showElement(_5e5.element);
5695 return new v.Opacity(_5e0,_5e1);
5697 MochiKit.Visual.puff=function(_5e6,_5e7){
5698 var s=MochiKit.Style;
5699 var v=MochiKit.Visual;
5700 _5e6=MochiKit.DOM.getElement(_5e6);
5701 var _5ea={opacity:_5e6.style.opacity||"",position:s.getStyle(_5e6,"position"),top:_5e6.style.top,left:_5e6.style.left,width:_5e6.style.width,height:_5e6.style.height};
5702 _5e7=MochiKit.Base.update({beforeSetupInternal:function(_5eb){
5703 MochiKit.Position.absolutize(_5eb.effects[0].element);
5704 },afterFinishInternal:function(_5ec){
5705 s.hideElement(_5ec.effects[0].element);
5706 s.setStyle(_5ec.effects[0].element,_5ea);
5708 return new v.Parallel([new v.Scale(_5e6,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new v.Opacity(_5e6,{sync:true,to:0})],_5e7);
5710 MochiKit.Visual.blindUp=function(_5ed,_5ee){
5712 _5ed=d.getElement(_5ed);
5713 var _5f0=d.makeClipping(_5ed);
5714 _5ee=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_5f1){
5715 MochiKit.Style.hideElement(_5f1.element);
5716 d.undoClipping(_5f1.element,_5f0);
5718 return new MochiKit.Visual.Scale(_5ed,0,_5ee);
5720 MochiKit.Visual.blindDown=function(_5f2,_5f3){
5722 var s=MochiKit.Style;
5723 _5f2=d.getElement(_5f2);
5724 var _5f6=s.getElementDimensions(_5f2);
5726 _5f3=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_5f6.h,originalWidth:_5f6.w},restoreAfterFinish:true,afterSetupInternal:function(_5f8){
5727 _5f7=d.makeClipping(_5f8.element);
5728 s.setStyle(_5f8.element,{height:"0px"});
5729 s.showElement(_5f8.element);
5730 },afterFinishInternal:function(_5f9){
5731 d.undoClipping(_5f9.element,_5f7);
5733 return new MochiKit.Visual.Scale(_5f2,100,_5f3);
5735 MochiKit.Visual.switchOff=function(_5fa,_5fb){
5737 _5fa=d.getElement(_5fa);
5738 var _5fd=_5fa.style.opacity||"";
5740 var _5fb=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_5ff){
5741 d.makePositioned(_5ff.element);
5742 _5fe=d.makeClipping(_5ff.element);
5743 },afterFinishInternal:function(_600){
5744 MochiKit.Style.hideElement(_600.element);
5745 d.undoClipping(_600.element,_5fe);
5746 d.undoPositioned(_600.element);
5747 MochiKit.Style.setStyle(_600.element,{opacity:_5fd});
5749 var v=MochiKit.Visual;
5750 return new v.appear(_5fa,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_602){
5751 new v.Scale(_602.element,1,_5fb);
5754 MochiKit.Visual.dropOut=function(_603,_604){
5756 var s=MochiKit.Style;
5757 _603=d.getElement(_603);
5758 var _607={top:s.getStyle(_603,"top"),left:s.getStyle(_603,"left"),opacity:_603.style.opacity||""};
5759 _604=MochiKit.Base.update({duration:0.5,beforeSetupInternal:function(_608){
5760 d.makePositioned(_608.effects[0].element);
5761 },afterFinishInternal:function(_609){
5762 s.hideElement(_609.effects[0].element);
5763 d.undoPositioned(_609.effects[0].element);
5764 s.setStyle(_609.effects[0].element,_607);
5766 var v=MochiKit.Visual;
5767 return new v.Parallel([new v.Move(_603,{x:0,y:100,sync:true}),new v.Opacity(_603,{sync:true,to:0})],_604);
5769 MochiKit.Visual.shake=function(_60b,_60c){
5771 var v=MochiKit.Visual;
5772 var s=MochiKit.Style;
5773 _60b=d.getElement(_60b);
5774 _60c=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_610){
5775 d.undoPositioned(_610.element);
5776 s.setStyle(_610.element,_611);
5778 var _611={top:s.getStyle(_60b,"top"),left:s.getStyle(_60b,"left")};
5779 return new v.Move(_60b,{x:20,y:0,duration:0.05,afterFinishInternal:function(_612){
5780 new v.Move(_612.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_613){
5781 new v.Move(_613.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_614){
5782 new v.Move(_614.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_615){
5783 new v.Move(_615.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_616){
5784 new v.Move(_616.element,_60c);
5791 MochiKit.Visual.slideDown=function(_617,_618){
5793 var b=MochiKit.Base;
5794 var s=MochiKit.Style;
5795 _617=d.getElement(_617);
5796 if(!_617.firstChild){
5797 throw "MochiKit.Visual.slideDown must be used on a element with a child";
5799 d.removeEmptyTextNodes(_617);
5800 var _61c=s.getStyle(_617.firstChild,"bottom")||0;
5801 var _61d=s.getElementDimensions(_617);
5803 _618=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_61d.h,originalWidth:_61d.w},restoreAfterFinish:true,afterSetupInternal:function(_61f){
5804 d.makePositioned(_61f.element);
5805 d.makePositioned(_61f.element.firstChild);
5806 if(/Opera/.test(navigator.userAgent)){
5807 s.setStyle(_61f.element,{top:""});
5809 _61e=d.makeClipping(_61f.element);
5810 s.setStyle(_61f.element,{height:"0px"});
5811 s.showElement(_61f.element);
5812 },afterUpdateInternal:function(_620){
5813 s.setStyle(_620.element.firstChild,{bottom:(_620.dims[0]-_620.element.clientHeight)+"px"});
5814 },afterFinishInternal:function(_621){
5815 d.undoClipping(_621.element,_61e);
5816 if(/MSIE/.test(navigator.userAgent)){
5817 d.undoPositioned(_621.element);
5818 d.undoPositioned(_621.element.firstChild);
5820 d.undoPositioned(_621.element.firstChild);
5821 d.undoPositioned(_621.element);
5823 s.setStyle(_621.element.firstChild,{bottom:_61c});
5825 return new MochiKit.Visual.Scale(_617,100,_618);
5827 MochiKit.Visual.slideUp=function(_622,_623){
5829 var b=MochiKit.Base;
5830 var s=MochiKit.Style;
5831 _622=d.getElement(_622);
5832 if(!_622.firstChild){
5833 throw "MochiKit.Visual.slideUp must be used on a element with a child";
5835 d.removeEmptyTextNodes(_622);
5836 var _627=s.getStyle(_622.firstChild,"bottom");
5838 _623=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_629){
5839 d.makePositioned(_629.element);
5840 d.makePositioned(_629.element.firstChild);
5841 if(/Opera/.test(navigator.userAgent)){
5842 s.setStyle(_629.element,{top:""});
5844 _628=d.makeClipping(_629.element);
5845 s.showElement(_629.element);
5846 },afterUpdateInternal:function(_62a){
5847 s.setStyle(_62a.element.firstChild,{bottom:(_62a.dims[0]-_62a.element.clientHeight)+"px"});
5848 },afterFinishInternal:function(_62b){
5849 s.hideElement(_62b.element);
5850 d.undoClipping(_62b.element,_628);
5851 d.undoPositioned(_62b.element.firstChild);
5852 d.undoPositioned(_62b.element);
5853 s.setStyle(_62b.element.firstChild,{bottom:_627});
5855 return new MochiKit.Visual.Scale(_622,0,_623);
5857 MochiKit.Visual.squish=function(_62c,_62d){
5859 var b=MochiKit.Base;
5861 _62d=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_631){
5862 _630=d.makeClipping(_631.element);
5863 },afterFinishInternal:function(_632){
5864 MochiKit.Style.hideElement(_632.element);
5865 d.undoClipping(_632.element,_630);
5867 return new MochiKit.Visual.Scale(_62c,/Opera/.test(navigator.userAgent)?1:0,_62d);
5869 MochiKit.Visual.grow=function(_633,_634){
5871 var v=MochiKit.Visual;
5872 var s=MochiKit.Style;
5873 _633=d.getElement(_633);
5874 _634=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full},_634||{});
5875 var _638={top:_633.style.top,left:_633.style.left,height:_633.style.height,width:_633.style.width,opacity:_633.style.opacity||""};
5876 var dims=s.getElementDimensions(_633);
5879 switch(_634.direction){
5881 _63a=_63b=_63c=_63d=0;
5893 case "bottom-right":
5906 var _63e=MochiKit.Base.update({beforeSetupInternal:function(_63f){
5907 s.setStyle(_63f.effects[0].element,{height:"0px"});
5908 s.showElement(_63f.effects[0].element);
5909 },afterFinishInternal:function(_640){
5910 d.undoClipping(_640.effects[0].element);
5911 d.undoPositioned(_640.effects[0].element);
5912 s.setStyle(_640.effects[0].element,_638);
5914 return new v.Move(_633,{x:_63a,y:_63b,duration:0.01,beforeSetupInternal:function(_641){
5915 s.hideElement(_641.element);
5916 d.makeClipping(_641.element);
5917 d.makePositioned(_641.element);
5918 },afterFinishInternal:function(_642){
5919 new v.Parallel([new v.Opacity(_642.element,{sync:true,to:1,from:0,transition:_634.opacityTransition}),new v.Move(_642.element,{x:_63c,y:_63d,sync:true,transition:_634.moveTransition}),new v.Scale(_642.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_634.scaleTransition,restoreAfterFinish:true})],_63e);
5922 MochiKit.Visual.shrink=function(_643,_644){
5924 var v=MochiKit.Visual;
5925 var s=MochiKit.Style;
5926 _643=d.getElement(_643);
5927 _644=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none},_644||{});
5928 var _648={top:_643.style.top,left:_643.style.left,height:_643.style.height,width:_643.style.width,opacity:_643.style.opacity||""};
5929 var dims=s.getElementDimensions(_643);
5931 switch(_644.direction){
5943 case "bottom-right":
5953 var _64d=MochiKit.Base.update({beforeStartInternal:function(_64e){
5954 _64c=d.makePositioned(_64e.effects[0].element);
5955 d.makeClipping(_64e.effects[0].element);
5956 },afterFinishInternal:function(_64f){
5957 s.hideElement(_64f.effects[0].element);
5958 d.undoClipping(_64f.effects[0].element,_64c);
5959 d.undoPositioned(_64f.effects[0].element);
5960 s.setStyle(_64f.effects[0].element,_648);
5962 return new v.Parallel([new v.Opacity(_643,{sync:true,to:0,from:1,transition:_644.opacityTransition}),new v.Scale(_643,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_644.scaleTransition,restoreAfterFinish:true}),new v.Move(_643,{x:_64a,y:_64b,sync:true,transition:_644.moveTransition})],_64d);
5964 MochiKit.Visual.pulsate=function(_650,_651){
5966 var v=MochiKit.Visual;
5967 var b=MochiKit.Base;
5968 var _655=d.getElement(_650).style.opacity||"";
5969 _651=b.update({duration:3,from:0,afterFinishInternal:function(_656){
5970 MochiKit.Style.setStyle(_656.element,{opacity:_655});
5972 var _657=_651.transition||v.Transitions.sinoidal;
5973 var _658=b.bind(function(pos){
5974 return _657(1-v.Transitions.pulse(pos));
5977 return new v.Opacity(_650,b.update({transition:_658},_651));
5979 MochiKit.Visual.fold=function(_65a,_65b){
5981 var v=MochiKit.Visual;
5982 var s=MochiKit.Style;
5983 _65a=d.getElement(_65a);
5984 var _65f={top:_65a.style.top,left:_65a.style.left,width:_65a.style.width,height:_65a.style.height};
5985 var _660=d.makeClipping(_65a);
5986 _65b=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_661){
5987 new v.Scale(_65a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_662){
5988 s.hideElement(_662.element);
5989 d.undoClipping(_662.element,_660);
5990 s.setStyle(_662.element,_65f);
5993 return new v.Scale(_65a,5,_65b);
5995 MochiKit.Visual.Color=MochiKit.Color.Color;
5996 MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
5997 MochiKit.Visual.__new__=function(){
5998 var m=MochiKit.Base;
5999 m.nameFunctions(this);
6000 this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
6002 MochiKit.Visual.EXPORT=["roundElement","roundClass","tagifyText","multiple","toggle","Base","Parallel","Opacity","Move","Scale","Highlight","ScrollTo","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"];
6003 MochiKit.Visual.EXPORT_OK=["PAIRS"];
6004 MochiKit.Visual.__new__();
6005 MochiKit.Base._exportSymbols(this,MochiKit.Visual);
6006 if(typeof (MochiKit)=="undefined"){
6009 if(typeof (MochiKit.MochiKit)=="undefined"){
6010 MochiKit.MochiKit={};
6012 MochiKit.MochiKit.NAME="MochiKit.MochiKit";
6013 MochiKit.MochiKit.VERSION="1.4";
6014 MochiKit.MochiKit.__repr__=function(){
6015 return "["+this.NAME+" "+this.VERSION+"]";
6017 MochiKit.MochiKit.toString=function(){
6018 return this.__repr__();
6020 MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","Style","LoggingPane","Color","Signal","Visual"];
6021 if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
6022 if(typeof (dojo)!="undefined"){
6023 dojo.provide("MochiKit.MochiKit");
6024 dojo.require("MochiKit.*");
6026 if(typeof (JSAN)!="undefined"){
6028 for(var i=0;i<lst.length;i++){
6029 JSAN.use("MochiKit."+lst[i],[]);
6031 })(MochiKit.MochiKit.SUBMODULES);
6034 var _666=MochiKit.Base.extend;
6035 var self=MochiKit.MochiKit;
6036 var _668=self.SUBMODULES;
6041 for(i=0;i<_668.length;i++){
6042 m=MochiKit[_668[i]];
6043 _666(_669,m.EXPORT);
6044 _666(_66a,m.EXPORT_OK);
6045 for(k in m.EXPORT_TAGS){
6046 _66b[k]=_666(_66b[k],m.EXPORT_TAGS[k]);
6048 all=m.EXPORT_TAGS[":all"];
6050 all=_666(null,m.EXPORT,m.EXPORT_OK);
6053 for(j=0;j<all.length;j++){
6059 self.EXPORT_OK=_66a;
6060 self.EXPORT_TAGS=_66b;
6063 if(typeof (MochiKit.__compat__)=="undefined"){
6064 MochiKit.__compat__=true;
6067 if(typeof (document)=="undefined"){
6070 var _671=document.getElementsByTagName("script");
6071 var _672="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
6076 for(i=0;i<_671.length;i++){
6077 var src=_671[i].getAttribute("src");
6082 if(src.match(/MochiKit.js$/)){
6083 base=src.substring(0,src.lastIndexOf("MochiKit.js"));
6090 var _678=MochiKit.MochiKit.SUBMODULES;
6091 for(var i=0;i<_678.length;i++){
6092 if(MochiKit[_678[i]]){
6095 var uri=base+_678[i]+".js";
6099 if(document.documentElement&&document.documentElement.namespaceURI==_672){
6100 var s=document.createElementNS(_672,"script");
6101 s.setAttribute("id","MochiKit_"+base+_678[i]);
6102 s.setAttribute("src",uri);
6103 s.setAttribute("type","application/x-javascript");
6104 _674.parentNode.appendChild(s);
6106 document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>");