client/player/RES/js/ui/jquery.effects.core.js
author hurons
Fri, 06 Aug 2010 12:50:43 +0200
changeset 28 44c6b827825d
permissions -rw-r--r--
Commit new player (version radio) with new path organisation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     1
/*
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     2
 * jQuery UI Effects 1.8.1
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     3
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     4
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     5
 * Dual licensed under the MIT (MIT-LICENSE.txt)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     6
 * and GPL (GPL-LICENSE.txt) licenses.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     7
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     8
 * http://docs.jquery.com/UI/Effects/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     9
 */
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    10
;jQuery.effects || (function($) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    11
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    12
$.effects = {};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    13
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    14
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    15
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    16
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    17
/****************************** COLOR ANIMATIONS ******************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    18
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    19
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    20
// override the animation for color styles
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    21
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    22
	'borderRightColor', 'borderTopColor', 'color', 'outlineColor'],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    23
function(i, attr) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    24
	$.fx.step[attr] = function(fx) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    25
		if (!fx.colorInit) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    26
			fx.start = getColor(fx.elem, attr);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    27
			fx.end = getRGB(fx.end);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    28
			fx.colorInit = true;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    29
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    30
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    31
		fx.elem.style[attr] = 'rgb(' +
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    32
			Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    33
			Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    34
			Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    35
	};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    36
});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    37
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    38
// Color Conversion functions from highlightFade
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    39
// By Blair Mitchelmore
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    40
// http://jquery.offput.ca/highlightFade/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    41
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    42
// Parse strings looking for color tuples [255,255,255]
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    43
function getRGB(color) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    44
		var result;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    45
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    46
		// Check if we're already dealing with an array of colors
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    47
		if ( color && color.constructor == Array && color.length == 3 )
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    48
				return color;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    49
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    50
		// Look for rgb(num,num,num)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    51
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    52
				return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    53
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    54
		// Look for rgb(num%,num%,num%)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    55
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    56
				return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    57
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    58
		// Look for #a0b1c2
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    59
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    60
				return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    61
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    62
		// Look for #fff
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    63
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    64
				return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    65
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    66
		// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    67
		if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    68
				return colors['transparent'];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    69
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    70
		// Otherwise, we're most likely dealing with a named color
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    71
		return colors[$.trim(color).toLowerCase()];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    72
}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    73
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    74
function getColor(elem, attr) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    75
		var color;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    76
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    77
		do {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    78
				color = $.curCSS(elem, attr);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    79
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    80
				// Keep going until we find an element that has color, or we hit the body
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    81
				if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    82
						break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    83
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    84
				attr = "backgroundColor";
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    85
		} while ( elem = elem.parentNode );
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    86
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    87
		return getRGB(color);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    88
};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    89
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    90
// Some named colors to work with
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    91
// From Interface by Stefan Petre
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    92
// http://interface.eyecon.ro/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    93
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    94
var colors = {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    95
	aqua:[0,255,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    96
	azure:[240,255,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    97
	beige:[245,245,220],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    98
	black:[0,0,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    99
	blue:[0,0,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   100
	brown:[165,42,42],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   101
	cyan:[0,255,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   102
	darkblue:[0,0,139],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   103
	darkcyan:[0,139,139],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   104
	darkgrey:[169,169,169],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   105
	darkgreen:[0,100,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   106
	darkkhaki:[189,183,107],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   107
	darkmagenta:[139,0,139],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   108
	darkolivegreen:[85,107,47],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   109
	darkorange:[255,140,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   110
	darkorchid:[153,50,204],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   111
	darkred:[139,0,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   112
	darksalmon:[233,150,122],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   113
	darkviolet:[148,0,211],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   114
	fuchsia:[255,0,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   115
	gold:[255,215,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   116
	green:[0,128,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   117
	indigo:[75,0,130],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   118
	khaki:[240,230,140],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   119
	lightblue:[173,216,230],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   120
	lightcyan:[224,255,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   121
	lightgreen:[144,238,144],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   122
	lightgrey:[211,211,211],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   123
	lightpink:[255,182,193],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   124
	lightyellow:[255,255,224],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   125
	lime:[0,255,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   126
	magenta:[255,0,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   127
	maroon:[128,0,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   128
	navy:[0,0,128],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   129
	olive:[128,128,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   130
	orange:[255,165,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   131
	pink:[255,192,203],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   132
	purple:[128,0,128],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   133
	violet:[128,0,128],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   134
	red:[255,0,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   135
	silver:[192,192,192],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   136
	white:[255,255,255],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   137
	yellow:[255,255,0],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   138
	transparent: [255,255,255]
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   139
};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   140
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   141
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   142
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   143
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   144
/****************************** CLASS ANIMATIONS ******************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   145
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   146
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   147
var classAnimationActions = ['add', 'remove', 'toggle'],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   148
	shorthandStyles = {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   149
		border: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   150
		borderBottom: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   151
		borderColor: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   152
		borderLeft: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   153
		borderRight: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   154
		borderTop: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   155
		borderWidth: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   156
		margin: 1,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   157
		padding: 1
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   158
	};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   159
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   160
function getElementStyles() {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   161
	var style = document.defaultView
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   162
			? document.defaultView.getComputedStyle(this, null)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   163
			: this.currentStyle,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   164
		newStyle = {},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   165
		key,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   166
		camelCase;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   167
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   168
	// webkit enumerates style porperties
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   169
	if (style && style.length && style[0] && style[style[0]]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   170
		var len = style.length;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   171
		while (len--) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   172
			key = style[len];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   173
			if (typeof style[key] == 'string') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   174
				camelCase = key.replace(/\-(\w)/g, function(all, letter){
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   175
					return letter.toUpperCase();
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   176
				});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   177
				newStyle[camelCase] = style[key];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   178
			}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   179
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   180
	} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   181
		for (key in style) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   182
			if (typeof style[key] === 'string') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   183
				newStyle[key] = style[key];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   184
			}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   185
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   186
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   187
	
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   188
	return newStyle;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   189
}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   190
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   191
function filterStyles(styles) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   192
	var name, value;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   193
	for (name in styles) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   194
		value = styles[name];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   195
		if (
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   196
			// ignore null and undefined values
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   197
			value == null ||
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   198
			// ignore functions (when does this occur?)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   199
			$.isFunction(value) ||
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   200
			// shorthand styles that need to be expanded
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   201
			name in shorthandStyles ||
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   202
			// ignore scrollbars (break in IE)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   203
			(/scrollbar/).test(name) ||
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   204
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   205
			// only colors or values that can be converted to numbers
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   206
			(!(/color/i).test(name) && isNaN(parseFloat(value)))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   207
		) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   208
			delete styles[name];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   209
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   210
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   211
	
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   212
	return styles;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   213
}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   214
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   215
function styleDifference(oldStyle, newStyle) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   216
	var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   217
		name;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   218
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   219
	for (name in newStyle) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   220
		if (oldStyle[name] != newStyle[name]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   221
			diff[name] = newStyle[name];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   222
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   223
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   224
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   225
	return diff;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   226
}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   227
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   228
$.effects.animateClass = function(value, duration, easing, callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   229
	if ($.isFunction(easing)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   230
		callback = easing;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   231
		easing = null;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   232
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   233
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   234
	return this.each(function() {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   235
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   236
		var that = $(this),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   237
			originalStyleAttr = that.attr('style') || ' ',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   238
			originalStyle = filterStyles(getElementStyles.call(this)),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   239
			newStyle,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   240
			className = that.attr('className');
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   241
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   242
		$.each(classAnimationActions, function(i, action) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   243
			if (value[action]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   244
				that[action + 'Class'](value[action]);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   245
			}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   246
		});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   247
		newStyle = filterStyles(getElementStyles.call(this));
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   248
		that.attr('className', className);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   249
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   250
		that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   251
			$.each(classAnimationActions, function(i, action) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   252
				if (value[action]) { that[action + 'Class'](value[action]); }
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   253
			});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   254
			// work around bug in IE by clearing the cssText before setting it
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   255
			if (typeof that.attr('style') == 'object') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   256
				that.attr('style').cssText = '';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   257
				that.attr('style').cssText = originalStyleAttr;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   258
			} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   259
				that.attr('style', originalStyleAttr);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   260
			}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   261
			if (callback) { callback.apply(this, arguments); }
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   262
		});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   263
	});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   264
};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   265
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   266
$.fn.extend({
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   267
	_addClass: $.fn.addClass,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   268
	addClass: function(classNames, speed, easing, callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   269
		return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   270
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   271
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   272
	_removeClass: $.fn.removeClass,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   273
	removeClass: function(classNames,speed,easing,callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   274
		return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   275
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   276
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   277
	_toggleClass: $.fn.toggleClass,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   278
	toggleClass: function(classNames, force, speed, easing, callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   279
		if ( typeof force == "boolean" || force === undefined ) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   280
			if ( !speed ) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   281
				// without speed parameter;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   282
				return this._toggleClass(classNames, force);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   283
			} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   284
				return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   285
			}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   286
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   287
			// without switch parameter;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   288
			return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   289
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   290
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   291
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   292
	switchClass: function(remove,add,speed,easing,callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   293
		return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   294
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   295
});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   296
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   297
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   298
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   299
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   300
/*********************************** EFFECTS **********************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   301
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   302
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   303
$.extend($.effects, {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   304
	version: "1.8.1",
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   305
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   306
	// Saves a set of properties in a data storage
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   307
	save: function(element, set) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   308
		for(var i=0; i < set.length; i++) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   309
			if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   310
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   311
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   312
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   313
	// Restores a set of previously saved properties from a data storage
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   314
	restore: function(element, set) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   315
		for(var i=0; i < set.length; i++) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   316
			if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   317
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   318
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   319
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   320
	setMode: function(el, mode) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   321
		if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   322
		return mode;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   323
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   324
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   325
	getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   326
		// this should be a little more flexible in the future to handle a string & hash
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   327
		var y, x;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   328
		switch (origin[0]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   329
			case 'top': y = 0; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   330
			case 'middle': y = 0.5; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   331
			case 'bottom': y = 1; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   332
			default: y = origin[0] / original.height;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   333
		};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   334
		switch (origin[1]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   335
			case 'left': x = 0; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   336
			case 'center': x = 0.5; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   337
			case 'right': x = 1; break;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   338
			default: x = origin[1] / original.width;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   339
		};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   340
		return {x: x, y: y};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   341
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   342
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   343
	// Wraps the element around a wrapper that copies position properties
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   344
	createWrapper: function(element) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   345
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   346
		// if the element is already wrapped, return it
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   347
		if (element.parent().is('.ui-effects-wrapper')) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   348
			return element.parent();
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   349
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   350
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   351
		// wrap the element
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   352
		var props = {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   353
				width: element.outerWidth(true),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   354
				height: element.outerHeight(true),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   355
				'float': element.css('float')
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   356
			},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   357
			wrapper = $('<div></div>')
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   358
				.addClass('ui-effects-wrapper')
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   359
				.css({
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   360
					fontSize: '100%',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   361
					background: 'transparent',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   362
					border: 'none',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   363
					margin: 0,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   364
					padding: 0
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   365
				});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   366
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   367
		element.wrap(wrapper);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   368
		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   369
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   370
		// transfer positioning properties to the wrapper
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   371
		if (element.css('position') == 'static') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   372
			wrapper.css({ position: 'relative' });
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   373
			element.css({ position: 'relative' });
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   374
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   375
			$.extend(props, {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   376
				position: element.css('position'),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   377
				zIndex: element.css('z-index')
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   378
			});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   379
			$.each(['top', 'left', 'bottom', 'right'], function(i, pos) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   380
				props[pos] = element.css(pos);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   381
				if (isNaN(parseInt(props[pos], 10))) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   382
					props[pos] = 'auto';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   383
				}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   384
			});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   385
			element.css({position: 'relative', top: 0, left: 0 });
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   386
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   387
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   388
		return wrapper.css(props).show();
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   389
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   390
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   391
	removeWrapper: function(element) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   392
		if (element.parent().is('.ui-effects-wrapper'))
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   393
			return element.parent().replaceWith(element);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   394
		return element;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   395
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   396
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   397
	setTransition: function(element, list, factor, value) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   398
		value = value || {};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   399
		$.each(list, function(i, x){
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   400
			unit = element.cssUnit(x);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   401
			if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   402
		});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   403
		return value;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   404
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   405
});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   406
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   407
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   408
function _normalizeArguments(effect, options, speed, callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   409
	// shift params for method overloading
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   410
	if (typeof effect == 'object') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   411
		callback = options;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   412
		speed = null;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   413
		options = effect;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   414
		effect = options.effect;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   415
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   416
	if ($.isFunction(options)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   417
		callback = options;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   418
		speed = null;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   419
		options = {};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   420
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   421
	if ($.isFunction(speed)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   422
		callback = speed;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   423
		speed = null;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   424
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   425
	if (typeof options == 'number' || $.fx.speeds[options]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   426
		callback = speed;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   427
		speed = options;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   428
		options = {};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   429
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   430
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   431
	options = options || {};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   432
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   433
	speed = speed || options.duration;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   434
	speed = $.fx.off ? 0 : typeof speed == 'number'
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   435
		? speed : $.fx.speeds[speed] || $.fx.speeds._default;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   436
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   437
	callback = callback || options.complete;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   438
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   439
	return [effect, options, speed, callback];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   440
}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   441
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   442
$.fn.extend({
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   443
	effect: function(effect, options, speed, callback) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   444
		var args = _normalizeArguments.apply(this, arguments),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   445
			// TODO: make effects takes actual parameters instead of a hash
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   446
			args2 = {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   447
				options: args[1],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   448
				duration: args[2],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   449
				callback: args[3]
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   450
			},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   451
			effectMethod = $.effects[effect];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   452
		
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   453
		return effectMethod && !$.fx.off ? effectMethod.call(this, args2) : this;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   454
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   455
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   456
	_show: $.fn.show,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   457
	show: function(speed) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   458
		if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   459
			return this._show.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   460
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   461
			var args = _normalizeArguments.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   462
			args[1].mode = 'show';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   463
			return this.effect.apply(this, args);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   464
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   465
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   466
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   467
	_hide: $.fn.hide,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   468
	hide: function(speed) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   469
		if (!speed || typeof speed == 'number' || $.fx.speeds[speed]) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   470
			return this._hide.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   471
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   472
			var args = _normalizeArguments.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   473
			args[1].mode = 'hide';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   474
			return this.effect.apply(this, args);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   475
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   476
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   477
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   478
	// jQuery core overloads toggle and create _toggle
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   479
	__toggle: $.fn.toggle,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   480
	toggle: function(speed) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   481
		if (!speed || typeof speed == 'number' || $.fx.speeds[speed] ||
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   482
			typeof speed == 'boolean' || $.isFunction(speed)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   483
			return this.__toggle.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   484
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   485
			var args = _normalizeArguments.apply(this, arguments);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   486
			args[1].mode = 'toggle';
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   487
			return this.effect.apply(this, args);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   488
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   489
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   490
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   491
	// helper functions
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   492
	cssUnit: function(key) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   493
		var style = this.css(key), val = [];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   494
		$.each( ['em','px','%','pt'], function(i, unit){
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   495
			if(style.indexOf(unit) > 0)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   496
				val = [parseFloat(style), unit];
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   497
		});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   498
		return val;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   499
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   500
});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   501
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   502
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   503
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   504
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   505
/*********************************** EASING ***********************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   506
/******************************************************************************/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   507
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   508
/*
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   509
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   510
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   511
 * Uses the built in easing capabilities added In jQuery 1.1
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   512
 * to offer multiple easing options
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   513
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   514
 * TERMS OF USE - jQuery Easing
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   515
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   516
 * Open source under the BSD License.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   517
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   518
 * Copyright 2008 George McGinley Smith
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   519
 * All rights reserved.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   520
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   521
 * Redistribution and use in source and binary forms, with or without modification,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   522
 * are permitted provided that the following conditions are met:
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   523
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   524
 * Redistributions of source code must retain the above copyright notice, this list of
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   525
 * conditions and the following disclaimer.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   526
 * Redistributions in binary form must reproduce the above copyright notice, this list
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   527
 * of conditions and the following disclaimer in the documentation and/or other materials
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   528
 * provided with the distribution.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   529
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   530
 * Neither the name of the author nor the names of contributors may be used to endorse
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   531
 * or promote products derived from this software without specific prior written permission.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   532
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   533
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   534
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   535
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   536
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   537
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   538
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   539
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   540
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   541
 * OF THE POSSIBILITY OF SUCH DAMAGE.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   542
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   543
*/
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   544
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   545
// t: current time, b: begInnIng value, c: change In value, d: duration
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   546
$.easing.jswing = $.easing.swing;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   547
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   548
$.extend($.easing,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   549
{
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   550
	def: 'easeOutQuad',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   551
	swing: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   552
		//alert($.easing.default);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   553
		return $.easing[$.easing.def](x, t, b, c, d);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   554
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   555
	easeInQuad: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   556
		return c*(t/=d)*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   557
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   558
	easeOutQuad: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   559
		return -c *(t/=d)*(t-2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   560
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   561
	easeInOutQuad: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   562
		if ((t/=d/2) < 1) return c/2*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   563
		return -c/2 * ((--t)*(t-2) - 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   564
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   565
	easeInCubic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   566
		return c*(t/=d)*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   567
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   568
	easeOutCubic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   569
		return c*((t=t/d-1)*t*t + 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   570
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   571
	easeInOutCubic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   572
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   573
		return c/2*((t-=2)*t*t + 2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   574
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   575
	easeInQuart: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   576
		return c*(t/=d)*t*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   577
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   578
	easeOutQuart: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   579
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   580
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   581
	easeInOutQuart: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   582
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   583
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   584
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   585
	easeInQuint: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   586
		return c*(t/=d)*t*t*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   587
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   588
	easeOutQuint: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   589
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   590
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   591
	easeInOutQuint: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   592
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   593
		return c/2*((t-=2)*t*t*t*t + 2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   594
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   595
	easeInSine: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   596
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   597
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   598
	easeOutSine: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   599
		return c * Math.sin(t/d * (Math.PI/2)) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   600
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   601
	easeInOutSine: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   602
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   603
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   604
	easeInExpo: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   605
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   606
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   607
	easeOutExpo: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   608
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   609
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   610
	easeInOutExpo: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   611
		if (t==0) return b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   612
		if (t==d) return b+c;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   613
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   614
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   615
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   616
	easeInCirc: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   617
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   618
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   619
	easeOutCirc: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   620
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   621
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   622
	easeInOutCirc: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   623
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   624
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   625
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   626
	easeInElastic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   627
		var s=1.70158;var p=0;var a=c;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   628
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   629
		if (a < Math.abs(c)) { a=c; var s=p/4; }
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   630
		else var s = p/(2*Math.PI) * Math.asin (c/a);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   631
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   632
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   633
	easeOutElastic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   634
		var s=1.70158;var p=0;var a=c;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   635
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   636
		if (a < Math.abs(c)) { a=c; var s=p/4; }
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   637
		else var s = p/(2*Math.PI) * Math.asin (c/a);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   638
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   639
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   640
	easeInOutElastic: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   641
		var s=1.70158;var p=0;var a=c;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   642
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   643
		if (a < Math.abs(c)) { a=c; var s=p/4; }
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   644
		else var s = p/(2*Math.PI) * Math.asin (c/a);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   645
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   646
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   647
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   648
	easeInBack: function (x, t, b, c, d, s) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   649
		if (s == undefined) s = 1.70158;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   650
		return c*(t/=d)*t*((s+1)*t - s) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   651
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   652
	easeOutBack: function (x, t, b, c, d, s) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   653
		if (s == undefined) s = 1.70158;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   654
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   655
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   656
	easeInOutBack: function (x, t, b, c, d, s) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   657
		if (s == undefined) s = 1.70158;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   658
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   659
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   660
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   661
	easeInBounce: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   662
		return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   663
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   664
	easeOutBounce: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   665
		if ((t/=d) < (1/2.75)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   666
			return c*(7.5625*t*t) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   667
		} else if (t < (2/2.75)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   668
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   669
		} else if (t < (2.5/2.75)) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   670
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   671
		} else {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   672
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   673
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   674
	},
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   675
	easeInOutBounce: function (x, t, b, c, d) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   676
		if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   677
		return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   678
	}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   679
});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   680
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   681
/*
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   682
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   683
 * TERMS OF USE - EASING EQUATIONS
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   684
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   685
 * Open source under the BSD License.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   686
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   687
 * Copyright 2001 Robert Penner
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   688
 * All rights reserved.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   689
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   690
 * Redistribution and use in source and binary forms, with or without modification,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   691
 * are permitted provided that the following conditions are met:
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   692
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   693
 * Redistributions of source code must retain the above copyright notice, this list of
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   694
 * conditions and the following disclaimer.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   695
 * Redistributions in binary form must reproduce the above copyright notice, this list
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   696
 * of conditions and the following disclaimer in the documentation and/or other materials
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   697
 * provided with the distribution.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   698
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   699
 * Neither the name of the author nor the names of contributors may be used to endorse
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   700
 * or promote products derived from this software without specific prior written permission.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   701
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   702
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   703
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   704
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   705
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   706
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   707
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   708
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   709
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   710
 * OF THE POSSIBILITY OF SUCH DAMAGE.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   711
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   712
 */
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   713
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
   714
})(jQuery);