2 * Portions of this file are based on pieces of Yahoo User Interface Library
3 * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
4 * YUI licensed under the BSD License:
5 * http://developer.yahoo.net/yui/license.txt
6 * <script type="text/javascript">
12 easeNone: function (t, b, c, d) {
17 easeIn: function (t, b, c, d) {
18 return c * (t /= d) * t + b;
22 easeOut: function (t, b, c, d) {
23 return -c * (t /= d) * (t - 2) + b;
27 easeBoth: function (t, b, c, d) {
28 if ((t /= d / 2) < 1) {
29 return c / 2 * t * t + b;
32 return -c / 2 * ((--t) * (t - 2) - 1) + b;
36 easeInStrong: function (t, b, c, d) {
37 return c * (t /= d) * t * t * t + b;
41 easeOutStrong: function (t, b, c, d) {
42 return -c * ((t = t / d - 1) * t * t * t - 1) + b;
46 easeBothStrong: function (t, b, c, d) {
47 if ((t /= d / 2) < 1) {
48 return c / 2 * t * t * t * t + b;
51 return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
56 elasticIn: function (t, b, c, d, a, p) {
67 if (!a || a < Math.abs(c)) {
72 var s = p / (2 * Math.PI) * Math.asin(c / a);
75 return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
79 elasticOut: function (t, b, c, d, a, p) {
90 if (!a || a < Math.abs(c)) {
95 var s = p / (2 * Math.PI) * Math.asin(c / a);
98 return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
102 elasticBoth: function (t, b, c, d, a, p) {
107 if ((t /= d / 2) == 2) {
115 if (!a || a < Math.abs(c)) {
120 var s = p / (2 * Math.PI) * Math.asin(c / a);
124 return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
125 Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
127 return a * Math.pow(2, -10 * (t -= 1)) *
128 Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
133 backIn: function (t, b, c, d, s) {
134 if (typeof s == 'undefined') {
137 return c * (t /= d) * t * ((s + 1) * t - s) + b;
141 backOut: function (t, b, c, d, s) {
142 if (typeof s == 'undefined') {
145 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
149 backBoth: function (t, b, c, d, s) {
150 if (typeof s == 'undefined') {
154 if ((t /= d / 2 ) < 1) {
155 return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
157 return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
161 bounceIn: function (t, b, c, d) {
162 return c - Roo.lib.Easing.bounceOut(d - t, 0, c, d) + b;
166 bounceOut: function (t, b, c, d) {
167 if ((t /= d) < (1 / 2.75)) {
168 return c * (7.5625 * t * t) + b;
169 } else if (t < (2 / 2.75)) {
170 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
171 } else if (t < (2.5 / 2.75)) {
172 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
174 return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
178 bounceBoth: function (t, b, c, d) {
180 return Roo.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
182 return Roo.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;