Type.registerNamespace("rb");rb.delay={};rb.extend=function(b,a){for(s in a){b[s]=a[s]}return b};rb.getEnumByValue=function(b,a){for(var c in b){if(typeof(b[c])=="number"&&b[c]==a){return c}}};rb.doDelay=function(a,c,b,d){if(this.delay[a]==null){this.delay[a]=new rb.delayObject(b,d,a);this.delay[a].num=window.setTimeout(Function.createDelegate(this.delay[a],this.delay[a].complete),c)}};rb.cancelDelay=function(a){if(this.delay[a]!=null){window.clearTimeout(this.delay[a].num);this.delay[a]=null}},rb.delayObject=function(a,c,b){this.num=null;this.pfunc=a;this.context=c;this.type=b};rb.delayObject.prototype={complete:function(){rb.delay[this.type]=null;this.pfunc(this.context)}};rb.delayObject.registerClass("rb.delayObject");Type.registerNamespace("rb.dom");rb.extend(rb.dom,{tweens:[],animate:function(r,c,o,u,b,q,w,d,n,j){r.style.display="";var e=Sys.UI.DomElement.getBounds(r);window.status=e.y;var h=[];var v=(o==rb.motion.animationDir.Down||o==rb.motion.animationDir.Up);var g=v?"y":"x";var m=g=="y"?"height":"width";var a=g=="y"?"top":"left";var k=rb.getEnumByValue(rb.motion.easingDir,q)+rb.getEnumByValue(rb.motion.easingType,b);if(c==rb.motion.animationType.Slide){if(o==rb.motion.animationDir.Left||o==rb.motion.animationDir.Up){var t="clip"+(o==rb.motion.animationDir.Left?"right":"bottom");h.push({prop:t,begin:0,finish:e[m]});h.push({prop:a,begin:e[g]+e[m],finish:e[g]})}else{h.push({prop:"clip"+a,begin:e[m],finish:0});h.push({prop:a,begin:e[g]-e[m],finish:e[g]})}}else{if(c==rb.motion.animationType.Expand){var p=v?"bottom":"right";h.push({prop:"clip"+p,begin:0,finish:e[m]})}else{if(c==rb.motion.animationType.Diagonal){m=e.h>e.w?"h":"w";h.push({prop:"clipbottomright",begin:0,finish:e[m]})}else{if(c==rb.motion.animationType.ReverseDiagonal){m=e.h>e.w?"h":"w";h.push({prop:"cliptopleft",begin:e[m],finish:0})}}}}var f=[];for(var l=0;l<h.length;l++){if(u){f.push(rb.dom.doTween(r.id+l,r,h[l].prop,rb.easing[k],h[l].begin,h[l].finish,w,d,"px",n,j))}else{f.push(rb.dom.doTween(r.id+l,r,h[l].prop,rb.easing[k],h[l].finish,h[l].begin,w,d,"px",n,j))}}return f},doTween:function(b,i,c,e,f,g,k,l,a,d,j){var h=this.tweens[b];if(h){h.stop();h.dispose();h=null}h=new rb.tween(b,i.style,c,e,f,g,k);this.tweens[b]=h;if(a){h.set_Suffix(a)}if(l){h.set_Interval(l)}h.addEventHandler("onMotionStarted",rb.dom.onMotionStarted);if(d){h.addEventHandler("onMotionStarted",d)}h.addEventHandler("onMotionFinished",rb.dom.onMotionFinished);if(j){h.addEventHandler("onMotionFinished",j)}h.start();return h},onMotionFinished:function(a){rb.dom.tweens[a.id]=null;a.dispose()},onMotionStarted:function(a){}});Type.registerNamespace("rb.motion");rb.motion=function(d,e,b,c,a){this.id=d;this._obj=e;this._prop=b;this._begin=c;this._duration=a;this._interval=10;this._finish=0;this._pos=0;this._prevPos=0;this._time=0;this._position=0;this._startTime=0;this._looping=false;this._suffix="px";this._listeners=[];this._events=new Sys.EventHandlerList()};rb.motion.prototype={get_Position:function(){},set_Position:function(d){this._prevPos=d;var b=Math.round(d)+this._suffix;if(this._prop.indexOf("clip")==0){var c=this._getClipObject();var e=this._getClips(this._prop);for(var a=0;a<e.length;a++){c[e[a]]=b}this._obj.clip="rect("+c.cliptop+","+c.clipright+","+c.clipbottom+","+c.clipleft+")"}else{this._obj[this._prop]=b}this._pos=d;this.raiseEvent("onMotionChanged")},get_PrevPosition:function(){return this._prevPos},set_Time:function(a){if(a>this._duration){if(this._looping){this.rewind(a-this._duration);this._update();this.raiseEvent("onMotionLooped")}else{this._time=this._duration;this._update();this.stop();this.raiseEvent("onMotionFinished")}}else{if(a<0){this.rewind();this._update()}else{this._time=a;this._update()}}},get_Time:function(){return this._time},set_Begin:function(a){this._begin=a},get_Begin:function(){return this._begin},set_Duration:function(a){this._duration=a},get_Duration:function(){return this._duration},set_Interval:function(a){this._interval=a},get_Interval:function(){return this._interval},set_Looping:function(a){this._looping=a},get_Looping:function(){return this._looping},set_Object:function(a){this._obj=a},get_Object:function(){return this._obj},set_Property:function(a){this._prop=a},get_Property:function(){return this._prop},set_Suffix:function(a){this._suffix=a},get_Suffix:function(){return this._suffix},get_Timer:function(){return new Date().getTime()-this._time},start:function(){this._fixTime();this.isPlaying=true;this._onEnterFrame();this.raiseEvent("onMotionStarted")},stop:function(){rb.cancelDelay(this.id);this.isPlaying=false;this.raiseEvent("onMotionStopped")},resume:function(){this._fixTime();this.start()},rewind:function(a){this._time=(a==null?1:a);this._fixTime()},fforward:function(){this.set_Time(this._duration);this._fixTime()},nextFrame:function(){this.set_Time((this.get_Timer()-this._startTime)/1000)},prevFrame:function(){this.set_Time(this._time-1)},dispose:function(){this._obj=null;this._listeners=null;this._events=null},toString:function(){return"[Motion prop="+this._prop+" t="+this._time+" pos="+this._pos+"]"},addEventHandler:function(a,b){this._events.addHandler(a,b)},removeEventHandler:function(a,b){this._events.removeHandler(a,b)},raiseEvent:function(b){if(!this._events){return}var a=this._events.getHandler(b);if(a){a(this,Sys.EventArgs.Empty)}},_onEnterFrame:function(){if(this.isPlaying){this.nextFrame();rb.doDelay(this.id,this._interval,Function.createDelegate(this,this._onEnterFrame))}},_update:function(){this.set_Position(this.get_Position(this._time))},_fixTime:function(){this._startTime=this.get_Timer()-this._time},_getClipObject:function(){var a={};a.cliptop="auto";a.clipright="auto";a.clipbottom="auto";a.clipleft="auto";return a},_getClips:function(b){var a=[];if(b.indexOf("top")>-1){a.push("cliptop")}if(b.indexOf("left")>-1){a.push("clipleft")}if(b.indexOf("bottom")>-1){a.push("clipbottom")}if(b.indexOf("right")>-1){a.push("clipright")}return a}};rb.motion.registerClass("rb.motion",null,Sys.IDisposable);rb.motion.animationType=function(){};rb.motion.animationType.prototype={None:0,Slide:1,Expand:2,Diagonal:3,ReverseDiagonal:4};rb.motion.animationType.registerEnum("rb.motion.animationType");rb.motion.animationDir=function(){};rb.motion.animationDir.prototype={Up:0,Down:1,Left:2,Right:3};rb.motion.animationDir.registerEnum("rb.motion.animationDir");rb.motion.easingType=function(){};rb.motion.easingType.prototype={Bounce:0,Circ:1,Cubic:2,Expo:3,Quad:4,Quint:5,Quart:6,Sine:7};rb.motion.easingType.registerEnum("rb.motion.easingType");rb.motion.easingDir=function(){};rb.motion.easingDir.prototype={easeIn:0,easeOut:1,easeInOut:2};rb.motion.easingDir.registerEnum("rb.motion.easingDir");rb.tween=function(f,g,c,d,e,a,b){rb.tween.initializeBase(this,[f,g,c,e,b]);this._func=d;this._change=0;this.set_Finish(a)};rb.tween.prototype={set_Function:function(a){this._func=a},get_Function:function(){return this._func},set_Change:function(a){this._change=a},get_Change:function(){return this._change},set_Finish:function(a){this._change=a-this._begin},get_Finish:function(){return this._begin+this._change},get_Position:function(){return this._func(this._time,this._begin,this._change,this._duration)},continueTo:function(b,a){this.set_Begin(this.get_Position());this.set_Finish(b);this.set_Duration(a);this.start()},dispose:function(){rb.tween.callBaseMethod(this,"dispose");this._func=null}};rb.tween.registerClass("rb.tween",rb.motion);Type.registerNamespace("rb.easing");rb.extend(rb.easing,{linearTween:function(a,e,f,g){return f*a/g+e},easeInQuad:function(a,e,f,g){return f*(a/=g)*a+e},easeOutQuad:function(a,e,f,g){return -f*(a/=g)*(a-2)+e},easeInOutQuad:function(a,e,f,g){if((a/=g/2)<1){return f/2*a*a+e}return -f/2*((--a)*(a-2)-1)+e},easeInCubic:function(a,e,f,g){return f*(a/=g)*a*a+e},easeOutCubic:function(a,e,f,g){return f*((a=a/g-1)*a*a+1)+e},easeInOutCubic:function(a,e,f,g){if((a/=g/2)<1){return f/2*a*a*a+e}return f/2*((a-=2)*a*a+2)+e},easeInQuart:function(a,e,f,g){return f*(a/=g)*a*a*a+e},easeOutQuart:function(a,e,f,g){return -f*((a=a/g-1)*a*a*a-1)+e},easeInOutQuart:function(a,e,f,g){if((a/=g/2)<1){return f/2*a*a*a*a+e}return -f/2*((a-=2)*a*a*a-2)+e},easeInQuint:function(a,e,f,g){return f*(a/=g)*a*a*a*a+e},easeOutQuint:function(a,e,f,g){return f*((a=a/g-1)*a*a*a*a+1)+e},easeInOutQuint:function(a,e,f,g){if((a/=g/2)<1){return f/2*a*a*a*a*a+e}return f/2*((a-=2)*a*a*a*a+2)+e},easeInSine:function(a,e,f,g){return -f*Math.cos(a/g*(3.14/2))+f+e},easeOutSine:function(a,e,f,g){return f*Math.sin(a/g*(3.14/2))+e},easeInOutSine:function(a,e,f,g){return -f/2*(Math.cos(3.14*a/g)-1)+e},easeInExpo:function(a,e,f,g){return(a==0)?e:f*Math.pow(2,10*(a/g-1))+e},easeOutExpo:function(a,e,f,g){return(a==g)?e+f:f*(-Math.pow(2,-10*a/g)+1)+e},easeInOutExpo:function(a,e,f,g){if(a==0){return e}if(a==g){return e+f}if((a/=g/2)<1){return f/2*Math.pow(2,10*(a-1))+e}return f/2*(-Math.pow(2,-10*--a)+2)+e},easeInCirc:function(a,e,f,g){return -f*(Math.sqrt(1-(a/=g)*a)-1)+e},easeOutCirc:function(a,e,f,g){return f*Math.sqrt(1-(a=a/g-1)*a)+e},easeInOutCirc:function(a,e,f,g){if((a/=g/2)<1){return -f/2*(Math.sqrt(1-a*a)-1)+e}return f/2*(Math.sqrt(1-(a-=2)*a)+1)+e},easeInBounce:function(a,e,f,g){return f-rb.easing.easeOutBounce(g-a,0,f,g)+e},easeOutBounce:function(a,e,f,g){if((a/=g)<(1/2.75)){return f*(7.5625*a*a)+e}else{if(a<(2/2.75)){return f*(7.5625*(a-=(1.5/2.75))*a+0.75)+e}else{if(a<(2.5/2.75)){return f*(7.5625*(a-=(2.25/2.75))*a+0.9375)+e}else{return f*(7.5625*(a-=(2.625/2.75))*a+0.984375)+e}}}},easeInOutBounce:function(a,e,f,g){if(a<g/2){return rb.easing.easeInBounce(a*2,0,f,g)*0.5+e}return rb.easing.easeOutBounce(a*2-g,0,f,g)*0.5+f*0.5+e}});