-}
-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);
-
-
-// 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();
- }
- };