--- /dev/null
+/***
+
+ MochiKit.MochiKit 1.4 : 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";
+MochiKit.Base.NAME="MochiKit.Base";
+MochiKit.Base.update=function(_1,_2){
+if(_1===null){
+_1={};
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!="undefined"&&o!==null){
+for(var k in o){
+_1[k]=o[k];
+}
+}
+}
+return _1;
+};
+MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+},toString:function(){
+return this.__repr__();
+},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();
+}
+},_flattenArray:function(_d,_e){
+for(var i=0;i<_e.length;i++){
+var o=_e[i];
+if(o instanceof Array){
+arguments.callee(_d,o);
+}else{
+_d.push(o);
+}
+}
+return _d;
+},flattenArray:function(lst){
+return MochiKit.Base._flattenArray([],lst);
+},flattenArguments:function(lst){
+var res=[];
+var m=MochiKit.Base;
+var _15=m.extend(null,arguments);
+while(_15.length){
+var o=_15.shift();
+if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
+for(var i=o.length-1;i>=0;i--){
+_15.unshift(o[i]);
+}
+}else{
+res.push(o);
+}
+}
+return res;
+},extend:function(_18,obj,_1a){
+if(!_1a){
+_1a=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(!_18){
+_18=[];
+}
+for(var i=_1a;i<l;i++){
+_18.push(obj[i]);
+}
+}
+return _18;
+},updatetree:function(_1d,obj){
+if(_1d===null){
+_1d={};
+}
+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 (_1d[k])=="object"&&typeof (v)=="object"){
+arguments.callee(_1d[k],v);
+}else{
+_1d[k]=v;
+}
+}
+}
+}
+return _1d;
+},setdefault:function(_23,obj){
+if(_23===null){
+_23={};
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+for(var k in o){
+if(!(k in _23)){
+_23[k]=o[k];
+}
+}
+}
+return _23;
+},keys:function(obj){
+var _29=[];
+for(var _2a in obj){
+_29.push(_2a);
+}
+return _29;
+},values:function(obj){
+var _2c=[];
+for(var _2d in obj){
+_2c.push(obj[_2d]);
+}
+return _2c;
+},items:function(obj){
+var _2f=[];
+var e;
+for(var _31 in obj){
+var v;
+try{
+v=obj[_31];
+}
+catch(e){
+continue;
+}
+_2f.push([_31,v]);
+}
+return _2f;
+},_newNamedError:function(_33,_34,_35){
+_35.prototype=new MochiKit.Base.NamedError(_33.NAME+"."+_34);
+_33[_34]=_35;
+},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(_73){
+return function(){
+return this[_73].apply(this,arguments);
+};
+},itemgetter:function(_74){
+return function(arg){
+return arg[_74];
+};
+},typeMatcher:function(){
+var _76={};
+for(var i=0;i<arguments.length;i++){
+var typ=arguments[i];
+_76[typ]=typ;
+}
+return function(){
+for(var i=0;i<arguments.length;i++){
+if(!(typeof (arguments[i]) in _76)){
+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){
+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 _87=[];
+for(var i=1;i<arguments.length;i++){
+_87.push(fn(arguments[i]));
+}
+return _87;
+},map:function(fn,lst){
+var m=MochiKit.Base;
+var itr=MochiKit.Iter;
+var _8d=m.isArrayLike;
+if(arguments.length<=2){
+if(!_8d(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 _8e=[];
+for(var i=0;i<lst.length;i++){
+_8e.push(fn(lst[i]));
+}
+return _8e;
+}else{
+if(fn===null){
+fn=Array;
+}
+var _90=null;
+for(i=1;i<arguments.length;i++){
+if(!_8d(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(_90===null||_90>l){
+_90=l;
+}
+}
+_8e=[];
+for(i=0;i<_90;i++){
+var _92=[];
+for(var j=1;j<arguments.length;j++){
+_92.push(arguments[j][i]);
+}
+_8e.push(fn.apply(this,_92));
+}
+return _8e;
+}
+},xfilter:function(fn){
+var _95=[];
+if(fn===null){
+fn=MochiKit.Base.operator.truth;
+}
+for(var i=1;i<arguments.length;i++){
+var o=arguments[i];
+if(fn(o)){
+_95.push(o);
+}
+}
+return _95;
+},filter:function(fn,lst,_9a){
+var _9b=[];
+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,_9a);
+}else{
+if(typeof (_9a)=="undefined"||_9a===null){
+for(var i=0;i<lst.length;i++){
+var o=lst[i];
+if(fn(o)){
+_9b.push(o);
+}
+}
+}else{
+for(i=0;i<lst.length;i++){
+o=lst[i];
+if(fn.call(_9a,o)){
+_9b.push(o);
+}
+}
+}
+}
+return _9b;
+},_wrapDumbFunction:function(_9f){
+return function(){
+switch(arguments.length){
+case 0:
+return _9f();
+case 1:
+return _9f(arguments[0]);
+case 2:
+return _9f(arguments[0],arguments[1]);
+case 3:
+return _9f(arguments[0],arguments[1],arguments[2]);
+}
+var _a0=[];
+for(var i=0;i<arguments.length;i++){
+_a0.push("arguments["+i+"]");
+}
+return eval("(func("+_a0.join(",")+"))");
+};
+},methodcaller:function(_a2){
+var _a3=MochiKit.Base.extend(null,arguments,1);
+if(typeof (_a2)=="function"){
+return function(obj){
+return _a2.apply(obj,_a3);
+};
+}else{
+return function(obj){
+return obj[_a2].apply(obj,_a3);
+};
+}
+},method:function(_a6,_a7){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([_a7,_a6],arguments,2));
+},compose:function(f1,f2){
+var _ab=[];
+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");
+}
+_ab.push(fn);
+}
+return function(){
+var _af=arguments;
+for(var i=_ab.length-1;i>=0;i--){
+_af=[_ab[i].apply(this,_af)];
+}
+return _af[0];
+};
+},bind:function(_b1,_b2){
+if(typeof (_b1)=="string"){
+_b1=_b2[_b1];
+}
+var _b3=_b1.im_func;
+var _b4=_b1.im_preargs;
+var _b5=_b1.im_self;
+var m=MochiKit.Base;
+if(typeof (_b1)=="function"&&typeof (_b1.apply)=="undefined"){
+_b1=m._wrapDumbFunction(_b1);
+}
+if(typeof (_b3)!="function"){
+_b3=_b1;
+}
+if(typeof (_b2)!="undefined"){
+_b5=_b2;
+}
+if(typeof (_b4)=="undefined"){
+_b4=[];
+}else{
+_b4=_b4.slice();
+}
+m.extend(_b4,arguments,2);
+var _b7=function(){
+var _b8=arguments;
+var me=arguments.callee;
+if(me.im_preargs.length>0){
+_b8=m.concat(me.im_preargs,_b8);
+}
+var _ba=me.im_self;
+if(!_ba){
+_ba=this;
+}
+return me.im_func.apply(_ba,_b8);
+};
+_b7.im_self=_b5;
+_b7.im_func=_b3;
+_b7.im_preargs=_b4;
+return _b7;
+},bindMethods:function(_bb){
+var _bc=MochiKit.Base.bind;
+for(var k in _bb){
+var _be=_bb[k];
+if(typeof (_be)=="function"){
+_bb[k]=_bc(_be,_bb);
+}
+}
+},registerComparator:function(_bf,_c0,_c1,_c2){
+MochiKit.Base.comparatorRegistry.register(_bf,_c0,_c1,_c2);
+},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
+if(a==b){
+return 0;
+}
+var _c5=(typeof (a)=="undefined"||a===null);
+var _c6=(typeof (b)=="undefined"||b===null);
+if(_c5&&_c6){
+return 0;
+}else{
+if(_c5){
+return -1;
+}else{
+if(_c6){
+return 1;
+}
+}
+}
+var m=MochiKit.Base;
+var _c8=m._primitives;
+if(!(typeof (a) in _c8&&typeof (b) in _c8)){
+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 _c9=m.repr;
+throw new TypeError(_c9(a)+" and "+_c9(b)+" can not be compared");
+},compareDateLike:function(a,b){
+return MochiKit.Base.compare(a.getTime(),b.getTime());
+},compareArrayLike:function(a,b){
+var _ce=MochiKit.Base.compare;
+var _cf=a.length;
+var _d0=0;
+if(_cf>b.length){
+_d0=1;
+_cf=b.length;
+}else{
+if(_cf<b.length){
+_d0=-1;
+}
+}
+for(var i=0;i<_cf;i++){
+var cmp=_ce(a[i],b[i]);
+if(cmp){
+return cmp;
+}
+}
+return _d0;
+},registerRepr:function(_d3,_d4,_d5,_d6){
+MochiKit.Base.reprRegistry.register(_d3,_d4,_d5,_d6);
+},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 _d8=(o+"");
+}
+catch(e){
+return "["+typeof (o)+"]";
+}
+if(typeof (o)=="function"){
+o=_d8.replace(/^\s+/,"");
+var idx=o.indexOf("{");
+if(idx!=-1){
+o=o.substr(0,idx)+"{...}";
+}
+}
+return _d8;
+},reprArrayLike:function(o){
+var m=MochiKit.Base;
+return "["+m.map(m.repr,o).join(", ")+"]";
+},reprString:function(o){
+return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
+},reprNumber:function(o){
+return o+"";
+},registerJSON:function(_de,_df,_e0,_e1){
+MochiKit.Base.jsonRegistry.register(_de,_df,_e0,_e1);
+},evalJSON:function(){
+return eval("("+arguments[0]+")");
+},serializeJSON:function(o){
+var _e3=typeof (o);
+if(_e3=="number"||_e3=="boolean"){
+return o+"";
+}else{
+if(o===null){
+return "null";
+}
+}
+var m=MochiKit.Base;
+var _e5=m.reprString;
+if(_e3=="string"){
+return _e5(o);
+}
+var me=arguments.callee;
+var _e7;
+if(typeof (o.__json__)=="function"){
+_e7=o.__json__();
+if(o!==_e7){
+return me(_e7);
+}
+}
+if(typeof (o.json)=="function"){
+_e7=o.json();
+if(o!==_e7){
+return me(_e7);
+}
+}
+if(_e3!="function"&&typeof (o.length)=="number"){
+var res=[];
+for(var i=0;i<o.length;i++){
+var val=me(o[i]);
+if(typeof (val)!="string"){
+val="undefined";
+}
+res.push(val);
+}
+return "["+res.join(", ")+"]";
+}
+try{
+_e7=m.jsonRegistry.match(o);
+if(o!==_e7){
+return me(_e7);
+}
+}
+catch(e){
+if(e!=m.NotFound){
+throw e;
+}
+}
+if(_e3=="undefined"){
+throw new TypeError("undefined can not be serialized as JSON");
+}
+if(_e3=="function"){
+return null;
+}
+res=[];
+for(var k in o){
+var _ec;
+if(typeof (k)=="number"){
+_ec="\""+k+"\"";
+}else{
+if(typeof (k)=="string"){
+_ec=_e5(k);
+}else{
+continue;
+}
+}
+val=me(o[k]);
+if(typeof (val)!="string"){
+continue;
+}
+res.push(_ec+":"+val);
+}
+return "{"+res.join(", ")+"}";
+},objEqual:function(a,b){
+return (MochiKit.Base.compare(a,b)===0);
+},arrayEqual:function(_ef,arr){
+if(_ef.length!=arr.length){
+return false;
+}
+return (MochiKit.Base.compare(_ef,arr)===0);
+},concat:function(){
+var _f1=[];
+var _f2=MochiKit.Base.extend;
+for(var i=0;i<arguments.length;i++){
+_f2(_f1,arguments[i]);
+}
+return _f1;
+},keyComparator:function(key){
+var m=MochiKit.Base;
+var _f6=m.compare;
+if(arguments.length==1){
+return function(a,b){
+return _f6(a[key],b[key]);
+};
+}
+var _f9=m.extend(null,arguments);
+return function(a,b){
+var _fc=0;
+for(var i=0;(_fc===0)&&(i<_f9.length);i++){
+var key=_f9[i];
+_fc=_f6(a[key],b[key]);
+}
+return _fc;
+};
+},reverseKeyComparator:function(key){
+var _100=MochiKit.Base.keyComparator.apply(this,arguments);
+return function(a,b){
+return _100(b,a);
+};
+},partial:function(func){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([func,undefined],arguments,1));
+},listMinMax:function(_105,lst){
+if(lst.length===0){
+return null;
+}
+var cur=lst[0];
+var _108=MochiKit.Base.compare;
+for(var i=1;i<lst.length;i++){
+var o=lst[i];
+if(_108(o,cur)==_105){
+cur=o;
+}
+}
+return cur;
+},objMax:function(){
+return MochiKit.Base.listMinMax(1,arguments);
+},objMin:function(){
+return MochiKit.Base.listMinMax(-1,arguments);
+},findIdentical:function(lst,_10c,_10d,end){
+if(typeof (end)=="undefined"||end===null){
+end=lst.length;
+}
+if(typeof (_10d)=="undefined"||_10d===null){
+_10d=0;
+}
+for(var i=_10d;i<end;i++){
+if(lst[i]===_10c){
+return i;
+}
+}
+return -1;
+},mean:function(){
+var sum=0;
+var m=MochiKit.Base;
+var args=m.extend(null,arguments);
+var _113=args.length;
+while(args.length){
+var o=args.shift();
+if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
+_113+=o.length-1;
+for(var i=o.length-1;i>=0;i--){
+sum+=o[i];
+}
+}else{
+sum+=o;
+}
+}
+if(_113<=0){
+throw new TypeError("mean() requires at least one argument");
+}
+return sum/_113;
+},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 _117=data.length/2;
+return (data[_117]+data[_117-1])/2;
+}else{
+return data[(data.length-1)/2];
+}
+},findValue:function(lst,_119,_11a,end){
+if(typeof (end)=="undefined"||end===null){
+end=lst.length;
+}
+if(typeof (_11a)=="undefined"||_11a===null){
+_11a=0;
+}
+var cmp=MochiKit.Base.compare;
+for(var i=_11a;i<end;i++){
+if(cmp(lst[i],_119)===0){
+return i;
+}
+}
+return -1;
+},nodeWalk:function(node,_11f){
+var _120=[node];
+var _121=MochiKit.Base.extend;
+while(_120.length){
+var res=_11f(_120.shift());
+if(res){
+_121(_120,res);
+}
+}
+},nameFunctions:function(_123){
+var base=_123.NAME;
+if(typeof (base)=="undefined"){
+base="";
+}else{
+base=base+".";
+}
+for(var name in _123){
+var o=_123[name];
+if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
+try{
+o.NAME=base+name;
+}
+catch(e){
+}
+}
+}
+},queryString:function(_127,_128){
+if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_127)=="string"||(typeof (_127.nodeType)!="undefined"&&_127.nodeType>0))){
+var kv=MochiKit.DOM.formContents(_127);
+_127=kv[0];
+_128=kv[1];
+}else{
+if(arguments.length==1){
+if(typeof (_127.length)=="number"&&_127.length==2){
+return arguments.callee(_127[0],_127[1]);
+}
+var o=_127;
+_127=[];
+_128=[];
+for(var k in o){
+var v=o[k];
+if(typeof (v)=="function"){
+continue;
+}else{
+if(typeof (v)!="string"&&typeof (v.length)=="number"){
+for(var i=0;i<v.length;i++){
+_127.push(k);
+_128.push(v[i]);
+}
+}else{
+_127.push(k);
+_128.push(v);
+}
+}
+}
+}
+}
+var rval=[];
+var len=Math.min(_127.length,_128.length);
+var _130=MochiKit.Base.urlEncode;
+for(var i=0;i<len;i++){
+v=_128[i];
+if(typeof (v)!="undefined"&&v!==null){
+rval.push(_130(_127[i])+"="+_130(v));
+}
+}
+return rval.join("&");
+},parseQueryString:function(_131,_132){
+var qstr=(_131.charAt(0)=="?")?_131.substring(1):_131;
+var _134=qstr.replace(/\+/g,"%20").split(/(\&\;|\&\#38\;|\&|\&)/);
+var o={};
+var _136;
+if(typeof (decodeURIComponent)!="undefined"){
+_136=decodeURIComponent;
+}else{
+_136=unescape;
+}
+if(_132){
+for(var i=0;i<_134.length;i++){
+var pair=_134[i].split("=");
+var name=_136(pair.shift());
+if(!name){
+continue;
+}
+var arr=o[name];
+if(!(arr instanceof Array)){
+arr=[];
+o[name]=arr;
+}
+arr.push(_136(pair.join("=")));
+}
+}else{
+for(i=0;i<_134.length;i++){
+pair=_134[i].split("=");
+var name=pair.shift();
+if(!name){
+continue;
+}
+o[_136(name)]=_136(pair.join("="));
+}
+}
+return o;
+}});
+MochiKit.Base.AdapterRegistry=function(){
+this.pairs=[];
+};
+MochiKit.Base.AdapterRegistry.prototype={register:function(name,_13c,wrap,_13e){
+if(_13e){
+this.pairs.unshift([name,_13c,wrap]);
+}else{
+this.pairs.push([name,_13c,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","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(_144,_145){
+if(!MochiKit.__export__){
+return;
+}
+var all=_145.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_144[all[i]]=_145[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(_149){
+return encodeURIComponent(_149).replace(/\'/g,"%27");
+};
+}else{
+m.urlEncode=function(_14a){
+return escape(_14a).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;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Base);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Iter");
+dojo.require("MochiKit.Base");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Iter depends on MochiKit.Base!";
+}
+if(typeof (MochiKit.Iter)=="undefined"){
+MochiKit.Iter={};
+}
+MochiKit.Iter.NAME="MochiKit.Iter";
+MochiKit.Iter.VERSION="1.4";
+MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+},toString:function(){
+return this.__repr__();
+},registerIteratorFactory:function(name,_14e,_14f,_150){
+MochiKit.Iter.iteratorRegistry.register(name,_14e,_14f,_150);
+},iter:function(_151,_152){
+var self=MochiKit.Iter;
+if(arguments.length==2){
+return self.takewhile(function(a){
+return a!=_152;
+},_151);
+}
+if(typeof (_151.next)=="function"){
+return _151;
+}else{
+if(typeof (_151.iter)=="function"){
+return _151.iter();
+}
+}
+try{
+return self.iteratorRegistry.match(_151);
+}
+catch(e){
+var m=MochiKit.Base;
+if(e==m.NotFound){
+e=new TypeError(typeof (_151)+": "+m.repr(_151)+" 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 _15c=self.iter(p);
+return {repr:function(){
+return "cycle(...)";
+},toString:m.forwardCall("repr"),next:function(){
+try{
+var rval=_15c.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(_162){
+return _162.next();
+},izip:function(p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var next=self.next;
+var _168=m.map(self.iter,arguments);
+return {repr:function(){
+return "izip(...)";
+},toString:m.forwardCall("repr"),next:function(){
+return m.map(next,_168);
+}};
+},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 _174=0;
+var stop=0;
+var step=1;
+var i=-1;
+if(arguments.length==2){
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_174=arguments[1];
+stop=arguments[2];
+}else{
+_174=arguments[1];
+stop=arguments[2];
+step=arguments[3];
+}
+}
+return {repr:function(){
+return "islice("+["...",_174,stop,step].join(", ")+")";
+},toString:m.forwardCall("repr"),next:function(){
+var rval;
+while(i<_174){
+rval=seq.next();
+i++;
+}
+if(_174>=stop){
+throw self.StopIteration;
+}
+_174+=step;
+return rval;
+}};
+},imap:function(fun,p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var _17e=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,_17e));
+}};
+},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 _189=m.map(self.iter,arguments);
+return {repr:function(){
+return "chain(...)";
+},toString:m.forwardCall("repr"),next:function(){
+while(_189.length>1){
+try{
+return _189[0].next();
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+_189.shift();
+}
+}
+if(_189.length==1){
+var arg=_189.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(_194,sync,_196){
+sync.pos[_194]=-1;
+var m=MochiKit.Base;
+var _198=m.listMin;
+return {repr:function(){
+return "tee("+_194+", ...)";
+},toString:m.forwardCall("repr"),next:function(){
+var rval;
+var i=sync.pos[_194];
+if(i==sync.max){
+rval=_196.next();
+sync.deque.push(rval);
+sync.max+=1;
+sync.pos[_194]+=1;
+}else{
+rval=sync.deque[i-sync.min];
+sync.pos[_194]+=1;
+if(i==sync.min&&_198(sync.pos)!=sync.min){
+sync.min+=1;
+sync.deque.shift();
+}
+}
+return rval;
+}};
+},tee:function(_19b,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;
+_19b=self.iter(_19b);
+var _tee=self._tee;
+for(var i=0;i<n;i++){
+rval.push(_tee(i,sync,_19b));
+}
+return rval;
+},list:function(_1a2){
+var rval;
+if(_1a2 instanceof Array){
+return _1a2.slice();
+}
+if(typeof (_1a2)=="function"&&!(_1a2 instanceof Function)&&typeof (_1a2.length)=="number"){
+rval=[];
+for(var i=0;i<_1a2.length;i++){
+rval.push(_1a2[i]);
+}
+return rval;
+}
+var self=MochiKit.Iter;
+_1a2=self.iter(_1a2);
+var rval=[];
+try{
+while(true){
+rval.push(_1a2.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return rval;
+}
+return undefined;
+},reduce:function(fn,_1a7,_1a8){
+var i=0;
+var x=_1a8;
+var self=MochiKit.Iter;
+_1a7=self.iter(_1a7);
+if(arguments.length<3){
+try{
+x=_1a7.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,_1a7.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},range:function(){
+var _1ac=0;
+var stop=0;
+var step=1;
+if(arguments.length==1){
+stop=arguments[0];
+}else{
+if(arguments.length==2){
+_1ac=arguments[0];
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_1ac=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&&_1ac>=stop)||(step<0&&_1ac<=stop)){
+throw MochiKit.Iter.StopIteration;
+}
+var rval=_1ac;
+_1ac+=step;
+return rval;
+},repr:function(){
+return "range("+[_1ac,stop,step].join(", ")+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+},sum:function(_1b0,_1b1){
+if(typeof (_1b1)=="undefined"||_1b1===null){
+_1b1=0;
+}
+var x=_1b1;
+var self=MochiKit.Iter;
+_1b0=self.iter(_1b0);
+try{
+while(true){
+x+=_1b0.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},exhaust:function(_1b4){
+var self=MochiKit.Iter;
+_1b4=self.iter(_1b4);
+try{
+while(true){
+_1b4.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+},forEach:function(_1b6,func,self){
+var m=MochiKit.Base;
+if(arguments.length>2){
+func=m.bind(func,self);
+}
+if(m.isArrayLike(_1b6)){
+try{
+for(var i=0;i<_1b6.length;i++){
+func(_1b6[i]);
+}
+}
+catch(e){
+if(e!=MochiKit.Iter.StopIteration){
+throw e;
+}
+}
+}else{
+self=MochiKit.Iter;
+self.exhaust(self.imap(func,_1b6));
+}
+},every:function(_1bb,func){
+var self=MochiKit.Iter;
+try{
+self.ifilterfalse(func,_1bb).next();
+return false;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return true;
+}
+},sorted:function(_1be,cmp){
+var rval=MochiKit.Iter.list(_1be);
+if(arguments.length==1){
+cmp=MochiKit.Base.compare;
+}
+rval.sort(cmp);
+return rval;
+},reversed:function(_1c1){
+var rval=MochiKit.Iter.list(_1c1);
+rval.reverse();
+return rval;
+},some:function(_1c3,func){
+var self=MochiKit.Iter;
+try{
+self.ifilter(func,_1c3).next();
+return true;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return false;
+}
+},iextend:function(lst,_1c7){
+if(MochiKit.Base.isArrayLike(_1c7)){
+for(var i=0;i<_1c7.length;i++){
+lst.push(_1c7[i]);
+}
+}else{
+var self=MochiKit.Iter;
+_1c7=self.iter(_1c7);
+try{
+while(true){
+lst.push(_1c7.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+}
+return lst;
+},groupby:function(_1ca,_1cb){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length<2){
+_1cb=m.operator.identity;
+}
+_1ca=self.iter(_1ca);
+var pk=undefined;
+var k=undefined;
+var v;
+function fetch(){
+v=_1ca.next();
+k=_1cb(v);
+}
+function eat(){
+var ret=v;
+v=undefined;
+return ret;
+}
+var _1d2=true;
+var _1d3=m.compare;
+return {repr:function(){
+return "groupby(...)";
+},next:function(){
+while(_1d3(k,pk)===0){
+fetch();
+if(_1d2){
+_1d2=false;
+break;
+}
+}
+pk=k;
+return [k,{next:function(){
+if(v==undefined){
+fetch();
+}
+if(_1d3(k,pk)!==0){
+throw self.StopIteration;
+}
+return eat();
+}}];
+}};
+},groupby_as_array:function(_1d4,_1d5){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length<2){
+_1d5=m.operator.identity;
+}
+_1d4=self.iter(_1d4);
+var _1d8=[];
+var _1d9=true;
+var _1da;
+var _1db=m.compare;
+while(true){
+try{
+var _1dc=_1d4.next();
+var key=_1d5(_1dc);
+}
+catch(e){
+if(e==self.StopIteration){
+break;
+}
+throw e;
+}
+if(_1d9||_1db(key,_1da)!==0){
+var _1de=[];
+_1d8.push([key,_1de]);
+}
+_1de.push(_1dc);
+_1d9=false;
+_1da=key;
+}
+return _1d8;
+},arrayLikeIter:function(_1df){
+var i=0;
+return {repr:function(){
+return "arrayLikeIter(...)";
+},toString:MochiKit.Base.forwardCall("repr"),next:function(){
+if(i>=_1df.length){
+throw MochiKit.Iter.StopIteration;
+}
+return _1df[i++];
+}};
+},hasIterateNext:function(_1e1){
+return (_1e1&&typeof (_1e1.iterateNext)=="function");
+},iterateNextIter:function(_1e2){
+return {repr:function(){
+return "iterateNextIter(...)";
+},toString:MochiKit.Base.forwardCall("repr"),next:function(){
+var rval=_1e2.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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Logging");
+dojo.require("MochiKit.Base");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Logging depends on MochiKit.Base!";
+}
+if(typeof (MochiKit.Logging)=="undefined"){
+MochiKit.Logging={};
+}
+MochiKit.Logging.NAME="MochiKit.Logging";
+MochiKit.Logging.VERSION="1.4";
+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,_1e6,info){
+this.num=num;
+this.level=_1e6;
+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(_1e9){
+var self=MochiKit.Logging;
+if(typeof (_1e9)=="string"){
+_1e9=self.LogLevel[_1e9];
+}
+return function(msg){
+var _1ec=msg.level;
+if(typeof (_1ec)=="string"){
+_1ec=self.LogLevel[_1ec];
+}
+return _1ec>=_1e9;
+};
+},isLogMessage:function(){
+var _1ed=MochiKit.Logging.LogMessage;
+for(var i=0;i<arguments.length;i++){
+if(!(arguments[i] instanceof _1ed)){
+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(_1f2){
+this.counter=0;
+if(typeof (_1f2)=="undefined"||_1f2===null){
+_1f2=-1;
+}
+this.maxSize=_1f2;
+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(_1f7,_1f8,_1f9){
+if(typeof (_1f8)=="string"){
+_1f8=MochiKit.Logging.logLevelAtLeast(_1f8);
+}
+var _1fa=[_1f8,_1f9];
+_1fa.ident=_1f7;
+this.listeners[_1f7]=_1fa;
+},removeListener:function(_1fb){
+delete this.listeners[_1fb];
+},baseLog:function(_1fc,_1fd){
+var msg=new MochiKit.Logging.LogMessage(this.counter,_1fc,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(_1ff){
+var _200=0;
+if(!(typeof (_1ff)=="undefined"||_1ff===null)){
+_200=Math.max(0,this._messages.length-_1ff);
+}
+return this._messages.slice(_200);
+},getMessageText:function(_201){
+if(typeof (_201)=="undefined"||_201===null){
+_201=30;
+}
+var _202=this.getMessages(_201);
+if(_202.length){
+var lst=map(function(m){
+return "\n ["+m.num+"] "+m.level+": "+m.info.join(" ");
+},_202);
+lst.unshift("LAST "+_202.length+" MESSAGES:");
+return lst.join("");
+}
+return "";
+},debuggingBookmarklet:function(_205){
+if(typeof (MochiKit.LoggingPane)=="undefined"){
+alert(this.getMessageText());
+}else{
+MochiKit.LoggingPane.createLoggingPane(_205||false);
+}
+}};
+MochiKit.Logging.__new__=function(){
+this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
+var m=MochiKit.Base;
+m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
+var _207=m.partial;
+var _208=this.Logger;
+var _209=_208.prototype.baseLog;
+m.update(this.Logger.prototype,{debug:_207(_209,"DEBUG"),log:_207(_209,"INFO"),error:_207(_209,"ERROR"),fatal:_207(_209,"FATAL"),warning:_207(_209,"WARNING")});
+var self=this;
+var _20b=function(name){
+return function(){
+self.logger[name].apply(self.logger,arguments);
+};
+};
+this.log=_20b("log");
+this.logError=_20b("error");
+this.logDebug=_20b("debug");
+this.logFatal=_20b("fatal");
+this.logWarning=_20b("warning");
+this.logger=new _208();
+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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.DateTime");
+}
+if(typeof (MochiKit)=="undefined"){
+MochiKit={};
+}
+if(typeof (MochiKit.DateTime)=="undefined"){
+MochiKit.DateTime={};
+}
+MochiKit.DateTime.NAME="MochiKit.DateTime";
+MochiKit.DateTime.VERSION="1.4";
+MochiKit.DateTime.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.DateTime.toString=function(){
+return this.__repr__();
+};
+MochiKit.DateTime.isoDate=function(str){
+str=str+"";
+if(typeof (str)!="string"||str.length===0){
+return null;
+}
+var iso=str.split("-");
+if(iso.length===0){
+return null;
+}
+return new Date(iso[0],iso[1]-1,iso[2]);
+};
+MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
+MochiKit.DateTime.isoTimestamp=function(str){
+str=str+"";
+if(typeof (str)!="string"||str.length===0){
+return null;
+}
+var res=str.match(MochiKit.DateTime._isoRegexp);
+if(typeof (res)=="undefined"||res===null){
+return null;
+}
+var year,_213,day,hour,min,sec,msec;
+year=parseInt(res[1],10);
+if(typeof (res[2])=="undefined"||res[2]===""){
+return new Date(year);
+}
+_213=parseInt(res[2],10)-1;
+day=parseInt(res[3],10);
+if(typeof (res[4])=="undefined"||res[4]===""){
+return new Date(year,_213,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,_213,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,_213,day,hour,min,sec,msec)-ofs);
+};
+MochiKit.DateTime.toISOTime=function(date,_21b){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var hh=date.getHours();
+var mm=date.getMinutes();
+var ss=date.getSeconds();
+var lst=[((_21b&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
+return lst.join(":");
+};
+MochiKit.DateTime.toISOTimestamp=function(date,_221){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var sep=_221?"T":" ";
+var foot=_221?"Z":"";
+if(_221){
+date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
+}
+return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_221)+foot;
+};
+MochiKit.DateTime.toISODate=function(date){
+if(typeof (date)=="undefined"||date===null){
+return null;
+}
+var _225=MochiKit.DateTime._padTwo;
+return [date.getFullYear(),_225(date.getMonth()+1),_225(date.getDate())].join("-");
+};
+MochiKit.DateTime.americanDate=function(d){
+d=d+"";
+if(typeof (d)!="string"||d.length===0){
+return null;
+}
+var a=d.split("/");
+return new Date(a[2],a[0]-1,a[1]);
+};
+MochiKit.DateTime._padTwo=function(n){
+return (n>9)?n:"0"+n;
+};
+MochiKit.DateTime.toPaddedAmericanDate=function(d){
+if(typeof (d)=="undefined"||d===null){
+return null;
+}
+var _22a=MochiKit.DateTime._padTwo;
+return [_22a(d.getMonth()+1),_22a(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(_22f,_230){
+if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
+var all=_230.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_22f[all[i]]=_230[all[i]];
+}
+}
+})(this,MochiKit.DateTime);
+}
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Format");
+}
+if(typeof (MochiKit)=="undefined"){
+MochiKit={};
+}
+if(typeof (MochiKit.Format)=="undefined"){
+MochiKit.Format={};
+}
+MochiKit.Format.NAME="MochiKit.Format";
+MochiKit.Format.VERSION="1.4";
+MochiKit.Format.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Format.toString=function(){
+return this.__repr__();
+};
+MochiKit.Format._numberFormatter=function(_233,_234,_235,_236,_237,_238,_239,_23a,_23b){
+return function(num){
+num=parseFloat(num);
+if(typeof (num)=="undefined"||num===null||isNaN(num)){
+return _233;
+}
+var _23d=_234;
+var _23e=_235;
+if(num<0){
+num=-num;
+}else{
+_23d=_23d.replace(/-/,"");
+}
+var me=arguments.callee;
+var fmt=MochiKit.Format.formatLocale(_236);
+if(_237){
+num=num*100;
+_23e=fmt.percent+_23e;
+}
+num=MochiKit.Format.roundToFixed(num,_238);
+var _241=num.split(/\./);
+var _242=_241[0];
+var frac=(_241.length==1)?"":_241[1];
+var res="";
+while(_242.length<_239){
+_242="0"+_242;
+}
+if(_23a){
+while(_242.length>_23a){
+var i=_242.length-_23a;
+res=fmt.separator+_242.substring(i,_242.length)+res;
+_242=_242.substring(0,i);
+}
+}
+res=_242+res;
+if(_238>0){
+while(frac.length<_23b){
+frac=frac+"0";
+}
+res=res+fmt.decimal+frac;
+}
+return _23d+res+_23e;
+};
+};
+MochiKit.Format.numberFormatter=function(_246,_247,_248){
+if(typeof (_247)=="undefined"){
+_247="";
+}
+var _249=_246.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
+if(!_249){
+throw TypeError("Invalid pattern");
+}
+var _24a=_246.substr(0,_249.index);
+var _24b=_246.substr(_249.index+_249[0].length);
+if(_24a.search(/-/)==-1){
+_24a=_24a+"-";
+}
+var _24c=_249[1];
+var frac=(typeof (_249[2])=="string"&&_249[2]!="")?_249[2]:"";
+var _24e=(typeof (_249[3])=="string"&&_249[3]!="");
+var tmp=_24c.split(/,/);
+var _250;
+if(typeof (_248)=="undefined"){
+_248="default";
+}
+if(tmp.length==1){
+_250=null;
+}else{
+_250=tmp[1].length;
+}
+var _251=_24c.length-_24c.replace(/0/g,"").length;
+var _252=frac.length-frac.replace(/0/g,"").length;
+var _253=frac.length;
+var rval=MochiKit.Format._numberFormatter(_247,_24a,_24b,_248,_24e,_253,_251,_250,_252);
+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(_258){
+if(typeof (_258)=="undefined"||_258===null){
+_258="default";
+}
+if(typeof (_258)=="string"){
+var rval=MochiKit.Format.LOCALE[_258];
+if(typeof (rval)=="string"){
+rval=arguments.callee(rval);
+MochiKit.Format.LOCALE[_258]=rval;
+}
+return rval;
+}else{
+return _258;
+}
+};
+MochiKit.Format.twoDigitAverage=function(_25a,_25b){
+if(_25b){
+var res=_25a/_25b;
+if(!isNaN(res)){
+return MochiKit.Format.twoDigitFloat(_25a/_25b);
+}
+}
+return "0";
+};
+MochiKit.Format.twoDigitFloat=function(_25d){
+var sign=(_25d<0?"-":"");
+var s=Math.floor(Math.abs(_25d)*100).toString();
+if(s=="0"){
+return s;
+}
+if(s.length<3){
+while(s.charAt(s.length-1)=="0"){
+s=s.substring(0,s.length-1);
+}
+return sign+"0."+s;
+}
+var head=sign+s.substring(0,s.length-2);
+var tail=s.substring(s.length-2,s.length);
+if(tail=="00"){
+return head;
+}else{
+if(tail.charAt(1)=="0"){
+return head+"."+tail.charAt(0);
+}else{
+return head+"."+tail;
+}
+}
+};
+MochiKit.Format.lstrip=function(str,_263){
+str=str+"";
+if(typeof (str)!="string"){
+return null;
+}
+if(!_263){
+return str.replace(/^\s+/,"");
+}else{
+return str.replace(new RegExp("^["+_263+"]+"),"");
+}
+};
+MochiKit.Format.rstrip=function(str,_265){
+str=str+"";
+if(typeof (str)!="string"){
+return null;
+}
+if(!_265){
+return str.replace(/\s+$/,"");
+}else{
+return str.replace(new RegExp("["+_265+"]+$"),"");
+}
+};
+MochiKit.Format.strip=function(str,_267){
+var self=MochiKit.Format;
+return self.rstrip(self.lstrip(str,_267),_267);
+};
+MochiKit.Format.truncToFixed=function(_269,_26a){
+_269=Math.floor(_269*Math.pow(10,_26a));
+var res=(_269*Math.pow(10,-_26a)).toFixed(_26a);
+if(res.charAt(0)=="."){
+res="0"+res;
+}
+return res;
+};
+MochiKit.Format.roundToFixed=function(_26c,_26d){
+return MochiKit.Format.truncToFixed(_26c+0.5*Math.pow(10,-_26d),_26d);
+};
+MochiKit.Format.percentFormat=function(_26e){
+return MochiKit.Format.twoDigitFloat(100*_26e)+"%";
+};
+MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
+MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
+MochiKit.Format.EXPORT_OK=[];
+MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
+MochiKit.Format.__new__=function(){
+var base=this.NAME+".";
+var k,v,o;
+for(k in this.LOCALE){
+o=this.LOCALE[k];
+if(typeof (o)=="object"){
+o.repr=function(){
+return this.NAME;
+};
+o.NAME=base+"LOCALE."+k;
+}
+}
+for(k in this){
+o=this[k];
+if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
+try{
+o.NAME=base+k;
+}
+catch(e){
+}
+}
+}
+};
+MochiKit.Format.__new__();
+if(typeof (MochiKit.Base)!="undefined"){
+MochiKit.Base._exportSymbols(this,MochiKit.Format);
+}else{
+(function(_273,_274){
+if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
+var all=_274.EXPORT_TAGS[":all"];
+for(var i=0;i<all.length;i++){
+_273[all[i]]=_274[all[i]];
+}
+}
+})(this,MochiKit.Format);
+}
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Async");
+dojo.require("MochiKit.Base");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Async depends on MochiKit.Base!";
+}
+if(typeof (MochiKit.Async)=="undefined"){
+MochiKit.Async={};
+}
+MochiKit.Async.NAME="MochiKit.Async";
+MochiKit.Async.VERSION="1.4";
+MochiKit.Async.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Async.toString=function(){
+return this.__repr__();
+};
+MochiKit.Async.Deferred=function(_277){
+this.chain=[];
+this.id=this._nextId();
+this.fired=-1;
+this.paused=0;
+this.results=[null,null];
+this.canceller=_277;
+this.silentlyCancelled=false;
+this.chained=false;
+};
+MochiKit.Async.Deferred.prototype={repr:function(){
+var _278;
+if(this.fired==-1){
+_278="unfired";
+}else{
+if(this.fired===0){
+_278="success";
+}else{
+_278="error";
+}
+}
+return "Deferred("+this.id+", "+_278+")";
+},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 _283=this.chain;
+var _284=this.fired;
+var res=this.results[_284];
+var self=this;
+var cb=null;
+while(_283.length>0&&this.paused===0){
+var pair=_283.shift();
+var f=pair[_284];
+if(f===null){
+continue;
+}
+try{
+res=f(res);
+_284=((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){
+_284=1;
+if(!(err instanceof Error)){
+err=new MochiKit.Async.GenericError(err);
+}
+res=err;
+}
+}
+this.fired=_284;
+this.results[_284]=res;
+if(cb&&this.paused){
+res.addBoth(cb);
+res.chained=true;
+}
+}};
+MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){
+return eval("("+arguments[0].responseText+")");
+},succeed:function(_28b){
+var d=new MochiKit.Async.Deferred();
+d.callback.apply(d,arguments);
+return d;
+},fail:function(_28d){
+var d=new MochiKit.Async.Deferred();
+d.errback.apply(d,arguments);
+return d;
+},getXMLHttpRequest:function(){
+var self=arguments.callee;
+if(!self.XMLHttpRequest){
+var _290=[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<_290.length;i++){
+var func=_290[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 _295=null;
+try{
+_295=this.status;
+if(!_295&&m.isNotEmpty(this.responseText)){
+_295=304;
+}
+}
+catch(e){
+}
+if(_295==200||_295==201||_295==204||_295==304||_295==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,_299){
+if(typeof (_299)=="undefined"||_299===null){
+_299="";
+}
+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(_299);
+}
+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);
+}
+if(opts.headers){
+var _2a6=opts.headers;
+if(!m.isArrayLike(_2a6)){
+_2a6=m.items(_2a6);
+}
+for(var i=0;i<_2a6.length;i++){
+var _2a8=_2a6[i];
+var name=_2a8[0];
+var _2aa=_2a8[1];
+req.setRequestHeader(name,_2aa);
+}
+}
+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(_2b3,_2b4){
+var d=new MochiKit.Async.Deferred();
+var m=MochiKit.Base;
+if(typeof (_2b4)!="undefined"){
+d.addCallback(function(){
+return _2b4;
+});
+}
+var _2b7=setTimeout(m.bind("callback",d),Math.floor(_2b3*1000));
+d.canceller=function(){
+try{
+clearTimeout(_2b7);
+}
+catch(e){
+}
+};
+return d;
+},callLater:function(_2b8,func){
+var m=MochiKit.Base;
+var _2bb=m.partial.apply(m,m.extend(null,arguments,1));
+return MochiKit.Async.wait(_2b8).addCallback(function(res){
+return _2bb();
+});
+}});
+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 _2be;
+if(this.locked){
+_2be="locked, "+this.waiting.length+" waiting";
+}else{
+_2be="unlocked";
+}
+return "DeferredLock("+this.id+", "+_2be+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+MochiKit.Async.DeferredList=function(list,_2c0,_2c1,_2c2,_2c3){
+MochiKit.Async.Deferred.apply(this,[_2c3]);
+this.list=list;
+var _2c4=[];
+this.resultList=_2c4;
+this.finishedCount=0;
+this.fireOnOneCallback=_2c0;
+this.fireOnOneErrback=_2c1;
+this.consumeErrors=_2c2;
+var cb=MochiKit.Base.bind(this._cbDeferred,this);
+for(var i=0;i<list.length;i++){
+var d=list[i];
+_2c4.push(undefined);
+d.addCallback(cb,i,true);
+d.addErrback(cb,i,false);
+}
+if(list.length===0&&!_2c0){
+this.callback(this.resultList);
+}
+};
+MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
+MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2c8,_2c9,_2ca){
+this.resultList[_2c8]=[_2c9,_2ca];
+this.finishedCount+=1;
+if(this.fired==-1){
+if(_2c9&&this.fireOnOneCallback){
+this.callback([_2c8,_2ca]);
+}else{
+if(!_2c9&&this.fireOnOneErrback){
+this.errback(_2ca);
+}else{
+if(this.finishedCount==this.list.length){
+this.callback(this.resultList);
+}
+}
+}
+}
+if(!_2c9&&this.consumeErrors){
+_2ca=null;
+}
+return _2ca;
+};
+MochiKit.Async.gatherResults=function(_2cb){
+var d=new MochiKit.Async.DeferredList(_2cb,false,true,false);
+d.addCallback(function(_2cd){
+var ret=[];
+for(var i=0;i<_2cd.length;i++){
+ret.push(_2cd[i][1]);
+}
+return ret;
+});
+return d;
+};
+MochiKit.Async.maybeDeferred=function(func){
+var self=MochiKit.Async;
+var _2d2;
+try{
+var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
+if(r instanceof self.Deferred){
+_2d2=r;
+}else{
+if(r instanceof Error){
+_2d2=self.fail(r);
+}else{
+_2d2=self.succeed(r);
+}
+}
+}
+catch(e){
+_2d2=self.fail(e);
+}
+return _2d2;
+};
+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(_2d6){
+this.deferred=_2d6;
+});
+ne("CancelledError",function(_2d7){
+this.deferred=_2d7;
+});
+ne("BrowserComplianceError",function(msg){
+this.message=msg;
+});
+ne("GenericError",function(msg){
+this.message=msg;
+});
+ne("XMLHttpRequestError",function(req,msg){
+this.req=req;
+this.message=msg;
+try{
+this.number=req.status;
+}
+catch(e){
+}
+});
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Async.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Async);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.DOM");
+dojo.require("MochiKit.Base");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.DOM depends on MochiKit.Base!";
+}
+if(typeof (MochiKit.DOM)=="undefined"){
+MochiKit.DOM={};
+}
+MochiKit.DOM.NAME="MochiKit.DOM";
+MochiKit.DOM.VERSION="1.4";
+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","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","scrapeText","isParent","getFirstParentByTagAndClassName","makeClipping","undoClipping","makePositioned","undoPositioned","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"],["hideElement","MochiKit.Style.hideElement","1.4"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
+MochiKit.DOM.getViewportDimensions=new Function(""+"if (!MochiKit[\"Style\"]) {"+" throw new Error(\"This function has been deprecated and depends on MochiKit.Style.\");"+"}"+"return MochiKit.Style.getViewportDimensions.apply(this, arguments);");
+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 _2df=self._document;
+var _2e0=self._window;
+var rval;
+try{
+self._window=win;
+self._document=win.document;
+rval=func();
+}
+catch(e){
+self._window=_2e0;
+self._document=_2df;
+throw e;
+}
+self._window=_2e0;
+self._document=_2df;
+return rval;
+},formContents:function(elem){
+var _2e3=[];
+var _2e4=[];
+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 _2e9=elem.tagName.toUpperCase();
+if(_2e9==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
+return null;
+}
+if(_2e9==="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;
+}
+}
+_2e3.push(name);
+_2e4.push(v);
+return null;
+}
+_2e3.push(name);
+_2e4.push("");
+return null;
+}else{
+var opts=elem.options;
+if(!opts.length){
+_2e3.push(name);
+_2e4.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;
+}
+}
+_2e3.push(name);
+_2e4.push(v);
+}
+return null;
+}
+}
+if(_2e9==="FORM"||_2e9==="P"||_2e9==="SPAN"||_2e9==="DIV"){
+return elem.childNodes;
+}
+_2e3.push(name);
+_2e4.push(elem.value||"");
+return null;
+}
+return elem.childNodes;
+});
+return [_2e3,_2e4];
+},withDocument:function(doc,func){
+var self=MochiKit.DOM;
+var _2f2=self._document;
+var rval;
+try{
+self._document=doc;
+rval=func();
+}
+catch(e){
+self._document=_2f2;
+throw e;
+}
+self._document=_2f2;
+return rval;
+},registerDOMConverter:function(name,_2f5,wrap,_2f7){
+MochiKit.DOM.domConverters.register(name,_2f5,wrap,_2f7);
+},coerceToDOM:function(node,ctx){
+var m=MochiKit.Base;
+var im=MochiKit.Iter;
+var self=MochiKit.DOM;
+if(im){
+var iter=im.iter;
+var _2fe=im.repeat;
+var map=m.map;
+}
+var _300=self.domConverters;
+var _301=arguments.callee;
+var _302=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 _303=null;
+try{
+_303=iter(node);
+}
+catch(e){
+}
+if(_303){
+return map(_301,_303,_2fe(ctx));
+}
+}
+try{
+node=_300.match(node,ctx);
+continue;
+}
+catch(e){
+if(e!=_302){
+throw e;
+}
+}
+return self._document.createTextNode(node.toString());
+}
+return undefined;
+},isChildNode:function(node,_305){
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+node=self.getElement(node);
+}
+if(typeof (_305)=="string"){
+_305=self.getElement(_305);
+}
+if(node===_305){
+return true;
+}
+while(node&&node.tagName.toUpperCase()!="BODY"){
+node=node.parentNode;
+if(node===_305){
+return true;
+}
+}
+return false;
+},setNodeAttribute:function(node,attr,_309){
+var o={};
+o[attr]=_309;
+try{
+return MochiKit.DOM.updateNodeAttributes(node,o);
+}
+catch(e){
+}
+return null;
+},getNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _30e=self.attributeArray.renames[attr];
+node=self.getElement(node);
+try{
+if(_30e){
+return node[_30e];
+}
+return node.getAttribute(attr);
+}
+catch(e){
+}
+return null;
+},removeNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _312=self.attributeArray.renames[attr];
+node=self.getElement(node);
+try{
+if(_312){
+return node[_312];
+}
+return node.removeAttribute(attr);
+}
+catch(e){
+}
+return null;
+},updateNodeAttributes:function(node,_314){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+if(_314){
+var _317=MochiKit.Base.updatetree;
+if(self.attributeArray.compliant){
+for(var k in _314){
+var v=_314[k];
+if(typeof (v)=="object"&&typeof (elem[k])=="object"){
+if(k=="style"&&MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_317(elem[k],v);
+}
+}else{
+if(k.substring(0,2)=="on"){
+if(typeof (v)=="string"){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+}
+}else{
+var _31a=self.attributeArray.renames;
+for(var k in _314){
+v=_314[k];
+var _31b=_31a[k];
+if(k=="style"&&typeof (v)=="string"){
+elem.style.cssText=v;
+}else{
+if(typeof (_31b)=="string"){
+elem[_31b]=v;
+}else{
+if(typeof (elem[k])=="object"&&typeof (v)=="object"){
+if(k=="style"&&MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_317(elem[k],v);
+}
+}else{
+if(k.substring(0,2)=="on"){
+if(typeof (v)=="string"){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+}
+}
+}
+}
+}
+return elem;
+},appendChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _31f=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _320=MochiKit.Base.concat;
+while(_31f.length){
+var n=_31f.shift();
+if(typeof (n)=="undefined"||n===null){
+}else{
+if(typeof (n.nodeType)=="number"){
+elem.appendChild(n);
+}else{
+_31f=_320(n,_31f);
+}
+}
+}
+return elem;
+},insertSiblingNodesBefore:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _325=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _326=elem.parentNode;
+var _327=MochiKit.Base.concat;
+while(_325.length){
+var n=_325.shift();
+if(typeof (n)=="undefined"||n===null){
+}else{
+if(typeof (n.nodeType)=="number"){
+_326.insertBefore(n,elem);
+}else{
+_325=_327(n,_325);
+}
+}
+}
+return _326;
+},insertSiblingNodesAfter:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+}
+var _32c=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+if(elem.nextSibling){
+return self.insertSiblingNodesBefore(elem.nextSibling,_32c);
+}else{
+return self.appendChildNodes(elem.parentNode,_32c);
+}
+},replaceChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)=="string"){
+elem=self.getElement(node);
+arguments[0]=elem;
+}
+var _330;
+while((_330=elem.firstChild)){
+elem.removeChild(_330);
+}
+if(arguments.length<2){
+return elem;
+}else{
+return self.appendChildNodes.apply(this,arguments);
+}
+},createDOM:function(name,_332){
+var elem;
+var self=MochiKit.DOM;
+var m=MochiKit.Base;
+if(typeof (_332)=="string"||typeof (_332)=="number"){
+var args=m.extend([name,null],arguments,1);
+return arguments.callee.apply(this,args);
+}
+if(typeof (name)=="string"){
+var _337=self._xhtml;
+if(_332&&!self.attributeArray.compliant){
+var _338="";
+if("name" in _332){
+_338+=" name=\""+self.escapeHTML(_332.name)+"\"";
+}
+if(name=="input"&&"type" in _332){
+_338+=" type=\""+self.escapeHTML(_332.type)+"\"";
+}
+if(_338){
+name="<"+name+_338+">";
+_337=false;
+}
+}
+var d=self._document;
+if(_337&&d===document){
+elem=d.createElementNS("http://www.w3.org/1999/xhtml",name);
+}else{
+elem=d.createElement(name);
+}
+}else{
+elem=name;
+}
+if(_332){
+self.updateNodeAttributes(elem,_332);
+}
+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 e=MochiKit.DOM.getElement(elem);
+e.parentNode.removeChild(e);
+return e;
+},swapDOM:function(dest,src){
+var self=MochiKit.DOM;
+dest=self.getElement(dest);
+var _340=dest.parentNode;
+if(src){
+src=self.getElement(src);
+_340.replaceChild(src,dest);
+}else{
+_340.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(_343,_344,_345){
+var self=MochiKit.DOM;
+if(typeof (_343)=="undefined"||_343===null){
+_343="*";
+}
+if(typeof (_345)=="undefined"||_345===null){
+_345=self._document;
+}
+_345=self.getElement(_345);
+var _347=(_345.getElementsByTagName(_343)||self._document.all);
+if(typeof (_344)=="undefined"||_344===null){
+return MochiKit.Base.extend(null,_347);
+}
+var _348=[];
+for(var i=0;i<_347.length;i++){
+var _34a=_347[i];
+var cls=_34a.className;
+if(!cls){
+continue;
+}
+var _34c=cls.split(" ");
+for(var j=0;j<_34c.length;j++){
+if(_34c[j]==_344){
+_348.push(_34a);
+break;
+}
+}
+}
+return _348;
+},_newCallStack:function(path,once){
+var rval=function(){
+var _351=arguments.callee.callStack;
+for(var i=0;i<_351.length;i++){
+if(_351[i].apply(this,arguments)===false){
+break;
+}
+}
+if(once){
+try{
+this[path]=null;
+}
+catch(e){
+}
+}
+};
+rval.callStack=[];
+return rval;
+},addToCallStack:function(_353,path,func,once){
+var self=MochiKit.DOM;
+var _358=_353[path];
+var _359=_358;
+if(!(typeof (_358)=="function"&&typeof (_358.callStack)=="object"&&_358.callStack!==null)){
+_359=self._newCallStack(path,once);
+if(typeof (_358)=="function"){
+_359.callStack.push(_358);
+}
+_353[path]=_359;
+}
+_359.callStack.push(func);
+},addLoadEvent:function(func){
+var self=MochiKit.DOM;
+self.addToCallStack(self._window,"onload",func,true);
+},focusOnLoad:function(_35c){
+var self=MochiKit.DOM;
+self.addLoadEvent(function(){
+_35c=self.getElement(_35c);
+if(_35c){
+_35c.focus();
+}
+});
+},setElementClass:function(_35e,_35f){
+var self=MochiKit.DOM;
+var obj=self.getElement(_35e);
+if(self.attributeArray.compliant){
+obj.setAttribute("class",_35f);
+}else{
+obj.setAttribute("className",_35f);
+}
+},toggleElementClass:function(_362){
+var self=MochiKit.DOM;
+for(var i=1;i<arguments.length;i++){
+var obj=self.getElement(arguments[i]);
+if(!self.addElementClass(obj,_362)){
+self.removeElementClass(obj,_362);
+}
+}
+},addElementClass:function(_366,_367){
+var self=MochiKit.DOM;
+var obj=self.getElement(_366);
+var cls=obj.className;
+if(cls==undefined||cls.length===0){
+self.setElementClass(obj,_367);
+return true;
+}
+if(cls==_367){
+return false;
+}
+var _36b=cls.split(" ");
+for(var i=0;i<_36b.length;i++){
+if(_36b[i]==_367){
+return false;
+}
+}
+self.setElementClass(obj,cls+" "+_367);
+return true;
+},removeElementClass:function(_36d,_36e){
+var self=MochiKit.DOM;
+var obj=self.getElement(_36d);
+var cls=obj.className;
+if(cls==undefined||cls.length===0){
+return false;
+}
+if(cls==_36e){
+self.setElementClass(obj,"");
+return true;
+}
+var _372=cls.split(" ");
+for(var i=0;i<_372.length;i++){
+if(_372[i]==_36e){
+_372.splice(i,1);
+self.setElementClass(obj,_372.join(" "));
+return true;
+}
+}
+return false;
+},swapElementClass:function(_374,_375,_376){
+var obj=MochiKit.DOM.getElement(_374);
+var res=MochiKit.DOM.removeElementClass(obj,_375);
+if(res){
+MochiKit.DOM.addElementClass(obj,_376);
+}
+return res;
+},hasElementClass:function(_379,_37a){
+var obj=MochiKit.DOM.getElement(_379);
+var cls=obj.className;
+if(!cls){
+return false;
+}
+var _37d=cls.split(" ");
+for(var i=1;i<arguments.length;i++){
+var good=false;
+for(var j=0;j<_37d.length;j++){
+if(_37d[j]==arguments[i]){
+good=true;
+break;
+}
+}
+if(!good){
+return false;
+}
+}
+return true;
+},escapeHTML:function(s){
+return s.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");
+},toHTML:function(dom){
+return MochiKit.DOM.emitHTML(dom).join("");
+},emitHTML:function(dom,lst){
+if(typeof (lst)=="undefined"||lst===null){
+lst=[];
+}
+var _385=[dom];
+var self=MochiKit.DOM;
+var _387=self.escapeHTML;
+var _388=self.attributeArray;
+while(_385.length){
+dom=_385.pop();
+if(typeof (dom)=="string"){
+lst.push(dom);
+}else{
+if(dom.nodeType==1){
+lst.push("<"+dom.tagName.toLowerCase());
+var _389=[];
+var _38a=_388(dom);
+for(var i=0;i<_38a.length;i++){
+var a=_38a[i];
+_389.push([" ",a.name,"=\"",_387(a.value),"\""]);
+}
+_389.sort();
+for(i=0;i<_389.length;i++){
+var _38d=_389[i];
+for(var j=0;j<_38d.length;j++){
+lst.push(_38d[j]);
+}
+}
+if(dom.hasChildNodes()){
+lst.push(">");
+_385.push("</"+dom.tagName.toLowerCase()+">");
+var _38f=dom.childNodes;
+for(i=_38f.length-1;i>=0;i--){
+_385.push(_38f[i]);
+}
+}else{
+lst.push("/>");
+}
+}else{
+if(dom.nodeType==3){
+lst.push(_387(dom.nodeValue));
+}
+}
+}
+}
+return lst;
+},scrapeText:function(node,_391){
+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 _396=node.nodeValue;
+if(typeof (_396)=="string"){
+rval.push(_396);
+}
+})(MochiKit.DOM.getElement(node));
+if(_391){
+return rval;
+}else{
+return rval.join("");
+}
+},removeEmptyTextNodes:function(_397){
+_397=MochiKit.DOM.getElement(_397);
+for(var i=0;i<_397.childNodes.length;i++){
+var node=_397.childNodes[i];
+if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
+node.parentNode.removeChild(node);
+}
+}
+},makeClipping:function(_39a){
+_39a=MochiKit.DOM.getElement(_39a);
+var _39b=_39a.style.overflow;
+if((MochiKit.Style.getStyle(_39a,"overflow")||"visible")!="hidden"){
+_39a.style.overflow="hidden";
+}
+return _39b;
+},undoClipping:function(_39c,_39d){
+_39c=MochiKit.DOM.getElement(_39c);
+if(!_39d){
+return;
+}
+_39c.style.overflow=_39d;
+},makePositioned:function(_39e){
+_39e=MochiKit.DOM.getElement(_39e);
+var pos=MochiKit.Style.getStyle(_39e,"position");
+if(pos=="static"||!pos){
+_39e.style.position="relative";
+if(/Opera/.test(navigator.userAgent)){
+_39e.style.top=0;
+_39e.style.left=0;
+}
+}
+},undoPositioned:function(_3a0){
+_3a0=MochiKit.DOM.getElement(_3a0);
+if(_3a0.style.position=="relative"){
+_3a0.style.position=_3a0.style.top=_3a0.style.left=_3a0.style.bottom=_3a0.style.right="";
+}
+},getFirstElementByTagAndClassName:function(_3a1,_3a2,_3a3){
+var self=MochiKit.DOM;
+if(typeof (_3a1)=="undefined"||_3a1===null){
+_3a1="*";
+}
+if(typeof (_3a3)=="undefined"||_3a3===null){
+_3a3=self._document;
+}
+_3a3=self.getElement(_3a3);
+var _3a5=(_3a3.getElementsByTagName(_3a1)||self._document.all);
+if(typeof (_3a2)=="undefined"||_3a2===null){
+return _3a5[0];
+}
+for(var i=0;i<_3a5.length;i++){
+var _3a7=_3a5[i];
+var _3a8=_3a7.className.split(" ");
+for(var j=0;j<_3a8.length;j++){
+if(_3a8[j]==_3a2){
+return _3a7;
+}
+}
+}
+},getFirstParentByTagAndClassName:function(elem,_3ab,_3ac){
+var self=MochiKit.DOM;
+elem=self.getElement(elem);
+if(typeof (_3ab)=="undefined"||_3ab===null){
+_3ab="*";
+}else{
+_3ab=_3ab.toUpperCase();
+}
+if(typeof (_3ac)=="undefined"||_3ac===null){
+_3ac=null;
+}
+var _3ae="";
+var _3af="";
+while(elem&&elem.tagName){
+elem=elem.parentNode;
+if(_3ab=="*"&&_3ac===null){
+return elem;
+}
+_3ae=elem.className.split(" ");
+_3af=elem.tagName.toUpperCase();
+if(_3ac===null&&_3ab==_3af){
+return elem;
+}else{
+if(_3ac!==null){
+for(var i=0;i<_3ae.length;i++){
+if(_3ab=="*"&&_3ae[i]==_3ac){
+return elem;
+}else{
+if(_3ab==_3af&&_3ae[i]==_3ac){
+return elem;
+}
+}
+}
+}
+}
+}
+return elem;
+},isParent:function(_3b1,_3b2){
+if(!_3b1.parentNode||_3b1==_3b2){
+return false;
+}
+if(_3b1.parentNode==_3b2){
+return true;
+}
+return MochiKit.DOM.isParent(_3b1.parentNode,_3b2);
+},__new__:function(win){
+var m=MochiKit.Base;
+if(typeof (document)!="undefined"){
+this._document=document;
+var _3b5="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_3b5);
+}else{
+if(MochiKit.MockDOM){
+this._document=MochiKit.MockDOM.document;
+}
+}
+this._window=win;
+this.domConverters=new m.AdapterRegistry();
+var _3b6=this._document.createElement("span");
+var _3b7;
+if(_3b6&&_3b6.attributes&&_3b6.attributes.length>0){
+var _3b8=m.filter;
+_3b7=function(node){
+return _3b8(_3b7.ignoreAttrFilter,node.attributes);
+};
+_3b7.ignoreAttr={};
+var _3ba=_3b6.attributes;
+var _3bb=_3b7.ignoreAttr;
+for(var i=0;i<_3ba.length;i++){
+var a=_3ba[i];
+_3bb[a.name]=a.value;
+}
+_3b7.ignoreAttrFilter=function(a){
+return (_3b7.ignoreAttr[a.name]!=a.value);
+};
+_3b7.compliant=false;
+_3b7.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor","cellspacing":"cellSpacing","cellpadding":"cellPadding"};
+}else{
+_3b7=function(node){
+return node.attributes;
+};
+_3b7.compliant=true;
+_3b7.renames={};
+}
+this.attributeArray=_3b7;
+var _3c0=function(_3c1,arr){
+var _3c3=arr[1].split(".");
+var str="";
+var obj={};
+str+="if (!MochiKit."+_3c3[1]+") { throw new Error(\"";
+str+="This function has been deprecated and depends on MochiKit.";
+str+=_3c3[1]+".\");}";
+str+="return MochiKit."+_3c3[1]+"."+arr[0];
+str+=".apply(this, arguments);";
+obj[_3c3[2]]=new Function(str);
+MochiKit.Base.update(MochiKit[_3c1],obj);
+};
+for(var i;i<MochiKit.DOM.DEPRECATED.length;i++){
+_3c0("DOM",MochiKit.DOM.DEPRECATED[i]);
+}
+var _3c6=this.createDOMFunc;
+this.UL=_3c6("ul");
+this.OL=_3c6("ol");
+this.LI=_3c6("li");
+this.TD=_3c6("td");
+this.TR=_3c6("tr");
+this.TBODY=_3c6("tbody");
+this.THEAD=_3c6("thead");
+this.TFOOT=_3c6("tfoot");
+this.TABLE=_3c6("table");
+this.TH=_3c6("th");
+this.INPUT=_3c6("input");
+this.SPAN=_3c6("span");
+this.A=_3c6("a");
+this.DIV=_3c6("div");
+this.IMG=_3c6("img");
+this.BUTTON=_3c6("button");
+this.TT=_3c6("tt");
+this.PRE=_3c6("pre");
+this.H1=_3c6("h1");
+this.H2=_3c6("h2");
+this.H3=_3c6("h3");
+this.BR=_3c6("br");
+this.HR=_3c6("hr");
+this.LABEL=_3c6("label");
+this.TEXTAREA=_3c6("textarea");
+this.FORM=_3c6("form");
+this.P=_3c6("p");
+this.SELECT=_3c6("select");
+this.OPTION=_3c6("option");
+this.OPTGROUP=_3c6("optgroup");
+this.LEGEND=_3c6("legend");
+this.FIELDSET=_3c6("fieldset");
+this.STRONG=_3c6("strong");
+this.CANVAS=_3c6("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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Selector");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+dojo.require("MochiKit.Iter");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+JSAN.use("MochiKit.Iter",[]);
+}
+try{
+if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Iter)==="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Selector depends on MochiKit.Base, MochiKit.DOM and MochiKit.Iter!";
+}
+if(typeof (MochiKit.Selector)=="undefined"){
+MochiKit.Selector={};
+}
+MochiKit.Selector.NAME="MochiKit.Selector";
+MochiKit.Selector.VERSION="1.4";
+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(_3c7){
+this.params={classNames:[],pseudoClassNames:[]};
+this.expression=_3c7.toString().replace(/(^\s+|\s+$)/g,"");
+this.parseExpression();
+this.compileMatcher();
+};
+MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
+function abort(_3c8){
+throw "Parse error in selector: "+_3c8;
+}
+if(this.expression==""){
+abort("empty expression");
+}
+var repr=MochiKit.Base.repr;
+var _3ca=this.params;
+var expr=this.expression;
+var _3cc,_3cd,_3ce,rest;
+while(_3cc=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
+_3ca.attributes=_3ca.attributes||[];
+_3ca.attributes.push({name:_3cc[2],operator:_3cc[3],value:_3cc[4]||_3cc[5]||""});
+expr=_3cc[1];
+}
+if(expr=="*"){
+return this.params.wildcard=true;
+}
+while(_3cc=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
+_3cd=_3cc[1];
+_3ce=_3cc[2];
+rest=_3cc[3];
+switch(_3cd){
+case "#":
+_3ca.id=_3ce;
+break;
+case ".":
+_3ca.classNames.push(_3ce);
+break;
+case ":":
+_3ca.pseudoClassNames.push(_3ce);
+break;
+case "":
+case undefined:
+_3ca.tagName=_3ce.toUpperCase();
+break;
+default:
+abort(repr(expr));
+}
+expr=rest;
+}
+if(expr.length>0){
+abort(repr(expr));
+}
+},buildMatchExpression:function(){
+var repr=MochiKit.Base.repr;
+var _3d1=this.params;
+var _3d2=[];
+var _3d3,i;
+function childElements(_3d5){
+return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_3d5+".childNodes)";
+}
+if(_3d1.wildcard){
+_3d2.push("true");
+}
+if(_3d3=_3d1.id){
+_3d2.push("element.id == "+repr(_3d3));
+}
+if(_3d3=_3d1.tagName){
+_3d2.push("element.tagName.toUpperCase() == "+repr(_3d3));
+}
+if((_3d3=_3d1.classNames).length>0){
+for(i=0;i<_3d3.length;i++){
+_3d2.push("MochiKit.DOM.hasElementClass(element, "+repr(_3d3[i])+")");
+}
+}
+if((_3d3=_3d1.pseudoClassNames).length>0){
+for(i=0;i<_3d3.length;i++){
+var _3d6=_3d3[i].match(/^([^(]+)(?:\((.*)\))?$/);
+var _3d7=_3d6[1];
+var _3d8=_3d6[2];
+switch(_3d7){
+case "root":
+_3d2.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":
+_3d6=_3d8.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
+if(!_3d6){
+throw "Invalid argument to pseudo element nth-child: "+_3d8;
+}
+var a,b;
+if(_3d6[0]=="odd"){
+a=2;
+b=1;
+}else{
+if(_3d6[0]=="even"){
+a=2;
+b=0;
+}else{
+a=_3d6[2]&&parseInt(_3d6)||null;
+b=parseInt(_3d6[3]);
+}
+}
+_3d2.push("this.nthChild(element,"+a+","+b+","+!!_3d7.match("^nth-last")+","+!!_3d7.match("of-type$")+")");
+break;
+case "first-child":
+_3d2.push("this.nthChild(element, null, 1)");
+break;
+case "last-child":
+_3d2.push("this.nthChild(element, null, 1, true)");
+break;
+case "first-of-type":
+_3d2.push("this.nthChild(element, null, 1, false, true)");
+break;
+case "last-of-type":
+_3d2.push("this.nthChild(element, null, 1, true, true)");
+break;
+case "only-child":
+_3d2.push(childElements("element.parentNode")+".length == 1");
+break;
+case "only-of-type":
+_3d2.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1");
+break;
+case "empty":
+_3d2.push("element.childNodes.length == 0");
+break;
+case "enabled":
+_3d2.push("(this.isUIElement(element) && element.disabled === false)");
+break;
+case "disabled":
+_3d2.push("(this.isUIElement(element) && element.disabled === true)");
+break;
+case "checked":
+_3d2.push("(this.isUIElement(element) && element.checked === true)");
+break;
+case "not":
+var _3db=new MochiKit.Selector.Selector(_3d8);
+_3d2.push("!( "+_3db.buildMatchExpression()+")");
+break;
+}
+}
+}
+if(_3d3=_3d1.attributes){
+MochiKit.Base.map(function(_3dc){
+var _3dd="MochiKit.DOM.getNodeAttribute(element, "+repr(_3dc.name)+")";
+var _3de=function(_3df){
+return _3dd+".split("+repr(_3df)+")";
+};
+switch(_3dc.operator){
+case "=":
+_3d2.push(_3dd+" == "+repr(_3dc.value));
+break;
+case "~=":
+_3d2.push(_3dd+" && MochiKit.Base.findValue("+_3de(" ")+", "+repr(_3dc.value)+") > -1");
+break;
+case "^=":
+_3d2.push(_3dd+".substring(0, "+_3dc.value.length+") == "+repr(_3dc.value));
+break;
+case "$=":
+_3d2.push(_3dd+".substring("+_3dd+".length - "+_3dc.value.length+") == "+repr(_3dc.value));
+break;
+case "*=":
+_3d2.push(_3dd+".match("+repr(_3dc.value)+")");
+break;
+case "|=":
+_3d2.push(_3dd+" && "+_3de("-")+"[0].toUpperCase() == "+repr(_3dc.value.toUpperCase()));
+break;
+case "!=":
+_3d2.push(_3dd+" != "+repr(_3dc.value));
+break;
+case "":
+case undefined:
+_3d2.push(_3dd+" != null");
+break;
+default:
+throw "Unknown operator "+_3dc.operator+" in selector";
+}
+},_3d3);
+}
+return _3d2.join(" && ");
+},compileMatcher:function(){
+this.match=new Function("element","if (!element.tagName) return false; return "+this.buildMatchExpression());
+},nthChild:function(_3e0,a,b,_3e3,_3e4){
+var _3e5=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3e0.parentNode.childNodes);
+if(_3e4){
+_3e5=MochiKit.Base.filter(function(node){
+return node.tagName==_3e0.tagName;
+},_3e5);
+}
+if(_3e3){
+_3e5=MochiKit.Iter.reversed(_3e5);
+}
+if(a){
+var _3e8=MochiKit.Base.findIdentical(_3e5,_3e0);
+return ((_3e8+1-b)/a)%1==0;
+}else{
+return b==MochiKit.Base.findIdentical(_3e5,_3e0)+1;
+}
+},isUIElement:function(_3e9){
+return MochiKit.Base.findValue(["input","button","select","option","textarea","object"],_3e9.tagName.toLowerCase())>-1;
+},findElements:function(_3ea,axis){
+var _3ec;
+if(axis==undefined){
+axis="";
+}
+function inScope(_3ed,_3ee){
+if(axis==""){
+return MochiKit.DOM.isChildNode(_3ed,_3ee);
+}else{
+if(axis==">"){
+return _3ed.parentNode==_3ee;
+}else{
+if(axis=="+"){
+return _3ed==nextSiblingElement(_3ee);
+}else{
+if(axis=="~"){
+var _3ef=_3ee;
+while(_3ef=nextSiblingElement(_3ef)){
+if(_3ed==_3ef){
+return true;
+}
+}
+return false;
+}else{
+throw "Invalid axis: "+axis;
+}
+}
+}
+}
+}
+if(_3ec=MochiKit.DOM.getElement(this.params.id)){
+if(this.match(_3ec)){
+if(!_3ea||inScope(_3ec,_3ea)){
+return [_3ec];
+}
+}
+}
+function nextSiblingElement(node){
+node=node.nextSibling;
+while(node&&node.nodeType!=1){
+node=node.nextSibling;
+}
+return node;
+}
+if(axis==""){
+_3ea=(_3ea||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||"*");
+}else{
+if(axis==">"){
+if(!_3ea){
+throw "> combinator not allowed without preceeding expression";
+}
+_3ea=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3ea.childNodes);
+}else{
+if(axis=="+"){
+if(!_3ea){
+throw "+ combinator not allowed without preceeding expression";
+}
+_3ea=nextSiblingElement(_3ea)&&[nextSiblingElement(_3ea)];
+}else{
+if(axis=="~"){
+if(!_3ea){
+throw "~ combinator not allowed without preceeding expression";
+}
+var _3f2=[];
+while(nextSiblingElement(_3ea)){
+_3ea=nextSiblingElement(_3ea);
+_3f2.push(_3ea);
+}
+_3ea=_3f2;
+}
+}
+}
+}
+if(!_3ea){
+return [];
+}
+var _3f3=MochiKit.Base.filter(MochiKit.Base.bind(function(_3f4){
+return this.match(_3f4);
+},this),_3ea);
+return _3f3;
+},repr:function(){
+return "Selector("+this.expression+")";
+},toString:MochiKit.Base.forwardCall("repr")};
+MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_3f5,_3f6){
+return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_3f7){
+var _3f8="";
+return MochiKit.Iter.reduce(function(_3f9,expr){
+if(match=expr.match(/^[>+~]$/)){
+_3f8=match[0];
+return _3f9;
+}else{
+var _3fb=new MochiKit.Selector.Selector(expr);
+var _3fc=MochiKit.Iter.reduce(function(_3fd,_3fe){
+return MochiKit.Base.extend(_3fd,_3fb.findElements(_3fe||_3f5,_3f8));
+},_3f9,[]);
+_3f8="";
+return _3fc;
+}
+},_3f7.replace(/(^\s+|\s+$)/g,"").split(/\s+/),[null]);
+},_3f6));
+},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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Style");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Style depends on MochiKit.Base!";
+}
+try{
+if(typeof (MochiKit.DOM)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Style depends on MochiKit.DOM!";
+}
+if(typeof (MochiKit.Style)=="undefined"){
+MochiKit.Style={};
+}
+MochiKit.Style.NAME="MochiKit.Style";
+MochiKit.Style.VERSION="1.4";
+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","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,_407){
+var dom=MochiKit.DOM;
+var d=dom._document;
+elem=dom.getElement(elem);
+_407=MochiKit.Base.camelize(_407);
+if(!elem||elem==d){
+return undefined;
+}
+if(_407=="opacity"&&elem.filters){
+var _40a=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/);
+if(_40a&&_40a[1]){
+return parseFloat(_40a[1])/100;
+}
+return 1;
+}
+var _40b=elem.style?elem.style[_407]:null;
+if(!_40b){
+if(d.defaultView&&d.defaultView.getComputedStyle){
+var css=d.defaultView.getComputedStyle(elem,null);
+_407=_407.replace(/([A-Z])/g,"-$1").toLowerCase();
+_40b=css?css.getPropertyValue(_407):null;
+}else{
+if(elem.currentStyle){
+_40b=elem.currentStyle[_407];
+}
+}
+}
+if(_407=="opacity"){
+_40b=parseFloat(_40b);
+}
+if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.find(["left","top","right","bottom"],_407)!=-1)){
+if(MochiKit.Style.getStyle(elem,"position")=="static"){
+_40b="auto";
+}
+}
+return _40b=="auto"?null:_40b;
+},setStyle:function(elem,_40e){
+elem=MochiKit.DOM.getElement(elem);
+for(var name in _40e){
+if(name=="opacity"){
+MochiKit.Style.setOpacity(elem,_40e[name]);
+}else{
+elem.style[MochiKit.Base.camelize(name)]=_40e[name];
+}
+}
+},setOpacity:function(elem,o){
+elem=MochiKit.DOM.getElement(elem);
+var self=MochiKit.Style;
+if(o==1){
+var _413=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
+elem.style["opacity"]=_413?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,_415){
+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 _41a=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;
+_41a=elem.offsetParent;
+if(_41a!=elem){
+while(_41a){
+c.x+=_41a.offsetLeft;
+c.y+=_41a.offsetTop;
+_41a=_41a.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(typeof (_415)!="undefined"){
+_415=arguments.callee(_415);
+if(_415){
+c.x-=(_415.x||0);
+c.y-=(_415.y||0);
+}
+}
+if(elem.parentNode){
+_41a=elem.parentNode;
+}else{
+_41a=null;
+}
+while(_41a){
+var _41f=_41a.tagName.toUpperCase();
+if(_41f==="BODY"||_41f==="HTML"){
+break;
+}
+var disp=self.getStyle(_41a,"display");
+if(disp!="inline"&&disp!="table-row"){
+c.x-=_41a.scrollLeft;
+c.y-=_41a.scrollTop;
+}
+if(_41a.parentNode){
+_41a=_41a.parentNode;
+}else{
+_41a=null;
+}
+}
+return c;
+},setElementPosition:function(elem,_422,_423){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_423)=="undefined"){
+_423="px";
+}
+var _424={};
+var _425=MochiKit.Base.isUndefinedOrNull;
+if(!_425(_422.x)){
+_424["left"]=_422.x+_423;
+}
+if(!_425(_422.y)){
+_424["top"]=_422.y+_423;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{"style":_424});
+},getElementDimensions:function(elem){
+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"){
+return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0);
+}
+var s=elem.style;
+var _42b=s.visibility;
+var _42c=s.position;
+s.visibility="hidden";
+s.position="absolute";
+s.display="";
+var _42d=elem.offsetWidth;
+var _42e=elem.offsetHeight;
+s.display="none";
+s.position=_42c;
+s.visibility=_42b;
+return new self.Dimensions(_42d,_42e);
+},setElementDimensions:function(elem,_430,_431){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_431)=="undefined"){
+_431="px";
+}
+var _432={};
+var _433=MochiKit.Base.isUndefinedOrNull;
+if(!_433(_430.w)){
+_432["width"]=_430.w+_431;
+}
+if(!_433(_430.h)){
+_432["height"]=_430.h+_431;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{"style":_432});
+},setDisplayForElement:function(_434,_435){
+var _436=MochiKit.Base.extend(null,arguments,1);
+var _437=MochiKit.DOM.getElement;
+for(var i=0;i<_436.length;i++){
+_435=_437(_436[i]);
+if(_435){
+_435.style.display=_434;
+}
+}
+},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;
+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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.LoggingPane");
+dojo.require("MochiKit.Logging");
+dojo.require("MochiKit.Base");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Logging",[]);
+JSAN.use("MochiKit.Base",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Logging)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!";
+}
+if(typeof (MochiKit.LoggingPane)=="undefined"){
+MochiKit.LoggingPane={};
+}
+MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
+MochiKit.LoggingPane.VERSION="1.4";
+MochiKit.LoggingPane.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.LoggingPane.toString=function(){
+return this.__repr__();
+};
+MochiKit.LoggingPane.createLoggingPane=function(_441){
+var m=MochiKit.LoggingPane;
+_441=!(!_441);
+if(m._loggingPane&&m._loggingPane.inline!=_441){
+m._loggingPane.closePane();
+m._loggingPane=null;
+}
+if(!m._loggingPane||m._loggingPane.closed){
+m._loggingPane=new m.LoggingPane(_441,MochiKit.Logging.logger);
+}
+return m._loggingPane;
+};
+MochiKit.LoggingPane.LoggingPane=function(_443,_444){
+if(typeof (_444)=="undefined"||_444===null){
+_444=MochiKit.Logging.logger;
+}
+this.logger=_444;
+var _445=MochiKit.Base.update;
+var _446=MochiKit.Base.updatetree;
+var bind=MochiKit.Base.bind;
+var _448=MochiKit.Base.clone;
+var win=window;
+var uid="_MochiKit_LoggingPane";
+if(typeof (MochiKit.DOM)!="undefined"){
+win=MochiKit.DOM.currentWindow();
+}
+if(!_443){
+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 _44f=doc.getElementById(uid);
+var _450=!!_44f;
+if(_44f&&typeof (_44f.loggingPane)!="undefined"){
+_44f.loggingPane.logger=this.logger;
+_44f.loggingPane.buildAndApplyFilter();
+return _44f.loggingPane;
+}
+if(_450){
+var _451;
+while((_451=_44f.firstChild)){
+_44f.removeChild(_451);
+}
+}else{
+_44f=doc.createElement("div");
+_44f.id=uid;
+}
+_44f.loggingPane=this;
+var _452=doc.createElement("input");
+var _453=doc.createElement("input");
+var _454=doc.createElement("button");
+var _455=doc.createElement("button");
+var _456=doc.createElement("button");
+var _457=doc.createElement("button");
+var _458=doc.createElement("div");
+var _459=doc.createElement("div");
+var _45a=uid+"_Listener";
+this.colorTable=_448(this.colorTable);
+var _45b=[];
+var _45c=null;
+var _45d=function(msg){
+var _45f=msg.level;
+if(typeof (_45f)=="number"){
+_45f=MochiKit.Logging.LogLevel[_45f];
+}
+return _45f;
+};
+var _460=function(msg){
+return msg.info.join(" ");
+};
+var _462=bind(function(msg){
+var _464=_45d(msg);
+var text=_460(msg);
+var c=this.colorTable[_464];
+var p=doc.createElement("span");
+p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_464;
+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(_464+": "+text));
+_459.appendChild(p);
+_459.appendChild(doc.createElement("br"));
+if(_458.offsetHeight>_458.scrollHeight){
+_458.scrollTop=0;
+}else{
+_458.scrollTop=_458.scrollHeight;
+}
+},this);
+var _468=function(msg){
+_45b[_45b.length]=msg;
+_462(msg);
+};
+var _46a=function(){
+var _46b,_46c;
+try{
+_46b=new RegExp(_452.value);
+_46c=new RegExp(_453.value);
+}
+catch(e){
+logDebug("Error in filter regex: "+e.message);
+return null;
+}
+return function(msg){
+return (_46b.test(_45d(msg))&&_46c.test(_460(msg)));
+};
+};
+var _46e=function(){
+while(_459.firstChild){
+_459.removeChild(_459.firstChild);
+}
+};
+var _46f=function(){
+_45b=[];
+_46e();
+};
+var _470=bind(function(){
+if(this.closed){
+return;
+}
+this.closed=true;
+if(MochiKit.LoggingPane._loggingPane==this){
+MochiKit.LoggingPane._loggingPane=null;
+}
+this.logger.removeListener(_45a);
+try{
+try{
+_44f.loggingPane=null;
+}
+catch(e){
+logFatal("Bookmarklet was closed incorrectly.");
+}
+if(_443){
+_44f.parentNode.removeChild(_44f);
+}else{
+this.win.close();
+}
+}
+catch(e){
+}
+},this);
+var _471=function(){
+_46e();
+for(var i=0;i<_45b.length;i++){
+var msg=_45b[i];
+if(_45c===null||_45c(msg)){
+_462(msg);
+}
+}
+};
+this.buildAndApplyFilter=function(){
+_45c=_46a();
+_471();
+this.logger.removeListener(_45a);
+this.logger.addListener(_45a,_45c,_468);
+};
+var _474=bind(function(){
+_45b=this.logger.getMessages();
+_471();
+},this);
+var _475=bind(function(_476){
+_476=_476||window.event;
+key=_476.which||_476.keyCode;
+if(key==13){
+this.buildAndApplyFilter();
+}
+},this);
+var _477="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
+if(_443){
+_477+="; height: 10em; border-top: 2px solid black";
+}else{
+_477+="; height: 100%;";
+}
+_44f.style.cssText=_477;
+if(!_450){
+doc.body.appendChild(_44f);
+}
+_477={"cssText":"width: 33%; display: inline; font: "+this.logFont};
+_446(_452,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_475,"style":_477});
+_44f.appendChild(_452);
+_446(_453,{"value":".*","onkeypress":_475,"style":_477});
+_44f.appendChild(_453);
+_477="width: 8%; display:inline; font: "+this.logFont;
+_454.appendChild(doc.createTextNode("Filter"));
+_454.onclick=bind("buildAndApplyFilter",this);
+_454.style.cssText=_477;
+_44f.appendChild(_454);
+_455.appendChild(doc.createTextNode("Load"));
+_455.onclick=_474;
+_455.style.cssText=_477;
+_44f.appendChild(_455);
+_456.appendChild(doc.createTextNode("Clear"));
+_456.onclick=_46f;
+_456.style.cssText=_477;
+_44f.appendChild(_456);
+_457.appendChild(doc.createTextNode("Close"));
+_457.onclick=_470;
+_457.style.cssText=_477;
+_44f.appendChild(_457);
+_458.style.cssText="overflow: auto; width: 100%";
+_459.style.cssText="width: 100%; height: "+(_443?"8em":"100%");
+_458.appendChild(_459);
+_44f.appendChild(_458);
+this.buildAndApplyFilter();
+_474();
+if(_443){
+this.win=undefined;
+}else{
+this.win=win;
+}
+this.inline=_443;
+this.closePane=_470;
+this.closed=false;
+return this;
+};
+MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
+MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
+MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
+MochiKit.LoggingPane.__new__=function(){
+this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
+MochiKit.Base.nameFunctions(this);
+MochiKit.LoggingPane._loggingPane=null;
+};
+MochiKit.LoggingPane.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Color");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+dojo.require("MochiKit.Style");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+JSAN.use("MochiKit.Style",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Color depends on MochiKit.Base";
+}
+try{
+if(typeof (MochiKit.DOM)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Color depends on MochiKit.DOM";
+}
+try{
+if(typeof (MochiKit.Style)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Color depends on MochiKit.Style";
+}
+if(typeof (MochiKit.Color)=="undefined"){
+MochiKit.Color={};
+}
+MochiKit.Color.NAME="MochiKit.Color";
+MochiKit.Color.VERSION="1.4";
+MochiKit.Color.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Color.toString=function(){
+return this.__repr__();
+};
+MochiKit.Color.Color=function(red,_479,blue,_47b){
+if(typeof (_47b)=="undefined"||_47b===null){
+_47b=1;
+}
+this.rgb={r:red,g:_479,b:blue,a:_47b};
+};
+MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_47c){
+var rgb=this.rgb;
+var m=MochiKit.Color;
+return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_47c);
+},colorWithHue:function(hue){
+var hsl=this.asHSL();
+hsl.h=hue;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithSaturation:function(_482){
+var hsl=this.asHSL();
+hsl.s=_482;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithLightness:function(_485){
+var hsl=this.asHSL();
+hsl.l=_485;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},darkerColorWithLevel:function(_488){
+var hsl=this.asHSL();
+hsl.l=Math.max(hsl.l-_488,0);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},lighterColorWithLevel:function(_48b){
+var hsl=this.asHSL();
+hsl.l=Math.min(hsl.l+_48b,1);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},blendedColor:function(_48e,_48f){
+if(typeof (_48f)=="undefined"||_48f===null){
+_48f=0.5;
+}
+var sf=1-_48f;
+var s=this.rgb;
+var d=_48e.rgb;
+var df=_48f;
+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(_494){
+var a=this.asRGB();
+var b=_494.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,_4ab,blue,_4ad){
+var _4ae=MochiKit.Color.Color;
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_4ab=rgb.g;
+blue=rgb.b;
+if(typeof (rgb.a)=="undefined"){
+_4ad=undefined;
+}else{
+_4ad=rgb.a;
+}
+}
+return new _4ae(red,_4ab,blue,_4ad);
+},fromHSL:function(hue,_4b1,_4b2,_4b3){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
+},fromHSV:function(hue,_4b6,_4b7,_4b8){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
+},fromName:function(name){
+var _4bb=MochiKit.Color.Color;
+if(name.charAt(0)=="\""){
+name=name.substr(1,name.length-2);
+}
+var _4bc=_4bb._namedColors[name.toLowerCase()];
+if(typeof (_4bc)=="string"){
+return _4bb.fromHexString(_4bc);
+}else{
+if(name=="transparent"){
+return _4bb.transparentColor();
+}
+}
+return null;
+},fromString:function(_4bd){
+var self=MochiKit.Color.Color;
+var _4bf=_4bd.substr(0,3);
+if(_4bf=="rgb"){
+return self.fromRGBString(_4bd);
+}else{
+if(_4bf=="hsl"){
+return self.fromHSLString(_4bd);
+}else{
+if(_4bd.charAt(0)=="#"){
+return self.fromHexString(_4bd);
+}
+}
+}
+return self.fromName(_4bd);
+},fromHexString:function(_4c0){
+if(_4c0.charAt(0)=="#"){
+_4c0=_4c0.substring(1);
+}
+var _4c1=[];
+var i,hex;
+if(_4c0.length==3){
+for(i=0;i<3;i++){
+hex=_4c0.substr(i,1);
+_4c1.push(parseInt(hex+hex,16)/255);
+}
+}else{
+for(i=0;i<6;i+=2){
+hex=_4c0.substr(i,2);
+_4c1.push(parseInt(hex,16)/255);
+}
+}
+var _4c4=MochiKit.Color.Color;
+return _4c4.fromRGB.apply(_4c4,_4c1);
+},_fromColorString:function(pre,_4c6,_4c7,_4c8){
+if(_4c8.indexOf(pre)===0){
+_4c8=_4c8.substring(_4c8.indexOf("(",3)+1,_4c8.length-1);
+}
+var _4c9=_4c8.split(/\s*,\s*/);
+var _4ca=[];
+for(var i=0;i<_4c9.length;i++){
+var c=_4c9[i];
+var val;
+var _4ce=c.substring(c.length-3);
+if(c.charAt(c.length-1)=="%"){
+val=0.01*parseFloat(c.substring(0,c.length-1));
+}else{
+if(_4ce=="deg"){
+val=parseFloat(c)/360;
+}else{
+if(_4ce=="rad"){
+val=parseFloat(c)/(Math.PI*2);
+}else{
+val=_4c7[i]*parseFloat(c);
+}
+}
+}
+_4ca.push(val);
+}
+return this[_4c6].apply(this,_4ca);
+},fromComputedStyle:function(elem,_4d0){
+var d=MochiKit.DOM;
+var cls=MochiKit.Color.Color;
+for(elem=d.getElement(elem);elem;elem=elem.parentNode){
+var _4d3=MochiKit.Style.getStyle.apply(d,arguments);
+if(!_4d3){
+continue;
+}
+var _4d4=cls.fromString(_4d3);
+if(!_4d4){
+break;
+}
+if(_4d4.asRGB().a>0){
+return _4d4;
+}
+}
+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,_4da){
+v*=_4da;
+if(v<0){
+return 0;
+}else{
+if(v>_4da){
+return _4da;
+}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,_4e0,_4e1,_4e2){
+if(arguments.length==1){
+var hsv=hue;
+hue=hsv.h;
+_4e0=hsv.s;
+_4e1=hsv.v;
+_4e2=hsv.a;
+}
+var red;
+var _4e5;
+var blue;
+if(_4e0===0){
+red=_4e1;
+_4e5=_4e1;
+blue=_4e1;
+}else{
+var i=Math.floor(hue*6);
+var f=(hue*6)-i;
+var p=_4e1*(1-_4e0);
+var q=_4e1*(1-(_4e0*f));
+var t=_4e1*(1-(_4e0*(1-f)));
+switch(i){
+case 1:
+red=q;
+_4e5=_4e1;
+blue=p;
+break;
+case 2:
+red=p;
+_4e5=_4e1;
+blue=t;
+break;
+case 3:
+red=p;
+_4e5=q;
+blue=_4e1;
+break;
+case 4:
+red=t;
+_4e5=p;
+blue=_4e1;
+break;
+case 5:
+red=_4e1;
+_4e5=p;
+blue=q;
+break;
+case 6:
+case 0:
+red=_4e1;
+_4e5=t;
+blue=p;
+break;
+}
+}
+return {r:red,g:_4e5,b:blue,a:_4e2};
+},hslToRGB:function(hue,_4ed,_4ee,_4ef){
+if(arguments.length==1){
+var hsl=hue;
+hue=hsl.h;
+_4ed=hsl.s;
+_4ee=hsl.l;
+_4ef=hsl.a;
+}
+var red;
+var _4f2;
+var blue;
+if(_4ed===0){
+red=_4ee;
+_4f2=_4ee;
+blue=_4ee;
+}else{
+var m2;
+if(_4ee<=0.5){
+m2=_4ee*(1+_4ed);
+}else{
+m2=_4ee+_4ed-(_4ee*_4ed);
+}
+var m1=(2*_4ee)-m2;
+var f=MochiKit.Color._hslValue;
+var h6=hue*6;
+red=f(m1,m2,h6+2);
+_4f2=f(m1,m2,h6);
+blue=f(m1,m2,h6-2);
+}
+return {r:red,g:_4f2,b:blue,a:_4ef};
+},rgbToHSV:function(red,_4f9,blue,_4fb){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_4f9=rgb.g;
+blue=rgb.b;
+_4fb=rgb.a;
+}
+var max=Math.max(Math.max(red,_4f9),blue);
+var min=Math.min(Math.min(red,_4f9),blue);
+var hue;
+var _500;
+var _501=max;
+if(min==max){
+hue=0;
+_500=0;
+}else{
+var _502=(max-min);
+_500=_502/max;
+if(red==max){
+hue=(_4f9-blue)/_502;
+}else{
+if(_4f9==max){
+hue=2+((blue-red)/_502);
+}else{
+hue=4+((red-_4f9)/_502);
+}
+}
+hue/=6;
+if(hue<0){
+hue+=1;
+}
+if(hue>1){
+hue-=1;
+}
+}
+return {h:hue,s:_500,v:_501,a:_4fb};
+},rgbToHSL:function(red,_504,blue,_506){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_504=rgb.g;
+blue=rgb.b;
+_506=rgb.a;
+}
+var max=Math.max(red,Math.max(_504,blue));
+var min=Math.min(red,Math.min(_504,blue));
+var hue;
+var _50b;
+var _50c=(max+min)/2;
+var _50d=max-min;
+if(_50d===0){
+hue=0;
+_50b=0;
+}else{
+if(_50c<=0.5){
+_50b=_50d/(max+min);
+}else{
+_50b=_50d/(2-max-min);
+}
+if(red==max){
+hue=(_504-blue)/_50d;
+}else{
+if(_504==max){
+hue=2+((blue-red)/_50d);
+}else{
+hue=4+((red-_504)/_50d);
+}
+}
+hue/=6;
+if(hue<0){
+hue+=1;
+}
+if(hue>1){
+hue-=1;
+}
+}
+return {h:hue,s:_50b,l:_50c,a:_506};
+},toColorPart:function(num){
+num=Math.round(num);
+var _50f=num.toString(16);
+if(num<16){
+return "0"+_50f;
+}
+return _50f;
+},__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 _511=1/3;
+var _512={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_511,_511,_511],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_511,2*_511,2*_511],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 _513=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 _512){
+var name=k+"Color";
+var _51c=m.concat([_513,this.Color,name],_512[k]);
+this.Color[name]=m.bind.apply(null,_51c);
+}
+var _51d=function(){
+for(var i=0;i<arguments.length;i++){
+if(!(arguments[i] instanceof Color)){
+return false;
+}
+}
+return true;
+};
+var _51f=function(a,b){
+return a.compareRGB(b);
+};
+m.nameFunctions(this);
+m.registerComparator(this.Color.NAME,_51d,_51f);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+}});
+MochiKit.Color.EXPORT=["Color"];
+MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
+MochiKit.Color.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Color);
+MochiKit.Color.Color._namedColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Signal");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+dojo.require("MochiKit.Style");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+JSAN.use("MochiKit.Style",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Signal depends on MochiKit.Base!";
+}
+try{
+if(typeof (MochiKit.DOM)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Signal depends on MochiKit.DOM!";
+}
+try{
+if(typeof (MochiKit.Style)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Signal depends on MochiKit.Style!";
+}
+if(typeof (MochiKit.Signal)=="undefined"){
+MochiKit.Signal={};
+}
+MochiKit.Signal.NAME="MochiKit.Signal";
+MochiKit.Signal.VERSION="1.4";
+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"){
+str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}}";
+}else{
+str+="}";
+}
+}
+if(this.type()=="mouseover"||this.type()=="mouseout"){
+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(){
+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"){
+elem=(this._event.relatedTarget||this._event.fromElement);
+}else{
+if(this.type()=="mouseout"){
+elem=(this._event.relatedTarget||this._event.toElement);
+}
+}
+if(elem!==null){
+this._relatedTarget=elem;
+return elem;
+}
+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"){
+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);
+}
+}
+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 _52e=MochiKit.Signal._specialMacKeys;
+for(i=63236;i<=63242;i++){
+_52e[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 _52f=MochiKit.Signal._specialKeys;
+for(var i=48;i<=57;i++){
+_52f[i]="KEY_"+(i-48);
+}
+for(i=65;i<=90;i++){
+_52f[i]="KEY_"+String.fromCharCode(i);
+}
+for(i=96;i<=105;i++){
+_52f[i]="KEY_NUM_PAD_"+(i-96);
+}
+for(i=112;i<=123;i++){
+_52f[i]="KEY_F"+(i-112+1);
+}
+})();
+MochiKit.Signal.Ident=function(_531){
+this.source=_531.source;
+this.signal=_531.signal;
+this.listener=_531.listener;
+this.isDOM=_531.isDOM;
+this.objOrFunc=_531.objOrFunc;
+this.funcOrStr=_531.funcOrStr;
+this.connected=_531.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 _533=self._observers;
+for(var i=0;i<_533.length;i++){
+if(_533[i].signal!=="onload"&&_533[i].signal!=="onunload"){
+self._disconnect(_533[i]);
+}
+}
+},_listener:function(src,sig,func,obj,_539){
+var self=MochiKit.Signal;
+var E=self.Event;
+if(!_539){
+return MochiKit.Base.bind(func,obj);
+}
+obj=obj||src;
+if(typeof (func)=="string"){
+if(sig==="onload"||sig==="onunload"){
+return function(_53c){
+obj[func].apply(obj,[new E(src,_53c)]);
+var _53d=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
+MochiKit.Signal._disconnect(_53d);
+};
+}else{
+return function(_53e){
+obj[func].apply(obj,[new E(src,_53e)]);
+};
+}
+}else{
+if(sig==="onload"||sig==="onunload"){
+return function(_53f){
+func.apply(obj,[new E(src,_53f)]);
+MochiKit.Signal.disconnect(src,sig,func);
+var _540=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
+MochiKit.Signal._disconnect(_540);
+};
+}else{
+return function(_541){
+func.apply(obj,[new E(src,_541)]);
+};
+}
+}
+},_browserAlreadyHasMouseEnterAndLeave:function(){
+return /MSIE/.test(navigator.userAgent);
+},_mouseEnterListener:function(src,sig,func,obj){
+var E=MochiKit.Signal.Event;
+return function(_547){
+var e=new E(src,_547);
+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(_549,_54a){
+var obj=null;
+var func=null;
+if(typeof (_54a)!="undefined"){
+obj=_549;
+func=_54a;
+if(typeof (_54a)=="string"){
+if(typeof (_549[_54a])!="function"){
+throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
+}
+}else{
+if(typeof (_54a)!="function"){
+throw new Error("'funcOrStr' must be a function or string");
+}
+}
+}else{
+if(typeof (_549)!="function"){
+throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
+}else{
+func=_549;
+}
+}
+return [obj,func];
+},connect:function(src,sig,_54f,_550){
+src=MochiKit.DOM.getElement(src);
+var self=MochiKit.Signal;
+if(typeof (sig)!="string"){
+throw new Error("'sig' must be a string");
+}
+var _552=self._getDestPair(_54f,_550);
+var obj=_552[0];
+var func=_552[1];
+if(typeof (obj)=="undefined"||obj===null){
+obj=src;
+}
+var _555=!!(src.addEventListener||src.attachEvent);
+if(_555&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
+var _556=self._mouseEnterListener(src,sig.substr(2),func,obj);
+if(sig==="onmouseenter"){
+sig="onmouseover";
+}else{
+sig="onmouseout";
+}
+}else{
+var _556=self._listener(src,sig,func,obj,_555);
+}
+if(src.addEventListener){
+src.addEventListener(sig.substr(2),_556,false);
+}else{
+if(src.attachEvent){
+src.attachEvent(sig,_556);
+}
+}
+var _557=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_556,isDOM:_555,objOrFunc:_54f,funcOrStr:_550,connected:true});
+self._observers.push(_557);
+if(!_555&&typeof (src.__connect__)=="function"){
+var args=MochiKit.Base.extend([_557],arguments,1);
+src.__connect__.apply(src,args);
+}
+return _557;
+},_disconnect:function(_559){
+if(!_559.connected){
+return;
+}
+_559.connected=false;
+if(!_559.isDOM){
+return;
+}
+var src=_559.source;
+var sig=_559.signal;
+var _55c=_559.listener;
+if(src.removeEventListener){
+src.removeEventListener(sig.substr(2),_55c,false);
+}else{
+if(src.detachEvent){
+src.detachEvent(sig,_55c);
+}else{
+throw new Error("'src' must be a DOM element");
+}
+}
+},disconnect:function(_55d){
+var self=MochiKit.Signal;
+var _55f=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=_55f.length-1;i>=0;i--){
+var o=_55f[i];
+if(o.source===src&&o.signal===sig&&o.objOrFunc===obj&&o.funcOrStr===func){
+self._disconnect(o);
+if(!self._lock){
+_55f.splice(i,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+}else{
+var idx=m.findIdentical(_55f,_55d);
+if(idx>=0){
+self._disconnect(_55d);
+if(!self._lock){
+_55f.splice(idx,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+return false;
+},disconnectAllTo:function(_568,_569){
+var self=MochiKit.Signal;
+var _56b=self._observers;
+var _56c=self._disconnect;
+var _56d=self._lock;
+var _56e=self._dirty;
+if(typeof (_569)==="undefined"){
+_569=null;
+}
+for(var i=_56b.length-1;i>=0;i--){
+var _570=_56b[i];
+if(_570.objOrFunc===_568&&(_569===null||_570.funcOrStr===_569)){
+_56c(_570);
+if(_56d){
+_56e=true;
+}else{
+_56b.splice(i,1);
+}
+}
+}
+self._dirty=_56e;
+},disconnectAll:function(src,sig){
+src=MochiKit.DOM.getElement(src);
+var m=MochiKit.Base;
+var _574=m.flattenArguments(m.extend(null,arguments,1));
+var self=MochiKit.Signal;
+var _576=self._disconnect;
+var _577=self._observers;
+var i,_579;
+var _57a=self._lock;
+var _57b=self._dirty;
+if(_574.length===0){
+for(i=_577.length-1;i>=0;i--){
+_579=_577[i];
+if(_579.source===src){
+_576(_579);
+if(!_57a){
+_577.splice(i,1);
+}else{
+_57b=true;
+}
+}
+}
+}else{
+var sigs={};
+for(i=0;i<_574.length;i++){
+sigs[_574[i]]=true;
+}
+for(i=_577.length-1;i>=0;i--){
+_579=_577[i];
+if(_579.source===src&&_579.signal in sigs){
+_576(_579);
+if(!_57a){
+_577.splice(i,1);
+}else{
+_57b=true;
+}
+}
+}
+}
+self._dirty=_57b;
+},signal:function(src,sig){
+var self=MochiKit.Signal;
+var _580=self._observers;
+src=MochiKit.DOM.getElement(src);
+var args=MochiKit.Base.extend(null,arguments,2);
+var _582=[];
+self._lock=true;
+for(var i=0;i<_580.length;i++){
+var _584=_580[i];
+if(_584.source===src&&_584.signal===sig){
+try{
+_584.listener.apply(src,args);
+}
+catch(e){
+_582.push(e);
+}
+}
+}
+self._lock=false;
+if(self._dirty){
+self._dirty=false;
+for(var i=_580.length-1;i>=0;i--){
+if(!_580[i].connected){
+_580.splice(i,1);
+}
+}
+}
+if(_582.length==1){
+throw _582[0];
+}else{
+if(_582.length>1){
+var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
+e.errors=_582;
+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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Position");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+dojo.require("MochiKit.Style");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+JSAN.use("MochiKit.Style",[]);
+}
+try{
+if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Style)=="undefined"||typeof (MochiKit.DOM)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Style depends on MochiKit.Base, MochiKit.DOM, and MochiKit.Style!";
+}
+if(typeof (MochiKit.Position)=="undefined"){
+MochiKit.Position={};
+}
+MochiKit.Position.NAME="MochiKit.Position";
+MochiKit.Position.VERSION="1.4";
+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 _588=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
+var _589=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
+this.windowOffset=new MochiKit.Style.Coordinates(_588,_589);
+},cumulativeOffset:function(_58a){
+var _58b=0;
+var _58c=0;
+do{
+_58b+=_58a.offsetTop||0;
+_58c+=_58a.offsetLeft||0;
+_58a=_58a.offsetParent;
+}while(_58a);
+return new MochiKit.Style.Coordinates(_58c,_58b);
+},realOffset:function(_58d){
+var _58e=0;
+var _58f=0;
+do{
+_58e+=_58d.scrollTop||0;
+_58f+=_58d.scrollLeft||0;
+_58d=_58d.parentNode;
+}while(_58d);
+return new MochiKit.Style.Coordinates(_58f,_58e);
+},within:function(_590,x,y){
+if(this.includeScrollOffsets){
+return this.withinIncludingScrolloffsets(_590,x,y);
+}
+this.xcomp=x;
+this.ycomp=y;
+this.offset=this.cumulativeOffset(_590);
+if(_590.style.position=="fixed"){
+this.offset.x+=this.windowOffset.x;
+this.offset.y+=this.windowOffset.y;
+}
+return (y>=this.offset.y&&y<this.offset.y+_590.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_590.offsetWidth);
+},withinIncludingScrolloffsets:function(_593,x,y){
+var _596=this.realOffset(_593);
+this.xcomp=x+_596.x-this.windowOffset.x;
+this.ycomp=y+_596.y-this.windowOffset.y;
+this.offset=this.cumulativeOffset(_593);
+return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_593.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_593.offsetWidth);
+},overlap:function(mode,_598){
+if(!mode){
+return 0;
+}
+if(mode=="vertical"){
+return ((this.offset.y+_598.offsetHeight)-this.ycomp)/_598.offsetHeight;
+}
+if(mode=="horizontal"){
+return ((this.offset.x+_598.offsetWidth)-this.xcomp)/_598.offsetWidth;
+}
+},absolutize:function(_599){
+_599=MochiKit.DOM.getElement(_599);
+if(_599.style.position=="absolute"){
+return;
+}
+MochiKit.Position.prepare();
+var _59a=MochiKit.Position.positionedOffset(_599);
+var _59b=_599.clientWidth;
+var _59c=_599.clientHeight;
+var _59d={"position":_599.style.position,"left":_59a.x-parseFloat(_599.style.left||0),"top":_59a.y-parseFloat(_599.style.top||0),"width":_599.style.width,"height":_599.style.height};
+_599.style.position="absolute";
+_599.style.top=_59a.y+"px";
+_599.style.left=_59a.x+"px";
+_599.style.width=_59b+"px";
+_599.style.height=_59c+"px";
+return _59d;
+},positionedOffset:function(_59e){
+var _59f=0,_5a0=0;
+do{
+_59f+=_59e.offsetTop||0;
+_5a0+=_59e.offsetLeft||0;
+_59e=_59e.offsetParent;
+if(_59e){
+p=MochiKit.Style.getStyle(_59e,"position");
+if(p=="relative"||p=="absolute"){
+break;
+}
+}
+}while(_59e);
+return new MochiKit.Style.Coordinates(_5a0,_59f);
+},relativize:function(_5a1,_5a2){
+_5a1=MochiKit.DOM.getElement(_5a1);
+if(_5a1.style.position=="relative"){
+return;
+}
+MochiKit.Position.prepare();
+var top=parseFloat(_5a1.style.top||0)-(_5a2["top"]||0);
+var left=parseFloat(_5a1.style.left||0)-(_5a2["left"]||0);
+_5a1.style.position=_5a2["position"];
+_5a1.style.top=top+"px";
+_5a1.style.left=left+"px";
+_5a1.style.width=_5a2["width"];
+_5a1.style.height=_5a2["height"];
+},clone:function(_5a5,_5a6){
+_5a5=MochiKit.DOM.getElement(_5a5);
+_5a6=MochiKit.DOM.getElement(_5a6);
+_5a6.style.position="absolute";
+var _5a7=this.cumulativeOffset(_5a5);
+_5a6.style.top=_5a7.y+"px";
+_5a6.style.left=_5a7.x+"px";
+_5a6.style.width=_5a5.offsetWidth+"px";
+_5a6.style.height=_5a5.offsetHeight+"px";
+},page:function(_5a8){
+var _5a9=0;
+var _5aa=0;
+var _5ab=_5a8;
+do{
+_5a9+=_5ab.offsetTop||0;
+_5aa+=_5ab.offsetLeft||0;
+if(_5ab.offsetParent==document.body&&MochiKit.Style.getStyle(_5ab,"position")=="absolute"){
+break;
+}
+}while(_5ab=_5ab.offsetParent);
+_5ab=_5a8;
+do{
+_5a9-=_5ab.scrollTop||0;
+_5aa-=_5ab.scrollLeft||0;
+}while(_5ab=_5ab.parentNode);
+return new MochiKit.Style.Coordinates(_5aa,_5a9);
+}});
+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);
+if(typeof (dojo)!="undefined"){
+dojo.provide("MochiKit.Visual");
+dojo.require("MochiKit.Base");
+dojo.require("MochiKit.DOM");
+dojo.require("MochiKit.Style");
+dojo.require("MochiKit.Color");
+dojo.require("MochiKit.Position");
+}
+if(typeof (JSAN)!="undefined"){
+JSAN.use("MochiKit.Base",[]);
+JSAN.use("MochiKit.DOM",[]);
+JSAN.use("MochiKit.Style",[]);
+JSAN.use("MochiKit.Color",[]);
+JSAN.use("MochiKit.Position",[]);
+}
+try{
+if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Style)==="undefined"||typeof (MochiKit.Position)==="undefined"||typeof (MochiKit.Color)==="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style, MochiKit.Position and MochiKit.Color!";
+}
+if(typeof (MochiKit.Visual)=="undefined"){
+MochiKit.Visual={};
+}
+MochiKit.Visual.NAME="MochiKit.Visual";
+MochiKit.Visual.VERSION="1.4";
+MochiKit.Visual.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+MochiKit.Visual.toString=function(){
+return this.__repr__();
+};
+MochiKit.Visual._RoundCorners=function(e,_5af){
+e=MochiKit.DOM.getElement(e);
+this._setOptions(_5af);
+if(this.options.__unstable__wrapElement){
+e=this._doWrap(e);
+}
+var _5b0=this.options.color;
+var C=MochiKit.Color.Color;
+if(this.options.color==="fromElement"){
+_5b0=C.fromBackground(e);
+}else{
+if(!(_5b0 instanceof C)){
+_5b0=C.fromString(_5b0);
+}
+}
+this.isTransparent=(_5b0.asRGB().a<=0);
+var _5b2=this.options.bgColor;
+if(this.options.bgColor==="fromParent"){
+_5b2=C.fromBackground(e.offsetParent);
+}else{
+if(!(_5b2 instanceof C)){
+_5b2=C.fromString(_5b2);
+}
+}
+this._roundCornersImpl(e,_5b0,_5b2);
+};
+MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
+var _5b4=e.parentNode;
+var doc=MochiKit.DOM.currentDocument();
+if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
+return e;
+}
+var _5b6=doc.defaultView.getComputedStyle(e,null);
+if(typeof (_5b6)==="undefined"||_5b6===null){
+return e;
+}
+var _5b7=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_5b6.getPropertyValue("padding-top"),marginRight:_5b6.getPropertyValue("padding-right"),marginBottom:_5b6.getPropertyValue("padding-bottom"),marginLeft:_5b6.getPropertyValue("padding-left"),padding:"0px"}});
+_5b7.innerHTML=e.innerHTML;
+e.innerHTML="";
+e.appendChild(_5b7);
+return e;
+},_roundCornersImpl:function(e,_5b9,_5ba){
+if(this.options.border){
+this._renderBorder(e,_5ba);
+}
+if(this._isTopRounded()){
+this._roundTopCorners(e,_5b9,_5ba);
+}
+if(this._isBottomRounded()){
+this._roundBottomCorners(e,_5b9,_5ba);
+}
+},_renderBorder:function(el,_5bc){
+var _5bd="1px solid "+this._borderColor(_5bc);
+var _5be="border-left: "+_5bd;
+var _5bf="border-right: "+_5bd;
+var _5c0="style='"+_5be+";"+_5bf+"'";
+el.innerHTML="<div "+_5c0+">"+el.innerHTML+"</div>";
+},_roundTopCorners:function(el,_5c2,_5c3){
+var _5c4=this._createCorner(_5c3);
+for(var i=0;i<this.options.numSlices;i++){
+_5c4.appendChild(this._createCornerSlice(_5c2,_5c3,i,"top"));
+}
+el.style.paddingTop=0;
+el.insertBefore(_5c4,el.firstChild);
+},_roundBottomCorners:function(el,_5c7,_5c8){
+var _5c9=this._createCorner(_5c8);
+for(var i=(this.options.numSlices-1);i>=0;i--){
+_5c9.appendChild(this._createCornerSlice(_5c7,_5c8,i,"bottom"));
+}
+el.style.paddingBottom=0;
+el.appendChild(_5c9);
+},_createCorner:function(_5cb){
+var dom=MochiKit.DOM;
+return dom.DIV({style:{backgroundColor:_5cb.toString()}});
+},_createCornerSlice:function(_5cd,_5ce,n,_5d0){
+var _5d1=MochiKit.DOM.SPAN();
+var _5d2=_5d1.style;
+_5d2.backgroundColor=_5cd.toString();
+_5d2.display="block";
+_5d2.height="1px";
+_5d2.overflow="hidden";
+_5d2.fontSize="1px";
+var _5d3=this._borderColor(_5cd,_5ce);
+if(this.options.border&&n===0){
+_5d2.borderTopStyle="solid";
+_5d2.borderTopWidth="1px";
+_5d2.borderLeftWidth="0px";
+_5d2.borderRightWidth="0px";
+_5d2.borderBottomWidth="0px";
+_5d2.height="0px";
+_5d2.borderColor=_5d3.toString();
+}else{
+if(_5d3){
+_5d2.borderColor=_5d3.toString();
+_5d2.borderStyle="solid";
+_5d2.borderWidth="0px 1px";
+}
+}
+if(!this.options.compact&&(n==(this.options.numSlices-1))){
+_5d2.height="2px";
+}
+this._setMargin(_5d1,n,_5d0);
+this._setBorder(_5d1,n,_5d0);
+return _5d1;
+},_setOptions:function(_5d4){
+this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
+MochiKit.Base.update(this.options,_5d4);
+this.options.numSlices=(this.options.compact?2:4);
+},_whichSideTop:function(){
+var _5d5=this.options.corners;
+if(this._hasString(_5d5,"all","top")){
+return "";
+}
+var _5d6=(_5d5.indexOf("tl")!=-1);
+var _5d7=(_5d5.indexOf("tr")!=-1);
+if(_5d6&&_5d7){
+return "";
+}
+if(_5d6){
+return "left";
+}
+if(_5d7){
+return "right";
+}
+return "";
+},_whichSideBottom:function(){
+var _5d8=this.options.corners;
+if(this._hasString(_5d8,"all","bottom")){
+return "";
+}
+var _5d9=(_5d8.indexOf("bl")!=-1);
+var _5da=(_5d8.indexOf("br")!=-1);
+if(_5d9&&_5da){
+return "";
+}
+if(_5d9){
+return "left";
+}
+if(_5da){
+return "right";
+}
+return "";
+},_borderColor:function(_5db,_5dc){
+if(_5db=="transparent"){
+return _5dc;
+}else{
+if(this.options.border){
+return this.options.border;
+}else{
+if(this.options.blend){
+return _5dc.blendedColor(_5db);
+}
+}
+}
+return "";
+},_setMargin:function(el,n,_5df){
+var _5e0=this._marginSize(n)+"px";
+var _5e1=(_5df=="top"?this._whichSideTop():this._whichSideBottom());
+var _5e2=el.style;
+if(_5e1=="left"){
+_5e2.marginLeft=_5e0;
+_5e2.marginRight="0px";
+}else{
+if(_5e1=="right"){
+_5e2.marginRight=_5e0;
+_5e2.marginLeft="0px";
+}else{
+_5e2.marginLeft=_5e0;
+_5e2.marginRight=_5e0;
+}
+}
+},_setBorder:function(el,n,_5e5){
+var _5e6=this._borderSize(n)+"px";
+var _5e7=(_5e5=="top"?this._whichSideTop():this._whichSideBottom());
+var _5e8=el.style;
+if(_5e7=="left"){
+_5e8.borderLeftWidth=_5e6;
+_5e8.borderRightWidth="0px";
+}else{
+if(_5e7=="right"){
+_5e8.borderRightWidth=_5e6;
+_5e8.borderLeftWidth="0px";
+}else{
+_5e8.borderLeftWidth=_5e6;
+_5e8.borderRightWidth=_5e6;
+}
+}
+},_marginSize:function(n){
+if(this.isTransparent){
+return 0;
+}
+var o=this.options;
+if(o.compact&&o.blend){
+var _5eb=[1,0];
+return _5eb[n];
+}else{
+if(o.compact){
+var _5ec=[2,1];
+return _5ec[n];
+}else{
+if(o.blend){
+var _5ed=[3,2,1,0];
+return _5ed[n];
+}else{
+var _5ee=[5,3,2,1];
+return _5ee[n];
+}
+}
+}
+},_borderSize:function(n){
+var o=this.options;
+var _5f1;
+if(o.compact&&(o.blend||this.isTransparent)){
+return 1;
+}else{
+if(o.compact){
+_5f1=[1,0];
+}else{
+if(o.blend){
+_5f1=[2,1,1,1];
+}else{
+if(o.border){
+_5f1=[0,2,0,0];
+}else{
+if(this.isTransparent){
+_5f1=[5,3,2,1];
+}else{
+return 0;
+}
+}
+}
+}
+}
+return _5f1[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,_5f6){
+new MochiKit.Visual._RoundCorners(e,_5f6);
+};
+MochiKit.Visual.roundClass=function(_5f7,_5f8,_5f9){
+var _5fa=MochiKit.DOM.getElementsByTagAndClassName(_5f7,_5f8);
+for(var i=0;i<_5fa.length;i++){
+MochiKit.Visual.roundElement(_5fa[i],_5f9);
+}
+};
+MochiKit.Visual.tagifyText=function(_5fc,_5fd){
+_5fd=_5fd||"position:relative";
+if(/MSIE/.test(navigator.userAgent)){
+_5fd+=";zoom:1";
+}
+_5fc=MochiKit.DOM.getElement(_5fc);
+var ma=MochiKit.Base.map;
+ma(function(_5ff){
+if(_5ff.nodeType==3){
+ma(function(_600){
+_5fc.insertBefore(MochiKit.DOM.SPAN({style:_5fd},_600==" "?String.fromCharCode(160):_600),_5ff);
+},_5ff.nodeValue.split(""));
+MochiKit.DOM.removeElement(_5ff);
+}
+},_5fc.childNodes);
+};
+MochiKit.Visual.forceRerendering=function(_601){
+try{
+_601=MochiKit.DOM.getElement(_601);
+var n=document.createTextNode(" ");
+_601.appendChild(n);
+_601.removeChild(n);
+}
+catch(e){
+}
+};
+MochiKit.Visual.multiple=function(_603,_604,_605){
+_605=MochiKit.Base.update({speed:0.1,delay:0},_605||{});
+var _606=_605.delay;
+var _607=0;
+MochiKit.Base.map(function(_608){
+_605.delay=_607*_605.speed+_606;
+new _604(_608,_605);
+_607+=1;
+},_603);
+};
+MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
+MochiKit.Visual.toggle=function(_609,_60a,_60b){
+_609=MochiKit.DOM.getElement(_609);
+_60a=(_60a||"appear").toLowerCase();
+_60b=MochiKit.Base.update({queue:{position:"end",scope:(_609.id||"global"),limit:1}},_60b||{});
+var v=MochiKit.Visual;
+v[_609.style.display!="none"?v.PAIRS[_60a][1]:v.PAIRS[_60a][0]](_609,_60b);
+};
+MochiKit.Visual.Transitions={};
+MochiKit.Visual.Transitions.linear=function(pos){
+return pos;
+};
+MochiKit.Visual.Transitions.sinoidal=function(pos){
+return (-Math.cos(pos*Math.PI)/2)+0.5;
+};
+MochiKit.Visual.Transitions.reverse=function(pos){
+return 1-pos;
+};
+MochiKit.Visual.Transitions.flicker=function(pos){
+return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
+};
+MochiKit.Visual.Transitions.wobble=function(pos){
+return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
+};
+MochiKit.Visual.Transitions.pulse=function(pos,_613){
+if(!_613){
+return (Math.floor(pos*10)%2===0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
+}
+return (Math.round((pos%(1/_613))*_613)==0?((pos*_613*2)-Math.floor(pos*_613*2)):1-((pos*_613*2)-Math.floor(pos*_613*2)));
+};
+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(_617){
+var _618=new Date().getTime();
+var _619=(typeof (_617.options.queue)=="string")?_617.options.queue:_617.options.queue.position;
+var ma=MochiKit.Base.map;
+switch(_619){
+case "front":
+ma(function(e){
+if(e.state=="idle"){
+e.startOn+=_617.finishOn;
+e.finishOn+=_617.finishOn;
+}
+},this.effects);
+break;
+case "end":
+var _61c;
+ma(function(e){
+var i=e.finishOn;
+if(i>=(_61c||i)){
+_61c=i;
+}
+},this.effects);
+_618=_61c||_618;
+break;
+case "break":
+ma(function(e){
+e.finalize();
+},this.effects);
+break;
+}
+_617.startOn+=_618;
+_617.finishOn+=_618;
+if(!_617.options.queue.limit||this.effects.length<_617.options.queue.limit){
+this.effects.push(_617);
+}
+if(!this.interval){
+this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
+}
+},startLoop:function(func,_621){
+return setInterval(func,_621);
+},remove:function(_622){
+this.effects=MochiKit.Base.filter(function(e){
+return e!=_622;
+},this.effects);
+if(!this.effects.length){
+this.stopLoop(this.interval);
+this.interval=null;
+}
+},stopLoop:function(_624){
+clearInterval(_624);
+},loop:function(){
+var _625=new Date().getTime();
+MochiKit.Base.map(function(_626){
+_626.loop(_625);
+},this.effects);
+}});
+MochiKit.Visual.Queues={instances:{},get:function(_627){
+if(typeof (_627)!="string"){
+return _627;
+}
+if(!this.instances[_627]){
+this.instances[_627]=new MochiKit.Visual.ScopedQueue();
+}
+return this.instances[_627];
+}};
+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(_628){
+var v=MochiKit.Visual;
+this.options=MochiKit.Base.setdefault(_628||{},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(_62a){
+if(_62a>=this.startOn){
+if(_62a>=this.finishOn){
+return this.finalize();
+}
+var pos=(_62a-this.startOn)/(this.finishOn-this.startOn);
+var _62c=Math.round(pos*this.options.fps*this.options.duration);
+if(_62c>this.currentFrame){
+this.render(pos);
+this.currentFrame=_62c;
+}
+}
+},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(_62e){
+},event:function(_62f){
+if(this.options[_62f+"Internal"]){
+this.options[_62f+"Internal"](this);
+}
+if(this.options[_62f]){
+this.options[_62f](this);
+}
+},repr:function(){
+return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
+}};
+MochiKit.Visual.Parallel=function(_630,_631){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_630,_631);
+}
+this.__init__(_630,_631);
+};
+MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_633,_634){
+this.effects=_633||[];
+this.start(_634);
+},update:function(_635){
+MochiKit.Base.map(function(_636){
+_636.render(_635);
+},this.effects);
+},finish:function(){
+MochiKit.Base.map(function(_637){
+_637.finalize();
+},this.effects);
+}});
+MochiKit.Visual.Opacity=function(_638,_639){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_638,_639);
+}
+this.__init__(_638,_639);
+};
+MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_63b,_63c){
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+this.element=MochiKit.DOM.getElement(_63b);
+if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
+s.setStyle(this.element,{zoom:1});
+}
+_63c=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_63c||{});
+this.start(_63c);
+},update:function(_63f){
+MochiKit.Style.setStyle(this.element,{"opacity":_63f});
+}});
+MochiKit.Visual.Move=function(_640,_641){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_640,_641);
+}
+this.__init__(_640,_641);
+};
+MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_643,_644){
+this.element=MochiKit.DOM.getElement(_643);
+_644=MochiKit.Base.update({x:0,y:0,mode:"relative"},_644||{});
+this.start(_644);
+},setup:function(){
+MochiKit.DOM.makePositioned(this.element);
+var s=this.element.style;
+var _646=s.visibility;
+var _647=s.display;
+if(_647=="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(_647=="none"){
+s.visibility=_646;
+s.display=_647;
+}
+},update:function(_648){
+MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_648+this.originalLeft)+"px",top:Math.round(this.options.y*_648+this.originalTop)+"px"});
+}});
+MochiKit.Visual.Scale=function(_649,_64a,_64b){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_649,_64a,_64b);
+}
+this.__init__(_649,_64a,_64b);
+};
+MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_64d,_64e,_64f){
+this.element=MochiKit.DOM.getElement(_64d);
+_64f=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_64e},_64f||{});
+this.start(_64f);
+},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 _653=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
+ma(b(function(_654){
+if(_653.indexOf(_654)>0){
+this.fontSize=parseFloat(_653);
+this.fontSizeType=_654;
+}
+},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(_655){
+var _656=(this.options.scaleFrom/100)+(this.factor*_655);
+if(this.options.scaleContent&&this.fontSize){
+MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_656+this.fontSizeType});
+}
+this.setDimensions(this.dims[0]*_656,this.dims[1]*_656);
+},finish:function(){
+if(this.restoreAfterFinish){
+MochiKit.Style.setStyle(this.element,this.originalStyle);
+}
+},setDimensions:function(_657,_658){
+var d={};
+var r=Math.round;
+if(/MSIE/.test(navigator.userAgent)){
+r=Math.ceil;
+}
+if(this.options.scaleX){
+d.width=r(_658)+"px";
+}
+if(this.options.scaleY){
+d.height=r(_657)+"px";
+}
+if(this.options.scaleFromCenter){
+var topd=(_657-this.dims[0])/2;
+var _65c=(_658-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-_65c+"px";
+}
+}else{
+if(this.options.scaleY){
+d.top=-topd+"px";
+}
+if(this.options.scaleX){
+d.left=-_65c+"px";
+}
+}
+}
+MochiKit.Style.setStyle(this.element,d);
+}});
+MochiKit.Visual.Highlight=function(_65d,_65e){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_65d,_65e);
+}
+this.__init__(_65d,_65e);
+};
+MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_660,_661){
+this.element=MochiKit.DOM.getElement(_660);
+_661=MochiKit.Base.update({startcolor:"#ffff99"},_661||{});
+this.start(_661);
+},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(_666){
+var m="#";
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_666));
+},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(_669,_66a){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_669,_66a);
+}
+this.__init__(_669,_66a);
+};
+MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_66c,_66d){
+this.element=MochiKit.DOM.getElement(_66c);
+this.start(_66d||{});
+},setup:function(){
+var p=MochiKit.Position;
+p.prepare();
+var _66f=p.cumulativeOffset(this.element);
+if(this.options.offset){
+_66f.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=(_66f.y>max?max:_66f.y)-this.scrollStart;
+},update:function(_671){
+var p=MochiKit.Position;
+p.prepare();
+window.scrollTo(p.windowOffset.x,this.scrollStart+(_671*this.delta));
+}});
+MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+MochiKit.Visual.Morph=function(_673,_674){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_673,_674);
+}
+this.__init__(_673,_674);
+};
+MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_676,_677){
+this.element=MochiKit.DOM.getElement(_676);
+this.start(_677||{});
+},setup:function(){
+var b=MochiKit.Base;
+var _679=this.options.style;
+this.styleStart={};
+this.styleEnd={};
+this.units={};
+var _67a,unit;
+for(var s in _679){
+_67a=_679[s];
+s=b.camelize(s);
+if(MochiKit.Visual.CSS_LENGTH.test(_67a)){
+var _67d=_67a.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_67a=parseFloat(_67d[1]);
+unit=(_67d.length==3)?_67d[2]:null;
+this.styleEnd[s]=_67a;
+this.units[s]=unit;
+_67a=MochiKit.Style.getStyle(this.element,s);
+_67d=_67a.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_67a=parseFloat(_67d[1]);
+this.styleStart[s]=_67a;
+}else{
+var c=MochiKit.Color.Color;
+_67a=c.fromString(_67a);
+if(_67a){
+this.units[s]="color";
+this.styleEnd[s]=_67a.toHexString();
+_67a=MochiKit.Style.getStyle(this.element,s);
+this.styleStart[s]=c.fromString(_67a).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]);
+}
+}
+}
+},update:function(_681){
+var _682;
+for(var s in this.styleStart){
+if(this.units[s]=="color"){
+var m="#";
+var _685=this.styleStart[s];
+var end=this.styleEnd[s];
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(_685[i]+(end[i]-_685[i])*_681));
+},this),[0,1,2]);
+this.element.style[s]=m;
+}else{
+_682=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_681*1000)/1000+this.units[s];
+this.element.style[s]=_682;
+}
+}
+}});
+MochiKit.Visual.fade=function(_688,_689){
+var s=MochiKit.Style;
+var _68b=s.getStyle(_688,"opacity");
+_689=MochiKit.Base.update({from:s.getStyle(_688,"opacity")||1,to:0,afterFinishInternal:function(_68c){
+if(_68c.options.to!==0){
+return;
+}
+s.hideElement(_68c.element);
+s.setStyle(_68c.element,{"opacity":_68b});
+}},_689||{});
+return new MochiKit.Visual.Opacity(_688,_689);
+};
+MochiKit.Visual.appear=function(_68d,_68e){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_68e=MochiKit.Base.update({from:(s.getStyle(_68d,"display")=="none"?0:s.getStyle(_68d,"opacity")||0),to:1,afterFinishInternal:function(_691){
+v.forceRerendering(_691.element);
+},beforeSetupInternal:function(_692){
+s.setStyle(_692.element,{"opacity":_692.options.from});
+s.showElement(_692.element);
+}},_68e||{});
+return new v.Opacity(_68d,_68e);
+};
+MochiKit.Visual.puff=function(_693,_694){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_693=MochiKit.DOM.getElement(_693);
+var _697={position:s.getStyle(_693,"position"),top:_693.style.top,left:_693.style.left,width:_693.style.width,height:_693.style.height,opacity:s.getStyle(_693,"opacity")};
+_694=MochiKit.Base.update({beforeSetupInternal:function(_698){
+MochiKit.Position.absolutize(_698.effects[0].element);
+},afterFinishInternal:function(_699){
+s.hideElement(_699.effects[0].element);
+s.setStyle(_699.effects[0].element,_697);
+},scaleContent:true,scaleFromCenter:true},_694||{});
+return new v.Parallel([new v.Scale(_693,200,{sync:true,scaleFromCenter:_694.scaleFromCenter,scaleContent:_694.scaleContent,restoreAfterFinish:true}),new v.Opacity(_693,{sync:true,to:0})],_694);
+};
+MochiKit.Visual.blindUp=function(_69a,_69b){
+var d=MochiKit.DOM;
+_69a=d.getElement(_69a);
+var _69d=d.makeClipping(_69a);
+_69b=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_69e){
+MochiKit.Style.hideElement(_69e.element);
+d.undoClipping(_69e.element,_69d);
+}},_69b||{});
+return new MochiKit.Visual.Scale(_69a,0,_69b);
+};
+MochiKit.Visual.blindDown=function(_69f,_6a0){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_69f=d.getElement(_69f);
+var _6a3=s.getElementDimensions(_69f);
+var _6a4;
+_6a0=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6a3.h,originalWidth:_6a3.w},restoreAfterFinish:true,afterSetupInternal:function(_6a5){
+_6a4=d.makeClipping(_6a5.element);
+s.setStyle(_6a5.element,{height:"0px"});
+s.showElement(_6a5.element);
+},afterFinishInternal:function(_6a6){
+d.undoClipping(_6a6.element,_6a4);
+}},_6a0||{});
+return new MochiKit.Visual.Scale(_69f,100,_6a0);
+};
+MochiKit.Visual.switchOff=function(_6a7,_6a8){
+var d=MochiKit.DOM;
+_6a7=d.getElement(_6a7);
+var _6aa=MochiKit.Style.getStyle(_6a7,"opacity");
+var _6ab;
+_6a8=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6ac){
+d.makePositioned(_6ac.element);
+_6ab=d.makeClipping(_6ac.element);
+},afterFinishInternal:function(_6ad){
+MochiKit.Style.hideElement(_6ad.element);
+d.undoClipping(_6ad.element,_6ab);
+d.undoPositioned(_6ad.element);
+MochiKit.Style.setStyle(_6ad.element,{"opacity":_6aa});
+}},_6a8||{});
+var v=MochiKit.Visual;
+return new v.appear(_6a7,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6af){
+new v.Scale(_6af.element,1,_6a8);
+}});
+};
+MochiKit.Visual.dropOut=function(_6b0,_6b1){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6b0=d.getElement(_6b0);
+var _6b4={top:s.getStyle(_6b0,"top"),left:s.getStyle(_6b0,"left"),opacity:s.getStyle(_6b0,"opacity")};
+_6b1=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6b5){
+d.makePositioned(_6b5.effects[0].element);
+},afterFinishInternal:function(_6b6){
+s.hideElement(_6b6.effects[0].element);
+d.undoPositioned(_6b6.effects[0].element);
+s.setStyle(_6b6.effects[0].element,_6b4);
+}},_6b1||{});
+var v=MochiKit.Visual;
+return new v.Parallel([new v.Move(_6b0,{x:0,y:_6b1.distance,sync:true}),new v.Opacity(_6b0,{sync:true,to:0})],_6b1);
+};
+MochiKit.Visual.shake=function(_6b8,_6b9){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6b8=d.getElement(_6b8);
+_6b9=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6bd){
+d.undoPositioned(_6bd.element);
+s.setStyle(_6bd.element,_6be);
+}},_6b9||{});
+var _6be={top:s.getStyle(_6b8,"top"),left:s.getStyle(_6b8,"left")};
+return new v.Move(_6b8,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6bf){
+new v.Move(_6bf.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c0){
+new v.Move(_6c0.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c1){
+new v.Move(_6c1.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c2){
+new v.Move(_6c2.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c3){
+new v.Move(_6c3.element,_6b9);
+}});
+}});
+}});
+}});
+}});
+};
+MochiKit.Visual.slideDown=function(_6c4,_6c5){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_6c4=d.getElement(_6c4);
+if(!_6c4.firstChild){
+throw "MochiKit.Visual.slideDown must be used on a element with a child";
+}
+d.removeEmptyTextNodes(_6c4);
+var _6c9=s.getStyle(_6c4.firstChild,"bottom")||0;
+var _6ca=s.getElementDimensions(_6c4);
+var _6cb;
+_6c5=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ca.h,originalWidth:_6ca.w},restoreAfterFinish:true,afterSetupInternal:function(_6cc){
+d.makePositioned(_6cc.element);
+d.makePositioned(_6cc.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_6cc.element,{top:""});
+}
+_6cb=d.makeClipping(_6cc.element);
+s.setStyle(_6cc.element,{height:"0px"});
+s.showElement(_6cc.element);
+},afterUpdateInternal:function(_6cd){
+s.setStyle(_6cd.element.firstChild,{bottom:(_6cd.dims[0]-_6cd.element.clientHeight)+"px"});
+},afterFinishInternal:function(_6ce){
+d.undoClipping(_6ce.element,_6cb);
+if(/MSIE/.test(navigator.userAgent)){
+d.undoPositioned(_6ce.element);
+d.undoPositioned(_6ce.element.firstChild);
+}else{
+d.undoPositioned(_6ce.element.firstChild);
+d.undoPositioned(_6ce.element);
+}
+s.setStyle(_6ce.element.firstChild,{bottom:_6c9});
+}},_6c5||{});
+return new MochiKit.Visual.Scale(_6c4,100,_6c5);
+};
+MochiKit.Visual.slideUp=function(_6cf,_6d0){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_6cf=d.getElement(_6cf);
+if(!_6cf.firstChild){
+throw "MochiKit.Visual.slideUp must be used on a element with a child";
+}
+d.removeEmptyTextNodes(_6cf);
+var _6d4=s.getStyle(_6cf.firstChild,"bottom");
+var _6d5;
+_6d0=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6d6){
+d.makePositioned(_6d6.element);
+d.makePositioned(_6d6.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_6d6.element,{top:""});
+}
+_6d5=d.makeClipping(_6d6.element);
+s.showElement(_6d6.element);
+},afterUpdateInternal:function(_6d7){
+s.setStyle(_6d7.element.firstChild,{bottom:(_6d7.dims[0]-_6d7.element.clientHeight)+"px"});
+},afterFinishInternal:function(_6d8){
+s.hideElement(_6d8.element);
+d.undoClipping(_6d8.element,_6d5);
+d.undoPositioned(_6d8.element.firstChild);
+d.undoPositioned(_6d8.element);
+s.setStyle(_6d8.element.firstChild,{bottom:_6d4});
+}},_6d0||{});
+return new MochiKit.Visual.Scale(_6cf,0,_6d0);
+};
+MochiKit.Visual.squish=function(_6d9,_6da){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var _6dd;
+_6da=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6de){
+_6dd=d.makeClipping(_6de.element);
+},afterFinishInternal:function(_6df){
+MochiKit.Style.hideElement(_6df.element);
+d.undoClipping(_6df.element,_6dd);
+}},_6da||{});
+return new MochiKit.Visual.Scale(_6d9,/Opera/.test(navigator.userAgent)?1:0,_6da);
+};
+MochiKit.Visual.grow=function(_6e0,_6e1){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6e0=d.getElement(_6e0);
+_6e1=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6e1||{});
+var _6e5={top:_6e0.style.top,left:_6e0.style.left,height:_6e0.style.height,width:_6e0.style.width,opacity:s.getStyle(_6e0,"opacity")};
+var dims=s.getElementDimensions(_6e0);
+var _6e7,_6e8;
+var _6e9,_6ea;
+switch(_6e1.direction){
+case "top-left":
+_6e7=_6e8=_6e9=_6ea=0;
+break;
+case "top-right":
+_6e7=dims.w;
+_6e8=_6ea=0;
+_6e9=-dims.w;
+break;
+case "bottom-left":
+_6e7=_6e9=0;
+_6e8=dims.h;
+_6ea=-dims.h;
+break;
+case "bottom-right":
+_6e7=dims.w;
+_6e8=dims.h;
+_6e9=-dims.w;
+_6ea=-dims.h;
+break;
+case "center":
+_6e7=dims.w/2;
+_6e8=dims.h/2;
+_6e9=-dims.w/2;
+_6ea=-dims.h/2;
+break;
+}
+var _6eb=MochiKit.Base.update({beforeSetupInternal:function(_6ec){
+s.setStyle(_6ec.effects[0].element,{height:"0px"});
+s.showElement(_6ec.effects[0].element);
+},afterFinishInternal:function(_6ed){
+d.undoClipping(_6ed.effects[0].element);
+d.undoPositioned(_6ed.effects[0].element);
+s.setStyle(_6ed.effects[0].element,_6e5);
+}},_6e1||{});
+return new v.Move(_6e0,{x:_6e7,y:_6e8,duration:0.01,beforeSetupInternal:function(_6ee){
+s.hideElement(_6ee.element);
+d.makeClipping(_6ee.element);
+d.makePositioned(_6ee.element);
+},afterFinishInternal:function(_6ef){
+new v.Parallel([new v.Opacity(_6ef.element,{sync:true,to:1,from:0,transition:_6e1.opacityTransition}),new v.Move(_6ef.element,{x:_6e9,y:_6ea,sync:true,transition:_6e1.moveTransition}),new v.Scale(_6ef.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6e1.scaleTransition,scaleContent:_6e1.scaleContent,scaleFromCenter:_6e1.scaleFromCenter,restoreAfterFinish:true})],_6eb);
+}});
+};
+MochiKit.Visual.shrink=function(_6f0,_6f1){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6f0=d.getElement(_6f0);
+_6f1=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6f1||{});
+var _6f5={top:_6f0.style.top,left:_6f0.style.left,height:_6f0.style.height,width:_6f0.style.width,opacity:s.getStyle(_6f0,"opacity")};
+var dims=s.getElementDimensions(_6f0);
+var _6f7,_6f8;
+switch(_6f1.direction){
+case "top-left":
+_6f7=_6f8=0;
+break;
+case "top-right":
+_6f7=dims.w;
+_6f8=0;
+break;
+case "bottom-left":
+_6f7=0;
+_6f8=dims.h;
+break;
+case "bottom-right":
+_6f7=dims.w;
+_6f8=dims.h;
+break;
+case "center":
+_6f7=dims.w/2;
+_6f8=dims.h/2;
+break;
+}
+var _6f9;
+var _6fa=MochiKit.Base.update({beforeStartInternal:function(_6fb){
+_6f9=d.makePositioned(_6fb.effects[0].element);
+d.makeClipping(_6fb.effects[0].element);
+},afterFinishInternal:function(_6fc){
+s.hideElement(_6fc.effects[0].element);
+d.undoClipping(_6fc.effects[0].element,_6f9);
+d.undoPositioned(_6fc.effects[0].element);
+s.setStyle(_6fc.effects[0].element,_6f5);
+}},_6f1||{});
+return new v.Parallel([new v.Opacity(_6f0,{sync:true,to:0,from:1,transition:_6f1.opacityTransition}),new v.Scale(_6f0,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_6f1.scaleTransition,scaleContent:_6f1.scaleContent,scaleFromCenter:_6f1.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_6f0,{x:_6f7,y:_6f8,sync:true,transition:_6f1.moveTransition})],_6fa);
+};
+MochiKit.Visual.pulsate=function(_6fd,_6fe){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var b=MochiKit.Base;
+var _702=MochiKit.Style.getStyle(_6fd,"opacity");
+_6fe=b.update({duration:3,from:0,afterFinishInternal:function(_703){
+MochiKit.Style.setStyle(_703.element,{"opacity":_702});
+}},_6fe||{});
+var _704=_6fe.transition||v.Transitions.sinoidal;
+var _705=b.bind(function(pos){
+return _704(1-v.Transitions.pulse(pos,_6fe.pulses));
+},_704);
+b.bind(_705,_704);
+return new v.Opacity(_6fd,b.update({transition:_705},_6fe));
+};
+MochiKit.Visual.fold=function(_707,_708){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_707=d.getElement(_707);
+var _70c={top:_707.style.top,left:_707.style.left,width:_707.style.width,height:_707.style.height};
+var _70d=d.makeClipping(_707);
+_708=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_70e){
+new v.Scale(_707,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_70f){
+s.hideElement(_70f.element);
+d.undoClipping(_70f.element,_70d);
+s.setStyle(_70f.element,_70c);
+}});
+}},_708||{});
+return new v.Scale(_707,5,_708);
+};
+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","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";
+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");
+dojo.require("MochiKit.*");
+}
+if(typeof (JSAN)!="undefined"){
+(function(lst){
+for(var i=0;i<lst.length;i++){
+JSAN.use("MochiKit."+lst[i],[]);
+}
+})(MochiKit.MochiKit.SUBMODULES);
+}
+(function(){
+var _713=MochiKit.Base.extend;
+var self=MochiKit.MochiKit;
+var _715=self.SUBMODULES;
+var _716=[];
+var _717=[];
+var _718={};
+var i,k,m,all;
+for(i=0;i<_715.length;i++){
+m=MochiKit[_715[i]];
+_713(_716,m.EXPORT);
+_713(_717,m.EXPORT_OK);
+for(k in m.EXPORT_TAGS){
+_718[k]=_713(_718[k],m.EXPORT_TAGS[k]);
+}
+all=m.EXPORT_TAGS[":all"];
+if(!all){
+all=_713(null,m.EXPORT,m.EXPORT_OK);
+}
+var j;
+for(j=0;j<all.length;j++){
+k=all[j];
+self[k]=m[k];
+}
+}
+self.EXPORT=_716;
+self.EXPORT_OK=_717;
+self.EXPORT_TAGS=_718;
+}());
+}else{
+if(typeof (MochiKit.__compat__)=="undefined"){
+MochiKit.__compat__=true;
+}
+(function(){
+if(typeof (document)=="undefined"){
+return;
+}
+var _71e=document.getElementsByTagName("script");
+var _71f="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+var base=null;
+var _721=null;
+var _722={};
+var i;
+for(i=0;i<_71e.length;i++){
+var src=_71e[i].getAttribute("src");
+if(!src){
+continue;
+}
+_722[src]=true;
+if(src.match(/MochiKit.js$/)){
+base=src.substring(0,src.lastIndexOf("MochiKit.js"));
+_721=_71e[i];
+}
+}
+if(base===null){
+return;
+}
+var _725=MochiKit.MochiKit.SUBMODULES;
+for(var i=0;i<_725.length;i++){
+if(MochiKit[_725[i]]){
+continue;
+}
+var uri=base+_725[i]+".js";
+if(uri in _722){
+continue;
+}
+if(document.documentElement&&document.documentElement.namespaceURI==_71f){
+var s=document.createElementNS(_71f,"script");
+s.setAttribute("id","MochiKit_"+base+_725[i]);
+s.setAttribute("src",uri);
+s.setAttribute("type","application/x-javascript");
+_721.parentNode.appendChild(s);
+}else{
+document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>");
+}
+}
+})();
+}
+
+
+/***
+
+ PlotKit.PlotKit 0.9.1 : PACKED VERSION
+
+ THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
+ diff against the source tree, not this file.
+
+ For more information, <http://www.liquidx.net/plotkit/>.
+
+ Copyright (c) 2006. Alastair Tse.
+
+***/
+
+try{
+if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.DOM)=="undefined"||typeof (MochiKit.Color)=="undefined"||typeof (MochiKit.Format)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format}";
+}
+MochiKit.Base.update(MochiKit.Color.Color.prototype,{asFillColor:function(){
+return this.lighterColorWithLevel(0.3);
+},asStrokeColor:function(){
+return this.darkerColorWithLevel(0.1);
+},asPointColor:function(){
+return this.lighterColorWithLevel(0.1);
+}});
+if(typeof (PlotKit)=="undefined"){
+PlotKit={};
+}
+PlotKit.NAME="PlotKit";
+PlotKit.VERSION="0.8";
+PlotKit.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.toString=function(){
+return this.__repr__();
+};
+if(typeof (PlotKit.Base)=="undefined"){
+PlotKit.Base={};
+}
+PlotKit.Base.NAME="PlotKit.Base";
+PlotKit.Base.VERSION=PlotKit.VERSION;
+PlotKit.Base.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.Base.toString=function(){
+return this.__repr__();
+};
+PlotKit.Base.usingPrototype=function(){
+try{
+return (typeof (Object.extend)=="function");
+}
+catch(e){
+return false;
+}
+};
+MochiKit.Base.update(PlotKit.Base,{roundInterval:function(_1,_2,_3){
+var _4=MochiKit.Format.roundToFixed;
+var _5=_1/_2;
+return parseFloat(_4(_5,_3));
+},collapse:function(_6){
+var m=MochiKit.Base;
+var _8=new Array();
+for(var i=0;i<_6.length;i++){
+_8=m.concat(_8,_6[i]);
+}
+if(PlotKit.Base.usingPrototype()){
+delete _8.extend;
+delete _8.from;
+delete _8.inspect;
+}
+return _8;
+},uniq:function(_10){
+var m=MochiKit.Base;
+if(!m.isArrayLike(_10)||(_10.length<1)){
+return new Array();
+}
+var _11=new Array();
+var _12=_10[0];
+_11.push(_10[0]);
+for(var i=1;i<_10.length;i++){
+if(m.compare(_10[i],_12)!=0){
+_12=_10[i];
+_11.push(_10[i]);
+}
+}
+return _11;
+},colorScheme:function(){
+var mb=MochiKit.Base;
+var mc=MochiKit.Color;
+var _15=["red","orange","yellow","green","cyan","blue","purple","magenta"];
+var _16=function(_17){
+return mc.Color[_17+"Color"]();
+};
+return mb.map(_16,_15);
+},baseDarkPrimaryColors:function(){
+var _18=MochiKit.Color.Color.fromHexString;
+return [_18("#ad3f40"),_18("#ddac2c"),_18("#dfdd0c"),_18("#5276c4"),_18("#739c5a")];
+},basePrimaryColors:function(){
+var _19=MochiKit.Color.Color.fromHexString;
+return [_19("#d24c4d"),_19("#f2b32f"),_19("#ece90e"),_19("#5d83da"),_19("#78a15d")];
+},baseBlueColors:function(){
+var _20=MochiKit.Color.Color.fromHexString;
+return [_20("#4b6b94"),_20("#5d81b4"),_20("#acbad2")];
+},palette:function(_21,_22,_23,_24){
+var _25=MochiKit.Base.isUndefinedOrNull;
+var _26=new Array();
+if(_25(_24)){
+_24=0.1;
+}
+if(_25(_23)){
+_23=0.4;
+}
+if(_25(_22)){
+_22=-0.2;
+}
+var _27=_22;
+while(_27<=_23){
+_26.push(_27);
+_27+=_24;
+}
+var _28=function(_29,_30){
+return _29.lighterColorWithLevel(_30);
+};
+return MochiKit.Base.map(partial(_28,_21),_26);
+},excanvasSupported:function(){
+if(/MSIE/.test(navigator.userAgent)&&!window.opera){
+return true;
+}
+return false;
+},findPosX:function(obj){
+var _32=0;
+if(obj.offsetParent){
+while(obj.offsetParent){
+_32+=obj.offsetLeft;
+obj=obj.offsetParent;
+}
+}else{
+if(obj.x){
+_32+=obj.x;
+}
+}
+return _32;
+},findPosY:function(obj){
+var _33=0;
+if(obj.offsetParent){
+while(obj.offsetParent){
+_33+=obj.offsetTop;
+obj=obj.offsetParent;
+}
+}else{
+if(obj.y){
+_33+=obj.y;
+}
+}
+return _33;
+},isFuncLike:function(obj){
+return (typeof (obj)=="function");
+}});
+PlotKit.Base.map=function(fn,lst){
+if(PlotKit.Base.usingPrototype()){
+var _36=[];
+for(var x in lst){
+if(typeof (lst[x])=="function"){
+continue;
+}
+_36.push(fn(lst[x]));
+}
+return _36;
+}else{
+return MochiKit.Base.map(fn,lst);
+}
+};
+PlotKit.Base.items=function(lst){
+if(PlotKit.Base.usingPrototype()){
+var _38=[];
+for(var x in lst){
+if(typeof (lst[x])=="function"){
+continue;
+}
+_38.push([x,lst[x]]);
+}
+return _38;
+}else{
+return MochiKit.Base.items(lst);
+}
+};
+PlotKit.Base.keys=function(lst){
+if(PlotKit.Base.usingPrototype()){
+var _39=[];
+for(var x in lst){
+if(typeof (lst[x])=="function"){
+continue;
+}
+_39.push(x);
+}
+return _39;
+}else{
+return MochiKit.Base.keys(lst);
+}
+};
+PlotKit.Base.baseColors=function(){
+var _40=MochiKit.Color.Color.fromHexString;
+return [_40("#476fb2"),_40("#be2c2b"),_40("#85b730"),_40("#734a99"),_40("#26a1c5"),_40("#fb8707"),_40("#000000")];
+};
+PlotKit.Base.officeBaseStyle={"axisLineWidth":2,"axisLabelColor":Color.grayColor(),"axisLineColor":Color.whiteColor(),"padding":{top:5,bottom:10,left:30,right:30}};
+MochiKit.Base.update(PlotKit.Base,{officeBlue:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),"backgroundColor":PlotKit.Base.baseColors()[0].lighterColorWithLevel(0.45)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officeRed:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),"backgroundColor":PlotKit.Base.baseColors()[1].lighterColorWithLevel(0.5)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officeGreen:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[2]),"backgroundColor":PlotKit.Base.baseColors()[2].lighterColorWithLevel(0.5)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officePurple:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[3]),"backgroundColor":PlotKit.Base.baseColors()[3].lighterColorWithLevel(0.5)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officeCyan:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[4]),"backgroundColor":PlotKit.Base.baseColors()[4].lighterColorWithLevel(0.5)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officeOrange:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[5]),"backgroundColor":PlotKit.Base.baseColors()[5].lighterColorWithLevel(0.4)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+},officeBlack:function(){
+var r={"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[6],0,0.6),"backgroundColor":PlotKit.Base.baseColors()[6].lighterColorWithLevel(0.9)};
+MochiKit.Base.update(r,PlotKit.Base.officeBaseStyle);
+return r;
+}});
+PlotKit.Base.EXPORT=["baseColors","collapse","colorScheme","findPosX","findPosY","officeBaseStyle","officeBlue","officeRed","officeGreen","officePurple","officeCyan","officeOrange","officeBlack","roundInterval","uniq","isFuncLike","excanvasSupported"];
+PlotKit.Base.EXPORT_OK=[];
+PlotKit.Base.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.Base.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.Base);
+try{
+if(typeof (PlotKit.Base)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Base";
+}
+if(typeof (PlotKit.Layout)=="undefined"){
+PlotKit.Layout={};
+}
+PlotKit.Layout.NAME="PlotKit.Layout";
+PlotKit.Layout.VERSION=PlotKit.VERSION;
+PlotKit.Layout.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.Layout.toString=function(){
+return this.__repr__();
+};
+PlotKit.Layout.valid_styles=["bar","line","pie","point"];
+PlotKit.Layout=function(_42,_43){
+this.options={"barWidthFillFraction":0.75,"barOrientation":"vertical","xOriginIsZero":true,"yOriginIsZero":true,"xAxis":null,"yAxis":null,"xTicks":null,"yTicks":null,"xNumberOfTicks":10,"yNumberOfTicks":5,"xTickPrecision":1,"yTickPrecision":1,"pieRadius":0.4};
+this.style=_42;
+MochiKit.Base.update(this.options,_43?_43:{});
+if(!MochiKit.Base.isUndefinedOrNull(this.options.xAxis)){
+this.minxval=this.options.xAxis[0];
+this.maxxval=this.options.xAxis[1];
+this.xscale=this.maxxval-this.minxval;
+}else{
+this.minxval=0;
+this.maxxval=null;
+this.xscale=null;
+}
+if(!MochiKit.Base.isUndefinedOrNull(this.options.yAxis)){
+this.minyval=this.options.yAxis[0];
+this.maxyval=this.options.yAxis[1];
+this.yscale=this.maxyval-this.minyval;
+}else{
+this.minyval=0;
+this.maxyval=null;
+this.yscale=null;
+}
+this.bars=new Array();
+this.points=new Array();
+this.slices=new Array();
+this.xticks=new Array();
+this.yticks=new Array();
+this.datasets=new Array();
+this.minxdelta=0;
+this.xrange=1;
+this.yrange=1;
+this.hitTestCache={x2maxy:null};
+};
+PlotKit.Layout.prototype.addDataset=function(_44,_45){
+this.datasets[_44]=_45;
+};
+PlotKit.Layout.prototype.removeDataset=function(_46,_47){
+delete this.datasets[_46];
+};
+PlotKit.Layout.prototype.addDatasetFromTable=function(_48,_49,_50,_51,_52){
+var _53=MochiKit.Base.isUndefinedOrNull;
+var _54=MochiKit.DOM.scrapeText;
+var _55=MochiKit.Format.strip;
+if(_53(_50)){
+_50=0;
+}
+if(_53(_51)){
+_51=1;
+}
+if(_53(_52)){
+_52=-1;
+}
+var _56=_49.tBodies[0].rows;
+var _57=new Array();
+var _58=new Array();
+if(!_53(_56)){
+for(var i=0;i<_56.length;i++){
+_57.push([parseFloat(_55(_54(_56[i].cells[_50]))),parseFloat(_55(_54(_56[i].cells[_51])))]);
+if(_52>=0){
+_58.push({v:parseFloat(_55(_54(_56[i].cells[_50]))),label:_55(_54(_56[i].cells[_52]))});
+}
+}
+this.addDataset(_48,_57);
+if(_52>=0){
+this.options.xTicks=_58;
+}
+return true;
+}
+return false;
+};
+PlotKit.Layout.prototype.evaluate=function(){
+this._evaluateLimits();
+this._evaluateScales();
+if(this.style=="bar"){
+if(this.options.barOrientation=="horizontal"){
+this._evaluateHorizBarCharts();
+}else{
+this._evaluateBarCharts();
+}
+this._evaluateBarTicks();
+}else{
+if(this.style=="line"){
+this._evaluateLineCharts();
+this._evaluateLineTicks();
+}else{
+if(this.style=="pie"){
+this._evaluatePieCharts();
+this._evaluatePieTicks();
+}
+}
+}
+};
+PlotKit.Layout.prototype.hitTest=function(x,y){
+var f=MochiKit.Format.twoDigitFloat;
+if((this.style=="bar")&&this.bars&&(this.bars.length>0)){
+for(var i=0;i<this.bars.length;i++){
+var bar=this.bars[i];
+if((x>=bar.x)&&(x<=bar.x+bar.w)&&(y>=bar.y)&&(y-bar.y<=bar.h)){
+return bar;
+}
+}
+}else{
+if(this.style=="line"){
+if(this.hitTestCache.x2maxy==null){
+this._regenerateHitTestCache();
+}
+var _62=x/this.xscale;
+var _63=this.hitTestCache.xvalues;
+var _64=null;
+var _65=null;
+for(var i=1;i<_63.length;i++){
+if(_63[i]>_62){
+_64=_63[i-1];
+_65=_63[i];
+break;
+}
+}
+if((_64!=null)){
+var _66=this.hitTestCache.x2maxy[_64];
+var _67=this.hitTestCache.x2maxy[_65];
+var _68=(1-y)/this.yscale;
+var _69=(_67-_66)/(_65-_64);
+var _70=_66+_69*(_62-_64);
+if(_70>=_68){
+var obj={xval:_62,yval:_68,xafter:_65,yafter:_67,xbefore:_64,ybefore:_66,yprojected:_70};
+return obj;
+}
+}
+}else{
+if(this.style=="pie"){
+var _71=Math.sqrt((y-0.5)*(y-0.5)+(x-0.5)*(x-0.5));
+if(_71>this.options.pieRadius){
+return null;
+}
+var _72=Math.atan2(y-0.5,x-0.5)-Math.PI/2;
+for(var i=0;i<this.slices.length;i++){
+var _73=this.slices[i];
+if(_73.startAngle<_72&&_73.endAngle>=_72){
+return _73;
+}
+}
+}
+}
+}
+return null;
+};
+PlotKit.Layout.prototype.rectForX=function(x){
+return null;
+};
+PlotKit.Layout.prototype.angleRangeForX=function(x){
+return null;
+};
+PlotKit.Layout.prototype._evaluateLimits=function(){
+var map=PlotKit.Base.map;
+var _75=PlotKit.Base.items;
+var _76=MochiKit.Base.itemgetter;
+var _77=PlotKit.Base.collapse;
+var _78=MochiKit.Base.listMin;
+var _79=MochiKit.Base.listMax;
+var _80=MochiKit.Base.isUndefinedOrNull;
+var all=_77(map(_76(1),_75(this.datasets)));
+if(_80(this.options.xAxis)){
+if(this.options.xOriginIsZero){
+this.minxval=0;
+}else{
+this.minxval=_78(map(parseFloat,map(_76(0),all)));
+}
+this.maxxval=_79(map(parseFloat,map(_76(0),all)));
+}else{
+this.minxval=this.options.xAxis[0];
+this.maxxval=this.options.xAxis[1];
+this.xscale=this.maxval-this.minxval;
+}
+if(_80(this.options.yAxis)){
+if(this.options.yOriginIsZero){
+this.minyval=0;
+}else{
+this.minyval=_78(map(parseFloat,map(_76(1),all)));
+}
+this.maxyval=_79(map(parseFloat,map(_76(1),all)));
+}else{
+this.minyval=this.options.yAxis[0];
+this.maxyval=this.options.yAxis[1];
+this.yscale=this.maxyval-this.minyval;
+}
+};
+PlotKit.Layout.prototype._evaluateScales=function(){
+var _82=MochiKit.Base.isUndefinedOrNull;
+this.xrange=this.maxxval-this.minxval;
+if(this.xrange==0){
+this.xscale=1;
+}else{
+this.xscale=1/this.xrange;
+}
+this.yrange=this.maxyval-this.minyval;
+if(this.yrange==0){
+this.yscale=1;
+}else{
+this.yscale=1/this.yrange;
+}
+};
+PlotKit.Layout.prototype._uniqueXValues=function(){
+var _83=PlotKit.Base.collapse;
+var map=PlotKit.Base.map;
+var _84=PlotKit.Base.uniq;
+var _85=MochiKit.Base.itemgetter;
+var _86=PlotKit.Base.items;
+var _87=map(parseFloat,map(_85(0),_83(map(_85(1),_86(this.datasets)))));
+_87.sort(MochiKit.Base.compare);
+return _84(_87);
+};
+PlotKit.Layout.prototype._evaluateBarCharts=function(){
+var _88=PlotKit.Base.items;
+var _89=_88(this.datasets).length;
+var _90=10000000;
+var _91=this._uniqueXValues();
+for(var i=1;i<_91.length;i++){
+_90=Math.min(Math.abs(_91[i]-_91[i-1]),_90);
+}
+var _92=0;
+var _93=0;
+var _94=0;
+if(_91.length==1){
+_90=1;
+this.xscale=1;
+this.minxval=_91[0];
+_92=1*this.options.barWidthFillFraction;
+_93=_92/_89;
+_94=(1-this.options.barWidthFillFraction)/2;
+}else{
+if(this.xrange==1){
+this.xscale=0.5;
+}else{
+if(this.xrange==2){
+this.xscale=1/3;
+}else{
+this.xscale=(1-_90/this.xrange)/this.xrange;
+}
+}
+_92=_90*this.xscale*this.options.barWidthFillFraction;
+_93=_92/_89;
+_94=_90*this.xscale*(1-this.options.barWidthFillFraction)/2;
+}
+this.minxdelta=_90;
+this.bars=new Array();
+var i=0;
+for(var _95 in this.datasets){
+var _96=this.datasets[_95];
+if(PlotKit.Base.isFuncLike(_96)){
+continue;
+}
+for(var j=0;j<_96.length;j++){
+var _98=_96[j];
+var _99={x:((parseFloat(_98[0])-this.minxval)*this.xscale)+(i*_93)+_94,y:1-((parseFloat(_98[1])-this.minyval)*this.yscale),w:_93,h:((parseFloat(_98[1])-this.minyval)*this.yscale),xval:parseFloat(_98[0]),yval:parseFloat(_98[1]),name:_95};
+if((_99.x>=0)&&(_99.x<=1)&&(_99.y>=0)&&(_99.y<=1)){
+this.bars.push(_99);
+}
+}
+i++;
+}
+};
+PlotKit.Layout.prototype._evaluateHorizBarCharts=function(){
+var _100=PlotKit.Base.items;
+var _101=_100(this.datasets).length;
+var _102=10000000;
+var _103=this._uniqueXValues();
+for(var i=1;i<_103.length;i++){
+_102=Math.min(Math.abs(_103[i]-_103[i-1]),_102);
+}
+var _104=0;
+var _105=0;
+var _106=0;
+if(_103.length==1){
+_102=1;
+this.xscale=1;
+this.minxval=_103[0];
+_104=1*this.options.barWidthFillFraction;
+_105=_104/_101;
+_106=(1-this.options.barWidthFillFraction)/2;
+}else{
+this.xscale=(1-_102/this.xrange)/this.xrange;
+_104=_102*this.xscale*this.options.barWidthFillFraction;
+_105=_104/_101;
+_106=_102*this.xscale*(1-this.options.barWidthFillFraction)/2;
+}
+this.minxdelta=_102;
+this.bars=new Array();
+var i=0;
+for(var _107 in this.datasets){
+var _108=this.datasets[_107];
+if(PlotKit.Base.isFuncLike(_108)){
+continue;
+}
+for(var j=0;j<_108.length;j++){
+var item=_108[j];
+var rect={y:((parseFloat(item[0])-this.minxval)*this.xscale)+(i*_105)+_106,x:0,h:_105,w:((parseFloat(item[1])-this.minyval)*this.yscale),xval:parseFloat(item[0]),yval:parseFloat(item[1]),name:_107};
+if(rect.y<=0){
+rect.y=0;
+}
+if(rect.y>=1){
+rect.y=1;
+}
+if((rect.x>=0)&&(rect.x<=1)){
+this.bars.push(rect);
+}
+}
+i++;
+}
+};
+PlotKit.Layout.prototype._evaluateLineCharts=function(){
+var _111=PlotKit.Base.items;
+var _112=_111(this.datasets).length;
+this.points=new Array();
+var i=0;
+for(var _113 in this.datasets){
+var _114=this.datasets[_113];
+if(PlotKit.Base.isFuncLike(_114)){
+continue;
+}
+_114.sort(function(a,b){
+return compare(parseFloat(a[0]),parseFloat(b[0]));
+});
+for(var j=0;j<_114.length;j++){
+var item=_114[j];
+var _117={x:((parseFloat(item[0])-this.minxval)*this.xscale),y:1-((parseFloat(item[1])-this.minyval)*this.yscale),xval:parseFloat(item[0]),yval:parseFloat(item[1]),name:_113};
+if(_117.y<=0){
+_117.y=0;
+}
+if(_117.y>=1){
+_117.y=1;
+}
+if((_117.x>=0)&&(_117.x<=1)){
+this.points.push(_117);
+}
+}
+i++;
+}
+};
+PlotKit.Layout.prototype._evaluatePieCharts=function(){
+var _118=PlotKit.Base.items;
+var sum=MochiKit.Iter.sum;
+var _120=MochiKit.Base.itemgetter;
+var _121=_118(this.datasets).length;
+var _122=_118(this.datasets)[0][1];
+var _123=sum(map(_120(1),_122));
+this.slices=new Array();
+var _124=0;
+for(var i=0;i<_122.length;i++){
+var _125=_122[i][1]/_123;
+var _126=_124*Math.PI*2;
+var _127=(_124+_125)*Math.PI*2;
+var _128={fraction:_125,xval:_122[i][0],yval:_122[i][1],startAngle:_126,endAngle:_127};
+if(_122[i][1]!=0){
+this.slices.push(_128);
+}
+_124+=_125;
+}
+};
+PlotKit.Layout.prototype._evaluateLineTicksForXAxis=function(){
+var _129=MochiKit.Base.isUndefinedOrNull;
+if(this.options.xTicks){
+this.xticks=new Array();
+var _130=function(tick){
+var _132=tick.label;
+if(_129(_132)){
+_132=tick.v.toString();
+}
+var pos=this.xscale*(tick.v-this.minxval);
+if((pos>=0)&&(pos<=1)){
+this.xticks.push([pos,_132]);
+}
+};
+MochiKit.Iter.forEach(this.options.xTicks,bind(_130,this));
+}else{
+if(this.options.xNumberOfTicks){
+var _134=this._uniqueXValues();
+var _135=this.xrange/this.options.xNumberOfTicks;
+var _136=0;
+this.xticks=new Array();
+for(var i=0;i<=_134.length;i++){
+if((_134[i]-this.minxval)>=(_136*_135)){
+var pos=this.xscale*(_134[i]-this.minxval);
+if((pos>1)||(pos<0)){
+continue;
+}
+this.xticks.push([pos,_134[i]]);
+_136++;
+}
+if(_136>this.options.xNumberOfTicks){
+break;
+}
+}
+}
+}
+};
+PlotKit.Layout.prototype._evaluateLineTicksForYAxis=function(){
+var _137=MochiKit.Base.isUndefinedOrNull;
+if(this.options.yTicks){
+this.yticks=new Array();
+var _138=function(tick){
+var _139=tick.label;
+if(_137(_139)){
+_139=tick.v.toString();
+}
+var pos=1-(this.yscale*(tick.v-this.minyval));
+if((pos>=0)&&(pos<=1)){
+this.yticks.push([pos,_139]);
+}
+};
+MochiKit.Iter.forEach(this.options.yTicks,bind(_138,this));
+}else{
+if(this.options.yNumberOfTicks){
+this.yticks=new Array();
+var _140=PlotKit.Base.roundInterval;
+var prec=this.options.yTickPrecision;
+var _142=_140(this.yrange,this.options.yNumberOfTicks,prec);
+for(var i=0;i<=this.options.yNumberOfTicks;i++){
+var yval=this.minyval+(i*_142);
+var pos=1-((yval-this.minyval)*this.yscale);
+if((pos>1)||(pos<0)){
+continue;
+}
+this.yticks.push([pos,MochiKit.Format.roundToFixed(yval,prec)]);
+}
+}
+}
+};
+PlotKit.Layout.prototype._evaluateLineTicks=function(){
+this._evaluateLineTicksForXAxis();
+this._evaluateLineTicksForYAxis();
+};
+PlotKit.Layout.prototype._evaluateBarTicks=function(){
+this._evaluateLineTicks();
+var _144=function(tick){
+return [tick[0]+(this.minxdelta*this.xscale)/2,tick[1]];
+};
+this.xticks=MochiKit.Base.map(bind(_144,this),this.xticks);
+if(this.options.barOrientation=="horizontal"){
+var _145=this.xticks;
+this.xticks=this.yticks;
+this.yticks=_145;
+var _146=function(tick){
+return [1-tick[0],tick[1]];
+};
+this.xticks=MochiKit.Base.map(_146,this.xticks);
+}
+};
+PlotKit.Layout.prototype._evaluatePieTicks=function(){
+var _147=MochiKit.Base.isUndefinedOrNull;
+var _148=MochiKit.Format.numberFormatter("#%");
+this.xticks=new Array();
+if(this.options.xTicks){
+var _149=new Array();
+for(var i=0;i<this.slices.length;i++){
+_149[this.slices[i].xval]=this.slices[i];
+}
+for(var i=0;i<this.options.xTicks.length;i++){
+var tick=this.options.xTicks[i];
+var _150=_149[tick.v];
+var _151=tick.label;
+if(_150){
+if(_147(_151)){
+_151=tick.v.toString();
+}
+_151+=" ("+_148(_150.fraction)+")";
+this.xticks.push([tick.v,_151]);
+}
+}
+}else{
+for(var i=0;i<this.slices.length;i++){
+var _150=this.slices[i];
+var _151=_150.xval+" ("+_148(_150.fraction)+")";
+this.xticks.push([_150.xval,_151]);
+}
+}
+};
+PlotKit.Layout.prototype._regenerateHitTestCache=function(){
+this.hitTestCache.xvalues=this._uniqueXValues();
+this.hitTestCache.xlookup=new Array();
+this.hitTestCache.x2maxy=new Array();
+var _152=MochiKit.Base.listMax;
+var _153=MochiKit.Base.itemgetter;
+var map=MochiKit.Base.map;
+var _154=keys(this.datasets);
+for(var i=0;i<_154.length;i++){
+var _155=this.datasets[_154[i]];
+for(var j=0;j<_155.length;j++){
+var xval=_155[j][0];
+var yval=_155[j][1];
+if(this.hitTestCache.xlookup[xval]){
+this.hitTestCache.xlookup[xval].push([yval,_154[i]]);
+}else{
+this.hitTestCache.xlookup[xval]=[[yval,_154[i]]];
+}
+}
+}
+for(var x in this.hitTestCache.xlookup){
+var _157=this.hitTestCache.xlookup[x];
+this.hitTestCache.x2maxy[x]=_152(map(_153(0),_157));
+}
+};
+PlotKit.LayoutModule={};
+PlotKit.LayoutModule.Layout=PlotKit.Layout;
+PlotKit.LayoutModule.EXPORT=["Layout"];
+PlotKit.LayoutModule.EXPORT_OK=[];
+PlotKit.LayoutModule.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.LayoutModule.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.LayoutModule);
+try{
+if((typeof (PlotKit.Base)=="undefined")||(typeof (PlotKit.Layout)=="undefined")){
+throw "";
+}
+}
+catch(e){
+throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Base,Layout}";
+}
+if(typeof (PlotKit.CanvasRenderer)=="undefined"){
+PlotKit.CanvasRenderer={};
+}
+PlotKit.CanvasRenderer.NAME="PlotKit.CanvasRenderer";
+PlotKit.CanvasRenderer.VERSION=PlotKit.VERSION;
+PlotKit.CanvasRenderer.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.CanvasRenderer.toString=function(){
+return this.__repr__();
+};
+PlotKit.CanvasRenderer=function(_158,_159,_160){
+if(arguments.length>0){
+this.__init__(_158,_159,_160);
+}
+};
+PlotKit.CanvasRenderer.prototype.__init__=function(_161,_162,_163){
+var _164=MochiKit.Base.isUndefinedOrNull;
+var _165=MochiKit.Color.Color;
+this.options={"drawBackground":true,"backgroundColor":_165.whiteColor(),"padding":{left:30,right:30,top:5,bottom:10},"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),"strokeColor":_165.whiteColor(),"strokeColorTransform":"asStrokeColor","strokeWidth":0.5,"shouldFill":true,"shouldStroke":true,"drawXAxis":true,"drawYAxis":true,"axisLineColor":_165.blackColor(),"axisLineWidth":0.5,"axisTickSize":3,"axisLabelColor":_165.blackColor(),"axisLabelFont":"Arial","axisLabelFontSize":9,"axisLabelWidth":50,"pieRadius":0.4,"enableEvents":true};
+MochiKit.Base.update(this.options,_163?_163:{});
+this.layout=_162;
+this.element=MochiKit.DOM.getElement(_161);
+this.container=this.element.parentNode;
+this.isIE=PlotKit.Base.excanvasSupported();
+if(this.isIE&&!_164(G_vmlCanvasManager)){
+this.IEDelay=0.5;
+this.maxTries=5;
+this.renderDelay=null;
+this.clearDelay=null;
+this.element=G_vmlCanvasManager.initElement(this.element);
+}
+this.height=this.element.height;
+this.width=this.element.width;
+if(_164(this.element)){
+throw "CanvasRenderer() - passed canvas is not found";
+}
+if(!this.isIE&&!(PlotKit.CanvasRenderer.isSupported(this.element))){
+throw "CanvasRenderer() - Canvas is not supported.";
+}
+if(_164(this.container)||(this.container.nodeName.toLowerCase()!="div")){
+throw "CanvasRenderer() - <canvas> needs to be enclosed in <div>";
+}
+this.xlabels=new Array();
+this.ylabels=new Array();
+this.isFirstRender=true;
+this.area={x:this.options.padding.left,y:this.options.padding.top,w:this.width-this.options.padding.left-this.options.padding.right,h:this.height-this.options.padding.top-this.options.padding.bottom};
+MochiKit.DOM.updateNodeAttributes(this.container,{"style":{"position":"relative","width":this.width+"px"}});
+};
+PlotKit.CanvasRenderer.prototype.render=function(){
+if(this.isIE){
+try{
+if(this.renderDelay){
+this.renderDelay.cancel();
+this.renderDelay=null;
+}
+var _166=this.element.getContext("2d");
+}
+catch(e){
+this.isFirstRender=false;
+if(this.maxTries-->0){
+this.renderDelay=MochiKit.Async.wait(this.IEDelay);
+this.renderDelay.addCallback(bind(this.render,this));
+}
+return;
+}
+}
+if(this.options.drawBackground){
+this._renderBackground();
+}
+if(this.layout.style=="bar"){
+this._renderBarChart();
+this._renderBarAxis();
+}else{
+if(this.layout.style=="pie"){
+this._renderPieChart();
+this._renderPieAxis();
+}else{
+if(this.layout.style=="line"){
+this._renderLineChart();
+this._renderLineAxis();
+}
+}
+}
+};
+PlotKit.CanvasRenderer.prototype._renderBarChartWrap=function(data,_168){
+var _169=this.element.getContext("2d");
+var _170=this.options.colorScheme.length;
+var _171=this.options.colorScheme;
+var _172=MochiKit.Base.keys(this.layout.datasets);
+var _173=_172.length;
+for(var i=0;i<_173;i++){
+var _174=_172[i];
+var _175=_171[i%_170];
+_169.save();
+_169.fillStyle=_175.toRGBString();
+if(this.options.strokeColor){
+_169.strokeStyle=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_169.strokeStyle=_175[this.options.strokeColorTransform]().toRGBString();
+}
+}
+_169.lineWidth=this.options.strokeWidth;
+var _176=function(obj){
+if(obj.name==_174){
+_168(_169,obj);
+}
+};
+MochiKit.Iter.forEach(data,bind(_176,this));
+_169.restore();
+}
+};
+PlotKit.CanvasRenderer.prototype._renderBarChart=function(){
+var bind=MochiKit.Base.bind;
+var _178=function(_179,bar){
+var x=this.area.w*bar.x+this.area.x;
+var y=this.area.h*bar.y+this.area.y;
+var w=this.area.w*bar.w;
+var h=this.area.h*bar.h;
+if((w<1)||(h<1)){
+return;
+}
+if(this.options.shouldFill){
+_179.fillRect(x,y,w,h);
+}
+if(this.options.shouldStroke){
+_179.strokeRect(x,y,w,h);
+}
+};
+this._renderBarChartWrap(this.layout.bars,bind(_178,this));
+};
+PlotKit.CanvasRenderer.prototype._renderLineChart=function(){
+var _182=this.element.getContext("2d");
+var _183=this.options.colorScheme.length;
+var _184=this.options.colorScheme;
+var _185=MochiKit.Base.keys(this.layout.datasets);
+var _186=_185.length;
+var bind=MochiKit.Base.bind;
+var _187=MochiKit.Base.partial;
+for(var i=0;i<_186;i++){
+var _188=_185[i];
+var _189=_184[i%_183];
+var _190=this.options.strokeColorTransform;
+_182.save();
+_182.fillStyle=_189.toRGBString();
+if(this.options.strokeColor){
+_182.strokeStyle=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_182.strokeStyle=_189[_190]().toRGBString();
+}
+}
+_182.lineWidth=this.options.strokeWidth;
+var _191=function(ctx){
+ctx.beginPath();
+ctx.moveTo(this.area.x,this.area.y+this.area.h);
+var _193=function(ctx_,_195){
+if(_195.name==_188){
+ctx_.lineTo(this.area.w*_195.x+this.area.x,this.area.h*_195.y+this.area.y);
+}
+};
+MochiKit.Iter.forEach(this.layout.points,_187(_193,ctx),this);
+ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y);
+ctx.lineTo(this.area.x,this.area.y+this.area.h);
+ctx.closePath();
+};
+if(this.options.shouldFill){
+bind(_191,this)(_182);
+_182.fill();
+}
+if(this.options.shouldStroke){
+bind(_191,this)(_182);
+_182.stroke();
+}
+_182.restore();
+}
+};
+PlotKit.CanvasRenderer.prototype._renderPieChart=function(){
+var _196=this.element.getContext("2d");
+var _197=this.options.colorScheme.length;
+var _198=this.layout.slices;
+var _199=this.area.x+this.area.w*0.5;
+var _200=this.area.y+this.area.h*0.5;
+var _201=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
+if(this.isIE){
+_199=parseInt(_199);
+_200=parseInt(_200);
+_201=parseInt(_201);
+}
+for(var i=0;i<_198.length;i++){
+var _202=this.options.colorScheme[i%_197];
+_196.save();
+_196.fillStyle=_202.toRGBString();
+var _203=function(){
+_196.beginPath();
+_196.moveTo(_199,_200);
+_196.arc(_199,_200,_201,_198[i].startAngle-Math.PI/2,_198[i].endAngle-Math.PI/2,false);
+_196.lineTo(_199,_200);
+_196.closePath();
+};
+if(Math.abs(_198[i].startAngle-_198[i].endAngle)>0.001){
+if(this.options.shouldFill){
+_203();
+_196.fill();
+}
+if(this.options.shouldStroke){
+_203();
+_196.lineWidth=this.options.strokeWidth;
+if(this.options.strokeColor){
+_196.strokeStyle=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_196.strokeStyle=_202[this.options.strokeColorTransform]().toRGBString();
+}
+}
+_196.stroke();
+}
+}
+_196.restore();
+}
+};
+PlotKit.CanvasRenderer.prototype._renderBarAxis=function(){
+this._renderAxis();
+};
+PlotKit.CanvasRenderer.prototype._renderLineAxis=function(){
+this._renderAxis();
+};
+PlotKit.CanvasRenderer.prototype._renderAxis=function(){
+if(!this.options.drawXAxis&&!this.options.drawYAxis){
+return;
+}
+var _204=this.element.getContext("2d");
+var _205={"style":{"position":"absolute","fontSize":this.options.axisLabelFontSize+"px","zIndex":10,"color":this.options.axisLabelColor.toRGBString(),"width":this.options.axisLabelWidth+"px","overflow":"hidden"}};
+_204.save();
+_204.strokeStyle=this.options.axisLineColor.toRGBString();
+_204.lineWidth=this.options.axisLineWidth;
+if(this.options.drawYAxis){
+if(this.layout.yticks){
+var _206=function(tick){
+if(typeof (tick)=="function"){
+return;
+}
+var x=this.area.x;
+var y=this.area.y+tick[0]*this.area.h;
+_204.beginPath();
+_204.moveTo(x,y);
+_204.lineTo(x-this.options.axisTickSize,y);
+_204.closePath();
+_204.stroke();
+var _207=DIV(_205,tick[1]);
+_207.style.top=(y-this.options.axisLabelFontSize)+"px";
+_207.style.left=(x-this.options.padding.left-this.options.axisTickSize)+"px";
+_207.style.textAlign="right";
+_207.style.width=(this.options.padding.left-this.options.axisTickSize*2)+"px";
+MochiKit.DOM.appendChildNodes(this.container,_207);
+this.ylabels.push(_207);
+};
+MochiKit.Iter.forEach(this.layout.yticks,bind(_206,this));
+}
+_204.beginPath();
+_204.moveTo(this.area.x,this.area.y);
+_204.lineTo(this.area.x,this.area.y+this.area.h);
+_204.closePath();
+_204.stroke();
+}
+if(this.options.drawXAxis){
+if(this.layout.xticks){
+var _206=function(tick){
+if(typeof (dataset)=="function"){
+return;
+}
+var x=this.area.x+tick[0]*this.area.w;
+var y=this.area.y+this.area.h;
+_204.beginPath();
+_204.moveTo(x,y);
+_204.lineTo(x,y+this.options.axisTickSize);
+_204.closePath();
+_204.stroke();
+var _208=DIV(_205,tick[1]);
+_208.style.top=(y+this.options.axisTickSize)+"px";
+_208.style.left=(x-this.options.axisLabelWidth/2)+"px";
+_208.style.textAlign="center";
+_208.style.width=this.options.axisLabelWidth+"px";
+MochiKit.DOM.appendChildNodes(this.container,_208);
+this.xlabels.push(_208);
+};
+MochiKit.Iter.forEach(this.layout.xticks,bind(_206,this));
+}
+_204.beginPath();
+_204.moveTo(this.area.x,this.area.y+this.area.h);
+_204.lineTo(this.area.x+this.area.w,this.area.y+this.area.h);
+_204.closePath();
+_204.stroke();
+}
+_204.restore();
+};
+PlotKit.CanvasRenderer.prototype._renderPieAxis=function(){
+if(!this.options.drawXAxis){
+return;
+}
+if(this.layout.xticks){
+var _209=new Array();
+for(var i=0;i<this.layout.slices.length;i++){
+_209[this.layout.slices[i].xval]=this.layout.slices[i];
+}
+var _210=this.area.x+this.area.w*0.5;
+var _211=this.area.y+this.area.h*0.5;
+var _212=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
+var _213=this.options.axisLabelWidth;
+for(var i=0;i<this.layout.xticks.length;i++){
+var _214=_209[this.layout.xticks[i][0]];
+if(MochiKit.Base.isUndefinedOrNull(_214)){
+continue;
+}
+var _215=(_214.startAngle+_214.endAngle)/2;
+var _216=_215;
+if(_216>Math.PI*2){
+_216=_216-Math.PI*2;
+}else{
+if(_216<0){
+_216=_216+Math.PI*2;
+}
+}
+var _217=_210+Math.sin(_216)*(_212+10);
+var _218=_211-Math.cos(_216)*(_212+10);
+var _219={"position":"absolute","zIndex":11,"width":_213+"px","fontSize":this.options.axisLabelFontSize+"px","overflow":"hidden","color":this.options.axisLabelColor.toHexString()};
+if(_216<=Math.PI*0.5){
+_219["textAlign"]="left";
+_219["verticalAlign"]="top";
+_219["left"]=_217+"px";
+_219["top"]=(_218-this.options.axisLabelFontSize)+"px";
+}else{
+if((_216>Math.PI*0.5)&&(_216<=Math.PI)){
+_219["textAlign"]="left";
+_219["verticalAlign"]="bottom";
+_219["left"]=_217+"px";
+_219["top"]=_218+"px";
+}else{
+if((_216>Math.PI)&&(_216<=Math.PI*1.5)){
+_219["textAlign"]="right";
+_219["verticalAlign"]="bottom";
+_219["left"]=(_217-_213)+"px";
+_219["top"]=_218+"px";
+}else{
+_219["textAlign"]="right";
+_219["verticalAlign"]="bottom";
+_219["left"]=(_217-_213)+"px";
+_219["top"]=(_218-this.options.axisLabelFontSize)+"px";
+}
+}
+}
+var _220=DIV({"style":_219},this.layout.xticks[i][1]);
+this.xlabels.push(_220);
+MochiKit.DOM.appendChildNodes(this.container,_220);
+}
+}
+};
+PlotKit.CanvasRenderer.prototype._renderBackground=function(){
+var _221=this.element.getContext("2d");
+_221.save();
+_221.fillStyle=this.options.backgroundColor.toRGBString();
+_221.fillRect(0,0,this.width,this.height);
+_221.restore();
+};
+PlotKit.CanvasRenderer.prototype.clear=function(){
+if(this.isIE){
+try{
+if(this.clearDelay){
+this.clearDelay.cancel();
+this.clearDelay=null;
+}
+var _222=this.element.getContext("2d");
+}
+catch(e){
+this.isFirstRender=false;
+this.clearDelay=MochiKit.Async.wait(this.IEDelay);
+this.clearDelay.addCallback(bind(this.clear,this));
+return;
+}
+}
+var _222=this.element.getContext("2d");
+_222.clearRect(0,0,this.width,this.height);
+MochiKit.Iter.forEach(this.xlabels,MochiKit.DOM.removeElement);
+MochiKit.Iter.forEach(this.ylabels,MochiKit.DOM.removeElement);
+this.xlabels=new Array();
+this.ylabels=new Array();
+};
+PlotKit.CanvasRenderer.prototype._initialiseEvents=function(){
+var _223=MochiKit.Signal.connect;
+var bind=MochiKit.Base.bind;
+_223(this.element,"onclick",bind(this.onclick,this));
+};
+PlotKit.CanvasRenderer.prototype._resolveObject=function(e){
+var x=(e.mouse().page.x-PlotKit.Base.findPosX(this.element)-this.area.x)/this.area.w;
+var y=(e.mouse().page.y-PlotKit.Base.findPosY(this.element)-this.area.y)/this.area.h;
+var _225=this.layout.hitTest(x,y);
+if(_225){
+return _225;
+}
+return null;
+};
+PlotKit.CanvasRenderer.prototype._createEventObject=function(_226,e){
+if(_226==null){
+return null;
+}
+e.chart=_226;
+return e;
+};
+PlotKit.CanvasRenderer.prototype.onclick=function(e){
+var _227=this._resolveObject(e);
+var _228=this._createEventObject(_227,e);
+if(_228!=null){
+MochiKit.Signal.signal(this,"onclick",_228);
+}
+};
+PlotKit.CanvasRenderer.prototype.onmouseover=function(e){
+var _229=this._resolveObject(e);
+var _230=this._createEventObject(_229,e);
+if(_230!=null){
+signal(this,"onmouseover",_230);
+}
+};
+PlotKit.CanvasRenderer.prototype.onmouseout=function(e){
+var _231=this._resolveObject(e);
+var _232=this._createEventObject(_231,e);
+if(_232==null){
+signal(this,"onmouseout",e);
+}else{
+signal(this,"onmouseout",_232);
+}
+};
+PlotKit.CanvasRenderer.prototype.onmousemove=function(e){
+var _233=this._resolveObject(e);
+var _234=this._createEventObject(_233,e);
+if((_233==null)&&(this.event_isinside==null)){
+return;
+}
+if((_233!=null)&&(this.event_isinside==null)){
+signal(this,"onmouseover",_234);
+}
+if((_233==null)&&(this.event_isinside!=null)){
+signal(this,"onmouseout",_234);
+}
+if((_233!=null)&&(this.event_isinside!=null)){
+signal(this,"onmousemove",_234);
+}
+this.event_isinside=_233;
+};
+PlotKit.CanvasRenderer.isSupported=function(_235){
+var _236=null;
+try{
+if(MochiKit.Base.isUndefinedOrNull(_235)){
+_236=MochiKit.DOM.CANVAS({});
+}else{
+_236=MochiKit.DOM.getElement(_235);
+}
+var _237=_236.getContext("2d");
+}
+catch(e){
+var ie=navigator.appVersion.match(/MSIE (\d\.\d)/);
+var _239=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
+if((!ie)||(ie[1]<6)||(_239)){
+return false;
+}
+return true;
+}
+return true;
+};
+PlotKit.Canvas={};
+PlotKit.Canvas.CanvasRenderer=PlotKit.CanvasRenderer;
+PlotKit.Canvas.EXPORT=["CanvasRenderer"];
+PlotKit.Canvas.EXPORT_OK=["CanvasRenderer"];
+PlotKit.Canvas.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.Canvas.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.Canvas);
+try{
+if(typeof (PlotKit.Layout)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Layout";
+}
+PlotKit.SVGRenderer=function(_240,_241,_242){
+if(arguments.length>0){
+this.__init__(_240,_241,_242);
+}
+};
+PlotKit.SVGRenderer.NAME="PlotKit.SVGRenderer";
+PlotKit.SVGRenderer.VERSION=PlotKit.VERSION;
+PlotKit.SVGRenderer.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.SVGRenderer.toString=function(){
+return this.__repr__();
+};
+PlotKit.SVGRenderer.SVGNS="http://www.w3.org/2000/svg";
+PlotKit.SVGRenderer.prototype.__init__=function(_243,_244,_245){
+var _246=MochiKit.Base.isUndefinedOrNull;
+this.options={"drawBackground":true,"backgroundColor":Color.whiteColor(),"padding":{left:30,right:30,top:5,bottom:10},"colorScheme":PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),"strokeColor":Color.whiteColor(),"strokeColorTransform":"asStrokeColor","strokeWidth":0.5,"shouldFill":true,"shouldStroke":true,"drawXAxis":true,"drawYAxis":true,"axisLineColor":Color.blackColor(),"axisLineWidth":0.5,"axisTickSize":3,"axisLabelColor":Color.blackColor(),"axisLabelFont":"Arial","axisLabelFontSize":9,"axisLabelWidth":50,"axisLabelUseDiv":true,"pieRadius":0.4,"enableEvents":true};
+MochiKit.Base.update(this.options,_245?_245:{});
+this.layout=_244;
+this.element=MochiKit.DOM.getElement(_243);
+this.container=this.element.parentNode;
+this.height=parseInt(this.element.getAttribute("height"));
+this.width=parseInt(this.element.getAttribute("width"));
+this.document=document;
+this.root=this.element;
+try{
+this.document=this.element.getSVGDocument();
+this.root=_246(this.document.documentElement)?this.element:this.document.documentElement;
+}
+catch(e){
+}
+this.element.style.zIndex=1;
+if(_246(this.element)){
+throw "SVGRenderer() - passed SVG object is not found";
+}
+if(_246(this.container)||this.container.nodeName.toLowerCase()!="div"){
+throw "SVGRenderer() - No DIV's around the SVG.";
+}
+this.xlabels=new Array();
+this.ylabels=new Array();
+this.defs=this.createSVGElement("defs");
+this.area={x:this.options.padding.left,y:this.options.padding.top,w:this.width-this.options.padding.left-this.options.padding.right,h:this.height-this.options.padding.top-this.options.padding.bottom};
+MochiKit.DOM.updateNodeAttributes(this.container,{"style":{"position":"relative","width":this.width+"px"}});
+};
+PlotKit.SVGRenderer.prototype.render=function(){
+if(this.options.drawBackground){
+this._renderBackground();
+}
+if(this.layout.style=="bar"){
+this._renderBarChart();
+this._renderBarAxis();
+}else{
+if(this.layout.style=="pie"){
+this._renderPieChart();
+this._renderPieAxis();
+}else{
+if(this.layout.style=="line"){
+this._renderLineChart();
+this._renderLineAxis();
+}
+}
+}
+};
+PlotKit.SVGRenderer.prototype._renderBarOrLine=function(data,_247,_248,_249){
+var _250=this.options.colorScheme.length;
+var _251=this.options.colorScheme;
+var _252=MochiKit.Base.keys(this.layout.datasets);
+var _253=_252.length;
+for(var i=0;i<_253;i++){
+var _254=_252[i];
+var _255=new Array();
+var _256=_251[i%_250];
+if(this.options.shouldFill){
+_255["fill"]=_256.toRGBString();
+}else{
+_255["fill"]="none";
+}
+if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){
+if(this.options.strokeColor){
+_255["stroke"]=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_255["stroke"]=_256[this.options.strokeColorTransform]().toRGBString();
+}
+}
+_255["strokeWidth"]=this.options.strokeWidth;
+}
+if(_248){
+_248(_255);
+}
+var _257=function(obj){
+if(obj.name==_254){
+_247(_255,obj);
+}
+};
+MochiKit.Iter.forEach(data,bind(_257,this));
+if(_249){
+_249(_255);
+}
+}
+};
+PlotKit.SVGRenderer.prototype._renderBarChart=function(){
+var bind=MochiKit.Base.bind;
+var _258=function(_259,bar){
+var x=this.area.w*bar.x+this.area.x;
+var y=this.area.h*bar.y+this.area.y;
+var w=this.area.w*bar.w;
+var h=this.area.h*bar.h;
+this._drawRect(x,y,w,h,_259);
+};
+this._renderBarOrLine(this.layout.bars,bind(_258,this));
+};
+PlotKit.SVGRenderer.prototype._renderLineChart=function(){
+var bind=MochiKit.Base.bind;
+var _260=function(_261,_262){
+this._tempPointsBuffer+=(this.area.w*_262.x+this.area.x)+","+(this.area.h*_262.y+this.area.y)+" ";
+};
+var _263=function(_264){
+this._tempPointsBuffer="";
+this._tempPointsBuffer+=(this.area.x)+","+(this.area.y+this.area.h)+" ";
+};
+var _265=function(_266){
+this._tempPointsBuffer+=(this.area.w+this.area.x)+","+(this.area.h+this.area.y);
+_266["points"]=this._tempPointsBuffer;
+var elem=this.createSVGElement("polygon",_266);
+this.root.appendChild(elem);
+};
+this._renderBarOrLine(this.layout.points,bind(_260,this),bind(_263,this),bind(_265,this));
+};
+PlotKit.SVGRenderer.prototype._renderPieChart=function(){
+var _268=this.options.colorScheme.length;
+var _269=this.layout.slices;
+var _270=this.area.x+this.area.w*0.5;
+var _271=this.area.y+this.area.h*0.5;
+var _272=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
+if(_269.length==1&&(Math.abs(_269[0].startAngle)-Math.abs(_269[0].endAngle)<0.1)){
+var _273={"cx":_270,"cy":_271,"r":_272};
+var _274=this.options.colorScheme[0];
+if(this.options.shouldFill){
+_273["fill"]=_274.toRGBString();
+}else{
+_273["fill"]="none";
+}
+if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){
+if(this.options.strokeColor){
+_273["stroke"]=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_273["stroke"]=_274[this.options.strokeColorTransform]().toRGBString();
+}
+}
+_273["style"]="stroke-width: "+this.options.strokeWidth;
+}
+this.root.appendChild(this.createSVGElement("circle",_273));
+return;
+}
+for(var i=0;i<_269.length;i++){
+var _273=new Array();
+var _274=this.options.colorScheme[i%_268];
+if(this.options.shouldFill){
+_273["fill"]=_274.toRGBString();
+}else{
+_273["fill"]="none";
+}
+if(this.options.shouldStroke&&(this.options.strokeColor||this.options.strokeColorTransform)){
+if(this.options.strokeColor){
+_273["stroke"]=this.options.strokeColor.toRGBString();
+}else{
+if(this.options.strokeColorTransform){
+_273["stroke"]=_274[this.options.strokeColorTransform]().toRGBString();
+}
+}
+_273["style"]="stroke-width:"+this.options.strokeWidth;
+}
+var _275=0;
+if(Math.abs(_269[i].endAngle-_269[i].startAngle)>Math.PI){
+_275=1;
+}
+var x1=Math.cos(_269[i].startAngle-Math.PI/2)*_272;
+var y1=Math.sin(_269[i].startAngle-Math.PI/2)*_272;
+var x2=Math.cos(_269[i].endAngle-Math.PI/2)*_272;
+var y2=Math.sin(_269[i].endAngle-Math.PI/2)*_272;
+var rx=x2-x1;
+var ry=y2-y1;
+var _282="M"+_270+","+_271+" ";
+_282+="l"+x1+","+y1+" ";
+_282+="a"+_272+","+_272+" 0 "+_275+",1 "+rx+","+ry+" z";
+_273["d"]=_282;
+var elem=this.createSVGElement("path",_273);
+this.root.appendChild(elem);
+}
+};
+PlotKit.SVGRenderer.prototype._renderBarAxis=function(){
+this._renderAxis();
+};
+PlotKit.SVGRenderer.prototype._renderLineAxis=function(){
+this._renderAxis();
+};
+PlotKit.SVGRenderer.prototype._renderAxis=function(){
+if(!this.options.drawXAxis&&!this.options.drawYAxis){
+return;
+}
+var _283={"style":{"position":"absolute","textAlign":"center","fontSize":this.options.axisLabelFontSize+"px","zIndex":10,"color":this.options.axisLabelColor.toRGBString(),"width":this.options.axisLabelWidth+"px","overflow":"hidden"}};
+var _284={"stroke":this.options.axisLineColor.toRGBString(),"strokeWidth":this.options.axisLineWidth};
+if(this.options.drawYAxis){
+if(this.layout.yticks){
+var _285=function(tick){
+var x=this.area.x;
+var y=this.area.y+tick[0]*this.area.h;
+this._drawLine(x,y,x-3,y,_284);
+if(this.options.axisLabelUseDiv){
+var _286=DIV(_283,tick[1]);
+_286.style.top=(y-this.options.axisLabelFontSize)+"px";
+_286.style.left=(x-this.options.padding.left+this.options.axisTickSize)+"px";
+_286.style.textAlign="left";
+_286.style.width=(this.options.padding.left-3)+"px";
+MochiKit.DOM.appendChildNodes(this.container,_286);
+this.ylabels.push(_286);
+}else{
+var _287={y:y+3,x:(x-this.options.padding.left+3),width:(this.options.padding.left-this.options.axisTickSize)+"px",height:(this.options.axisLabelFontSize+3)+"px",fontFamily:"Arial",fontSize:this.options.axisLabelFontSize+"px",fill:this.options.axisLabelColor.toRGBString()};
+var _286=this.createSVGElement("text",_287);
+_286.appendChild(this.document.createTextNode(tick[1]));
+this.root.appendChild(_286);
+}
+};
+MochiKit.Iter.forEach(this.layout.yticks,bind(_285,this));
+}
+this._drawLine(this.area.x,this.area.y,this.area.x,this.area.y+this.area.h,_284);
+}
+if(this.options.drawXAxis){
+if(this.layout.xticks){
+var _285=function(tick){
+var x=this.area.x+tick[0]*this.area.w;
+var y=this.area.y+this.area.h;
+this._drawLine(x,y,x,y+this.options.axisTickSize,_284);
+if(this.options.axisLabelUseDiv){
+var _288=DIV(_283,tick[1]);
+_288.style.top=(y+this.options.axisTickSize)+"px";
+_288.style.left=(x-this.options.axisLabelWidth/2)+"px";
+_288.style.textAlign="center";
+_288.style.width=this.options.axisLabelWidth+"px";
+MochiKit.DOM.appendChildNodes(this.container,_288);
+this.xlabels.push(_288);
+}else{
+var _289={y:(y+this.options.axisTickSize+this.options.axisLabelFontSize),x:x-3,width:this.options.axisLabelWidth+"px",height:(this.options.axisLabelFontSize+3)+"px",fontFamily:"Arial",fontSize:this.options.axisLabelFontSize+"px",fill:this.options.axisLabelColor.toRGBString(),textAnchor:"middle"};
+var _288=this.createSVGElement("text",_289);
+_288.appendChild(this.document.createTextNode(tick[1]));
+this.root.appendChild(_288);
+}
+};
+MochiKit.Iter.forEach(this.layout.xticks,bind(_285,this));
+}
+this._drawLine(this.area.x,this.area.y+this.area.h,this.area.x+this.area.w,this.area.y+this.area.h,_284);
+}
+};
+PlotKit.SVGRenderer.prototype._renderPieAxis=function(){
+if(this.layout.xticks){
+var _290=new Array();
+for(var i=0;i<this.layout.slices.length;i++){
+_290[this.layout.slices[i].xval]=this.layout.slices[i];
+}
+var _291=this.area.x+this.area.w*0.5;
+var _292=this.area.y+this.area.h*0.5;
+var _293=Math.min(this.area.w*this.options.pieRadius+10,this.area.h*this.options.pieRadius+10);
+var _294=this.options.axisLabelWidth;
+for(var i=0;i<this.layout.xticks.length;i++){
+var _295=_290[this.layout.xticks[i][0]];
+if(MochiKit.Base.isUndefinedOrNull(_295)){
+continue;
+}
+var _296=(_295.startAngle+_295.endAngle)/2;
+var _297=_296;
+if(_297>Math.PI*2){
+_297=_297-Math.PI*2;
+}else{
+if(_297<0){
+_297=_297+Math.PI*2;
+}
+}
+var _298=_291+Math.sin(_297)*(_293+10);
+var _299=_292-Math.cos(_297)*(_293+10);
+var _300={"position":"absolute","zIndex":11,"width":_294+"px","fontSize":this.options.axisLabelFontSize+"px","overflow":"hidden","color":this.options.axisLabelColor.toHexString()};
+var _301={"width":_294+"px","fontSize":this.options.axisLabelFontSize+"px","height":(this.options.axisLabelFontSize+3)+"px","fill":this.options.axisLabelColor.toRGBString()};
+if(_297<=Math.PI*0.5){
+MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"top","left":_298+"px","top":(_299-this.options.axisLabelFontSize)+"px"});
+MochiKit.Base.update(_301,{"x":_298,"y":(_299-this.options.axisLabelFontSize),"textAnchor":"left"});
+}else{
+if((_297>Math.PI*0.5)&&(_297<=Math.PI)){
+MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"bottom","left":_298+"px","top":_299+"px"});
+MochiKit.Base.update(_301,{"textAnchor":"left","x":_298,"y":_299});
+}else{
+if((_297>Math.PI)&&(_297<=Math.PI*1.5)){
+MochiKit.Base.update(_300,{"textAlign":"right","verticalAlign":"bottom","left":_298+"px","top":_299+"px"});
+MochiKit.Base.update(_301,{"textAnchor":"right","x":_298-_294,"y":_299});
+}else{
+MochiKit.Base.update(_300,{"textAlign":"left","verticalAlign":"bottom","left":_298+"px","top":_299+"px"});
+MochiKit.Base.update(_301,{"textAnchor":"left","x":_298-_294,"y":_299-this.options.axisLabelFontSize});
+}
+}
+}
+if(this.options.axisLabelUseDiv){
+var _302=DIV({"style":_300},this.layout.xticks[i][1]);
+this.xlabels.push(_302);
+MochiKit.DOM.appendChildNodes(this.container,_302);
+}else{
+var _302=this.createSVGElement("text",_301);
+_302.appendChild(this.document.createTextNode(this.layout.xticks[i][1]));
+this.root.appendChild(_302);
+}
+}
+}
+};
+PlotKit.SVGRenderer.prototype._renderBackground=function(){
+var opts={"stroke":"none","fill":this.options.backgroundColor.toRGBString()};
+this._drawRect(0,0,this.width,this.height,opts);
+};
+PlotKit.SVGRenderer.prototype._drawRect=function(x,y,w,h,_304){
+var _305={x:x+"px",y:y+"px",width:w+"px",height:h+"px"};
+if(_304){
+MochiKit.Base.update(_305,_304);
+}
+var elem=this.createSVGElement("rect",_305);
+this.root.appendChild(elem);
+};
+PlotKit.SVGRenderer.prototype._drawLine=function(x1,y1,x2,y2,_306){
+var _307={x1:x1+"px",y1:y1+"px",x2:x2+"px",y2:y2+"px"};
+if(_306){
+MochiKit.Base.update(_307,_306);
+}
+var elem=this.createSVGElement("line",_307);
+this.root.appendChild(elem);
+};
+PlotKit.SVGRenderer.prototype.clear=function(){
+while(this.element.firstChild){
+this.element.removeChild(this.element.firstChild);
+}
+if(this.options.axisLabelUseDiv){
+for(var i=0;i<this.xlabels.length;i++){
+MochiKit.DOM.removeElement(this.xlabels[i]);
+}
+for(var i=0;i<this.ylabels.length;i++){
+MochiKit.DOM.removeElement(this.ylabels[i]);
+}
+}
+this.xlabels=new Array();
+this.ylabels=new Array();
+};
+PlotKit.SVGRenderer.prototype.createSVGElement=function(name,_309){
+var _310=MochiKit.Base.isUndefinedOrNull;
+var elem;
+var doc=_310(this.document)?document:this.document;
+try{
+elem=doc.createElementNS(PlotKit.SVGRenderer.SVGNS,name);
+}
+catch(e){
+elem=doc.createElement(name);
+elem.setAttribute("xmlns",PlotKit.SVGRenderer.SVGNS);
+}
+if(_309){
+MochiKit.DOM.updateNodeAttributes(elem,_309);
+}
+return elem;
+};
+PlotKit.SVGRenderer.SVG=function(_312){
+var ie=navigator.appVersion.match(/MSIE (\d\.\d)/);
+var _313=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
+if(ie&&(ie[1]>=6)&&(!_313)){
+var _314=_312["width"]?_312["width"]:"100";
+var _315=_312["height"]?_312["height"]:"100";
+var eid=_312["id"]?_312["id"]:"notunique";
+var html="<svg:svg width=\""+_314+"\" height=\""+_315+"\" ";
+html+="id=\""+eid+"\" version=\"1.1\" baseProfile=\"full\" />";
+var _318=document.createElement(html);
+var _319=_318.getSVGDocument().createElementNS(PlotKit.SVGRenderer.SVGNS,"svg");
+_319.setAttribute("width",_314);
+_319.setAttribute("height",_315);
+_318.getSVGDocument().appendChild(_319);
+return _318;
+}else{
+return PlotKit.SVGRenderer.prototype.createSVGElement("svg",_312);
+}
+};
+PlotKit.SVGRenderer.isSupported=function(){
+var _320=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
+var _321=navigator.appVersion.match(/MSIE (\d\.\d)/);
+var _322=navigator.userAgent.match(/AppleWebKit\/(\d+)/);
+var _323=navigator.userAgent.match(/Opera\/(\d*\.\d*)/);
+var _324=navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/);
+var _325="http://www.w3.org/TR/SVG11/feature#SVG";
+if(_321&&(_321[1]>=6)&&!_320){
+return document.implementation.hasFeature(_325,"1.1");
+}
+if(_323&&(_323[1]>8.9)){
+return true;
+}
+if(_324&&(_324>1.7)){
+return true;
+}
+return false;
+};
+PlotKit.SVG={};
+PlotKit.SVG.SVGRenderer=PlotKit.SVGRenderer;
+PlotKit.SVG.EXPORT=["SVGRenderer"];
+PlotKit.SVG.EXPORT_OK=["SVGRenderer"];
+PlotKit.SVG.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.SVG.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.SVG);
+try{
+if(typeof (PlotKit.CanvasRenderer)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "SweetCanvas depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, Canvas}";
+}
+if(typeof (PlotKit.SweetCanvasRenderer)=="undefined"){
+PlotKit.SweetCanvasRenderer={};
+}
+PlotKit.SweetCanvasRenderer=function(_326,_327,_328){
+if(arguments.length>0){
+this.__init__(_326,_327,_328);
+}
+};
+PlotKit.SweetCanvasRenderer.NAME="PlotKit.SweetCanvasRenderer";
+PlotKit.SweetCanvasRenderer.VERSION=PlotKit.VERSION;
+PlotKit.SweetCanvasRenderer.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.SweetCanvasRenderer.toString=function(){
+return this.__repr__();
+};
+PlotKit.SweetCanvasRenderer.prototype=new PlotKit.CanvasRenderer();
+PlotKit.SweetCanvasRenderer.prototype.constructor=PlotKit.SweetCanvasRenderer;
+PlotKit.SweetCanvasRenderer.__super__=PlotKit.CanvasRenderer.prototype;
+PlotKit.SweetCanvasRenderer.prototype.__init__=function(el,_330,opts){
+var _331=PlotKit.Base.officeBlue();
+MochiKit.Base.update(_331,opts);
+PlotKit.SweetCanvasRenderer.__super__.__init__.call(this,el,_330,_331);
+};
+PlotKit.SweetCanvasRenderer.prototype._renderBarChart=function(){
+var bind=MochiKit.Base.bind;
+var _332=Color.blackColor().colorWithAlpha(0.1).toRGBString();
+var _333=function(_334,x,y,w,h){
+_334.fillStyle=_332;
+_334.fillRect(x-2,y-2,w+4,h+2);
+_334.fillStyle=_332;
+_334.fillRect(x-1,y-1,w+2,h+1);
+};
+var _335=this.options.colorScheme.length;
+var _336=this.options.colorScheme;
+var _337=PlotKit.Base.keys(this.layout.datasets);
+var _338=_337.length;
+var _339=function(name){
+for(var i=0;i<_338;i++){
+if(name==_337[i]){
+return _336[i%_335];
+}
+}
+return _336[0];
+};
+var _340=function(_341,bar){
+var x=this.area.w*bar.x+this.area.x;
+var y=this.area.h*bar.y+this.area.y;
+var w=this.area.w*bar.w;
+var h=this.area.h*bar.h;
+if((w<1)||(h<1)){
+return;
+}
+_341.save();
+_341.shadowBlur=5;
+_341.shadowColor=Color.fromHexString("#888888").toRGBString();
+if(this.isIE){
+_341.save();
+_341.fillStyle="#cccccc";
+_341.fillRect(x-2,y-2,w+4,h+2);
+_341.restore();
+}else{
+_333(_341,x,y,w,h);
+}
+if(this.options.shouldFill){
+_341.fillStyle=_339(bar.name).toRGBString();
+_341.fillRect(x,y,w,h);
+}
+_341.shadowBlur=0;
+_341.strokeStyle=Color.whiteColor().toRGBString();
+_341.lineWidth=2;
+if(this.options.shouldStroke){
+_341.strokeRect(x,y,w,h);
+}
+_341.restore();
+};
+this._renderBarChartWrap(this.layout.bars,bind(_340,this));
+};
+PlotKit.SweetCanvasRenderer.prototype._renderLineChart=function(){
+var _342=this.element.getContext("2d");
+var _343=this.options.colorScheme.length;
+var _344=this.options.colorScheme;
+var _345=PlotKit.Base.keys(this.layout.datasets);
+var _346=_345.length;
+var bind=MochiKit.Base.bind;
+for(var i=0;i<_346;i++){
+var _347=_345[i];
+var _348=_344[i%_343];
+var _349=this.options.strokeColorTransform;
+_342.save();
+var _350=function(ctx){
+ctx.beginPath();
+ctx.moveTo(this.area.x,this.area.y+this.area.h);
+var _351=function(ctx_,_352){
+if(_352.name==_347){
+ctx_.lineTo(this.area.w*_352.x+this.area.x,this.area.h*_352.y+this.area.y);
+}
+};
+MochiKit.Iter.forEach(this.layout.points,partial(_351,ctx),this);
+ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y);
+ctx.lineTo(this.area.x,this.area.y+this.area.h);
+ctx.closePath();
+};
+if(this.options.shouldFill){
+_342.save();
+if(this.isIE){
+_342.fillStyle="#cccccc";
+}else{
+_342.fillStyle=Color.blackColor().colorWithAlpha(0.2).toRGBString();
+}
+_342.translate(-1,-2);
+bind(_350,this)(_342);
+if(this.options.shouldFill){
+_342.fill();
+}
+_342.restore();
+}
+_342.shadowBlur=5;
+_342.shadowColor=Color.fromHexString("#888888").toRGBString();
+_342.fillStyle=_348.toRGBString();
+_342.lineWidth=2;
+_342.strokeStyle=Color.whiteColor().toRGBString();
+if(this.options.shouldFill){
+bind(_350,this)(_342);
+_342.fill();
+}
+if(this.options.shouldStroke){
+bind(_350,this)(_342);
+_342.stroke();
+}
+_342.restore();
+}
+};
+PlotKit.SweetCanvasRenderer.prototype._renderPieChart=function(){
+var _353=this.element.getContext("2d");
+var _354=this.options.colorScheme.length;
+var _355=this.layout.slices;
+var _356=this.area.x+this.area.w*0.5;
+var _357=this.area.y+this.area.h*0.5;
+var _358=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
+if(this.isIE){
+_356=parseInt(_356);
+_357=parseInt(_357);
+_358=parseInt(_358);
+}
+if(!this.isIE){
+_353.save();
+var _359=Color.blackColor().colorWithAlpha(0.2);
+_353.fillStyle=_359.toRGBString();
+_353.shadowBlur=5;
+_353.shadowColor=Color.fromHexString("#888888").toRGBString();
+_353.translate(1,1);
+_353.beginPath();
+_353.moveTo(_356,_357);
+_353.arc(_356,_357,_358+2,0,Math.PI*2,false);
+_353.closePath();
+_353.fill();
+_353.restore();
+}
+_353.save();
+_353.strokeStyle=Color.whiteColor().toRGBString();
+_353.lineWidth=2;
+for(var i=0;i<_355.length;i++){
+var _360=this.options.colorScheme[i%_354];
+_353.fillStyle=_360.toRGBString();
+var _361=function(){
+_353.beginPath();
+_353.moveTo(_356,_357);
+_353.arc(_356,_357,_358,_355[i].startAngle-Math.PI/2,_355[i].endAngle-Math.PI/2,false);
+_353.lineTo(_356,_357);
+_353.closePath();
+};
+if(Math.abs(_355[i].startAngle-_355[i].endAngle)>0.0001){
+if(this.options.shouldFill){
+_361();
+_353.fill();
+}
+if(this.options.shouldStroke){
+_361();
+_353.stroke();
+}
+}
+}
+_353.restore();
+};
+PlotKit.SweetCanvasRenderer.prototype._renderBackground=function(){
+var _362=this.element.getContext("2d");
+if(this.layout.style=="bar"||this.layout.style=="line"){
+_362.save();
+_362.fillStyle=this.options.backgroundColor.toRGBString();
+_362.fillRect(this.area.x,this.area.y,this.area.w,this.area.h);
+_362.strokeStyle=this.options.axisLineColor.toRGBString();
+_362.lineWidth=1;
+var _363=this.layout.yticks;
+var _364=false;
+if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){
+_363=this.layout.xticks;
+_364=true;
+}
+for(var i=0;i<_363.length;i++){
+var x1=0;
+var y1=0;
+var x2=0;
+var y2=0;
+if(_364){
+x1=_363[i][0]*this.area.w+this.area.x;
+y1=this.area.y;
+x2=x1;
+y2=y1+this.area.h;
+}else{
+x1=this.area.x;
+y1=_363[i][0]*this.area.h+this.area.y;
+x2=x1+this.area.w;
+y2=y1;
+}
+_362.beginPath();
+_362.moveTo(x1,y1);
+_362.lineTo(x2,y2);
+_362.closePath();
+_362.stroke();
+}
+_362.restore();
+}else{
+PlotKit.SweetCanvasRenderer.__super__._renderBackground.call(this);
+}
+};
+PlotKit.SweetCanvas={};
+PlotKit.SweetCanvas.SweetCanvasRenderer=PlotKit.SweetCanvasRenderer;
+PlotKit.SweetCanvas.EXPORT=["SweetCanvasRenderer"];
+PlotKit.SweetCanvas.EXPORT_OK=["SweetCanvasRenderer"];
+PlotKit.SweetCanvas.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.SweetCanvas.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.SweetCanvas);
+try{
+if(typeof (PlotKit.SVGRenderer)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}";
+}
+if(typeof (PlotKit.SweetSVGRenderer)=="undefined"){
+PlotKit.SweetSVGRenderer={};
+}
+PlotKit.SweetSVGRenderer=function(_365,_366,_367){
+if(arguments.length>0){
+this.__init__(_365,_366,_367);
+}
+};
+PlotKit.SweetSVGRenderer.NAME="PlotKit.SweetSVGRenderer";
+PlotKit.SweetSVGRenderer.VERSION=PlotKit.VERSION;
+PlotKit.SweetSVGRenderer.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.SweetSVGRenderer.toString=function(){
+return this.__repr__();
+};
+PlotKit.SweetSVGRenderer.prototype=new PlotKit.SVGRenderer();
+PlotKit.SweetSVGRenderer.prototype.constructor=PlotKit.SweetSVGRenderer;
+PlotKit.SweetSVGRenderer.__super__=PlotKit.SVGRenderer.prototype;
+PlotKit.SweetSVGRenderer.prototype.__init__=function(_368,_369,_370){
+var _371=PlotKit.Base.officeBlue();
+MochiKit.Base.update(_371,_370);
+PlotKit.SweetSVGRenderer.__super__.__init__.call(this,_368,_369,_371);
+};
+PlotKit.SweetSVGRenderer.prototype._addDropShadowFilter=function(){
+var _372=this.createSVGElement("filter",{x:0,y:0,"id":"dropShadow"});
+var _373=this.createSVGElement("feOffset",{"in":"SourceGraphic","dx":0,"dy":0,"result":"topCopy"});
+var blur=this.createSVGElement("feGaussianBlur",{"in":"SourceAlpha","StdDeviation":2,"result":"shadow"});
+var _375=this.createSVGElement("feOffset",{"in":"shadow","dx":-1,"dy":-2,"result":"movedShadow"});
+var _376=this.createSVGElement("feMerge");
+var _377=this.createSVGElement("feMergeNode",{"in":"topCopy"});
+var _378=this.createSVGElement("feMergeNode",{"in":"movedShadow"});
+_376.appendChild(_377);
+_376.appendChild(_378);
+_372.appendChild(_373);
+_372.appendChild(blur);
+_372.appendChild(_375);
+_372.appendChild(_376);
+this.defs.appendChild(_372);
+};
+PlotKit.SweetSVGRenderer.prototype._renderBarChart=function(){
+var bind=MochiKit.Base.bind;
+var _379=Color.blackColor().toRGBString();
+var _380="fill:"+_379+";fill-opacity:0.15";
+var _381="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString();
+var _382=function(_383,bar){
+var x=this.area.w*bar.x+this.area.x;
+var y=this.area.h*bar.y+this.area.y;
+var w=this.area.w*bar.w;
+var h=this.area.h*bar.h;
+if((w<1)||(h<1)){
+return;
+}
+_383["style"]=_381;
+this._drawRect(x-2,y-1,w+4,h+2,{"style":_380});
+this._drawRect(x,y,w,h,_383);
+};
+this._renderBarOrLine(this.layout.bars,bind(_382,this));
+};
+PlotKit.SweetSVGRenderer.prototype._renderLineChart=function(){
+var bind=MochiKit.Base.bind;
+var _384=Color.blackColor().toRGBString();
+var _385="fill:"+_384+";fill-opacity:0.15";
+var _386="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString();
+var _387=function(_388,_389){
+this._tempPointsBuffer+=(this.area.w*_389.x+this.area.x)+","+(this.area.h*_389.y+this.area.y)+" ";
+};
+var _390=function(_391){
+this._tempPointsBuffer="";
+this._tempPointsBuffer+=(this.area.x)+","+(this.area.y+this.area.h)+" ";
+};
+var _392=function(_393){
+this._tempPointsBuffer+=(this.area.w+this.area.x)+","+(this.area.h+this.area.y);
+_393["points"]=this._tempPointsBuffer;
+_393["stroke"]="none";
+_393["transform"]="translate(-2, -1)";
+_393["style"]=_385;
+var _394=this.createSVGElement("polygon",_393);
+this.root.appendChild(_394);
+_393["transform"]="";
+_393["style"]=_386;
+var elem=this.createSVGElement("polygon",_393);
+this.root.appendChild(elem);
+};
+this._renderBarOrLine(this.layout.points,bind(_387,this),bind(_390,this),bind(_392,this));
+};
+PlotKit.SweetSVGRenderer.prototype._renderPieChart=function(){
+var _395=this.area.x+this.area.w*0.5;
+var _396=this.area.y+this.area.h*0.5;
+var _397=Color.blackColor().toRGBString();
+var _398=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);
+var _399="fill:"+_397+";fill-opacity:0.15";
+var _400=this.createSVGElement("circle",{"style":_399,"cx":_395+1,"cy":_396+1,"r":_398+1});
+this.root.appendChild(_400);
+PlotKit.SweetSVGRenderer.__super__._renderPieChart.call(this);
+};
+PlotKit.SweetSVGRenderer.prototype._renderBackground=function(){
+var _401={"fill":this.options.backgroundColor.toRGBString(),"stroke":"none"};
+if(this.layout.style=="bar"||this.layout.style=="line"){
+this._drawRect(this.area.x,this.area.y,this.area.w,this.area.h,_401);
+var _402=this.layout.yticks;
+var _403=false;
+if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){
+_402=this.layout.xticks;
+_403=true;
+}
+for(var i=0;i<_402.length;i++){
+var x=0;
+var y=0;
+var w=0;
+var h=0;
+if(_403){
+x=_402[i][0]*this.area.w+this.area.x;
+y=this.area.y;
+w=1;
+h=this.area.w;
+}else{
+x=this.area.x;
+y=_402[i][0]*this.area.h+this.area.y;
+w=this.area.w;
+h=1;
+}
+this._drawRect(x,y,w,h,{"fill":this.options.axisLineColor.toRGBString()});
+}
+}else{
+PlotKit.SweetSVGRenderer.__super__._renderBackground.call(this);
+}
+};
+PlotKit.SweetSVG={};
+PlotKit.SweetSVG.SweetSVGRenderer=PlotKit.SweetSVGRenderer;
+PlotKit.SweetSVG.EXPORT=["SweetSVGRenderer"];
+PlotKit.SweetSVG.EXPORT_OK=["SweetSVGRenderer"];
+PlotKit.SweetSVG.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.SweetSVG.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.SweetSVG);
+try{
+if(typeof (PlotKit.CanvasRenderer)=="undefined"){
+throw "";
+}
+}
+catch(e){
+throw "PlotKit.EasyPlot depends on all of PlotKit's components";
+}
+if(typeof (PlotKit.EasyPlot)=="undefined"){
+PlotKit.EasyPlot={};
+}
+PlotKit.EasyPlot.NAME="PlotKit.EasyPlot";
+PlotKit.EasyPlot.VERSION=PlotKit.VERSION;
+PlotKit.EasyPlot.__repr__=function(){
+return "["+this.NAME+" "+this.VERSION+"]";
+};
+PlotKit.EasyPlot.toString=function(){
+return this.__repr__();
+};
+PlotKit.EasyPlot=function(_404,_405,_406,_407){
+this.layout=new Layout(_404,_405);
+this.divElem=_406;
+this.width=parseInt(_406.getAttribute("width"));
+this.height=parseInt(_406.getAttribute("height"));
+this.deferredCount=0;
+if(this.width<1){
+this.width=this.divElem.width?this.divElem.width:300;
+}
+if(this.height<1){
+this.height=this.divElem.height?this.divElem.height:300;
+}
+if(isArrayLike(_407)){
+for(var i=0;i<_407.length;i++){
+if(typeof (_407[i])=="string"){
+this.deferredCount++;
+var d=MochiKit.Async.doSimpleXMLHttpRequest(_407[i]);
+d.addCallback(MochiKit.Base.bind(PlotKit.EasyPlot.onDataLoaded,this));
+}else{
+if(isArrayLike(_407[i])){
+this.layout.addDataset("data-"+i,_407[i]);
+}
+}
+}
+}else{
+if(!isUndefinedOrNull(_407)){
+throw "Passed datasources are not Array like";
+}
+}
+if(CanvasRenderer.isSupported()){
+this.element=CANVAS({"id":this.divElem.getAttribute("id")+"-canvas","width":this.width,"height":this.height},"");
+this.divElem.appendChild(this.element);
+this.renderer=new SweetCanvasRenderer(this.element,this.layout,_405);
+}else{
+if(SVGRenderer.isSupported()){
+this.element=SVGRenderer.SVG({"id":this.divElem.getAttribute("id")+"-svg","width":this.width,"height":this.height,"version":"1.1","baseProfile":"full"},"");
+this.divElem.appendChild(this.element);
+this.renderer=new SweetSVGRenderer(this.element,this.layout,_405);
+}
+}
+if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){
+this.layout.evaluate();
+this.renderer.clear();
+this.renderer.render();
+}
+};
+PlotKit.EasyPlot.onDataLoaded=function(_409){
+var _410=new Array();
+var _411=_409.responseText.split("\n");
+for(var i=0;i<_411.length;i++){
+var _412=MochiKit.Format.strip(_411[i]);
+if((_412.length>1)&&(_412.charAt(0)!="#")){
+_410.push(_412.split(","));
+}
+}
+this.layout.addDataset("data-ajax-"+this.deferredCount,_410);
+this.deferredCount--;
+if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){
+this.layout.evaluate();
+this.renderer.clear();
+this.renderer.render();
+}
+};
+PlotKit.EasyPlot.prototype.reload=function(){
+this.layout.evaluate();
+this.renderer.clear();
+this.renderer.render();
+};
+PlotKit.EasyPlotModule={};
+PlotKit.EasyPlotModule.EasyPlot=PlotKit.EasyPlot;
+PlotKit.EasyPlotModule.EXPORT=["EasyPlot"];
+PlotKit.EasyPlotModule.EXPORT_OK=[];
+PlotKit.EasyPlotModule.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+PlotKit.EasyPlotModule.__new__();
+MochiKit.Base._exportSymbols(this,PlotKit.EasyPlotModule);
+
+
+// Copyright 2006 Dan Vanderkam (danvdk@gmail.com)
+// All Rights Reserved.
+
+/**
+ * @fileoverview Subclasses various parts of PlotKit to meet the additional
+ * needs of DateGraph: grid overlays and error bars
+ */
+
+// Subclass PlotKit.Layout to add:
+// 1. Sigma/errorBars properties
+// 2. Copy error terms for PlotKit.CanvasRenderer._renderLineChart
+
+/**
+ * Creates a new DateGraphLayout object. Options are the same as those allowed
+ * by the PlotKit.Layout constructor.
+ * @param {Object} options Options for PlotKit.Layout
+ * @return {Object} The DateGraphLayout object
+ */
+DateGraphLayout = function(options) {
+ PlotKit.Layout.call(this, "line", options);
+};
+DateGraphLayout.prototype = new PlotKit.Layout();
+
+/**
+ * Behaves the same way as PlotKit.Layout, but also copies the errors
+ * @private
+ */
+DateGraphLayout.prototype.evaluateWithError = function() {
+ this.evaluate();
+ if (!this.options.errorBars) return;
+
+ // Copy over the error terms
+ var i = 0; // index in this.points
+ for (var setName in this.datasets) {
+ var j = 0;
+ var dataset = this.datasets[setName];
+ if (PlotKit.Base.isFuncLike(dataset)) continue;
+ for (var j = 0; j < dataset.length; j++, i++) {
+ var item = dataset[j];
+ var xv = parseFloat(item[0]);
+ var yv = parseFloat(item[1]);
+
+ if (xv == this.points[i].xval &&
+ yv == this.points[i].yval) {
+ this.points[i].errorMinus = parseFloat(item[2]);
+ this.points[i].errorPlus = parseFloat(item[3]);
+ }
+ }
+ }
+};
+
+/**
+ * Convenience function to remove all the data sets from a graph
+ */
+DateGraphLayout.prototype.removeAllDatasets = function() {
+ delete this.datasets;
+ this.datasets = new Array();
+};
+
+/**
+ * Change the values of various layout options
+ * @param {Object} new_options an associative array of new properties
+ */
+DateGraphLayout.prototype.updateOptions = function(new_options) {
+ MochiKit.Base.update(this.options, new_options ? new_options : {});
+};
+
+// Subclass PlotKit.CanvasRenderer to add:
+// 1. X/Y grid overlay
+// 2. Ability to draw error bars (if required)
+
+/**
+ * Sets some PlotKit.CanvasRenderer options
+ * @param {Object} element The canvas to attach to
+ * @param {Layout} layout The DateGraphLayout object for this graph.
+ * @param {Object} options Options to pass on to CanvasRenderer
+ */
+DateGraphCanvasRenderer = function(element, layout, options) {
+ PlotKit.CanvasRenderer.call(this, element, layout, options);
+ this.options.shouldFill = false;
+ this.options.shouldStroke = true;
+ this.options.drawYGrid = true;
+ this.options.drawXGrid = true;
+ this.options.gridLineColor = MochiKit.Color.Color.grayColor();
+ MochiKit.Base.update(this.options, options);
+
+ // TODO(danvk) This shouldn't be necessary: effects should be overlaid
+ this.options.drawBackground = false;
+};
+DateGraphCanvasRenderer.prototype = new PlotKit.CanvasRenderer();
+
+/**
+ * Draw an X/Y grid on top of the existing plot
+ */
+DateGraphCanvasRenderer.prototype.render = function() {
+ // Do the ordinary rendering, as before
+ // TODO(danvk) Call super.render()
+ this._renderLineChart();
+ this._renderLineAxis();
+
+ // Draw the new X/Y grid
+ var ctx = this.element.getContext("2d");
+ if (this.options.drawYGrid) {
+ var ticks = this.layout.yticks;
+ ctx.save();
+ ctx.strokeStyle = this.options.gridLineColor.toRGBString();
+ ctx.lineWidth = this.options.axisLineWidth;
+ for (var i = 0; i < ticks.length; i++) {
+ var x = this.area.x;
+ var y = this.area.y + ticks[i][0] * this.area.h;
+ ctx.beginPath();
+ ctx.moveTo(x, y);
+ ctx.lineTo(x + this.area.w, y);
+ ctx.closePath();
+ ctx.stroke();
+ }
+ }
+
+ if (this.options.drawXGrid) {
+ var ticks = this.layout.xticks;
+ ctx.save();
+ ctx.strokeStyle = this.options.gridLineColor.toRGBString();
+ ctx.lineWidth = this.options.axisLineWidth;
+ for (var i=0; i<ticks.length; i++) {
+ var x = this.area.x + ticks[i][0] * this.area.w;
+ var y = this.area.y + this.area.h;
+ ctx.beginPath();
+ ctx.moveTo(x, y);
+ ctx.lineTo(x, this.area.y);
+ ctx.closePath();
+ ctx.stroke();
+ }
+ }
+};
+
+/**
+ * Overrides the CanvasRenderer method to draw error bars
+ */
+DateGraphCanvasRenderer.prototype._renderLineChart = function() {
+ var context = this.element.getContext("2d");
+ var colorCount = this.options.colorScheme.length;
+ var colorScheme = this.options.colorScheme;
+ var setNames = MochiKit.Base.keys(this.layout.datasets);
+ var errorBars = this.layout.options.errorBars;
+ var setCount = setNames.length;
+ var bind = MochiKit.Base.bind;
+ var partial = MochiKit.Base.partial;
+
+ //Update Points
+ var updatePoint = function(point) {
+ point.canvasx = this.area.w * point.x + this.area.x;
+ point.canvasy = this.area.h * point.y + this.area.y;
+ }
+ MochiKit.Iter.forEach(this.layout.points, updatePoint, this);
+
+ // create paths
+ var makePath = function(ctx) {
+ for (var i = 0; i < setCount; i++) {
+ var setName = setNames[i];
+ var color = colorScheme[i%colorCount];
+ var strokeX = this.options.strokeColorTransform;
+
+ // setup graphics context
+ context.save();
+ context.strokeStyle = color.toRGBString();
+ context.lineWidth = this.options.strokeWidth;
+ ctx.beginPath();
+ var point = this.layout.points[0];
+ var first_point = true;
+ var addPoint = function(ctx_, point) {
+ if (point.name == setName) {
+ if (first_point)
+ ctx_.moveTo(point.canvasx, point.canvasy);
+ else
+ ctx_.lineTo(point.canvasx, point.canvasy);
+ first_point = false;
+ }
+ };
+ MochiKit.Iter.forEach(this.layout.points, partial(addPoint, ctx), this);
+ ctx.stroke();
+ }
+ };
+
+ var makeErrorBars = function(ctx) {
+ for (var i = 0; i < setCount; i++) {
+ var setName = setNames[i];
+ var color = colorScheme[i % colorCount];
+ var strokeX = this.options.strokeColorTransform;
+
+ // setup graphics context
+ context.save();
+ context.strokeStyle = color.toRGBString();
+ context.lineWidth = this.options.strokeWidth;
+ var prevX = -1;
+ var prevYs = [-1, -1];
+ var count = 0;
+ var yscale = this.layout.yscale;
+ var errorTrapezoid = function(ctx_,point) {
+ count++;
+ if (point.name == setName) {
+ var newYs = [ point.y - point.errorPlus * yscale,
+ point.y + point.errorMinus * yscale ];
+ newYs[0] = this.area.h * newYs[0] + this.area.y;
+ newYs[1] = this.area.h * newYs[1] + this.area.y;
+ if (prevX >= 0) {
+ ctx_.moveTo(prevX, prevYs[0]);
+ ctx_.lineTo(point.canvasx, newYs[0]);
+ ctx_.lineTo(point.canvasx, newYs[1]);
+ ctx_.lineTo(prevX, prevYs[1]);
+ ctx_.closePath();
+ }
+ prevYs[0] = newYs[0];
+ prevYs[1] = newYs[1];
+ prevX = point.canvasx;
+ }
+ };
+ // should be same color as the lines
+ var err_color = color.colorWithAlpha(0.15);
+ ctx.fillStyle = err_color.toRGBString();
+ ctx.beginPath();
+ MochiKit.Iter.forEach(this.layout.points, partial(errorTrapezoid, ctx), this);
+ ctx.fill();
+ }
+ };
+
+ if (errorBars)
+ bind(makeErrorBars, this)(context);
+ bind(makePath, this)(context);
+ context.restore();
+};
+// Copyright 2006 Dan Vanderkam (danvdk@gmail.com)
+// All Rights Reserved.
+
+/**
+ * @fileoverview Creates an interactive, zoomable graph based on a CSV file or
+ * string. DateGraph can handle multiple series with or without error bars. The
+ * date/value ranges will be automatically set. DateGraph uses the
+ * <canvas> tag, so it only works in FF1.5+.
+ * @author danvdk@gmail.com (Dan Vanderkam)
+
+ Usage:
+ <div id="graphdiv" style="width:800px; height:500px;"></div>
+ <script type="text/javascript">
+ new DateGraph(document.getElementById("graphdiv"),
+ "datafile.csv",
+ ["Series 1", "Series 2"],
+ { }); // options
+ </script>
+
+ The CSV file is of the form
+
+ YYYYMMDD,A1,B1,C1
+ YYYYMMDD,A2,B2,C2
+
+ If null is passed as the third parameter (series names), then the first line
+ of the CSV file is assumed to contain names for each series.
+
+ If the 'errorBars' option is set in the constructor, the input should be of
+ the form
+
+ YYYYMMDD,A1,sigmaA1,B1,sigmaB1,...
+ YYYYMMDD,A2,sigmaA2,B2,sigmaB2,...
+
+ If the 'fractions' option is set, the input should be of the form:
+
+ YYYYMMDD,A1/B1,A2/B2,...
+ YYYYMMDD,A1/B1,A2/B2,...
+
+ And error bars will be calculated automatically using a binomial distribution.
+
+ For further documentation and examples, see http://www/~danvk/dg/
+
+ */
+
+/**
+ * An interactive, zoomable graph
+ * @param {String | Function} file A file containing CSV data or a function that
+ * returns this data. The expected format for each line is
+ * YYYYMMDD,val1,val2,... or, if attrs.errorBars is set,
+ * YYYYMMDD,val1,stddev1,val2,stddev2,...
+ * @param {Array.<String>} labels Labels for the data series
+ * @param {Object} attrs Various other attributes, e.g. errorBars determines
+ * whether the input data contains error ranges.
+ */
+DateGraph = function(div, file, labels, attrs) {
+ if (arguments.length > 0)
+ this.__init__(div, file, labels, attrs);
+};
+
+DateGraph.NAME = "DateGraph";
+DateGraph.VERSION = "1.1";
+DateGraph.__repr__ = function() {
+ return "[" + this.NAME + " " + this.VERSION + "]";
+};
+DateGraph.toString = function() {
+ return this.__repr__();
+};
+
+// Various default values
+DateGraph.DEFAULT_ROLL_PERIOD = 1;
+DateGraph.DEFAULT_WIDTH = 480;
+DateGraph.DEFAULT_HEIGHT = 320;
+DateGraph.DEFAULT_STROKE_WIDTH = 1.0;
+DateGraph.AXIS_LINE_WIDTH = 0.3;
+
+/**
+ * Initializes the DateGraph. This creates a new DIV and constructs the PlotKit
+ * and interaction <canvas> inside of it. See the constructor for details
+ * on the parameters.
+ * @param {String | Function} file Source data
+ * @param {Array.<String>} labels Names of the data series
+ * @param {Object} attrs Miscellaneous other options
+ * @private
+ */
+DateGraph.prototype.__init__ = function(div, file, labels, attrs) {
+ // Copy the important bits into the object
+ this.maindiv_ = div;
+ this.labels_ = labels;
+ this.file_ = file;
+ this.rollPeriod_ = attrs.rollPeriod || DateGraph.DEFAULT_ROLL_PERIOD;
+ this.previousVerticalX_ = -1;
+ this.width_ = parseInt(div.style.width, 10);
+ this.height_ = parseInt(div.style.height, 10);
+ this.errorBars_ = attrs.errorBars || false;
+ this.fractions_ = attrs.fractions || false;
+ this.strokeWidth_ = attrs.strokeWidth || DateGraph.DEFAULT_STROKE_WIDTH;
+ this.dateWindow_ = attrs.dateWindow || null;
+ this.valueRange_ = attrs.valueRange || null;
+ this.labelsSeparateLines = attrs.labelsSeparateLines || false;
+ this.labelsDiv_ = attrs.labelsDiv || null;
+ this.labelsKMB_ = attrs.labelsKMB || false;
+ this.minTickSize_ = attrs.minTickSize || 0;
+ this.xValueParser_ = attrs.xValueParser || DateGraph.prototype.dateParser;
+ this.xValueFormatter_ = attrs.xValueFormatter ||
+ DateGraph.prototype.dateString_;
+ this.xTicker_ = attrs.xTicker || DateGraph.prototype.dateTicker;
+ this.sigma_ = attrs.sigma || 2.0;
+ this.wilsonInterval_ = attrs.wilsonInterval || true;
+ this.customBars_ = attrs.customBars || false;
+ this.attrs_ = attrs;
+
+ // Make a note of whether labels will be pulled from the CSV file.
+ this.labelsFromCSV_ = (this.labels_ == null);
+ if (this.labels_ == null)
+ this.labels_ = [];
+
+ // Prototype of the callback is "void clickCallback(event, date)"
+ this.clickCallback_ = attrs.clickCallback || null;
+
+ // Prototype of zoom callback is "void dragCallback(minDate, maxDate)"
+ this.zoomCallback_ = attrs.zoomCallback || null;
+
+ // Create the containing DIV and other interactive elements
+ this.createInterface_();
+
+ // Create the PlotKit grapher
+ this.layoutOptions_ = { 'errorBars': (this.errorBars_ || this.customBars_),
+ 'xOriginIsZero': false };
+ MochiKit.Base.update(this.layoutOptions_, attrs);
+ this.setColors_(attrs);
+
+ this.layout_ = new DateGraphLayout(this.layoutOptions_);
+
+ this.renderOptions_ = { colorScheme: this.colors_,
+ strokeColor: null,
+ strokeWidth: this.strokeWidth_,
+ axisLabelFontSize: 14,
+ axisLineWidth: DateGraph.AXIS_LINE_WIDTH };
+ MochiKit.Base.update(this.renderOptions_, attrs);
+ this.plotter_ = new DateGraphCanvasRenderer(this.hidden_, this.layout_,
+ this.renderOptions_);
+
+ this.createStatusMessage_();
+ this.createRollInterface_();
+ this.createDragInterface_();
+
+ MochiKit.DOM.addLoadEvent(this.start_());
+};
+
+/**
+ * Returns the current rolling period, as set by the user or an option.
+ * @return {Number} The number of days in the rolling window
+ */
+DateGraph.prototype.rollPeriod = function() {
+ return this.rollPeriod_;
+}
+
+/**
+ * Generates interface elements for the DateGraph: a containing div, a div to
+ * display the current point, and a textbox to adjust the rolling average
+ * period.
+ * @private
+ */
+DateGraph.prototype.createInterface_ = function() {
+ // Create the all-enclosing graph div
+ var enclosing = this.maindiv_;
+
+ this.graphDiv = MochiKit.DOM.DIV( { style: { 'width': this.width_ + "px",
+ 'height': this.height_ + "px"
+ }});
+ appendChildNodes(enclosing, this.graphDiv);
+
+ // Create the canvas to store
+ var canvas = MochiKit.DOM.CANVAS;
+ this.canvas_ = canvas( { style: { 'position': 'absolute' },
+ width: this.width_,
+ height: this.height_});
+ appendChildNodes(this.graphDiv, this.canvas_);
+
+ this.hidden_ = this.createPlotKitCanvas_(this.canvas_);
+ connect(this.hidden_, 'onmousemove', this, function(e) { this.mouseMove_(e) });
+ connect(this.hidden_, 'onmouseout', this, function(e) { this.mouseOut_(e) });
+}
+
+/**
+ * Creates the canvas containing the PlotKit graph. Only plotkit ever draws on
+ * this particular canvas. All DateGraph work is done on this.canvas_.
+ * @param {Object} canvas The DateGraph canvas to over which to overlay the plot
+ * @return {Object} The newly-created canvas
+ * @private
+ */
+DateGraph.prototype.createPlotKitCanvas_ = function(canvas) {
+ var h = document.createElement("canvas");
+ h.style.position = "absolute";
+ h.style.top = canvas.style.top;
+ h.style.left = canvas.style.left;
+ h.width = this.width_;
+ h.height = this.height_;
+ MochiKit.DOM.appendChildNodes(this.graphDiv, h);
+ return h;
+};
+
+/**
+ * Generate a set of distinct colors for the data series. This is done with a
+ * color wheel. Saturation/Value are customizable, and the hue is
+ * equally-spaced around the color wheel. If a custom set of colors is
+ * specified, that is used instead.
+ * @param {Object} attrs Various attributes, e.g. saturation and value
+ * @private
+ */
+DateGraph.prototype.setColors_ = function(attrs) {
+ var num = this.labels_.length;
+ this.colors_ = [];
+ if (!attrs.colors) {
+ var sat = attrs.colorSaturation || 1.0;
+ var val = attrs.colorValue || 0.5;
+ for (var i = 1; i <= num; i++) {
+ var hue = (1.0*i/(1+num));
+ this.colors_.push( MochiKit.Color.Color.fromHSV(hue, sat, val) );
+ }
+ } else {
+ for (var i = 0; i < num; i++) {
+ var colorStr = attrs.colors[i % attrs.colors.length];
+ this.colors_.push( MochiKit.Color.Color.fromString(colorStr) );
+ }
+ }
+}
+
+/**
+ * Create the div that contains information on the selected point(s)
+ * This goes in the top right of the canvas, unless an external div has already
+ * been specified.
+ * @private
+ */
+DateGraph.prototype.createStatusMessage_ = function(){
+ if (!this.labelsDiv_) {
+ var divWidth = 250;
+ var messagestyle = { "style": {
+ "position": "absolute",
+ "fontSize": "14px",
+ "zIndex": 10,
+ "width": divWidth + "px",
+ "top": "0px",
+ "left": this.width_ - divWidth + "px",
+ "background": "white",
+ "textAlign": "left",
+ "overflow": "hidden"}};
+ this.labelsDiv_ = MochiKit.DOM.DIV(messagestyle);
+ MochiKit.DOM.appendChildNodes(this.graphDiv, this.labelsDiv_);
+ }
+};
+
+/**
+ * Create the text box to adjust the averaging period
+ * @return {Object} The newly-created text box
+ * @private
+ */
+DateGraph.prototype.createRollInterface_ = function() {
+ var padding = this.plotter_.options.padding;
+ var textAttr = { "type": "text",
+ "size": "2",
+ "value": this.rollPeriod_,
+ "style": { "position": "absolute",
+ "zIndex": 10,
+ "top": (this.height_ - 25 - padding.bottom) + "px",
+ "left": (padding.left+1) + "px" }
+ };
+ var roller = MochiKit.DOM.INPUT(textAttr);
+ var pa = this.graphDiv;
+ MochiKit.DOM.appendChildNodes(pa, roller);
+ connect(roller, 'onchange', this,
+ function() { this.adjustRoll(roller.value); });
+ return roller;
+}
+
+/**
+ * Set up all the mouse handlers needed to capture dragging behavior for zoom
+ * events. Uses MochiKit.Signal to attach all the event handlers.
+ * @private
+ */
+DateGraph.prototype.createDragInterface_ = function() {
+ var self = this;
+
+ // Tracks whether the mouse is down right now
+ var mouseDown = false;
+ var dragStartX = null;
+ var dragStartY = null;
+ var dragEndX = null;
+ var dragEndY = null;
+ var prevEndX = null;
+
+ // Utility function to convert page-wide coordinates to canvas coords
+ var px = PlotKit.Base.findPosX(this.canvas_);
+ var py = PlotKit.Base.findPosY(this.canvas_);
+ var getX = function(e) { return e.mouse().page.x - px };
+ var getY = function(e) { return e.mouse().page.y - py };
+
+ // Draw zoom rectangles when the mouse is down and the user moves around
+ connect(this.hidden_, 'onmousemove', function(event) {
+ if (mouseDown) {
+ dragEndX = getX(event);
+ dragEndY = getY(event);
+
+ self.drawZoomRect_(dragStartX, dragEndX, prevEndX);
+ prevEndX = dragEndX;
+ }
+ });
+
+ // Track the beginning of drag events
+ connect(this.hidden_, 'onmousedown', function(event) {
+ mouseDown = true;
+ dragStartX = getX(event);
+ dragStartY = getY(event);
+ });
+
+ // If the user releases the mouse button during a drag, but not over the
+ // canvas, then it doesn't count as a zooming action.
+ connect(document, 'onmouseup', this, function(event) {
+ if (mouseDown) {
+ mouseDown = false;
+ dragStartX = null;
+ dragStartY = null;
+ }
+ });
+
+ // Temporarily cancel the dragging event when the mouse leaves the graph
+ connect(this.hidden_, 'onmouseout', this, function(event) {
+ if (mouseDown) {
+ dragEndX = null;
+ dragEndY = null;
+ }
+ });
+
+ // If the mouse is released on the canvas during a drag event, then it's a
+ // zoom. Only do the zoom if it's over a large enough area (>= 10 pixels)
+ connect(this.hidden_, 'onmouseup', this, function(event) {
+ if (mouseDown) {
+ mouseDown = false;
+ dragEndX = getX(event);
+ dragEndY = getY(event);
+ var regionWidth = Math.abs(dragEndX - dragStartX);
+ var regionHeight = Math.abs(dragEndY - dragStartY);
+
+ if (regionWidth < 2 && regionHeight < 2 &&
+ self.clickCallback_ != null &&
+ self.lastx_ != undefined) {
+ self.clickCallback_(event, new Date(self.lastx_));
+ }
+
+ if (regionWidth >= 10) {
+ self.doZoom_(Math.min(dragStartX, dragEndX),
+ Math.max(dragStartX, dragEndX));
+ } else {
+ self.canvas_.getContext("2d").clearRect(0, 0,
+ self.canvas_.width,
+ self.canvas_.height);
+ }
+
+ dragStartX = null;
+ dragStartY = null;
+ }
+ });
+
+ // Double-clicking zooms back out
+ connect(this.hidden_, 'ondblclick', this, function(event) {
+ self.dateWindow_ = null;
+ self.drawGraph_(self.rawData_);
+ var minDate = self.rawData_[0][0];
+ var maxDate = self.rawData_[self.rawData_.length - 1][0];
+ self.zoomCallback_(minDate, maxDate);
+ });
+};
+
+/**
+ * Draw a gray zoom rectangle over the desired area of the canvas. Also clears
+ * up any previous zoom rectangles that were drawn. This could be optimized to
+ * avoid extra redrawing, but it's tricky to avoid interactions with the status
+ * dots.
+ * @param {Number} startX The X position where the drag started, in canvas
+ * coordinates.
+ * @param {Number} endX The current X position of the drag, in canvas coords.
+ * @param {Number} prevEndX The value of endX on the previous call to this
+ * function. Used to avoid excess redrawing
+ * @private
+ */
+DateGraph.prototype.drawZoomRect_ = function(startX, endX, prevEndX) {
+ var ctx = this.canvas_.getContext("2d");
+
+ // Clean up from the previous rect if necessary
+ if (prevEndX) {
+ ctx.clearRect(Math.min(startX, prevEndX), 0,
+ Math.abs(startX - prevEndX), this.height_);
+ }
+
+ // Draw a light-grey rectangle to show the new viewing area
+ if (endX && startX) {
+ ctx.fillStyle = "rgba(128,128,128,0.33)";
+ ctx.fillRect(Math.min(startX, endX), 0,
+ Math.abs(endX - startX), this.height_);
+ }
+};
+
+/**
+ * Zoom to something containing [lowX, highX]. These are pixel coordinates
+ * in the canvas. The exact zoom window may be slightly larger if there are no
+ * data points near lowX or highX. This function redraws the graph.
+ * @param {Number} lowX The leftmost pixel value that should be visible.
+ * @param {Number} highX The rightmost pixel value that should be visible.
+ * @private
+ */
+DateGraph.prototype.doZoom_ = function(lowX, highX) {
+ // Find the earliest and latest dates contained in this canvasx range.
+ var points = this.layout_.points;
+ var minDate = null;
+ var maxDate = null;
+ // Find the nearest [minDate, maxDate] that contains [lowX, highX]
+ for (var i = 0; i < points.length; i++) {
+ var cx = points[i].canvasx;
+ var x = points[i].xval;
+ if (cx < lowX && (minDate == null || x > minDate)) minDate = x;
+ if (cx > highX && (maxDate == null || x < maxDate)) maxDate = x;
+ }
+ // Use the extremes if either is missing
+ if (minDate == null) minDate = points[0].xval;
+ if (maxDate == null) maxDate = points[points.length-1].xval;
+
+ this.dateWindow_ = [minDate, maxDate];
+ this.drawGraph_(this.rawData_);
+ this.zoomCallback_(minDate, maxDate);
+};
+
+/**
+ * When the mouse moves in the canvas, display information about a nearby data
+ * point and draw dots over those points in the data series. This function
+ * takes care of cleanup of previously-drawn dots.
+ * @param {Object} event The mousemove event from the browser.
+ * @private
+ */
+DateGraph.prototype.mouseMove_ = function(event) {
+ var canvasx = event.mouse().page.x - PlotKit.Base.findPosX(this.hidden_);
+ var points = this.layout_.points;
+
+ var lastx = -1;
+ var lasty = -1;
+
+ // Loop through all the points and find the date nearest to our current
+ // location.
+ var minDist = 1e+100;
+ var idx = -1;
+ for (var i = 0; i < points.length; i++) {
+ var dist = Math.abs(points[i].canvasx - canvasx);
+ if (dist > minDist) break;
+ minDist = dist;
+ idx = i;
+ }
+ if (idx >= 0) lastx = points[idx].xval;
+ // Check that you can really highlight the last day's data
+ if (canvasx > points[points.length-1].canvasx)
+ lastx = points[points.length-1].xval;
+
+ // Extract the points we've selected
+ var selPoints = [];
+ for (var i = 0; i < points.length; i++) {
+ if (points[i].xval == lastx) {
+ selPoints.push(points[i]);
+ }
+ }
+
+ // Clear the previously drawn vertical, if there is one
+ var circleSize = 3;
+ var ctx = this.canvas_.getContext("2d");
+ if (this.previousVerticalX_ >= 0) {
+ var px = this.previousVerticalX_;
+ ctx.clearRect(px - circleSize - 1, 0, 2 * circleSize + 2, this.height_);
+ }
+
+ if (selPoints.length > 0) {
+ var canvasx = selPoints[0].canvasx;
+
+ // Set the status message to indicate the selected point(s)
+ var replace = this.xValueFormatter_(lastx) + ":";
+ var clen = this.colors_.length;
+ for (var i = 0; i < selPoints.length; i++) {
+ if (this.labelsSeparateLines) {
+ replace += "<br/>";
+ }
+ var point = selPoints[i];
+ replace += " <b><font color='" + this.colors_[i%clen].toHexString() + "'>"
+ + point.name + "</font></b>:"
+ + this.round_(point.yval, 2);
+ }
+ this.labelsDiv_.innerHTML = replace;
+
+ // Save last x position for callbacks.
+ this.lastx_ = lastx;
+
+ // Draw colored circles over the center of each selected point
+ ctx.save()
+ for (var i = 0; i < selPoints.length; i++) {
+ ctx.beginPath();
+ ctx.fillStyle = this.colors_[i%clen].toRGBString();
+ ctx.arc(canvasx, selPoints[i%clen].canvasy, circleSize, 0, 360, false);
+ ctx.fill();
+ }
+ ctx.restore();
+
+ this.previousVerticalX_ = canvasx;
+ }
+};
+
+/**
+ * The mouse has left the canvas. Clear out whatever artifacts remain
+ * @param {Object} event the mouseout event from the browser.
+ * @private
+ */
+DateGraph.prototype.mouseOut_ = function(event) {
+ // Get rid of the overlay data
+ var ctx = this.canvas_.getContext("2d");
+ ctx.clearRect(0, 0, this.width_, this.height_);
+ this.labelsDiv_.innerHTML = "";
+};
+
+/**
+ * Convert a JS date (millis since epoch) to YYYY/MM/DD
+ * @param {Number} date The JavaScript date (ms since epoch)
+ * @return {String} A date of the form "YYYY/MM/DD"
+ * @private
+ */
+DateGraph.prototype.dateString_ = function(date) {
+ var d = new Date(date);
+
+ // Get the year:
+ var year = "" + d.getFullYear();
+ // Get a 0 padded month string
+ var month = "" + (d.getMonth() + 1); //months are 0-offset, sigh
+ if (month.length < 2) month = "0" + month;
+ // Get a 0 padded day string
+ var day = "" + d.getDate();
+ if (day.length < 2) day = "0" + day;
+
+ return year + "/" + month + "/" + day;
+};
+
+/**
+ * Round a number to the specified number of digits past the decimal point.
+ * @param {Number} num The number to round
+ * @param {Number} places The number of decimals to which to round
+ * @return {Number} The rounded number
+ * @private
+ */
+DateGraph.prototype.round_ = function(num, places) {
+ var shift = Math.pow(10, places);
+ return Math.round(num * shift)/shift;
+};
+
+/**
+ * Fires when there's data available to be graphed.
+ * @param {String} data Raw CSV data to be plotted
+ * @private
+ */
+DateGraph.prototype.loadedEvent_ = function(data) {
+ this.rawData_ = this.parseCSV_(data);
+ this.drawGraph_(this.rawData_);
+};
+
+DateGraph.prototype.months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
+DateGraph.prototype.quarters = ["Jan", "Apr", "Jul", "Oct"];
+
+/**
+ * Add ticks on the x-axis representing years, months, quarters, weeks, or days
+ * @private
+ */
+DateGraph.prototype.addXTicks_ = function() {
+ // Determine the correct ticks scale on the x-axis: quarterly, monthly, ...
+ var startDate, endDate;
+ if (this.dateWindow_) {
+ startDate = this.dateWindow_[0];
+ endDate = this.dateWindow_[1];
+ } else {
+ startDate = this.rawData_[0][0];
+ endDate = this.rawData_[this.rawData_.length - 1][0];
+ }
+
+ var xTicks = this.xTicker_(startDate, endDate);
+ this.layout_.updateOptions({xTicks: xTicks});
+}
+
+/**
+ * Add ticks to the x-axis based on a date range.
+ * @param {Number} startDate Start of the date window (millis since epoch)
+ * @param {Number} endDate End of the date window (millis since epoch)
+ * @return {Array.<Object>} Array of {label, value} tuples.
+ * @public
+ */
+DateGraph.prototype.dateTicker = function(startDate, endDate) {
+ var ONE_DAY = 24*60*60*1000;
+ startDate = startDate / ONE_DAY;
+ endDate = endDate / ONE_DAY;
+ var dateSpan = endDate - startDate;
+
+ var scale = [];
+ var isMonthly = false;
+ var yearMod = 1;
+ if (dateSpan > 30 * 366) { // decadal
+ isMonthly = true;
+ scale = ["Jan"];
+ yearMod = 10;
+ } else if (dateSpan > 4*366) { // annual
+ scale = ["Jan"];
+ isMonthly = true;
+ } else if (dateSpan > 366) { // quarterly
+ scale = this.quarters;
+ isMonthly = true;
+ } else if (dateSpan > 40) { // monthly
+ scale = this.months;
+ isMonthly = true;
+ } else if (dateSpan > 10) { // weekly
+ for (var week = startDate - 14; week < endDate + 14; week += 7) {
+ scale.push(week * ONE_DAY);
+ }
+ } else { // daily
+ for (var day = startDate - 14; day < endDate + 14; day += 1) {
+ scale.push(day * ONE_DAY);
+ }
+ }
+
+ var xTicks = [];
+
+ if (isMonthly) {
+ var startYear = 1900 + (new Date(startDate* ONE_DAY)).getYear();
+ var endYear = 1900 + (new Date(endDate * ONE_DAY)).getYear();
+ for (var i = startYear; i <= endYear; i++) {
+ if (i % yearMod != 0) continue;
+ for (var j = 0; j < scale.length; j++ ) {
+ var date = Date.parse(scale[j] + " 1, " + i);
+ xTicks.push( {label: scale[j] + "'" + ("" + i).substr(2,2), v: date } );
+ }
+ }
+ } else {
+ for (var i = 0; i < scale.length; i++) {
+ var date = new Date(scale[i]);
+ var year = date.getFullYear().toString();
+ var label = this.months[date.getMonth()] + date.getDate();
+ label += "'" + year.substr(year.length - 2, 2);
+ xTicks.push( {label: label, v: date} );
+ }
+ }
+ return xTicks;
+};
+
+/**
+ * Add ticks when the x axis has numbers on it (instead of dates)
+ * @param {Number} startDate Start of the date window (millis since epoch)
+ * @param {Number} endDate End of the date window (millis since epoch)
+ * @return {Array.<Object>} Array of {label, value} tuples.
+ * @public
+ */
+DateGraph.prototype.numericTicks = function(minV, maxV) {
+ var scale;
+ if (maxV <= 0.0) {
+ scale = 1.0;
+ } else {
+ scale = Math.pow( 10, Math.floor(Math.log(maxV)/Math.log(10.0)) );
+ }
+
+ // Add a smallish number of ticks at human-friendly points
+ var nTicks = (maxV - minV) / scale;
+ while (2 * nTicks < 20) {
+ nTicks *= 2;
+ }
+ if ((maxV - minV) / nTicks < this.minTickSize_) {
+ nTicks = this.round_((maxV - minV) / this.minTickSize_, 1);
+ }
+
+ // Construct labels for the ticks
+ var ticks = [];
+ for (var i = 0; i <= nTicks; i++) {
+ var tickV = minV + i * (maxV - minV) / nTicks;
+ var label = this.round_(tickV, 2);
+ if (this.labelsKMB_) {
+ var k = 1000;
+ if (tickV >= k*k*k) {
+ label = this.round_(tickV/(k*k*k), 1) + "B";
+ } else if (tickV >= k*k) {
+ label = this.round_(tickV/(k*k), 1) + "M";
+ } else if (tickV >= k) {
+ label = this.round_(tickV/k, 1) + "K";
+ }
+ }
+ ticks.push( {label: label, v: tickV} );
+ }
+ return ticks;
+};
+
+/**
+ * Adds appropriate ticks on the y-axis
+ * @param {Number} minY The minimum Y value in the data set
+ * @param {Number} maxY The maximum Y value in the data set
+ * @private
+ */
+DateGraph.prototype.addYTicks_ = function(minY, maxY) {
+ // Set the number of ticks so that the labels are human-friendly.
+ var ticks = this.numericTicks(minY, maxY);
+ this.layout_.updateOptions( { yAxis: [minY, maxY],
+ yTicks: ticks } );
+};
+
+/**
+ * Update the graph with new data. Data is in the format
+ * [ [date1, val1, val2, ...], [date2, val1, val2, ...] if errorBars=false
+ * or, if errorBars=true,
+ * [ [date1, [val1,stddev1], [val2,stddev2], ...], [date2, ...], ...]
+ * @param {Array.<Object>} data The data (see above)
+ * @private
+ */
+DateGraph.prototype.drawGraph_ = function(data) {
+ var maxY = null;
+ this.layout_.removeAllDatasets();
+ // Loop over all fields in the dataset
+ for (var i = 1; i < data[0].length; i++) {
+ var series = [];
+ for (var j = 0; j < data.length; j++) {
+ var date = data[j][0];
+ series[j] = [date, data[j][i]];
+ }
+ series = this.rollingAverage(series, this.rollPeriod_);
+
+ // Prune down to the desired range, if necessary (for zooming)
+ var bars = this.errorBars_ || this.customBars_;
+ if (this.dateWindow_) {
+ var low = this.dateWindow_[0];
+ var high= this.dateWindow_[1];
+ var pruned = [];
+ for (var k = 0; k < series.length; k++) {
+ if (series[k][0] >= low && series[k][0] <= high) {
+ pruned.push(series[k]);
+ var y = bars ? series[k][1][0] : series[k][1];
+ if (maxY == null || y > maxY) maxY = y;
+ }
+ }
+ series = pruned;
+ } else {
+ for (var j = 0; j < series.length; j++) {
+ var y = bars ? series[j][1][0] : series[j][1];
+ if (maxY == null || y > maxY) {
+ maxY = bars ? y + series[j][1][1] : y;
+ }
+ }
+ }
+
+ if (bars) {
+ var vals = [];
+ for (var j=0; j<series.length; j++)
+ vals[j] = [series[j][0],
+ series[j][1][0], series[j][1][1], series[j][1][2]];
+ this.layout_.addDataset(this.labels_[i - 1], vals);
+ } else {
+ this.layout_.addDataset(this.labels_[i - 1], series);
+ }
+ }
+
+ // Use some heuristics to come up with a good maxY value, unless it's been
+ // set explicitly by the user.
+ if (this.valueRange_ != null) {
+ this.addYTicks_(this.valueRange_[0], this.valueRange_[1]);
+ } else {
+ // Add some padding and round up to an integer to be human-friendly.
+ maxY *= 1.1;
+ if (maxY <= 0.0) maxY = 1.0;
+ else {
+ var scale = Math.pow(10, Math.floor(Math.log(maxY) / Math.log(10.0)));
+ maxY = scale * Math.ceil(maxY / scale);
+ }
+ this.addYTicks_(0, maxY);
+ }
+
+ this.addXTicks_();
+
+ // Tell PlotKit to use this new data and render itself
+ this.layout_.evaluateWithError();
+ this.plotter_.clear();
+ this.plotter_.render();
+ this.canvas_.getContext('2d').clearRect(0, 0,
+ this.canvas_.width, this.canvas_.height);
+};
+
+/**
+ * Calculates the rolling average of a data set.
+ * If originalData is [label, val], rolls the average of those.
+ * If originalData is [label, [, it's interpreted as [value, stddev]
+ * and the roll is returned in the same form, with appropriately reduced
+ * stddev for each value.
+ * Note that this is where fractional input (i.e. '5/10') is converted into
+ * decimal values.
+ * @param {Array} originalData The data in the appropriate format (see above)
+ * @param {Number} rollPeriod The number of days over which to average the data
+ */
+DateGraph.prototype.rollingAverage = function(originalData, rollPeriod) {
+ if (originalData.length < 2)
+ return originalData;
+ var rollPeriod = Math.min(rollPeriod, originalData.length - 1);
+ var rollingData = [];
+ var sigma = this.sigma_;
+
+ if (this.fractions_) {
+ var num = 0;
+ var den = 0; // numerator/denominator
+ var mult = 100.0;
+ for (var i = 0; i < originalData.length; i++) {
+ num += originalData[i][1][0];
+ den += originalData[i][1][1];
+ if (i - rollPeriod >= 0) {
+ num -= originalData[i - rollPeriod][1][0];
+ den -= originalData[i - rollPeriod][1][1];
+ }
+
+ var date = originalData[i][0];
+ var value = den ? num / den : 0.0;
+ if (this.errorBars_) {
+ if (this.wilsonInterval_) {
+ // For more details on this confidence interval, see:
+ // http://en.wikipedia.org/wiki/Binomial_confidence_interval
+ if (den) {
+ var p = value < 0 ? 0 : value, n = den;
+ var pm = sigma * Math.sqrt(p*(1-p)/n + sigma*sigma/(4*n*n));
+ var denom = 1 + sigma * sigma / den;
+ var low = (p + sigma * sigma / (2 * den) - pm) / denom;
+ var high = (p + sigma * sigma / (2 * den) + pm) / denom;
+ rollingData[i] = [date,
+ [p * mult, (p - low) * mult, (high - p) * mult]];
+ } else {
+ rollingData[i] = [date, [0, 0, 0]];
+ }
+ } else {
+ var stddev = den ? sigma * Math.sqrt(value * (1 - value) / den) : 1.0;
+ rollingData[i] = [date, [mult * value, mult * stddev, mult * stddev]];
+ }
+ } else {
+ rollingData[i] = [date, mult * value];
+ }
+ }
+ } else if (this.customBars_) {
+ // just ignore the rolling for now.
+ // TODO(danvk): do something reasonable.
+ for (var i = 0; i < originalData.length; i++) {
+ var data = originalData[i][1];
+ var y = data[1];
+ rollingData[i] = [originalData[i][0], [y, y - data[0], data[2] - y]];
+ }
+ } else {
+ // Calculate the rolling average for the first rollPeriod - 1 points where
+ // there is not enough data to roll over the full number of days
+ var num_init_points = Math.min(rollPeriod - 1, originalData.length - 2);
+ if (!this.errorBars_){
+ for (var i = 0; i < num_init_points; i++) {
+ var sum = 0;
+ for (var j = 0; j < i + 1; j++)
+ sum += originalData[j][1];
+ rollingData[i] = [originalData[i][0], sum / (i + 1)];
+ }
+ // Calculate the rolling average for the remaining points
+ for (var i = Math.min(rollPeriod - 1, originalData.length - 2);
+ i < originalData.length;
+ i++) {
+ var sum = 0;
+ for (var j = i - rollPeriod + 1; j < i + 1; j++)
+ sum += originalData[j][1];
+ rollingData[i] = [originalData[i][0], sum / rollPeriod];
+ }
+ } else {
+ for (var i = 0; i < num_init_points; i++) {
+ var sum = 0;
+ var variance = 0;
+ for (var j = 0; j < i + 1; j++) {
+ sum += originalData[j][1][0];
+ variance += Math.pow(originalData[j][1][1], 2);
+ }
+ var stddev = Math.sqrt(variance)/(i+1);
+ rollingData[i] = [originalData[i][0],
+ [sum/(i+1), sigma * stddev, sigma * stddev]];
+ }
+ // Calculate the rolling average for the remaining points
+ for (var i = Math.min(rollPeriod - 1, originalData.length - 2);
+ i < originalData.length;
+ i++) {
+ var sum = 0;
+ var variance = 0;
+ for (var j = i - rollPeriod + 1; j < i + 1; j++) {
+ sum += originalData[j][1][0];
+ variance += Math.pow(originalData[j][1][1], 2);
+ }
+ var stddev = Math.sqrt(variance) / rollPeriod;
+ rollingData[i] = [originalData[i][0],
+ [sum / rollPeriod, sigma * stddev, sigma * stddev]];
+ }
+ }
+ }
+
+ return rollingData;
+};
+
+/**
+ * Parses a date, returning the number of milliseconds since epoch. This can be
+ * passed in as an xValueParser in the DateGraph constructor.
+ * @param {String} A date in YYYYMMDD format.
+ * @return {Number} Milliseconds since epoch.
+ * @public
+ */
+DateGraph.prototype.dateParser = function(dateStr) {
+ var dateStrSlashed;
+ if (dateStr.search("-") != -1) {
+ dateStrSlashed = dateStr.replace("-", "/", "g");
+ } else if (dateStr.search("/") != -1) {
+ return Date.parse(dateStr);
+ } else {
+ dateStrSlashed = dateStr.substr(0,4) + "/" + dateStr.substr(4,2)
+ + "/" + dateStr.substr(6,2);
+ }
+ return Date.parse(dateStrSlashed);
+};
+
+/**
+ * Parses a string in a special csv format. We expect a csv file where each
+ * line is a date point, and the first field in each line is the date string.
+ * We also expect that all remaining fields represent series.
+ * if this.errorBars_ is set, then interpret the fields as:
+ * date, series1, stddev1, series2, stddev2, ...
+ * @param {Array.<Object>} data See above.
+ * @private
+ */
+DateGraph.prototype.parseCSV_ = function(data) {
+ var ret = [];
+ var lines = data.split("\n");
+ var start = this.labelsFromCSV_ ? 1 : 0;
+ if (this.labelsFromCSV_) {
+ var labels = lines[0].split(",");
+ labels.shift(); // a "date" parameter is assumed.
+ this.labels_ = labels;
+ // regenerate automatic colors.
+ this.setColors_(this.attrs_);
+ this.renderOptions_.colorScheme = this.colors_;
+ MochiKit.Base.update(this.plotter_.options, this.renderOptions_);
+ MochiKit.Base.update(this.layoutOptions_, this.attrs_);
+ }
+
+ for (var i = start; i < lines.length; i++) {
+ var line = lines[i];
+ if (line.length == 0) continue; // skip blank lines
+ var inFields = line.split(',');
+ if (inFields.length < 2)
+ continue;
+
+ var fields = [];
+ fields[0] = this.xValueParser_(inFields[0]);
+
+ // If fractions are expected, parse the numbers as "A/B"
+ if (this.fractions_) {
+ for (var j = 1; j < inFields.length; j++) {
+ // TODO(danvk): figure out an appropriate way to flag parse errors.
+ var vals = inFields[j].split("/");
+ fields[j] = [parseFloat(vals[0]), parseFloat(vals[1])];
+ }
+ } else if (this.errorBars_) {
+ // If there are error bars, values are (value, stddev) pairs
+ for (var j = 1; j < inFields.length; j += 2)
+ fields[(j + 1) / 2] = [parseFloat(inFields[j]),
+ parseFloat(inFields[j + 1])];
+ } else if (this.customBars_) {
+ // Bars are a low;center;high tuple
+ for (var j = 1; j < inFields.length; j++) {
+ var vals = inFields[j].split(";");
+ fields[j] = [ parseFloat(vals[0]),
+ parseFloat(vals[1]),
+ parseFloat(vals[2]) ];
+ }
+ } else {
+ // Values are just numbers
+ for (var j = 1; j < inFields.length; j++)
+ fields[j] = parseFloat(inFields[j]);
+ }
+ ret.push(fields);
+ }
+ return ret;
+};
+
+/**
+ * Get the CSV data. If it's in a function, call that function. If it's in a
+ * file, do an XMLHttpRequest to get it.
+ * @private
+ */
+DateGraph.prototype.start_ = function() {
+ if (typeof this.file_ == 'function') {
+ // Stubbed out to allow this to run off a filesystem
+ this.loadedEvent_(this.file_());
+ } else {
+ var req = new XMLHttpRequest();
+ var caller = this;
+ req.onreadystatechange = function () {
+ if (req.readyState == 4) {
+ if (req.status == 200) {
+ caller.loadedEvent_(req.responseText);
+ }
+ }
+ };
+
+ req.open("GET", this.file_, true);
+ req.send(null);
+ }
+};
+
+/**
+ * Changes various properties of the graph. These can include:
+ * <ul>
+ * <li>file: changes the source data for the graph</li>
+ * <li>errorBars: changes whether the data contains stddev</li>
+ * </ul>
+ * @param {Object} attrs The new properties and values
+ */
+DateGraph.prototype.updateOptions = function(attrs) {
+ if (attrs.errorBars) {
+ this.errorBars_ = attrs.errorBars;
+ }
+ if (attrs.customBars) {
+ this.customBars_ = attrs.customBars;
+ }
+ if (attrs.strokeWidth) {
+ this.strokeWidth_ = attrs.strokeWidth;
+ }
+ if (attrs.rollPeriod) {
+ this.rollPeriod_ = attrs.rollPeriod;
+ }
+ if (attrs.dateWindow) {
+ this.dateWindow_ = attrs.dateWindow;
+ }
+ if (attrs.valueRange) {
+ this.valueRange_ = attrs.valueRange;
+ }
+ if (attrs.minTickSize) {
+ this.minTickSize_ = attrs.minTickSize;
+ }
+ if (typeof(attrs.labels) != 'undefined') {
+ this.labels_ = attrs.labels;
+ this.labelsFromCSV_ = (attrs.labels == null);
+ }
+ this.layout_.updateOptions({ 'errorBars': this.errorBars_ });
+ if (attrs['file'] && attrs['file'] != this.file_) {
+ this.file_ = attrs['file'];
+ this.start_();
+ } else {
+ this.drawGraph_(this.rawData_);
+ }
+};
+
+/**
+ * Adjusts the number of days in the rolling average. Updates the graph to
+ * reflect the new averaging period.
+ * @param {Number} length Number of days over which to average the data.
+ */
+DateGraph.prototype.adjustRoll = function(length) {
+ this.rollPeriod_ = length;
+ this.drawGraph_(this.rawData_);
+};