/***

    MochiKit.MochiKit 1.4.1 : 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={};
}
if(typeof (MochiKit.__export__)=="undefined"){
MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
}
MochiKit.Base.VERSION="1.4.1";
MochiKit.Base.NAME="MochiKit.Base";
MochiKit.Base.update=function(_1,_2){
if(_1===null||_1===undefined){
_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__();
},camelize:function(_6){
var _7=_6.split("-");
var cc=_7[0];
for(var i=1;i<_7.length;i++){
cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
}
return cc;
},counter:function(n){
if(arguments.length===0){
n=1;
}
return function(){
return n++;
};
},clone:function(_b){
var me=arguments.callee;
if(arguments.length==1){
me.prototype=_b;
return new me();
}
},_deps:function(_d,_e){
if(!(_d in MochiKit)){
MochiKit[_d]={};
}
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit."+_d);
}
for(var i=0;i<_e.length;i++){
if(typeof (dojo)!="undefined"){
dojo.require("MochiKit."+_e[i]);
}
if(typeof (JSAN)!="undefined"){
JSAN.use("MochiKit."+_e[i],[]);
}
if(!(_e[i] in MochiKit)){
throw "MochiKit."+_d+" depends on MochiKit."+_e[i]+"!";
}
}
},_flattenArray:function(res,lst){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(o instanceof Array){
arguments.callee(res,o);
}else{
res.push(o);
}
}
return res;
},flattenArray:function(lst){
return MochiKit.Base._flattenArray([],lst);
},flattenArguments:function(lst){
var res=[];
var m=MochiKit.Base;
var _18=m.extend(null,arguments);
while(_18.length){
var o=_18.shift();
if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
for(var i=o.length-1;i>=0;i--){
_18.unshift(o[i]);
}
}else{
res.push(o);
}
}
return res;
},extend:function(_1b,obj,_1d){
if(!_1d){
_1d=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(!_1b){
_1b=[];
}
for(var i=_1d;i<l;i++){
_1b.push(obj[i]);
}
}
return _1b;
},updatetree:function(_20,obj){
if(_20===null||_20===undefined){
_20={};
}
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 (_20[k])=="object"&&typeof (v)=="object"){
arguments.callee(_20[k],v);
}else{
_20[k]=v;
}
}
}
}
return _20;
},setdefault:function(_26,obj){
if(_26===null||_26===undefined){
_26={};
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
for(var k in o){
if(!(k in _26)){
_26[k]=o[k];
}
}
}
return _26;
},keys:function(obj){
var _2c=[];
for(var _2d in obj){
_2c.push(_2d);
}
return _2c;
},values:function(obj){
var _2f=[];
for(var _30 in obj){
_2f.push(obj[_30]);
}
return _2f;
},items:function(obj){
var _32=[];
var e;
for(var _34 in obj){
var v;
try{
v=obj[_34];
}
catch(e){
continue;
}
_32.push([_34,v]);
}
return _32;
},_newNamedError:function(_36,_37,_38){
_38.prototype=new MochiKit.Base.NamedError(_36.NAME+"."+_37);
_36[_37]=_38;
},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;
},seq:function(a,b){
return a===b;
},sne:function(a,b){
return a!==b;
},ceq:function(a,b){
return MochiKit.Base.compare(a,b)===0;
},cne:function(a,b){
return MochiKit.Base.compare(a,b)!==0;
},cgt:function(a,b){
return MochiKit.Base.compare(a,b)==1;
},cge:function(a,b){
return MochiKit.Base.compare(a,b)!=-1;
},clt:function(a,b){
return MochiKit.Base.compare(a,b)==-1;
},cle:function(a,b){
return MochiKit.Base.compare(a,b)!=1;
},logand:function(a,b){
return a&&b;
},logor:function(a,b){
return a||b;
},contains:function(a,b){
return b in a;
}},forwardCall:function(_76){
return function(){
return this[_76].apply(this,arguments);
};
},itemgetter:function(_77){
return function(arg){
return arg[_77];
};
},typeMatcher:function(){
var _79={};
for(var i=0;i<arguments.length;i++){
var typ=arguments[i];
_79[typ]=typ;
}
return function(){
for(var i=0;i<arguments.length;i++){
if(!(typeof (arguments[i]) in _79)){
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;
},isEmpty:function(obj){
return !MochiKit.Base.isNotEmpty.apply(this,arguments);
},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"||o.nodeType===3||o.nodeType===4){
return false;
}
}
return true;
},isDateLike:function(){
for(var i=0;i<arguments.length;i++){
var o=arguments[i];
if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
return false;
}
}
return true;
},xmap:function(fn){
if(fn===null){
return MochiKit.Base.extend(null,arguments,1);
}
var _8a=[];
for(var i=1;i<arguments.length;i++){
_8a.push(fn(arguments[i]));
}
return _8a;
},map:function(fn,lst){
var m=MochiKit.Base;
var itr=MochiKit.Iter;
var _90=m.isArrayLike;
if(arguments.length<=2){
if(!_90(lst)){
if(itr){
lst=itr.list(lst);
if(fn===null){
return lst;
}
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
if(fn===null){
return m.extend(null,lst);
}
var _91=[];
for(var i=0;i<lst.length;i++){
_91.push(fn(lst[i]));
}
return _91;
}else{
if(fn===null){
fn=Array;
}
var _93=null;
for(i=1;i<arguments.length;i++){
if(!_90(arguments[i])){
if(itr){
return itr.list(itr.imap.apply(null,arguments));
}else{
throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
}
}
var l=arguments[i].length;
if(_93===null||_93>l){
_93=l;
}
}
_91=[];
for(i=0;i<_93;i++){
var _95=[];
for(var j=1;j<arguments.length;j++){
_95.push(arguments[j][i]);
}
_91.push(fn.apply(this,_95));
}
return _91;
}
},xfilter:function(fn){
var _98=[];
if(fn===null){
fn=MochiKit.Base.operator.truth;
}
for(var i=1;i<arguments.length;i++){
var o=arguments[i];
if(fn(o)){
_98.push(o);
}
}
return _98;
},filter:function(fn,lst,_9d){
var _9e=[];
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,_9d);
}else{
if(typeof (_9d)=="undefined"||_9d===null){
for(var i=0;i<lst.length;i++){
var o=lst[i];
if(fn(o)){
_9e.push(o);
}
}
}else{
for(i=0;i<lst.length;i++){
o=lst[i];
if(fn.call(_9d,o)){
_9e.push(o);
}
}
}
}
return _9e;
},_wrapDumbFunction:function(_a2){
return function(){
switch(arguments.length){
case 0:
return _a2();
case 1:
return _a2(arguments[0]);
case 2:
return _a2(arguments[0],arguments[1]);
case 3:
return _a2(arguments[0],arguments[1],arguments[2]);
}
var _a3=[];
for(var i=0;i<arguments.length;i++){
_a3.push("arguments["+i+"]");
}
return eval("(func("+_a3.join(",")+"))");
};
},methodcaller:function(_a5){
var _a6=MochiKit.Base.extend(null,arguments,1);
if(typeof (_a5)=="function"){
return function(obj){
return _a5.apply(obj,_a6);
};
}else{
return function(obj){
return obj[_a5].apply(obj,_a6);
};
}
},method:function(_a9,_aa){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([_aa,_a9],arguments,2));
},compose:function(f1,f2){
var _ae=[];
var m=MochiKit.Base;
if(arguments.length===0){
throw new TypeError("compose() requires at least one argument");
}
for(var i=0;i<arguments.length;i++){
var fn=arguments[i];
if(typeof (fn)!="function"){
throw new TypeError(m.repr(fn)+" is not a function");
}
_ae.push(fn);
}
return function(){
var _b2=arguments;
for(var i=_ae.length-1;i>=0;i--){
_b2=[_ae[i].apply(this,_b2)];
}
return _b2[0];
};
},bind:function(_b4,_b5){
if(typeof (_b4)=="string"){
_b4=_b5[_b4];
}
var _b6=_b4.im_func;
var _b7=_b4.im_preargs;
var _b8=_b4.im_self;
var m=MochiKit.Base;
if(typeof (_b4)=="function"&&typeof (_b4.apply)=="undefined"){
_b4=m._wrapDumbFunction(_b4);
}
if(typeof (_b6)!="function"){
_b6=_b4;
}
if(typeof (_b5)!="undefined"){
_b8=_b5;
}
if(typeof (_b7)=="undefined"){
_b7=[];
}else{
_b7=_b7.slice();
}
m.extend(_b7,arguments,2);
var _ba=function(){
var _bb=arguments;
var me=arguments.callee;
if(me.im_preargs.length>0){
_bb=m.concat(me.im_preargs,_bb);
}
var _bd=me.im_self;
if(!_bd){
_bd=this;
}
return me.im_func.apply(_bd,_bb);
};
_ba.im_self=_b8;
_ba.im_func=_b6;
_ba.im_preargs=_b7;
return _ba;
},bindLate:function(_be,_bf){
var m=MochiKit.Base;
if(typeof (_be)!="string"){
return m.bind.apply(this,arguments);
}
var _c1=m.extend([],arguments,2);
var _c2=function(){
var _c3=arguments;
var me=arguments.callee;
if(me.im_preargs.length>0){
_c3=m.concat(me.im_preargs,_c3);
}
var _c5=me.im_self;
if(!_c5){
_c5=this;
}
return _c5[me.im_func].apply(_c5,_c3);
};
_c2.im_self=_bf;
_c2.im_func=_be;
_c2.im_preargs=_c1;
return _c2;
},bindMethods:function(_c6){
var _c7=MochiKit.Base.bind;
for(var k in _c6){
var _c9=_c6[k];
if(typeof (_c9)=="function"){
_c6[k]=_c7(_c9,_c6);
}
}
},registerComparator:function(_ca,_cb,_cc,_cd){
MochiKit.Base.comparatorRegistry.register(_ca,_cb,_cc,_cd);
},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
if(a==b){
return 0;
}
var _d0=(typeof (a)=="undefined"||a===null);
var _d1=(typeof (b)=="undefined"||b===null);
if(_d0&&_d1){
return 0;
}else{
if(_d0){
return -1;
}else{
if(_d1){
return 1;
}
}
}
var m=MochiKit.Base;
var _d3=m._primitives;
if(!(typeof (a) in _d3&&typeof (b) in _d3)){
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 _d4=m.repr;
throw new TypeError(_d4(a)+" and "+_d4(b)+" can not be compared");
},compareDateLike:function(a,b){
return MochiKit.Base.compare(a.getTime(),b.getTime());
},compareArrayLike:function(a,b){
var _d9=MochiKit.Base.compare;
var _da=a.length;
var _db=0;
if(_da>b.length){
_db=1;
_da=b.length;
}else{
if(_da<b.length){
_db=-1;
}
}
for(var i=0;i<_da;i++){
var cmp=_d9(a[i],b[i]);
if(cmp){
return cmp;
}
}
return _db;
},registerRepr:function(_de,_df,_e0,_e1){
MochiKit.Base.reprRegistry.register(_de,_df,_e0,_e1);
},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 _e3=(o+"");
}
catch(e){
return "["+typeof (o)+"]";
}
if(typeof (o)=="function"){
_e3=_e3.replace(/^\s+/,"").replace(/\s+/g," ");
_e3=_e3.replace(/,(\S)/,", $1");
var idx=_e3.indexOf("{");
if(idx!=-1){
_e3=_e3.substr(0,idx)+"{...}";
}
}
return _e3;
},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(/[\v]/g,"\\v").replace(/[\r]/g,"\\r");
},reprNumber:function(o){
return o+"";
},registerJSON:function(_e9,_ea,_eb,_ec){
MochiKit.Base.jsonRegistry.register(_e9,_ea,_eb,_ec);
},evalJSON:function(){
return eval("("+MochiKit.Base._filterJSON(arguments[0])+")");
},_filterJSON:function(s){
var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
if(m){
return m[1];
}
return s;
},serializeJSON:function(o){
var _f0=typeof (o);
if(_f0=="number"||_f0=="boolean"){
return o+"";
}else{
if(o===null){
return "null";
}else{
if(_f0=="string"){
var res="";
for(var i=0;i<o.length;i++){
var c=o.charAt(i);
if(c=="\""){
res+="\\\"";
}else{
if(c=="\\"){
res+="\\\\";
}else{
if(c=="\b"){
res+="\\b";
}else{
if(c=="\f"){
res+="\\f";
}else{
if(c=="\n"){
res+="\\n";
}else{
if(c=="\r"){
res+="\\r";
}else{
if(c=="\t"){
res+="\\t";
}else{
if(o.charCodeAt(i)<=31){
var hex=o.charCodeAt(i).toString(16);
if(hex.length<2){
hex="0"+hex;
}
res+="\\u00"+hex.toUpperCase();
}else{
res+=c;
}
}
}
}
}
}
}
}
}
return "\""+res+"\"";
}
}
}
var me=arguments.callee;
var _f6;
if(typeof (o.__json__)=="function"){
_f6=o.__json__();
if(o!==_f6){
return me(_f6);
}
}
if(typeof (o.json)=="function"){
_f6=o.json();
if(o!==_f6){
return me(_f6);
}
}
if(_f0!="function"&&typeof (o.length)=="number"){
var res=[];
for(var i=0;i<o.length;i++){
var val=me(o[i]);
if(typeof (val)!="string"){
continue;
}
res.push(val);
}
return "["+res.join(", ")+"]";
}
var m=MochiKit.Base;
try{
_f6=m.jsonRegistry.match(o);
if(o!==_f6){
return me(_f6);
}
}
catch(e){
if(e!=m.NotFound){
throw e;
}
}
if(_f0=="undefined"){
throw new TypeError("undefined can not be serialized as JSON");
}
if(_f0=="function"){
return null;
}
res=[];
for(var k in o){
var _fa;
if(typeof (k)=="number"){
_fa="\""+k+"\"";
}else{
if(typeof (k)=="string"){
_fa=me(k);
}else{
continue;
}
}
val=me(o[k]);
if(typeof (val)!="string"){
continue;
}
res.push(_fa+":"+val);
}
return "{"+res.join(", ")+"}";
},objEqual:function(a,b){
return (MochiKit.Base.compare(a,b)===0);
},arrayEqual:function(_fd,arr){
if(_fd.length!=arr.length){
return false;
}
return (MochiKit.Base.compare(_fd,arr)===0);
},concat:function(){
var _ff=[];
var _100=MochiKit.Base.extend;
for(var i=0;i<arguments.length;i++){
_100(_ff,arguments[i]);
}
return _ff;
},keyComparator:function(key){
var m=MochiKit.Base;
var _104=m.compare;
if(arguments.length==1){
return function(a,b){
return _104(a[key],b[key]);
};
}
var _107=m.extend(null,arguments);
return function(a,b){
var rval=0;
for(var i=0;(rval===0)&&(i<_107.length);i++){
var key=_107[i];
rval=_104(a[key],b[key]);
}
return rval;
};
},reverseKeyComparator:function(key){
var _10e=MochiKit.Base.keyComparator.apply(this,arguments);
return function(a,b){
return _10e(b,a);
};
},partial:function(func){
var m=MochiKit.Base;
return m.bind.apply(this,m.extend([func,undefined],arguments,1));
},listMinMax:function(_113,lst){
if(lst.length===0){
return null;
}
var cur=lst[0];
var _116=MochiKit.Base.compare;
for(var i=1;i<lst.length;i++){
var o=lst[i];
if(_116(o,cur)==_113){
cur=o;
}
}
return cur;
},objMax:function(){
return MochiKit.Base.listMinMax(1,arguments);
},objMin:function(){
return MochiKit.Base.listMinMax(-1,arguments);
},findIdentical:function(lst,_11a,_11b,end){
if(typeof (end)=="undefined"||end===null){
end=lst.length;
}
if(typeof (_11b)=="undefined"||_11b===null){
_11b=0;
}
for(var i=_11b;i<end;i++){
if(lst[i]===_11a){
return i;
}
}
return -1;
},mean:function(){
var sum=0;
var m=MochiKit.Base;
var args=m.extend(null,arguments);
var _121=args.length;
while(args.length){
var o=args.shift();
if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
_121+=o.length-1;
for(var i=o.length-1;i>=0;i--){
sum+=o[i];
}
}else{
sum+=o;
}
}
if(_121<=0){
throw new TypeError("mean() requires at least one argument");
}
return sum/_121;
},median:function(){
var data=MochiKit.Base.flattenArguments(arguments);
if(data.length===0){
throw new TypeError("median() requires at least one argument");
}
data.sort(compare);
if(data.length%2==0){
var _125=data.length/2;
return (data[_125]+data[_125-1])/2;
}else{
return data[(data.length-1)/2];
}
},findValue:function(lst,_127,_128,end){
if(typeof (end)=="undefined"||end===null){
end=lst.length;
}
if(typeof (_128)=="undefined"||_128===null){
_128=0;
}
var cmp=MochiKit.Base.compare;
for(var i=_128;i<end;i++){
if(cmp(lst[i],_127)===0){
return i;
}
}
return -1;
},nodeWalk:function(node,_12d){
var _12e=[node];
var _12f=MochiKit.Base.extend;
while(_12e.length){
var res=_12d(_12e.shift());
if(res){
_12f(_12e,res);
}
}
},nameFunctions:function(_131){
var base=_131.NAME;
if(typeof (base)=="undefined"){
base="";
}else{
base=base+".";
}
for(var name in _131){
var o=_131[name];
if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
try{
o.NAME=base+name;
}
catch(e){
}
}
}
},queryString:function(_135,_136){
if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_135)=="string"||(typeof (_135.nodeType)!="undefined"&&_135.nodeType>0))){
var kv=MochiKit.DOM.formContents(_135);
_135=kv[0];
_136=kv[1];
}else{
if(arguments.length==1){
if(typeof (_135.length)=="number"&&_135.length==2){
return arguments.callee(_135[0],_135[1]);
}
var o=_135;
_135=[];
_136=[];
for(var k in o){
var v=o[k];
if(typeof (v)=="function"){
continue;
}else{
if(MochiKit.Base.isArrayLike(v)){
for(var i=0;i<v.length;i++){
_135.push(k);
_136.push(v[i]);
}
}else{
_135.push(k);
_136.push(v);
}
}
}
}
}
var rval=[];
var len=Math.min(_135.length,_136.length);
var _13e=MochiKit.Base.urlEncode;
for(var i=0;i<len;i++){
v=_136[i];
if(typeof (v)!="undefined"&&v!==null){
rval.push(_13e(_135[i])+"="+_13e(v));
}
}
return rval.join("&");
},parseQueryString:function(_13f,_140){
var qstr=(_13f.charAt(0)=="?")?_13f.substring(1):_13f;
var _142=qstr.replace(/\+/g,"%20").split(/\&amp\;|\&\#38\;|\&#x26;|\&/);
var o={};
var _144;
if(typeof (decodeURIComponent)!="undefined"){
_144=decodeURIComponent;
}else{
_144=unescape;
}
if(_140){
for(var i=0;i<_142.length;i++){
var pair=_142[i].split("=");
var name=_144(pair.shift());
if(!name){
continue;
}
var arr=o[name];
if(!(arr instanceof Array)){
arr=[];
o[name]=arr;
}
arr.push(_144(pair.join("=")));
}
}else{
for(i=0;i<_142.length;i++){
pair=_142[i].split("=");
var name=pair.shift();
if(!name){
continue;
}
o[_144(name)]=_144(pair.join("="));
}
}
return o;
}});
MochiKit.Base.AdapterRegistry=function(){
this.pairs=[];
};
MochiKit.Base.AdapterRegistry.prototype={register:function(name,_14a,wrap,_14c){
if(_14c){
this.pairs.unshift([name,_14a,wrap]);
}else{
this.pairs.push([name,_14a,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=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindLate","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"];
MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
MochiKit.Base._exportSymbols=function(_152,_153){
if(!MochiKit.__export__){
return;
}
var all=_153.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_152[all[i]]=_153[all[i]];
}
};
MochiKit.Base.__new__=function(){
var m=this;
m.noop=m.operator.identity;
m.forward=m.forwardCall;
m.find=m.findValue;
if(typeof (encodeURIComponent)!="undefined"){
m.urlEncode=function(_157){
return encodeURIComponent(_157).replace(/\'/g,"%27");
};
}else{
m.urlEncode=function(_158){
return escape(_158).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.forwardCall("repr")});
m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
m.listMax=m.partial(m.listMinMax,1);
m.listMin=m.partial(m.listMinMax,-1);
m.isCallable=m.typeMatcher("function");
m.isUndefined=m.typeMatcher("undefined");
m.merge=m.partial(m.update,null);
m.zip=m.partial(m.map,null);
m.average=m.mean;
m.comparatorRegistry=new m.AdapterRegistry();
m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
m.reprRegistry=new m.AdapterRegistry();
m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
m.registerRepr("string",m.typeMatcher("string"),m.reprString);
m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
m.jsonRegistry=new m.AdapterRegistry();
var all=m.concat(m.EXPORT,m.EXPORT_OK);
m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
m.nameFunctions(this);
};
MochiKit.Base.__new__();
if(MochiKit.__export__){
compare=MochiKit.Base.compare;
compose=MochiKit.Base.compose;
serializeJSON=MochiKit.Base.serializeJSON;
mean=MochiKit.Base.mean;
median=MochiKit.Base.median;
}
MochiKit.Base._exportSymbols(this,MochiKit.Base);
MochiKit.Base._deps("Iter",["Base"]);
MochiKit.Iter.NAME="MochiKit.Iter";
MochiKit.Iter.VERSION="1.4.1";
MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
return "["+this.NAME+" "+this.VERSION+"]";
},toString:function(){
return this.__repr__();
},registerIteratorFactory:function(name,_15c,_15d,_15e){
MochiKit.Iter.iteratorRegistry.register(name,_15c,_15d,_15e);
},isIterable:function(o){
return o!=null&&(typeof (o.next)=="function"||typeof (o.iter)=="function");
},iter:function(_160,_161){
var self=MochiKit.Iter;
if(arguments.length==2){
return self.takewhile(function(a){
return a!=_161;
},_160);
}
if(typeof (_160.next)=="function"){
return _160;
}else{
if(typeof (_160.iter)=="function"){
return _160.iter();
}
}
try{
return self.iteratorRegistry.match(_160);
}
catch(e){
var m=MochiKit.Base;
if(e==m.NotFound){
e=new TypeError(typeof (_160)+": "+m.repr(_160)+" is not iterable");
}
throw e;
}
},count:function(n){
if(!n){
n=0;
}
var m=MochiKit.Base;
return {repr:function(){
return "count("+n+")";
},toString:m.forwardCall("repr"),next:m.counter(n)};
},cycle:function(p){
var self=MochiKit.Iter;
var m=MochiKit.Base;
var lst=[];
var _16b=self.iter(p);
return {repr:function(){
return "cycle(...)";
},toString:m.forwardCall("repr"),next:function(){
try{
var rval=_16b.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.forwardCall("repr"),next:function(){
return elem;
}};
}
return {repr:function(){
return "repeat("+m.repr(elem)+", "+n+")";
},toString:m.forwardCall("repr"),next:function(){
if(n<=0){
throw MochiKit.Iter.StopIteration;
}
n-=1;
return elem;
}};
},next:function(_171){
return _171.next();
},izip:function(p,q){
var m=MochiKit.Base;
var self=MochiKit.Iter;
var next=self.next;
var _177=m.map(self.iter,arguments);
return {repr:function(){
return "izip(...)";
},toString:m.forwardCall("repr"),next:function(){
return m.map(next,_177);
}};
},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.forwardCall("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.forwardCall("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 _183=0;
var stop=0;
var step=1;
var i=-1;
if(arguments.length==2){
stop=arguments[1];
}else{
if(arguments.length==3){
_183=arguments[1];
stop=arguments[2];
}else{
_183=arguments[1];
stop=arguments[2];
step=arguments[3];
}
}
return {repr:function(){
return "islice("+["...",_183,stop,step].join(", ")+")";
},toString:m.forwardCall("repr"),next:function(){
var rval;
while(i<_183){
rval=seq.next();
i++;
}
if(_183>=stop){
throw self.StopIteration;
}
_183+=step;
return rval;
}};
},imap:function(fun,p,q){
var m=MochiKit.Base;
var self=MochiKit.Iter;
var _18d=m.map(self.iter,m.extend(null,arguments,1));
var map=m.map;
var next=self.next;
return {repr:function(){
return "imap(...)";
},toString:m.forwardCall("repr"),next:function(){
return fun.apply(this,map(next,_18d));
}};
},applymap:function(fun,seq,self){
seq=MochiKit.Iter.iter(seq);
var m=MochiKit.Base;
return {repr:function(){
return "applymap(...)";
},toString:m.forwardCall("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 _198=m.map(self.iter,arguments);
return {repr:function(){
return "chain(...)";
},toString:m.forwardCall("repr"),next:function(){
while(_198.length>1){
try{
var _199=_198[0].next();
return _199;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
_198.shift();
var _199=_198[0].next();
return _199;
}
}
if(_198.length==1){
var arg=_198.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.forwardCall("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.forwardCall("repr"),"next":function(){
while(true){
var rval=seq.next();
if(!pred(rval)){
break;
}
}
this.next=bind("next",seq);
return rval;
}};
},_tee:function(_1a4,sync,_1a6){
sync.pos[_1a4]=-1;
var m=MochiKit.Base;
var _1a8=m.listMin;
return {repr:function(){
return "tee("+_1a4+", ...)";
},toString:m.forwardCall("repr"),next:function(){
var rval;
var i=sync.pos[_1a4];
if(i==sync.max){
rval=_1a6.next();
sync.deque.push(rval);
sync.max+=1;
sync.pos[_1a4]+=1;
}else{
rval=sync.deque[i-sync.min];
sync.pos[_1a4]+=1;
if(i==sync.min&&_1a8(sync.pos)!=sync.min){
sync.min+=1;
sync.deque.shift();
}
}
return rval;
}};
},tee:function(_1ab,n){
var rval=[];
var sync={"pos":[],"deque":[],"max":-1,"min":-1};
if(arguments.length==1||typeof (n)=="undefined"||n===null){
n=2;
}
var self=MochiKit.Iter;
_1ab=self.iter(_1ab);
var _tee=self._tee;
for(var i=0;i<n;i++){
rval.push(_tee(i,sync,_1ab));
}
return rval;
},list:function(_1b2){
var rval;
if(_1b2 instanceof Array){
return _1b2.slice();
}
if(typeof (_1b2)=="function"&&!(_1b2 instanceof Function)&&typeof (_1b2.length)=="number"){
rval=[];
for(var i=0;i<_1b2.length;i++){
rval.push(_1b2[i]);
}
return rval;
}
var self=MochiKit.Iter;
_1b2=self.iter(_1b2);
var rval=[];
var _1b6;
try{
while(true){
_1b6=_1b2.next();
rval.push(_1b6);
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return rval;
}
return undefined;
},reduce:function(fn,_1b8,_1b9){
var i=0;
var x=_1b9;
var self=MochiKit.Iter;
_1b8=self.iter(_1b8);
if(arguments.length<3){
try{
x=_1b8.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,_1b8.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},range:function(){
var _1bd=0;
var stop=0;
var step=1;
if(arguments.length==1){
stop=arguments[0];
}else{
if(arguments.length==2){
_1bd=arguments[0];
stop=arguments[1];
}else{
if(arguments.length==3){
_1bd=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&&_1bd>=stop)||(step<0&&_1bd<=stop)){
throw MochiKit.Iter.StopIteration;
}
var rval=_1bd;
_1bd+=step;
return rval;
},repr:function(){
return "range("+[_1bd,stop,step].join(", ")+")";
},toString:MochiKit.Base.forwardCall("repr")};
},sum:function(_1c1,_1c2){
if(typeof (_1c2)=="undefined"||_1c2===null){
_1c2=0;
}
var x=_1c2;
var self=MochiKit.Iter;
_1c1=self.iter(_1c1);
try{
while(true){
x+=_1c1.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
return x;
},exhaust:function(_1c5){
var self=MochiKit.Iter;
_1c5=self.iter(_1c5);
try{
while(true){
_1c5.next();
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
},forEach:function(_1c7,func,obj){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length>2){
func=m.bind(func,obj);
}
if(m.isArrayLike(_1c7)&&!self.isIterable(_1c7)){
try{
for(var i=0;i<_1c7.length;i++){
func(_1c7[i]);
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
}else{
self.exhaust(self.imap(func,_1c7));
}
},every:function(_1cd,func){
var self=MochiKit.Iter;
try{
self.ifilterfalse(func,_1cd).next();
return false;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return true;
}
},sorted:function(_1d0,cmp){
var rval=MochiKit.Iter.list(_1d0);
if(arguments.length==1){
cmp=MochiKit.Base.compare;
}
rval.sort(cmp);
return rval;
},reversed:function(_1d3){
var rval=MochiKit.Iter.list(_1d3);
rval.reverse();
return rval;
},some:function(_1d5,func){
var self=MochiKit.Iter;
try{
self.ifilter(func,_1d5).next();
return true;
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
return false;
}
},iextend:function(lst,_1d9){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(m.isArrayLike(_1d9)&&!self.isIterable(_1d9)){
for(var i=0;i<_1d9.length;i++){
lst.push(_1d9[i]);
}
}else{
_1d9=self.iter(_1d9);
try{
while(true){
lst.push(_1d9.next());
}
}
catch(e){
if(e!=self.StopIteration){
throw e;
}
}
}
return lst;
},groupby:function(_1dd,_1de){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_1de=m.operator.identity;
}
_1dd=self.iter(_1dd);
var pk=undefined;
var k=undefined;
var v;
function fetch(){
v=_1dd.next();
k=_1de(v);
}
function eat(){
var ret=v;
v=undefined;
return ret;
}
var _1e5=true;
var _1e6=m.compare;
return {repr:function(){
return "groupby(...)";
},next:function(){
while(_1e6(k,pk)===0){
fetch();
if(_1e5){
_1e5=false;
break;
}
}
pk=k;
return [k,{next:function(){
if(v==undefined){
fetch();
}
if(_1e6(k,pk)!==0){
throw self.StopIteration;
}
return eat();
}}];
}};
},groupby_as_array:function(_1e7,_1e8){
var m=MochiKit.Base;
var self=MochiKit.Iter;
if(arguments.length<2){
_1e8=m.operator.identity;
}
_1e7=self.iter(_1e7);
var _1eb=[];
var _1ec=true;
var _1ed;
var _1ee=m.compare;
while(true){
try{
var _1ef=_1e7.next();
var key=_1e8(_1ef);
}
catch(e){
if(e==self.StopIteration){
break;
}
throw e;
}
if(_1ec||_1ee(key,_1ed)!==0){
var _1f1=[];
_1eb.push([key,_1f1]);
}
_1f1.push(_1ef);
_1ec=false;
_1ed=key;
}
return _1eb;
},arrayLikeIter:function(_1f2){
var i=0;
return {repr:function(){
return "arrayLikeIter(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
if(i>=_1f2.length){
throw MochiKit.Iter.StopIteration;
}
return _1f2[i++];
}};
},hasIterateNext:function(_1f4){
return (_1f4&&typeof (_1f4.iterateNext)=="function");
},iterateNextIter:function(_1f5){
return {repr:function(){
return "iterateNextIter(...)";
},toString:MochiKit.Base.forwardCall("repr"),next:function(){
var rval=_1f5.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;
if(typeof (StopIteration)!="undefined"){
this.StopIteration=StopIteration;
}else{
this.StopIteration=new m.NamedError("StopIteration");
}
this.iteratorRegistry=new m.AdapterRegistry();
this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Iter.__new__();
if(MochiKit.__export__){
reduce=MochiKit.Iter.reduce;
}
MochiKit.Base._exportSymbols(this,MochiKit.Iter);
MochiKit.Base._deps("Logging",["Base"]);
MochiKit.Logging.NAME="MochiKit.Logging";
MochiKit.Logging.VERSION="1.4.1";
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,_1f9,info){
this.num=num;
this.level=_1f9;
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.forwardCall("repr")};
MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1fc){
var self=MochiKit.Logging;
if(typeof (_1fc)=="string"){
_1fc=self.LogLevel[_1fc];
}
return function(msg){
var _1ff=msg.level;
if(typeof (_1ff)=="string"){
_1ff=self.LogLevel[_1ff];
}
return _1ff>=_1fc;
};
},isLogMessage:function(){
var _200=MochiKit.Logging.LogMessage;
for(var i=0;i<arguments.length;i++){
if(!(arguments[i] instanceof _200)){
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(_205){
this.counter=0;
if(typeof (_205)=="undefined"||_205===null){
_205=-1;
}
this.maxSize=_205;
this._messages=[];
this.listeners={};
this.useNativeConsole=false;
};
MochiKit.Logging.Logger.prototype={clear:function(){
this._messages.splice(0,this._messages.length);
},logToConsole:function(msg){
if(typeof (window)!="undefined"&&window.console&&window.console.log){
window.console.log(msg.replace(/%/g,"\uff05"));
}else{
if(typeof (opera)!="undefined"&&opera.postError){
opera.postError(msg);
}else{
if(typeof (printfire)=="function"){
printfire(msg);
}else{
if(typeof (Debug)!="undefined"&&Debug.writeln){
Debug.writeln(msg);
}else{
if(typeof (debug)!="undefined"&&debug.trace){
debug.trace(msg);
}
}
}
}
}
},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(_20a,_20b,_20c){
if(typeof (_20b)=="string"){
_20b=MochiKit.Logging.logLevelAtLeast(_20b);
}
var _20d=[_20b,_20c];
_20d.ident=_20a;
this.listeners[_20a]=_20d;
},removeListener:function(_20e){
delete this.listeners[_20e];
},baseLog:function(_20f,_210){
if(typeof (_20f)=="number"){
if(_20f>=MochiKit.Logging.LogLevel.FATAL){
_20f="FATAL";
}else{
if(_20f>=MochiKit.Logging.LogLevel.ERROR){
_20f="ERROR";
}else{
if(_20f>=MochiKit.Logging.LogLevel.WARNING){
_20f="WARNING";
}else{
if(_20f>=MochiKit.Logging.LogLevel.INFO){
_20f="INFO";
}else{
_20f="DEBUG";
}
}
}
}
}
var msg=new MochiKit.Logging.LogMessage(this.counter,_20f,MochiKit.Base.extend(null,arguments,1));
this._messages.push(msg);
this.dispatchListeners(msg);
if(this.useNativeConsole){
this.logToConsole(msg.level+": "+msg.info.join(" "));
}
this.counter+=1;
while(this.maxSize>=0&&this._messages.length>this.maxSize){
this._messages.shift();
}
},getMessages:function(_212){
var _213=0;
if(!(typeof (_212)=="undefined"||_212===null)){
_213=Math.max(0,this._messages.length-_212);
}
return this._messages.slice(_213);
},getMessageText:function(_214){
if(typeof (_214)=="undefined"||_214===null){
_214=30;
}
var _215=this.getMessages(_214);
if(_215.length){
var lst=map(function(m){
return "\n  ["+m.num+"] "+m.level+": "+m.info.join(" ");
},_215);
lst.unshift("LAST "+_215.length+" MESSAGES:");
return lst.join("");
}
return "";
},debuggingBookmarklet:function(_218){
if(typeof (MochiKit.LoggingPane)=="undefined"){
alert(this.getMessageText());
}else{
MochiKit.LoggingPane.createLoggingPane(_218||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 _21a=m.partial;
var _21b=this.Logger;
var _21c=_21b.prototype.baseLog;
m.update(this.Logger.prototype,{debug:_21a(_21c,"DEBUG"),log:_21a(_21c,"INFO"),error:_21a(_21c,"ERROR"),fatal:_21a(_21c,"FATAL"),warning:_21a(_21c,"WARNING")});
var self=this;
var _21e=function(name){
return function(){
self.logger[name].apply(self.logger,arguments);
};
};
this.log=_21e("log");
this.logError=_21e("error");
this.logDebug=_21e("debug");
this.logFatal=_21e("fatal");
this.logWarning=_21e("warning");
this.logger=new _21b();
this.logger.useNativeConsole=true;
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
if(typeof (printfire)=="undefined"&&typeof (document)!="undefined"&&document.createEvent&&typeof (dispatchEvent)!="undefined"){
printfire=function(){
printfire.args=arguments;
var ev=document.createEvent("Events");
ev.initEvent("printfire",false,true);
dispatchEvent(ev);
};
}
MochiKit.Logging.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Logging);
MochiKit.Base._deps("DateTime",["Base"]);
MochiKit.DateTime.NAME="MochiKit.DateTime";
MochiKit.DateTime.VERSION="1.4.1";
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;
}
var date=new Date(iso[0],iso[1]-1,iso[2]);
date.setFullYear(iso[0]);
date.setMonth(iso[1]-1);
date.setDate(iso[2]);
return date;
};
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,_227,day,hour,min,sec,msec;
year=parseInt(res[1],10);
if(typeof (res[2])=="undefined"||res[2]===""){
return new Date(year);
}
_227=parseInt(res[2],10)-1;
day=parseInt(res[3],10);
if(typeof (res[4])=="undefined"||res[4]===""){
return new Date(year,_227,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,_227,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,_227,day,hour,min,sec,msec)-ofs);
};
MochiKit.DateTime.toISOTime=function(date,_22f){
if(typeof (date)=="undefined"||date===null){
return null;
}
var hh=date.getHours();
var mm=date.getMinutes();
var ss=date.getSeconds();
var lst=[((_22f&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
return lst.join(":");
};
MochiKit.DateTime.toISOTimestamp=function(date,_235){
if(typeof (date)=="undefined"||date===null){
return null;
}
var sep=_235?"T":" ";
var foot=_235?"Z":"";
if(_235){
date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
}
return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_235)+foot;
};
MochiKit.DateTime.toISODate=function(date){
if(typeof (date)=="undefined"||date===null){
return null;
}
var _239=MochiKit.DateTime._padTwo;
var _23a=MochiKit.DateTime._padFour;
return [_23a(date.getFullYear()),_239(date.getMonth()+1),_239(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._padFour=function(n){
switch(n.toString().length){
case 1:
return "000"+n;
break;
case 2:
return "00"+n;
break;
case 3:
return "0"+n;
break;
case 4:
default:
return n;
}
};
MochiKit.DateTime.toPaddedAmericanDate=function(d){
if(typeof (d)=="undefined"||d===null){
return null;
}
var _240=MochiKit.DateTime._padTwo;
return [_240(d.getMonth()+1),_240(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(_245,_246){
if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
var all=_246.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_245[all[i]]=_246[all[i]];
}
}
})(this,MochiKit.DateTime);
}
MochiKit.Base._deps("Format",["Base"]);
MochiKit.Format.NAME="MochiKit.Format";
MochiKit.Format.VERSION="1.4.1";
MochiKit.Format.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Format.toString=function(){
return this.__repr__();
};
MochiKit.Format._numberFormatter=function(_249,_24a,_24b,_24c,_24d,_24e,_24f,_250,_251){
return function(num){
num=parseFloat(num);
if(typeof (num)=="undefined"||num===null||isNaN(num)){
return _249;
}
var _253=_24a;
var _254=_24b;
if(num<0){
num=-num;
}else{
_253=_253.replace(/-/,"");
}
var me=arguments.callee;
var fmt=MochiKit.Format.formatLocale(_24c);
if(_24d){
num=num*100;
_254=fmt.percent+_254;
}
num=MochiKit.Format.roundToFixed(num,_24e);
var _257=num.split(/\./);
var _258=_257[0];
var frac=(_257.length==1)?"":_257[1];
var res="";
while(_258.length<_24f){
_258="0"+_258;
}
if(_250){
while(_258.length>_250){
var i=_258.length-_250;
res=fmt.separator+_258.substring(i,_258.length)+res;
_258=_258.substring(0,i);
}
}
res=_258+res;
if(_24e>0){
while(frac.length<_251){
frac=frac+"0";
}
res=res+fmt.decimal+frac;
}
return _253+res+_254;
};
};
MochiKit.Format.numberFormatter=function(_25c,_25d,_25e){
if(typeof (_25d)=="undefined"){
_25d="";
}
var _25f=_25c.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
if(!_25f){
throw TypeError("Invalid pattern");
}
var _260=_25c.substr(0,_25f.index);
var _261=_25c.substr(_25f.index+_25f[0].length);
if(_260.search(/-/)==-1){
_260=_260+"-";
}
var _262=_25f[1];
var frac=(typeof (_25f[2])=="string"&&_25f[2]!="")?_25f[2]:"";
var _264=(typeof (_25f[3])=="string"&&_25f[3]!="");
var tmp=_262.split(/,/);
var _266;
if(typeof (_25e)=="undefined"){
_25e="default";
}
if(tmp.length==1){
_266=null;
}else{
_266=tmp[1].length;
}
var _267=_262.length-_262.replace(/0/g,"").length;
var _268=frac.length-frac.replace(/0/g,"").length;
var _269=frac.length;
var rval=MochiKit.Format._numberFormatter(_25d,_260,_261,_25e,_264,_269,_267,_266,_268);
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(_26e){
if(typeof (_26e)=="undefined"||_26e===null){
_26e="default";
}
if(typeof (_26e)=="string"){
var rval=MochiKit.Format.LOCALE[_26e];
if(typeof (rval)=="string"){
rval=arguments.callee(rval);
MochiKit.Format.LOCALE[_26e]=rval;
}
return rval;
}else{
return _26e;
}
};
MochiKit.Format.twoDigitAverage=function(_270,_271){
if(_271){
var res=_270/_271;
if(!isNaN(res)){
return MochiKit.Format.twoDigitFloat(res);
}
}
return "0";
};
MochiKit.Format.twoDigitFloat=function(_273){
var res=roundToFixed(_273,2);
if(res.indexOf(".00")>0){
return res.substring(0,res.length-3);
}else{
if(res.charAt(res.length-1)=="0"){
return res.substring(0,res.length-1);
}else{
return res;
}
}
};
MochiKit.Format.lstrip=function(str,_276){
str=str+"";
if(typeof (str)!="string"){
return null;
}
if(!_276){
return str.replace(/^\s+/,"");
}else{
return str.replace(new RegExp("^["+_276+"]+"),"");
}
};
MochiKit.Format.rstrip=function(str,_278){
str=str+"";
if(typeof (str)!="string"){
return null;
}
if(!_278){
return str.replace(/\s+$/,"");
}else{
return str.replace(new RegExp("["+_278+"]+$"),"");
}
};
MochiKit.Format.strip=function(str,_27a){
var self=MochiKit.Format;
return self.rstrip(self.lstrip(str,_27a),_27a);
};
MochiKit.Format.truncToFixed=function(_27c,_27d){
var res=Math.floor(_27c).toFixed(0);
if(_27c<0){
res=Math.ceil(_27c).toFixed(0);
if(res.charAt(0)!="-"&&_27d>0){
res="-"+res;
}
}
if(res.indexOf("e")<0&&_27d>0){
var tail=_27c.toString();
if(tail.indexOf("e")>0){
tail=".";
}else{
if(tail.indexOf(".")<0){
tail=".";
}else{
tail=tail.substring(tail.indexOf("."));
}
}
if(tail.length-1>_27d){
tail=tail.substring(0,_27d+1);
}
while(tail.length-1<_27d){
tail+="0";
}
res+=tail;
}
return res;
};
MochiKit.Format.roundToFixed=function(_280,_281){
var _282=Math.abs(_280)+0.5*Math.pow(10,-_281);
var res=MochiKit.Format.truncToFixed(_282,_281);
if(_280<0){
res="-"+res;
}
return res;
};
MochiKit.Format.percentFormat=function(_284){
return MochiKit.Format.twoDigitFloat(100*_284)+"%";
};
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:"%"},pt_BR:{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(_289,_28a){
if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
var all=_28a.EXPORT_TAGS[":all"];
for(var i=0;i<all.length;i++){
_289[all[i]]=_28a[all[i]];
}
}
})(this,MochiKit.Format);
}
MochiKit.Base._deps("Async",["Base"]);
MochiKit.Async.NAME="MochiKit.Async";
MochiKit.Async.VERSION="1.4.1";
MochiKit.Async.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Async.toString=function(){
return this.__repr__();
};
MochiKit.Async.Deferred=function(_28d){
this.chain=[];
this.id=this._nextId();
this.fired=-1;
this.paused=0;
this.results=[null,null];
this.canceller=_28d;
this.silentlyCancelled=false;
this.chained=false;
};
MochiKit.Async.Deferred.prototype={repr:function(){
var _28e;
if(this.fired==-1){
_28e="unfired";
}else{
if(this.fired===0){
_28e="success";
}else{
_28e="error";
}
}
return "Deferred("+this.id+", "+_28e+")";
},toString:MochiKit.Base.forwardCall("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();
}
}
},_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();
if(res instanceof MochiKit.Async.Deferred){
throw new Error("Deferred instances can only be chained if they are the result of a callback");
}
this._resback(res);
},errback:function(res){
this._check();
var self=MochiKit.Async;
if(res instanceof self.Deferred){
throw new Error("Deferred instances can only be chained if they are the result of a callback");
}
if(!(res instanceof Error)){
res=new self.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){
if(this.chained){
throw new Error("Chained Deferreds can not be re-used");
}
this.chain.push([cb,eb]);
if(this.fired>=0){
this._fire();
}
return this;
},_fire:function(){
var _299=this.chain;
var _29a=this.fired;
var res=this.results[_29a];
var self=this;
var cb=null;
while(_299.length>0&&this.paused===0){
var pair=_299.shift();
var f=pair[_29a];
if(f===null){
continue;
}
try{
res=f(res);
_29a=((res instanceof Error)?1:0);
if(res instanceof MochiKit.Async.Deferred){
cb=function(res){
self._resback(res);
self.paused--;
if((self.paused===0)&&(self.fired>=0)){
self._fire();
}
};
this.paused++;
}
}
catch(err){
_29a=1;
if(!(err instanceof Error)){
err=new MochiKit.Async.GenericError(err);
}
res=err;
}
}
this.fired=_29a;
this.results[_29a]=res;
if(cb&&this.paused){
res.addBoth(cb);
res.chained=true;
}
}};
MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
return MochiKit.Base.evalJSON(req.responseText);
},succeed:function(_2a2){
var d=new MochiKit.Async.Deferred();
d.callback.apply(d,arguments);
return d;
},fail:function(_2a4){
var d=new MochiKit.Async.Deferred();
d.errback.apply(d,arguments);
return d;
},getXMLHttpRequest:function(){
var self=arguments.callee;
if(!self.XMLHttpRequest){
var _2a7=[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<_2a7.length;i++){
var func=_2a7[i];
try{
self.XMLHttpRequest=func;
return func();
}
catch(e){
}
}
}
return self.XMLHttpRequest();
},_xhr_onreadystatechange:function(d){
var m=MochiKit.Base;
if(this.readyState==4){
try{
this.onreadystatechange=null;
}
catch(e){
try{
this.onreadystatechange=m.noop;
}
catch(e){
}
}
var _2ac=null;
try{
_2ac=this.status;
if(!_2ac&&m.isNotEmpty(this.responseText)){
_2ac=304;
}
}
catch(e){
}
if(_2ac==200||_2ac==201||_2ac==204||_2ac==304||_2ac==1223){
d.callback(this);
}else{
var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
if(err.number){
d.errback(err);
}else{
d.errback(err);
}
}
}
},_xhr_canceller:function(req){
try{
req.onreadystatechange=null;
}
catch(e){
try{
req.onreadystatechange=MochiKit.Base.noop;
}
catch(e){
}
}
req.abort();
},sendXMLHttpRequest:function(req,_2b0){
if(typeof (_2b0)=="undefined"||_2b0===null){
_2b0="";
}
var m=MochiKit.Base;
var self=MochiKit.Async;
var d=new self.Deferred(m.partial(self._xhr_canceller,req));
try{
req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
req.send(_2b0);
}
catch(e){
try{
req.onreadystatechange=null;
}
catch(ignore){
}
d.errback(e);
}
return d;
},doXHR:function(url,opts){
var self=MochiKit.Async;
return self.callLater(0,self._doXHR,url,opts);
},_doXHR:function(url,opts){
var m=MochiKit.Base;
opts=m.update({method:"GET",sendContent:""},opts);
var self=MochiKit.Async;
var req=self.getXMLHttpRequest();
if(opts.queryString){
var qs=m.queryString(opts.queryString);
if(qs){
url+="?"+qs;
}
}
if("username" in opts){
req.open(opts.method,url,true,opts.username,opts.password);
}else{
req.open(opts.method,url,true);
}
if(req.overrideMimeType&&opts.mimeType){
req.overrideMimeType(opts.mimeType);
}
req.setRequestHeader("X-Requested-With","XMLHttpRequest");
if(opts.headers){
var _2bd=opts.headers;
if(!m.isArrayLike(_2bd)){
_2bd=m.items(_2bd);
}
for(var i=0;i<_2bd.length;i++){
var _2bf=_2bd[i];
var name=_2bf[0];
var _2c1=_2bf[1];
req.setRequestHeader(name,_2c1);
}
}
return self.sendXMLHttpRequest(req,opts.sendContent);
},_buildURL:function(url){
if(arguments.length>1){
var m=MochiKit.Base;
var qs=m.queryString.apply(null,m.extend(null,arguments,1));
if(qs){
return url+"?"+qs;
}
}
return url;
},doSimpleXMLHttpRequest:function(url){
var self=MochiKit.Async;
url=self._buildURL.apply(self,arguments);
return self.doXHR(url);
},loadJSONDoc:function(url){
var self=MochiKit.Async;
url=self._buildURL.apply(self,arguments);
var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]});
d=d.addCallback(self.evalJSONRequest);
return d;
},wait:function(_2ca,_2cb){
var d=new MochiKit.Async.Deferred();
var m=MochiKit.Base;
if(typeof (_2cb)!="undefined"){
d.addCallback(function(){
return _2cb;
});
}
var _2ce=setTimeout(m.bind("callback",d),Math.floor(_2ca*1000));
d.canceller=function(){
try{
clearTimeout(_2ce);
}
catch(e){
}
};
return d;
},callLater:function(_2cf,func){
var m=MochiKit.Base;
var _2d2=m.partial.apply(m,m.extend(null,arguments,1));
return MochiKit.Async.wait(_2cf).addCallback(function(res){
return _2d2();
});
}});
MochiKit.Async.DeferredLock=function(){
this.waiting=[];
this.locked=false;
this.id=this._nextId();
};
MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
var 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 _2d5;
if(this.locked){
_2d5="locked, "+this.waiting.length+" waiting";
}else{
_2d5="unlocked";
}
return "DeferredLock("+this.id+", "+_2d5+")";
},toString:MochiKit.Base.forwardCall("repr")};
MochiKit.Async.DeferredList=function(list,_2d7,_2d8,_2d9,_2da){
MochiKit.Async.Deferred.apply(this,[_2da]);
this.list=list;
var _2db=[];
this.resultList=_2db;
this.finishedCount=0;
this.fireOnOneCallback=_2d7;
this.fireOnOneErrback=_2d8;
this.consumeErrors=_2d9;
var cb=MochiKit.Base.bind(this._cbDeferred,this);
for(var i=0;i<list.length;i++){
var d=list[i];
_2db.push(undefined);
d.addCallback(cb,i,true);
d.addErrback(cb,i,false);
}
if(list.length===0&&!_2d7){
this.callback(this.resultList);
}
};
MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2df,_2e0,_2e1){
this.resultList[_2df]=[_2e0,_2e1];
this.finishedCount+=1;
if(this.fired==-1){
if(_2e0&&this.fireOnOneCallback){
this.callback([_2df,_2e1]);
}else{
if(!_2e0&&this.fireOnOneErrback){
this.errback(_2e1);
}else{
if(this.finishedCount==this.list.length){
this.callback(this.resultList);
}
}
}
}
if(!_2e0&&this.consumeErrors){
_2e1=null;
}
return _2e1;
};
MochiKit.Async.gatherResults=function(_2e2){
var d=new MochiKit.Async.DeferredList(_2e2,false,true,false);
d.addCallback(function(_2e4){
var ret=[];
for(var i=0;i<_2e4.length;i++){
ret.push(_2e4[i][1]);
}
return ret;
});
return d;
};
MochiKit.Async.maybeDeferred=function(func){
var self=MochiKit.Async;
var _2e9;
try{
var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
if(r instanceof self.Deferred){
_2e9=r;
}else{
if(r instanceof Error){
_2e9=self.fail(r);
}else{
_2e9=self.succeed(r);
}
}
}
catch(e){
_2e9=self.fail(e);
}
return _2e9;
};
MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"];
MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
MochiKit.Async.__new__=function(){
var m=MochiKit.Base;
var ne=m.partial(m._newNamedError,this);
ne("AlreadyCalledError",function(_2ed){
this.deferred=_2ed;
});
ne("CancelledError",function(_2ee){
this.deferred=_2ee;
});
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);
MochiKit.Base._deps("DOM",["Base"]);
MochiKit.DOM.NAME="MochiKit.DOM";
MochiKit.DOM.VERSION="1.4.1";
MochiKit.DOM.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.DOM.toString=function(){
return this.__repr__();
};
MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","removeNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","insertSiblingNodesAfter","insertSiblingNodesBefore","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","H4","H5","H6","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","DL","DT","DD","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","computedStyle","escapeHTML","toHTML","emitHTML","scrapeText","getFirstParentByTagAndClassName","getFirstElementByTagAndClassName"];
MochiKit.DOM.EXPORT_OK=["domConverters"];
MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.getStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["getViewportDimensions","MochiKit.Style.getViewportDimensions","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["makeClipping","MochiKit.Style.makeClipping","1.4.1"],["makePositioned","MochiKit.Style.makePositioned","1.4.1"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["undoClipping","MochiKit.Style.undoClipping","1.4.1"],["undoPositioned","MochiKit.Style.undoPositioned","1.4.1"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
return MochiKit.DOM._window;
},currentDocument:function(){
return MochiKit.DOM._document;
},withWindow:function(win,func){
var self=MochiKit.DOM;
var _2f6=self._document;
var _2f7=self._window;
var rval;
try{
self._window=win;
self._document=win.document;
rval=func();
}
catch(e){
self._window=_2f7;
self._document=_2f6;
throw e;
}
self._window=_2f7;
self._document=_2f6;
return rval;
},formContents:function(elem){
var _2fa=[];
var _2fb=[];
var m=MochiKit.Base;
var self=MochiKit.DOM;
if(typeof (elem)=="undefined"||elem===null){
elem=self._document.body;
}else{
elem=self.getElement(elem);
}
m.nodeWalk(elem,function(elem){
var name=elem.name;
if(m.isNotEmpty(name)){
var _300=elem.tagName.toUpperCase();
if(_300==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
return null;
}
if(_300==="SELECT"){
if(elem.type=="select-one"){
if(elem.selectedIndex>=0){
var opt=elem.options[elem.selectedIndex];
var v=opt.value;
if(!v){
var h=opt.outerHTML;
if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
v=opt.text;
}
}
_2fa.push(name);
_2fb.push(v);
return null;
}
_2fa.push(name);
_2fb.push("");
return null;
}else{
var opts=elem.options;
if(!opts.length){
_2fa.push(name);
_2fb.push("");
return null;
}
for(var i=0;i<opts.length;i++){
var opt=opts[i];
if(!opt.selected){
continue;
}
var v=opt.value;
if(!v){
var h=opt.outerHTML;
if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
v=opt.text;
}
}
_2fa.push(name);
_2fb.push(v);
}
return null;
}
}
if(_300==="FORM"||_300==="P"||_300==="SPAN"||_300==="DIV"){
return elem.childNodes;
}
_2fa.push(name);
_2fb.push(elem.value||"");
return null;
}
return elem.childNodes;
});
return [_2fa,_2fb];
},withDocument:function(doc,func){
var self=MochiKit.DOM;
var _309=self._document;
var rval;
try{
self._document=doc;
rval=func();
}
catch(e){
self._document=_309;
throw e;
}
self._document=_309;
return rval;
},registerDOMConverter:function(name,_30c,wrap,_30e){
MochiKit.DOM.domConverters.register(name,_30c,wrap,_30e);
},coerceToDOM:function(node,ctx){
var m=MochiKit.Base;
var im=MochiKit.Iter;
var self=MochiKit.DOM;
if(im){
var iter=im.iter;
var _315=im.repeat;
var map=m.map;
}
var _317=self.domConverters;
var _318=arguments.callee;
var _319=m.NotFound;
while(true){
if(typeof (node)=="undefined"||node===null){
return null;
}
if(typeof (node)=="function"&&typeof (node.length)=="number"&&!(node instanceof Function)){
node=im.list(node);
}
if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
return node;
}
if(typeof (node)=="number"||typeof (node)=="boolean"){
node=node.toString();
}
if(typeof (node)=="string"){
return self._document.createTextNode(node);
}
if(typeof (node.__dom__)=="function"){
node=node.__dom__(ctx);
continue;
}
if(typeof (node.dom)=="function"){
node=node.dom(ctx);
continue;
}
if(typeof (node)=="function"){
node=node.apply(ctx,[ctx]);
continue;
}
if(im){
var _31a=null;
try{
_31a=iter(node);
}
catch(e){
}
if(_31a){
return map(_318,_31a,_315(ctx));
}
}
try{
node=_317.match(node,ctx);
continue;
}
catch(e){
if(e!=_319){
throw e;
}
}
return self._document.createTextNode(node.toString());
}
return undefined;
},isChildNode:function(node,_31c){
var self=MochiKit.DOM;
if(typeof (node)=="string"){
node=self.getElement(node);
}
if(typeof (_31c)=="string"){
_31c=self.getElement(_31c);
}
if(typeof (node)=="undefined"||node===null){
return false;
}
while(node!=null&&node!==self._document){
if(node===_31c){
return true;
}
node=node.parentNode;
}
return false;
},setNodeAttribute:function(node,attr,_320){
var o={};
o[attr]=_320;
try{
return MochiKit.DOM.updateNodeAttributes(node,o);
}
catch(e){
}
return null;
},getNodeAttribute:function(node,attr){
var self=MochiKit.DOM;
var _325=self.attributeArray.renames[attr];
var _326=self.attributeArray.ignoreAttr[attr];
node=self.getElement(node);
try{
if(_325){
return node[_325];
}
var _327=node.getAttribute(attr);
if(_327!=_326){
return _327;
}
}
catch(e){
}
return null;
},removeNodeAttribute:function(node,attr){
var self=MochiKit.DOM;
var _32b=self.attributeArray.renames[attr];
node=self.getElement(node);
try{
if(_32b){
return node[_32b];
}
return node.removeAttribute(attr);
}
catch(e){
}
return null;
},updateNodeAttributes:function(node,_32d){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
if(_32d){
var _330=MochiKit.Base.updatetree;
if(self.attributeArray.compliant){
for(var k in _32d){
var v=_32d[k];
if(typeof (v)=="object"&&typeof (elem[k])=="object"){
if(k=="style"&&MochiKit.Style){
MochiKit.Style.setStyle(elem,v);
}else{
_330(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);
}
}
if(typeof (elem[k])=="string"&&elem[k]!=v){
elem[k]=v;
}
}
}else{
var _333=self.attributeArray.renames;
for(var k in _32d){
v=_32d[k];
var _334=_333[k];
if(k=="style"&&typeof (v)=="string"){
elem.style.cssText=v;
}else{
if(typeof (_334)=="string"){
elem[_334]=v;
}else{
if(typeof (elem[k])=="object"&&typeof (v)=="object"){
if(k=="style"&&MochiKit.Style){
MochiKit.Style.setStyle(elem,v);
}else{
_330(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);
}
}
}
}
if(typeof (elem[k])=="string"&&elem[k]!=v){
elem[k]=v;
}
}
}
}
return elem;
},appendChildNodes:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _338=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
var _339=MochiKit.Base.concat;
while(_338.length){
var n=_338.shift();
if(typeof (n)=="undefined"||n===null){
}else{
if(typeof (n.nodeType)=="number"){
elem.appendChild(n);
}else{
_338=_339(n,_338);
}
}
}
return elem;
},insertSiblingNodesBefore:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _33e=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
var _33f=elem.parentNode;
var _340=MochiKit.Base.concat;
while(_33e.length){
var n=_33e.shift();
if(typeof (n)=="undefined"||n===null){
}else{
if(typeof (n.nodeType)=="number"){
_33f.insertBefore(n,elem);
}else{
_33e=_340(n,_33e);
}
}
}
return _33f;
},insertSiblingNodesAfter:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
}
var _345=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
if(elem.nextSibling){
return self.insertSiblingNodesBefore(elem.nextSibling,_345);
}else{
return self.appendChildNodes(elem.parentNode,_345);
}
},replaceChildNodes:function(node){
var elem=node;
var self=MochiKit.DOM;
if(typeof (node)=="string"){
elem=self.getElement(node);
arguments[0]=elem;
}
var _349;
while((_349=elem.firstChild)){
elem.removeChild(_349);
}
if(arguments.length<2){
return elem;
}else{
return self.appendChildNodes.apply(this,arguments);
}
},createDOM:function(name,_34b){
var elem;
var self=MochiKit.DOM;
var m=MochiKit.Base;
if(typeof (_34b)=="string"||typeof (_34b)=="number"){
var args=m.extend([name,null],arguments,1);
return arguments.callee.apply(this,args);
}
if(typeof (name)=="string"){
var _350=self._xhtml;
if(_34b&&!self.attributeArray.compliant){
var _351="";
if("name" in _34b){
_351+=" name=\""+self.escapeHTML(_34b.name)+"\"";
}
if(name=="input"&&"type" in _34b){
_351+=" type=\""+self.escapeHTML(_34b.type)+"\"";
}
if(_351){
name="<"+name+_351+">";
_350=false;
}
}
var d=self._document;
if(_350&&d===document){
elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
}else{
elem=d.createElement(name);
}
}else{
elem=name;
}
if(_34b){
self.updateNodeAttributes(elem,_34b);
}
if(arguments.length<=2){
return elem;
}else{
var args=m.extend([elem],arguments,2);
return self.appendChildNodes.apply(this,args);
}
},createDOMFunc:function(){
var m=MochiKit.Base;
return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
},removeElement:function(elem){
var self=MochiKit.DOM;
var e=self.coerceToDOM(self.getElement(elem));
e.parentNode.removeChild(e);
return e;
},swapDOM:function(dest,src){
var self=MochiKit.DOM;
dest=self.getElement(dest);
var _35a=dest.parentNode;
if(src){
src=self.coerceToDOM(self.getElement(src),_35a);
_35a.replaceChild(src,dest);
}else{
_35a.removeChild(dest);
}
return src;
},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);
}
},getElementsByTagAndClassName:function(_35d,_35e,_35f){
var self=MochiKit.DOM;
if(typeof (_35d)=="undefined"||_35d===null){
_35d="*";
}
if(typeof (_35f)=="undefined"||_35f===null){
_35f=self._document;
}
_35f=self.getElement(_35f);
if(_35f==null){
return [];
}
var _361=(_35f.getElementsByTagName(_35d)||self._document.all);
if(typeof (_35e)=="undefined"||_35e===null){
return MochiKit.Base.extend(null,_361);
}
var _362=[];
for(var i=0;i<_361.length;i++){
var _364=_361[i];
var cls=_364.className;
if(typeof (cls)!="string"){
cls=_364.getAttribute("class");
}
if(typeof (cls)=="string"){
var _366=cls.split(" ");
for(var j=0;j<_366.length;j++){
if(_366[j]==_35e){
_362.push(_364);
break;
}
}
}
}
return _362;
},_newCallStack:function(path,once){
var rval=function(){
var _36b=arguments.callee.callStack;
for(var i=0;i<_36b.length;i++){
if(_36b[i].apply(this,arguments)===false){
break;
}
}
if(once){
try{
this[path]=null;
}
catch(e){
}
}
};
rval.callStack=[];
return rval;
},addToCallStack:function(_36d,path,func,once){
var self=MochiKit.DOM;
var _372=_36d[path];
var _373=_372;
if(!(typeof (_372)=="function"&&typeof (_372.callStack)=="object"&&_372.callStack!==null)){
_373=self._newCallStack(path,once);
if(typeof (_372)=="function"){
_373.callStack.push(_372);
}
_36d[path]=_373;
}
_373.callStack.push(func);
},addLoadEvent:function(func){
var self=MochiKit.DOM;
self.addToCallStack(self._window,"onload",func,true);
},focusOnLoad:function(_376){
var self=MochiKit.DOM;
self.addLoadEvent(function(){
_376=self.getElement(_376);
if(_376){
_376.focus();
}
});
},setElementClass:function(_378,_379){
var self=MochiKit.DOM;
var obj=self.getElement(_378);
if(self.attributeArray.compliant){
obj.setAttribute("class",_379);
}else{
obj.setAttribute("className",_379);
}
},toggleElementClass:function(_37c){
var self=MochiKit.DOM;
for(var i=1;i<arguments.length;i++){
var obj=self.getElement(arguments[i]);
if(!self.addElementClass(obj,_37c)){
self.removeElementClass(obj,_37c);
}
}
},addElementClass:function(_380,_381){
var self=MochiKit.DOM;
var obj=self.getElement(_380);
var cls=obj.className;
if(typeof (cls)!="string"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"||cls.length===0){
self.setElementClass(obj,_381);
return true;
}
if(cls==_381){
return false;
}
var _385=cls.split(" ");
for(var i=0;i<_385.length;i++){
if(_385[i]==_381){
return false;
}
}
self.setElementClass(obj,cls+" "+_381);
return true;
},removeElementClass:function(_387,_388){
var self=MochiKit.DOM;
var obj=self.getElement(_387);
var cls=obj.className;
if(typeof (cls)!="string"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"||cls.length===0){
return false;
}
if(cls==_388){
self.setElementClass(obj,"");
return true;
}
var _38c=cls.split(" ");
for(var i=0;i<_38c.length;i++){
if(_38c[i]==_388){
_38c.splice(i,1);
self.setElementClass(obj,_38c.join(" "));
return true;
}
}
return false;
},swapElementClass:function(_38e,_38f,_390){
var obj=MochiKit.DOM.getElement(_38e);
var res=MochiKit.DOM.removeElementClass(obj,_38f);
if(res){
MochiKit.DOM.addElementClass(obj,_390);
}
return res;
},hasElementClass:function(_393,_394){
var obj=MochiKit.DOM.getElement(_393);
if(obj==null){
return false;
}
var cls=obj.className;
if(typeof (cls)!="string"){
cls=obj.getAttribute("class");
}
if(typeof (cls)!="string"){
return false;
}
var _397=cls.split(" ");
for(var i=1;i<arguments.length;i++){
var good=false;
for(var j=0;j<_397.length;j++){
if(_397[j]==arguments[i]){
good=true;
break;
}
}
if(!good){
return false;
}
}
return true;
},escapeHTML:function(s){
return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},toHTML:function(dom){
return MochiKit.DOM.emitHTML(dom).join("");
},emitHTML:function(dom,lst){
if(typeof (lst)=="undefined"||lst===null){
lst=[];
}
var _39f=[dom];
var self=MochiKit.DOM;
var _3a1=self.escapeHTML;
var _3a2=self.attributeArray;
while(_39f.length){
dom=_39f.pop();
if(typeof (dom)=="string"){
lst.push(dom);
}else{
if(dom.nodeType==1){
lst.push("<"+dom.tagName.toLowerCase());
var _3a3=[];
var _3a4=_3a2(dom);
for(var i=0;i<_3a4.length;i++){
var a=_3a4[i];
_3a3.push([" ",a.name,"=\"",_3a1(a.value),"\""]);
}
_3a3.sort();
for(i=0;i<_3a3.length;i++){
var _3a7=_3a3[i];
for(var j=0;j<_3a7.length;j++){
lst.push(_3a7[j]);
}
}
if(dom.hasChildNodes()){
lst.push(">");
_39f.push("</"+dom.tagName.toLowerCase()+">");
var _3a9=dom.childNodes;
for(i=_3a9.length-1;i>=0;i--){
_39f.push(_3a9[i]);
}
}else{
lst.push("/>");
}
}else{
if(dom.nodeType==3){
lst.push(_3a1(dom.nodeValue));
}
}
}
}
return lst;
},scrapeText:function(node,_3ab){
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 _3b0=node.nodeValue;
if(typeof (_3b0)=="string"){
rval.push(_3b0);
}
})(MochiKit.DOM.getElement(node));
if(_3ab){
return rval;
}else{
return rval.join("");
}
},removeEmptyTextNodes:function(_3b1){
_3b1=MochiKit.DOM.getElement(_3b1);
for(var i=0;i<_3b1.childNodes.length;i++){
var node=_3b1.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
node.parentNode.removeChild(node);
}
}
},getFirstElementByTagAndClassName:function(_3b4,_3b5,_3b6){
var self=MochiKit.DOM;
if(typeof (_3b4)=="undefined"||_3b4===null){
_3b4="*";
}
if(typeof (_3b6)=="undefined"||_3b6===null){
_3b6=self._document;
}
_3b6=self.getElement(_3b6);
if(_3b6==null){
return null;
}
var _3b8=(_3b6.getElementsByTagName(_3b4)||self._document.all);
if(_3b8.length<=0){
return null;
}else{
if(typeof (_3b5)=="undefined"||_3b5===null){
return _3b8[0];
}
}
for(var i=0;i<_3b8.length;i++){
var _3ba=_3b8[i];
var cls=_3ba.className;
if(typeof (cls)!="string"){
cls=_3ba.getAttribute("class");
}
if(typeof (cls)=="string"){
var _3bc=cls.split(" ");
for(var j=0;j<_3bc.length;j++){
if(_3bc[j]==_3b5){
return _3ba;
}
}
}
}
return null;
},getFirstParentByTagAndClassName:function(elem,_3bf,_3c0){
var self=MochiKit.DOM;
elem=self.getElement(elem);
if(typeof (_3bf)=="undefined"||_3bf===null){
_3bf="*";
}else{
_3bf=_3bf.toUpperCase();
}
if(typeof (_3c0)=="undefined"||_3c0===null){
_3c0=null;
}
if(elem){
elem=elem.parentNode;
}
while(elem&&elem.tagName){
var _3c2=elem.tagName.toUpperCase();
if((_3bf==="*"||_3bf==_3c2)&&(_3c0===null||self.hasElementClass(elem,_3c0))){
return elem;
}
elem=elem.parentNode;
}
return null;
},__new__:function(win){
var m=MochiKit.Base;
if(typeof (document)!="undefined"){
this._document=document;
var _3c5="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_3c5);
}else{
if(MochiKit.MockDOM){
this._document=MochiKit.MockDOM.document;
}
}
this._window=win;
this.domConverters=new m.AdapterRegistry();
var _3c6=this._document.createElement("span");
var _3c7;
if(_3c6&&_3c6.attributes&&_3c6.attributes.length>0){
var _3c8=m.filter;
_3c7=function(node){
return _3c8(_3c7.ignoreAttrFilter,node.attributes);
};
_3c7.ignoreAttr={};
var _3ca=_3c6.attributes;
var _3cb=_3c7.ignoreAttr;
for(var i=0;i<_3ca.length;i++){
var a=_3ca[i];
_3cb[a.name]=a.value;
}
_3c7.ignoreAttrFilter=function(a){
return (_3c7.ignoreAttr[a.name]!=a.value);
};
_3c7.compliant=false;
_3c7.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor","cellspacing":"cellSpacing","cellpadding":"cellPadding"};
}else{
_3c7=function(node){
return node.attributes;
};
_3c7.compliant=true;
_3c7.ignoreAttr={};
_3c7.renames={};
}
this.attributeArray=_3c7;
var _3d0=function(_3d1,arr){
var _3d3=arr[0];
var _3d4=arr[1];
var _3d5=_3d4.split(".")[1];
var str="";
str+="if (!MochiKit."+_3d5+") { throw new Error(\"";
str+="This function has been deprecated and depends on MochiKit.";
str+=_3d5+".\");}";
str+="return "+_3d4+".apply(this, arguments);";
MochiKit[_3d1][_3d3]=new Function(str);
};
for(var i=0;i<MochiKit.DOM.DEPRECATED.length;i++){
_3d0("DOM",MochiKit.DOM.DEPRECATED[i]);
}
var _3d7=this.createDOMFunc;
this.UL=_3d7("ul");
this.OL=_3d7("ol");
this.LI=_3d7("li");
this.DL=_3d7("dl");
this.DT=_3d7("dt");
this.DD=_3d7("dd");
this.TD=_3d7("td");
this.TR=_3d7("tr");
this.TBODY=_3d7("tbody");
this.THEAD=_3d7("thead");
this.TFOOT=_3d7("tfoot");
this.TABLE=_3d7("table");
this.TH=_3d7("th");
this.INPUT=_3d7("input");
this.SPAN=_3d7("span");
this.A=_3d7("a");
this.DIV=_3d7("div");
this.IMG=_3d7("img");
this.BUTTON=_3d7("button");
this.TT=_3d7("tt");
this.PRE=_3d7("pre");
this.H1=_3d7("h1");
this.H2=_3d7("h2");
this.H3=_3d7("h3");
this.H4=_3d7("h4");
this.H5=_3d7("h5");
this.H6=_3d7("h6");
this.BR=_3d7("br");
this.HR=_3d7("hr");
this.LABEL=_3d7("label");
this.TEXTAREA=_3d7("textarea");
this.FORM=_3d7("form");
this.P=_3d7("p");
this.SELECT=_3d7("select");
this.OPTION=_3d7("option");
this.OPTGROUP=_3d7("optgroup");
this.LEGEND=_3d7("legend");
this.FIELDSET=_3d7("fieldset");
this.STRONG=_3d7("strong");
this.CANVAS=_3d7("canvas");
this.$=this.getElement;
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
}});
MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
if(MochiKit.__export__){
withWindow=MochiKit.DOM.withWindow;
withDocument=MochiKit.DOM.withDocument;
}
MochiKit.Base._exportSymbols(this,MochiKit.DOM);
MochiKit.Base._deps("Selector",["Base","DOM","Iter"]);
MochiKit.Selector.NAME="MochiKit.Selector";
MochiKit.Selector.VERSION="1.4.1";
MochiKit.Selector.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Selector.toString=function(){
return this.__repr__();
};
MochiKit.Selector.EXPORT=["Selector","findChildElements","findDocElements","$$"];
MochiKit.Selector.EXPORT_OK=[];
MochiKit.Selector.Selector=function(_3d8){
this.params={classNames:[],pseudoClassNames:[]};
this.expression=_3d8.toString().replace(/(^\s+|\s+$)/g,"");
this.parseExpression();
this.compileMatcher();
};
MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
function abort(_3d9){
throw "Parse error in selector: "+_3d9;
}
if(this.expression==""){
abort("empty expression");
}
var repr=MochiKit.Base.repr;
var _3db=this.params;
var expr=this.expression;
var _3dd,_3de,_3df,rest;
while(_3dd=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_3db.attributes=_3db.attributes||[];
_3db.attributes.push({name:_3dd[2],operator:_3dd[3],value:_3dd[4]||_3dd[5]||""});
expr=_3dd[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_3dd=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
_3de=_3dd[1];
_3df=_3dd[2];
rest=_3dd[3];
switch(_3de){
case "#":
_3db.id=_3df;
break;
case ".":
_3db.classNames.push(_3df);
break;
case ":":
_3db.pseudoClassNames.push(_3df);
break;
case "":
case undefined:
_3db.tagName=_3df.toUpperCase();
break;
default:
abort(repr(expr));
}
expr=rest;
}
if(expr.length>0){
abort(repr(expr));
}
},buildMatchExpression:function(){
var repr=MochiKit.Base.repr;
var _3e2=this.params;
var _3e3=[];
var _3e4,i;
function childElements(_3e6){
return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_3e6+".childNodes)";
}
if(_3e2.wildcard){
_3e3.push("true");
}
if(_3e4=_3e2.id){
_3e3.push("element.id == "+repr(_3e4));
}
if(_3e4=_3e2.tagName){
_3e3.push("element.tagName.toUpperCase() == "+repr(_3e4));
}
if((_3e4=_3e2.classNames).length>0){
for(i=0;i<_3e4.length;i++){
_3e3.push("MochiKit.DOM.hasElementClass(element, "+repr(_3e4[i])+")");
}
}
if((_3e4=_3e2.pseudoClassNames).length>0){
for(i=0;i<_3e4.length;i++){
var _3e7=_3e4[i].match(/^([^(]+)(?:\((.*)\))?$/);
var _3e8=_3e7[1];
var _3e9=_3e7[2];
switch(_3e8){
case "root":
_3e3.push("element.nodeType == 9 || element === element.ownerDocument.documentElement");
break;
case "nth-child":
case "nth-last-child":
case "nth-of-type":
case "nth-last-of-type":
_3e7=_3e9.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
if(!_3e7){
throw "Invalid argument to pseudo element nth-child: "+_3e9;
}
var a,b;
if(_3e7[0]=="odd"){
a=2;
b=1;
}else{
if(_3e7[0]=="even"){
a=2;
b=0;
}else{
a=_3e7[2]&&parseInt(_3e7)||null;
b=parseInt(_3e7[3]);
}
}
_3e3.push("this.nthChild(element,"+a+","+b+","+!!_3e8.match("^nth-last")+","+!!_3e8.match("of-type$")+")");
break;
case "first-child":
_3e3.push("this.nthChild(element, null, 1)");
break;
case "last-child":
_3e3.push("this.nthChild(element, null, 1, true)");
break;
case "first-of-type":
_3e3.push("this.nthChild(element, null, 1, false, true)");
break;
case "last-of-type":
_3e3.push("this.nthChild(element, null, 1, true, true)");
break;
case "only-child":
_3e3.push(childElements("element.parentNode")+".length == 1");
break;
case "only-of-type":
_3e3.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1");
break;
case "empty":
_3e3.push("element.childNodes.length == 0");
break;
case "enabled":
_3e3.push("(this.isUIElement(element) && element.disabled === false)");
break;
case "disabled":
_3e3.push("(this.isUIElement(element) && element.disabled === true)");
break;
case "checked":
_3e3.push("(this.isUIElement(element) && element.checked === true)");
break;
case "not":
var _3ec=new MochiKit.Selector.Selector(_3e9);
_3e3.push("!( "+_3ec.buildMatchExpression()+")");
break;
}
}
}
if(_3e4=_3e2.attributes){
MochiKit.Base.map(function(_3ed){
var _3ee="MochiKit.DOM.getNodeAttribute(element, "+repr(_3ed.name)+")";
var _3ef=function(_3f0){
return _3ee+".split("+repr(_3f0)+")";
};
_3e3.push(_3ee+" != null");
switch(_3ed.operator){
case "=":
_3e3.push(_3ee+" == "+repr(_3ed.value));
break;
case "~=":
_3e3.push("MochiKit.Base.findValue("+_3ef(" ")+", "+repr(_3ed.value)+") > -1");
break;
case "^=":
_3e3.push(_3ee+".substring(0, "+_3ed.value.length+") == "+repr(_3ed.value));
break;
case "$=":
_3e3.push(_3ee+".substring("+_3ee+".length - "+_3ed.value.length+") == "+repr(_3ed.value));
break;
case "*=":
_3e3.push(_3ee+".match("+repr(_3ed.value)+")");
break;
case "|=":
_3e3.push(_3ef("-")+"[0].toUpperCase() == "+repr(_3ed.value.toUpperCase()));
break;
case "!=":
_3e3.push(_3ee+" != "+repr(_3ed.value));
break;
case "":
case undefined:
break;
default:
throw "Unknown operator "+_3ed.operator+" in selector";
}
},_3e4);
}
return _3e3.join(" && ");
},compileMatcher:function(){
var code="return (!element.tagName) ? false : "+this.buildMatchExpression()+";";
this.match=new Function("element",code);
},nthChild:function(_3f2,a,b,_3f5,_3f6){
var _3f7=MochiKit.Base.filter(function(node){
return node.nodeType==1;
},_3f2.parentNode.childNodes);
if(_3f6){
_3f7=MochiKit.Base.filter(function(node){
return node.tagName==_3f2.tagName;
},_3f7);
}
if(_3f5){
_3f7=MochiKit.Iter.reversed(_3f7);
}
if(a){
var _3fa=MochiKit.Base.findIdentical(_3f7,_3f2);
return ((_3fa+1-b)/a)%1==0;
}else{
return b==MochiKit.Base.findIdentical(_3f7,_3f2)+1;
}
},isUIElement:function(_3fb){
return MochiKit.Base.findValue(["input","button","select","option","textarea","object"],_3fb.tagName.toLowerCase())>-1;
},findElements:function(_3fc,axis){
var _3fe;
if(axis==undefined){
axis="";
}
function inScope(_3ff,_400){
if(axis==""){
return MochiKit.DOM.isChildNode(_3ff,_400);
}else{
if(axis==">"){
return _3ff.parentNode===_400;
}else{
if(axis=="+"){
return _3ff===nextSiblingElement(_400);
}else{
if(axis=="~"){
var _401=_400;
while(_401=nextSiblingElement(_401)){
if(_3ff===_401){
return true;
}
}
return false;
}else{
throw "Invalid axis: "+axis;
}
}
}
}
}
if(_3fe=MochiKit.DOM.getElement(this.params.id)){
if(this.match(_3fe)){
if(!_3fc||inScope(_3fe,_3fc)){
return [_3fe];
}
}
}
function nextSiblingElement(node){
node=node.nextSibling;
while(node&&node.nodeType!=1){
node=node.nextSibling;
}
return node;
}
if(axis==""){
_3fc=(_3fc||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||"*");
}else{
if(axis==">"){
if(!_3fc){
throw "> combinator not allowed without preceeding expression";
}
_3fc=MochiKit.Base.filter(function(node){
return node.nodeType==1;
},_3fc.childNodes);
}else{
if(axis=="+"){
if(!_3fc){
throw "+ combinator not allowed without preceeding expression";
}
_3fc=nextSiblingElement(_3fc)&&[nextSiblingElement(_3fc)];
}else{
if(axis=="~"){
if(!_3fc){
throw "~ combinator not allowed without preceeding expression";
}
var _404=[];
while(nextSiblingElement(_3fc)){
_3fc=nextSiblingElement(_3fc);
_404.push(_3fc);
}
_3fc=_404;
}
}
}
}
if(!_3fc){
return [];
}
var _405=MochiKit.Base.filter(MochiKit.Base.bind(function(_406){
return this.match(_406);
},this),_3fc);
return _405;
},repr:function(){
return "Selector("+this.expression+")";
},toString:MochiKit.Base.forwardCall("repr")};
MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_407,_408){
var uniq=function(arr){
var res=[];
for(var i=0;i<arr.length;i++){
if(MochiKit.Base.findIdentical(res,arr[i])<0){
res.push(arr[i]);
}
}
return res;
};
return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_40d){
var _40e="";
var _40f=function(_410,expr){
if(match=expr.match(/^[>+~]$/)){
_40e=match[0];
return _410;
}else{
var _412=new MochiKit.Selector.Selector(expr);
var _413=MochiKit.Iter.reduce(function(_414,_415){
return MochiKit.Base.extend(_414,_412.findElements(_415||_407,_40e));
},_410,[]);
_40e="";
return _413;
}
};
var _416=_40d.replace(/(^\s+|\s+$)/g,"").split(/\s+/);
return uniq(MochiKit.Iter.reduce(_40f,_416,[null]));
},_408));
},findDocElements:function(){
return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
},__new__:function(){
var m=MochiKit.Base;
this.$$=this.findDocElements;
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
}});
MochiKit.Selector.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Selector);
MochiKit.Base._deps("Style",["Base","DOM"]);
MochiKit.Style.NAME="MochiKit.Style";
MochiKit.Style.VERSION="1.4.1";
MochiKit.Style.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Style.toString=function(){
return this.__repr__();
};
MochiKit.Style.EXPORT_OK=[];
MochiKit.Style.EXPORT=["setStyle","setOpacity","getStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","makePositioned","undoPositioned","makeClipping","undoClipping","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"];
MochiKit.Style.Dimensions=function(w,h){
this.w=w;
this.h=h;
};
MochiKit.Style.Dimensions.prototype.__repr__=function(){
var repr=MochiKit.Base.repr;
return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
};
MochiKit.Style.Dimensions.prototype.toString=function(){
return this.__repr__();
};
MochiKit.Style.Coordinates=function(x,y){
this.x=x;
this.y=y;
};
MochiKit.Style.Coordinates.prototype.__repr__=function(){
var repr=MochiKit.Base.repr;
return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
};
MochiKit.Style.Coordinates.prototype.toString=function(){
return this.__repr__();
};
MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_41f){
var dom=MochiKit.DOM;
var d=dom._document;
elem=dom.getElement(elem);
_41f=MochiKit.Base.camelize(_41f);
if(!elem||elem==d){
return undefined;
}
if(_41f=="opacity"&&typeof (elem.filters)!="undefined"){
var _422=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
if(_422&&_422[1]){
return parseFloat(_422[1])/100;
}
return 1;
}
if(_41f=="float"||_41f=="cssFloat"||_41f=="styleFloat"){
if(elem.style["float"]){
return elem.style["float"];
}else{
if(elem.style.cssFloat){
return elem.style.cssFloat;
}else{
if(elem.style.styleFloat){
return elem.style.styleFloat;
}else{
return "none";
}
}
}
}
var _423=elem.style?elem.style[_41f]:null;
if(!_423){
if(d.defaultView&&d.defaultView.getComputedStyle){
var css=d.defaultView.getComputedStyle(elem,null);
_41f=_41f.replace(/([A-Z])/g,"-$1").toLowerCase();
_423=css?css.getPropertyValue(_41f):null;
}else{
if(elem.currentStyle){
_423=elem.currentStyle[_41f];
if(/^\d/.test(_423)&&!/px$/.test(_423)&&_41f!="fontWeight"){
var left=elem.style.left;
var _426=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
elem.style.left=_423||0;
_423=elem.style.pixelLeft+"px";
elem.style.left=left;
elem.runtimeStyle.left=_426;
}
}
}
}
if(_41f=="opacity"){
_423=parseFloat(_423);
}
if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.findValue(["left","top","right","bottom"],_41f)!=-1)){
if(MochiKit.Style.getStyle(elem,"position")=="static"){
_423="auto";
}
}
return _423=="auto"?null:_423;
},setStyle:function(elem,_428){
elem=MochiKit.DOM.getElement(elem);
for(var name in _428){
switch(name){
case "opacity":
MochiKit.Style.setOpacity(elem,_428[name]);
break;
case "float":
case "cssFloat":
case "styleFloat":
if(typeof (elem.style["float"])!="undefined"){
elem.style["float"]=_428[name];
}else{
if(typeof (elem.style.cssFloat)!="undefined"){
elem.style.cssFloat=_428[name];
}else{
elem.style.styleFloat=_428[name];
}
}
break;
default:
elem.style[MochiKit.Base.camelize(name)]=_428[name];
}
}
},setOpacity:function(elem,o){
elem=MochiKit.DOM.getElement(elem);
var self=MochiKit.Style;
if(o==1){
var _42d=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
elem.style["opacity"]=_42d?0.999999:1;
if(/MSIE/.test(navigator.userAgent)){
elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(o<0.00001){
o=0;
}
elem.style["opacity"]=o;
if(/MSIE/.test(navigator.userAgent)){
elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")";
}
}
},getElementPosition:function(elem,_42f){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
elem=dom.getElement(elem);
if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode===null||self.getStyle(elem,"display")=="none"))){
return undefined;
}
var c=new self.Coordinates(0,0);
var box=null;
var _434=null;
var d=MochiKit.DOM._document;
var de=d.documentElement;
var b=d.body;
if(!elem.parentNode&&elem.x&&elem.y){
c.x+=elem.x||0;
c.y+=elem.y||0;
}else{
if(elem.getBoundingClientRect){
box=elem.getBoundingClientRect();
c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
}else{
if(elem.offsetParent){
c.x+=elem.offsetLeft;
c.y+=elem.offsetTop;
_434=elem.offsetParent;
if(_434!=elem){
while(_434){
c.x+=parseInt(_434.style.borderLeftWidth)||0;
c.y+=parseInt(_434.style.borderTopWidth)||0;
c.x+=_434.offsetLeft;
c.y+=_434.offsetTop;
_434=_434.offsetParent;
}
}
var ua=navigator.userAgent.toLowerCase();
if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("AppleWebKit")!=-1&&self.getStyle(elem,"position")=="absolute")){
c.x-=b.offsetLeft;
c.y-=b.offsetTop;
}
if(elem.parentNode){
_434=elem.parentNode;
}else{
_434=null;
}
while(_434){
var _439=_434.tagName.toUpperCase();
if(_439==="BODY"||_439==="HTML"){
break;
}
var disp=self.getStyle(_434,"display");
if(disp.search(/^inline|table-row.*$/i)){
c.x-=_434.scrollLeft;
c.y-=_434.scrollTop;
}
if(_434.parentNode){
_434=_434.parentNode;
}else{
_434=null;
}
}
}
}
}
if(typeof (_42f)!="undefined"){
_42f=arguments.callee(_42f);
if(_42f){
c.x-=(_42f.x||0);
c.y-=(_42f.y||0);
}
}
return c;
},setElementPosition:function(elem,_43c,_43d){
elem=MochiKit.DOM.getElement(elem);
if(typeof (_43d)=="undefined"){
_43d="px";
}
var _43e={};
var _43f=MochiKit.Base.isUndefinedOrNull;
if(!_43f(_43c.x)){
_43e["left"]=_43c.x+_43d;
}
if(!_43f(_43c.y)){
_43e["top"]=_43c.y+_43d;
}
MochiKit.DOM.updateNodeAttributes(elem,{"style":_43e});
},makePositioned:function(_440){
_440=MochiKit.DOM.getElement(_440);
var pos=MochiKit.Style.getStyle(_440,"position");
if(pos=="static"||!pos){
_440.style.position="relative";
if(/Opera/.test(navigator.userAgent)){
_440.style.top=0;
_440.style.left=0;
}
}
},undoPositioned:function(_442){
_442=MochiKit.DOM.getElement(_442);
if(_442.style.position=="relative"){
_442.style.position=_442.style.top=_442.style.left=_442.style.bottom=_442.style.right="";
}
},makeClipping:function(_443){
_443=MochiKit.DOM.getElement(_443);
var s=_443.style;
var _445={"overflow":s.overflow,"overflow-x":s.overflowX,"overflow-y":s.overflowY};
if((MochiKit.Style.getStyle(_443,"overflow")||"visible")!="hidden"){
_443.style.overflow="hidden";
_443.style.overflowX="hidden";
_443.style.overflowY="hidden";
}
return _445;
},undoClipping:function(_446,_447){
_446=MochiKit.DOM.getElement(_446);
if(typeof (_447)=="string"){
_446.style.overflow=_447;
}else{
if(_447!=null){
_446.style.overflow=_447["overflow"];
_446.style.overflowX=_447["overflow-x"];
_446.style.overflowY=_447["overflow-y"];
}
}
},getElementDimensions:function(elem,_449){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
return new self.Dimensions(elem.w||0,elem.h||0);
}
elem=dom.getElement(elem);
if(!elem){
return undefined;
}
var disp=self.getStyle(elem,"display");
if(disp=="none"||disp==""||typeof (disp)=="undefined"){
var s=elem.style;
var _44e=s.visibility;
var _44f=s.position;
var _450=s.display;
s.visibility="hidden";
s.position="absolute";
s.display=self._getDefaultDisplay(elem);
var _451=elem.offsetWidth;
var _452=elem.offsetHeight;
s.display=_450;
s.position=_44f;
s.visibility=_44e;
}else{
_451=elem.offsetWidth||0;
_452=elem.offsetHeight||0;
}
if(_449){
var _453="colSpan" in elem&&"rowSpan" in elem;
var _454=(_453&&elem.parentNode&&self.getStyle(elem.parentNode,"borderCollapse")=="collapse");
if(_454){
if(/MSIE/.test(navigator.userAgent)){
var _455=elem.previousSibling?0.5:1;
var _456=elem.nextSibling?0.5:1;
}else{
var _455=0.5;
var _456=0.5;
}
}else{
var _455=1;
var _456=1;
}
_451-=Math.round((parseFloat(self.getStyle(elem,"paddingLeft"))||0)+(parseFloat(self.getStyle(elem,"paddingRight"))||0)+_455*(parseFloat(self.getStyle(elem,"borderLeftWidth"))||0)+_456*(parseFloat(self.getStyle(elem,"borderRightWidth"))||0));
if(_453){
if(/Gecko|Opera/.test(navigator.userAgent)&&!/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent)){
var _457=0;
}else{
if(/MSIE/.test(navigator.userAgent)){
var _457=1;
}else{
var _457=_454?0.5:1;
}
}
}else{
var _457=1;
}
_452-=Math.round((parseFloat(self.getStyle(elem,"paddingTop"))||0)+(parseFloat(self.getStyle(elem,"paddingBottom"))||0)+_457*((parseFloat(self.getStyle(elem,"borderTopWidth"))||0)+(parseFloat(self.getStyle(elem,"borderBottomWidth"))||0)));
}
return new self.Dimensions(_451,_452);
},setElementDimensions:function(elem,_459,_45a){
elem=MochiKit.DOM.getElement(elem);
if(typeof (_45a)=="undefined"){
_45a="px";
}
var _45b={};
var _45c=MochiKit.Base.isUndefinedOrNull;
if(!_45c(_459.w)){
_45b["width"]=_459.w+_45a;
}
if(!_45c(_459.h)){
_45b["height"]=_459.h+_45a;
}
MochiKit.DOM.updateNodeAttributes(elem,{"style":_45b});
},_getDefaultDisplay:function(elem){
var self=MochiKit.Style;
var dom=MochiKit.DOM;
elem=dom.getElement(elem);
if(!elem){
return undefined;
}
var _460=elem.tagName.toUpperCase();
return self._defaultDisplay[_460]||"block";
},setDisplayForElement:function(_461,_462){
var _463=MochiKit.Base.extend(null,arguments,1);
var _464=MochiKit.DOM.getElement;
for(var i=0;i<_463.length;i++){
_462=_464(_463[i]);
if(_462){
_462.style.display=_461;
}
}
},getViewportDimensions:function(){
var d=new MochiKit.Style.Dimensions();
var w=MochiKit.DOM._window;
var b=MochiKit.DOM._document.body;
if(w.innerWidth){
d.w=w.innerWidth;
d.h=w.innerHeight;
}else{
if(b.parentElement.clientWidth){
d.w=b.parentElement.clientWidth;
d.h=b.parentElement.clientHeight;
}else{
if(b&&b.clientWidth){
d.w=b.clientWidth;
d.h=b.clientHeight;
}
}
}
return d;
},getViewportPosition:function(){
var c=new MochiKit.Style.Coordinates(0,0);
var d=MochiKit.DOM._document;
var de=d.documentElement;
var db=d.body;
if(de&&(de.scrollTop||de.scrollLeft)){
c.x=de.scrollLeft;
c.y=de.scrollTop;
}else{
if(db){
c.x=db.scrollLeft;
c.y=db.scrollTop;
}
}
return c;
},__new__:function(){
var m=MochiKit.Base;
var _46e=["A","ABBR","ACRONYM","B","BASEFONT","BDO","BIG","BR","CITE","CODE","DFN","EM","FONT","I","IMG","KBD","LABEL","Q","S","SAMP","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","TEXTAREA","TT","U","VAR"];
this._defaultDisplay={"TABLE":"table","THEAD":"table-header-group","TBODY":"table-row-group","TFOOT":"table-footer-group","COLGROUP":"table-column-group","COL":"table-column","TR":"table-row","TD":"table-cell","TH":"table-cell","CAPTION":"table-caption","LI":"list-item","INPUT":"inline-block","SELECT":"inline-block"};
for(var i=0;i<_46e.length;i++){
this._defaultDisplay[_46e[i]]="inline";
}
this.elementPosition=this.getElementPosition;
this.elementDimensions=this.getElementDimensions;
this.hideElement=m.partial(this.setDisplayForElement,"none");
this.showElement=m.partial(this.setDisplayForElement,"block");
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
}});
MochiKit.Style.__new__();
MochiKit.Base._exportSymbols(this,MochiKit.Style);
MochiKit.Base._deps("LoggingPane",["Base","Logging"]);
MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
MochiKit.LoggingPane.VERSION="1.4.1";
MochiKit.LoggingPane.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.LoggingPane.toString=function(){
return this.__repr__();
};
MochiKit.LoggingPane.createLoggingPane=function(_470){
var m=MochiKit.LoggingPane;
_470=!(!_470);
if(m._loggingPane&&m._loggingPane.inline!=_470){
m._loggingPane.closePane();
m._loggingPane=null;
}
if(!m._loggingPane||m._loggingPane.closed){
m._loggingPane=new m.LoggingPane(_470,MochiKit.Logging.logger);
}
return m._loggingPane;
};
MochiKit.LoggingPane.LoggingPane=function(_472,_473){
if(typeof (_473)=="undefined"||_473===null){
_473=MochiKit.Logging.logger;
}
this.logger=_473;
var _474=MochiKit.Base.update;
var _475=MochiKit.Base.updatetree;
var bind=MochiKit.Base.bind;
var _477=MochiKit.Base.clone;
var win=window;
var uid="_MochiKit_LoggingPane";
if(typeof (MochiKit.DOM)!="undefined"){
win=MochiKit.DOM.currentWindow();
}
if(!_472){
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 _47e=doc.getElementById(uid);
var _47f=!!_47e;
if(_47e&&typeof (_47e.loggingPane)!="undefined"){
_47e.loggingPane.logger=this.logger;
_47e.loggingPane.buildAndApplyFilter();
return _47e.loggingPane;
}
if(_47f){
var _480;
while((_480=_47e.firstChild)){
_47e.removeChild(_480);
}
}else{
_47e=doc.createElement("div");
_47e.id=uid;
}
_47e.loggingPane=this;
var _481=doc.createElement("input");
var _482=doc.createElement("input");
var _483=doc.createElement("button");
var _484=doc.createElement("button");
var _485=doc.createElement("button");
var _486=doc.createElement("button");
var _487=doc.createElement("div");
var _488=doc.createElement("div");
var _489=uid+"_Listener";
this.colorTable=_477(this.colorTable);
var _48a=[];
var _48b=null;
var _48c=function(msg){
var _48e=msg.level;
if(typeof (_48e)=="number"){
_48e=MochiKit.Logging.LogLevel[_48e];
}
return _48e;
};
var _48f=function(msg){
return msg.info.join(" ");
};
var _491=bind(function(msg){
var _493=_48c(msg);
var text=_48f(msg);
var c=this.colorTable[_493];
var p=doc.createElement("span");
p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_493;
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(_493+": "+text));
_488.appendChild(p);
_488.appendChild(doc.createElement("br"));
if(_487.offsetHeight>_487.scrollHeight){
_487.scrollTop=0;
}else{
_487.scrollTop=_487.scrollHeight;
}
},this);
var _497=function(msg){
_48a[_48a.length]=msg;
_491(msg);
};
var _499=function(){
var _49a,_49b;
try{
_49a=new RegExp(_481.value);
_49b=new RegExp(_482.value);
}
catch(e){
logDebug("Error in filter regex: "+e.message);
return null;
}
return function(msg){
return (_49a.test(_48c(msg))&&_49b.test(_48f(msg)));
};
};
var _49d=function(){
while(_488.firstChild){
_488.removeChild(_488.firstChild);
}
};
var _49e=function(){
_48a=[];
_49d();
};
var _49f=bind(function(){
if(this.closed){
return;
}
this.closed=true;
if(MochiKit.LoggingPane._loggingPane==this){
MochiKit.LoggingPane._loggingPane=null;
}
this.logger.removeListener(_489);
try{
try{
_47e.loggingPane=null;
}
catch(e){
logFatal("Bookmarklet was closed incorrectly.");
}
if(_472){
_47e.parentNode.removeChild(_47e);
}else{
this.win.close();
}
}
catch(e){
}
},this);
var _4a0=function(){
_49d();
for(var i=0;i<_48a.length;i++){
var msg=_48a[i];
if(_48b===null||_48b(msg)){
_491(msg);
}
}
};
this.buildAndApplyFilter=function(){
_48b=_499();
_4a0();
this.logger.removeListener(_489);
this.logger.addListener(_489,_48b,_497);
};
var _4a3=bind(function(){
_48a=this.logger.getMessages();
_4a0();
},this);
var _4a4=bind(function(_4a5){
_4a5=_4a5||window.event;
key=_4a5.which||_4a5.keyCode;
if(key==13){
this.buildAndApplyFilter();
}
},this);
var _4a6="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
if(_472){
_4a6+="; height: 10em; border-top: 2px solid black";
}else{
_4a6+="; height: 100%;";
}
_47e.style.cssText=_4a6;
if(!_47f){
doc.body.appendChild(_47e);
}
_4a6={"cssText":"width: 33%; display: inline; font: "+this.logFont};
_475(_481,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_4a4,"style":_4a6});
_47e.appendChild(_481);
_475(_482,{"value":".*","onkeypress":_4a4,"style":_4a6});
_47e.appendChild(_482);
_4a6="width: 8%; display:inline; font: "+this.logFont;
_483.appendChild(doc.createTextNode("Filter"));
_483.onclick=bind("buildAndApplyFilter",this);
_483.style.cssText=_4a6;
_47e.appendChild(_483);
_484.appendChild(doc.createTextNode("Load"));
_484.onclick=_4a3;
_484.style.cssText=_4a6;
_47e.appendChild(_484);
_485.appendChild(doc.createTextNode("Clear"));
_485.onclick=_49e;
_485.style.cssText=_4a6;
_47e.appendChild(_485);
_486.appendChild(doc.createTextNode("Close"));
_486.onclick=_49f;
_486.style.cssText=_4a6;
_47e.appendChild(_486);
_487.style.cssText="overflow: auto; width: 100%";
_488.style.cssText="width: 100%; height: "+(_472?"8em":"100%");
_487.appendChild(_488);
_47e.appendChild(_487);
this.buildAndApplyFilter();
_4a3();
if(_472){
this.win=undefined;
}else{
this.win=win;
}
this.inline=_472;
this.closePane=_49f;
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);
MochiKit.Base._deps("Color",["Base","DOM","Style"]);
MochiKit.Color.NAME="MochiKit.Color";
MochiKit.Color.VERSION="1.4.1";
MochiKit.Color.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Color.toString=function(){
return this.__repr__();
};
MochiKit.Color.Color=function(red,_4a8,blue,_4aa){
if(typeof (_4aa)=="undefined"||_4aa===null){
_4aa=1;
}
this.rgb={r:red,g:_4a8,b:blue,a:_4aa};
};
MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_4ab){
var rgb=this.rgb;
var m=MochiKit.Color;
return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_4ab);
},colorWithHue:function(hue){
var hsl=this.asHSL();
hsl.h=hue;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},colorWithSaturation:function(_4b1){
var hsl=this.asHSL();
hsl.s=_4b1;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},colorWithLightness:function(_4b4){
var hsl=this.asHSL();
hsl.l=_4b4;
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},darkerColorWithLevel:function(_4b7){
var hsl=this.asHSL();
hsl.l=Math.max(hsl.l-_4b7,0);
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},lighterColorWithLevel:function(_4ba){
var hsl=this.asHSL();
hsl.l=Math.min(hsl.l+_4ba,1);
var m=MochiKit.Color;
return m.Color.fromHSL(hsl);
},blendedColor:function(_4bd,_4be){
if(typeof (_4be)=="undefined"||_4be===null){
_4be=0.5;
}
var sf=1-_4be;
var s=this.rgb;
var d=_4bd.rgb;
var df=_4be;
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(_4c3){
var a=this.asRGB();
var b=_4c3.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,_4da,blue,_4dc){
var _4dd=MochiKit.Color.Color;
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_4da=rgb.g;
blue=rgb.b;
if(typeof (rgb.a)=="undefined"){
_4dc=undefined;
}else{
_4dc=rgb.a;
}
}
return new _4dd(red,_4da,blue,_4dc);
},fromHSL:function(hue,_4e0,_4e1,_4e2){
var m=MochiKit.Color;
return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
},fromHSV:function(hue,_4e5,_4e6,_4e7){
var m=MochiKit.Color;
return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
},fromName:function(name){
var _4ea=MochiKit.Color.Color;
if(name.charAt(0)=="\""){
name=name.substr(1,name.length-2);
}
var _4eb=_4ea._namedColors[name.toLowerCase()];
if(typeof (_4eb)=="string"){
return _4ea.fromHexString(_4eb);
}else{
if(name=="transparent"){
return _4ea.transparentColor();
}
}
return null;
},fromString:function(_4ec){
var self=MochiKit.Color.Color;
var _4ee=_4ec.substr(0,3);
if(_4ee=="rgb"){
return self.fromRGBString(_4ec);
}else{
if(_4ee=="hsl"){
return self.fromHSLString(_4ec);
}else{
if(_4ec.charAt(0)=="#"){
return self.fromHexString(_4ec);
}
}
}
return self.fromName(_4ec);
},fromHexString:function(_4ef){
if(_4ef.charAt(0)=="#"){
_4ef=_4ef.substring(1);
}
var _4f0=[];
var i,hex;
if(_4ef.length==3){
for(i=0;i<3;i++){
hex=_4ef.substr(i,1);
_4f0.push(parseInt(hex+hex,16)/255);
}
}else{
for(i=0;i<6;i+=2){
hex=_4ef.substr(i,2);
_4f0.push(parseInt(hex,16)/255);
}
}
var _4f3=MochiKit.Color.Color;
return _4f3.fromRGB.apply(_4f3,_4f0);
},_fromColorString:function(pre,_4f5,_4f6,_4f7){
if(_4f7.indexOf(pre)===0){
_4f7=_4f7.substring(_4f7.indexOf("(",3)+1,_4f7.length-1);
}
var _4f8=_4f7.split(/\s*,\s*/);
var _4f9=[];
for(var i=0;i<_4f8.length;i++){
var c=_4f8[i];
var val;
var _4fd=c.substring(c.length-3);
if(c.charAt(c.length-1)=="%"){
val=0.01*parseFloat(c.substring(0,c.length-1));
}else{
if(_4fd=="deg"){
val=parseFloat(c)/360;
}else{
if(_4fd=="rad"){
val=parseFloat(c)/(Math.PI*2);
}else{
val=_4f6[i]*parseFloat(c);
}
}
}
_4f9.push(val);
}
return this[_4f5].apply(this,_4f9);
},fromComputedStyle:function(elem,_4ff){
var d=MochiKit.DOM;
var cls=MochiKit.Color.Color;
for(elem=d.getElement(elem);elem;elem=elem.parentNode){
var _502=MochiKit.Style.getStyle.apply(d,arguments);
if(!_502){
continue;
}
var _503=cls.fromString(_502);
if(!_503){
break;
}
if(_503.asRGB().a>0){
return _503;
}
}
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,_509){
v*=_509;
if(v<0){
return 0;
}else{
if(v>_509){
return _509;
}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,_50f,_510,_511){
if(arguments.length==1){
var hsv=hue;
hue=hsv.h;
_50f=hsv.s;
_510=hsv.v;
_511=hsv.a;
}
var red;
var _514;
var blue;
if(_50f===0){
red=_510;
_514=_510;
blue=_510;
}else{
var i=Math.floor(hue*6);
var f=(hue*6)-i;
var p=_510*(1-_50f);
var q=_510*(1-(_50f*f));
var t=_510*(1-(_50f*(1-f)));
switch(i){
case 1:
red=q;
_514=_510;
blue=p;
break;
case 2:
red=p;
_514=_510;
blue=t;
break;
case 3:
red=p;
_514=q;
blue=_510;
break;
case 4:
red=t;
_514=p;
blue=_510;
break;
case 5:
red=_510;
_514=p;
blue=q;
break;
case 6:
case 0:
red=_510;
_514=t;
blue=p;
break;
}
}
return {r:red,g:_514,b:blue,a:_511};
},hslToRGB:function(hue,_51c,_51d,_51e){
if(arguments.length==1){
var hsl=hue;
hue=hsl.h;
_51c=hsl.s;
_51d=hsl.l;
_51e=hsl.a;
}
var red;
var _521;
var blue;
if(_51c===0){
red=_51d;
_521=_51d;
blue=_51d;
}else{
var m2;
if(_51d<=0.5){
m2=_51d*(1+_51c);
}else{
m2=_51d+_51c-(_51d*_51c);
}
var m1=(2*_51d)-m2;
var f=MochiKit.Color._hslValue;
var h6=hue*6;
red=f(m1,m2,h6+2);
_521=f(m1,m2,h6);
blue=f(m1,m2,h6-2);
}
return {r:red,g:_521,b:blue,a:_51e};
},rgbToHSV:function(red,_528,blue,_52a){
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_528=rgb.g;
blue=rgb.b;
_52a=rgb.a;
}
var max=Math.max(Math.max(red,_528),blue);
var min=Math.min(Math.min(red,_528),blue);
var hue;
var _52f;
var _530=max;
if(min==max){
hue=0;
_52f=0;
}else{
var _531=(max-min);
_52f=_531/max;
if(red==max){
hue=(_528-blue)/_531;
}else{
if(_528==max){
hue=2+((blue-red)/_531);
}else{
hue=4+((red-_528)/_531);
}
}
hue/=6;
if(hue<0){
hue+=1;
}
if(hue>1){
hue-=1;
}
}
return {h:hue,s:_52f,v:_530,a:_52a};
},rgbToHSL:function(red,_533,blue,_535){
if(arguments.length==1){
var rgb=red;
red=rgb.r;
_533=rgb.g;
blue=rgb.b;
_535=rgb.a;
}
var max=Math.max(red,Math.max(_533,blue));
var min=Math.min(red,Math.min(_533,blue));
var hue;
var _53a;
var _53b=(max+min)/2;
var _53c=max-min;
if(_53c===0){
hue=0;
_53a=0;
}else{
if(_53b<=0.5){
_53a=_53c/(max+min);
}else{
_53a=_53c/(2-max-min);
}
if(red==max){
hue=(_533-blue)/_53c;
}else{
if(_533==max){
hue=2+((blue-red)/_53c);
}else{
hue=4+((red-_533)/_53c);
}
}
hue/=6;
if(hue<0){
hue+=1;
}
if(hue>1){
hue-=1;
}
}
return {h:hue,s:_53a,l:_53b,a:_535};
},toColorPart:function(num){
num=Math.round(num);
var _53e=num.toString(16);
if(num<16){
return "0"+_53e;
}
return _53e;
},__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 _540=1/3;
var _541={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_540,_540,_540],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_540,2*_540,2*_540],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 _542=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 _541){
var name=k+"Color";
var _54b=m.concat([_542,this.Color,name],_541[k]);
this.Color[name]=m.bind.apply(null,_54b);
}
var _54c=function(){
for(var i=0;i<arguments.length;i++){
if(!(arguments[i] instanceof MochiKit.Color.Color)){
return false;
}
}
return true;
};
var _54e=function(a,b){
return a.compareRGB(b);
};
m.nameFunctions(this);
m.registerComparator(this.Color.NAME,_54c,_54e);
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"};
MochiKit.Base._deps("Signal",["Base","DOM","Style"]);
MochiKit.Signal.NAME="MochiKit.Signal";
MochiKit.Signal.VERSION="1.4.1";
MochiKit.Signal._observers=[];
MochiKit.Signal.Event=function(src,e){
this._event=e||window.event;
this._src=src;
};
MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
var repr=MochiKit.Base.repr;
var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target());
if(this.type()&&this.type().indexOf("key")===0||this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu"){
str+=", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}";
}
if(this.type()&&this.type().indexOf("key")===0){
str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
}
if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
if(this.type()!="mousemove"&&this.type()!="mousewheel"){
str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}";
}
if(this.type()=="mousewheel"){
str+=", wheel: "+repr(this.mouse().wheel);
}
str+="}";
}
if(this.type()=="mouseover"||this.type()=="mouseout"||this.type()=="mouseenter"||this.type()=="mouseleave"){
str+=", relatedTarget(): "+repr(this.relatedTarget());
}
str+="}";
return str;
},toString:function(){
return this.__repr__();
},src:function(){
return this._src;
},event:function(){
return this._event;
},type:function(){
if(this._event.type==="DOMMouseScroll"){
return "mousewheel";
}else{
return this._event.type||undefined;
}
},target:function(){
return this._event.target||this._event.srcElement;
},_relatedTarget:null,relatedTarget:function(){
if(this._relatedTarget!==null){
return this._relatedTarget;
}
var elem=null;
if(this.type()=="mouseover"||this.type()=="mouseenter"){
elem=(this._event.relatedTarget||this._event.fromElement);
}else{
if(this.type()=="mouseout"||this.type()=="mouseleave"){
elem=(this._event.relatedTarget||this._event.toElement);
}
}
try{
if(elem!==null&&elem.nodeType!==null){
this._relatedTarget=elem;
return elem;
}
}
catch(ignore){
}
return undefined;
},_modifier:null,modifier:function(){
if(this._modifier!==null){
return this._modifier;
}
var m={};
m.alt=this._event.altKey;
m.ctrl=this._event.ctrlKey;
m.meta=this._event.metaKey||false;
m.shift=this._event.shiftKey;
m.any=m.alt||m.ctrl||m.shift||m.meta;
this._modifier=m;
return m;
},_key:null,key:function(){
if(this._key!==null){
return this._key;
}
var k={};
if(this.type()&&this.type().indexOf("key")===0){
if(this.type()=="keydown"||this.type()=="keyup"){
k.code=this._event.keyCode;
k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
this._key=k;
return k;
}else{
if(this.type()=="keypress"){
k.code=0;
k.string="";
if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
k.code=this._event.charCode;
k.string=String.fromCharCode(k.code);
}else{
if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
k.code=this._event.keyCode;
k.string=String.fromCharCode(k.code);
}
}
this._key=k;
return k;
}
}
}
return undefined;
},_mouse:null,mouse:function(){
if(this._mouse!==null){
return this._mouse;
}
var m={};
var e=this._event;
if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
m.client=new MochiKit.Style.Coordinates(0,0);
if(e.clientX||e.clientY){
m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
}
m.page=new MochiKit.Style.Coordinates(0,0);
if(e.pageX||e.pageY){
m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
}else{
var de=MochiKit.DOM._document.documentElement;
var b=MochiKit.DOM._document.body;
m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
}
if(this.type()!="mousemove"&&this.type()!="mousewheel"){
m.button={};
m.button.left=false;
m.button.right=false;
m.button.middle=false;
if(e.which){
m.button.left=(e.which==1);
m.button.middle=(e.which==2);
m.button.right=(e.which==3);
}else{
m.button.left=!!(e.button&1);
m.button.right=!!(e.button&2);
m.button.middle=!!(e.button&4);
}
}
if(this.type()=="mousewheel"){
m.wheel=new MochiKit.Style.Coordinates(0,0);
if(e.wheelDeltaX||e.wheelDeltaY){
m.wheel.x=e.wheelDeltaX/-40||0;
m.wheel.y=e.wheelDeltaY/-40||0;
}else{
if(e.wheelDelta){
m.wheel.y=e.wheelDelta/-40;
}else{
m.wheel.y=e.detail||0;
}
}
}
this._mouse=m;
return m;
}
return undefined;
},stop:function(){
this.stopPropagation();
this.preventDefault();
},stopPropagation:function(){
if(this._event.stopPropagation){
this._event.stopPropagation();
}else{
this._event.cancelBubble=true;
}
},preventDefault:function(){
if(this._event.preventDefault){
this._event.preventDefault();
}else{
if(this._confirmUnload===null){
this._event.returnValue=false;
}
}
},_confirmUnload:null,confirmUnload:function(msg){
if(this.type()=="beforeunload"){
this._confirmUnload=msg;
this._event.returnValue=msg;
}
}});
MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"};
(function(){
var _55d=MochiKit.Signal._specialMacKeys;
for(i=63236;i<=63242;i++){
_55d[i]="KEY_F"+(i-63236+1);
}
})();
MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"};
(function(){
var _55e=MochiKit.Signal._specialKeys;
for(var i=48;i<=57;i++){
_55e[i]="KEY_"+(i-48);
}
for(i=65;i<=90;i++){
_55e[i]="KEY_"+String.fromCharCode(i);
}
for(i=96;i<=105;i++){
_55e[i]="KEY_NUM_PAD_"+(i-96);
}
for(i=112;i<=123;i++){
_55e[i]="KEY_F"+(i-112+1);
}
})();
MochiKit.Signal.Ident=function(_560){
this.source=_560.source;
this.signal=_560.signal;
this.listener=_560.listener;
this.isDOM=_560.isDOM;
this.objOrFunc=_560.objOrFunc;
this.funcOrStr=_560.funcOrStr;
this.connected=_560.connected;
};
MochiKit.Signal.Ident.prototype={};
MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
return "["+this.NAME+" "+this.VERSION+"]";
},toString:function(){
return this.__repr__();
},_unloadCache:function(){
var self=MochiKit.Signal;
var _562=self._observers;
for(var i=0;i<_562.length;i++){
if(_562[i].signal!=="onload"&&_562[i].signal!=="onunload"){
self._disconnect(_562[i]);
}
}
},_listener:function(src,sig,func,obj,_568){
var self=MochiKit.Signal;
var E=self.Event;
if(!_568){
if(typeof (func.im_self)=="undefined"){
return MochiKit.Base.bindLate(func,obj);
}else{
return func;
}
}
obj=obj||src;
if(typeof (func)=="string"){
if(sig==="onload"||sig==="onunload"){
return function(_56b){
obj[func].apply(obj,[new E(src,_56b)]);
var _56c=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
MochiKit.Signal._disconnect(_56c);
};
}else{
return function(_56d){
obj[func].apply(obj,[new E(src,_56d)]);
};
}
}else{
if(sig==="onload"||sig==="onunload"){
return function(_56e){
func.apply(obj,[new E(src,_56e)]);
var _56f=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
MochiKit.Signal._disconnect(_56f);
};
}else{
return function(_570){
func.apply(obj,[new E(src,_570)]);
};
}
}
},_browserAlreadyHasMouseEnterAndLeave:function(){
return /MSIE/.test(navigator.userAgent);
},_browserLacksMouseWheelEvent:function(){
return /Gecko\//.test(navigator.userAgent);
},_mouseEnterListener:function(src,sig,func,obj){
var E=MochiKit.Signal.Event;
return function(_576){
var e=new E(src,_576);
try{
e.relatedTarget().nodeName;
}
catch(err){
return;
}
e.stop();
if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
return;
}
e.type=function(){
return sig;
};
if(typeof (func)=="string"){
return obj[func].apply(obj,[e]);
}else{
return func.apply(obj,[e]);
}
};
},_getDestPair:function(_578,_579){
var obj=null;
var func=null;
if(typeof (_579)!="undefined"){
obj=_578;
func=_579;
if(typeof (_579)=="string"){
if(typeof (_578[_579])!="function"){
throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
}
}else{
if(typeof (_579)!="function"){
throw new Error("'funcOrStr' must be a function or string");
}
}
}else{
if(typeof (_578)!="function"){
throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
}else{
func=_578;
}
}
return [obj,func];
},connect:function(src,sig,_57e,_57f){
src=MochiKit.DOM.getElement(src);
var self=MochiKit.Signal;
if(typeof (sig)!="string"){
throw new Error("'sig' must be a string");
}
var _581=self._getDestPair(_57e,_57f);
var obj=_581[0];
var func=_581[1];
if(typeof (obj)=="undefined"||obj===null){
obj=src;
}
var _584=!!(src.addEventListener||src.attachEvent);
if(_584&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
var _585=self._mouseEnterListener(src,sig.substr(2),func,obj);
if(sig==="onmouseenter"){
sig="onmouseover";
}else{
sig="onmouseout";
}
}else{
if(_584&&sig=="onmousewheel"&&self._browserLacksMouseWheelEvent()){
var _585=self._listener(src,sig,func,obj,_584);
sig="onDOMMouseScroll";
}else{
var _585=self._listener(src,sig,func,obj,_584);
}
}
if(src.addEventListener){
src.addEventListener(sig.substr(2),_585,false);
}else{
if(src.attachEvent){
src.attachEvent(sig,_585);
}
}
var _586=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_585,isDOM:_584,objOrFunc:_57e,funcOrStr:_57f,connected:true});
self._observers.push(_586);
if(!_584&&typeof (src.__connect__)=="function"){
var args=MochiKit.Base.extend([_586],arguments,1);
src.__connect__.apply(src,args);
}
return _586;
},_disconnect:function(_588){
if(!_588.connected){
return;
}
_588.connected=false;
var src=_588.source;
var sig=_588.signal;
var _58b=_588.listener;
if(!_588.isDOM){
if(typeof (src.__disconnect__)=="function"){
src.__disconnect__(_588,sig,_588.objOrFunc,_588.funcOrStr);
}
return;
}
if(src.removeEventListener){
src.removeEventListener(sig.substr(2),_58b,false);
}else{
if(src.detachEvent){
src.detachEvent(sig,_58b);
}else{
throw new Error("'src' must be a DOM element");
}
}
},disconnect:function(_58c){
var self=MochiKit.Signal;
var _58e=self._observers;
var m=MochiKit.Base;
if(arguments.length>1){
var src=MochiKit.DOM.getElement(arguments[0]);
var sig=arguments[1];
var obj=arguments[2];
var func=arguments[3];
for(var i=_58e.length-1;i>=0;i--){
var o=_58e[i];
if(o.source===src&&o.signal===sig&&o.objOrFunc===obj&&o.funcOrStr===func){
self._disconnect(o);
if(!self._lock){
_58e.splice(i,1);
}else{
self._dirty=true;
}
return true;
}
}
}else{
var idx=m.findIdentical(_58e,_58c);
if(idx>=0){
self._disconnect(_58c);
if(!self._lock){
_58e.splice(idx,1);
}else{
self._dirty=true;
}
return true;
}
}
return false;
},disconnectAllTo:function(_597,_598){
var self=MochiKit.Signal;
var _59a=self._observers;
var _59b=self._disconnect;
var _59c=self._lock;
var _59d=self._dirty;
if(typeof (_598)==="undefined"){
_598=null;
}
for(var i=_59a.length-1;i>=0;i--){
var _59f=_59a[i];
if(_59f.objOrFunc===_597&&(_598===null||_59f.funcOrStr===_598)){
_59b(_59f);
if(_59c){
_59d=true;
}else{
_59a.splice(i,1);
}
}
}
self._dirty=_59d;
},disconnectAll:function(src,sig){
src=MochiKit.DOM.getElement(src);
var m=MochiKit.Base;
var _5a3=m.flattenArguments(m.extend(null,arguments,1));
var self=MochiKit.Signal;
var _5a5=self._disconnect;
var _5a6=self._observers;
var i,_5a8;
var _5a9=self._lock;
var _5aa=self._dirty;
if(_5a3.length===0){
for(i=_5a6.length-1;i>=0;i--){
_5a8=_5a6[i];
if(_5a8.source===src){
_5a5(_5a8);
if(!_5a9){
_5a6.splice(i,1);
}else{
_5aa=true;
}
}
}
}else{
var sigs={};
for(i=0;i<_5a3.length;i++){
sigs[_5a3[i]]=true;
}
for(i=_5a6.length-1;i>=0;i--){
_5a8=_5a6[i];
if(_5a8.source===src&&_5a8.signal in sigs){
_5a5(_5a8);
if(!_5a9){
_5a6.splice(i,1);
}else{
_5aa=true;
}
}
}
}
self._dirty=_5aa;
},signal:function(src,sig){
var self=MochiKit.Signal;
var _5af=self._observers;
src=MochiKit.DOM.getElement(src);
var args=MochiKit.Base.extend(null,arguments,2);
var _5b1=[];
self._lock=true;
for(var i=0;i<_5af.length;i++){
var _5b3=_5af[i];
if(_5b3.source===src&&_5b3.signal===sig&&_5b3.connected){
try{
_5b3.listener.apply(src,args);
}
catch(e){
_5b1.push(e);
}
}
}
self._lock=false;
if(self._dirty){
self._dirty=false;
for(var i=_5af.length-1;i>=0;i--){
if(!_5af[i].connected){
_5af.splice(i,1);
}
}
}
if(_5b1.length==1){
throw _5b1[0];
}else{
if(_5b1.length>1){
var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
e.errors=_5b1;
throw e;
}
}
}});
MochiKit.Signal.EXPORT_OK=[];
MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll","disconnectAllTo"];
MochiKit.Signal.__new__=function(win){
var m=MochiKit.Base;
this._document=document;
this._window=win;
this._lock=false;
this._dirty=false;
try{
this.connect(window,"onunload",this._unloadCache);
}
catch(e){
}
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Signal.__new__(this);
if(MochiKit.__export__){
connect=MochiKit.Signal.connect;
disconnect=MochiKit.Signal.disconnect;
disconnectAll=MochiKit.Signal.disconnectAll;
signal=MochiKit.Signal.signal;
}
MochiKit.Base._exportSymbols(this,MochiKit.Signal);
MochiKit.Base._deps("Position",["Base","DOM","Style"]);
MochiKit.Position.NAME="MochiKit.Position";
MochiKit.Position.VERSION="1.4.1";
MochiKit.Position.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Position.toString=function(){
return this.__repr__();
};
MochiKit.Position.EXPORT_OK=[];
MochiKit.Position.EXPORT=[];
MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){
var _5b7=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
var _5b8=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
this.windowOffset=new MochiKit.Style.Coordinates(_5b7,_5b8);
},cumulativeOffset:function(_5b9){
var _5ba=0;
var _5bb=0;
do{
_5ba+=_5b9.offsetTop||0;
_5bb+=_5b9.offsetLeft||0;
_5b9=_5b9.offsetParent;
}while(_5b9);
return new MochiKit.Style.Coordinates(_5bb,_5ba);
},realOffset:function(_5bc){
var _5bd=0;
var _5be=0;
do{
_5bd+=_5bc.scrollTop||0;
_5be+=_5bc.scrollLeft||0;
_5bc=_5bc.parentNode;
}while(_5bc);
return new MochiKit.Style.Coordinates(_5be,_5bd);
},within:function(_5bf,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_5bf,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_5bf);
if(_5bf.style.position=="fixed"){
this.offset.x+=this.windowOffset.x;
this.offset.y+=this.windowOffset.y;
}
return (y>=this.offset.y&&y<this.offset.y+_5bf.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_5bf.offsetWidth);
},withinIncludingScrolloffsets:function(_5c2,x,y){
var _5c5=this.realOffset(_5c2);
this.xcomp=x+_5c5.x-this.windowOffset.x;
this.ycomp=y+_5c5.y-this.windowOffset.y;
this.offset=this.cumulativeOffset(_5c2);
return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_5c2.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_5c2.offsetWidth);
},overlap:function(mode,_5c7){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset.y+_5c7.offsetHeight)-this.ycomp)/_5c7.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset.x+_5c7.offsetWidth)-this.xcomp)/_5c7.offsetWidth;
}
},absolutize:function(_5c8){
_5c8=MochiKit.DOM.getElement(_5c8);
if(_5c8.style.position=="absolute"){
return;
}
MochiKit.Position.prepare();
var _5c9=MochiKit.Position.positionedOffset(_5c8);
var _5ca=_5c8.clientWidth;
var _5cb=_5c8.clientHeight;
var _5cc={"position":_5c8.style.position,"left":_5c9.x-parseFloat(_5c8.style.left||0),"top":_5c9.y-parseFloat(_5c8.style.top||0),"width":_5c8.style.width,"height":_5c8.style.height};
_5c8.style.position="absolute";
_5c8.style.top=_5c9.y+"px";
_5c8.style.left=_5c9.x+"px";
_5c8.style.width=_5ca+"px";
_5c8.style.height=_5cb+"px";
return _5cc;
},positionedOffset:function(_5cd){
var _5ce=0,_5cf=0;
do{
_5ce+=_5cd.offsetTop||0;
_5cf+=_5cd.offsetLeft||0;
_5cd=_5cd.offsetParent;
if(_5cd){
p=MochiKit.Style.getStyle(_5cd,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_5cd);
return new MochiKit.Style.Coordinates(_5cf,_5ce);
},relativize:function(_5d0,_5d1){
_5d0=MochiKit.DOM.getElement(_5d0);
if(_5d0.style.position=="relative"){
return;
}
MochiKit.Position.prepare();
var top=parseFloat(_5d0.style.top||0)-(_5d1["top"]||0);
var left=parseFloat(_5d0.style.left||0)-(_5d1["left"]||0);
_5d0.style.position=_5d1["position"];
_5d0.style.top=top+"px";
_5d0.style.left=left+"px";
_5d0.style.width=_5d1["width"];
_5d0.style.height=_5d1["height"];
},clone:function(_5d4,_5d5){
_5d4=MochiKit.DOM.getElement(_5d4);
_5d5=MochiKit.DOM.getElement(_5d5);
_5d5.style.position="absolute";
var _5d6=this.cumulativeOffset(_5d4);
_5d5.style.top=_5d6.y+"px";
_5d5.style.left=_5d6.x+"px";
_5d5.style.width=_5d4.offsetWidth+"px";
_5d5.style.height=_5d4.offsetHeight+"px";
},page:function(_5d7){
var _5d8=0;
var _5d9=0;
var _5da=_5d7;
do{
_5d8+=_5da.offsetTop||0;
_5d9+=_5da.offsetLeft||0;
if(_5da.offsetParent==document.body&&MochiKit.Style.getStyle(_5da,"position")=="absolute"){
break;
}
}while(_5da=_5da.offsetParent);
_5da=_5d7;
do{
_5d8-=_5da.scrollTop||0;
_5d9-=_5da.scrollLeft||0;
}while(_5da=_5da.parentNode);
return new MochiKit.Style.Coordinates(_5d9,_5d8);
}});
MochiKit.Position.__new__=function(win){
var m=MochiKit.Base;
this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
m.nameFunctions(this);
};
MochiKit.Position.__new__(this);
MochiKit.Base._exportSymbols(this,MochiKit.Position);
MochiKit.Base._deps("Visual",["Base","DOM","Style","Color","Position"]);
MochiKit.Visual.NAME="MochiKit.Visual";
MochiKit.Visual.VERSION="1.4.1";
MochiKit.Visual.__repr__=function(){
return "["+this.NAME+" "+this.VERSION+"]";
};
MochiKit.Visual.toString=function(){
return this.__repr__();
};
MochiKit.Visual._RoundCorners=function(e,_5de){
e=MochiKit.DOM.getElement(e);
this._setOptions(_5de);
if(this.options.__unstable__wrapElement){
e=this._doWrap(e);
}
var _5df=this.options.color;
var C=MochiKit.Color.Color;
if(this.options.color==="fromElement"){
_5df=C.fromBackground(e);
}else{
if(!(_5df instanceof C)){
_5df=C.fromString(_5df);
}
}
this.isTransparent=(_5df.asRGB().a<=0);
var _5e1=this.options.bgColor;
if(this.options.bgColor==="fromParent"){
_5e1=C.fromBackground(e.offsetParent);
}else{
if(!(_5e1 instanceof C)){
_5e1=C.fromString(_5e1);
}
}
this._roundCornersImpl(e,_5df,_5e1);
};
MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
var _5e3=e.parentNode;
var doc=MochiKit.DOM.currentDocument();
if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
return e;
}
var _5e5=doc.defaultView.getComputedStyle(e,null);
if(typeof (_5e5)==="undefined"||_5e5===null){
return e;
}
var _5e6=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_5e5.getPropertyValue("padding-top"),marginRight:_5e5.getPropertyValue("padding-right"),marginBottom:_5e5.getPropertyValue("padding-bottom"),marginLeft:_5e5.getPropertyValue("padding-left"),padding:"0px"}});
_5e6.innerHTML=e.innerHTML;
e.innerHTML="";
e.appendChild(_5e6);
return e;
},_roundCornersImpl:function(e,_5e8,_5e9){
if(this.options.border){
this._renderBorder(e,_5e9);
}
if(this._isTopRounded()){
this._roundTopCorners(e,_5e8,_5e9);
}
if(this._isBottomRounded()){
this._roundBottomCorners(e,_5e8,_5e9);
}
},_renderBorder:function(el,_5eb){
var _5ec="1px solid "+this._borderColor(_5eb);
var _5ed="border-left: "+_5ec;
var _5ee="border-right: "+_5ec;
var _5ef="style='"+_5ed+";"+_5ee+"'";
el.innerHTML="<div "+_5ef+">"+el.innerHTML+"</div>";
},_roundTopCorners:function(el,_5f1,_5f2){
var _5f3=this._createCorner(_5f2);
for(var i=0;i<this.options.numSlices;i++){
_5f3.appendChild(this._createCornerSlice(_5f1,_5f2,i,"top"));
}
el.style.paddingTop=0;
el.insertBefore(_5f3,el.firstChild);
},_roundBottomCorners:function(el,_5f6,_5f7){
var _5f8=this._createCorner(_5f7);
for(var i=(this.options.numSlices-1);i>=0;i--){
_5f8.appendChild(this._createCornerSlice(_5f6,_5f7,i,"bottom"));
}
el.style.paddingBottom=0;
el.appendChild(_5f8);
},_createCorner:function(_5fa){
var dom=MochiKit.DOM;
return dom.DIV({style:{backgroundColor:_5fa.toString()}});
},_createCornerSlice:function(_5fc,_5fd,n,_5ff){
var _600=MochiKit.DOM.SPAN();
var _601=_600.style;
_601.backgroundColor=_5fc.toString();
_601.display="block";
_601.height="1px";
_601.overflow="hidden";
_601.fontSize="1px";
var _602=this._borderColor(_5fc,_5fd);
if(this.options.border&&n===0){
_601.borderTopStyle="solid";
_601.borderTopWidth="1px";
_601.borderLeftWidth="0px";
_601.borderRightWidth="0px";
_601.borderBottomWidth="0px";
_601.height="0px";
_601.borderColor=_602.toString();
}else{
if(_602){
_601.borderColor=_602.toString();
_601.borderStyle="solid";
_601.borderWidth="0px 1px";
}
}
if(!this.options.compact&&(n==(this.options.numSlices-1))){
_601.height="2px";
}
this._setMargin(_600,n,_5ff);
this._setBorder(_600,n,_5ff);
return _600;
},_setOptions:function(_603){
this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
MochiKit.Base.update(this.options,_603);
this.options.numSlices=(this.options.compact?2:4);
},_whichSideTop:function(){
var _604=this.options.corners;
if(this._hasString(_604,"all","top")){
return "";
}
var _605=(_604.indexOf("tl")!=-1);
var _606=(_604.indexOf("tr")!=-1);
if(_605&&_606){
return "";
}
if(_605){
return "left";
}
if(_606){
return "right";
}
return "";
},_whichSideBottom:function(){
var _607=this.options.corners;
if(this._hasString(_607,"all","bottom")){
return "";
}
var _608=(_607.indexOf("bl")!=-1);
var _609=(_607.indexOf("br")!=-1);
if(_608&&_609){
return "";
}
if(_608){
return "left";
}
if(_609){
return "right";
}
return "";
},_borderColor:function(_60a,_60b){
if(_60a=="transparent"){
return _60b;
}else{
if(this.options.border){
return this.options.border;
}else{
if(this.options.blend){
return _60b.blendedColor(_60a);
}
}
}
return "";
},_setMargin:function(el,n,_60e){
var _60f=this._marginSize(n)+"px";
var _610=(_60e=="top"?this._whichSideTop():this._whichSideBottom());
var _611=el.style;
if(_610=="left"){
_611.marginLeft=_60f;
_611.marginRight="0px";
}else{
if(_610=="right"){
_611.marginRight=_60f;
_611.marginLeft="0px";
}else{
_611.marginLeft=_60f;
_611.marginRight=_60f;
}
}
},_setBorder:function(el,n,_614){
var _615=this._borderSize(n)+"px";
var _616=(_614=="top"?this._whichSideTop():this._whichSideBottom());
var _617=el.style;
if(_616=="left"){
_617.borderLeftWidth=_615;
_617.borderRightWidth="0px";
}else{
if(_616=="right"){
_617.borderRightWidth=_615;
_617.borderLeftWidth="0px";
}else{
_617.borderLeftWidth=_615;
_617.borderRightWidth=_615;
}
}
},_marginSize:function(n){
if(this.isTransparent){
return 0;
}
var o=this.options;
if(o.compact&&o.blend){
var _61a=[1,0];
return _61a[n];
}else{
if(o.compact){
var _61b=[2,1];
return _61b[n];
}else{
if(o.blend){
var _61c=[3,2,1,0];
return _61c[n];
}else{
var _61d=[5,3,2,1];
return _61d[n];
}
}
}
},_borderSize:function(n){
var o=this.options;
var _620;
if(o.compact&&(o.blend||this.isTransparent)){
return 1;
}else{
if(o.compact){
_620=[1,0];
}else{
if(o.blend){
_620=[2,1,1,1];
}else{
if(o.border){
_620=[0,2,0,0];
}else{
if(this.isTransparent){
_620=[5,3,2,1];
}else{
return 0;
}
}
}
}
}
return _620[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,_625){
new MochiKit.Visual._RoundCorners(e,_625);
};
MochiKit.Visual.roundClass=function(_626,_627,_628){
var _629=MochiKit.DOM.getElementsByTagAndClassName(_626,_627);
for(var i=0;i<_629.length;i++){
MochiKit.Visual.roundElement(_629[i],_628);
}
};
MochiKit.Visual.tagifyText=function(_62b,_62c){
_62c=_62c||"position:relative";
if(/MSIE/.test(navigator.userAgent)){
_62c+=";zoom:1";
}
_62b=MochiKit.DOM.getElement(_62b);
var ma=MochiKit.Base.map;
ma(function(_62e){
if(_62e.nodeType==3){
ma(function(_62f){
_62b.insertBefore(MochiKit.DOM.SPAN({style:_62c},_62f==" "?String.fromCharCode(160):_62f),_62e);
},_62e.nodeValue.split(""));
MochiKit.DOM.removeElement(_62e);
}
},_62b.childNodes);
};
MochiKit.Visual.forceRerendering=function(_630){
try{
_630=MochiKit.DOM.getElement(_630);
var n=document.createTextNode(" ");
_630.appendChild(n);
_630.removeChild(n);
}
catch(e){
}
};
MochiKit.Visual.multiple=function(_632,_633,_634){
_634=MochiKit.Base.update({speed:0.1,delay:0},_634);
var _635=_634.delay;
var _636=0;
MochiKit.Base.map(function(_637){
_634.delay=_636*_634.speed+_635;
new _633(_637,_634);
_636+=1;
},_632);
};
MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
MochiKit.Visual.toggle=function(_638,_639,_63a){
_638=MochiKit.DOM.getElement(_638);
_639=(_639||"appear").toLowerCase();
_63a=MochiKit.Base.update({queue:{position:"end",scope:(_638.id||"global"),limit:1}},_63a);
var v=MochiKit.Visual;
v[MochiKit.Style.getStyle(_638,"display")!="none"?v.PAIRS[_639][1]:v.PAIRS[_639][0]](_638,_63a);
};
MochiKit.Visual.Transitions={};
MochiKit.Visual.Transitions.linear=function(pos){
return pos;
};
MochiKit.Visual.Transitions.sinoidal=function(pos){
return 0.5-Math.cos(pos*Math.PI)/2;
};
MochiKit.Visual.Transitions.reverse=function(pos){
return 1-pos;
};
MochiKit.Visual.Transitions.flicker=function(pos){
return 0.25-Math.cos(pos*Math.PI)/4+Math.random()/2;
};
MochiKit.Visual.Transitions.wobble=function(pos){
return 0.5-Math.cos(9*pos*Math.PI)/2;
};
MochiKit.Visual.Transitions.pulse=function(pos,_642){
if(_642){
pos*=2*_642;
}else{
pos*=10;
}
var _643=pos-Math.floor(pos);
return (Math.floor(pos)%2==0)?_643:1-_643;
};
MochiKit.Visual.Transitions.parabolic=function(pos){
return pos*pos;
};
MochiKit.Visual.Transitions.none=function(pos){
return 0;
};
MochiKit.Visual.Transitions.full=function(pos){
return 1;
};
MochiKit.Visual.ScopedQueue=function(){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls();
}
this.__init__();
};
MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
this.effects=[];
this.interval=null;
},add:function(_648){
var _649=new Date().getTime();
var _64a=(typeof (_648.options.queue)=="string")?_648.options.queue:_648.options.queue.position;
var ma=MochiKit.Base.map;
switch(_64a){
case "front":
ma(function(e){
if(e.state=="idle"){
e.startOn+=_648.finishOn;
e.finishOn+=_648.finishOn;
}
},this.effects);
break;
case "end":
var _64d;
ma(function(e){
var i=e.finishOn;
if(i>=(_64d||i)){
_64d=i;
}
},this.effects);
_649=_64d||_649;
break;
case "break":
ma(function(e){
e.finalize();
},this.effects);
break;
}
_648.startOn+=_649;
_648.finishOn+=_649;
if(!_648.options.queue.limit||this.effects.length<_648.options.queue.limit){
this.effects.push(_648);
}
if(!this.interval){
this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
}
},startLoop:function(func,_652){
return setInterval(func,_652);
},remove:function(_653){
this.effects=MochiKit.Base.filter(function(e){
return e!=_653;
},this.effects);
if(!this.effects.length){
this.stopLoop(this.interval);
this.interval=null;
}
},stopLoop:function(_655){
clearInterval(_655);
},loop:function(){
var _656=new Date().getTime();
MochiKit.Base.map(function(_657){
_657.loop(_656);
},this.effects);
}});
MochiKit.Visual.Queues={instances:{},get:function(_658){
if(typeof (_658)!="string"){
return _658;
}
if(!this.instances[_658]){
this.instances[_658]=new MochiKit.Visual.ScopedQueue();
}
return this.instances[_658];
}};
MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global");
MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
MochiKit.Visual.Base=function(){
};
MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_659){
var v=MochiKit.Visual;
this.options=MochiKit.Base.setdefault(_659,v.DefaultOptions);
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_65b){
if(_65b>=this.startOn){
if(_65b>=this.finishOn){
return this.finalize();
}
var pos=(_65b-this.startOn)/(this.finishOn-this.startOn);
var _65d=Math.round(pos*this.options.fps*this.options.duration);
if(_65d>this.currentFrame){
this.render(pos);
this.currentFrame=_65d;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
this.setup();
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.event("beforeUpdate");
this.update(pos);
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},finalize:function(){
this.render(1);
this.cancel();
this.event("beforeFinish");
this.finish();
this.event("afterFinish");
},setup:function(){
},finish:function(){
},update:function(_65f){
},event:function(_660){
if(this.options[_660+"Internal"]){
this.options[_660+"Internal"](this);
}
if(this.options[_660]){
this.options[_660](this);
}
},repr:function(){
return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
}};
MochiKit.Visual.Parallel=function(_661,_662){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_661,_662);
}
this.__init__(_661,_662);
};
MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_664,_665){
this.effects=_664||[];
this.start(_665);
},update:function(_666){
MochiKit.Base.map(function(_667){
_667.render(_666);
},this.effects);
},finish:function(){
MochiKit.Base.map(function(_668){
_668.finalize();
},this.effects);
}});
MochiKit.Visual.Sequence=function(_669,_66a){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_669,_66a);
}
this.__init__(_669,_66a);
};
MochiKit.Visual.Sequence.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Sequence.prototype,{__class__:MochiKit.Visual.Sequence,__init__:function(_66c,_66d){
var defs={transition:MochiKit.Visual.Transitions.linear,duration:0};
this.effects=_66c||[];
MochiKit.Base.map(function(_66f){
defs.duration+=_66f.options.duration;
},this.effects);
MochiKit.Base.setdefault(_66d,defs);
this.start(_66d);
},update:function(_670){
var time=_670*this.options.duration;
for(var i=0;i<this.effects.length;i++){
var _673=this.effects[i];
if(time<=_673.options.duration){
_673.render(time/_673.options.duration);
break;
}else{
time-=_673.options.duration;
}
}
},finish:function(){
MochiKit.Base.map(function(_674){
_674.finalize();
},this.effects);
}});
MochiKit.Visual.Opacity=function(_675,_676){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_675,_676);
}
this.__init__(_675,_676);
};
MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_678,_679){
var b=MochiKit.Base;
var s=MochiKit.Style;
this.element=MochiKit.DOM.getElement(_678);
if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
s.setStyle(this.element,{zoom:1});
}
_679=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_679);
this.start(_679);
},update:function(_67c){
MochiKit.Style.setStyle(this.element,{"opacity":_67c});
}});
MochiKit.Visual.Move=function(_67d,_67e){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_67d,_67e);
}
this.__init__(_67d,_67e);
};
MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_680,_681){
this.element=MochiKit.DOM.getElement(_680);
_681=MochiKit.Base.update({x:0,y:0,mode:"relative"},_681);
this.start(_681);
},setup:function(){
MochiKit.Style.makePositioned(this.element);
var s=this.element.style;
var _683=s.visibility;
var _684=s.display;
if(_684=="none"){
s.visibility="hidden";
s.display="";
}
this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0");
this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0");
if(this.options.mode=="absolute"){
this.options.x-=this.originalLeft;
this.options.y-=this.originalTop;
}
if(_684=="none"){
s.visibility=_683;
s.display=_684;
}
},update:function(_685){
MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_685+this.originalLeft)+"px",top:Math.round(this.options.y*_685+this.originalTop)+"px"});
}});
MochiKit.Visual.Scale=function(_686,_687,_688){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_686,_687,_688);
}
this.__init__(_686,_687,_688);
};
MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_68a,_68b,_68c){
this.element=MochiKit.DOM.getElement(_68a);
_68c=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_68b},_68c);
this.start(_68c);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=MochiKit.Style.getStyle(this.element,"position");
var ma=MochiKit.Base.map;
var b=MochiKit.Base.bind;
this.originalStyle={};
ma(b(function(k){
this.originalStyle[k]=this.element.style[k];
},this),["top","left","width","height","fontSize"]);
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _690=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
ma(b(function(_691){
if(_690.indexOf(_691)>0){
this.fontSize=parseFloat(_690);
this.fontSizeType=_691;
}
},this),["em","px","%"]);
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
if(/^content/.test(this.options.scaleMode)){
this.dims=[this.element.scrollHeight,this.element.scrollWidth];
}else{
if(this.options.scaleMode=="box"){
this.dims=[this.element.offsetHeight,this.element.offsetWidth];
}else{
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
}
}
},update:function(_692){
var _693=(this.options.scaleFrom/100)+(this.factor*_692);
if(this.options.scaleContent&&this.fontSize){
MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_693+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_693,this.dims[1]*_693);
},finish:function(){
if(this.restoreAfterFinish){
MochiKit.Style.setStyle(this.element,this.originalStyle);
}
},setDimensions:function(_694,_695){
var d={};
var r=Math.round;
if(/MSIE/.test(navigator.userAgent)){
r=Math.ceil;
}
if(this.options.scaleX){
d.width=r(_695)+"px";
}
if(this.options.scaleY){
d.height=r(_694)+"px";
}
if(this.options.scaleFromCenter){
var topd=(_694-this.dims[0])/2;
var _699=(_695-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-topd+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_699+"px";
}
}else{
if(this.options.scaleY){
d.top=-topd+"px";
}
if(this.options.scaleX){
d.left=-_699+"px";
}
}
}
MochiKit.Style.setStyle(this.element,d);
}});
MochiKit.Visual.Highlight=function(_69a,_69b){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_69a,_69b);
}
this.__init__(_69a,_69b);
};
MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_69d,_69e){
this.element=MochiKit.DOM.getElement(_69d);
_69e=MochiKit.Base.update({startcolor:"#ffff99"},_69e);
this.start(_69e);
},setup:function(){
var b=MochiKit.Base;
var s=MochiKit.Style;
if(s.getStyle(this.element,"display")=="none"){
this.cancel();
return;
}
this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")};
s.setStyle(this.element,{backgroundImage:"none"});
if(!this.options.endcolor){
this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
}
if(b.isUndefinedOrNull(this.options.restorecolor)){
this.options.restorecolor=s.getStyle(this.element,"background-color");
}
this._base=b.map(b.bind(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
},this),[0,1,2]);
this._delta=b.map(b.bind(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
},this),[0,1,2]);
},update:function(_6a3){
var m="#";
MochiKit.Base.map(MochiKit.Base.bind(function(i){
m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_6a3));
},this),[0,1,2]);
MochiKit.Style.setStyle(this.element,{backgroundColor:m});
},finish:function(){
MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
MochiKit.Visual.ScrollTo=function(_6a6,_6a7){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_6a6,_6a7);
}
this.__init__(_6a6,_6a7);
};
MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_6a9,_6aa){
this.element=MochiKit.DOM.getElement(_6a9);
this.start(_6aa);
},setup:function(){
var p=MochiKit.Position;
p.prepare();
var _6ac=p.cumulativeOffset(this.element);
if(this.options.offset){
_6ac.y+=this.options.offset;
}
var max;
if(window.innerHeight){
max=window.innerHeight-window.height;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
max=document.documentElement.clientHeight-document.body.scrollHeight;
}else{
if(document.body){
max=document.body.clientHeight-document.body.scrollHeight;
}
}
}
this.scrollStart=p.windowOffset.y;
this.delta=(_6ac.y>max?max:_6ac.y)-this.scrollStart;
},update:function(_6ae){
var p=MochiKit.Position;
p.prepare();
window.scrollTo(p.windowOffset.x,this.scrollStart+(_6ae*this.delta));
}});
MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
MochiKit.Visual.Morph=function(_6b0,_6b1){
var cls=arguments.callee;
if(!(this instanceof cls)){
return new cls(_6b0,_6b1);
}
this.__init__(_6b0,_6b1);
};
MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_6b3,_6b4){
this.element=MochiKit.DOM.getElement(_6b3);
this.start(_6b4);
},setup:function(){
var b=MochiKit.Base;
var _6b6=this.options.style;
this.styleStart={};
this.styleEnd={};
this.units={};
var _6b7,unit;
for(var s in _6b6){
_6b7=_6b6[s];
s=b.camelize(s);
if(MochiKit.Visual.CSS_LENGTH.test(_6b7)){
var _6ba=_6b7.match(/^([\+\-]?[0-9\.]+)(.*)$/);
_6b7=parseFloat(_6ba[1]);
unit=(_6ba.length==3)?_6ba[2]:null;
this.styleEnd[s]=_6b7;
this.units[s]=unit;
_6b7=MochiKit.Style.getStyle(this.element,s);
_6ba=_6b7.match(/^([\+\-]?[0-9\.]+)(.*)$/);
_6b7=parseFloat(_6ba[1]);
this.styleStart[s]=_6b7;
}else{
if(/[Cc]olor$/.test(s)){
var c=MochiKit.Color.Color;
_6b7=c.fromString(_6b7);
if(_6b7){
this.units[s]="color";
this.styleEnd[s]=_6b7.toHexString();
_6b7=MochiKit.Style.getStyle(this.element,s);
this.styleStart[s]=c.fromString(_6b7).toHexString();
this.styleStart[s]=b.map(b.bind(function(i){
return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16);
},this),[0,1,2]);
this.styleEnd[s]=b.map(b.bind(function(i){
return parseInt(this.styleEnd[s].slice(i*2+1,i*2+3),16);
},this),[0,1,2]);
}
}else{
this.element.style[s]=_6b7;
}
}
}
},update:function(_6be){
var _6bf;
for(var s in this.styleStart){
if(this.units[s]=="color"){
var m="#";
var _6c2=this.styleStart[s];
var end=this.styleEnd[s];
MochiKit.Base.map(MochiKit.Base.bind(function(i){
m+=MochiKit.Color.toColorPart(Math.round(_6c2[i]+(end[i]-_6c2[i])*_6be));
},this),[0,1,2]);
this.element.style[s]=m;
}else{
_6bf=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_6be*1000)/1000+this.units[s];
this.element.style[s]=_6bf;
}
}
}});
MochiKit.Visual.fade=function(_6c5,_6c6){
var s=MochiKit.Style;
var _6c8=s.getStyle(_6c5,"opacity");
_6c6=MochiKit.Base.update({from:s.getStyle(_6c5,"opacity")||1,to:0,afterFinishInternal:function(_6c9){
if(_6c9.options.to!==0){
return;
}
s.hideElement(_6c9.element);
s.setStyle(_6c9.element,{"opacity":_6c8});
}},_6c6);
return new MochiKit.Visual.Opacity(_6c5,_6c6);
};
MochiKit.Visual.appear=function(_6ca,_6cb){
var s=MochiKit.Style;
var v=MochiKit.Visual;
_6cb=MochiKit.Base.update({from:(s.getStyle(_6ca,"display")=="none"?0:s.getStyle(_6ca,"opacity")||0),to:1,afterFinishInternal:function(_6ce){
v.forceRerendering(_6ce.element);
},beforeSetupInternal:function(_6cf){
s.setStyle(_6cf.element,{"opacity":_6cf.options.from});
s.showElement(_6cf.element);
}},_6cb);
return new v.Opacity(_6ca,_6cb);
};
MochiKit.Visual.puff=function(_6d0,_6d1){
var s=MochiKit.Style;
var v=MochiKit.Visual;
_6d0=MochiKit.DOM.getElement(_6d0);
var _6d4=MochiKit.Style.getElementDimensions(_6d0,true);
var _6d5={position:s.getStyle(_6d0,"position"),top:_6d0.style.top,left:_6d0.style.left,width:_6d0.style.width,height:_6d0.style.height,opacity:s.getStyle(_6d0,"opacity")};
_6d1=MochiKit.Base.update({beforeSetupInternal:function(_6d6){
MochiKit.Position.absolutize(_6d6.effects[0].element);
},afterFinishInternal:function(_6d7){
s.hideElement(_6d7.effects[0].element);
s.setStyle(_6d7.effects[0].element,_6d5);
},scaleContent:true,scaleFromCenter:true},_6d1);
return new v.Parallel([new v.Scale(_6d0,200,{sync:true,scaleFromCenter:_6d1.scaleFromCenter,scaleMode:{originalHeight:_6d4.h,originalWidth:_6d4.w},scaleContent:_6d1.scaleContent,restoreAfterFinish:true}),new v.Opacity(_6d0,{sync:true,to:0})],_6d1);
};
MochiKit.Visual.blindUp=function(_6d8,_6d9){
var d=MochiKit.DOM;
var s=MochiKit.Style;
_6d8=d.getElement(_6d8);
var _6dc=s.getElementDimensions(_6d8,true);
var _6dd=s.makeClipping(_6d8);
_6d9=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_6dc.h,originalWidth:_6dc.w},restoreAfterFinish:true,afterFinishInternal:function(_6de){
s.hideElement(_6de.element);
s.undoClipping(_6de.element,_6dd);
}},_6d9);
return new MochiKit.Visual.Scale(_6d8,0,_6d9);
};
MochiKit.Visual.blindDown=function(_6df,_6e0){
var d=MochiKit.DOM;
var s=MochiKit.Style;
_6df=d.getElement(_6df);
var _6e3=s.getElementDimensions(_6df,true);
var _6e4;
_6e0=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6e3.h,originalWidth:_6e3.w},restoreAfterFinish:true,afterSetupInternal:function(_6e5){
_6e4=s.makeClipping(_6e5.element);
s.setStyle(_6e5.element,{height:"0px"});
s.showElement(_6e5.element);
},afterFinishInternal:function(_6e6){
s.undoClipping(_6e6.element,_6e4);
}},_6e0);
return new MochiKit.Visual.Scale(_6df,100,_6e0);
};
MochiKit.Visual.switchOff=function(_6e7,_6e8){
var d=MochiKit.DOM;
var s=MochiKit.Style;
_6e7=d.getElement(_6e7);
var _6eb=s.getElementDimensions(_6e7,true);
var _6ec=s.getStyle(_6e7,"opacity");
var _6ed;
_6e8=MochiKit.Base.update({duration:0.7,restoreAfterFinish:true,beforeSetupInternal:function(_6ee){
s.makePositioned(_6e7);
_6ed=s.makeClipping(_6e7);
},afterFinishInternal:function(_6ef){
s.hideElement(_6e7);
s.undoClipping(_6e7,_6ed);
s.undoPositioned(_6e7);
s.setStyle(_6e7,{"opacity":_6ec});
}},_6e8);
var v=MochiKit.Visual;
return new v.Sequence([new v.appear(_6e7,{sync:true,duration:0.57*_6e8.duration,from:0,transition:v.Transitions.flicker}),new v.Scale(_6e7,1,{sync:true,duration:0.43*_6e8.duration,scaleFromCenter:true,scaleX:false,scaleMode:{originalHeight:_6eb.h,originalWidth:_6eb.w},scaleContent:false,restoreAfterFinish:true})],_6e8);
};
MochiKit.Visual.dropOut=function(_6f1,_6f2){
var d=MochiKit.DOM;
var s=MochiKit.Style;
_6f1=d.getElement(_6f1);
var _6f5={top:s.getStyle(_6f1,"top"),left:s.getStyle(_6f1,"left"),opacity:s.getStyle(_6f1,"opacity")};
_6f2=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6f6){
s.makePositioned(_6f6.effects[0].element);
},afterFinishInternal:function(_6f7){
s.hideElement(_6f7.effects[0].element);
s.undoPositioned(_6f7.effects[0].element);
s.setStyle(_6f7.effects[0].element,_6f5);
}},_6f2);
var v=MochiKit.Visual;
return new v.Parallel([new v.Move(_6f1,{x:0,y:_6f2.distance,sync:true}),new v.Opacity(_6f1,{sync:true,to:0})],_6f2);
};
MochiKit.Visual.shake=function(_6f9,_6fa){
var d=MochiKit.DOM;
var v=MochiKit.Visual;
var s=MochiKit.Style;
_6f9=d.getElement(_6f9);
var _6fe={top:s.getStyle(_6f9,"top"),left:s.getStyle(_6f9,"left")};
_6fa=MochiKit.Base.update({duration:0.5,afterFinishInternal:function(_6ff){
s.undoPositioned(_6f9);
s.setStyle(_6f9,_6fe);
}},_6fa);
return new v.Sequence([new v.Move(_6f9,{sync:true,duration:0.1*_6fa.duration,x:20,y:0}),new v.Move(_6f9,{sync:true,duration:0.2*_6fa.duration,x:-40,y:0}),new v.Move(_6f9,{sync:true,duration:0.2*_6fa.duration,x:40,y:0}),new v.Move(_6f9,{sync:true,duration:0.2*_6fa.duration,x:-40,y:0}),new v.Move(_6f9,{sync:true,duration:0.2*_6fa.duration,x:40,y:0}),new v.Move(_6f9,{sync:true,duration:0.1*_6fa.duration,x:-20,y:0})],_6fa);
};
MochiKit.Visual.slideDown=function(_700,_701){
var d=MochiKit.DOM;
var b=MochiKit.Base;
var s=MochiKit.Style;
_700=d.getElement(_700);
if(!_700.firstChild){
throw new Error("MochiKit.Visual.slideDown must be used on a element with a child");
}
d.removeEmptyTextNodes(_700);
var _705=s.getStyle(_700.firstChild,"bottom")||0;
var _706=s.getElementDimensions(_700,true);
var _707;
_701=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_706.h,originalWidth:_706.w},restoreAfterFinish:true,afterSetupInternal:function(_708){
s.makePositioned(_708.element);
s.makePositioned(_708.element.firstChild);
if(/Opera/.test(navigator.userAgent)){
s.setStyle(_708.element,{top:""});
}
_707=s.makeClipping(_708.element);
s.setStyle(_708.element,{height:"0px"});
s.showElement(_708.element);
},afterUpdateInternal:function(_709){
var _70a=s.getElementDimensions(_709.element,true);
s.setStyle(_709.element.firstChild,{bottom:(_709.dims[0]-_70a.h)+"px"});
},afterFinishInternal:function(_70b){
s.undoClipping(_70b.element,_707);
if(/MSIE/.test(navigator.userAgent)){
s.undoPositioned(_70b.element);
s.undoPositioned(_70b.element.firstChild);
}else{
s.undoPositioned(_70b.element.firstChild);
s.undoPositioned(_70b.element);
}
s.setStyle(_70b.element.firstChild,{bottom:_705});
}},_701);
return new MochiKit.Visual.Scale(_700,100,_701);
};
MochiKit.Visual.slideUp=function(_70c,_70d){
var d=MochiKit.DOM;
var b=MochiKit.Base;
var s=MochiKit.Style;
_70c=d.getElement(_70c);
if(!_70c.firstChild){
throw new Error("MochiKit.Visual.slideUp must be used on a element with a child");
}
d.removeEmptyTextNodes(_70c);
var _711=s.getStyle(_70c.firstChild,"bottom");
var _712=s.getElementDimensions(_70c,true);
var _713;
_70d=b.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_712.h,originalWidth:_712.w},scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_714){
s.makePositioned(_714.element);
s.makePositioned(_714.element.firstChild);
if(/Opera/.test(navigator.userAgent)){
s.setStyle(_714.element,{top:""});
}
_713=s.makeClipping(_714.element);
s.showElement(_714.element);
},afterUpdateInternal:function(_715){
var _716=s.getElementDimensions(_715.element,true);
s.setStyle(_715.element.firstChild,{bottom:(_715.dims[0]-_716.h)+"px"});
},afterFinishInternal:function(_717){
s.hideElement(_717.element);
s.undoClipping(_717.element,_713);
s.undoPositioned(_717.element.firstChild);
s.undoPositioned(_717.element);
s.setStyle(_717.element.firstChild,{bottom:_711});
}},_70d);
return new MochiKit.Visual.Scale(_70c,0,_70d);
};
MochiKit.Visual.squish=function(_718,_719){
var d=MochiKit.DOM;
var b=MochiKit.Base;
var s=MochiKit.Style;
var _71d=s.getElementDimensions(_718,true);
var _71e;
_719=b.update({restoreAfterFinish:true,scaleMode:{originalHeight:_71d.w,originalWidth:_71d.h},beforeSetupInternal:function(_71f){
_71e=s.makeClipping(_71f.element);
},afterFinishInternal:function(_720){
s.hideElement(_720.element);
s.undoClipping(_720.element,_71e);
}},_719);
return new MochiKit.Visual.Scale(_718,/Opera/.test(navigator.userAgent)?1:0,_719);
};
MochiKit.Visual.grow=function(_721,_722){
var d=MochiKit.DOM;
var v=MochiKit.Visual;
var s=MochiKit.Style;
_721=d.getElement(_721);
_722=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_722);
var _726={top:_721.style.top,left:_721.style.left,height:_721.style.height,width:_721.style.width,opacity:s.getStyle(_721,"opacity")};
var dims=s.getElementDimensions(_721,true);
var _728,_729;
var _72a,_72b;
switch(_722.direction){
case "top-left":
_728=_729=_72a=_72b=0;
break;
case "top-right":
_728=dims.w;
_729=_72b=0;
_72a=-dims.w;
break;
case "bottom-left":
_728=_72a=0;
_729=dims.h;
_72b=-dims.h;
break;
case "bottom-right":
_728=dims.w;
_729=dims.h;
_72a=-dims.w;
_72b=-dims.h;
break;
case "center":
_728=dims.w/2;
_729=dims.h/2;
_72a=-dims.w/2;
_72b=-dims.h/2;
break;
}
var _72c=MochiKit.Base.update({beforeSetupInternal:function(_72d){
s.setStyle(_72d.effects[0].element,{height:"0px"});
s.showElement(_72d.effects[0].element);
},afterFinishInternal:function(_72e){
s.undoClipping(_72e.effects[0].element);
s.undoPositioned(_72e.effects[0].element);
s.setStyle(_72e.effects[0].element,_726);
}},_722);
return new v.Move(_721,{x:_728,y:_729,duration:0.01,beforeSetupInternal:function(_72f){
s.hideElement(_72f.element);
s.makeClipping(_72f.element);
s.makePositioned(_72f.element);
},afterFinishInternal:function(_730){
new v.Parallel([new v.Opacity(_730.element,{sync:true,to:1,from:0,transition:_722.opacityTransition}),new v.Move(_730.element,{x:_72a,y:_72b,sync:true,transition:_722.moveTransition}),new v.Scale(_730.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_722.scaleTransition,scaleContent:_722.scaleContent,scaleFromCenter:_722.scaleFromCenter,restoreAfterFinish:true})],_72c);
}});
};
MochiKit.Visual.shrink=function(_731,_732){
var d=MochiKit.DOM;
var v=MochiKit.Visual;
var s=MochiKit.Style;
_731=d.getElement(_731);
_732=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_732);
var _736={top:_731.style.top,left:_731.style.left,height:_731.style.height,width:_731.style.width,opacity:s.getStyle(_731,"opacity")};
var dims=s.getElementDimensions(_731,true);
var _738,_739;
switch(_732.direction){
case "top-left":
_738=_739=0;
break;
case "top-right":
_738=dims.w;
_739=0;
break;
case "bottom-left":
_738=0;
_739=dims.h;
break;
case "bottom-right":
_738=dims.w;
_739=dims.h;
break;
case "center":
_738=dims.w/2;
_739=dims.h/2;
break;
}
var _73a;
var _73b=MochiKit.Base.update({beforeStartInternal:function(_73c){
s.makePositioned(_73c.effects[0].element);
_73a=s.makeClipping(_73c.effects[0].element);
},afterFinishInternal:function(_73d){
s.hideElement(_73d.effects[0].element);
s.undoClipping(_73d.effects[0].element,_73a);
s.undoPositioned(_73d.effects[0].element);
s.setStyle(_73d.effects[0].element,_736);
}},_732);
return new v.Parallel([new v.Opacity(_731,{sync:true,to:0,from:1,transition:_732.opacityTransition}),new v.Scale(_731,/Opera/.test(navigator.userAgent)?1:0,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,transition:_732.scaleTransition,scaleContent:_732.scaleContent,scaleFromCenter:_732.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_731,{x:_738,y:_739,sync:true,transition:_732.moveTransition})],_73b);
};
MochiKit.Visual.pulsate=function(_73e,_73f){
var d=MochiKit.DOM;
var v=MochiKit.Visual;
var b=MochiKit.Base;
var _743=MochiKit.Style.getStyle(_73e,"opacity");
_73f=b.update({duration:3,from:0,afterFinishInternal:function(_744){
MochiKit.Style.setStyle(_744.element,{"opacity":_743});
}},_73f);
var _745=_73f.transition||v.Transitions.sinoidal;
_73f.transition=function(pos){
return _745(1-v.Transitions.pulse(pos,_73f.pulses));
};
return new v.Opacity(_73e,_73f);
};
MochiKit.Visual.fold=function(_747,_748){
var d=MochiKit.DOM;
var v=MochiKit.Visual;
var s=MochiKit.Style;
_747=d.getElement(_747);
var _74c=s.getElementDimensions(_747,true);
var _74d={top:_747.style.top,left:_747.style.left,width:_747.style.width,height:_747.style.height};
var _74e=s.makeClipping(_747);
_748=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleMode:{originalHeight:_74c.h,originalWidth:_74c.w},afterFinishInternal:function(_74f){
new v.Scale(_747,1,{scaleContent:false,scaleY:false,scaleMode:{originalHeight:_74c.h,originalWidth:_74c.w},afterFinishInternal:function(_750){
s.hideElement(_750.element);
s.undoClipping(_750.element,_74e);
s.setStyle(_750.element,_74d);
}});
}},_748);
return new v.Scale(_747,5,_748);
};
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","tagifyText","multiple","toggle","Parallel","Sequence","Opacity","Move","Scale","Highlight","ScrollTo","Morph","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"];
MochiKit.Visual.EXPORT_OK=["Base","PAIRS"];
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.4.1";
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","Selector","Style","LoggingPane","Color","Signal","Position","Visual"];
if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.MochiKit");
(function(lst){
for(var i=0;i<lst.length;i++){
dojo.require("MochiKit."+lst[i]);
}
})(MochiKit.MochiKit.SUBMODULES);
}
if(typeof (JSAN)!="undefined"){
(function(lst){
for(var i=0;i<lst.length;i++){
JSAN.use("MochiKit."+lst[i],[]);
}
})(MochiKit.MochiKit.SUBMODULES);
}
(function(){
var _756=MochiKit.Base.extend;
var self=MochiKit.MochiKit;
var _758=self.SUBMODULES;
var _759=[];
var _75a=[];
var _75b={};
var i,k,m,all;
for(i=0;i<_758.length;i++){
m=MochiKit[_758[i]];
_756(_759,m.EXPORT);
_756(_75a,m.EXPORT_OK);
for(k in m.EXPORT_TAGS){
_75b[k]=_756(_75b[k],m.EXPORT_TAGS[k]);
}
all=m.EXPORT_TAGS[":all"];
if(!all){
all=_756(null,m.EXPORT,m.EXPORT_OK);
}
var j;
for(j=0;j<all.length;j++){
k=all[j];
self[k]=m[k];
}
}
self.EXPORT=_759;
self.EXPORT_OK=_75a;
self.EXPORT_TAGS=_75b;
}());
}else{
if(typeof (MochiKit.__compat__)=="undefined"){
MochiKit.__compat__=true;
}
(function(){
if(typeof (document)=="undefined"){
return;
}
var _761=document.getElementsByTagName("script");
var _762="http://www.w3.org/1999/xhtml";
var _763="http://www.w3.org/2000/svg";
var _764="http://www.w3.org/1999/xlink";
var _765="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var base=null;
var _767=null;
var _768={};
var i;
var src;
for(i=0;i<_761.length;i++){
src=null;
switch(_761[i].namespaceURI){
case _763:
src=_761[i].getAttributeNS(_764,"href");
break;
default:
src=_761[i].getAttribute("src");
break;
}
if(!src){
continue;
}
_768[src]=true;
if(src.match(/MochiKit.js(\?.*)?$/)){
base=src.substring(0,src.lastIndexOf("MochiKit.js"));
_767=_761[i];
}
}
if(base===null){
return;
}
var _76b=MochiKit.MochiKit.SUBMODULES;
for(var i=0;i<_76b.length;i++){
if(MochiKit[_76b[i]]){
continue;
}
var uri=base+_76b[i]+".js";
if(uri in _768){
continue;
}
if(_767.namespaceURI==_763||_767.namespaceURI==_765){
var s=document.createElementNS(_767.namespaceURI,"script");
s.setAttribute("id","MochiKit_"+base+_76b[i]);
if(_767.namespaceURI==_763){
s.setAttributeNS(_764,"href",uri);
}else{
s.setAttribute("src",uri);
}
s.setAttribute("type","application/x-javascript");
_767.parentNode.appendChild(s);
}else{
document.write("<"+_767.nodeName+" src=\""+uri+"\" type=\"text/javascript\"></script>");
}
}
})();
}


