~jstys-z/helioviewer.org/timeline

« back to all changes in this revision

Viewing changes to lib/jquery/jquery.ui-1.7.1/development-bundle/ui/effects.core.js

  • Committer: V. Keith Hughitt
  • Date: 2009-03-26 19:20:57 UTC
  • Revision ID: hughitt1@kore-20090326192057-u0x8rf8sf5lmmnwh
nightly build 03-26-2009: Using alpha-channel JPEG 2000 dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * jQuery UI Effects 1.7.1
 
3
 *
 
4
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 
5
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 
6
 * and GPL (GPL-LICENSE.txt) licenses.
 
7
 *
 
8
 * http://docs.jquery.com/UI/Effects/
 
9
 */
 
10
;jQuery.effects || (function($) {
 
11
 
 
12
$.effects = {
 
13
        version: "1.7.1",
 
14
 
 
15
        // Saves a set of properties in a data storage
 
16
        save: function(element, set) {
 
17
                for(var i=0; i < set.length; i++) {
 
18
                        if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
 
19
                }
 
20
        },
 
21
 
 
22
        // Restores a set of previously saved properties from a data storage
 
23
        restore: function(element, set) {
 
24
                for(var i=0; i < set.length; i++) {
 
25
                        if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
 
26
                }
 
27
        },
 
28
 
 
29
        setMode: function(el, mode) {
 
30
                if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
 
31
                return mode;
 
32
        },
 
33
 
 
34
        getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
 
35
                // this should be a little more flexible in the future to handle a string & hash
 
36
                var y, x;
 
37
                switch (origin[0]) {
 
38
                        case 'top': y = 0; break;
 
39
                        case 'middle': y = 0.5; break;
 
40
                        case 'bottom': y = 1; break;
 
41
                        default: y = origin[0] / original.height;
 
42
                };
 
43
                switch (origin[1]) {
 
44
                        case 'left': x = 0; break;
 
45
                        case 'center': x = 0.5; break;
 
46
                        case 'right': x = 1; break;
 
47
                        default: x = origin[1] / original.width;
 
48
                };
 
49
                return {x: x, y: y};
 
50
        },
 
51
 
 
52
        // Wraps the element around a wrapper that copies position properties
 
53
        createWrapper: function(element) {
 
54
 
 
55
                //if the element is already wrapped, return it
 
56
                if (element.parent().is('.ui-effects-wrapper'))
 
57
                        return element.parent();
 
58
 
 
59
                //Cache width,height and float properties of the element, and create a wrapper around it
 
60
                var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') };
 
61
                element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
 
62
                var wrapper = element.parent();
 
63
 
 
64
                //Transfer the positioning of the element to the wrapper
 
65
                if (element.css('position') == 'static') {
 
66
                        wrapper.css({ position: 'relative' });
 
67
                        element.css({ position: 'relative'} );
 
68
                } else {
 
69
                        var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto';
 
70
                        var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto';
 
71
                        wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
 
72
                        element.css({position: 'relative', top: 0, left: 0 });
 
73
                }
 
74
 
 
75
                wrapper.css(props);
 
76
                return wrapper;
 
77
        },
 
78
 
 
79
        removeWrapper: function(element) {
 
80
                if (element.parent().is('.ui-effects-wrapper'))
 
81
                        return element.parent().replaceWith(element);
 
82
                return element;
 
83
        },
 
84
 
 
85
        setTransition: function(element, list, factor, value) {
 
86
                value = value || {};
 
87
                $.each(list, function(i, x){
 
88
                        unit = element.cssUnit(x);
 
89
                        if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
 
90
                });
 
91
                return value;
 
92
        },
 
93
 
 
94
        //Base function to animate from one class to another in a seamless transition
 
95
        animateClass: function(value, duration, easing, callback) {
 
96
 
 
97
                var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
 
98
                var ea = (typeof easing == "string" ? easing : null);
 
99
 
 
100
                return this.each(function() {
 
101
 
 
102
                        var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
 
103
                        if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
 
104
                        if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
 
105
 
 
106
                        //Let's get a style offset
 
107
                        var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
 
108
                        if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
 
109
                        var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
 
110
                        if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
 
111
 
 
112
                        // The main function to form the object for animation
 
113
                        for(var n in newStyle) {
 
114
                                if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
 
115
                                && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
 
116
                                && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
 
117
                                && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
 
118
                                && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
 
119
                                ) offset[n] = newStyle[n];
 
120
                        }
 
121
 
 
122
                        that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
 
123
                                // Change style attribute back to original. For stupid IE, we need to clear the damn object.
 
124
                                if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
 
125
                                if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
 
126
                                if(cb) cb.apply(this, arguments);
 
127
                        });
 
128
 
 
129
                });
 
130
        }
 
131
};
 
132
 
 
133
 
 
134
function _normalizeArguments(a, m) {
 
135
 
 
136
        var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m;
 
137
        var speed = a[1] && a[1].constructor != Object ? a[1] : (o.duration ? o.duration : a[2]); //either comes from options.duration or the secon/third argument
 
138
                speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
 
139
        var callback = o.callback || ( $.isFunction(a[1]) && a[1] ) || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] );
 
140
 
 
141
        return [a[0], o, speed, callback];
 
142
        
 
143
}
 
144
 
 
145
//Extend the methods of jQuery
 
146
$.fn.extend({
 
147
 
 
148
        //Save old methods
 
149
        _show: $.fn.show,
 
150
        _hide: $.fn.hide,
 
151
        __toggle: $.fn.toggle,
 
152
        _addClass: $.fn.addClass,
 
153
        _removeClass: $.fn.removeClass,
 
154
        _toggleClass: $.fn.toggleClass,
 
155
 
 
156
        // New effect methods
 
157
        effect: function(fx, options, speed, callback) {
 
158
                return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null;
 
159
        },
 
160
 
 
161
        show: function() {
 
162
                if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
 
163
                        return this._show.apply(this, arguments);
 
164
                else {
 
165
                        return this.effect.apply(this, _normalizeArguments(arguments, 'show'));
 
166
                }
 
167
        },
 
168
 
 
169
        hide: function() {
 
170
                if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
 
171
                        return this._hide.apply(this, arguments);
 
172
                else {
 
173
                        return this.effect.apply(this, _normalizeArguments(arguments, 'hide'));
 
174
                }
 
175
        },
 
176
 
 
177
        toggle: function(){
 
178
                if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function))
 
179
                        return this.__toggle.apply(this, arguments);
 
180
                else {
 
181
                        return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
 
182
                }
 
183
        },
 
184
 
 
185
        addClass: function(classNames, speed, easing, callback) {
 
186
                return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
 
187
        },
 
188
        removeClass: function(classNames,speed,easing,callback) {
 
189
                return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
 
190
        },
 
191
        toggleClass: function(classNames,speed,easing,callback) {
 
192
                return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);
 
193
        },
 
194
        morph: function(remove,add,speed,easing,callback) {
 
195
                return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
 
196
        },
 
197
        switchClass: function() {
 
198
                return this.morph.apply(this, arguments);
 
199
        },
 
200
 
 
201
        // helper functions
 
202
        cssUnit: function(key) {
 
203
                var style = this.css(key), val = [];
 
204
                $.each( ['em','px','%','pt'], function(i, unit){
 
205
                        if(style.indexOf(unit) > 0)
 
206
                                val = [parseFloat(style), unit];
 
207
                });
 
208
                return val;
 
209
        }
 
210
});
 
211
 
 
212
/*
 
213
 * jQuery Color Animations
 
214
 * Copyright 2007 John Resig
 
215
 * Released under the MIT and GPL licenses.
 
216
 */
 
217
 
 
218
// We override the animation for all of these color styles
 
219
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
 
220
                $.fx.step[attr] = function(fx) {
 
221
                                if ( fx.state == 0 ) {
 
222
                                                fx.start = getColor( fx.elem, attr );
 
223
                                                fx.end = getRGB( fx.end );
 
224
                                }
 
225
 
 
226
                                fx.elem.style[attr] = "rgb(" + [
 
227
                                                Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0),
 
228
                                                Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0),
 
229
                                                Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0)
 
230
                                ].join(",") + ")";
 
231
                        };
 
232
});
 
233
 
 
234
// Color Conversion functions from highlightFade
 
235
// By Blair Mitchelmore
 
236
// http://jquery.offput.ca/highlightFade/
 
237
 
 
238
// Parse strings looking for color tuples [255,255,255]
 
239
function getRGB(color) {
 
240
                var result;
 
241
 
 
242
                // Check if we're already dealing with an array of colors
 
243
                if ( color && color.constructor == Array && color.length == 3 )
 
244
                                return color;
 
245
 
 
246
                // Look for rgb(num,num,num)
 
247
                if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
 
248
                                return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
 
249
 
 
250
                // Look for rgb(num%,num%,num%)
 
251
                if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
 
252
                                return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
 
253
 
 
254
                // Look for #a0b1c2
 
255
                if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
 
256
                                return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
 
257
 
 
258
                // Look for #fff
 
259
                if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
 
260
                                return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
 
261
 
 
262
                // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
 
263
                if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
 
264
                                return colors['transparent'];
 
265
 
 
266
                // Otherwise, we're most likely dealing with a named color
 
267
                return colors[$.trim(color).toLowerCase()];
 
268
}
 
269
 
 
270
function getColor(elem, attr) {
 
271
                var color;
 
272
 
 
273
                do {
 
274
                                color = $.curCSS(elem, attr);
 
275
 
 
276
                                // Keep going until we find an element that has color, or we hit the body
 
277
                                if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
 
278
                                                break;
 
279
 
 
280
                                attr = "backgroundColor";
 
281
                } while ( elem = elem.parentNode );
 
282
 
 
283
                return getRGB(color);
 
284
};
 
285
 
 
286
// Some named colors to work with
 
287
// From Interface by Stefan Petre
 
288
// http://interface.eyecon.ro/
 
289
 
 
290
var colors = {
 
291
        aqua:[0,255,255],
 
292
        azure:[240,255,255],
 
293
        beige:[245,245,220],
 
294
        black:[0,0,0],
 
295
        blue:[0,0,255],
 
296
        brown:[165,42,42],
 
297
        cyan:[0,255,255],
 
298
        darkblue:[0,0,139],
 
299
        darkcyan:[0,139,139],
 
300
        darkgrey:[169,169,169],
 
301
        darkgreen:[0,100,0],
 
302
        darkkhaki:[189,183,107],
 
303
        darkmagenta:[139,0,139],
 
304
        darkolivegreen:[85,107,47],
 
305
        darkorange:[255,140,0],
 
306
        darkorchid:[153,50,204],
 
307
        darkred:[139,0,0],
 
308
        darksalmon:[233,150,122],
 
309
        darkviolet:[148,0,211],
 
310
        fuchsia:[255,0,255],
 
311
        gold:[255,215,0],
 
312
        green:[0,128,0],
 
313
        indigo:[75,0,130],
 
314
        khaki:[240,230,140],
 
315
        lightblue:[173,216,230],
 
316
        lightcyan:[224,255,255],
 
317
        lightgreen:[144,238,144],
 
318
        lightgrey:[211,211,211],
 
319
        lightpink:[255,182,193],
 
320
        lightyellow:[255,255,224],
 
321
        lime:[0,255,0],
 
322
        magenta:[255,0,255],
 
323
        maroon:[128,0,0],
 
324
        navy:[0,0,128],
 
325
        olive:[128,128,0],
 
326
        orange:[255,165,0],
 
327
        pink:[255,192,203],
 
328
        purple:[128,0,128],
 
329
        violet:[128,0,128],
 
330
        red:[255,0,0],
 
331
        silver:[192,192,192],
 
332
        white:[255,255,255],
 
333
        yellow:[255,255,0],
 
334
        transparent: [255,255,255]
 
335
};
 
336
 
 
337
/*
 
338
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 
339
 *
 
340
 * Uses the built in easing capabilities added In jQuery 1.1
 
341
 * to offer multiple easing options
 
342
 *
 
343
 * TERMS OF USE - jQuery Easing
 
344
 *
 
345
 * Open source under the BSD License.
 
346
 *
 
347
 * Copyright 2008 George McGinley Smith
 
348
 * All rights reserved.
 
349
 *
 
350
 * Redistribution and use in source and binary forms, with or without modification,
 
351
 * are permitted provided that the following conditions are met:
 
352
 *
 
353
 * Redistributions of source code must retain the above copyright notice, this list of
 
354
 * conditions and the following disclaimer.
 
355
 * Redistributions in binary form must reproduce the above copyright notice, this list
 
356
 * of conditions and the following disclaimer in the documentation and/or other materials
 
357
 * provided with the distribution.
 
358
 *
 
359
 * Neither the name of the author nor the names of contributors may be used to endorse
 
360
 * or promote products derived from this software without specific prior written permission.
 
361
 *
 
362
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 
363
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
364
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 
365
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
366
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 
367
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 
368
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 
369
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 
370
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 
371
 *
 
372
*/
 
373
 
 
374
// t: current time, b: begInnIng value, c: change In value, d: duration
 
375
$.easing.jswing = $.easing.swing;
 
376
 
 
377
$.extend($.easing,
 
378
{
 
379
        def: 'easeOutQuad',
 
380
        swing: function (x, t, b, c, d) {
 
381
                //alert($.easing.default);
 
382
                return $.easing[$.easing.def](x, t, b, c, d);
 
383
        },
 
384
        easeInQuad: function (x, t, b, c, d) {
 
385
                return c*(t/=d)*t + b;
 
386
        },
 
387
        easeOutQuad: function (x, t, b, c, d) {
 
388
                return -c *(t/=d)*(t-2) + b;
 
389
        },
 
390
        easeInOutQuad: function (x, t, b, c, d) {
 
391
                if ((t/=d/2) < 1) return c/2*t*t + b;
 
392
                return -c/2 * ((--t)*(t-2) - 1) + b;
 
393
        },
 
394
        easeInCubic: function (x, t, b, c, d) {
 
395
                return c*(t/=d)*t*t + b;
 
396
        },
 
397
        easeOutCubic: function (x, t, b, c, d) {
 
398
                return c*((t=t/d-1)*t*t + 1) + b;
 
399
        },
 
400
        easeInOutCubic: function (x, t, b, c, d) {
 
401
                if ((t/=d/2) < 1) return c/2*t*t*t + b;
 
402
                return c/2*((t-=2)*t*t + 2) + b;
 
403
        },
 
404
        easeInQuart: function (x, t, b, c, d) {
 
405
                return c*(t/=d)*t*t*t + b;
 
406
        },
 
407
        easeOutQuart: function (x, t, b, c, d) {
 
408
                return -c * ((t=t/d-1)*t*t*t - 1) + b;
 
409
        },
 
410
        easeInOutQuart: function (x, t, b, c, d) {
 
411
                if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
 
412
                return -c/2 * ((t-=2)*t*t*t - 2) + b;
 
413
        },
 
414
        easeInQuint: function (x, t, b, c, d) {
 
415
                return c*(t/=d)*t*t*t*t + b;
 
416
        },
 
417
        easeOutQuint: function (x, t, b, c, d) {
 
418
                return c*((t=t/d-1)*t*t*t*t + 1) + b;
 
419
        },
 
420
        easeInOutQuint: function (x, t, b, c, d) {
 
421
                if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
 
422
                return c/2*((t-=2)*t*t*t*t + 2) + b;
 
423
        },
 
424
        easeInSine: function (x, t, b, c, d) {
 
425
                return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
 
426
        },
 
427
        easeOutSine: function (x, t, b, c, d) {
 
428
                return c * Math.sin(t/d * (Math.PI/2)) + b;
 
429
        },
 
430
        easeInOutSine: function (x, t, b, c, d) {
 
431
                return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
 
432
        },
 
433
        easeInExpo: function (x, t, b, c, d) {
 
434
                return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
 
435
        },
 
436
        easeOutExpo: function (x, t, b, c, d) {
 
437
                return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
 
438
        },
 
439
        easeInOutExpo: function (x, t, b, c, d) {
 
440
                if (t==0) return b;
 
441
                if (t==d) return b+c;
 
442
                if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
 
443
                return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
 
444
        },
 
445
        easeInCirc: function (x, t, b, c, d) {
 
446
                return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
 
447
        },
 
448
        easeOutCirc: function (x, t, b, c, d) {
 
449
                return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
 
450
        },
 
451
        easeInOutCirc: function (x, t, b, c, d) {
 
452
                if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
 
453
                return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
 
454
        },
 
455
        easeInElastic: function (x, t, b, c, d) {
 
456
                var s=1.70158;var p=0;var a=c;
 
457
                if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
 
458
                if (a < Math.abs(c)) { a=c; var s=p/4; }
 
459
                else var s = p/(2*Math.PI) * Math.asin (c/a);
 
460
                return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
 
461
        },
 
462
        easeOutElastic: function (x, t, b, c, d) {
 
463
                var s=1.70158;var p=0;var a=c;
 
464
                if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
 
465
                if (a < Math.abs(c)) { a=c; var s=p/4; }
 
466
                else var s = p/(2*Math.PI) * Math.asin (c/a);
 
467
                return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
 
468
        },
 
469
        easeInOutElastic: function (x, t, b, c, d) {
 
470
                var s=1.70158;var p=0;var a=c;
 
471
                if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
 
472
                if (a < Math.abs(c)) { a=c; var s=p/4; }
 
473
                else var s = p/(2*Math.PI) * Math.asin (c/a);
 
474
                if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
 
475
                return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
 
476
        },
 
477
        easeInBack: function (x, t, b, c, d, s) {
 
478
                if (s == undefined) s = 1.70158;
 
479
                return c*(t/=d)*t*((s+1)*t - s) + b;
 
480
        },
 
481
        easeOutBack: function (x, t, b, c, d, s) {
 
482
                if (s == undefined) s = 1.70158;
 
483
                return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
 
484
        },
 
485
        easeInOutBack: function (x, t, b, c, d, s) {
 
486
                if (s == undefined) s = 1.70158;
 
487
                if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
 
488
                return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
 
489
        },
 
490
        easeInBounce: function (x, t, b, c, d) {
 
491
                return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
 
492
        },
 
493
        easeOutBounce: function (x, t, b, c, d) {
 
494
                if ((t/=d) < (1/2.75)) {
 
495
                        return c*(7.5625*t*t) + b;
 
496
                } else if (t < (2/2.75)) {
 
497
                        return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
 
498
                } else if (t < (2.5/2.75)) {
 
499
                        return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
 
500
                } else {
 
501
                        return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
 
502
                }
 
503
        },
 
504
        easeInOutBounce: function (x, t, b, c, d) {
 
505
                if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
 
506
                return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
 
507
        }
 
508
});
 
509
 
 
510
/*
 
511
 *
 
512
 * TERMS OF USE - EASING EQUATIONS
 
513
 *
 
514
 * Open source under the BSD License.
 
515
 *
 
516
 * Copyright 2001 Robert Penner
 
517
 * All rights reserved.
 
518
 *
 
519
 * Redistribution and use in source and binary forms, with or without modification,
 
520
 * are permitted provided that the following conditions are met:
 
521
 *
 
522
 * Redistributions of source code must retain the above copyright notice, this list of
 
523
 * conditions and the following disclaimer.
 
524
 * Redistributions in binary form must reproduce the above copyright notice, this list
 
525
 * of conditions and the following disclaimer in the documentation and/or other materials
 
526
 * provided with the distribution.
 
527
 *
 
528
 * Neither the name of the author nor the names of contributors may be used to endorse
 
529
 * or promote products derived from this software without specific prior written permission.
 
530
 *
 
531
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 
532
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
533
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 
534
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
535
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 
536
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 
537
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 
538
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 
539
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 
540
 *
 
541
 */
 
542
 
 
543
})(jQuery);