Changeset 1359

Show
Ignore:
Timestamp:
04/19/08 03:43:28 (3 months ago)
Author:
cederberg@gmail.com
Message:

Updated MochiKit.Visual.Transitions to clarify the code and fix issues in pulse, flicker and wobble (patch from Christoph Zwerschke).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mochikit/trunk/MochiKit/Visual.js

    r1340 r1359  
    448448/** @id MochiKit.Visual.Transitions.sinoidal */ 
    449449MochiKit.Visual.Transitions.sinoidal = function (pos) { 
    450     return (-Math.cos(pos*Math.PI)/2) + 0.5
     450    return 0.5 - Math.cos(pos*Math.PI)/2
    451451}; 
    452452 
     
    458458/** @id MochiKit.Visual.Transitions.flicker */ 
    459459MochiKit.Visual.Transitions.flicker = function (pos) { 
    460     return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4
     460    return 0.25 - Math.cos(pos*Math.PI)/4 + Math.random()/2
    461461}; 
    462462 
    463463/** @id MochiKit.Visual.Transitions.wobble */ 
    464464MochiKit.Visual.Transitions.wobble = function (pos) { 
    465     return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5
     465    return 0.5 - Math.cos(9*pos*Math.PI)/2
    466466}; 
    467467 
    468468/** @id MochiKit.Visual.Transitions.pulse */ 
    469469MochiKit.Visual.Transitions.pulse = function (pos, pulses) { 
    470     if (!pulses) { 
    471         return (Math.floor(pos*10) % 2 === 0 ? 
    472             (pos*10 - Math.floor(pos*10)) : 1 - (pos*10 - Math.floor(pos*10))); 
    473     } 
    474     return (Math.round((pos % (1/pulses)) * pulses) == 0 ? 
    475             ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : 
    476         1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)))
     470    if (pulses) { 
     471        pos *= 2 * pulses; 
     472    } else { 
     473        pos *= 10; 
     474    } 
     475    var decimals = pos - Math.floor(pos); 
     476    return (Math.floor(pos) % 2 == 0) ? decimals : 1 - decimals
    477477}; 
    478478 
  • mochikit/trunk/packed/MochiKit/MochiKit.js

    r1355 r1359  
    57785778}; 
    57795779MochiKit.Visual.Transitions.sinoidal=function(pos){ 
    5780 return (-Math.cos(pos*Math.PI)/2)+0.5
     5780return 0.5-Math.cos(pos*Math.PI)/2
    57815781}; 
    57825782MochiKit.Visual.Transitions.reverse=function(pos){ 
     
    57845784}; 
    57855785MochiKit.Visual.Transitions.flicker=function(pos){ 
    5786 return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4
     5786return 0.25-Math.cos(pos*Math.PI)/4+Math.random()/2
    57875787}; 
    57885788MochiKit.Visual.Transitions.wobble=function(pos){ 
    5789 return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5
     5789return 0.5-Math.cos(9*pos*Math.PI)/2
    57905790}; 
    57915791MochiKit.Visual.Transitions.pulse=function(pos,_61d){ 
    5792 if(!_61d){ 
    5793 return (Math.floor(pos*10)%2===0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10))); 
    5794 
    5795 return (Math.round((pos%(1/_61d))*_61d)==0?((pos*_61d*2)-Math.floor(pos*_61d*2)):1-((pos*_61d*2)-Math.floor(pos*_61d*2))); 
     5792if(_61d){ 
     5793pos*=2*_61d; 
     5794}else{ 
     5795pos*=10; 
     5796
     5797var _61e=pos-Math.floor(pos); 
     5798return (Math.floor(pos)%2==0)?_61e:1-_61e; 
    57965799}; 
    57975800MochiKit.Visual.Transitions.none=function(pos){ 
     
    58115814this.effects=[]; 
    58125815this.interval=null; 
    5813 },add:function(_621){ 
    5814 var _622=new Date().getTime(); 
    5815 var _623=(typeof (_621.options.queue)=="string")?_621.options.queue:_621.options.queue.position; 
     5816},add:function(_622){ 
     5817var _623=new Date().getTime(); 
     5818var _624=(typeof (_622.options.queue)=="string")?_622.options.queue:_622.options.queue.position; 
    58165819var ma=MochiKit.Base.map; 
    5817 switch(_623){ 
     5820switch(_624){ 
    58185821case "front": 
    58195822ma(function(e){ 
    58205823if(e.state=="idle"){ 
    5821 e.startOn+=_621.finishOn; 
    5822 e.finishOn+=_621.finishOn; 
     5824e.startOn+=_622.finishOn; 
     5825e.finishOn+=_622.finishOn; 
    58235826} 
    58245827},this.effects); 
    58255828break; 
    58265829case "end": 
    5827 var _626
     5830var _627
    58285831ma(function(e){ 
    58295832var i=e.finishOn; 
    5830 if(i>=(_626||i)){ 
    5831 _626=i; 
     5833if(i>=(_627||i)){ 
     5834_627=i; 
    58325835} 
    58335836},this.effects); 
    5834 _622=_626||_622
     5837_623=_627||_623
    58355838break; 
    58365839case "break": 
     
    58405843break; 
    58415844} 
    5842 _621.startOn+=_622
    5843 _621.finishOn+=_622
    5844 if(!_621.options.queue.limit||this.effects.length<_621.options.queue.limit){ 
    5845 this.effects.push(_621); 
     5845_622.startOn+=_623
     5846_622.finishOn+=_623
     5847if(!_622.options.queue.limit||this.effects.length<_622.options.queue.limit){ 
     5848this.effects.push(_622); 
    58465849} 
    58475850if(!this.interval){ 
    58485851this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40); 
    58495852} 
    5850 },startLoop:function(func,_62b){ 
    5851 return setInterval(func,_62b); 
    5852 },remove:function(_62c){ 
     5853},startLoop:function(func,_62c){ 
     5854return setInterval(func,_62c); 
     5855},remove:function(_62d){ 
    58535856this.effects=MochiKit.Base.filter(function(e){ 
    5854 return e!=_62c
     5857return e!=_62d
    58555858},this.effects); 
    58565859if(!this.effects.length){ 
     
    58585861this.interval=null; 
    58595862} 
    5860 },stopLoop:function(_62e){ 
    5861 clearInterval(_62e); 
     5863},stopLoop:function(_62f){ 
     5864clearInterval(_62f); 
    58625865},loop:function(){ 
    5863 var _62f=new Date().getTime(); 
    5864 MochiKit.Base.map(function(_630){ 
    5865 _630.loop(_62f); 
     5866var _630=new Date().getTime(); 
     5867MochiKit.Base.map(function(_631){ 
     5868_631.loop(_630); 
    58665869},this.effects); 
    58675870}}); 
    5868 MochiKit.Visual.Queues={instances:{},get:function(_631){ 
    5869 if(typeof (_631)!="string"){ 
    5870 return _631
    5871 } 
    5872 if(!this.instances[_631]){ 
    5873 this.instances[_631]=new MochiKit.Visual.ScopedQueue(); 
    5874 } 
    5875 return this.instances[_631]; 
     5871MochiKit.Visual.Queues={instances:{},get:function(_632){ 
     5872if(typeof (_632)!="string"){ 
     5873return _632
     5874} 
     5875if(!this.instances[_632]){ 
     5876this.instances[_632]=new MochiKit.Visual.ScopedQueue(); 
     5877} 
     5878return this.instances[_632]; 
    58765879}}; 
    58775880MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global"); 
     
    58795882MochiKit.Visual.Base=function(){ 
    58805883}; 
    5881 MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_632){ 
     5884MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_633){ 
    58825885var v=MochiKit.Visual; 
    5883 this.options=MochiKit.Base.setdefault(_632,v.DefaultOptions); 
     5886this.options=MochiKit.Base.setdefault(_633,v.DefaultOptions); 
    58845887this.currentFrame=0; 
    58855888this.state="idle"; 
     
    58905893v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this); 
    58915894} 
    5892 },loop:function(_634){ 
    5893 if(_634>=this.startOn){ 
    5894 if(_634>=this.finishOn){ 
     5895},loop:function(_635){ 
     5896if(_635>=this.startOn){ 
     5897if(_635>=this.finishOn){ 
    58955898return this.finalize(); 
    58965899} 
    5897 var pos=(_634-this.startOn)/(this.finishOn-this.startOn); 
    5898 var _636=Math.round(pos*this.options.fps*this.options.duration); 
    5899 if(_636>this.currentFrame){ 
     5900var pos=(_635-this.startOn)/(this.finishOn-this.startOn); 
     5901var _637=Math.round(pos*this.options.fps*this.options.duration); 
     5902if(_637>this.currentFrame){ 
    59005903this.render(pos); 
    5901 this.currentFrame=_636
     5904this.currentFrame=_637
    59025905} 
    59035906} 
     
    59325935},setup:function(){ 
    59335936},finish:function(){ 
    5934 },update:function(_638){ 
    5935 },event:function(_639){ 
    5936 if(this.options[_639+"Internal"]){ 
    5937 this.options[_639+"Internal"](this); 
    5938 } 
    5939 if(this.options[_639]){ 
    5940 this.options[_639](this); 
     5937},update:function(_639){ 
     5938},event:function(_63a){ 
     5939if(this.options[_63a+"Internal"]){ 
     5940this.options[_63a+"Internal"](this); 
     5941} 
     5942if(this.options[_63a]){ 
     5943this.options[_63a](this); 
    59415944} 
    59425945},repr:function(){ 
    59435946return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]"; 
    59445947}}; 
    5945 MochiKit.Visual.Parallel=function(_63a,_63b){ 
     5948MochiKit.Visual.Parallel=function(_63b,_63c){ 
    59465949var cls=arguments.callee; 
    59475950if(!(this instanceof cls)){ 
    5948 return new cls(_63a,_63b); 
    5949 } 
    5950 this.__init__(_63a,_63b); 
     5951return new cls(_63b,_63c); 
     5952} 
     5953this.__init__(_63b,_63c); 
    59515954}; 
    59525955MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base(); 
    5953 MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_63d,_63e){ 
    5954 this.effects=_63d||[]; 
    5955 this.start(_63e); 
    5956 },update:function(_63f){ 
    5957 MochiKit.Base.map(function(_640){ 
    5958 _640.render(_63f); 
     5956MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_63e,_63f){ 
     5957this.effects=_63e||[]; 
     5958this.start(_63f); 
     5959},update:function(_640){ 
     5960MochiKit.Base.map(function(_641){ 
     5961_641.render(_640); 
    59595962},this.effects); 
    59605963},finish:function(){ 
    5961 MochiKit.Base.map(function(_641){ 
    5962 _641.finalize(); 
     5964MochiKit.Base.map(function(_642){ 
     5965_642.finalize(); 
    59635966},this.effects); 
    59645967}}); 
    5965 MochiKit.Visual.Opacity=function(_642,_643){ 
     5968MochiKit.Visual.Opacity=function(_643,_644){ 
    59665969var cls=arguments.callee; 
    59675970if(!(this instanceof cls)){ 
    5968 return new cls(_642,_643); 
    5969 } 
    5970 this.__init__(_642,_643); 
     5971return new cls(_643,_644); 
     5972} 
     5973this.__init__(_643,_644); 
    59715974}; 
    59725975MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base(); 
    5973 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_645,_646){ 
     5976MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_646,_647){ 
    59745977var b=MochiKit.Base; 
    59755978var s=MochiKit.Style; 
    5976 this.element=MochiKit.DOM.getElement(_645); 
     5979this.element=MochiKit.DOM.getElement(_646); 
    59775980if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){ 
    59785981s.setStyle(this.element,{zoom:1}); 
    59795982} 
    5980 _646=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_646); 
    5981 this.start(_646); 
    5982 },update:function(_649){ 
    5983 MochiKit.Style.setStyle(this.element,{"opacity":_649}); 
     5983_647=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_647); 
     5984this.start(_647); 
     5985},update:function(_64a){ 
     5986MochiKit.Style.setStyle(this.element,{"opacity":_64a}); 
    59845987}}); 
    5985 MochiKit.Visual.Move=function(_64a,_64b){ 
     5988MochiKit.Visual.Move=function(_64b,_64c){ 
    59865989var cls=arguments.callee; 
    59875990if(!(this instanceof cls)){ 
    5988 return new cls(_64a,_64b); 
    5989 } 
    5990 this.__init__(_64a,_64b); 
     5991return new cls(_64b,_64c); 
     5992} 
     5993this.__init__(_64b,_64c); 
    59915994}; 
    59925995MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base(); 
    5993 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_64d,_64e){ 
    5994 this.element=MochiKit.DOM.getElement(_64d); 
    5995 _64e=MochiKit.Base.update({x:0,y:0,mode:"relative"},_64e); 
    5996 this.start(_64e); 
     5996MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_64e,_64f){ 
     5997this.element=MochiKit.DOM.getElement(_64e); 
     5998_64f=MochiKit.Base.update({x:0,y:0,mode:"relative"},_64f); 
     5999this.start(_64f); 
    59976000},setup:function(){ 
    59986001MochiKit.DOM.makePositioned(this.element); 
    59996002var s=this.element.style; 
    6000 var _650=s.visibility; 
    6001 var _651=s.display; 
    6002 if(_651=="none"){ 
     6003var _651=s.visibility; 
     6004var _652=s.display; 
     6005if(_652=="none"){ 
    60036006s.visibility="hidden"; 
    60046007s.display=""; 
     
    60106013this.options.y-=this.originalTop; 
    60116014} 
    6012 if(_651=="none"){ 
    6013 s.visibility=_650
    6014 s.display=_651
    6015 } 
    6016 },update:function(_652){ 
    6017 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_652+this.originalLeft)+"px",top:Math.round(this.options.y*_652+this.originalTop)+"px"}); 
     6015if(_652=="none"){ 
     6016s.visibility=_651
     6017s.display=_652
     6018} 
     6019},update:function(_653){ 
     6020MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_653+this.originalLeft)+"px",top:Math.round(this.options.y*_653+this.originalTop)+"px"}); 
    60186021}}); 
    6019 MochiKit.Visual.Scale=function(_653,_654,_655){ 
     6022MochiKit.Visual.Scale=function(_654,_655,_656){ 
    60206023var cls=arguments.callee; 
    60216024if(!(this instanceof cls)){ 
    6022 return new cls(_653,_654,_655); 
    6023 } 
    6024 this.__init__(_653,_654,_655); 
     6025return new cls(_654,_655,_656); 
     6026} 
     6027this.__init__(_654,_655,_656); 
    60256028}; 
    60266029MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base(); 
    6027 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_657,_658,_659){ 
    6028 this.element=MochiKit.DOM.getElement(_657); 
    6029 _659=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_658},_659); 
    6030 this.start(_659); 
     6030MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_658,_659,_65a){ 
     6031this.element=MochiKit.DOM.getElement(_658); 
     6032_65a=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_659},_65a); 
     6033this.start(_65a); 
    60316034},setup:function(){ 
    60326035this.restoreAfterFinish=this.options.restoreAfterFinish||false; 
     
    60406043this.originalTop=this.element.offsetTop; 
    60416044this.originalLeft=this.element.offsetLeft; 
    6042 var _65d=MochiKit.Style.getStyle(this.element,"font-size")||"100%"; 
    6043 ma(b(function(_65e){ 
    6044 if(_65d.indexOf(_65e)>0){ 
    6045 this.fontSize=parseFloat(_65d); 
    6046 this.fontSizeType=_65e
     6045var _65e=MochiKit.Style.getStyle(this.element,"font-size")||"100%"; 
     6046ma(b(function(_65f){ 
     6047if(_65e.indexOf(_65f)>0){ 
     6048this.fontSize=parseFloat(_65e); 
     6049this.fontSizeType=_65f
    60476050} 
    60486051},this),["em","px","%"]); 
     
    60576060} 
    60586061} 
    6059 },update:function(_65f){ 
    6060 var _660=(this.options.scaleFrom/100)+(this.factor*_65f); 
     6062},update:function(_660){ 
     6063var _661=(this.options.scaleFrom/100)+(this.factor*_660); 
    60616064if(this.options.scaleContent&&this.fontSize){ 
    6062 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_660+this.fontSizeType}); 
    6063 } 
    6064 this.setDimensions(this.dims[0]*_660,this.dims[1]*_660); 
     6065MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_661+this.fontSizeType}); 
     6066} 
     6067this.setDimensions(this.dims[0]*_661,this.dims[1]*_661); 
    60656068},finish:function(){ 
    60666069if(this.restoreAfterFinish){ 
    60676070MochiKit.Style.setStyle(this.element,this.originalStyle); 
    60686071} 
    6069 },setDimensions:function(_661,_662){ 
     6072},setDimensions:function(_662,_663){ 
    60706073var d={}; 
    60716074var r=Math.round; 
     
    60746077} 
    60756078if(this.options.scaleX){ 
    6076 d.width=r(_662)+"px"; 
     6079d.width=r(_663)+"px"; 
    60776080} 
    60786081if(this.options.scaleY){ 
    6079 d.height=r(_661)+"px"; 
     6082d.height=r(_662)+"px"; 
    60806083} 
    60816084if(this.options.scaleFromCenter){ 
    6082 var topd=(_661-this.dims[0])/2; 
    6083 var _666=(_662-this.dims[1])/2; 
     6085var topd=(_662-this.dims[0])/2; 
     6086var _667=(_663-this.dims[1])/2; 
    60846087if(this.elementPositioning=="absolute"){ 
    60856088if(this.options.scaleY){ 
     
    60876090} 
    60886091if(this.options.scaleX){ 
    6089 d.left=this.originalLeft-_666+"px"; 
     6092d.left=this.originalLeft-_667+"px"; 
    60906093} 
    60916094}else{ 
     
    60946097} 
    60956098if(this.options.scaleX){ 
    6096 d.left=-_666+"px"; 
     6099d.left=-_667+"px"; 
    60976100} 
    60986101} 
     
    61006103MochiKit.Style.setStyle(this.element,d); 
    61016104}}); 
    6102 MochiKit.Visual.Highlight=function(_667,_668){ 
     6105MochiKit.Visual.Highlight=function(_668,_669){ 
    61036106var cls=arguments.callee; 
    61046107if(!(this instanceof cls)){ 
    6105 return new cls(_667,_668); 
    6106 } 
    6107 this.__init__(_667,_668); 
     6108return new cls(_668,_669); 
     6109} 
     6110this.__init__(_668,_669); 
    61086111}; 
    61096112MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base(); 
    6110 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_66a,_66b){ 
    6111 this.element=MochiKit.DOM.getElement(_66a); 
    6112 _66b=MochiKit.Base.update({startcolor:"#ffff99"},_66b); 
    6113 this.start(_66b); 
     6113MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_66b,_66c){ 
     6114this.element=MochiKit.DOM.getElement(_66b); 
     6115_66c=MochiKit.Base.update({startcolor:"#ffff99"},_66c); 
     6116this.start(_66c); 
    61146117},setup:function(){ 
    61156118var b=MochiKit.Base; 
     
    61336136return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]; 
    61346137},this),[0,1,2]); 
    6135 },update:function(_670){ 
     6138},update:function(_671){ 
    61366139var m="#"; 
    61376140MochiKit.Base.map(MochiKit.Base.bind(function(i){ 
    6138 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_670)); 
     6141m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_671)); 
    61396142},this),[0,1,2]); 
    61406143MochiKit.Style.setStyle(this.element,{backgroundColor:m}); 
     
    61426145MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor})); 
    61436146}}); 
    6144 MochiKit.Visual.ScrollTo=function(_673,_674){ 
     6147MochiKit.Visual.ScrollTo=function(_674,_675){ 
    61456148var cls=arguments.callee; 
    61466149if(!(this instanceof cls)){ 
    6147 return new cls(_673,_674); 
    6148 } 
    6149 this.__init__(_673,_674); 
     6150return new cls(_674,_675); 
     6151} 
     6152this.__init__(_674,_675); 
    61506153}; 
    61516154MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base(); 
    6152 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_676,_677){ 
    6153 this.element=MochiKit.DOM.getElement(_676); 
    6154 this.start(_677); 
     6155MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_677,_678){ 
     6156this.element=MochiKit.DOM.getElement(_677); 
     6157this.start(_678); 
    61556158},setup:function(){ 
    61566159var p=MochiKit.Position; 
    61576160p.prepare(); 
    6158 var _679=p.cumulativeOffset(this.element); 
     6161var _67a=p.cumulativeOffset(this.element); 
    61596162if(this.options.offset){ 
    6160 _679.y+=this.options.offset; 
     6163_67a.y+=this.options.offset; 
    61616164} 
    61626165var max; 
     
    61736176} 
    61746177this.scrollStart=p.windowOffset.y; 
    6175 this.delta=(_679.y>max?max:_679.y)-this.scrollStart; 
    6176 },update:function(_67b){ 
     6178this.delta=(_67a.y>max?max:_67a.y)-this.scrollStart; 
     6179},update:function(_67c){ 
    61776180var p=MochiKit.Position; 
    61786181p.prepare(); 
    6179 window.scrollTo(p.windowOffset.x,this.scrollStart+(_67b*this.delta)); 
     6182window.scrollTo(p.windowOffset.x,this.scrollStart+(_67c*this.delta)); 
    61806183}}); 
    61816184MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; 
    6182 MochiKit.Visual.Morph=function(_67d,_67e){ 
     6185MochiKit.Visual.Morph=function(_67e,_67f){ 
    61836186var cls=arguments.callee; 
    61846187if(!(this instanceof cls)){ 
    6185 return new cls(_67d,_67e); 
    6186 } 
    6187 this.__init__(_67d,_67e); 
     6188return new cls(_67e,_67f); 
     6189} 
     6190this.__init__(_67e,_67f); 
    61886191}; 
    61896192MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base(); 
    6190 MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_680,_681){ 
    6191 this.element=MochiKit.DOM.getElement(_680); 
    6192 this.start(_681); 
     6193MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_681,_682){ 
     6194this.element=MochiKit.DOM.getElement(_681); 
     6195this.start(_682); 
    61936196},setup:function(){ 
    61946197var b=MochiKit.Base; 
    6195 var _683=this.options.style; 
     6198var _684=this.options.style; 
    61966199this.styleStart={}; 
    61976200this.styleEnd={}; 
    61986201this.units={}; 
    6199 var _684,unit; 
    6200 for(var s in _683){ 
    6201 _684=_683[s]; 
     6202var _685,unit; 
     6203for(var s in _684){ 
     6204_685=_684[s]; 
    62026205s=b.camelize(s); 
    6203 if(MochiKit.Visual.CSS_LENGTH.test(_684)){ 
    6204 var _687=_684.match(/^([\+\-]?[0-9\.]+)(.*)$/); 
    6205 _684=parseFloat(_687[1]); 
    6206 unit=(_687.length==3)?_687[2]:null; 
    6207 this.styleEnd[s]=_684
     6206if(MochiKit.Visual.CSS_LENGTH.test(_685)){ 
     6207var _688=_685.match(/^([\+\-]?[0-9\.]+)(.*)$/); 
     6208_685=parseFloat(_688[1]); 
     6209unit=(_688.length==3)?_688[2]:null; 
     6210this.styleEnd[s]=_685
    62086211this.units[s]=unit; 
    6209 _684=MochiKit.Style.getStyle(this.element,s); 
    6210 _687=_684.match(/^([\+\-]?[0-9\.]+)(.*)$/); 
    6211 _684=parseFloat(_687[1]); 
    6212 this.styleStart[s]=_684
     6212_685=MochiKit.Style.getStyle(this.element,s); 
     6213_688=_685.match(/^([\+\-]?[0-9\.]+)(.*)$/); 
     6214_685=parseFloat(_688[1]); 
     6215this.styleStart[s]=_685
    62136216}else{ 
    62146217var c=MochiKit.Color.Color; 
    6215 _684=c.fromString(_684); 
    6216 if(_684){ 
     6218_685=c.fromString(_685); 
     6219if(_685){ 
    62176220this.units[s]="color"; 
    6218 this.styleEnd[s]=_684.toHexString(); 
    6219 _684=MochiKit.Style.getStyle(this.element,s); 
    6220 this.styleStart[s]=c.fromString(_684).toHexString(); 
     6221this.styleEnd[s]=_685.toHexString(); 
     6222_685=MochiKit.Style.getStyle(this.element,s); 
     6223this.styleStart[s]=c.fromString(_685).toHexString(); 
    62216224this.styleStart[s]=b.map(b.bind(function(i){ 
    62226225return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16); 
     
    62286231} 
    62296232} 
    6230 },update:function(_68b){ 
    6231 var _68c
     6233},update:function(_68c){ 
     6234var _68d
    62326235for(var s in this.styleStart){ 
    62336236if(this.units[s]=="color"){ 
    62346237var m="#"; 
    6235 var _68f=this.styleStart[s]; 
     6238var _690=this.styleStart[s]; 
    62366239var end=this.styleEnd[s]; 
    62376240MochiKit.Base.map(MochiKit.Base.bind(function(i){ 
    6238 m+=MochiKit.Color.toColorPart(Math.round(_68f[i]+(end[i]-_68f[i])*_68b)); 
     6241m+=MochiKit.Color.toColorPart(Math.round(_690[i]+(end[i]-_690[i])*_68c)); 
    62396242},this),[0,1,2]); 
    62406243this.element.style[s]=m; 
    62416244}else{ 
    6242 _68c=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_68b*1000)/1000+this.units[s]; 
    6243 this.element.style[s]=_68c
     6245_68d=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_68c*1000)/1000+this.units[s]; 
     6246this.element.style[s]=_68d
    62446247} 
    62456248} 
    62466249}}); 
    6247 MochiKit.Visual.fade=function(_692,_693){ 
     6250MochiKit.Visual.fade=function(_693,_694){ 
    62486251var s=MochiKit.Style; 
    6249 var _695=s.getStyle(_692,"opacity"); 
    6250 _693=MochiKit.Base.update({from:s.getStyle(_692,"opacity")||1,to:0,afterFinishInternal:function(_696){ 
    6251 if(_696.options.to!==0){ 
     6252var _696=s.getStyle(_693,"opacity"); 
     6253_694=MochiKit.Base.update({from:s.getStyle(_693,"opacity")||1,to:0,afterFinishInternal:function(_697){ 
     6254if(_697.options.to!==0){ 
    62526255return; 
    62536256} 
    6254 s.hideElement(_696.element); 
    6255 s.setStyle(_696.element,{"opacity":_695}); 
    6256 }},_693); 
    6257 return new MochiKit.Visual.Opacity(_692,_693); 
    6258 }; 
    6259 MochiKit.Visual.appear=function(_697,_698){ 
     6257s.hideElement(_697.element); 
     6258s.setStyle(_697.element,{"opacity":_696}); 
     6259}},_694); 
     6260return new MochiKit.Visual.Opacity(_693,_694); 
     6261}; 
     6262MochiKit.Visual.appear=function(_698,_699){ 
    62606263var s=MochiKit.Style; 
    62616264var v=MochiKit.Visual; 
    6262 _698=MochiKit.Base.update({from:(s.getStyle(_697,"display")=="none"?0:s.getStyle(_697,"opacity")||0),to:1,afterFinishInternal:function(_69b){ 
    6263 v.forceRerendering(_69b.element); 
    6264 },beforeSetupInternal:function(_69c){ 
    6265 s.setStyle(_69c.element,{"opacity":_69c.options.from}); 
    6266 s.showElement(_69c.element); 
    6267 }},_698); 
    6268 return new v.Opacity(_697,_698); 
    6269 }; 
    6270 MochiKit.Visual.puff=function(_69d,_69e){ 
     6265_699=MochiKit.Base.update({from:(s.getStyle(_698,"display")=="none"?0:s.getStyle(_698,"opacity")||0),to:1,afterFinishInternal:function(_69c){ 
     6266v.forceRerendering(_69c.element); 
     6267},beforeSetupInternal:function(_69d){ 
     6268s.setStyle(_69d.element,{"opacity":_69d.options.from}); 
     6269s.showElement(_69d.element); 
     6270}},_699); 
     6271return new v.Opacity(_698,_699); 
     6272}; 
     6273MochiKit.Visual.puff=function(_69e,_69f){ 
    62716274var s=MochiKit.Style; 
    62726275var v=MochiKit.Visual; 
    6273 _69d=MochiKit.DOM.getElement(_69d); 
    6274 var _6a1={position:s.getStyle(_69d,"position"),top:_69d.style.top,left:_69d.style.left,width:_69d.style.width,height:_69d.style.height,opacity:s.getStyle(_69d,"opacity")}; 
    6275 _69e=MochiKit.Base.update({beforeSetupInternal:function(_6a2){ 
    6276 MochiKit.Position.absolutize(_6a2.effects[0].element); 
    6277 },afterFinishInternal:function(_6a3){ 
    6278 s.hideElement(_6a3.effects[0].element); 
    6279 s.setStyle(_6a3.effects[0].element,_6a1); 
    6280 },scaleContent:true,scaleFromCenter:true},_69e); 
    6281 return new v.Parallel([new v.Scale(_69d,200,{sync:true,scaleFromCenter:_69e.scaleFromCenter,scaleContent:_69e.scaleContent,restoreAfterFinish:true}),new v.Opacity(_69d,{sync:true,to:0})],_69e); 
    6282 }; 
    6283 MochiKit.Visual.blindUp=function(_6a4,_6a5){ 
     6276_69e=MochiKit.DOM.getElement(_69e); 
     6277var _6a2={position:s.getStyle(_69e,"position"),top:_69e.style.top,left:_69e.style.left,width:_69e.style.width,height:_69e.style.height,opacity:s.getStyle(_69e,"opacity")}; 
     6278_69f=MochiKit.Base.update({beforeSetupInternal:function(_6a3){ 
     6279MochiKit.Position.absolutize(_6a3.effects[0].element); 
     6280},afterFinishInternal:function(_6a4){ 
     6281s.hideElement(_6a4.effects[0].element); 
     6282s.setStyle(_6a4.effects[0].element,_6a2); 
     6283},scaleContent:true,scaleFromCenter:true},_69f); 
     6284return new v.Parallel([new v.Scale(_69e,200,{sync:true,scaleFromCenter:_69f.scaleFromCenter,scaleContent:_69f.scaleContent,restoreAfterFinish:true}),new v.Opacity(_69e,{sync:true,to:0})],_69f); 
     6285}; 
     6286MochiKit.Visual.blindUp=function(_6a5,_6a6){ 
    62846287var d=MochiKit.DOM; 
    6285 _6a4=d.getElement(_6a4); 
    6286 var _6a7=d.makeClipping(_6a4); 
    6287 _6a5=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a8){ 
    6288 MochiKit.Style.hideElement(_6a8.element); 
    6289 d.undoClipping(_6a8.element,_6a7); 
    6290 }},_6a5); 
    6291 return new MochiKit.Visual.Scale(_6a4,0,_6a5); 
    6292 }; 
    6293 MochiKit.Visual.blindDown=function(_6a9,_6aa){ 
     6288_6a5=d.getElement(_6a5); 
     6289var _6a8=d.makeClipping(_6a5); 
     6290_6a6=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a9){ 
     6291MochiKit.Style.hideElement(_6a9.element); 
     6292d.undoClipping(_6a9.element,_6a8); 
     6293}},_6a6); 
     6294return new MochiKit.Visual.Scale(_6a5,0,_6a6); 
     6295}; 
     6296MochiKit.Visual.blindDown=function(_6aa,_6ab){ 
    62946297var d=MochiKit.DOM; 
    62956298var s=MochiKit.Style; 
    6296 _6a9=d.getElement(_6a9); 
    6297 var _6ad=s.getElementDimensions(_6a9); 
    6298 var _6ae
    6299 _6aa=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ad.h,originalWidth:_6ad.w},restoreAfterFinish:true,afterSetupInternal:function(_6af){ 
    6300 _6ae=d.makeClipping(_6af.element); 
    6301 s.setStyle(_6af.element,{height:"0px"}); 
    6302 s.showElement(_6af.element); 
    6303 },afterFinishInternal:function(_6b0){ 
    6304 d.undoClipping(_6b0.element,_6ae); 
    6305 }},_6aa); 
    6306 return new MochiKit.Visual.Scale(_6a9,100,_6aa); 
    6307 }; 
    6308 MochiKit.Visual.switchOff=function(_6b1,_6b2){ 
     6299_6aa=d.getElement(_6aa); 
     6300var _6ae=s.getElementDimensions(_6aa); 
     6301var _6af
     6302_6ab=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ae.h,originalWidth:_6ae.w},restoreAfterFinish:true,afterSetupInternal:function(_6b0){ 
     6303_6af=d.makeClipping(_6b0.element); 
     6304s.setStyle(_6b0.element,{height:"0px"}); 
     6305s.showElement(_6b0.element); 
     6306},afterFinishInternal:function(_6b1){ 
     6307d.undoClipping(_6b1.element,_6af); 
     6308}},_6ab); 
     6309return new MochiKit.Visual.Scale(_6aa,100,_6ab); 
     6310}; 
     6311MochiKit.Visual.switchOff=function(_6b2,_6b3){ 
    63096312var d=MochiKit.DOM; 
    6310 _6b1=d.getElement(_6b1); 
    6311 var _6b4=MochiKit.Style.getStyle(_6b1,"opacity"); 
    6312 var _6b5
    6313 _6b2=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b6){ 
    6314 d.makePositioned(_6b6.element); 
    6315 _6b5=d.makeClipping(_6b6.element); 
    6316 },afterFinishInternal:function(_6b7){ 
    6317 MochiKit.Style.hideElement(_6b7.element); 
    6318 d.undoClipping(_6b7.element,_6b5); 
    6319 d.undoPositioned(_6b7.element); 
    6320 MochiKit.Style.setStyle(_6b7.element,{"opacity":_6b4}); 
    6321 }},_6b2); 
     6313_6b2=d.getElement(_6b2); 
     6314var _6b5=MochiKit.Style.getStyle(_6b2,"opacity"); 
     6315var _6b6
     6316_6b3=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b7){ 
     6317d.makePositioned(_6b7.element); 
     6318_6b6=d.makeClipping(_6b7.element); 
     6319},afterFinishInternal:function(_6b8){ 
     6320MochiKit.Style.hideElement(_6b8.element); 
     6321d.undoClipping(_6b8.element,_6b6); 
     6322d.undoPositioned(_6b8.element); 
     6323MochiKit.Style.setStyle(_6b8.element,{"opacity":_6b5}); 
     6324}},_6b3); 
    63226325var v=MochiKit.Visual; 
    6323 return new v.appear(_6b1,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6b9){ 
    6324 new v.Scale(_6b9.element,1,_6b2); 
     6326return new v.appear(_6b2,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6ba){ 
     6327new v.Scale(_6ba.element,1,_6b3); 
    63256328}}); 
    63266329}; 
    6327 MochiKit.Visual.dropOut=function(_6ba,_6bb){ 
     6330MochiKit.Visual.dropOut=function(_6bb,_6bc){ 
    63286331var d=MochiKit.DOM; 
    63296332var s=MochiKit.Style; 
    6330 _6ba=d.getElement(_6ba); 
    6331 var _6be={top:s.getStyle(_6ba,"top"),left:s.getStyle(_6ba,"left"),opacity:s.getStyle(_6ba,"opacity")}; 
    6332 _6bb=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6bf){ 
    6333 d.makePositioned(_6bf.effects[0].element); 
    6334 },afterFinishInternal:function(_6c0){ 
    6335 s.hideElement(_6c0.effects[0].element); 
    6336 d.undoPositioned(_6c0.effects[0].element); 
    6337 s.setStyle(_6c0.effects[0].element,_6be); 
    6338 }},_6bb); 
     6333_6bb=d.getElement(_6bb); 
     6334var _6bf={top:s.getStyle(_6bb,"top"),left:s.getStyle(_6bb,"left"),opacity:s.getStyle(_6bb,"opacity")}; 
     6335_6bc=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6c0){ 
     6336d.makePositioned(_6c0.effects[0].element); 
     6337},afterFinishInternal:function(_6c1){ 
     6338s.hideElement(_6c1.effects[0].element); 
     6339d.undoPositioned(_6c1.effects[0].element); 
     6340s.setStyle(_6c1.effects[0].element,_6bf); 
     6341}},_6bc); 
    63396342var v=MochiKit.Visual; 
    6340 return new v.Parallel([new v.Move(_6ba,{x:0,y:_6bb.distance,sync:true}),new v.Opacity(_6ba,{sync:true,to:0})],_6bb); 
    6341 }; 
    6342 MochiKit.Visual.shake=function(_6c2,_6c3){ 
     6343return new v.Parallel([new v.Move(_6bb,{x:0,y:_6bc.distance,sync:true}),new v.Opacity(_6bb,{sync:true,to:0})],_6bc); 
     6344}; 
     6345MochiKit.Visual.shake=function(_6c3,_6c4){ 
    63436346var d=MochiKit.DOM; 
    63446347var v=MochiKit.Visual; 
    63456348var s=MochiKit.Style; 
    6346 _6c2=d.getElement(_6c2); 
    6347 var _6c7={top:s.getStyle(_6c2,"top"),left:s.getStyle(_6c2,"left")}; 
    6348 _6c3=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c8){ 
    6349 d.undoPositioned(_6c8.element); 
    6350 s.setStyle(_6c8.element,_6c7); 
    6351 }},_6c3); 
    6352 return new v.Move(_6c2,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6c9){ 
    6353 new v.Move(_6c9.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6ca){ 
    6354 new v.Move(_6ca.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cb){ 
    6355 new v.Move(_6cb.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cc){ 
    6356 new v.Move(_6cc.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cd){ 
    6357 new v.Move(_6cd.element,_6c3); 
     6349_6c3=d.getElement(_6c3); 
     6350var _6c8={top:s.getStyle(_6c3,"top"),left:s.getStyle(_6c3,"left")}; 
     6351_6c4=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c9){ 
     6352d.undoPositioned(_6c9.element); 
     6353s.setStyle(_6c9.element,_6c8); 
     6354}},_6c4); 
     6355return new v.Move(_6c3,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6ca){ 
     6356new v.Move(_6ca.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cb){ 
     6357new v.Move(_6cb.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cc){ 
     6358new v.Move(_6cc.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cd){ 
     6359new v.Move(_6cd.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6ce){ 
     6360new v.Move(_6ce.element,_6c4); 
    63586361}}); 
    63596362}}); 
     
    63626365}}); 
    63636366}; 
    6364 MochiKit.Visual.slideDown=function(_6ce,_6cf){ 
     6367MochiKit.Visual.slideDown=function(_6cf,_6d0){ 
    63656368var d=MochiKit.DOM; 
    63666369var b=MochiKit.Base; 
    63676370var s=MochiKit.Style; 
    6368 _6ce=d.getElement(_6ce); 
    6369 if(!_6ce.firstChild){ 
     6371_6cf=d.getElement(_6cf); 
     6372if(!_6cf.firstChild){ 
    63706373throw "MochiKit.Visual.slideDown must be used on a element with a child"; 
    63716374} 
    6372 d.removeEmptyTextNodes(_6ce); 
    6373 var _6d3=s.getStyle(_6ce.firstChild,"bottom")||0; 
    6374 var _6d4=s.getElementDimensions(_6ce); 
    6375 var _6d5
    6376 _6cf=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6d4.h,originalWidth:_6d4.w},restoreAfterFinish:true,afterSetupInternal:function(_6d6){ 
    6377 d.makePositioned(_6d6.element); 
    6378 d.makePositioned(_6d6.element.firstChild); 
     6375d.removeEmptyTextNodes(_6cf); 
     6376var _6d4=s.getStyle(_6cf.firstChild,"bottom")||0; 
     6377var _6d5=s.getElementDimensions(_6cf); 
     6378var _6d6
     6379_6d0=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6d5.h,originalWidth:_6d5.w},restoreAfterFinish:true,afterSetupInternal:function(_6d7){ 
     6380d.makePositioned(_6d7.element); 
     6381d.makePositioned(_6d7.element.firstChild); 
    63796382if(/Opera/.test(navigator.userAgent)){ 
    6380 s.setStyle(_6d6.element,{top:""}); 
    6381 } 
    6382 _6d5=d.makeClipping(_6d6.element); 
    6383 s.setStyle(_6d6.element,{height:"0px"}); 
    6384 s.showElement(_6d6.element); 
    6385 },afterUpdateInternal:function(_6d7){ 
    6386 s.setStyle(_6d7.element.firstChild,{bottom:(_6d7.dims[0]-_6d7.element.clientHeight)+"px"}); 
    6387 },afterFinishInternal:function(_6d8){ 
    6388 d.undoClipping(_6d8.element,_6d5); 
     6383s.setStyle(_6d7.element,{top:""}); 
     6384} 
     6385_6d6=d.makeClipping(_6d7.element); 
     6386s.setStyle(_6d7.element,{height:"0px"}); 
     6387s.showElement(_6d7.element); 
     6388},afterUpdateInternal:function(_6d8){ 
     6389s.setStyle(_6d8.element.firstChild,{bottom:(_6d8.dims[0]-_6d8.element.clientHeight)+"px"}); 
     6390},afterFinishInternal:function(_6d9){ 
     6391d.undoClipping(_6d9.element,_6d6); 
    63896392if(/MSIE/.test(navigator.userAgent)){ 
    6390 d.undoPositioned(_6d8.element); 
    6391 d.undoPositioned(_6d8.element.firstChild); 
    6392 }else{ 
    6393 d.undoPositioned(_6d8.element.firstChild); 
    6394 d.undoPositioned(_6d8.element); 
    6395 } 
    6396 s.setStyle(_6d8.element.firstChild,{bottom:_6d3}); 
    6397 }},_6cf); 
    6398 return new MochiKit.Visual.Scale(_6ce,100,_6cf); 
    6399 }; 
    6400 MochiKit.Visual.slideUp=function(_6d9,_6da){ 
     6393d.undoPositioned(_6d9.element); 
     6394d.undoPositioned(_6d9.element.firstChild); 
     6395}else{ 
     6396d.undoPositioned(_6d9.element.firstChild); 
     6397d.undoPositioned(_6d9.element); 
     6398} 
     6399s.setStyle(_6d9.element.firstChild,{bottom:_6d4}); 
     6400}},_6d0); 
     6401return new MochiKit.Visual.Scale(_6cf,100,_6d0); 
     6402}; 
     6403MochiKit.Visual.slideUp=function(_6da,_6db){ 
    64016404var d=MochiKit.DOM; 
    64026405var b=MochiKit.Base; 
    64036406var s=MochiKit.Style; 
    6404 _6d9=d.getElement(_6d9); 
    6405 if(!_6d9.firstChild){ 
     6407_6da=d.getElement(_6da); 
     6408if(!_6da.firstChild){ 
    64066409throw "MochiKit.Visual.slideUp must be used on a element with a child"; 
    64076410} 
    6408 d.removeEmptyTextNodes(_6d9); 
    6409 var _6de=s.getStyle(_6d9.firstChild,"bottom"); 
    6410 var _6df
    6411 _6da=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6e0){ 
    6412 d.makePositioned(_6e0.element); 
    6413 d.makePositioned(_6e0.element.firstChild); 
     6411d.removeEmptyTextNodes(_6da); 
     6412var _6df=s.getStyle(_6da.firstChild,"bottom"); 
     6413var _6e0
     6414_6db=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6e1){ 
     6415d.makePositioned(_6e1.element); 
     6416d.makePositioned(_6e1.element.firstChild); 
    64146417if(/Opera/.test(navigator.userAgent)){ 
    6415 s.setStyle(_6e0.element,{top:""}); 
    6416 } 
    6417 _6df=d.makeClipping(_6e0.element); 
    6418 s.showElement(_6e0.element); 
    6419 },afterUpdateInternal:function(_6e1){ 
    6420 s.setStyle(_6e1.element.firstChild,{bottom:(_6e1.dims[0]-_6e1.element.clientHeight)+"px"}); 
    6421 },afterFinishInternal:function(_6e2){ 
    6422 s.hideElement(_6e2.element); 
    6423 d.undoClipping(_6e2.element,_6df); 
    6424 d.undoPositioned(_6e2.element.firstChild); 
    6425 d.undoPositioned(_6e2.element); 
    6426 s.setStyle(_6e2.element.firstChild,{bottom:_6de}); 
    6427 }},_6da); 
    6428 return new MochiKit.Visual.Scale(_6d9,0,_6da); 
    6429 }; 
    6430 MochiKit.Visual.squish=function(_6e3,_6e4){ 
     6418s.setStyle(_6e1.element,{top:""}); 
     6419} 
     6420_6e0=d.makeClipping(_6e1.element); 
     6421s.showElement(_6e1.element); 
     6422},afterUpdateInternal:function(_6e2){ 
     6423s.setStyle(_6e2.element.firstChild,{bottom:(_6e2.dims[0]-_6e2.element.clientHeight)+"px"}); 
     6424},afterFinishInternal:function(_6e3){ 
     6425s.hideElement(_6e3.element); 
     6426d.undoClipping(_6e3.element,_6e0); 
     6427d.undoPositioned(_6e3.element.firstChild); 
     6428d.undoPositioned(_6e3.element); 
     6429s.setStyle(_6e3.element.firstChild,{bottom:_6df}); 
     6430}},_6db); 
     6431return new MochiKit.Visual.Scale(_6da,0,_6db); 
     6432}; 
     6433MochiKit.Visual.squish=function(_6e4,_6e5){ 
    64316434var d=MochiKit.DOM; 
    64326435var b=MochiKit.Base; 
    6433 var _6e7
    6434 _6e4=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e8){ 
    6435 _6e7=d.makeClipping(_6e8.element); 
    6436 },afterFinishInternal:function(_6e9){ 
    6437 MochiKit.Style.hideElement(_6e9.element); 
    6438 d.undoClipping(_6e9.element,_6e7); 
    6439 }},_6e4); 
    6440 return new MochiKit.Visual.Scale(_6e3,/Opera/.test(navigator.userAgent)?1:0,_6e4); 
    6441 }; 
    6442 MochiKit.Visual.grow=function(_6ea,_6eb){ 
     6436var _6e8
     6437_6e5=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e9){ 
     6438_6e8=d.makeClipping(_6e9.element); 
     6439},afterFinishInternal:function(_6ea){ 
     6440MochiKit.Style.hideElement(_6ea.element); 
     6441d.undoClipping(_6ea.element,_6e8); 
     6442}},_6e5); 
     6443return new MochiKit.Visual.Scale(_6e4,/Opera/.test(navigator.userAgent)?1:0,_6e5); 
     6444}; 
     6445MochiKit.Visual.grow=function(_6eb,_6ec){ 
    64436446var d=MochiKit.DOM; 
    64446447var v=MochiKit.Visual; 
    64456448var s=MochiKit.Style; 
    6446 _6ea=d.getElement(_6ea); 
    6447 _6eb=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6eb); 
    6448 var _6ef={top:_6ea.style.top,left:_6ea.style.left,height:_6ea.style.height,width:_6ea.style.width,opacity:s.getStyle(_6ea,"opacity")}; 
    6449 var dims=s.getElementDimensions(_6ea); 
    6450 var _6f1,_6f2
    6451 var _6f3,_6f4
    6452 switch(_6eb.direction){ 
     6449_6eb=d.getElement(_6eb); 
     6450_6ec=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6ec); 
     6451var _6f0={top:_6eb.style.top,left:_6eb.style.left,height:_6eb.style.height,width:_6eb.style.width,opacity:s.getStyle(_6eb,"opacity")}; 
     6452var dims=s.getElementDimensions(_6eb); 
     6453var _6f2,_6f3
     6454var _6f4,_6f5
     6455switch(_6ec.direction){ 
    64536456case "top-left": 
    6454 _6f1=_6f2=_6f3=_6f4=0; 
     6457_6f2=_6f3=_6f4=_6f5=0; 
    64556458break; 
    64566459case "top-right": 
    6457 _6f1=dims.w; 
    6458 _6f2=_6f4=0; 
    6459 _6f3=-dims.w; 
     6460_6f2=dims.w; 
     6461_6f3=_6f5=0; 
     6462_6f4=-dims.w; 
    64606463break; 
    64616464case "bottom-left": 
    6462 _6f1=_6f3=0; 
    6463 _6f2=dims.h; 
    6464 _6f4=-dims.h; 
     6465_6f2=_6f4=0; 
     6466_6f3=dims.h; 
     6467_6f5=-dims.h; 
    64656468break; 
    64666469case "bottom-right": 
    6467 _6f1=dims.w; 
    6468 _6f2=dims.h; 
    6469 _6f3=-dims.w; 
    6470 _6f4=-dims.h; 
     6470_6f2=dims.w; 
     6471_6f3=dims.h; 
     6472_6f4=-dims.w; 
     6473_6f5=-dims.h; 
    64716474break; 
    64726475case "center": 
    6473 _6f1=dims.w/2; 
    6474 _6f2=dims.h/2; 
    6475 _6f3=-dims.w/2; 
    6476 _6f4=-dims.h/2; 
     6476_6f2=dims.w/2; 
     6477_6f3=dims.h/2; 
     6478_6f4=-dims.w/2; 
     6479_6f5=-dims.h/2; 
    64776480break; 
    64786481} 
    6479 var _6f5=MochiKit.Base.update({beforeSetupInternal:function(_6f6){ 
    6480 s.setStyle(_6f6.effects[0].element,{height:"0px"}); 
    6481 s.showElement(_6f6.effects[0].element); 
    6482 },afterFinishInternal:function(_6f7){ 
    6483 d.undoClipping(_6f7.effects[0].element); 
    6484 d.undoPositioned(_6f7.effects[0].element); 
    6485 s.setStyle(_6f7.effects[0].element,_6ef); 
    6486 }},_6eb); 
    6487 return new v.Move(_6ea,{x:_6f1,y:_6f2,duration:0.01,beforeSetupInternal:function(_6f8){ 
    6488 s.hideElement(_6f8.element); 
    6489 d.makeClipping(_6f8.element); 
    6490 d.makePositioned(_6f8.element); 
    6491 },afterFinishInternal:function(_6f9){ 
    6492 new v.Parallel([new v.Opacity(_6f9.element,{sync:true,to:1,from:0,transition:_6eb.opacityTransition}),new v.Move(_6f9.element,{x:_6f3,y:_6f4,sync:true,transition:_6eb.moveTransition}),new v.Scale(_6f9.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6eb.scaleTransition,scaleContent:_6eb.scaleContent,scaleFromCenter:_6eb.scaleFromCenter,restoreAfterFinish:true})],_6f5); 
     6482var _6f6=MochiKit.Base.update({beforeSetupInternal:function(_6f7){ 
     6483s.setStyle(_6f7.effects[0].element,{height:"0px"}); 
     6484s.showElement(_6f7.effects[0].element); 
     6485},afterFinishInternal:function(_6f8){ 
     6486d.undoClipping(_6f8.effects[0].element); 
     6487d.undoPositioned(_6f8.effects[0].element); 
     6488s.setStyle(_6f8.effects[0].element,_6f0); 
     6489}},_6ec); 
     6490return new v.Move(_6eb,{x:_6f2,y:_6f3,duration:0.01,beforeSetupInternal:function(_6f9){ 
     6491s.hideElement(_6f9.element); 
     6492d.makeClipping(_6f9.element); 
     6493d.makePositioned(_6f9.element); 
     6494},afterFinishInternal:function(_6fa){ 
     6495new v.Parallel([new v.Opacity(_6fa.element,{sync:true,to:1,from:0,transition:_6ec.opacityTransition}),new v.Move(_6fa.element,{x:_6f4,y:_6f5,sync:true,transition:_6ec.moveTransition}),new v.Scale(_6fa.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6ec.scaleTransition,scaleContent:_6ec.scaleContent,scaleFromCenter:_6ec.scaleFromCenter,restoreAfterFinish:true})],_6f6); 
    64936496}}); 
    64946497}; 
    6495 MochiKit.Visual.shrink=function(_6fa,_6fb){ 
     6498MochiKit.Visual.shrink=function(_6fb,_6fc){ 
    64966499var d=MochiKit.DOM; 
    64976500var v=MochiKit.Visual; 
    64986501var s=MochiKit.Style; 
    6499 _6fa=d.getElement(_6fa); 
    6500 _6fb=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6fb); 
    6501 var _6ff={top:_6fa.style.top,left:_6fa.style.left,height:_6fa.style.height,width:_6fa.style.width,opacity:s.getStyle(_6fa,"opacity")}; 
    6502 var dims=s.getElementDimensions(_6fa); 
    6503 var _701,_702
    6504 switch(_6fb.direction){ 
     6502_6fb=d.getElement(_6fb); 
     6503_6fc=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6fc); 
     6504var _700={top:_6fb.style.top,left:_6fb.style.left,height:_6fb.style.height,width:_6fb.style.width,opacity:s.getStyle(_6fb,"opacity")}; 
     6505var dims=s.getElementDimensions(_6fb); 
     6506var _702,_703
     6507switch(_6fc.direction){ 
    65056508case "top-left": 
    6506 _701=_702=0; 
     6509_702=_703=0; 
    65076510break; 
    65086511case "top-right": 
    6509 _701=dims.w; 
    6510 _702=0; 
     6512_702=dims.w; 
     6513_703=0; 
    65116514break; 
    65126515case "bottom-left": 
    6513 _701=0; 
    6514 _702=dims.h; 
     6516_702=0; 
     6517_703=dims.h; 
    65156518break; 
    65166519case "bottom-right": 
    6517 _701=dims.w; 
    6518 _702=dims.h; 
     6520_702=dims.w; 
     6521_703=dims.h; 
    65196522break; 
    65206523case "center": 
    6521