/***

    MochiKit.MochiKit 1.2 : PACKED VERSION

    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
    diff against the source tree, not this file.

    See <http://mochikit.com/> for documentation, downloads, license, etc.

    (c) 2005 Bob Ippolito.  All rights Reserved.

***/

if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Base");
}
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.Base)=="undefined"){
MochiKit.Base={};
}
MochiKit.Base.VERSION="1.2";
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+"]";
},toString:function(){
return this.__repr__();
},counter:function(n){
if(arguments.length==0){
n=1;
}
return function(){
return n++;
};
},clone:function(_7){
var me=arguments.callee;
if(arguments.length==1){
me.prototype=_7;
return new me();
}
},extend:function(_9,obj,_11){
if(!_11){
_11=0;
}
if(obj){
var l=obj.length;
if(typeof (l)!="number"){
if(typeof (MochiKit.Iter)!="undefined"){
obj=MochiKit.Iter.list(obj);
l=obj.length;
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(!_9){
_9=[];
}
for(var i=_11;i<l;i++){
_9.push(obj[i]);
}
}
return _9;
},updatetree:function(_13,obj){
if(_13==null){
_13={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="undefined"&&o!=null){
for(var k in o){
var v=o[k];
if(typeof (_13[k])=="object"&&typeof (v)=="object"){
arguments.callee(_13[k],v);
}else{
_13[k]=v;
}
}
}
}
return _13;
},setdefault:function(_15,obj){
if(_15==null){
_15={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
for(var k in o){
if(!(k in _15)){
_15[k]=o[k];
}
}
}
return _15;
},keys:function(obj){
var _16=[];
for(var _17 in obj){
_16.push(_17);
}
return _16;
},items:function(obj){
var _18=[];
var e;
for(var _20 in obj){
var v;
try{
v=obj[_20];
}
catch(e){
continue;
}
_18.push([_20,v]);
}
return _18;
},_newNamedError:function(_21,_22,_23){
_23.prototype=new MochiKit.Base.NamedError(_21.NAME+"."+_22);
_21[_22]=_23;
},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;
}},forward:function(_26){
return function(){
return this[_26].apply(this,arguments);
};
},itemgetter:function(_27){
return function(arg){
return arg[_27];
};
},typeMatcher:function(){
var _29={};
for(var i=0;i<arguments.length;i++){
var typ=arguments[i];
_29[typ]=typ;
}
return function(){
for(var i=0;i<arguments.length;i++){
if(!(typeof (arguments[i]) in _29)){
return false;
}
}
return true;
};
},isNull:function(){
for(var i=0;i<arguments.length;i++){
if(arguments[i]!=null){
return false;
}
}
return true;
},isUndefinedOrNull:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(!(typeof (o)=="undefined"||o==null)){
return false;
}
}
return true;
},isNotEmpty:function(obj){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(!(o&&o.length)){
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;
},isDateLike:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="object"||typeof (o.getTime)!="function"){
return false;
}
}
return true;
},xmap:function(fn){
if(fn==null){
return MochiKit.Base.extend(null,arguments,1);
}
var _32=[];
for(var i=1;i<arguments.length;i++){
_32.push(fn(arguments[i]));
}
return _32;
},map:function(fn,lst){
var m=MochiKit.Base;
var _35=m.isArrayLike;
if(arguments.length<=2){
if(!_35(lst)){
if(MochiKit.Iter){
lst=MochiKit.Iter.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 _36=[];
for(var i=0;i<lst.length;i++){
_36.push(fn(lst[i]));
}
return _36;
}else{
if(fn==null){
fn=Array;
}
var _37=null;
for(i=1;i<arguments.length;i++){
if(!_35(arguments[i])){
if(MochiKit.Iter){
arguments[i]=MochiKit.Iter.list(arguments[i]);
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
var l=arguments[i].length;
if(_37==null||_37>l){
_37=l;
}
}
_36=[];
for(i=0;i<_37;i++){
var _38=[];
for(var j=1;j<arguments.length;j++){
_38.push(arguments[j][i]);
}
_36.push(fn.apply(this,_38));
}
return _36;
}
},xfilter:function(fn){
var _40=[];
if(fn==null){
fn=MochiKit.Base.operator.truth;
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(fn(o)){
_40.push(o);
}
}
return _40;
},filter:function(fn,lst,_41){
var _42=[];
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,_41);
}else{
if(typeof (_41)=="undefined"||_41==null){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(fn(o)){
_42.push(o);
}
}
}else{
for(i=0;i<lst.length;i++){
o=lst[i];
if(fn.call(_41,o)){
_42.push(o);
}
}
}
}
return _42;
},_wrapDumbFunction:function(_43){
return function(){
switch(arguments.length){
case 0:
return _43();
case 1:
return _43(arguments[0]);
case 2:
return _43(arguments[0],arguments[1]);
case 3:
return _43(arguments[0],arguments[1],arguments[2]);
}
var _44=[];
for(var i=0;i<arguments.length;i++){
_44.push("arguments["+i+"]");
}
return eval("(func("+_44.join(",")+"))");
};
},bind:function(_45,_46){
if(typeof (_45)=="string"){
_45=_46[_45];
}
var _47=_45.im_func;
var _48=_45.im_preargs;
var _49=_45.im_self;
var m=MochiKit.Base;
if(typeof (_45)=="function"&&typeof (_45.apply)=="undefined"){
_45=m._wrapDumbFunction(_45);
}
if(typeof (_47)!="function"){
_47=_45;
}
if(typeof (_46)!="undefined"){
_49=_46;
}
if(typeof (_48)=="undefined"){
_48=[];
}else{
_48=_48.slice();
}
m.extend(_48,arguments,2);
var _50=function(){
var _51=arguments;
var me=arguments.callee;
if(me.im_preargs.length>0){
_51=m.concat(me.im_preargs,_51);
}
var _46=me.im_self;
if(!_46){
_46=this;
}
return me.im_func.apply(_46,_51);
};
_50.im_self=_49;
_50.im_func=_47;
_50.im_preargs=_48;
return _50;
},bindMethods:function(_52){
var _53=MochiKit.Base.bind;
for(var k in _52){
var _54=_52[k];
if(typeof (_54)=="function"){
_52[k]=_53(_54,_52);
}
}
},registerComparator:function(_55,_56,_57,_58){
MochiKit.Base.comparatorRegistry.register(_55,_56,_57,_58);
},_primitives:{"bool":true,"string":true,"number":true},compare:function(a,b){
if(a==b){
return 0;
}
var _59=(typeof (a)=="undefined"||a==null);
var _60=(typeof (b)=="undefined"||b==null);
if(_59&&_60){
return 0;
}else{
if(_59){
return -1;
}else{
if(_60){
return 1;
}
}
}
var m=MochiKit.Base;
var _61=m._primitives;
if(!(typeof (a) in _61&&typeof (b) in _61)){
try{
return m.comparatorRegistry.match(a,b);
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
}
if(a<b){
return -1;
}else{
if(a>b){
return 1;
}
}
var _62=m.repr;
throw new TypeError(_62(a)+" and "+_62(b)+" can not be compared");
},compareDateLike:function(a,b){
return MochiKit.Base.compare(a.getTime(),b.getTime());
},compareArrayLike:function(a,b){
var _63=MochiKit.Base.compare;
var _64=a.length;
var _65=0;
if(_64>b.length){
_65=1;
_64=b.length;
}else{
if(_64<b.length){
_65=-1;
}
}
for(var i=0;i<_64;i++){
var cmp=_63(a[i],b[i]);
if(cmp){
return cmp;
}
}
return _65;
},registerRepr:function(_67,_68,_69,_70){
MochiKit.Base.reprRegistry.register(_67,_68,_69,_70);
},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 _71=(o+"");
}
catch(e){
return "["+typeof (o)+"]";
}
if(typeof (o)=="function"){
o=_71.replace(/^\s+/,"");
var idx=o.indexOf("{");
if(idx!=-1){
o=o.substr(0,idx)+"{...}";
}
}
return _71;
},reprArrayLike:function(o){
var m=MochiKit.Base;
return "["+m.map(m.repr,o).join(", ")+"]";
},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(_73,_74,_75,_76){
MochiKit.Base.jsonRegistry.register(_73,_74,_75,_76);
},evalJSON:function(){
return eval("("+arguments[0]+")");
},serializeJSON:function(o){
var _77=typeof (o);
if(_77=="undefined"){
return "undefined";
}else{
if(_77=="number"||_77=="boolean"){
return o+"";
}else{
if(o===null){
return "null";
}
}
}
var m=MochiKit.Base;
var _78=m.reprString;
if(_77=="string"){
return _78(o);
}
var me=arguments.callee;
var _79;
if(typeof (o.__json__)=="function"){
_79=o.__json__();
if(o!==_79){
return me(_79);
}
}
if(typeof (o.json)=="function"){
_79=o.json();
if(o!==_79){
return me(_79);
}
}
if(_77!="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{
_79=m.jsonRegistry.match(o);
return me(_79);
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
if(_77=="function"){
return null;
}
res=[];
for(var k in o){
var _82;
if(typeof (k)=="number"){
_82="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_82=_78(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_82+":"+val);
}
return "{"+res.join(", ")+"}";
},objEqual:function(a,b){
return (MochiKit.Base.compare(a,b)==0);
},arrayEqual:function(_83,arr){
if(_83.length!=arr.length){
return false;
}
return (MochiKit.Base.compare(_83,arr)==0);
},concat:function(){
var _85=[];
var _86=MochiKit.Base.extend;
for(var i=0;i<arguments.length;i++){
_86(_85,arguments[i]);
}
return _85;
},keyComparator:function(key){
var m=MochiKit.Base;
var _88=m.compare;
if(arguments.length==1){
return function(a,b){
return _88(a[key],b[key]);
};
}
var _89=m.extend(null,arguments);
return function(a,b){
var _90=0;
for(var i=0;(_90==0)&&(i<_89.length);i++){
var key=_89[i];
_90=_88(a[key],b[key]);
}
return _90;
};
},reverseKeyComparator:function(key){
var _91=MochiKit.Base.keyComparator.apply(this,arguments);
return function(a,b){
return _91(b,a);
};
},partial:function(_92){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([_92,undefined],arguments,1));
},listMinMax:function(_93,lst){
if(lst.length==0){
return null;
}
var cur=lst[0];
var _95=MochiKit.Base.compare;
for(var i=1;i<lst.length;i++){
var o=lst[i];
if(_95(o,cur)==_93){
cur=o;
}
}
return cur;
},objMax:function(){
return MochiKit.Base.listMinMax(1,arguments);
},objMin:function(){
return MochiKit.Base.listMinMax(-1,arguments);
},findIdentical:function(lst,_96,_97,end){
if(typeof (end)=="undefined"||end==null){
end=lst.length;
}
for(var i=(_97||0);i<end;i++){
if(lst[i]===_96){
return i;
}
}
return -1;
},find:function(lst,_99,_100,end){
if(typeof (end)=="undefined"||end==null){
end=lst.length;
}
var cmp=MochiKit.Base.compare;
for(var i=(_100||0);i<end;i++){
if(cmp(lst[i],_99)==0){
return i;
}
}
return -1;
},nodeWalk:function(node,_102){
var _103=[node];
var _104=MochiKit.Base.extend;
while(_103.length){
var res=_102(_103.shift());
if(res){
_104(_103,res);
}
}
},nameFunctions:function(_105){
var base=_105.NAME;
if(typeof (base)=="undefined"){
base="";
}else{
base=base+".";
}
for(var name in _105){
var o=_105[name];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=base+name;
}
catch(e){
}
}
}
},queryString:function(_108,_109){
if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_108)=="string"||(typeof (_108.nodeType)!="undefined"&&_108.nodeType>0))){
var kv=MochiKit.DOM.formContents(_108);
_108=kv[0];
_109=kv[1];
}else{
if(arguments.length==1){
var o=_108;
_108=[];
_109=[];
for(var k in o){
var v=o[k];
if(typeof (v)!="function"){
_108.push(k);
_109.push(v);
}
}
}
}
var rval=[];
var len=Math.min(_108.length,_109.length);
var _113=MochiKit.Base.urlEncode;
for(var i=0;i<len;i++){
v=_109[i];
if(typeof (v)!="undefined"&&v!=null){
rval.push(_113(_108[i])+"="+_113(v));
}
}
return rval.join("&");
},parseQueryString:function(_114,_115){
var _116=_114.replace(/\+/g,"%20").split("&");
var o={};
var _117;
if(typeof (decodeURIComponent)!="undefined"){
_117=decodeURIComponent;
}else{
_117=unescape;
}
if(_115){
for(var i=0;i<_116.length;i++){
var pair=_116[i].split("=");
var name=_117(pair[0]);
var arr=o[name];
if(!(arr instanceof Array)){
arr=[];
o[name]=arr;
}
arr.push(_117(pair[1]));
}
}else{
for(i=0;i<_116.length;i++){
pair=_116[i].split("=");
o[_117(pair[0])]=_117(pair[1]);
}
}
return o;
}});
MochiKit.Base.AdapterRegistry=function(){
this.pairs=[];
};
MochiKit.Base.AdapterRegistry.prototype={register:function(name,_119,wrap,_121){
if(_121){
this.pairs.unshift([name,_119,wrap]);
}else{
this.pairs.push([name,_119,wrap]);
}
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[1].apply(this,arguments)){
return pair[2].apply(this,arguments);
}
}
throw MochiKit.Base.NotFound;
},unregister:function(name){
for(var i=0;i<this.pairs.length;i++){
var pair=this.pairs[i];
if(pair[0]==name){
this.pairs.splice(i,1);
return true;
}
}
return false;
}};
MochiKit.Base.EXPORT=["counter","clone","extend","update","updatetree","setdefault","keys","items","NamedError","operator","forward","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","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","find","findIdentical"];
MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
MochiKit.Base._exportSymbols=function(_122,_123){
if(typeof (MochiKit.__export__)=="undefined"){
MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
}
if(!MochiKit.__export__){
return;
}
var all=_123.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_122[all[i]]=_123[all[i]];
}
};
MochiKit.Base.__new__=function(){
var m=this;
if(typeof (encodeURIComponent)!="undefined"){
m.urlEncode=function(_125){
return encodeURIComponent(_125).replace(/\'/g,"%27");
};
}else{
m.urlEncode=function(_126){
return escape(_126).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
};
}
m.NamedError=function(name){
this.message=name;
this.name=name;
};
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.forward("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__();
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.2";
MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
return "["+this.NAME+" "+this.VERSION+"]";
},toString:function(){
return this.__repr__();
},registerIteratorFactory:function(name,_127,_128,_129){
MochiKit.Iter.iteratorRegistry.register(name,_127,_128,_129);
},iter:function(_130,_131){
var self=MochiKit.Iter;
if(arguments.length==2){
return self.takewhile(function(a){
return a!=_131;
},_130);
}
if(typeof (_130.next)=="function"){
return _130;
}else{
if(typeof (_130.iter)=="function"){
return _130.iter();
}
}
try{
return self.iteratorRegistry.match(_130);
}
catch(e){
var m=MochiKit.Base;
if(e==m.NotFound){
e=new TypeError(typeof (_130)+": "+m.repr(_130)+" is not iterable");
}
throw e;
}
},count:function(n){
if(!n){
n=0;
}
var m=MochiKit.Base;
return {repr:function(){
return "count("+n+")";
},toString:m.forward("repr"),next:m.counter(n)};
},cycle:function(p){
var self=MochiKit.Iter;
var m=MochiKit.Base;
var lst=[];
var _134=self.iter(p);
return {repr:function(){
return "cycle(...)";
},toString:m.forward("repr"),next:function(){
try{
var rval=_134.next();
lst.push(rval);
return rval;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
if(lst.length==0){
this.next=function(){
throw self.StopIteration;
};
}else{
var i=-1;
this.next=function(){
i=(i+1)%lst.length;
return lst[i];
};
}
return this.next();
}
}};
},repeat:function(elem,n){
var m=MochiKit.Base;
if(typeof (n)=="undefined"){
return {repr:function(){
return "repeat("+m.repr(elem)+")";
},toString:m.forward("repr"),next:function(){
return elem;
}};
}
return {repr:function(){
return "repeat("+m.repr(elem)+", "+n+")";
},toString:m.forward("repr"),next:function(){
if(n<=0){
throw MochiKit.Iter.StopIteration;
}
n-=1;
return elem;
}};
},next:function(_136){
return _136.next();
},izip:function(p,q){
var m=MochiKit.Base;
var next=MochiKit.Iter.next;
var _139=m.map(iter,arguments);
return {repr:function(){
return "izip(...)";
},toString:m.forward("repr"),next:function(){
return m.map(next,_139);
}};
},ifilter:function(pred,seq){
var m=MochiKit.Base;
seq=MochiKit.Iter.iter(seq);
if(pred==null){
pred=m.operator.truth;
}
return {repr:function(){
return "ifilter(...)";
},toString:m.forward("repr"),next:function(){
while(true){
var rval=seq.next();
if(pred(rval)){
return rval;
}
}
return undefined;
}};
},ifilterfalse:function(pred,seq){
var m=MochiKit.Base;
seq=MochiKit.Iter.iter(seq);
if(pred==null){
pred=m.operator.truth;
}
return {repr:function(){
return "ifilterfalse(...)";
},toString:m.forward("repr"),next:function(){
while(true){
var rval=seq.next();
if(!pred(rval)){
return rval;
}
}
return undefined;
}};
},islice:function(seq){
var self=MochiKit.Iter;
var m=MochiKit.Base;
seq=self.iter(seq);
var _142=0;
var stop=0;
var step=1;
var i=-1;
if(arguments.length==2){
stop=arguments[1];
}else{
if(arguments.length==3){
_142=arguments[1];
stop=arguments[2];
}else{
_142=arguments[1];
stop=arguments[2];
step=arguments[3];
}
}
return {repr:function(){
return "islice("+["...",_142,stop,step].join(", ")+")";
},toString:m.forward("repr"),next:function(){
var rval;
while(i<_142){
rval=seq.next();
i++;
}
if(_142>=stop){
throw self.StopIteration;
}
_142+=step;
return rval;
}};
},imap:function(fun,p,q){
var m=MochiKit.Base;
var self=MochiKit.Iter;
var _146=m.map(self.iter,m.extend(null,arguments,1));
var map=m.map;
var next=self.next;
return {repr:function(){
return "imap(...)";
},toString:m.forward("repr"),next:function(){
return fun.apply(this,map(next,_146));
}};
},applymap:function(fun,seq,self){
seq=MochiKit.Iter.iter(seq);
var m=MochiKit.Base;
return {repr:function(){
return "applymap(...)";
},toString:m.forward("repr"),next:function(){
return fun.apply(self,seq.next());
}};
},chain:function(p,q){
var self=MochiKit.Iter;
var m=MochiKit.Base;
if(arguments.length==1){
return self.iter(arguments[0]);
}
var _148=m.map(self.iter,arguments);
return {repr:function(){
return "chain(...)";
},toString:m.forward("repr"),next:function(){
while(_148.length>1){
try{
return _148[0].next();
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
_148.shift();
}
}
if(_148.length==1){
var arg=_148.shift();
this.next=m.bind("next",arg);
return this.next();
}
throw self.StopIteration;
}};
},takewhile:function(pred,seq){
var self=MochiKit.Iter;
seq=self.iter(seq);
return {repr:function(){
return "takewhile(...)";
},toString:MochiKit.Base.forward("repr"),next:function(){
var rval=seq.next();
if(!pred(rval)){
this.next=function(){
throw self.StopIteration;
};
this.next();
}
return rval;
}};
},dropwhile:function(pred,seq){
seq=MochiKit.Iter.iter(seq);
var m=MochiKit.Base;
var bind=m.bind;
return {"repr":function(){
return "dropwhile(...)";
},"toString":m.forward("repr"),"next":function(){
while(true){
var rval=seq.next();
if(!pred(rval)){
break;
}
}
this.next=bind("next",seq);
return rval;
}};
},_tee:function(_150,sync,_152){
sync.pos[_150]=-1;
var m=MochiKit.Base;
var _153=m.listMin;
return {repr:function(){
return "tee("+_150+", ...)";
},toString:m.forward("repr"),next:function(){
var rval;
var i=sync.pos[_150];
if(i==sync.max){
rval=_152.next();
sync.deque.push(rval);
sync.max+=1;
sync.pos[_150]+=1;
}else{
rval=sync.deque[i-sync.min];
sync.pos[_150]+=1;
if(i==sync.min&&_153(sync.pos)!=sync.min){
sync.min+=1;
sync.deque.shift();
}
}
return rval;
}};
},tee:function(_154,n){
var rval=[];
var sync={"pos":[],"deque":[],"max":-1,"min":-1};
if(arguments.length==1){
n=2;
}
var self=MochiKit.Iter;
_154=self.iter(_154);
var _tee=self._tee;
for(var i=0;i<n;i++){
rval.push(_tee(i,sync,_154));
}
return rval;
},list:function(_156){
var m=MochiKit.Base;
if(typeof (_156.slice)=="function"){
return _156.slice();
}else{
if(m.isArrayLike(_156)){
return m.concat(_156);
}
}
var self=MochiKit.Iter;
_156=self.iter(_156);
var rval=[];
try{
while(true){
rval.push(_156.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return rval;
}
return undefined;
},reduce:function(fn,_157,_158){
var i=0;
var x=_158;
var self=MochiKit.Iter;
_157=self.iter(_157);
if(arguments.length<3){
try{
x=_157.next();
}
catch(e){
if(e==self.StopIteration){
e=new TypeError("reduce() of empty sequence with no initial value");
}
throw e;
}
i++;
}
try{
while(true){
x=fn(x,_157.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},range:function(){
var _160=0;
var stop=0;
var step=1;
if(arguments.length==1){
stop=arguments[0];
}else{
if(arguments.length==2){
_160=arguments[0];
stop=arguments[1];
}else{
if(arguments.length==3){
_160=arguments[0];
stop=arguments[1];
step=arguments[2];
}else{
throw new TypeError("range() takes 1, 2, or 3 arguments!");
}
}
}
if(step==0){
throw new TypeError("range() step must not be 0");
}
return {next:function(){
if((step>0&&_160>=stop)||(step<0&&_160<=stop)){
throw MochiKit.Iter.StopIteration;
}
var rval=_160;
_160+=step;
return rval;
},repr:function(){
return "range("+[_160,stop,step].join(", ")+")";
},toString:MochiKit.Base.forward("repr")};
},sum:function(_161,_162){
var x=_162||0;
var self=MochiKit.Iter;
_161=self.iter(_161);
try{
while(true){
x+=_161.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},exhaust:function(_163){
var self=MochiKit.Iter;
_163=self.iter(_163);
try{
while(true){
_163.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
},forEach:function(_164,func,self){
var m=MochiKit.Base;
if(arguments.length>2){
func=m.bind(func,self);
}
if(m.isArrayLike(_164)){
try{
for(var i=0;i<_164.length;i++){
func(_164[i]);
}
}
catch(e){
if(e!=MochiKit.Iter.StopIteration){
throw e;
}
}
}else{
self=MochiKit.Iter;
self.exhaust(self.imap(func,_164));
}
},every:function(_166,func){
var self=MochiKit.Iter;
try{
self.ifilterfalse(func,_166).next();
return false;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return true;
}
},sorted:function(_167,cmp){
var rval=MochiKit.Iter.list(_167);
if(arguments.length==1){
cmp=MochiKit.Base.compare;
}
rval.sort(cmp);
return rval;
},reversed:function(_168){
var rval=MochiKit.Iter.list(_168);
rval.reverse();
return rval;
},some:function(_169,func){
var self=MochiKit.Iter;
try{
self.ifilter(func,_169).next();
return true;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return false;
}
},iextend:function(lst,_170){
if(MochiKit.Base.isArrayLike(_170)){
for(var i=0;i<_170.length;i++){
lst.push(_170[i]);
}
}else{
var self=MochiKit.Iter;
_170=self.iter(_170);
try{
while(true){
lst.push(_170.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
}
return lst;
},groupby:function(_171,_172){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_172=m.operator.identity;
}
_171=self.iter(_171);
var pk=undefined;
var k=undefined;
var v;
function fetch(){
v=_171.next();
k=_172(v);
}
function eat(){
var ret=v;
v=undefined;
return ret;
}
var _175=true;
return {repr:function(){
return "groupby(...)";
},next:function(){
while(k==pk){
fetch();
if(_175){
_175=false;
break;
}
}
pk=k;
return [k,{next:function(){
if(v==undefined){
fetch();
}
if(k!=pk){
throw self.StopIteration;
}
return eat();
}}];
}};
},groupby_as_array:function(_176,_177){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_177=m.operator.identity;
}
_176=self.iter(_176);
var _178=[];
var _179=true;
var _180;
while(true){
try{
var _181=_176.next();
var key=_177(_181);
}
catch(e){
if(e==self.StopIteration){
break;
}
throw e;
}
if(_179||key!=_180){
var _182=[];
_178.push([key,_182]);
}
_182.push(_181);
_179=false;
_180=key;
}
return _178;
},arrayLikeIter:function(_183){
var i=0;
return {repr:function(){
return "arrayLikeIter(...)";
},toString:MochiKit.Base.forward("repr"),next:function(){
if(i>=_183.length){
throw MochiKit.Iter.StopIteration;
}
return _183[i++];
}};
},hasIterateNext:function(_184){
return (_184&&typeof (_184.iterateNext)=="function");
},iterateNextIter:function(_185){
return {repr:function(){
return "iterateNextIter(...)";
},toString:MochiKit.Base.forward("repr"),next:function(){
var rval=_185.iterateNext();
if(rval===null||rval===undefined){
throw MochiKit.Iter.StopIteration;
}
return rval;
}};
}});
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__();
reduce=MochiKit.Iter.reduce;
MochiKit.Base._exportSymbols(this,MochiKit.Iter);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Logging");
dojo.require("MochiKit.Base");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.Logging depends on MochiKit.Base!";
}
if(typeof (MochiKit.Logging)=="undefined"){
MochiKit.Logging={};
}
MochiKit.Logging.NAME="MochiKit.Logging";
MochiKit.Logging.VERSION="1.2";
MochiKit.Logging.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Logging.toString=function(){
return this.__repr__();
};
MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"];
MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"];
MochiKit.Logging.LogMessage=function(num,_187,info){
this.num=num;
this.level=_187;
this.info=info;
this.timestamp=new Date();
};
MochiKit.Logging.LogMessage.prototype={repr:function(){
var m=MochiKit.Base;
return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")";
},toString:MochiKit.Base.forward("repr")};
MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_189){
var self=MochiKit.Logging;
if(typeof (_189)=="string"){
_189=self.LogLevel[_189];
}
return function(msg){
var _191=msg.level;
if(typeof (_191)=="string"){
_191=self.LogLevel[_191];
}
return _191>=_189;
};
},isLogMessage:function(){
var _192=MochiKit.Logging.LogMessage;
for(var i=0;i<arguments.length;i++){
if(!(arguments[i] instanceof _192)){
return false;
}
}
return true;
},compareLogMessage:function(a,b){
return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
},alertListener:function(msg){
alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" "));
}});
MochiKit.Logging.Logger=function(_193){
this.counter=0;
if(typeof (_193)=="undefined"||_193==null){
_193=-1;
}
this.maxSize=_193;
this._messages=[];
this.listeners={};
};
MochiKit.Logging.Logger.prototype={clear:function(){
this._messages.splice(0,this._messages.length);
},dispatchListeners:function(msg){
for(var k in this.listeners){
var pair=this.listeners[k];
if(pair.ident!=k||(pair[0]&&!pair[0](msg))){
continue;
}
pair[1](msg);
}
},addListener:function(_194,_195,_196){
if(typeof (_195)=="string"){
_195=MochiKit.Logging.logLevelAtLeast(_195);
}
var _197=[_195,_196];
_197.ident=_194;
this.listeners[_194]=_197;
},removeListener:function(_198){
delete this.listeners[_198];
},baseLog:function(_199,_200){
var msg=new MochiKit.Logging.LogMessage(this.counter,_199,MochiKit.Base.extend(null,arguments,1));
this._messages.push(msg);
this.dispatchListeners(msg);
this.counter+=1;
while(this.maxSize>=0&&this._messages.length>this.maxSize){
this._messges.shift();
}
},getMessages:function(_201){
var _202=0;
if(!(typeof (_201)=="undefined"||_201==null)){
_202=Math.max(0,this._messages.length-_201);
}
return this._messages.slice(_202);
},getMessageText:function(_203){
if(typeof (_203)=="undefined"||_203==null){
_203=30;
}
var _204=this.getMessages(_203);
if(_204.length){
var lst=map(function(m){
return "\n  ["+m.num+"] "+m.level+": "+m.info.join(" ");
},_204);
lst.unshift("LAST "+_204.length+" MESSAGES:");
return lst.join("");
}
return "";
},debuggingBookmarklet:function(_205){
if(typeof (MochiKit.LoggingPane)=="undefined"){
alert(this.getMessageText());
}else{
MochiKit.LoggingPane.createLoggingPane(_205||false);
}
}};
MochiKit.Logging.__new__=function(){
this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
var m=MochiKit.Base;
m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
var _206=m.partial;
var _207=this.Logger;
var _208=_207.prototype.baseLog;
m.update(this.Logger.prototype,{debug:_206(_208,"DEBUG"),log:_206(_208,"INFO"),error:_206(_208,"ERROR"),fatal:_206(_208,"FATAL"),warning:_206(_208,"WARNING")});
var self=this;
var _209=function(name){
return function(){
self.logger[name].apply(self.logger,arguments);
};
};
this.log=_209("log");
this.logError=_209("error");
this.logDebug=_209("debug");
this.logFatal=_209("fatal");
this.logWarning=_209("warning");
this.logger=new _207();
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Logging.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Logging);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.DateTime");
}
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.DateTime)=="undefined"){
MochiKit.DateTime={};
}
MochiKit.DateTime.NAME="MochiKit.DateTime";
MochiKit.DateTime.VERSION="1.2";
MochiKit.DateTime.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.DateTime.toString=function(){
return this.__repr__();
};
MochiKit.DateTime.isoDate=function(str){
str=str+"";
if(typeof (str)!="string"||str.length==0){
return null;
}
var iso=str.split("-");
if(iso.length==0){
return null;
}
return new Date(iso[0],iso[1]-1,iso[2]);
};
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}))?)?)?)?)?/;
MochiKit.DateTime.isoTimestamp=function(str){
str=str+"";
if(typeof (str)!="string"||str.length==0){
return null;
}
var res=str.match(MochiKit.DateTime._isoRegexp);
if(typeof (res)=="undefined"||res==null){
return null;
}
var year,month,day,hour,min,sec,msec;
year=parseInt(res[1],10);
if(typeof (res[2])=="undefined"||res[2]==""){
return new Date(year);
}
month=parseInt(res[2],10)-1;
day=parseInt(res[3],10);
if(typeof (res[4])=="undefined"||res[4]==""){
return new Date(year,month,day);
}
hour=parseInt(res[4],10);
min=parseInt(res[5],10);
sec=(typeof (res[6])!="undefined"&&res[6]!="")?parseInt(res[6],10):0;
if(typeof (res[7])!="undefined"&&res[7]!=""){
msec=Math.round(1000*parseFloat("0."+res[7]));
}else{
msec=0;
}
if((typeof (res[8])=="undefined"||res[8]=="")&&(typeof (res[9])=="undefined"||res[9]=="")){
return new Date(year,month,day,hour,min,sec,msec);
}
var ofs;
if(typeof (res[9])!="undefined"&&res[9]!=""){
ofs=parseInt(res[10],10)*3600000;
if(typeof (res[11])!="undefined"&&res[11]!=""){
ofs+=parseInt(res[11],10)*60000;
}
if(res[9]=="-"){
ofs=-ofs;
}
}else{
ofs=0;
}
return new Date(Date.UTC(year,month,day,hour,min,sec,msec)-ofs);
};
MochiKit.DateTime.toISOTime=function(date,_215){
if(typeof (date)=="undefined"||date==null){
return null;
}
var hh=date.getHours();
var mm=date.getMinutes();
var ss=date.getSeconds();
var lst=[((_215&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
return lst.join(":");
};
MochiKit.DateTime.toISOTimestamp=function(date,_219){
if(typeof (date)=="undefined"||date==null){
return null;
}
var sep=_219?"T":" ";
var foot=_219?"Z":"";
if(_219){
date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
}
return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_219)+foot;
};
MochiKit.DateTime.toISODate=function(date){
if(typeof (date)=="undefined"||date==null){
return null;
}
var _222=MochiKit.DateTime._padTwo;
return [date.getFullYear(),_222(date.getMonth()+1),_222(date.getDate())].join("-");
};
MochiKit.DateTime.americanDate=function(d){
d=d+"";
if(typeof (d)!="string"||d.length==0){
return null;
}
var a=d.split("/");
return new Date(a[2],a[0]-1,a[1]);
};
MochiKit.DateTime._padTwo=function(n){
return (n>9)?n:"0"+n;
};
MochiKit.DateTime.toPaddedAmericanDate=function(d){
if(typeof (d)=="undefined"||d==null){
return null;
}
var _224=MochiKit.DateTime._padTwo;
return [_224(d.getMonth()+1),_224(d.getDate()),d.getFullYear()].join("/");
};
MochiKit.DateTime.toAmericanDate=function(d){
if(typeof (d)=="undefined"||d==null){
return null;
}
return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
};
MochiKit.DateTime.EXPORT=["isoDate","isoTimestamp","toISOTime","toISOTimestamp","toISODate","americanDate","toPaddedAmericanDate","toAmericanDate"];
MochiKit.DateTime.EXPORT_OK=[];
MochiKit.DateTime.EXPORT_TAGS={":common":MochiKit.DateTime.EXPORT,":all":MochiKit.DateTime.EXPORT};
MochiKit.DateTime.__new__=function(){
var base=this.NAME+".";
for(var k in this){
var o=this[k];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=base+k;
}
catch(e){
}
}
}
};
MochiKit.DateTime.__new__();
if(typeof (MochiKit.Base)!="undefined"){
MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
}else{
(function(_225,_226){
if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(typeof (MochiKit.__compat__)=="boolean"&&MochiKit.__compat__)){
var all=_226.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_225[all[i]]=_226[all[i]];
}
}
})(this,MochiKit.DateTime);
}
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Format");
}
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.Format)=="undefined"){
MochiKit.Format={};
}
MochiKit.Format.NAME="MochiKit.Format";
MochiKit.Format.VERSION="1.2";
MochiKit.Format.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Format.toString=function(){
return this.__repr__();
};
MochiKit.Format._numberFormatter=function(_227,_228,_229,_230,_231,_232,_233,_234,_235){
return function(num){
num=parseFloat(num);
if(typeof (num)=="undefined"||num==null||isNaN(num)){
return _227;
}
var _236=_228;
var _237=_229;
if(num<0){
num=-num;
}else{
_236=_236.replace(/-/,"");
}
var me=arguments.callee;
var fmt=MochiKit.Format.formatLocale(_230);
if(_231){
num=num*100;
_237=fmt.percent+_237;
}
num=MochiKit.Format.roundToFixed(num,_232);
var _239=num.split(/\./);
var _240=_239[0];
var frac=(_239.length==1)?"":_239[1];
var res="";
while(_240.length<_233){
_240="0"+_240;
}
if(_234){
while(_240.length>_234){
var i=_240.length-_234;
res=fmt.separator+_240.substring(i,_240.length)+res;
_240=_240.substring(0,i);
}
}
res=_240+res;
if(_232>0){
while(frac.length<_235){
frac=frac+"0";
}
res=res+fmt.decimal+frac;
}
return _236+res+_237;
};
};
MochiKit.Format.numberFormatter=function(_242,_243,_244){
if(typeof (_243)=="undefined"){
_243="";
}
var _245=_242.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
if(!_245){
throw TypeError("Invalid pattern");
}
var _246=_242.substr(0,_245.index);
var _247=_242.substr(_245.index+_245[0].length);
if(_246.search(/-/)==-1){
_246=_246+"-";
}
var _248=_245[1];
var frac=(typeof (_245[2])=="string"&&_245[2]!="")?_245[2]:"";
var _249=(typeof (_245[3])=="string"&&_245[3]!="");
var tmp=_248.split(/,/);
var _251;
if(typeof (_244)=="undefined"){
_244="default";
}
if(tmp.length==1){
_251=null;
}else{
_251=tmp[1].length;
}
var _252=_248.length-_248.replace(/0/g,"").length;
var _253=frac.length-frac.replace(/0/g,"").length;
var _254=frac.length;
var rval=MochiKit.Format._numberFormatter(_243,_246,_247,_244,_249,_254,_252,_251,_253);
var m=MochiKit.Base;
if(m){
var fn=arguments.callee;
var args=m.concat(arguments);
rval.repr=function(){
return [self.NAME,"(",map(m.repr,args).join(", "),")"].join("");
};
}
return rval;
};
MochiKit.Format.formatLocale=function(_256){
if(typeof (_256)=="undefined"||_256==null){
_256="default";
}
if(typeof (_256)=="string"){
var rval=MochiKit.Format.LOCALE[_256];
if(typeof (rval)=="string"){
rval=arguments.callee(rval);
MochiKit.Format.LOCALE[_256]=rval;
}
return rval;
}else{
return _256;
}
};
MochiKit.Format.twoDigitAverage=function(_257,_258){
if(_258){
var res=_257/_258;
if(!isNaN(res)){
return MochiKit.Format.twoDigitFloat(_257/_258);
}
}
return "0";
};
MochiKit.Format.twoDigitFloat=function(_259){
var sign=(_259<0?"-":"");
var s=Math.floor(Math.abs(_259)*100).toString();
if(s=="0"){
return s;
}
if(s.length<3){
while(s.charAt(s.length-1)=="0"){
s=s.substring(0,s.length-1);
}
return sign+"0."+s;
}
var head=sign+s.substring(0,s.length-2);
var tail=s.substring(s.length-2,s.length);
if(tail=="00"){
return head;
}else{
if(tail.charAt(1)=="0"){
return head+"."+tail.charAt(0);
}else{
return head+"."+tail;
}
}
};
MochiKit.Format.lstrip=function(str,_264){
str=str+"";
if(typeof (str)!="string"){
return null;
}
if(!_264){
return str.replace(/^\s+/,"");
}else{
return str.replace(new RegExp("^["+_264+"]+"),"");
}
};
MochiKit.Format.rstrip=function(str,_265){
str=str+"";
if(typeof (str)!="string"){
return null;
}
if(!_265){
return str.replace(/\s+$/,"");
}else{
return str.replace(new RegExp("["+_265+"]+$"),"");
}
};
MochiKit.Format.strip=function(str,_266){
var self=MochiKit.Format;
return self.rstrip(self.lstrip(str,_266),_266);
};
MochiKit.Format.truncToFixed=function(_267,_268){
_267=Math.floor(_267*Math.pow(10,_268));
var res=(_267*Math.pow(10,-_268)).toFixed(_268);
if(res.charAt(0)=="."){
res="0"+res;
}
return res;
};
MochiKit.Format.roundToFixed=function(_269,_270){
return MochiKit.Format.truncToFixed(_269+0.5*Math.pow(10,-_270),_270);
};
MochiKit.Format.percentFormat=function(_271){
return MochiKit.Format.twoDigitFloat(100*_271)+"%";
};
MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
MochiKit.Format.EXPORT_OK=[];
MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
MochiKit.Format.__new__=function(){
var base=this.NAME+".";
var k,v,o;
for(k in this.LOCALE){
o=this.LOCALE[k];
if(typeof (o)=="object"){
o.repr=function(){
return this.NAME;
};
o.NAME=base+"LOCALE."+k;
}
}
for(k in this){
o=this[k];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=base+k;
}
catch(e){
}
}
}
};
MochiKit.Format.__new__();
if(typeof (MochiKit.Base)!="undefined"){
MochiKit.Base._exportSymbols(this,MochiKit.Format);
}else{
(function(_272,_273){
if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(typeof (MochiKit.__compat__)=="boolean"&&MochiKit.__compat__)){
var all=_273.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_272[all[i]]=_273[all[i]];
}
}
})(this,MochiKit.Format);
}
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Async");
dojo.require("MochiKit.Base");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.Async depends on MochiKit.Base!";
}
if(typeof (MochiKit.Async)=="undefined"){
MochiKit.Async={};
}
MochiKit.Async.NAME="MochiKit.Async";
MochiKit.Async.VERSION="1.2";
MochiKit.Async.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Async.toString=function(){
return this.__repr__();
};
MochiKit.Async.Deferred=function(_274){
this.chain=[];
this.id=this._nextId();
this.fired=-1;
this.paused=0;
this.results=[null,null];
this.canceller=_274;
this.silentlyCancelled=false;
};
MochiKit.Async.Deferred.prototype={repr:function(){
var _275;
if(this.fired==-1){
_275="unfired";
}else{
if(this.fired==0){
_275="success";
}else{
_275="error";
}
}
return "Deferred("+this.id+", "+_275+")";
},toString:MochiKit.Base.forward("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
var self=MochiKit.Async;
if(this.fired==-1){
if(this.canceller){
this.canceller(this);
}else{
this.silentlyCancelled=true;
}
if(this.fired==-1){
this.errback(new self.CancelledError(this));
}
}else{
if((this.fired==0)&&(this.results[0] instanceof self.Deferred)){
this.results[0].cancel();
}
}
},_pause:function(){
this.paused++;
},_unpause:function(){
this.paused--;
if((this.paused==0)&&(this.fired>=0)){
this._fire();
}
},_continue:function(res){
this._resback(res);
this._unpause();
},_resback:function(res){
this.fired=((res instanceof Error)?1:0);
this.results[this.fired]=res;
this._fire();
},_check:function(){
if(this.fired!=-1){
if(!this.silentlyCancelled){
throw new MochiKit.Async.AlreadyCalledError(this);
}
this.silentlyCancelled=false;
return;
}
},callback:function(res){
this._check();
this._resback(res);
},errback:function(res){
this._check();
if(!(res instanceof Error)){
res=new MochiKit.Async.GenericError(res);
}
this._resback(res);
},addBoth:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(fn,fn);
},addCallback:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(fn,null);
},addErrback:function(fn){
if(arguments.length>1){
fn=MochiKit.Base.partial.apply(null,arguments);
}
return this.addCallbacks(null,fn);
},addCallbacks:function(cb,eb){
this.chain.push([cb,eb]);
if(this.fired>=0){
this._fire();
}
return this;
},_fire:function(){
var _278=this.chain;
var _279=this.fired;
var res=this.results[_279];
var self=this;
var cb=null;
while(_278.length>0&&this.paused==0){
var pair=_278.shift();
var f=pair[_279];
if(f==null){
continue;
}
try{
res=f(res);
_279=((res instanceof Error)?1:0);
if(res instanceof MochiKit.Async.Deferred){
cb=function(res){
self._continue(res);
};
this._pause();
}
}
catch(err){
_279=1;
res=err;
}
}
this.fired=_279;
this.results[_279]=res;
if(cb&&this.paused){
res.addBoth(cb);
}
}};
MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){
return eval("("+arguments[0].responseText+")");
},succeed:function(_281){
var d=new MochiKit.Async.Deferred();
d.callback.apply(d,arguments);
return d;
},fail:function(_282){
var d=new MochiKit.Async.Deferred();
d.errback.apply(d,arguments);
return d;
},getXMLHttpRequest:function(){
var self=arguments.callee;
if(!self.XMLHttpRequest){
var _283=[function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new ActiveXObject("Msxml2.XMLHTTP.4.0");
},function(){
throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
}];
for(var i=0;i<_283.length;i++){
var func=_283[i];
try{
self.XMLHttpRequest=func;
return func();
}
catch(e){
}
}
}
return self.XMLHttpRequest();
},sendXMLHttpRequest:function(req,_285){
if(typeof (_285)=="undefined"){
_285=null;
}
var _286=function(){
try{
req.onreadystatechange=null;
}
catch(e){
try{
req.onreadystatechange=function(){
};
}
catch(e){
}
}
req.abort();
};
var self=MochiKit.Async;
var d=new self.Deferred(_286);
var _287=function(){
if(req.readyState==4){
try{
req.onreadystatechange=null;
}
catch(e){
try{
req.onreadystatechange=function(){
};
}
catch(e){
}
}
var _288=null;
try{
_288=req.status;
if(!_288&&MochiKit.Base.isNotEmpty(req.responseText)){
_288=304;
}
}
catch(e){
}
if(_288==200||_288==304){
d.callback(req);
}else{
var err=new self.XMLHttpRequestError(req,"Request failed");
if(err.number){
d.errback(err);
}else{
d.errback(err);
}
}
}
};
try{
req.onreadystatechange=_287;
req.send(_285);
}
catch(e){
try{
req.onreadystatechange=null;
}
catch(ignore){
}
d.errback(e);
}
return d;
},doSimpleXMLHttpRequest:function(url){
var self=MochiKit.Async;
var req=self.getXMLHttpRequest();
if(arguments.length>1){
var m=MochiKit.Base;
var qs=m.queryString.apply(null,m.extend(null,arguments,1));
if(qs){
url+="?"+qs;
}
}
req.open("GET",url,true);
return self.sendXMLHttpRequest(req);
},loadJSONDoc:function(url){
var self=MochiKit.Async;
var d=self.doSimpleXMLHttpRequest.apply(self,arguments);
d=d.addCallback(self.evalJSONRequest);
return d;
},wait:function(_292,_293){
var d=new MochiKit.Async.Deferred();
var m=MochiKit.Base;
if(typeof (_293)!="undefined"){
d.addCallback(function(){
return _293;
});
}
var _294=setTimeout(m.bind("callback",d),Math.floor(_292*1000));
d.canceller=function(){
try{
clearTimeout(_294);
}
catch(e){
}
};
return d;
},callLater:function(_295,func){
var m=MochiKit.Base;
var _296=m.partial.apply(m,m.extend(null,arguments,1));
return MochiKit.Async.wait(_295).addCallback(function(res){
return _296();
});
}});
MochiKit.Async.DeferredLock=function(){
this.waiting=[];
this.locked=false;
this.id=this._nextId();
};
MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
d=new MochiKit.Async.Deferred();
if(this.locked){
this.waiting.push(d);
}else{
this.locked=true;
d.callback(this);
}
return d;
},release:function(){
if(!this.locked){
throw TypeError("Tried to release an unlocked DeferredLock");
}
this.locked=false;
if(this.waiting.length>0){
this.locked=true;
this.waiting.shift().callback(this);
}
},_nextId:MochiKit.Base.counter(),repr:function(){
var _297;
if(this.locked){
_297="locked, "+this.waiting.length+" waiting";
}else{
_297="unlocked";
}
return "DeferredLock("+this.id+", "+_297+")";
},toString:MochiKit.Base.forward("repr")};
MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock"];
MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
MochiKit.Async.__new__=function(){
var m=MochiKit.Base;
var ne=m.partial(m._newNamedError,this);
ne("AlreadyCalledError",function(_299){
this.deferred=_299;
});
ne("CancelledError",function(_300){
this.deferred=_300;
});
ne("BrowserComplianceError",function(msg){
this.message=msg;
});
ne("GenericError",function(msg){
this.message=msg;
});
ne("XMLHttpRequestError",function(req,msg){
this.req=req;
this.message=msg;
try{
this.number=req.status;
}
catch(e){
}
});
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Async.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Async);
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.2";
MochiKit.DOM.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.DOM.toString=function(){
return this.__repr__();
};
MochiKit.DOM.EXPORT=["elementDimensions","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","elementPosition"];
MochiKit.DOM.EXPORT_OK=["domConverters"];
MochiKit.DOM.Dimensions=function(w,h){
this.w=w;
this.h=h;
};
MochiKit.DOM.Dimensions.prototype.repr=function(){
var repr=MochiKit.Base.repr;
return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
};
MochiKit.DOM.Coordinates=function(x,y){
this.x=x;
this.y=y;
};
MochiKit.DOM.Coordinates.prototype.repr=function(){
var repr=MochiKit.Base.repr;
return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
};
MochiKit.DOM.elementDimensions=function(elem){
var self=MochiKit.DOM;
if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
return new self.Dimensions(elem.w||0,elem.h||0);
}
elem=self.getElement(elem);
if(!elem){
return undefined;
}
if(self.computedStyle(elem,"display")!="none"){
return new self.Dimensions(elem.w||0,elem.h||0);
}
var s=elem.style;
var _305=s.visibility;
var _306=s.position;
s.visibility="hidden";
s.position="absolute";
s.display="";
var _307=elem.clientWidth;
var _308=elem.clientHeight;
s.display="none";
s.position=_306;
s.visibility=_305;
return new self.Dimensions(_307,_308);
};
MochiKit.DOM.elementPosition=function(elem,_309){
var self=MochiKit.DOM;
elem=self.getElement(elem);
if(!elem){
return undefined;
}
var x=0;
var y=0;
if(elem.offsetParent){
while(elem.offsetParent){
x+=elem.offsetLeft;
y+=elem.offsetTop;
elem=elem.offsetParent;
}
}else{
x=elem.x||x;
y=elem.y||y;
}
if(_309){
_309=arguments.callee(_309);
if(_309){
x-=(_309.x||0);
y-=(_309.y||0);
}
}
return new self.Coordinates(x,y);
};
MochiKit.DOM.currentWindow=function(){
return MochiKit.DOM._window;
};
MochiKit.DOM.currentDocument=function(){
return MochiKit.DOM._document;
};
MochiKit.DOM.withWindow=function(win,func){
var self=MochiKit.DOM;
var _311=self._document;
var _312=self._win;
var rval;
try{
self._window=win;
self._document=win.document;
rval=func();
}
catch(e){
self._window=_312;
self._document=_311;
throw e;
}
self._window=_312;
self._document=_311;
return rval;
};
MochiKit.DOM.formContents=function(elem){
var _313=[];
var _314=[];
var m=MochiKit.Base;
var self=MochiKit.DOM;
if(typeof (elem)=="undefined"||elem==null){
elem=self._document;
}else{
elem=self.getElement(elem);
}
m.nodeWalk(elem,function(elem){
var name=elem.name;
if(m.isNotEmpty(name)){
if(elem.tagName=="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
return null;
}
if(elem.tagName=="SELECT"){
var opts=elem.options;
for(var i=0;i<opts.length;i++){
var opt=opts[i];
if(!opt.selected){
continue;
}
_313.push(name);
_314.push((opt.value)?opt.value:opt.text);
}
}else{
_313.push(name);
_314.push(elem.value||"");
}
return null;
}
return elem.childNodes;
});
return [_313,_314];
};
MochiKit.DOM.withDocument=function(doc,func){
var self=MochiKit.DOM;
var _318=self._document;
var rval;
try{
self._document=doc;
rval=func();
}
catch(e){
self._document=_318;
throw e;
}
self._document=_318;
return rval;
};
MochiKit.DOM.registerDOMConverter=function(name,_319,wrap,_320){
MochiKit.DOM.domConverters.register(name,_319,wrap,_320);
};
MochiKit.DOM.coerceToDOM=function(node,ctx){
var im=MochiKit.Iter;
var self=MochiKit.DOM;
var iter=im.iter;
var _324=im.repeat;
var imap=im.imap;
var _326=self.domConverters;
var _327=self.coerceToDOM;
var _328=MochiKit.Base.NotFound;
while(true){
if(typeof (node)=="undefined"||node==null){
return null;
}
if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
return node;
}
if(typeof (node)=="number"||typeof (node)=="bool"){
node=node.toString();
}
if(typeof (node)=="string"){
return self._document.createTextNode(node);
}
if(typeof (node.toDOM)=="function"){
node=node.toDOM(ctx);
continue;
}
if(typeof (node)=="function"){
node=node(ctx);
continue;
}
var _329=null;
try{
_329=iter(node);
}
catch(e){
}
if(_329){
return imap(_327,_329,_324(ctx));
}
try{
node=_326.match(node,ctx);
continue;
}
catch(e){
if(e!=_328){
throw e;
}
}
return self._document.createTextNode(node.toString());
}
return undefined;
};
MochiKit.DOM.setNodeAttribute=function(node,attr,_331){
var o={};
o[attr]=_331;
try{
return MochiKit.DOM.updateNodeAttributes(node,o);
}
catch(e){
}
return null;
};
MochiKit.DOM.getNodeAttribute=function(node,attr){
var self=MochiKit.DOM;
var _332=self.attributeArray.renames[attr];
node=self.getElement(node);
try{
if(_332){
return node[_332];
}
return node.getAttribute(attr);
}
catch(e){
}
return null;
};
MochiKit.DOM.updateNodeAttributes=function(node,_333){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
if(_333){
var _334=MochiKit.Base.updatetree;
if(self.attributeArray.compliant){
for(var k in _333){
var v=_333[k];
if(typeof (v)=="object"&&typeof (elem[k])=="object"){
_334(elem[k],v);
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
elem[k]=v;
}else{
elem.setAttribute(k,v);
}
}
}
}else{
var _335=self.attributeArray.renames;
for(k in _333){
v=_333[k];
var _336=_335[k];
if(k=="style"&&typeof (v)=="string"){
elem.style.cssText=v;
}else{
if(typeof (_336)=="string"){
elem[_336]=v;
}else{
if(typeof (elem[k])=="object"&&typeof (v)=="object"){
_334(elem[k],v);
}else{
if(k.substring(0,2)=="on"){
if(typeof (v)=="string"){
v=new Function(v);
}
elem[k]=v;
}else{
elem.setAttribute(k,v);
}
}
}
}
}
}
}
return elem;
};
MochiKit.DOM.appendChildNodes=function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _337=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
var _338=MochiKit.Iter.iextend;
while(_337.length){
var n=_337.shift();
if(typeof (n)=="undefined"||n==null){
}else{
if(typeof (n.nodeType)=="number"){
elem.appendChild(n);
}else{
_338(_337,n);
}
}
}
return elem;
};
MochiKit.DOM.replaceChildNodes=function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
arguments[0]=elem;
}
var _339;
while((_339=elem.firstChild)){
elem.removeChild(_339);
}
if(arguments.length<2){
return elem;
}else{
return self.appendChildNodes.apply(this,arguments);
}
};
MochiKit.DOM.createDOM=function(name,_340){
var elem;
var self=MochiKit.DOM;
if(typeof (name)=="string"){
if(_340&&"name" in _340&&!self.attributeArray.compliant){
name="<"+name+" name=\""+self.escapeHTML(_340.name)+"\">";
}
elem=self._document.createElement(name);
}else{
elem=name;
}
if(_340){
self.updateNodeAttributes(elem,_340);
}
if(arguments.length<=2){
return elem;
}else{
var args=MochiKit.Base.extend([elem],arguments,2);
return self.appendChildNodes.apply(this,args);
}
};
MochiKit.DOM.createDOMFunc=function(){
var m=MochiKit.Base;
return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
};
MochiKit.DOM.swapDOM=function(dest,src){
var self=MochiKit.DOM;
dest=self.getElement(dest);
var _343=dest.parentNode;
if(src){
src=self.getElement(src);
_343.replaceChild(src,dest);
}else{
_343.removeChild(dest);
}
return src;
};
MochiKit.DOM.getElement=function(id){
var self=MochiKit.DOM;
if(arguments.length==1){
return ((typeof (id)=="string")?self._document.getElementById(id):id);
}else{
return MochiKit.Base.map(self.getElement,arguments);
}
};
MochiKit.DOM.computedStyle=function(_345,_346,_347){
if(arguments.length==2){
_347=_346;
}
var self=MochiKit.DOM;
var el=self.getElement(_345);
var _349=self._document;
if(!el||el==_349){
return undefined;
}
if(el.currentStyle){
return el.currentStyle[_346];
}
if(typeof (_349.defaultView)=="undefined"){
return undefined;
}
if(_349.defaultView==null){
return undefined;
}
var _350=_349.defaultView.getComputedStyle(el,null);
if(typeof (_350)=="undefined"||_350==null){
return undefined;
}
return _350.getPropertyValue(_347);
};
MochiKit.DOM.getElementsByTagAndClassName=function(_351,_352,_353){
var self=MochiKit.DOM;
if(typeof (_351)=="undefined"||_351==null){
_351="*";
}
if(typeof (_353)=="undefined"||_353==null){
_353=self._document;
}
_353=self.getElement(_353);
var _354=_353.getElementsByTagName(_351)||self._document.all;
if(typeof (_352)=="undefined"||_352==null){
return MochiKit.Base.extend(null,_354);
}
var _355=[];
for(var i=0;i<_354.length;i++){
var _356=_354[i];
var _357=_356.className.split(" ");
for(var j=0;j<_357.length;j++){
if(_357[j]==_352){
_355.push(_356);
break;
}
}
}
return _355;
};
MochiKit.DOM._newCallStack=function(path,once){
var rval=function(){
var _360=arguments.callee.callStack;
for(var i=0;i<_360.length;i++){
if(_360[i].apply(this,arguments)===false){
break;
}
}
if(once){
try{
this[path]=null;
}
catch(e){
}
}
};
rval.callStack=[];
return rval;
};
MochiKit.DOM.addToCallStack=function(_361,path,func,once){
var self=MochiKit.DOM;
var _362=_361[path];
var _363=_362;
if(!(typeof (_362)=="function"&&typeof (_362.callStack)=="object"&&_362.callStack!=null)){
_363=self._newCallStack(path,once);
if(typeof (_362)=="function"){
_363.callStack.push(_362);
}
_361[path]=_363;
}
_363.callStack.push(func);
};
MochiKit.DOM.addLoadEvent=function(func){
var self=MochiKit.DOM;
self.addToCallStack(self._window,"onload",func,true);
};
MochiKit.DOM.focusOnLoad=function(_364){
var self=MochiKit.DOM;
self.addLoadEvent(function(){
_364=self.getElement(_364);
if(_364){
_364.focus();
}
});
};
MochiKit.DOM.setElementClass=function(_365,_366){
var self=MochiKit.DOM;
var obj=self.getElement(_365);
if(self.attributeArray.compliant){
obj.setAttribute("class",_366);
}else{
obj.setAttribute("className",_366);
}
};
MochiKit.DOM.toggleElementClass=function(_367){
var self=MochiKit.DOM;
for(var i=1;i<arguments.length;i++){
var obj=self.getElement(arguments[i]);
if(!self.addElementClass(obj,_367)){
self.removeElementClass(obj,_367);
}
}
};
MochiKit.DOM.addElementClass=function(_368,_369){
var self=MochiKit.DOM;
var obj=self.getElement(_368);
var cls=obj.className;
if(cls.length==0){
self.setElementClass(obj,_369);
return true;
}
if(cls==_369){
return false;
}
var _371=obj.className.split(" ");
for(var i=0;i<_371.length;i++){
if(_371[i]==_369){
return false;
}
}
self.setElementClass(obj,cls+" "+_369);
return true;
};
MochiKit.DOM.removeElementClass=function(_372,_373){
var self=MochiKit.DOM;
var obj=self.getElement(_372);
var cls=obj.className;
if(cls.length==0){
return false;
}
if(cls==_373){
self.setElementClass(obj,"");
return true;
}
var _374=obj.className.split(" ");
for(var i=0;i<_374.length;i++){
if(_374[i]==_373){
_374.splice(i,1);
self.setElementClass(obj,_374.join(" "));
return true;
}
}
return false;
};
MochiKit.DOM.swapElementClass=function(_375,_376,_377){
var obj=MochiKit.DOM.getElement(_375);
var res=MochiKit.DOM.removeElementClass(obj,_376);
if(res){
MochiKit.DOM.addElementClass(obj,_377);
}
return res;
};
MochiKit.DOM.hasElementClass=function(_378,_379){
var obj=MochiKit.DOM.getElement(_378);
var _380=obj.className.split(" ");
for(var i=1;i<arguments.length;i++){
var good=false;
for(var j=0;j<_380.length;j++){
if(_380[j]==arguments[i]){
good=true;
break;
}
}
if(!good){
return false;
}
}
return true;
};
MochiKit.DOM.escapeHTML=function(s){
return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
MochiKit.DOM.toHTML=function(dom){
return MochiKit.DOM.emitHTML(dom).join("");
};
MochiKit.DOM.emitHTML=function(dom,lst){
if(typeof (lst)=="undefined"||lst==null){
lst=[];
}
var _383=[dom];
var self=MochiKit.DOM;
var _384=self.escapeHTML;
var _385=self.attributeArray;
while(_383.length){
dom=_383.pop();
if(typeof (dom)=="string"){
lst.push(dom);
}else{
if(dom.nodeType==1){
lst.push("<"+dom.nodeName.toLowerCase());
var _386=[];
var _387=_385(dom);
for(var i=0;i<_387.length;i++){
var a=_387[i];
_386.push([" ",a.name,"=\"",_384(a.value),"\""]);
}
_386.sort();
for(i=0;i<_386.length;i++){
var _388=_386[i];
for(var j=0;j<_388.length;j++){
lst.push(_388[j]);
}
}
if(dom.hasChildNodes()){
lst.push(">");
_383.push("</"+dom.nodeName.toLowerCase()+">");
var _389=dom.childNodes;
for(i=_389.length-1;i>=0;i--){
_383.push(_389[i]);
}
}else{
lst.push("/>");
}
}else{
if(dom.nodeType==3){
lst.push(_384(dom.nodeValue));
}
}
}
}
return lst;
};
MochiKit.DOM.setDisplayForElement=function(_390,_391){
var m=MochiKit.Base;
var _392=m.extend(null,arguments,1);
MochiKit.Iter.forEach(m.filter(null,m.map(MochiKit.DOM.getElement,_392)),function(_391){
_391.style.display=_390;
});
};
MochiKit.DOM.scrapeText=function(node,_393){
var rval=[];
(function(node){
var cn=node.childNodes;
if(cn){
for(var i=0;i<cn.length;i++){
arguments.callee.call(this,cn[i]);
}
}
var _395=node.nodeValue;
if(typeof (_395)=="string"){
rval.push(_395);
}
})(MochiKit.DOM.getElement(node));
if(_393){
return rval;
}else{
return rval.join("");
}
};
MochiKit.DOM.__new__=function(win){
var m=MochiKit.Base;
this._document=document;
this._window=win;
this.domConverters=new m.AdapterRegistry();
var _396=this._document.createElement("span");
var _397;
if(_396&&_396.attributes&&_396.attributes.length>0){
var _398=m.filter;
_397=function(node){
return _398(_397.ignoreAttrFilter,node.attributes);
};
_397.ignoreAttr={};
MochiKit.Iter.forEach(_396.attributes,function(a){
_397.ignoreAttr[a.name]=a.value;
});
_397.ignoreAttrFilter=function(a){
return (_397.ignoreAttr[a.name]!=a.value);
};
_397.compliant=false;
_397.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor"};
}else{
_397=function(node){
return node.attributes;
};
_397.compliant=true;
_397.renames={};
}
this.attributeArray=_397;
var _399=this.createDOMFunc;
this.UL=_399("ul");
this.OL=_399("ol");
this.LI=_399("li");
this.TD=_399("td");
this.TR=_399("tr");
this.TBODY=_399("tbody");
this.THEAD=_399("thead");
this.TFOOT=_399("tfoot");
this.TABLE=_399("table");
this.TH=_399("th");
this.INPUT=_399("input");
this.SPAN=_399("span");
this.A=_399("a");
this.DIV=_399("div");
this.IMG=_399("img");
this.BUTTON=_399("button");
this.TT=_399("tt");
this.PRE=_399("pre");
this.H1=_399("h1");
this.H2=_399("h2");
this.H3=_399("h3");
this.BR=_399("br");
this.HR=_399("hr");
this.LABEL=_399("label");
this.TEXTAREA=_399("textarea");
this.FORM=_399("form");
this.P=_399("p");
this.SELECT=_399("select");
this.OPTION=_399("option");
this.OPTGROUP=_399("optgroup");
this.LEGEND=_399("legend");
this.FIELDSET=_399("fieldset");
this.STRONG=_399("strong");
this.CANVAS=_399("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__(this);
withWindow=MochiKit.DOM.withWindow;
withDocument=MochiKit.DOM.withDocument;
MochiKit.Base._exportSymbols(this,MochiKit.DOM);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.LoggingPane");
dojo.require("MochiKit.Logging");
dojo.require("MochiKit.Base");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Logging",[]);
JSAN.use("MochiKit.Base",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Logging)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!";
}
if(typeof (MochiKit.LoggingPane)=="undefined"){
MochiKit.LoggingPane={};
}
MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
MochiKit.LoggingPane.VERSION="1.2";
MochiKit.LoggingPane.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.LoggingPane.toString=function(){
return this.__repr__();
};
MochiKit.LoggingPane.createLoggingPane=function(_400){
var m=MochiKit.LoggingPane;
_400=!(!_400);
if(m._loggingPane&&m._loggingPane.inline!=_400){
m._loggingPane.closePane();
m._loggingPane=null;
}
if(!m._loggingPane||m._loggingPane.closed){
m._loggingPane=new m.LoggingPane(_400,MochiKit.Logging.logger);
}
return m._loggingPane;
};
MochiKit.LoggingPane.LoggingPane=function(_401,_402){
if(typeof (_402)=="undefined"||_402==null){
_402=MochiKit.Logging.logger;
}
this.logger=_402;
var _403=MochiKit.Base.update;
var _404=MochiKit.Base.updatetree;
var bind=MochiKit.Base.bind;
var _405=MochiKit.Base.clone;
var win=window;
var uid="_MochiKit_LoggingPane";
if(typeof (MochiKit.DOM)!="undefined"){
win=MochiKit.DOM.currentWindow();
}
if(!_401){
var url=win.location.href.split("?")[0].replace(/[:\/.><&]/g,"_");
var name=uid+"_"+url;
var nwin=win.open("",name,"dependent,resizable,height=200");
if(!nwin){
alert("Not able to open debugging window due to pop-up blocking.");
return undefined;
}
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>");
nwin.document.close();
nwin.document.title+=" "+win.document.title;
win=nwin;
}
var doc=win.document;
this.doc=doc;
var _408=doc.getElementById(uid);
var _409=!!_408;
if(_408&&typeof (_408.loggingPane)!="undefined"){
_408.loggingPane.logger=this.logger;
_408.loggingPane.buildAndApplyFilter();
return _408.loggingPane;
}
if(_409){
var _410;
while((_410=_408.firstChild)){
_408.removeChild(_410);
}
}else{
_408=doc.createElement("div");
_408.id=uid;
}
_408.loggingPane=this;
var _411=doc.createElement("input");
var _412=doc.createElement("input");
var _413=doc.createElement("button");
var _414=doc.createElement("button");
var _415=doc.createElement("button");
var _416=doc.createElement("button");
var _417=doc.createElement("div");
var _418=doc.createElement("div");
var _419=uid+"_Listener";
this.colorTable=_405(this.colorTable);
var _420=[];
var _421=null;
var _422=function(msg){
var _423=msg.level;
if(typeof (_423)=="number"){
_423=MochiKit.Logging.LogLevel[_423];
}
return _423;
};
var _424=function(msg){
return msg.info.join(" ");
};
var _425=bind(function(msg){
var _426=_422(msg);
var text=_424(msg);
var c=this.colorTable[_426];
var p=doc.createElement("span");
p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_426;
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;
p.appendChild(doc.createTextNode(_426+": "+text));
_418.appendChild(p);
_418.appendChild(doc.createElement("br"));
if(_417.offsetHeight>_417.scrollHeight){
_417.scrollTop=0;
}else{
_417.scrollTop=_417.scrollHeight;
}
},this);
var _429=function(msg){
_420[_420.length]=msg;
_425(msg);
};
var _430=function(){
var _431,infore;
try{
_431=new RegExp(_411.value);
infore=new RegExp(_412.value);
}
catch(e){
logDebug("Error in filter regex: "+e.message);
return null;
}
return function(msg){
return (_431.test(_422(msg))&&infore.test(_424(msg)));
};
};
var _432=function(){
while(_418.firstChild){
_418.removeChild(_418.firstChild);
}
};
var _433=function(){
_420=[];
_432();
};
var _434=bind(function(){
if(this.closed){
return;
}
this.closed=true;
if(MochiKit.LoggingPane._loggingPane==this){
MochiKit.LoggingPane._loggingPane=null;
}
this.logger.removeListener(_419);
_408.loggingPane=null;
if(_401){
_408.parentNode.removeChild(_408);
}else{
this.win.close();
}
},this);
var _435=function(){
_432();
for(var i=0;i<_420.length;i++){
var msg=_420[i];
if(_421==null||_421(msg)){
_425(msg);
}
}
};
this.buildAndApplyFilter=function(){
_421=_430();
_435();
this.logger.removeListener(_419);
this.logger.addListener(_419,_421,_429);
};
var _436=bind(function(){
_420=this.logger.getMessages();
_435();
},this);
var _437=bind(function(_438){
_438=_438||window.event;
key=_438.which||_438.keyCode;
if(key==13){
this.buildAndApplyFilter();
}
},this);
var _439="display: block; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
if(_401){
_439+="; height: 10em; border-top: 2px solid black";
}else{
_439+="; height: 100%;";
}
_408.style.cssText=_439;
if(!_409){
doc.body.appendChild(_408);
}
_439={"cssText":"width: 33%; display: inline; font: "+this.logFont};
_404(_411,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_437,"style":_439});
_408.appendChild(_411);
_404(_412,{"value":".*","onkeypress":_437,"style":_439});
_408.appendChild(_412);
_439="width: 8%; display:inline; font: "+this.logFont;
_413.appendChild(doc.createTextNode("Filter"));
_413.onclick=bind("buildAndApplyFilter",this);
_413.style.cssText=_439;
_408.appendChild(_413);
_414.appendChild(doc.createTextNode("Load"));
_414.onclick=_436;
_414.style.cssText=_439;
_408.appendChild(_414);
_415.appendChild(doc.createTextNode("Clear"));
_415.onclick=_433;
_415.style.cssText=_439;
_408.appendChild(_415);
_416.appendChild(doc.createTextNode("Close"));
_416.onclick=_434;
_416.style.cssText=_439;
_408.appendChild(_416);
_417.style.cssText="overflow: auto; width: 100%";
_418.style.cssText="width: 100%; height: "+(_401?"8em":"100%");
_417.appendChild(_418);
_408.appendChild(_417);
this.buildAndApplyFilter();
_436();
if(_401){
this.win=undefined;
}else{
this.win=win;
}
this.inline=_401;
this.closePane=_434;
this.closed=false;
return this;
};
MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
MochiKit.LoggingPane.__new__=function(){
this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
MochiKit.Base.nameFunctions(this);
MochiKit.LoggingPane._loggingPane=null;
};
MochiKit.LoggingPane.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Color");
dojo.require("MochiKit.Base");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.Color depends on MochiKit.Base";
}
if(typeof (MochiKit.Color)=="undefined"){
MochiKit.Color={};
}
MochiKit.Color.NAME="MochiKit.Color";
MochiKit.Color.VERSION="1.2";
MochiKit.Color.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Color.toString=function(){
return this.__repr__();
};
MochiKit.Color.Color=function(red,_441,blue,_443){
if(typeof (_443)=="undefined"||_443==null){
_443=1;
}
this.rgb={r:red,g:_441,b:blue,a:_443};
};
MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_444){
var rgb=this.rgb;
var m=MochiKit.Color;
return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_444);
},colorWithHue:function(hue){
var hsl=this.asHSL();
hsl.h=hue;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},colorWithSaturation:function(_448){
var hsl=this.asHSL();
hsl.s=_448;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},colorWithLightness:function(_449){
var hsl=this.asHSL();
hsl.l=_449;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},darkerColorWithLevel:function(_450){
var hsl=this.asHSL();
hsl.l=Math.max(hsl.l-_450,0);
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},lighterColorWithLevel:function(_451){
var hsl=this.asHSL();
hsl.l=Math.min(hsl.l+_451,1);
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},blendedColor:function(_452,_453){
if(typeof (_453)=="undefined"||_453==null){
_453=0.5;
}
var sf=1-_453;
var s=this.rgb;
var d=_452.rgb;
var df=_453;
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));
},compareRGB:function(_456){
var a=this.asRGB();
var b=_456.asRGB();
return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
},isLight:function(){
return this.asHSL().b>0.5;
},isDark:function(){
return (!this.isLight());
},toHSLString:function(){
var c=this.asHSL();
var ccc=MochiKit.Color.clampColorComponent;
var rval=this._hslString;
if(!rval){
var mid=(ccc(c.h,360).toFixed(0)+","+ccc(c.s,100).toPrecision(4)+"%"+","+ccc(c.l,100).toPrecision(4)+"%");
var a=c.a;
if(a>=1){
a=1;
rval="hsl("+mid+")";
}else{
if(a<=0){
a=0;
}
rval="hsla("+mid+","+a+")";
}
this._hslString=rval;
}
return rval;
},toRGBString:function(){
var c=this.rgb;
var ccc=MochiKit.Color.clampColorComponent;
var rval=this._rgbString;
if(!rval){
var mid=(ccc(c.r,255).toFixed(0)+","+ccc(c.g,255).toFixed(0)+","+ccc(c.b,255).toFixed(0));
if(c.a!=1){
rval="rgba("+mid+","+c.a+")";
}else{
rval="rgb("+mid+")";
}
this._rgbString=rval;
}
return rval;
},asRGB:function(){
return MochiKit.Base.clone(this.rgb);
},toHexString:function(){
var m=MochiKit.Color;
var c=this.rgb;
var ccc=MochiKit.Color.clampColorComponent;
var rval=this._hexString;
if(!rval){
rval=("#"+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
this._hexString=rval;
}
return rval;
},asHSV:function(){
var hsv=this.hsv;
var c=this.rgb;
if(typeof (hsv)=="undefined"||hsv==null){
hsv=MochiKit.Color.rgbToHSV(this.rgb);
this.hsv=hsv;
}
return MochiKit.Base.clone(hsv);
},asHSL:function(){
var hsl=this.hsl;
var c=this.rgb;
if(typeof (hsl)=="undefined"||hsl==null){
hsl=MochiKit.Color.rgbToHSL(this.rgb);
this.hsl=hsl;
}
return MochiKit.Base.clone(hsl);
},toString:function(){
return this.toRGBString();
},repr:function(){
var c=this.rgb;
var col=[c.r,c.g,c.b,c.a];
return this.__class__.NAME+"("+col.join(", ")+")";
}};
MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_461,blue,_462){
var _463=MochiKit.Color.Color;
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_461=rgb.g;
blue=rgb.b;
if(typeof (rgb.a)=="undefined"){
_462=undefined;
}else{
_462=rgb.a;
}
}
return new _463(red,_461,blue,_462);
},fromHSL:function(hue,_464,_465,_466){
var m=MochiKit.Color;
return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
},fromHSV:function(hue,_467,_468,_469){
var m=MochiKit.Color;
return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
},fromName:function(name){
var _470=MochiKit.Color.Color;
var _471=_470._namedColors[name.toLowerCase()];
if(typeof (_471)=="string"){
return _470.fromHexString(_471);
}else{
if(name=="transparent"){
return _470.transparentColor();
}
}
return null;
},fromString:function(_472){
var self=MochiKit.Color.Color;
var _473=_472.substr(0,3);
if(_473=="rgb"){
return self.fromRGBString(_472);
}else{
if(_473=="hsl"){
return self.fromHSLString(_472);
}else{
if(_472.charAt(0)=="#"){
return self.fromHexString(_472);
}
}
}
return self.fromName(_472);
},fromHexString:function(_474){
if(_474.charAt(0)=="#"){
_474=_474.substring(1);
}
var _475=[];
var i,hex;
if(_474.length==3){
for(i=0;i<3;i++){
hex=_474.substr(i,1);
_475.push(parseInt(hex+hex,16)/255);
}
}else{
for(i=0;i<6;i+=2){
hex=_474.substr(i,2);
_475.push(parseInt(hex,16)/255);
}
}
var _476=MochiKit.Color.Color;
return _476.fromRGB.apply(_476,_475);
},_fromColorString:function(pre,_478,_479,_480){
if(_480.indexOf(pre)==0){
_480=_480.substring(_480.indexOf("(",3)+1,_480.length-1);
}
var _481=_480.split(/\s*,\s*/);
var _482=[];
for(var i=0;i<_481.length;i++){
var c=_481[i];
var val;
var _483=c.substring(c.length-3);
if(c.charAt(c.length-1)=="%"){
val=0.01*parseFloat(c.substring(0,c.length-1));
}else{
if(_483=="deg"){
val=parseFloat(c)/360;
}else{
if(_483=="rad"){
val=parseFloat(c)/(Math.PI*2);
}else{
val=_479[i]*parseFloat(c);
}
}
}
_482.push(val);
}
return this[_478].apply(this,_482);
},fromComputedStyle:function(elem,_484,_485){
var d=MochiKit.DOM;
var cls=MochiKit.Color.Color;
for(elem=d.getElement(elem);elem;elem=elem.parentNode){
var _486=d.computedStyle.apply(d,arguments);
if(!_486){
continue;
}
var _487=cls.fromString(_486);
if(!_487){
break;
}
if(_487.asRGB().a>0){
return _487;
}
}
return null;
},fromBackground:function(elem){
var cls=MochiKit.Color.Color;
return cls.fromComputedStyle(elem,"backgroundColor","background-color")||cls.whiteColor();
},fromText:function(elem){
var cls=MochiKit.Color.Color;
return cls.fromComputedStyle(elem,"color","color")||cls.blackColor();
},namedColors:function(){
return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
}});
MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_488){
v*=_488;
if(v<0){
return 0;
}else{
if(v>_488){
return _488;
}else{
return v;
}
}
},_hslValue:function(n1,n2,hue){
if(hue>6){
hue-=6;
}else{
if(hue<0){
hue+=6;
}
}
var val;
if(hue<1){
val=n1+(n2-n1)*hue;
}else{
if(hue<3){
val=n2;
}else{
if(hue<4){
val=n1+(n2-n1)*(4-hue);
}else{
val=n1;
}
}
}
return val;
},hsvToRGB:function(hue,_491,_492,_493){
if(arguments.length==1){
var hsv=hue;
hue=hsv.h;
_491=hsv.s;
_492=hsv.v;
_493=hsv.a;
}
var red;
var _494;
var blue;
if(_491==0){
red=0;
_494=0;
blue=0;
}else{
var i=Math.floor(hue*6);
var f=(hue*6)-i;
var p=_492*(1-_491);
var q=_492*(1-(_491*f));
var t=_492*(1-(_491*(1-f)));
switch(i){
case 1:
red=q;
_494=_492;
blue=p;
break;
case 2:
red=p;
_494=_492;
blue=t;
break;
case 3:
red=p;
_494=q;
blue=_492;
break;
case 4:
red=t;
_494=p;
blue=_492;
break;
case 5:
red=_492;
_494=p;
blue=q;
break;
case 6:
case 0:
red=_492;
_494=t;
blue=p;
break;
}
}
return {r:red,g:_494,b:blue,a:_493};
},hslToRGB:function(hue,_496,_497,_498){
if(arguments.length==1){
var hsl=hue;
hue=hsl.h;
_496=hsl.s;
_497=hsl.l;
_498=hsl.a;
}
var red;
var _499;
var blue;
if(_496==0){
red=_497;
_499=_497;
blue=_497;
}else{
var m2;
if(_497<=0.5){
m2=_497*(1+_496);
}else{
m2=_497+_496-(_497*_496);
}
var m1=(2*_497)-m2;
var f=MochiKit.Color._hslValue;
var h6=hue*6;
red=f(m1,m2,h6+2);
_499=f(m1,m2,h6);
blue=f(m1,m2,h6-2);
}
return {r:red,g:_499,b:blue,a:_498};
},rgbToHSV:function(red,_503,blue,_504){
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_503=rgb.g;
blue=rgb.b;
_504=rgb.a;
}
var max=Math.max(Math.max(red,_503),blue);
var min=Math.min(Math.min(red,_503),blue);
var hue;
var _507;
var _508=max;
if(min==max){
hue=0;
_507=0;
}else{
var _509=(max-min);
_507=_509/max;
if(red==max){
hue=(_503-blue)/_509;
}else{
if(_503==max){
hue=2+((blue-red)/_509);
}else{
hue=4+((red-_503)/_509);
}
}
hue/=6;
if(hue<0){
hue+=1;
}
if(hue>1){
hue-=1;
}
}
return {h:hue,s:_507,v:_508,a:_504};
},rgbToHSL:function(red,_510,blue,_511){
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_510=rgb.g;
blue=rgb.b;
_511=rgb.a;
}
var max=Math.max(red,Math.max(_510,blue));
var min=Math.min(red,Math.min(_510,blue));
var hue;
var _512;
var _513=(max+min)/2;
var _514=max-min;
if(_514==0){
hue=0;
_512=0;
}else{
if(_513<=0.5){
_512=_514/(max+min);
}else{
_512=_514/(2-max-min);
}
if(red==max){
hue=(_510-blue)/_514;
}else{
if(_510==max){
hue=2+((blue-red)/_514);
}else{
hue=4+((red-_510)/_514);
}
}
hue/=6;
if(hue<0){
hue+=1;
}
if(hue>1){
hue-=1;
}
}
return {h:hue,s:_512,l:_513,a:_511};
},toColorPart:function(num){
var _515=Math.round(num).toString(16);
if(num<16){
return "0"+_515;
}
return _515;
},__new__:function(){
var m=MochiKit.Base;
this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]);
this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]);
var _516=1/3;
var _517={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_516,_516,_516],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_516,2*_516,2*_516],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]};
var _518=function(name,r,g,b,a){
var rval=this.fromRGB(r,g,b,a);
this[name]=function(){
return rval;
};
return rval;
};
for(var k in _517){
var name=k+"Color";
var _521=m.concat([_518,this.Color,name],_517[k]);
this.Color[name]=m.bind.apply(null,_521);
}
var _522=function(){
for(var i=0;i<arguments.length;i++){
if(!(arguments[i] instanceof Color)){
return false;
}
}
return true;
};
var _523=function(a,b){
return a.compareRGB(b);
};
m.nameFunctions(this);
m.registerComparator(this.Color.NAME,_522,_523);
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
}});
MochiKit.Color.EXPORT=["Color"];
MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
MochiKit.Color.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Color);
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"};
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Visual");
dojo.require("MochiKit.Base");
dojo.require("MochiKit.DOM");
dojo.require("MochiKit.Color");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
JSAN.use("MochiKit.DOM",[]);
JSAN.use("MochiKit.Color",[]);
}
try{
if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.DOM)=="undefined"||typeof (MochiKit.Color)=="undefined"){
throw "";
}
}
catch(e){
throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM and MochiKit.Color!";
}
if(typeof (MochiKit.Visual)=="undefined"){
MochiKit.Visual={};
}
MochiKit.Visual.NAME="MochiKit.Visual";
MochiKit.Visual.VERSION="1.2";
MochiKit.Visual.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Visual.toString=function(){
return this.__repr__();
};
MochiKit.Visual._RoundCorners=function(e,_524){
e=MochiKit.DOM.getElement(e);
this._setOptions(_524);
if(this.options.__unstable__wrapElement){
e=this._doWrap(e);
}
var _525=this.options.color;
var C=MochiKit.Color.Color;
if(this.options.color=="fromElement"){
_525=C.fromBackground(e);
}else{
if(!(_525 instanceof C)){
_525=C.fromString(_525);
}
}
this.isTransparent=(_525.asRGB().a<=0);
var _527=this.options.bgColor;
if(this.options.bgColor=="fromParent"){
_527=C.fromBackground(e.offsetParent);
}else{
if(!(_527 instanceof C)){
_527=C.fromString(_527);
}
}
this._roundCornersImpl(e,_525,_527);
};
MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
var _528=e.parentNode;
var doc=MochiKit.DOM.currentDocument();
if(typeof (doc.defaultView)=="undefined"||doc.defaultView==null){
return e;
}
var _529=doc.defaultView.getComputedStyle(e,null);
if(typeof (_529)=="undefined"||_529==null){
return e;
}
var _530=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_529.getPropertyValue("padding-top"),marginRight:_529.getPropertyValue("padding-right"),marginBottom:_529.getPropertyValue("padding-bottom"),marginLeft:_529.getPropertyValue("padding-left"),padding:"0px"}});
_530.innerHTML=e.innerHTML;
e.innerHTML="";
e.appendChild(_530);
return e;
},_roundCornersImpl:function(e,_531,_532){
if(this.options.border){
this._renderBorder(e,_532);
}
if(this._isTopRounded()){
this._roundTopCorners(e,_531,_532);
}
if(this._isBottomRounded()){
this._roundBottomCorners(e,_531,_532);
}
},_renderBorder:function(el,_533){
var _534="1px solid "+this._borderColor(_533);
var _535="border-left: "+_534;
var _536="border-right: "+_534;
var _537="style='"+_535+";"+_536+"'";
el.innerHTML="<div "+_537+">"+el.innerHTML+"</div>";
},_roundTopCorners:function(el,_538,_539){
var _540=this._createCorner(_539);
for(var i=0;i<this.options.numSlices;i++){
_540.appendChild(this._createCornerSlice(_538,_539,i,"top"));
}
el.style.paddingTop=0;
el.insertBefore(_540,el.firstChild);
},_roundBottomCorners:function(el,_541,_542){
var _543=this._createCorner(_542);
for(var i=(this.options.numSlices-1);i>=0;i--){
_543.appendChild(this._createCornerSlice(_541,_542,i,"bottom"));
}
el.style.paddingBottom=0;
el.appendChild(_543);
},_createCorner:function(_544){
var dom=MochiKit.DOM;
return dom.DIV({style:{backgroundColor:_544.toString()}});
},_createCornerSlice:function(_545,_546,n,_547){
var _548=MochiKit.DOM.SPAN();
var _549=_548.style;
_549.backgroundColor=_545.toString();
_549.display="block";
_549.height="1px";
_549.overflow="hidden";
_549.fontSize="1px";
var _550=this._borderColor(_545,_546);
if(this.options.border&&n==0){
_549.borderTopStyle="solid";
_549.borderTopWidth="1px";
_549.borderLeftWidth="0px";
_549.borderRightWidth="0px";
_549.borderBottomWidth="0px";
_549.height="0px";
_549.borderColor=_550.toString();
}else{
if(_550){
_549.borderColor=_550.toString();
_549.borderStyle="solid";
_549.borderWidth="0px 1px";
}
}
if(!this.options.compact&&(n==(this.options.numSlices-1))){
_549.height="2px";
}
this._setMargin(_548,n,_547);
this._setBorder(_548,n,_547);
return _548;
},_setOptions:function(_551){
this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
MochiKit.Base.update(this.options,_551);
this.options.numSlices=(this.options.compact?2:4);
},_whichSideTop:function(){
var _552=this.options.corners;
if(this._hasString(_552,"all","top")){
return "";
}
var _553=(_552.indexOf("tl")!=-1);
var _554=(_552.indexOf("tr")!=-1);
if(_553&&_554){
return "";
}
if(_553){
return "left";
}
if(_554){
return "right";
}
return "";
},_whichSideBottom:function(){
var _555=this.options.corners;
if(this._hasString(_555,"all","bottom")){
return "";
}
var _556=(_555.indexOf("bl")!=-1);
var _557=(_555.indexOf("br")!=-1);
if(_556&&_557){
return "";
}
if(_556){
return "left";
}
if(_557){
return "right";
}
return "";
},_borderColor:function(_558,_559){
if(_558=="transparent"){
return _559;
}else{
if(this.options.border){
return this.options.border;
}else{
if(this.options.blend){
return _559.blendedColor(_558);
}
}
}
return "";
},_setMargin:function(el,n,_560){
var _561=this._marginSize(n)+"px";
var _562=(_560=="top"?this._whichSideTop():this._whichSideBottom());
var _563=el.style;
if(_562=="left"){
_563.marginLeft=_561;
_563.marginRight="0px";
}else{
if(_562=="right"){
_563.marginRight=_561;
_563.marginLeft="0px";
}else{
_563.marginLeft=_561;
_563.marginRight=_561;
}
}
},_setBorder:function(el,n,_564){
var _565=this._borderSize(n)+"px";
var _566=(_564=="top"?this._whichSideTop():this._whichSideBottom());
var _567=el.style;
if(_566=="left"){
_567.borderLeftWidth=_565;
_567.borderRightWidth="0px";
}else{
if(_566=="right"){
_567.borderRightWidth=_565;
_567.borderLeftWidth="0px";
}else{
_567.borderLeftWidth=_565;
_567.borderRightWidth=_565;
}
}
},_marginSize:function(n){
if(this.isTransparent){
return 0;
}
var o=this.options;
if(o.compact&&o.blend){
var _568=[1,0];
return _568[n];
}else{
if(o.compact){
var _569=[2,1];
return _569[n];
}else{
if(o.blend){
var _570=[3,2,1,0];
return _570[n];
}else{
var _571=[5,3,2,1];
return _571[n];
}
}
}
},_borderSize:function(n){
var o=this.options;
var _572;
if(o.compact&&(o.blend||this.isTransparent)){
return 1;
}else{
if(o.compact){
_572=[1,0];
}else{
if(o.blend){
_572=[2,1,1,1];
}else{
if(o.border){
_572=[0,2,0,0];
}else{
if(this.isTransparent){
_572=[5,3,2,1];
}else{
return 0;
}
}
}
}
}
return _572[n];
},_hasString:function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])!=-1){
return true;
}
}
return false;
},_isTopRounded:function(){
return this._hasString(this.options.corners,"all","top","tl","tr");
},_isBottomRounded:function(){
return this._hasString(this.options.corners,"all","bottom","bl","br");
},_hasSingleTextChild:function(el){
return (el.childNodes.length==1&&el.childNodes[0].nodeType==3);
}};
MochiKit.Visual.roundElement=function(e,_573){
new MochiKit.Visual._RoundCorners(e,_573);
};
MochiKit.Visual.roundClass=function(_574,_575,_576){
var _577=MochiKit.DOM.getElementsByTagAndClassName(_574,_575);
for(var i=0;i<_577.length;i++){
MochiKit.Visual.roundElement(_577[i],_576);
}
};
MochiKit.Visual.Color=MochiKit.Color.Color;
MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
MochiKit.Visual.__new__=function(){
var m=MochiKit.Base;
m.nameFunctions(this);
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
};
MochiKit.Visual.EXPORT=["roundElement","roundClass"];
MochiKit.Visual.EXPORT_OK=[];
MochiKit.Visual.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Visual);
if(typeof (MochiKit)=="undefined"){
MochiKit={};
}
if(typeof (MochiKit.MochiKit)=="undefined"){
MochiKit.MochiKit={};
}
MochiKit.MochiKit.NAME="MochiKit.MochiKit";
MochiKit.MochiKit.VERSION="1.2";
MochiKit.MochiKit.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.MochiKit.toString=function(){
return this.__repr__();
};
MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","LoggingPane","Color","Visual"];
if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.MochiKit");
dojo.require("MochiKit.*");
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit.Base",[]);
JSAN.use("MochiKit.Iter",[]);
JSAN.use("MochiKit.Logging",[]);
JSAN.use("MochiKit.DateTime",[]);
JSAN.use("MochiKit.Format",[]);
JSAN.use("MochiKit.Async",[]);
JSAN.use("MochiKit.DOM",[]);
JSAN.use("MochiKit.LoggingPane",[]);
JSAN.use("MochiKit.Color",[]);
JSAN.use("MochiKit.Visual",[]);
}
(function(){
var _578=MochiKit.Base.extend;
var self=MochiKit.MochiKit;
var _579=self.SUBMODULES;
var _580=[];
var _581=[];
var _582={};
var i,k,m,all;
for(i=0;i<_579.length;i++){
m=MochiKit[_579[i]];
_578(_580,m.EXPORT);
_578(_581,m.EXPORT_OK);
for(k in m.EXPORT_TAGS){
_582[k]=_578(_582[k],m.EXPORT_TAGS[k]);
}
all=m.EXPORT_TAGS[":all"];
if(!all){
all=_578(null,m.EXPORT,m.EXPORT_OK);
}
for(i=0;i<all.length;i++){
k=all[i];
self[k]=m[k];
}
}
self.EXPORT=_580;
self.EXPORT_OK=_581;
self.EXPORT_TAGS=_582;
}());
}else{
if(typeof (MochiKit.__compat__)=="undefined"){
MochiKit.__compat__=true;
}
(function(){
var _583=document.getElementsByTagName("script");
var _584="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var base=null;
var _585=null;
var _586={};
var i;
for(i=0;i<_583.length;i++){
var src=_583[i].getAttribute("src");
if(!src){
continue;
}
_586[src]=true;
if(src.match(/MochiKit.js$/)){
base=src.substring(0,src.lastIndexOf("MochiKit.js"));
_585=_583[i];
}
}
if(base==null){
return;
}
var _587=MochiKit.MochiKit.SUBMODULES;
for(i=0;i<_587.length;i++){
if(MochiKit[_587[i]]){
continue;
}
var uri=base+_587[i]+".js";
if(uri in _586){
continue;
}
if(document.documentElement&&document.documentElement.namespaceURI==_584){
var s=document.createElementNS(_584,"script");
s.setAttribute("id","MochiKit_"+base+_587[i]);
s.setAttribute("src",uri);
s.setAttribute("type","application/x-javascript");
_585.parentNode.appendChild(s);
}else{
var tag="<"+"script src=\""+uri+"\" type=\"text/javascript\""+">"+"<"+"/script"+">";
document.write(tag);
}
}
})();
}


