if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Base");
}
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.Base)=="undefined"){
MochiKit.Base={};
}
MochiKit.Base.VERSION="1.3.1";
MochiKit.Base.NAME="MochiKit.Base";
MochiKit.Base.update=function(_1,_2){
if(_1===null){
_1={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="undefined"&&o!==null){
for(var k in o){
_1[k]=o[k];
}
}
}
return _1;
};
MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
return "["+this.NAME+" "+this.VERSION+"]";
},extend:function(_6,_7,_8){
if(!_8){
_8=0;
}
if(_7){
var l=_7.length;
if(typeof (l)!="number"){
if(typeof (MochiKit.Iter)!="undefined"){
_7=MochiKit.Iter.list(_7);
l=_7.length;
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(!_6){
_6=[];
}
for(var i=_8;i<l;i++){
_6.push(_7[i]);
}
}
return _6;
},keys:function(_b){
var _c=[];
for(var _d in _b){
_c.push(_d);
}
return _c;
},operator:{truth:function(a){
return !!a;
},lognot:function(a){
return !a;
},identity:function(a){
return a;
},not:function(a){
return ~a;
},neg:function(a){
return -a;
},add:function(a,b){
return a+b;
},sub:function(a,b){
return a-b;
},div:function(a,b){
return a/b;
},mod:function(a,b){
return a%b;
},mul:function(a,b){
return a*b;
},and:function(a,b){
return a&b;
},or:function(a,b){
return a|b;
},xor:function(a,b){
return a^b;
},lshift:function(a,b){
return a<<b;
},rshift:function(a,b){
return a>>b;
},zrshift:function(a,b){
return a>>>b;
},eq:function(a,b){
return a==b;
},ne:function(a,b){
return a!=b;
},gt:function(a,b){
return a>b;
},ge:function(a,b){
return a>=b;
},lt:function(a,b){
return a<b;
},le:function(a,b){
return a<=b;
},ceq:function(a,b){
return MochiKit.Base.compare(a,b)===0;
},cne:function(a,b){
return MochiKit.Base.compare(a,b)!==0;
},cgt:function(a,b){
return MochiKit.Base.compare(a,b)==1;
},cge:function(a,b){
return MochiKit.Base.compare(a,b)!=-1;
},clt:function(a,b){
return MochiKit.Base.compare(a,b)==-1;
},cle:function(a,b){
return MochiKit.Base.compare(a,b)!=1;
},logand:function(a,b){
return a&&b;
},logor:function(a,b){
return a||b;
},contains:function(a,b){
return b in a;
}},forwardCall:function(_47){
return function(){
return this[_47].apply(this,arguments);
};
},typeMatcher:function(){
var _48={};
for(var i=0;i<arguments.length;i++){
var typ=arguments[i];
_48[typ]=typ;
}
return function(){
for(var i=0;i<arguments.length;i++){
if(!(typeof (arguments[i]) in _48)){
return false;
}
}
return true;
};
},isArrayLike:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
var typ=typeof (o);
if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"){
return false;
}
}
return true;
},map:function(fn,lst){
var m=MochiKit.Base;
var itr=MochiKit.Iter;
var _53=m.isArrayLike;
if(arguments.length<=2){
if(!_53(lst)){
if(itr){
lst=itr.list(lst);
if(fn===null){
return lst;
}
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(fn===null){
return m.extend(null,lst);
}
var _54=[];
for(var i=0;i<lst.length;i++){
_54.push(fn(lst[i]));
}
return _54;
}else{
if(fn===null){
fn=Array;
}
var _56=null;
for(i=1;i<arguments.length;i++){
if(!_53(arguments[i])){
if(itr){
return itr.list(itr.imap.apply(null,arguments));
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
var l=arguments[i].length;
if(_56===null||_56>l){
_56=l;
}
}
_54=[];
for(i=0;i<_56;i++){
var _58=[];
for(var j=1;j<arguments.length;j++){
_58.push(arguments[j][i]);
}
_54.push(fn.apply(this,_58));
}
return _54;
}
},filter:function(fn,lst,_5c){
var _5d=[];
var m=MochiKit.Base;
if(!m.isArrayLike(lst)){
if(MochiKit.Iter){
lst=MochiKit.Iter.list(lst);
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(fn===null){
fn=m.operator.truth;
}
if(typeof (Array.prototype.filter)=="function"){
return Array.prototype.filter.call(lst,fn,_5c);
}else{
if(typeof (_5c)=="undefined"||_5c===null){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(fn(o)){
_5d.push(o);
}
}
}else{
for(i=0;i<lst.length;i++){
o=lst[i];
if(fn.call(_5c,o)){
_5d.push(o);
}
}
}
}
return _5d;
},bind:function(_61,_62){
if(typeof (_61)=="string"){
_61=_62[_61];
}
var _63=_61.im_func;
var _64=_61.im_preargs;
var _65=_61.im_self;
var m=MochiKit.Base;
if(typeof (_61)=="function"&&typeof (_61.apply)=="undefined"){
_61=m._wrapDumbFunction(_61);
}
if(typeof (_63)!="function"){
_63=_61;
}
if(typeof (_62)!="undefined"){
_65=_62;
}
if(typeof (_64)=="undefined"){
_64=[];
}else{
_64=_64.slice();
}
m.extend(_64,arguments,2);
var _67=function(){
var _68=arguments;
var me=arguments.callee;
if(me.im_preargs.length>0){
_68=m.concat(me.im_preargs,_68);
}
var _6a=me.im_self;
if(!_6a){
_6a=this;
}
return me.im_func.apply(_6a,_68);
};
_67.im_self=_65;
_67.im_func=_63;
_67.im_preargs=_64;
return _67;
},registerComparator:function(_6b,_6c,_6d,_6e){
MochiKit.Base.comparatorRegistry.register(_6b,_6c,_6d,_6e);
},_primitives:{"boolean":true,"string":true,"number":true},registerRepr:function(_6f,_70,_71,_72){
MochiKit.Base.reprRegistry.register(_6f,_70,_71,_72);
},repr:function(o){
if(typeof (o)=="undefined"){
return "undefined";
}else{
if(o===null){
return "null";
}
}
try{
if(typeof (o.__repr__)=="function"){
return o.__repr__();
}else{
if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
return o.repr();
}
}
return MochiKit.Base.reprRegistry.match(o);
}
catch(e){
if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
return o.NAME;
}
}
try{
var _74=(o+"");
}
catch(e){
return "["+typeof (o)+"]";
}
if(typeof (o)=="function"){
o=_74.replace(/^\s+/,"");
var idx=o.indexOf("{");
if(idx!=-1){
o=o.substr(0,idx)+"{...}";
}
}
return _74;
},reprString:function(o){
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");
},reprNumber:function(o){
return o+"";
},registerJSON:function(_78,_79,_7a,_7b){
MochiKit.Base.jsonRegistry.register(_78,_79,_7a,_7b);
},evalJSON:function(){
return eval("("+arguments[0]+")");
},serializeJSON:function(o){
var _7d=typeof (o);
if(_7d=="undefined"){
return "undefined";
}else{
if(_7d=="number"||_7d=="boolean"){
return o+"";
}else{
if(o===null){
return "null";
}
}
}
var m=MochiKit.Base;
var _7f=m.reprString;
if(_7d=="string"){
return _7f(o);
}
var me=arguments.callee;
var _81;
if(typeof (o.__json__)=="function"){
_81=o.__json__();
if(o!==_81){
return me(_81);
}
}
if(typeof (o.json)=="function"){
_81=o.json();
if(o!==_81){
return me(_81);
}
}
if(_7d!="function"&&typeof (o.length)=="number"){
var res=[];
for(var i=0;i<o.length;i++){
var val=me(o[i]);
if(typeof (val)!="string"){
val="undefined";
}
res.push(val);
}
return "["+res.join(", ")+"]";
}
try{
_81=m.jsonRegistry.match(o);
return me(_81);
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
if(_7d=="function"){
return null;
}
res=[];
for(var k in o){
var _86;
if(typeof (k)=="number"){
_86="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_86=_7f(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_86+":"+val);
}
return "{"+res.join(", ")+"}";
},concat:function(){
var _87=[];
var _88=MochiKit.Base.extend;
for(var i=0;i<arguments.length;i++){
_88(_87,arguments[i]);
}
return _87;
},partial:function(_8a){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([_8a,undefined],arguments,1));
},listMinMax:function(_8c,lst){
if(lst.length===0){
return null;
}
var cur=lst[0];
var _8f=MochiKit.Base.compare;
for(var i=1;i<lst.length;i++){
var o=lst[i];
if(_8f(o,cur)==_8c){
cur=o;
}
}
return cur;
},nameFunctions:function(_92){
var _93=_92.NAME;
if(typeof (_93)=="undefined"){
_93="";
}else{
_93=_93+".";
}
for(var _94 in _92){
var o=_92[_94];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=_93+_94;
}
catch(e){
}
}
}
},queryString:function(_96,_97){
if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_96)=="string"||(typeof (_96.nodeType)!="undefined"&&_96.nodeType>0))){
var kv=MochiKit.DOM.formContents(_96);
_96=kv[0];
_97=kv[1];
}else{
if(arguments.length==1){
var o=_96;
_96=[];
_97=[];
for(var k in o){
var v=o[k];
if(typeof (v)!="function"){
_96.push(k);
_97.push(v);
}
}
}
}
var _9c=[];
var len=Math.min(_96.length,_97.length);
var _9e=MochiKit.Base.urlEncode;
for(var i=0;i<len;i++){
v=_97[i];
if(typeof (v)!="undefined"&&v!==null){
_9c.push(_9e(_96[i])+"="+_9e(v));
}
}
return _9c.join("&");
}});
MochiKit.Base.AdapterRegistry=function(){
this.pairs=[];
};
MochiKit.Base.AdapterRegistry.prototype={register:function(_a0,_a1,_a2,_a3){
if(_a3){
this.pairs.unshift([_a0,_a1,_a2]);
}else{
this.pairs.push([_a0,_a1,_a2]);
}
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var _a5=this.pairs[i];
if(_a5[1].apply(this,arguments)){
return _a5[2].apply(this,arguments);
}
}
throw MochiKit.Base.NotFound;
},unregister:function(_a6){
for(var i=0;i<this.pairs.length;i++){
var _a8=this.pairs[i];
if(_a8[0]==_a6){
this.pairs.splice(i,1);
return true;
}
}
return false;
}};
MochiKit.Base.EXPORT=["counter","clone","extend","update","updatetree","setdefault","keys","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","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"];
MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
MochiKit.Base._exportSymbols=function(_a9,_aa){
if(typeof (MochiKit.__export__)=="undefined"){
MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
}
if(!MochiKit.__export__){
return;
}
var all=_aa.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_a9[all[i]]=_aa[all[i]];
}
};
MochiKit.Base.__new__=function(){
var m=this;
m.forward=m.forwardCall;
m.find=m.findValue;
if(typeof (encodeURIComponent)!="undefined"){
m.urlEncode=function(_ae){
return encodeURIComponent(_ae).replace(/\'/g,"%27");
};
}else{
m.urlEncode=function(_af){
return escape(_af).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
};
}
m.NamedError=function(_b0){
this.message=_b0;
this.name=_b0;
};
m.NamedError.prototype=new Error();
m.update(m.NamedError.prototype,{repr:function(){
if(this.message&&this.message!=this.name){
return this.name+"("+m.repr(this.message)+")";
}else{
return this.name+"()";
}
},toString:m.forwardCall("repr")});
m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
m.listMax=m.partial(m.listMinMax,1);
m.listMin=m.partial(m.listMinMax,-1);
m.isCallable=m.typeMatcher("function");
m.isUndefined=m.typeMatcher("undefined");
m.merge=m.partial(m.update,null);
m.zip=m.partial(m.map,null);
m.comparatorRegistry=new m.AdapterRegistry();
m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
m.reprRegistry=new m.AdapterRegistry();
m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
m.registerRepr("string",m.typeMatcher("string"),m.reprString);
m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
m.jsonRegistry=new m.AdapterRegistry();
var all=m.concat(m.EXPORT,m.EXPORT_OK);
m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
m.nameFunctions(this);
};
MochiKit.Base.__new__();
if(!MochiKit.__compat__){
compare=MochiKit.Base.compare;
}
MochiKit.Base._exportSymbols(this,MochiKit.Base);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Iter");
dojo.require("MochiKit.Base");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.Iter depends on MochiKit.Base!";
}
if(typeof (MochiKit.Iter)=="undefined"){
MochiKit.Iter={};
}
MochiKit.Iter.NAME="MochiKit.Iter";
MochiKit.Iter.VERSION="1.3.1";
MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
return "["+this.NAME+" "+this.VERSION+"]";
},toString:function(){
return this.__repr__();
},registerIteratorFactory:function(_b2,_b3,_b4,_b5){
MochiKit.Iter.iteratorRegistry.register(_b2,_b3,_b4,_b5);
},iter:function(_b6,_b7){
var _b8=MochiKit.Iter;
if(arguments.length==2){
return _b8.takewhile(function(a){
return a!=_b7;
},_b6);
}
if(typeof (_b6.next)=="function"){
return _b6;
}else{
if(typeof (_b6.iter)=="function"){
return _b6.iter();
}
}
try{
return _b8.iteratorRegistry.match(_b6);
}
catch(e){
var m=MochiKit.Base;
if(e==m.NotFound){
e=new TypeError(typeof (_b6)+": "+m.repr(_b6)+" is not iterable");
}
throw e;
}
},repeat:function(_bb,n){
var m=MochiKit.Base;
if(typeof (n)=="undefined"){
return {repr:function(){
return "repeat("+m.repr(_bb)+")";
},toString:m.forwardCall("repr"),next:function(){
return _bb;
}};
}
return {repr:function(){
return "repeat("+m.repr(_bb)+", "+n+")";
},toString:m.forwardCall("repr"),next:function(){
if(n<=0){
throw MochiKit.Iter.StopIteration;
}
n-=1;
return _bb;
}};
},next:function(_be){
return _be.next();
},imap:function(fun,p,q){
var m=MochiKit.Base;
var _c3=MochiKit.Iter;
var _c4=m.map(_c3.iter,m.extend(null,arguments,1));
var map=m.map;
var _c6=_c3.next;
return {repr:function(){
return "imap(...)";
},toString:m.forwardCall("repr"),next:function(){
return fun.apply(this,map(_c6,_c4));
}};
},list:function(_c7){
var m=MochiKit.Base;
if(typeof (_c7.slice)=="function"){
return _c7.slice();
}else{
if(m.isArrayLike(_c7)){
return m.concat(_c7);
}
}
var _c9=MochiKit.Iter;
_c7=_c9.iter(_c7);
var _ca=[];
try{
while(true){
_ca.push(_c7.next());
}
}
catch(e){
if(e!=_c9.StopIteration){
throw e;
}
return _ca;
}
return undefined;
},forEach:function(_cb,_cc,_cd){
var m=MochiKit.Base;
if(arguments.length>2){
_cc=m.bind(_cc,_cd);
}
if(m.isArrayLike(_cb)){
try{
for(var i=0;i<_cb.length;i++){
_cc(_cb[i]);
}
}
catch(e){
if(e!=MochiKit.Iter.StopIteration){
throw e;
}
}
}else{
_cd=MochiKit.Iter;
_cd.exhaust(_cd.imap(_cc,_cb));
}
},arrayLikeIter:function(_d0){
var i=0;
return {repr:function(){
return "arrayLikeIter(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
if(i>=_d0.length){
throw MochiKit.Iter.StopIteration;
}
return _d0[i++];
}};
}});
MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter",];
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"];
MochiKit.Iter.__new__=function(){
var m=MochiKit.Base;
this.StopIteration=new m.NamedError("StopIteration");
this.iteratorRegistry=new m.AdapterRegistry();
this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Iter.__new__();
if(!MochiKit.__compat__){
reduce=MochiKit.Iter.reduce;
}
MochiKit.Base._exportSymbols(this,MochiKit.Iter);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.DOM");
dojo.require("MochiKit.Iter");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Iter",[]);
}
try{
if(typeof (MochiKit.Iter)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.DOM depends on MochiKit.Iter!";
}
if(typeof (MochiKit.DOM)=="undefined"){
MochiKit.DOM={};
}
MochiKit.DOM.NAME="MochiKit.DOM";
MochiKit.DOM.VERSION="1.3.1";
MochiKit.DOM.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.DOM.toString=function(){
return this.__repr__();
};
MochiKit.DOM.EXPORT=["formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","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","$","computedStyle","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","setDisplayForElement","hideElement","showElement","scrapeText","elementDimensions","elementPosition","setElementDimensions","setElementPosition","getViewportDimensions","setOpacity"];
MochiKit.DOM.EXPORT_OK=["domConverters"];
MochiKit.DOM.Dimensions=function(w,h){
this.w=w;
this.h=h;
};
MochiKit.DOM.Dimensions.prototype.repr=function(){
var _d5=MochiKit.Base.repr;
return "{w: "+_d5(this.w)+", h: "+_d5(this.h)+"}";
};
MochiKit.DOM.Coordinates=function(x,y){
this.x=x;
this.y=y;
};
MochiKit.DOM.Coordinates.prototype.repr=function(){
var _d8=MochiKit.Base.repr;
return "{x: "+_d8(this.x)+", y: "+_d8(this.y)+"}";
};
MochiKit.DOM.Coordinates.prototype.toString=function(){
return this.repr();
};
MochiKit.Base.update(MochiKit.DOM,{coerceToDOM:function(_d9,ctx){
var im=MochiKit.Iter;
var _dc=MochiKit.DOM;
var _dd=im.iter;
var _de=im.repeat;
var _df=im.imap;
var _e0=_dc.domConverters;
var _e1=_dc.coerceToDOM;
var _e2=MochiKit.Base.NotFound;
while(true){
if(typeof (_d9)=="undefined"||_d9===null){
return null;
}
if(typeof (_d9.nodeType)!="undefined"&&_d9.nodeType>0){
return _d9;
}
if(typeof (_d9)=="number"||typeof (_d9)=="boolean"){
_d9=_d9.toString();
}
if(typeof (_d9)=="string"){
return _dc._document.createTextNode(_d9);
}
if(typeof (_d9.toDOM)=="function"){
_d9=_d9.toDOM(ctx);
continue;
}
if(typeof (_d9)=="function"){
_d9=_d9(ctx);
continue;
}
var _e3=null;
try{
_e3=_dd(_d9);
}
catch(e){
}
if(_e3){
return _df(_e1,_e3,_de(ctx));
}
try{
_d9=_e0.match(_d9,ctx);
continue;
}
catch(e){
if(e!=_e2){
throw e;
}
}
return _dc._document.createTextNode(_d9.toString());
}
return undefined;
},updateNodeAttributes:function(_e4,_e5){
var _e6=_e4;
var _e7=MochiKit.DOM;
if(typeof (_e4)=="string"){
_e6=_e7.getElement(_e4);
}
if(_e5){
var _e8=MochiKit.Base.updatetree;
if(_e7.attributeArray.compliant){
for(var k in _e5){
var v=_e5[k];
if(typeof (v)=="object"&&typeof (_e6[k])=="object"){
_e8(_e6[k],v);
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
_e6[k]=v;
}else{
_e6.setAttribute(k,v);
}
}
}
}else{
var _eb=_e7.attributeArray.renames;
for(k in _e5){
v=_e5[k];
var _ec=_eb[k];
if(k=="style"&&typeof (v)=="string"){
_e6.style.cssText=v;
}else{
if(typeof (_ec)=="string"){
_e6[_ec]=v;
}else{
if(typeof (_e6[k])=="object"&&typeof (v)=="object"){
_e8(_e6[k],v);
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
_e6[k]=v;
}else{
_e6.setAttribute(k,v);
}
}
}
}
}
}
}
return _e6;
},appendChildNodes:function(_ed){
var _ee=_ed;
var _ef=MochiKit.DOM;
if(typeof (_ed)=="string"){
_ee=_ef.getElement(_ed);
}
var _f0=[_ef.coerceToDOM(MochiKit.Base.extend(null,arguments,1),_ee)];
var _f1=MochiKit.Base.concat;
while(_f0.length){
var n=_f0.shift();
if(typeof (n)=="undefined"||n===null){
}else{
if(typeof (n.nodeType)=="number"){
_ee.appendChild(n);
}else{
_f0=_f1(n,_f0);
}
}
}
return _ee;
},replaceChildNodes:function(_f3){
var _f4=_f3;
var _f5=MochiKit.DOM;
if(typeof (_f3)=="string"){
_f4=_f5.getElement(_f3);
arguments[0]=_f4;
}
var _f6;
while((_f6=_f4.firstChild)){
_f4.removeChild(_f6);
}
if(arguments.length<2){
return _f4;
}else{
return _f5.appendChildNodes.apply(this,arguments);
}
},createDOM:function(_f7,_f8){
var _f9;
var _fa=MochiKit.DOM;
var m=MochiKit.Base;
if(typeof (_f8)=="string"||typeof (_f8)=="number"){
var _fc=m.extend([_f7,null],arguments,1);
return arguments.callee.apply(this,_fc);
}
if(typeof (_f7)=="string"){
if(_f8&&"name" in _f8&&!_fa.attributeArray.compliant){
_f7=("<"+_f7+" name=\""+_fa.escapeHTML(_f8.name)+"\">");
}
_f9=_fa._document.createElement(_f7);
}else{
_f9=_f7;
}
if(_f8){
_fa.updateNodeAttributes(_f9,_f8);
}
if(arguments.length<=2){
return _f9;
}else{
var _fc=m.extend([_f9],arguments,2);
return _fa.appendChildNodes.apply(this,_fc);
}
},createDOMFunc:function(){
var m=MochiKit.Base;
return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
},getElement:function(id){
var _ff=MochiKit.DOM;
if(arguments.length==1){
return ((typeof (id)=="string")?_ff._document.getElementById(id):id);
}else{
return MochiKit.Base.map(_ff.getElement,arguments);
}
},getElementsByTagAndClassName:function(_100,_101,_102){
var self=MochiKit.DOM;
if(typeof (_100)=="undefined"||_100===null){
_100="*";
}
if(typeof (_102)=="undefined"||_102===null){
_102=self._document;
}
_102=self.getElement(_102);
var _104=(_102.getElementsByTagName(_100)||self._document.all);
if(typeof (_101)=="undefined"||_101===null){
return MochiKit.Base.extend(null,_104);
}
var _105=[];
for(var i=0;i<_104.length;i++){
var _107=_104[i];
var _108=_107.className.split(" ");
for(var j=0;j<_108.length;j++){
if(_108[j]==_101){
_105.push(_107);
break;
}
}
}
return _105;
},_newCallStack:function(path,once){
var rval=function(){
var _10d=arguments.callee.callStack;
for(var i=0;i<_10d.length;i++){
if(_10d[i].apply(this,arguments)===false){
break;
}
}
if(once){
try{
this[path]=null;
}
catch(e){
}
}
};
rval.callStack=[];
return rval;
},addToCallStack:function(_10f,path,func,once){
var self=MochiKit.DOM;
var _114=_10f[path];
var _115=_114;
if(!(typeof (_114)=="function"&&typeof (_114.callStack)=="object"&&_114.callStack!==null)){
_115=self._newCallStack(path,once);
if(typeof (_114)=="function"){
_115.callStack.push(_114);
}
_10f[path]=_115;
}
_115.callStack.push(func);
},addLoadEvent:function(func){
var self=MochiKit.DOM;
self.addToCallStack(self._window,"onload",func,true);
},setElementClass:function(_118,_119){
var self=MochiKit.DOM;
var obj=self.getElement(_118);
if(self.attributeArray.compliant){
obj.setAttribute("class",_119);
}else{
obj.setAttribute("className",_119);
}
},addElementClass:function(_11c,_11d){
var self=MochiKit.DOM;
var obj=self.getElement(_11c);
var cls=obj.className;
if(cls.length===0){
self.setElementClass(obj,_11d);
return true;
}
if(cls==_11d){
return false;
}
var _121=obj.className.split(" ");
for(var i=0;i<_121.length;i++){
if(_121[i]==_11d){
return false;
}
}
self.setElementClass(obj,cls+" "+_11d);
return true;
},removeElementClass:function(_123,_124){
var self=MochiKit.DOM;
var obj=self.getElement(_123);
var cls=obj.className;
if(cls.length===0){
return false;
}
if(cls==_124){
self.setElementClass(obj,"");
return true;
}
var _128=obj.className.split(" ");
for(var i=0;i<_128.length;i++){
if(_128[i]==_124){
_128.splice(i,1);
self.setElementClass(obj,_128.join(" "));
return true;
}
}
return false;
},hasElementClass:function(_12a,_12b){
var obj=MochiKit.DOM.getElement(_12a);
var _12d=obj.className.split(" ");
for(var i=1;i<arguments.length;i++){
var good=false;
for(var j=0;j<_12d.length;j++){
if(_12d[j]==arguments[i]){
good=true;
break;
}
}
if(!good){
return false;
}
}
return true;
},escapeHTML:function(s){
return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},setDisplayForElement:function(_132,_133){
var m=MochiKit.Base;
var _135=m.extend(null,arguments,1);
MochiKit.Iter.forEach(m.filter(null,m.map(MochiKit.DOM.getElement,_135)),function(_136){
_136.style.display=_132;
});
},__new__:function(win){
var m=MochiKit.Base;
this._document=document;
this._window=win;
this.domConverters=new m.AdapterRegistry();
var _139=this._document.createElement("span");
var _13a;
if(_139&&_139.attributes&&_139.attributes.length>0){
var _13b=m.filter;
_13a=function(node){
return _13b(_13a.ignoreAttrFilter,node.attributes);
};
_13a.ignoreAttr={};
MochiKit.Iter.forEach(_139.attributes,function(a){
_13a.ignoreAttr[a.name]=a.value;
});
_13a.ignoreAttrFilter=function(a){
return (_13a.ignoreAttr[a.name]!=a.value);
};
_13a.compliant=false;
_13a.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor"};
}else{
_13a=function(node){
return node.attributes;
};
_13a.compliant=true;
_13a.renames={};
}
this.attributeArray=_13a;
var _140=this.createDOMFunc;
this.UL=_140("ul");
this.OL=_140("ol");
this.LI=_140("li");
this.TD=_140("td");
this.TR=_140("tr");
this.TBODY=_140("tbody");
this.THEAD=_140("thead");
this.TFOOT=_140("tfoot");
this.TABLE=_140("table");
this.TH=_140("th");
this.INPUT=_140("input");
this.SPAN=_140("span");
this.A=_140("a");
this.DIV=_140("div");
this.IMG=_140("img");
this.BUTTON=_140("button");
this.TT=_140("tt");
this.PRE=_140("pre");
this.H1=_140("h1");
this.H2=_140("h2");
this.H3=_140("h3");
this.BR=_140("br");
this.HR=_140("hr");
this.LABEL=_140("label");
this.TEXTAREA=_140("textarea");
this.FORM=_140("form");
this.P=_140("p");
this.SELECT=_140("select");
this.OPTION=_140("option");
this.OPTGROUP=_140("optgroup");
this.LEGEND=_140("legend");
this.FIELDSET=_140("fieldset");
this.STRONG=_140("strong");
this.CANVAS=_140("canvas");
this.hideElement=m.partial(this.setDisplayForElement,"none");
this.showElement=m.partial(this.setDisplayForElement,"block");
this.removeElement=this.swapDOM;
this.$=this.getElement;
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
}});
MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
if(!MochiKit.__compat__){
withWindow=MochiKit.DOM.withWindow;
withDocument=MochiKit.DOM.withDocument;
}
MochiKit.Base._exportSymbols(this,MochiKit.DOM);

