(function(){var g=window.DL;g.Animator=new g.Class({version:'$Revision: 1.20 $',initialize:function(b){this.options={duration:400,transition:g.Animator.tx.easeOut};this.setOptions(b);var a=this;this.timerDelegate=function(){a.onTimerEvent()};this.subjects=[];this.target=0;this.state=0},seekTo:function(a){this.seekFromTo(this.state,a)},seekFromTo:function(a,b){this.onstart.call(this);this.target=Math.max(0,Math.min(1,b));this.state=Math.max(0,Math.min(1,a));if(!this.intervalId){this.intervalId=g.Function.interval(this.timerDelegate,g.Animator.interval)}},jumpTo:function(a){this.target=this.state=Math.max(0,Math.min(1,a));this.propagate()},toggle:function(){this.seekTo(1-this.target)},addSubject:function(a){this.subjects[this.subjects.length]=a;return this},removeSubject:function(a){for(var i=0;this.subjects.length;i++){if(this.subjects[i]==a){g.Array.remove(this.subjects[i],i)}}},clearSubjects:function(){this.subjects=[]},propagate:function(){var a=this.options.transition(this.state);for(var i=0;i=Math.abs(this.state-this.target)){this.state=this.target}else{this.state+=a}try{try{this.propagate()}finally{this.onstep.call(this);if(this.target==this.state){g.Function.clear(this.intervalId);this.intervalId=null;this.oncomplete.call(this)}}}catch(e){}},play:function(){this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},oncomplete:function(){},onstep:function(){},onstart:function(){}});g.Animator.interval=40;g.Animator.makeArray=function(o){if(o==null)return[];if(!o.length)return[o];var a=[];for(var i=0;i20)return}},getStyle:function(a){a=this.from+((this.to-this.from)*a);if(this.property=='filter')return"alpha(opacity="+Math.round(a*100)+")";if(this.property=='opacity')return a;return Math.round(a)+this.units}});g.Animator.ColorStyleSubject=new g.Class({initialize:function(d,c,a,b){this.els=g.Animator.makeArray(d);this.property=g.Animator.camelize(c);this.to=this.expandColor(b);this.from=this.expandColor(a)},expandColor:function(b){var a,red,green,blue;a=g.Animator.ColorStyleSubject.parseColor(b);if(a){red=parseInt(a.slice(1,3),16);green=parseInt(a.slice(3,5),16);blue=parseInt(a.slice(5,7),16);return[red,green,blue]}if(window.DEBUG){alert("Invalid colour: '"+b+"'")}},getValueForState:function(b,a){return Math.round(this.from[b]+((this.to[b]-this.from[b])*a))},setState:function(a){var b='#'+g.Animator.ColorStyleSubject.toColorPart(this.getValueForState(0,a))+g.Animator.ColorStyleSubject.toColorPart(this.getValueForState(1,a))+g.Animator.ColorStyleSubject.toColorPart(this.getValueForState(2,a));for(var i=0;i255)a=255;var b=a.toString(16);if(a<16)return'0'+b;return b};g.Animator.ColorStyleSubject.parseColor.rgbRe=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;g.Animator.ColorStyleSubject.parseColor.hexRe=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;g.Animator.CSSStyleSubject=new g.Class({initialize:function(d,b,c){d=g.Animator.makeArray(d);this.subjects=[];if(d.length==0)return;var a,toStyle,fromStyle;if(c){fromStyle=this.parseStyle(b,d[0]);toStyle=this.parseStyle(c,d[0])}else{toStyle=this.parseStyle(b,d[0]);fromStyle={};for(a in toStyle){fromStyle[a]=g.Element.getStyle(d[0],a)}}var a;for(a in fromStyle){if(fromStyle[a]==toStyle[a]){delete fromStyle[a];delete toStyle[a]}}var a,from,to,units,match,type;for(a in fromStyle){if(!toStyle[a]){if(window.DEBUG){console.error("No to style provided for '"+a+'"')}continue}if((from=g.Animator.ColorStyleSubject.parseColor(fromStyle[a]))){to=g.Animator.ColorStyleSubject.parseColor(toStyle[a]);type=g.Animator.ColorStyleSubject}else if((match=g.Animator.CSSStyleSubject.numericalRe.exec(fromStyle[a]))){from=parseFloat(fromStyle[a]);to=parseFloat(toStyle[a]);type=g.Animator.NumericalStyleSubject;units=match[1]||g.Animator.CSSStyleSubject.numericalRe.exec(toStyle[a])[1]}else{if(window.DEBUG){console.error("Unrecognised format for value of "+a+": '"+fromStyle[a]+"'")}continue}this.subjects[this.subjects.length]=new type(d,a,from,to,units)}},parseStyle:function(e,d){var c={};if(e.indexOf(":")!=-1){var f=e.split(";");for(var i=0;ia?1:0);else this.ans[i].jumpTo(i>a?1:0)}}});g.Accordion.implement(new g.Class.Options)})();