Subversion Repositories Sites.obs-saisons.fr

Rev

Rev 31 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 54
1
/*!
1
/*!
2
 * jQuery JavaScript Library v1.4.2
2
 * jQuery JavaScript Library v1.4.4
3
 * http://jquery.com/
3
 * http://jquery.com/
4
 *
4
 *
5
 * Copyright 2010, John Resig
5
 * Copyright 2010, John Resig
6
 * Dual licensed under the MIT or GPL Version 2 licenses.
6
 * Dual licensed under the MIT or GPL Version 2 licenses.
7
 * http://jquery.org/license
7
 * http://jquery.org/license
8
 *
8
 *
9
 * Includes Sizzle.js
9
 * Includes Sizzle.js
10
 * http://sizzlejs.com/
10
 * http://sizzlejs.com/
11
 * Copyright 2010, The Dojo Foundation
11
 * Copyright 2010, The Dojo Foundation
12
 * Released under the MIT, BSD, and GPL Licenses.
12
 * Released under the MIT, BSD, and GPL Licenses.
13
 *
13
 *
14
 * Date: Sat Feb 13 22:33:48 2010 -0500
14
 * Date: Thu Nov 11 19:04:53 2010 -0500
15
 */
15
 */
16
(function( window, undefined ) {
16
(function( window, undefined ) {
-
 
17
 
-
 
18
// Use the correct document accordingly with window argument (sandbox)
-
 
19
var document = window.document;
-
 
20
var jQuery = (function() {
17
 
21
 
18
// Define a local copy of jQuery
22
// Define a local copy of jQuery
19
var jQuery = function( selector, context ) {
23
var jQuery = function( selector, context ) {
20
		// The jQuery object is actually just the init constructor 'enhanced'
24
		// The jQuery object is actually just the init constructor 'enhanced'
21
		return new jQuery.fn.init( selector, context );
25
		return new jQuery.fn.init( selector, context );
22
	},
26
	},
23
 
27
 
24
	// Map over jQuery in case of overwrite
28
	// Map over jQuery in case of overwrite
25
	_jQuery = window.jQuery,
29
	_jQuery = window.jQuery,
26
 
30
 
27
	// Map over the $ in case of overwrite
31
	// Map over the $ in case of overwrite
28
	_$ = window.$,
32
	_$ = window.$,
29
 
-
 
30
	// Use the correct document accordingly with window argument (sandbox)
-
 
31
	document = window.document,
-
 
32
 
33
 
33
	// A central reference to the root jQuery(document)
34
	// A central reference to the root jQuery(document)
34
	rootjQuery,
35
	rootjQuery,
35
 
36
 
36
	// A simple way to check for HTML strings or ID strings
37
	// A simple way to check for HTML strings or ID strings
37
	// (both of which we optimize for)
38
	// (both of which we optimize for)
38
	quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
39
	quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
39
 
40
 
40
	// Is it a simple selector
41
	// Is it a simple selector
41
	isSimple = /^.[^:#\[\.,]*$/,
42
	isSimple = /^.[^:#\[\.,]*$/,
42
 
43
 
43
	// Check if a string has a non-whitespace character in it
44
	// Check if a string has a non-whitespace character in it
44
	rnotwhite = /\S/,
45
	rnotwhite = /\S/,
-
 
46
	rwhite = /\s/,
45
 
47
 
-
 
48
	// Used for trimming whitespace
46
	// Used for trimming whitespace
49
	trimLeft = /^\s+/,
-
 
50
	trimRight = /\s+$/,
-
 
51
 
-
 
52
	// Check for non-word characters
-
 
53
	rnonword = /\W/,
-
 
54
 
-
 
55
	// Check for digits
47
	rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
56
	rdigit = /\d/,
48
 
57
 
49
	// Match a standalone tag
58
	// Match a standalone tag
50
	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
59
	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
 
60
 
-
 
61
	// JSON RegExp
-
 
62
	rvalidchars = /^[\],:{}\s]*$/,
-
 
63
	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-
 
64
	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-
 
65
	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
 
66
 
-
 
67
	// Useragent RegExp
-
 
68
	rwebkit = /(webkit)[ \/]([\w.]+)/,
-
 
69
	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
-
 
70
	rmsie = /(msie) ([\w.]+)/,
-
 
71
	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
51
 
72
 
52
	// Keep a UserAgent string for use with jQuery.browser
73
	// Keep a UserAgent string for use with jQuery.browser
53
	userAgent = navigator.userAgent,
74
	userAgent = navigator.userAgent,
54
 
75
 
55
	// For matching the engine and version of the browser
76
	// For matching the engine and version of the browser
56
	browserMatch,
77
	browserMatch,
57
	
78
	
58
	// Has the ready events already been bound?
79
	// Has the ready events already been bound?
59
	readyBound = false,
80
	readyBound = false,
60
	
81
	
61
	// The functions to execute on DOM ready
82
	// The functions to execute on DOM ready
62
	readyList = [],
83
	readyList = [],
63
 
84
 
64
	// The ready event handler
85
	// The ready event handler
65
	DOMContentLoaded,
86
	DOMContentLoaded,
66
 
87
 
67
	// Save a reference to some core methods
88
	// Save a reference to some core methods
68
	toString = Object.prototype.toString,
89
	toString = Object.prototype.toString,
69
	hasOwnProperty = Object.prototype.hasOwnProperty,
90
	hasOwn = Object.prototype.hasOwnProperty,
70
	push = Array.prototype.push,
91
	push = Array.prototype.push,
71
	slice = Array.prototype.slice,
92
	slice = Array.prototype.slice,
-
 
93
	trim = String.prototype.trim,
72
	indexOf = Array.prototype.indexOf;
94
	indexOf = Array.prototype.indexOf,
-
 
95
	
-
 
96
	// [[Class]] -> type pairs
-
 
97
	class2type = {};
73
 
98
 
74
jQuery.fn = jQuery.prototype = {
99
jQuery.fn = jQuery.prototype = {
75
	init: function( selector, context ) {
100
	init: function( selector, context ) {
76
		var match, elem, ret, doc;
101
		var match, elem, ret, doc;
77
 
102
 
78
		// Handle $(""), $(null), or $(undefined)
103
		// Handle $(""), $(null), or $(undefined)
79
		if ( !selector ) {
104
		if ( !selector ) {
80
			return this;
105
			return this;
81
		}
106
		}
82
 
107
 
83
		// Handle $(DOMElement)
108
		// Handle $(DOMElement)
84
		if ( selector.nodeType ) {
109
		if ( selector.nodeType ) {
85
			this.context = this[0] = selector;
110
			this.context = this[0] = selector;
86
			this.length = 1;
111
			this.length = 1;
87
			return this;
112
			return this;
88
		}
113
		}
89
		
114
		
90
		// The body element only exists once, optimize finding it
115
		// The body element only exists once, optimize finding it
91
		if ( selector === "body" && !context ) {
116
		if ( selector === "body" && !context && document.body ) {
92
			this.context = document;
117
			this.context = document;
93
			this[0] = document.body;
118
			this[0] = document.body;
94
			this.selector = "body";
119
			this.selector = "body";
95
			this.length = 1;
120
			this.length = 1;
96
			return this;
121
			return this;
97
		}
122
		}
98
 
123
 
99
		// Handle HTML strings
124
		// Handle HTML strings
100
		if ( typeof selector === "string" ) {
125
		if ( typeof selector === "string" ) {
101
			// Are we dealing with HTML string or an ID?
126
			// Are we dealing with HTML string or an ID?
102
			match = quickExpr.exec( selector );
127
			match = quickExpr.exec( selector );
103
 
128
 
104
			// Verify a match, and that no context was specified for #id
129
			// Verify a match, and that no context was specified for #id
105
			if ( match && (match[1] || !context) ) {
130
			if ( match && (match[1] || !context) ) {
106
 
131
 
107
				// HANDLE: $(html) -> $(array)
132
				// HANDLE: $(html) -> $(array)
108
				if ( match[1] ) {
133
				if ( match[1] ) {
109
					doc = (context ? context.ownerDocument || context : document);
134
					doc = (context ? context.ownerDocument || context : document);
110
 
135
 
111
					// If a single string is passed in and it's a single tag
136
					// If a single string is passed in and it's a single tag
112
					// just do a createElement and skip the rest
137
					// just do a createElement and skip the rest
113
					ret = rsingleTag.exec( selector );
138
					ret = rsingleTag.exec( selector );
114
 
139
 
115
					if ( ret ) {
140
					if ( ret ) {
116
						if ( jQuery.isPlainObject( context ) ) {
141
						if ( jQuery.isPlainObject( context ) ) {
117
							selector = [ document.createElement( ret[1] ) ];
142
							selector = [ document.createElement( ret[1] ) ];
118
							jQuery.fn.attr.call( selector, context, true );
143
							jQuery.fn.attr.call( selector, context, true );
119
 
144
 
120
						} else {
145
						} else {
121
							selector = [ doc.createElement( ret[1] ) ];
146
							selector = [ doc.createElement( ret[1] ) ];
122
						}
147
						}
123
 
148
 
124
					} else {
149
					} else {
125
						ret = buildFragment( [ match[1] ], [ doc ] );
150
						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
126
						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
151
						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
127
					}
152
					}
128
					
153
					
129
					return jQuery.merge( this, selector );
154
					return jQuery.merge( this, selector );
130
					
155
					
131
				// HANDLE: $("#id")
156
				// HANDLE: $("#id")
132
				} else {
157
				} else {
133
					elem = document.getElementById( match[2] );
158
					elem = document.getElementById( match[2] );
-
 
159
 
-
 
160
					// Check parentNode to catch when Blackberry 4.6 returns
134
 
161
					// nodes that are no longer in the document #6963
135
					if ( elem ) {
162
					if ( elem && elem.parentNode ) {
136
						// Handle the case where IE and Opera return items
163
						// Handle the case where IE and Opera return items
137
						// by name instead of ID
164
						// by name instead of ID
138
						if ( elem.id !== match[2] ) {
165
						if ( elem.id !== match[2] ) {
139
							return rootjQuery.find( selector );
166
							return rootjQuery.find( selector );
140
						}
167
						}
141
 
168
 
142
						// Otherwise, we inject the element directly into the jQuery object
169
						// Otherwise, we inject the element directly into the jQuery object
143
						this.length = 1;
170
						this.length = 1;
144
						this[0] = elem;
171
						this[0] = elem;
145
					}
172
					}
146
 
173
 
147
					this.context = document;
174
					this.context = document;
148
					this.selector = selector;
175
					this.selector = selector;
149
					return this;
176
					return this;
150
				}
177
				}
151
 
178
 
152
			// HANDLE: $("TAG")
179
			// HANDLE: $("TAG")
153
			} else if ( !context && /^\w+$/.test( selector ) ) {
180
			} else if ( !context && !rnonword.test( selector ) ) {
154
				this.selector = selector;
181
				this.selector = selector;
155
				this.context = document;
182
				this.context = document;
156
				selector = document.getElementsByTagName( selector );
183
				selector = document.getElementsByTagName( selector );
157
				return jQuery.merge( this, selector );
184
				return jQuery.merge( this, selector );
158
 
185
 
159
			// HANDLE: $(expr, $(...))
186
			// HANDLE: $(expr, $(...))
160
			} else if ( !context || context.jquery ) {
187
			} else if ( !context || context.jquery ) {
161
				return (context || rootjQuery).find( selector );
188
				return (context || rootjQuery).find( selector );
162
 
189
 
163
			// HANDLE: $(expr, context)
190
			// HANDLE: $(expr, context)
164
			// (which is just equivalent to: $(context).find(expr)
191
			// (which is just equivalent to: $(context).find(expr)
165
			} else {
192
			} else {
166
				return jQuery( context ).find( selector );
193
				return jQuery( context ).find( selector );
167
			}
194
			}
168
 
195
 
169
		// HANDLE: $(function)
196
		// HANDLE: $(function)
170
		// Shortcut for document ready
197
		// Shortcut for document ready
171
		} else if ( jQuery.isFunction( selector ) ) {
198
		} else if ( jQuery.isFunction( selector ) ) {
172
			return rootjQuery.ready( selector );
199
			return rootjQuery.ready( selector );
173
		}
200
		}
174
 
201
 
175
		if (selector.selector !== undefined) {
202
		if (selector.selector !== undefined) {
176
			this.selector = selector.selector;
203
			this.selector = selector.selector;
177
			this.context = selector.context;
204
			this.context = selector.context;
178
		}
205
		}
179
 
206
 
180
		return jQuery.makeArray( selector, this );
207
		return jQuery.makeArray( selector, this );
181
	},
208
	},
182
 
209
 
183
	// Start with an empty selector
210
	// Start with an empty selector
184
	selector: "",
211
	selector: "",
185
 
212
 
186
	// The current version of jQuery being used
213
	// The current version of jQuery being used
187
	jquery: "1.4.2",
214
	jquery: "1.4.4",
188
 
215
 
189
	// The default length of a jQuery object is 0
216
	// The default length of a jQuery object is 0
190
	length: 0,
217
	length: 0,
191
 
218
 
192
	// The number of elements contained in the matched element set
219
	// The number of elements contained in the matched element set
193
	size: function() {
220
	size: function() {
194
		return this.length;
221
		return this.length;
195
	},
222
	},
196
 
223
 
197
	toArray: function() {
224
	toArray: function() {
198
		return slice.call( this, 0 );
225
		return slice.call( this, 0 );
199
	},
226
	},
200
 
227
 
201
	// Get the Nth element in the matched element set OR
228
	// Get the Nth element in the matched element set OR
202
	// Get the whole matched element set as a clean array
229
	// Get the whole matched element set as a clean array
203
	get: function( num ) {
230
	get: function( num ) {
204
		return num == null ?
231
		return num == null ?
205
 
232
 
206
			// Return a 'clean' array
233
			// Return a 'clean' array
207
			this.toArray() :
234
			this.toArray() :
208
 
235
 
209
			// Return just the object
236
			// Return just the object
210
			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
237
			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
211
	},
238
	},
212
 
239
 
213
	// Take an array of elements and push it onto the stack
240
	// Take an array of elements and push it onto the stack
214
	// (returning the new matched element set)
241
	// (returning the new matched element set)
215
	pushStack: function( elems, name, selector ) {
242
	pushStack: function( elems, name, selector ) {
216
		// Build a new jQuery matched element set
243
		// Build a new jQuery matched element set
217
		var ret = jQuery();
244
		var ret = jQuery();
218
 
245
 
219
		if ( jQuery.isArray( elems ) ) {
246
		if ( jQuery.isArray( elems ) ) {
220
			push.apply( ret, elems );
247
			push.apply( ret, elems );
221
		
248
		
222
		} else {
249
		} else {
223
			jQuery.merge( ret, elems );
250
			jQuery.merge( ret, elems );
224
		}
251
		}
225
 
252
 
226
		// Add the old object onto the stack (as a reference)
253
		// Add the old object onto the stack (as a reference)
227
		ret.prevObject = this;
254
		ret.prevObject = this;
228
 
255
 
229
		ret.context = this.context;
256
		ret.context = this.context;
230
 
257
 
231
		if ( name === "find" ) {
258
		if ( name === "find" ) {
232
			ret.selector = this.selector + (this.selector ? " " : "") + selector;
259
			ret.selector = this.selector + (this.selector ? " " : "") + selector;
233
		} else if ( name ) {
260
		} else if ( name ) {
234
			ret.selector = this.selector + "." + name + "(" + selector + ")";
261
			ret.selector = this.selector + "." + name + "(" + selector + ")";
235
		}
262
		}
236
 
263
 
237
		// Return the newly-formed element set
264
		// Return the newly-formed element set
238
		return ret;
265
		return ret;
239
	},
266
	},
240
 
267
 
241
	// Execute a callback for every element in the matched set.
268
	// Execute a callback for every element in the matched set.
242
	// (You can seed the arguments with an array of args, but this is
269
	// (You can seed the arguments with an array of args, but this is
243
	// only used internally.)
270
	// only used internally.)
244
	each: function( callback, args ) {
271
	each: function( callback, args ) {
245
		return jQuery.each( this, callback, args );
272
		return jQuery.each( this, callback, args );
246
	},
273
	},
247
	
274
	
248
	ready: function( fn ) {
275
	ready: function( fn ) {
249
		// Attach the listeners
276
		// Attach the listeners
250
		jQuery.bindReady();
277
		jQuery.bindReady();
251
 
278
 
252
		// If the DOM is already ready
279
		// If the DOM is already ready
253
		if ( jQuery.isReady ) {
280
		if ( jQuery.isReady ) {
254
			// Execute the function immediately
281
			// Execute the function immediately
255
			fn.call( document, jQuery );
282
			fn.call( document, jQuery );
256
 
283
 
257
		// Otherwise, remember the function for later
284
		// Otherwise, remember the function for later
258
		} else if ( readyList ) {
285
		} else if ( readyList ) {
259
			// Add the function to the wait list
286
			// Add the function to the wait list
260
			readyList.push( fn );
287
			readyList.push( fn );
261
		}
288
		}
262
 
289
 
263
		return this;
290
		return this;
264
	},
291
	},
265
	
292
	
266
	eq: function( i ) {
293
	eq: function( i ) {
267
		return i === -1 ?
294
		return i === -1 ?
268
			this.slice( i ) :
295
			this.slice( i ) :
269
			this.slice( i, +i + 1 );
296
			this.slice( i, +i + 1 );
270
	},
297
	},
271
 
298
 
272
	first: function() {
299
	first: function() {
273
		return this.eq( 0 );
300
		return this.eq( 0 );
274
	},
301
	},
275
 
302
 
276
	last: function() {
303
	last: function() {
277
		return this.eq( -1 );
304
		return this.eq( -1 );
278
	},
305
	},
279
 
306
 
280
	slice: function() {
307
	slice: function() {
281
		return this.pushStack( slice.apply( this, arguments ),
308
		return this.pushStack( slice.apply( this, arguments ),
282
			"slice", slice.call(arguments).join(",") );
309
			"slice", slice.call(arguments).join(",") );
283
	},
310
	},
284
 
311
 
285
	map: function( callback ) {
312
	map: function( callback ) {
286
		return this.pushStack( jQuery.map(this, function( elem, i ) {
313
		return this.pushStack( jQuery.map(this, function( elem, i ) {
287
			return callback.call( elem, i, elem );
314
			return callback.call( elem, i, elem );
288
		}));
315
		}));
289
	},
316
	},
290
	
317
	
291
	end: function() {
318
	end: function() {
292
		return this.prevObject || jQuery(null);
319
		return this.prevObject || jQuery(null);
293
	},
320
	},
294
 
321
 
295
	// For internal use only.
322
	// For internal use only.
296
	// Behaves like an Array's method, not like a jQuery method.
323
	// Behaves like an Array's method, not like a jQuery method.
297
	push: push,
324
	push: push,
298
	sort: [].sort,
325
	sort: [].sort,
299
	splice: [].splice
326
	splice: [].splice
300
};
327
};
301
 
328
 
302
// Give the init function the jQuery prototype for later instantiation
329
// Give the init function the jQuery prototype for later instantiation
303
jQuery.fn.init.prototype = jQuery.fn;
330
jQuery.fn.init.prototype = jQuery.fn;
304
 
331
 
305
jQuery.extend = jQuery.fn.extend = function() {
332
jQuery.extend = jQuery.fn.extend = function() {
-
 
333
	 var options, name, src, copy, copyIsArray, clone,
306
	// copy reference to target object
334
		target = arguments[0] || {},
-
 
335
		i = 1,
307
	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
336
		length = arguments.length,
-
 
337
		deep = false;
308
 
338
 
309
	// Handle a deep copy situation
339
	// Handle a deep copy situation
310
	if ( typeof target === "boolean" ) {
340
	if ( typeof target === "boolean" ) {
311
		deep = target;
341
		deep = target;
312
		target = arguments[1] || {};
342
		target = arguments[1] || {};
313
		// skip the boolean and the target
343
		// skip the boolean and the target
314
		i = 2;
344
		i = 2;
315
	}
345
	}
316
 
346
 
317
	// Handle case when target is a string or something (possible in deep copy)
347
	// Handle case when target is a string or something (possible in deep copy)
318
	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
348
	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
319
		target = {};
349
		target = {};
320
	}
350
	}
321
 
351
 
322
	// extend jQuery itself if only one argument is passed
352
	// extend jQuery itself if only one argument is passed
323
	if ( length === i ) {
353
	if ( length === i ) {
324
		target = this;
354
		target = this;
325
		--i;
355
		--i;
326
	}
356
	}
327
 
357
 
328
	for ( ; i < length; i++ ) {
358
	for ( ; i < length; i++ ) {
329
		// Only deal with non-null/undefined values
359
		// Only deal with non-null/undefined values
330
		if ( (options = arguments[ i ]) != null ) {
360
		if ( (options = arguments[ i ]) != null ) {
331
			// Extend the base object
361
			// Extend the base object
332
			for ( name in options ) {
362
			for ( name in options ) {
333
				src = target[ name ];
363
				src = target[ name ];
334
				copy = options[ name ];
364
				copy = options[ name ];
335
 
365
 
336
				// Prevent never-ending loop
366
				// Prevent never-ending loop
337
				if ( target === copy ) {
367
				if ( target === copy ) {
338
					continue;
368
					continue;
339
				}
369
				}
340
 
370
 
341
				// Recurse if we're merging object literal values or arrays
371
				// Recurse if we're merging plain objects or arrays
-
 
372
				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-
 
373
					if ( copyIsArray ) {
342
				if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
374
						copyIsArray = false;
-
 
375
						clone = src && jQuery.isArray(src) ? src : [];
-
 
376
 
343
					var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
377
					} else {
-
 
378
						clone = src && jQuery.isPlainObject(src) ? src : {};
344
						: jQuery.isArray(copy) ? [] : {};
379
					}
345
 
380
 
346
					// Never move original objects, clone them
381
					// Never move original objects, clone them
347
					target[ name ] = jQuery.extend( deep, clone, copy );
382
					target[ name ] = jQuery.extend( deep, clone, copy );
348
 
383
 
349
				// Don't bring in undefined values
384
				// Don't bring in undefined values
350
				} else if ( copy !== undefined ) {
385
				} else if ( copy !== undefined ) {
351
					target[ name ] = copy;
386
					target[ name ] = copy;
352
				}
387
				}
353
			}
388
			}
354
		}
389
		}
355
	}
390
	}
356
 
391
 
357
	// Return the modified object
392
	// Return the modified object
358
	return target;
393
	return target;
359
};
394
};
360
 
395
 
361
jQuery.extend({
396
jQuery.extend({
362
	noConflict: function( deep ) {
397
	noConflict: function( deep ) {
363
		window.$ = _$;
398
		window.$ = _$;
364
 
399
 
365
		if ( deep ) {
400
		if ( deep ) {
366
			window.jQuery = _jQuery;
401
			window.jQuery = _jQuery;
367
		}
402
		}
368
 
403
 
369
		return jQuery;
404
		return jQuery;
370
	},
405
	},
371
	
406
	
372
	// Is the DOM ready to be used? Set to true once it occurs.
407
	// Is the DOM ready to be used? Set to true once it occurs.
373
	isReady: false,
408
	isReady: false,
-
 
409
 
-
 
410
	// A counter to track how many items to wait for before
-
 
411
	// the ready event fires. See #6781
-
 
412
	readyWait: 1,
374
	
413
	
375
	// Handle when the DOM is ready
414
	// Handle when the DOM is ready
-
 
415
	ready: function( wait ) {
-
 
416
		// A third-party is pushing the ready event forwards
-
 
417
		if ( wait === true ) {
-
 
418
			jQuery.readyWait--;
-
 
419
		}
376
	ready: function() {
420
 
377
		// Make sure that the DOM is not already loaded
421
		// Make sure that the DOM is not already loaded
378
		if ( !jQuery.isReady ) {
422
		if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
379
			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
423
			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
380
			if ( !document.body ) {
424
			if ( !document.body ) {
381
				return setTimeout( jQuery.ready, 13 );
425
				return setTimeout( jQuery.ready, 1 );
382
			}
426
			}
383
 
427
 
384
			// Remember that the DOM is ready
428
			// Remember that the DOM is ready
385
			jQuery.isReady = true;
429
			jQuery.isReady = true;
-
 
430
 
-
 
431
			// If a normal DOM Ready event fired, decrement, and wait if need be
-
 
432
			if ( wait !== true && --jQuery.readyWait > 0 ) {
-
 
433
				return;
-
 
434
			}
386
 
435
 
387
			// If there are functions bound, to execute
436
			// If there are functions bound, to execute
388
			if ( readyList ) {
437
			if ( readyList ) {
389
				// Execute all of them
438
				// Execute all of them
390
				var fn, i = 0;
439
				var fn,
391
				while ( (fn = readyList[ i++ ]) ) {
440
					i = 0,
392
					fn.call( document, jQuery );
441
					ready = readyList;
393
				}
-
 
394
 
442
 
395
				// Reset the list of functions
443
				// Reset the list of functions
396
				readyList = null;
444
				readyList = null;
-
 
445
 
-
 
446
				while ( (fn = ready[ i++ ]) ) {
-
 
447
					fn.call( document, jQuery );
397
			}
448
				}
398
 
449
 
399
			// Trigger any bound ready events
450
				// Trigger any bound ready events
400
			if ( jQuery.fn.triggerHandler ) {
451
				if ( jQuery.fn.trigger ) {
401
				jQuery( document ).triggerHandler( "ready" );
452
					jQuery( document ).trigger( "ready" ).unbind( "ready" );
-
 
453
				}
402
			}
454
			}
403
		}
455
		}
404
	},
456
	},
405
	
457
	
406
	bindReady: function() {
458
	bindReady: function() {
407
		if ( readyBound ) {
459
		if ( readyBound ) {
408
			return;
460
			return;
409
		}
461
		}
410
 
462
 
411
		readyBound = true;
463
		readyBound = true;
412
 
464
 
413
		// Catch cases where $(document).ready() is called after the
465
		// Catch cases where $(document).ready() is called after the
414
		// browser event has already occurred.
466
		// browser event has already occurred.
415
		if ( document.readyState === "complete" ) {
467
		if ( document.readyState === "complete" ) {
-
 
468
			// Handle it asynchronously to allow scripts the opportunity to delay ready
416
			return jQuery.ready();
469
			return setTimeout( jQuery.ready, 1 );
417
		}
470
		}
418
 
471
 
419
		// Mozilla, Opera and webkit nightlies currently support this event
472
		// Mozilla, Opera and webkit nightlies currently support this event
420
		if ( document.addEventListener ) {
473
		if ( document.addEventListener ) {
421
			// Use the handy event callback
474
			// Use the handy event callback
422
			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
475
			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
423
			
476
			
424
			// A fallback to window.onload, that will always work
477
			// A fallback to window.onload, that will always work
425
			window.addEventListener( "load", jQuery.ready, false );
478
			window.addEventListener( "load", jQuery.ready, false );
426
 
479
 
427
		// If IE event model is used
480
		// If IE event model is used
428
		} else if ( document.attachEvent ) {
481
		} else if ( document.attachEvent ) {
429
			// ensure firing before onload,
482
			// ensure firing before onload,
430
			// maybe late but safe also for iframes
483
			// maybe late but safe also for iframes
431
			document.attachEvent("onreadystatechange", DOMContentLoaded);
484
			document.attachEvent("onreadystatechange", DOMContentLoaded);
432
			
485
			
433
			// A fallback to window.onload, that will always work
486
			// A fallback to window.onload, that will always work
434
			window.attachEvent( "onload", jQuery.ready );
487
			window.attachEvent( "onload", jQuery.ready );
435
 
488
 
436
			// If IE and not a frame
489
			// If IE and not a frame
437
			// continually check to see if the document is ready
490
			// continually check to see if the document is ready
438
			var toplevel = false;
491
			var toplevel = false;
439
 
492
 
440
			try {
493
			try {
441
				toplevel = window.frameElement == null;
494
				toplevel = window.frameElement == null;
442
			} catch(e) {}
495
			} catch(e) {}
443
 
496
 
444
			if ( document.documentElement.doScroll && toplevel ) {
497
			if ( document.documentElement.doScroll && toplevel ) {
445
				doScrollCheck();
498
				doScrollCheck();
446
			}
499
			}
447
		}
500
		}
448
	},
501
	},
449
 
502
 
450
	// See test/unit/core.js for details concerning isFunction.
503
	// See test/unit/core.js for details concerning isFunction.
451
	// Since version 1.3, DOM methods and functions like alert
504
	// Since version 1.3, DOM methods and functions like alert
452
	// aren't supported. They return false on IE (#2968).
505
	// aren't supported. They return false on IE (#2968).
453
	isFunction: function( obj ) {
506
	isFunction: function( obj ) {
454
		return toString.call(obj) === "[object Function]";
507
		return jQuery.type(obj) === "function";
-
 
508
	},
-
 
509
 
-
 
510
	isArray: Array.isArray || function( obj ) {
-
 
511
		return jQuery.type(obj) === "array";
-
 
512
	},
-
 
513
 
-
 
514
	// A crude way of determining if an object is a window
-
 
515
	isWindow: function( obj ) {
-
 
516
		return obj && typeof obj === "object" && "setInterval" in obj;
-
 
517
	},
-
 
518
 
-
 
519
	isNaN: function( obj ) {
-
 
520
		return obj == null || !rdigit.test( obj ) || isNaN( obj );
455
	},
521
	},
456
 
522
 
-
 
523
	type: function( obj ) {
-
 
524
		return obj == null ?
457
	isArray: function( obj ) {
525
			String( obj ) :
458
		return toString.call(obj) === "[object Array]";
526
			class2type[ toString.call(obj) ] || "object";
459
	},
527
	},
460
 
528
 
461
	isPlainObject: function( obj ) {
529
	isPlainObject: function( obj ) {
462
		// Must be an Object.
530
		// Must be an Object.
463
		// Because of IE, we also have to check the presence of the constructor property.
531
		// Because of IE, we also have to check the presence of the constructor property.
464
		// Make sure that DOM nodes and window objects don't pass through, as well
532
		// Make sure that DOM nodes and window objects don't pass through, as well
465
		if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
533
		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
466
			return false;
534
			return false;
467
		}
535
		}
468
		
536
		
469
		// Not own constructor property must be Object
537
		// Not own constructor property must be Object
470
		if ( obj.constructor
538
		if ( obj.constructor &&
471
			&& !hasOwnProperty.call(obj, "constructor")
539
			!hasOwn.call(obj, "constructor") &&
472
			&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
540
			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
473
			return false;
541
			return false;
474
		}
542
		}
475
		
543
		
476
		// Own properties are enumerated firstly, so to speed up,
544
		// Own properties are enumerated firstly, so to speed up,
477
		// if last one is own, then all properties are own.
545
		// if last one is own, then all properties are own.
478
	
546
	
479
		var key;
547
		var key;
480
		for ( key in obj ) {}
548
		for ( key in obj ) {}
481
		
549
		
482
		return key === undefined || hasOwnProperty.call( obj, key );
550
		return key === undefined || hasOwn.call( obj, key );
483
	},
551
	},
484
 
552
 
485
	isEmptyObject: function( obj ) {
553
	isEmptyObject: function( obj ) {
486
		for ( var name in obj ) {
554
		for ( var name in obj ) {
487
			return false;
555
			return false;
488
		}
556
		}
489
		return true;
557
		return true;
490
	},
558
	},
491
	
559
	
492
	error: function( msg ) {
560
	error: function( msg ) {
493
		throw msg;
561
		throw msg;
494
	},
562
	},
495
	
563
	
496
	parseJSON: function( data ) {
564
	parseJSON: function( data ) {
497
		if ( typeof data !== "string" || !data ) {
565
		if ( typeof data !== "string" || !data ) {
498
			return null;
566
			return null;
499
		}
567
		}
500
 
568
 
501
		// Make sure leading/trailing whitespace is removed (IE can't handle it)
569
		// Make sure leading/trailing whitespace is removed (IE can't handle it)
502
		data = jQuery.trim( data );
570
		data = jQuery.trim( data );
503
		
571
		
504
		// Make sure the incoming data is actual JSON
572
		// Make sure the incoming data is actual JSON
505
		// Logic borrowed from http://json.org/json2.js
573
		// Logic borrowed from http://json.org/json2.js
506
		if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
574
		if ( rvalidchars.test(data.replace(rvalidescape, "@")
507
			.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
575
			.replace(rvalidtokens, "]")
508
			.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
576
			.replace(rvalidbraces, "")) ) {
509
 
577
 
510
			// Try to use the native JSON parser first
578
			// Try to use the native JSON parser first
511
			return window.JSON && window.JSON.parse ?
579
			return window.JSON && window.JSON.parse ?
512
				window.JSON.parse( data ) :
580
				window.JSON.parse( data ) :
513
				(new Function("return " + data))();
581
				(new Function("return " + data))();
514
 
582
 
515
		} else {
583
		} else {
516
			jQuery.error( "Invalid JSON: " + data );
584
			jQuery.error( "Invalid JSON: " + data );
517
		}
585
		}
518
	},
586
	},
519
 
587
 
520
	noop: function() {},
588
	noop: function() {},
521
 
589
 
522
	// Evalulates a script in a global context
590
	// Evalulates a script in a global context
523
	globalEval: function( data ) {
591
	globalEval: function( data ) {
524
		if ( data && rnotwhite.test(data) ) {
592
		if ( data && rnotwhite.test(data) ) {
525
			// Inspired by code by Andrea Giammarchi
593
			// Inspired by code by Andrea Giammarchi
526
			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
594
			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
527
			var head = document.getElementsByTagName("head")[0] || document.documentElement,
595
			var head = document.getElementsByTagName("head")[0] || document.documentElement,
528
				script = document.createElement("script");
596
				script = document.createElement("script");
529
 
597
 
530
			script.type = "text/javascript";
598
			script.type = "text/javascript";
531
 
599
 
532
			if ( jQuery.support.scriptEval ) {
600
			if ( jQuery.support.scriptEval ) {
533
				script.appendChild( document.createTextNode( data ) );
601
				script.appendChild( document.createTextNode( data ) );
534
			} else {
602
			} else {
535
				script.text = data;
603
				script.text = data;
536
			}
604
			}
537
 
605
 
538
			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
606
			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
539
			// This arises when a base node is used (#2709).
607
			// This arises when a base node is used (#2709).
540
			head.insertBefore( script, head.firstChild );
608
			head.insertBefore( script, head.firstChild );
541
			head.removeChild( script );
609
			head.removeChild( script );
542
		}
610
		}
543
	},
611
	},
544
 
612
 
545
	nodeName: function( elem, name ) {
613
	nodeName: function( elem, name ) {
546
		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
614
		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
547
	},
615
	},
548
 
616
 
549
	// args is for internal usage only
617
	// args is for internal usage only
550
	each: function( object, callback, args ) {
618
	each: function( object, callback, args ) {
551
		var name, i = 0,
619
		var name, i = 0,
552
			length = object.length,
620
			length = object.length,
553
			isObj = length === undefined || jQuery.isFunction(object);
621
			isObj = length === undefined || jQuery.isFunction(object);
554
 
622
 
555
		if ( args ) {
623
		if ( args ) {
556
			if ( isObj ) {
624
			if ( isObj ) {
557
				for ( name in object ) {
625
				for ( name in object ) {
558
					if ( callback.apply( object[ name ], args ) === false ) {
626
					if ( callback.apply( object[ name ], args ) === false ) {
559
						break;
627
						break;
560
					}
628
					}
561
				}
629
				}
562
			} else {
630
			} else {
563
				for ( ; i < length; ) {
631
				for ( ; i < length; ) {
564
					if ( callback.apply( object[ i++ ], args ) === false ) {
632
					if ( callback.apply( object[ i++ ], args ) === false ) {
565
						break;
633
						break;
566
					}
634
					}
567
				}
635
				}
568
			}
636
			}
569
 
637
 
570
		// A special, fast, case for the most common use of each
638
		// A special, fast, case for the most common use of each
571
		} else {
639
		} else {
572
			if ( isObj ) {
640
			if ( isObj ) {
573
				for ( name in object ) {
641
				for ( name in object ) {
574
					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
642
					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
575
						break;
643
						break;
576
					}
644
					}
577
				}
645
				}
578
			} else {
646
			} else {
579
				for ( var value = object[0];
647
				for ( var value = object[0];
580
					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
648
					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
581
			}
649
			}
582
		}
650
		}
583
 
651
 
584
		return object;
652
		return object;
585
	},
653
	},
-
 
654
 
-
 
655
	// Use native String.trim function wherever possible
586
 
656
	trim: trim ?
-
 
657
		function( text ) {
-
 
658
			return text == null ?
-
 
659
				"" :
-
 
660
				trim.call( text );
-
 
661
		} :
-
 
662
 
-
 
663
		// Otherwise use our own trimming functionality
-
 
664
		function( text ) {
-
 
665
			return text == null ?
587
	trim: function( text ) {
666
				"" :
588
		return (text || "").replace( rtrim, "" );
667
				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
589
	},
668
		},
590
 
669
 
591
	// results is for internal usage only
670
	// results is for internal usage only
592
	makeArray: function( array, results ) {
671
	makeArray: function( array, results ) {
593
		var ret = results || [];
672
		var ret = results || [];
594
 
673
 
595
		if ( array != null ) {
674
		if ( array != null ) {
596
			// The window, strings (and functions) also have 'length'
675
			// The window, strings (and functions) also have 'length'
597
			// The extra typeof function check is to prevent crashes
676
			// The extra typeof function check is to prevent crashes
598
			// in Safari 2 (See: #3039)
677
			// in Safari 2 (See: #3039)
-
 
678
			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-
 
679
			var type = jQuery.type(array);
-
 
680
 
599
			if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
681
			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
600
				push.call( ret, array );
682
				push.call( ret, array );
601
			} else {
683
			} else {
602
				jQuery.merge( ret, array );
684
				jQuery.merge( ret, array );
603
			}
685
			}
604
		}
686
		}
605
 
687
 
606
		return ret;
688
		return ret;
607
	},
689
	},
608
 
690
 
609
	inArray: function( elem, array ) {
691
	inArray: function( elem, array ) {
610
		if ( array.indexOf ) {
692
		if ( array.indexOf ) {
611
			return array.indexOf( elem );
693
			return array.indexOf( elem );
612
		}
694
		}
613
 
695
 
614
		for ( var i = 0, length = array.length; i < length; i++ ) {
696
		for ( var i = 0, length = array.length; i < length; i++ ) {
615
			if ( array[ i ] === elem ) {
697
			if ( array[ i ] === elem ) {
616
				return i;
698
				return i;
617
			}
699
			}
618
		}
700
		}
619
 
701
 
620
		return -1;
702
		return -1;
621
	},
703
	},
622
 
704
 
623
	merge: function( first, second ) {
705
	merge: function( first, second ) {
624
		var i = first.length, j = 0;
706
		var i = first.length,
-
 
707
			j = 0;
625
 
708
 
626
		if ( typeof second.length === "number" ) {
709
		if ( typeof second.length === "number" ) {
627
			for ( var l = second.length; j < l; j++ ) {
710
			for ( var l = second.length; j < l; j++ ) {
628
				first[ i++ ] = second[ j ];
711
				first[ i++ ] = second[ j ];
629
			}
712
			}
630
		
713
		
631
		} else {
714
		} else {
632
			while ( second[j] !== undefined ) {
715
			while ( second[j] !== undefined ) {
633
				first[ i++ ] = second[ j++ ];
716
				first[ i++ ] = second[ j++ ];
634
			}
717
			}
635
		}
718
		}
636
 
719
 
637
		first.length = i;
720
		first.length = i;
638
 
721
 
639
		return first;
722
		return first;
640
	},
723
	},
641
 
724
 
642
	grep: function( elems, callback, inv ) {
725
	grep: function( elems, callback, inv ) {
643
		var ret = [];
726
		var ret = [], retVal;
-
 
727
		inv = !!inv;
644
 
728
 
645
		// Go through the array, only saving the items
729
		// Go through the array, only saving the items
646
		// that pass the validator function
730
		// that pass the validator function
647
		for ( var i = 0, length = elems.length; i < length; i++ ) {
731
		for ( var i = 0, length = elems.length; i < length; i++ ) {
648
			if ( !inv !== !callback( elems[ i ], i ) ) {
732
			retVal = !!callback( elems[ i ], i );
-
 
733
			if ( inv !== retVal ) {
649
				ret.push( elems[ i ] );
734
				ret.push( elems[ i ] );
650
			}
735
			}
651
		}
736
		}
652
 
737
 
653
		return ret;
738
		return ret;
654
	},
739
	},
655
 
740
 
656
	// arg is for internal usage only
741
	// arg is for internal usage only
657
	map: function( elems, callback, arg ) {
742
	map: function( elems, callback, arg ) {
658
		var ret = [], value;
743
		var ret = [], value;
659
 
744
 
660
		// Go through the array, translating each of the items to their
745
		// Go through the array, translating each of the items to their
661
		// new value (or values).
746
		// new value (or values).
662
		for ( var i = 0, length = elems.length; i < length; i++ ) {
747
		for ( var i = 0, length = elems.length; i < length; i++ ) {
663
			value = callback( elems[ i ], i, arg );
748
			value = callback( elems[ i ], i, arg );
664
 
749
 
665
			if ( value != null ) {
750
			if ( value != null ) {
666
				ret[ ret.length ] = value;
751
				ret[ ret.length ] = value;
667
			}
752
			}
668
		}
753
		}
669
 
754
 
670
		return ret.concat.apply( [], ret );
755
		return ret.concat.apply( [], ret );
671
	},
756
	},
672
 
757
 
673
	// A global GUID counter for objects
758
	// A global GUID counter for objects
674
	guid: 1,
759
	guid: 1,
675
 
760
 
676
	proxy: function( fn, proxy, thisObject ) {
761
	proxy: function( fn, proxy, thisObject ) {
677
		if ( arguments.length === 2 ) {
762
		if ( arguments.length === 2 ) {
678
			if ( typeof proxy === "string" ) {
763
			if ( typeof proxy === "string" ) {
679
				thisObject = fn;
764
				thisObject = fn;
680
				fn = thisObject[ proxy ];
765
				fn = thisObject[ proxy ];
681
				proxy = undefined;
766
				proxy = undefined;
682
 
767
 
683
			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
768
			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
684
				thisObject = proxy;
769
				thisObject = proxy;
685
				proxy = undefined;
770
				proxy = undefined;
686
			}
771
			}
687
		}
772
		}
688
 
773
 
689
		if ( !proxy && fn ) {
774
		if ( !proxy && fn ) {
690
			proxy = function() {
775
			proxy = function() {
691
				return fn.apply( thisObject || this, arguments );
776
				return fn.apply( thisObject || this, arguments );
692
			};
777
			};
693
		}
778
		}
694
 
779
 
695
		// Set the guid of unique handler to the same of original handler, so it can be removed
780
		// Set the guid of unique handler to the same of original handler, so it can be removed
696
		if ( fn ) {
781
		if ( fn ) {
697
			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
782
			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
698
		}
783
		}
699
 
784
 
700
		// So proxy can be declared as an argument
785
		// So proxy can be declared as an argument
701
		return proxy;
786
		return proxy;
702
	},
787
	},
-
 
788
 
-
 
789
	// Mutifunctional method to get and set values to a collection
-
 
790
	// The value/s can be optionally by executed if its a function
-
 
791
	access: function( elems, key, value, exec, fn, pass ) {
-
 
792
		var length = elems.length;
-
 
793
	
-
 
794
		// Setting many attributes
-
 
795
		if ( typeof key === "object" ) {
-
 
796
			for ( var k in key ) {
-
 
797
				jQuery.access( elems, k, key[k], exec, fn, value );
-
 
798
			}
-
 
799
			return elems;
-
 
800
		}
-
 
801
	
-
 
802
		// Setting one attribute
-
 
803
		if ( value !== undefined ) {
-
 
804
			// Optionally, function values get executed if exec is true
-
 
805
			exec = !pass && exec && jQuery.isFunction(value);
-
 
806
		
-
 
807
			for ( var i = 0; i < length; i++ ) {
-
 
808
				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-
 
809
			}
-
 
810
		
-
 
811
			return elems;
-
 
812
		}
-
 
813
	
-
 
814
		// Getting an attribute
-
 
815
		return length ? fn( elems[0], key ) : undefined;
-
 
816
	},
-
 
817
 
-
 
818
	now: function() {
-
 
819
		return (new Date()).getTime();
-
 
820
	},
703
 
821
 
704
	// Use of jQuery.browser is frowned upon.
822
	// Use of jQuery.browser is frowned upon.
705
	// More details: http://docs.jquery.com/Utilities/jQuery.browser
823
	// More details: http://docs.jquery.com/Utilities/jQuery.browser
706
	uaMatch: function( ua ) {
824
	uaMatch: function( ua ) {
707
		ua = ua.toLowerCase();
825
		ua = ua.toLowerCase();
708
 
826
 
709
		var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
827
		var match = rwebkit.exec( ua ) ||
710
			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
828
			ropera.exec( ua ) ||
711
			/(msie) ([\w.]+)/.exec( ua ) ||
829
			rmsie.exec( ua ) ||
712
			!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
830
			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
713
		  	[];
831
			[];
714
 
832
 
715
		return { browser: match[1] || "", version: match[2] || "0" };
833
		return { browser: match[1] || "", version: match[2] || "0" };
716
	},
834
	},
717
 
835
 
718
	browser: {}
836
	browser: {}
719
});
837
});
-
 
838
 
-
 
839
// Populate the class2type map
-
 
840
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-
 
841
	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-
 
842
});
720
 
843
 
721
browserMatch = jQuery.uaMatch( userAgent );
844
browserMatch = jQuery.uaMatch( userAgent );
722
if ( browserMatch.browser ) {
845
if ( browserMatch.browser ) {
723
	jQuery.browser[ browserMatch.browser ] = true;
846
	jQuery.browser[ browserMatch.browser ] = true;
724
	jQuery.browser.version = browserMatch.version;
847
	jQuery.browser.version = browserMatch.version;
725
}
848
}
726
 
849
 
727
// Deprecated, use jQuery.browser.webkit instead
850
// Deprecated, use jQuery.browser.webkit instead
728
if ( jQuery.browser.webkit ) {
851
if ( jQuery.browser.webkit ) {
729
	jQuery.browser.safari = true;
852
	jQuery.browser.safari = true;
730
}
853
}
731
 
854
 
732
if ( indexOf ) {
855
if ( indexOf ) {
733
	jQuery.inArray = function( elem, array ) {
856
	jQuery.inArray = function( elem, array ) {
734
		return indexOf.call( array, elem );
857
		return indexOf.call( array, elem );
735
	};
858
	};
736
}
859
}
-
 
860
 
-
 
861
// Verify that \s matches non-breaking spaces
-
 
862
// (IE fails on this test)
-
 
863
if ( !rwhite.test( "\xA0" ) ) {
-
 
864
	trimLeft = /^[\s\xA0]+/;
-
 
865
	trimRight = /[\s\xA0]+$/;
-
 
866
}
737
 
867
 
738
// All jQuery objects should point back to these
868
// All jQuery objects should point back to these
739
rootjQuery = jQuery(document);
869
rootjQuery = jQuery(document);
740
 
870
 
741
// Cleanup functions for the document ready method
871
// Cleanup functions for the document ready method
742
if ( document.addEventListener ) {
872
if ( document.addEventListener ) {
743
	DOMContentLoaded = function() {
873
	DOMContentLoaded = function() {
744
		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
874
		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
745
		jQuery.ready();
875
		jQuery.ready();
746
	};
876
	};
747
 
877
 
748
} else if ( document.attachEvent ) {
878
} else if ( document.attachEvent ) {
749
	DOMContentLoaded = function() {
879
	DOMContentLoaded = function() {
750
		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
880
		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
751
		if ( document.readyState === "complete" ) {
881
		if ( document.readyState === "complete" ) {
752
			document.detachEvent( "onreadystatechange", DOMContentLoaded );
882
			document.detachEvent( "onreadystatechange", DOMContentLoaded );
753
			jQuery.ready();
883
			jQuery.ready();
754
		}
884
		}
755
	};
885
	};
756
}
886
}
757
 
887
 
758
// The DOM ready check for Internet Explorer
888
// The DOM ready check for Internet Explorer
759
function doScrollCheck() {
889
function doScrollCheck() {
760
	if ( jQuery.isReady ) {
890
	if ( jQuery.isReady ) {
761
		return;
891
		return;
762
	}
892
	}
763
 
893
 
764
	try {
894
	try {
765
		// If IE is used, use the trick by Diego Perini
895
		// If IE is used, use the trick by Diego Perini
766
		// http://javascript.nwbox.com/IEContentLoaded/
896
		// http://javascript.nwbox.com/IEContentLoaded/
767
		document.documentElement.doScroll("left");
897
		document.documentElement.doScroll("left");
768
	} catch( error ) {
898
	} catch(e) {
769
		setTimeout( doScrollCheck, 1 );
899
		setTimeout( doScrollCheck, 1 );
770
		return;
900
		return;
771
	}
901
	}
772
 
902
 
773
	// and execute any waiting functions
903
	// and execute any waiting functions
774
	jQuery.ready();
904
	jQuery.ready();
775
}
905
}
776
 
906
 
777
function evalScript( i, elem ) {
-
 
778
	if ( elem.src ) {
-
 
779
		jQuery.ajax({
-
 
780
			url: elem.src,
-
 
781
			async: false,
-
 
782
			dataType: "script"
-
 
783
		});
-
 
784
	} else {
-
 
785
		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
 
786
	}
-
 
787
 
-
 
788
	if ( elem.parentNode ) {
907
// Expose jQuery to the global object
789
		elem.parentNode.removeChild( elem );
-
 
790
	}
-
 
791
}
-
 
792
 
-
 
793
// Mutifunctional method to get and set values to a collection
-
 
794
// The value/s can be optionally by executed if its a function
-
 
795
function access( elems, key, value, exec, fn, pass ) {
-
 
796
	var length = elems.length;
-
 
797
	
-
 
798
	// Setting many attributes
-
 
799
	if ( typeof key === "object" ) {
-
 
800
		for ( var k in key ) {
-
 
801
			access( elems, k, key[k], exec, fn, value );
-
 
802
		}
-
 
803
		return elems;
-
 
804
	}
-
 
805
	
-
 
806
	// Setting one attribute
-
 
807
	if ( value !== undefined ) {
-
 
808
		// Optionally, function values get executed if exec is true
-
 
809
		exec = !pass && exec && jQuery.isFunction(value);
-
 
810
		
-
 
811
		for ( var i = 0; i < length; i++ ) {
-
 
812
			fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-
 
813
		}
-
 
814
		
908
return (window.jQuery = window.$ = jQuery);
815
		return elems;
-
 
816
	}
-
 
817
	
-
 
818
	// Getting an attribute
-
 
819
	return length ? fn( elems[0], key ) : undefined;
-
 
820
}
-
 
821
 
909
 
822
function now() {
910
})();
823
	return (new Date).getTime();
911
 
824
}
912
 
825
(function() {
913
(function() {
826
 
914
 
827
	jQuery.support = {};
915
	jQuery.support = {};
828
 
916
 
829
	var root = document.documentElement,
917
	var root = document.documentElement,
830
		script = document.createElement("script"),
918
		script = document.createElement("script"),
831
		div = document.createElement("div"),
919
		div = document.createElement("div"),
832
		id = "script" + now();
920
		id = "script" + jQuery.now();
833
 
921
 
834
	div.style.display = "none";
922
	div.style.display = "none";
835
	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
923
	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
836
 
924
 
837
	var all = div.getElementsByTagName("*"),
925
	var all = div.getElementsByTagName("*"),
838
		a = div.getElementsByTagName("a")[0];
926
		a = div.getElementsByTagName("a")[0],
-
 
927
		select = document.createElement("select"),
-
 
928
		opt = select.appendChild( document.createElement("option") );
839
 
929
 
840
	// Can't get basic test support
930
	// Can't get basic test support
841
	if ( !all || !all.length || !a ) {
931
	if ( !all || !all.length || !a ) {
842
		return;
932
		return;
843
	}
933
	}
844
 
934
 
845
	jQuery.support = {
935
	jQuery.support = {
846
		// IE strips leading whitespace when .innerHTML is used
936
		// IE strips leading whitespace when .innerHTML is used
847
		leadingWhitespace: div.firstChild.nodeType === 3,
937
		leadingWhitespace: div.firstChild.nodeType === 3,
848
 
938
 
849
		// Make sure that tbody elements aren't automatically inserted
939
		// Make sure that tbody elements aren't automatically inserted
850
		// IE will insert them into empty tables
940
		// IE will insert them into empty tables
851
		tbody: !div.getElementsByTagName("tbody").length,
941
		tbody: !div.getElementsByTagName("tbody").length,
852
 
942
 
853
		// Make sure that link elements get serialized correctly by innerHTML
943
		// Make sure that link elements get serialized correctly by innerHTML
854
		// This requires a wrapper element in IE
944
		// This requires a wrapper element in IE
855
		htmlSerialize: !!div.getElementsByTagName("link").length,
945
		htmlSerialize: !!div.getElementsByTagName("link").length,
856
 
946
 
857
		// Get the style information from getAttribute
947
		// Get the style information from getAttribute
858
		// (IE uses .cssText insted)
948
		// (IE uses .cssText insted)
859
		style: /red/.test( a.getAttribute("style") ),
949
		style: /red/.test( a.getAttribute("style") ),
860
 
950
 
861
		// Make sure that URLs aren't manipulated
951
		// Make sure that URLs aren't manipulated
862
		// (IE normalizes it by default)
952
		// (IE normalizes it by default)
863
		hrefNormalized: a.getAttribute("href") === "/a",
953
		hrefNormalized: a.getAttribute("href") === "/a",
864
 
954
 
865
		// Make sure that element opacity exists
955
		// Make sure that element opacity exists
866
		// (IE uses filter instead)
956
		// (IE uses filter instead)
867
		// Use a regex to work around a WebKit issue. See #5145
957
		// Use a regex to work around a WebKit issue. See #5145
868
		opacity: /^0.55$/.test( a.style.opacity ),
958
		opacity: /^0.55$/.test( a.style.opacity ),
869
 
959
 
870
		// Verify style float existence
960
		// Verify style float existence
871
		// (IE uses styleFloat instead of cssFloat)
961
		// (IE uses styleFloat instead of cssFloat)
872
		cssFloat: !!a.style.cssFloat,
962
		cssFloat: !!a.style.cssFloat,
873
 
963
 
874
		// Make sure that if no value is specified for a checkbox
964
		// Make sure that if no value is specified for a checkbox
875
		// that it defaults to "on".
965
		// that it defaults to "on".
876
		// (WebKit defaults to "" instead)
966
		// (WebKit defaults to "" instead)
877
		checkOn: div.getElementsByTagName("input")[0].value === "on",
967
		checkOn: div.getElementsByTagName("input")[0].value === "on",
878
 
968
 
879
		// Make sure that a selected-by-default option has a working selected property.
969
		// Make sure that a selected-by-default option has a working selected property.
880
		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
970
		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
881
		optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
971
		optSelected: opt.selected,
882
 
-
 
883
		parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
-
 
884
 
972
 
885
		// Will be defined later
973
		// Will be defined later
886
		deleteExpando: true,
974
		deleteExpando: true,
-
 
975
		optDisabled: false,
887
		checkClone: false,
976
		checkClone: false,
888
		scriptEval: false,
977
		scriptEval: false,
889
		noCloneEvent: true,
978
		noCloneEvent: true,
890
		boxModel: null
979
		boxModel: null,
-
 
980
		inlineBlockNeedsLayout: false,
-
 
981
		shrinkWrapBlocks: false,
-
 
982
		reliableHiddenOffsets: true
891
	};
983
	};
-
 
984
 
-
 
985
	// Make sure that the options inside disabled selects aren't marked as disabled
-
 
986
	// (WebKit marks them as diabled)
-
 
987
	select.disabled = true;
-
 
988
	jQuery.support.optDisabled = !opt.disabled;
892
 
989
 
893
	script.type = "text/javascript";
990
	script.type = "text/javascript";
894
	try {
991
	try {
895
		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
992
		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
896
	} catch(e) {}
993
	} catch(e) {}
897
 
994
 
898
	root.insertBefore( script, root.firstChild );
995
	root.insertBefore( script, root.firstChild );
899
 
996
 
900
	// Make sure that the execution of code works by injecting a script
997
	// Make sure that the execution of code works by injecting a script
901
	// tag with appendChild/createTextNode
998
	// tag with appendChild/createTextNode
902
	// (IE doesn't support this, fails, and uses .text instead)
999
	// (IE doesn't support this, fails, and uses .text instead)
903
	if ( window[ id ] ) {
1000
	if ( window[ id ] ) {
904
		jQuery.support.scriptEval = true;
1001
		jQuery.support.scriptEval = true;
905
		delete window[ id ];
1002
		delete window[ id ];
906
	}
1003
	}
907
 
1004
 
908
	// Test to see if it's possible to delete an expando from an element
1005
	// Test to see if it's possible to delete an expando from an element
909
	// Fails in Internet Explorer
1006
	// Fails in Internet Explorer
910
	try {
1007
	try {
911
		delete script.test;
1008
		delete script.test;
912
	
1009
 
913
	} catch(e) {
1010
	} catch(e) {
914
		jQuery.support.deleteExpando = false;
1011
		jQuery.support.deleteExpando = false;
915
	}
1012
	}
916
 
1013
 
917
	root.removeChild( script );
1014
	root.removeChild( script );
918
 
1015
 
919
	if ( div.attachEvent && div.fireEvent ) {
1016
	if ( div.attachEvent && div.fireEvent ) {
920
		div.attachEvent("onclick", function click() {
1017
		div.attachEvent("onclick", function click() {
921
			// Cloning a node shouldn't copy over any
1018
			// Cloning a node shouldn't copy over any
922
			// bound event handlers (IE does this)
1019
			// bound event handlers (IE does this)
923
			jQuery.support.noCloneEvent = false;
1020
			jQuery.support.noCloneEvent = false;
924
			div.detachEvent("onclick", click);
1021
			div.detachEvent("onclick", click);
925
		});
1022
		});
926
		div.cloneNode(true).fireEvent("onclick");
1023
		div.cloneNode(true).fireEvent("onclick");
927
	}
1024
	}
928
 
1025
 
929
	div = document.createElement("div");
1026
	div = document.createElement("div");
930
	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
1027
	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
931
 
1028
 
932
	var fragment = document.createDocumentFragment();
1029
	var fragment = document.createDocumentFragment();
933
	fragment.appendChild( div.firstChild );
1030
	fragment.appendChild( div.firstChild );
934
 
1031
 
935
	// WebKit doesn't clone checked state correctly in fragments
1032
	// WebKit doesn't clone checked state correctly in fragments
936
	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
1033
	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
937
 
1034
 
938
	// Figure out if the W3C box model works as expected
1035
	// Figure out if the W3C box model works as expected
939
	// document.body must exist before we can do this
1036
	// document.body must exist before we can do this
940
	jQuery(function() {
1037
	jQuery(function() {
941
		var div = document.createElement("div");
1038
		var div = document.createElement("div");
942
		div.style.width = div.style.paddingLeft = "1px";
1039
		div.style.width = div.style.paddingLeft = "1px";
943
 
1040
 
944
		document.body.appendChild( div );
1041
		document.body.appendChild( div );
945
		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
1042
		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
946
		document.body.removeChild( div ).style.display = 'none';
-
 
-
 
1043
 
-
 
1044
		if ( "zoom" in div.style ) {
-
 
1045
			// Check if natively block-level elements act like inline-block
-
 
1046
			// elements when setting their display to 'inline' and giving
-
 
1047
			// them layout
-
 
1048
			// (IE < 8 does this)
-
 
1049
			div.style.display = "inline";
-
 
1050
			div.style.zoom = 1;
-
 
1051
			jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
-
 
1052
 
-
 
1053
			// Check if elements with layout shrink-wrap their children
-
 
1054
			// (IE 6 does this)
-
 
1055
			div.style.display = "";
-
 
1056
			div.innerHTML = "<div style='width:4px;'></div>";
-
 
1057
			jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
-
 
1058
		}
-
 
1059
 
-
 
1060
		div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
-
 
1061
		var tds = div.getElementsByTagName("td");
-
 
1062
 
-
 
1063
		// Check if table cells still have offsetWidth/Height when they are set
-
 
1064
		// to display:none and there are still other visible table cells in a
-
 
1065
		// table row; if so, offsetWidth/Height are not reliable for use when
-
 
1066
		// determining if an element has been hidden directly using
-
 
1067
		// display:none (it is still safe to use offsets if a parent element is
-
 
1068
		// hidden; don safety goggles and see bug #4512 for more information).
-
 
1069
		// (only IE 8 fails this test)
-
 
1070
		jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
-
 
1071
 
-
 
1072
		tds[0].style.display = "";
-
 
1073
		tds[1].style.display = "none";
-
 
1074
 
-
 
1075
		// Check if empty table cells still have offsetWidth/Height
-
 
1076
		// (IE < 8 fail this test)
-
 
1077
		jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
-
 
1078
		div.innerHTML = "";
-
 
1079
 
947
 
1080
		document.body.removeChild( div ).style.display = "none";
948
		div = null;
1081
		div = tds = null;
949
	});
1082
	});
950
 
1083
 
951
	// Technique from Juriy Zaytsev
1084
	// Technique from Juriy Zaytsev
952
	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
1085
	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
953
	var eventSupported = function( eventName ) { 
1086
	var eventSupported = function( eventName ) {
954
		var el = document.createElement("div"); 
1087
		var el = document.createElement("div");
955
		eventName = "on" + eventName; 
1088
		eventName = "on" + eventName;
956
 
1089
 
957
		var isSupported = (eventName in el); 
1090
		var isSupported = (eventName in el);
958
		if ( !isSupported ) { 
1091
		if ( !isSupported ) {
959
			el.setAttribute(eventName, "return;"); 
1092
			el.setAttribute(eventName, "return;");
960
			isSupported = typeof el[eventName] === "function"; 
1093
			isSupported = typeof el[eventName] === "function";
961
		} 
1094
		}
962
		el = null; 
1095
		el = null;
963
 
1096
 
964
		return isSupported; 
1097
		return isSupported;
965
	};
1098
	};
966
	
1099
 
967
	jQuery.support.submitBubbles = eventSupported("submit");
1100
	jQuery.support.submitBubbles = eventSupported("submit");
968
	jQuery.support.changeBubbles = eventSupported("change");
1101
	jQuery.support.changeBubbles = eventSupported("change");
969
 
1102
 
970
	// release memory in IE
1103
	// release memory in IE
971
	root = script = div = all = a = null;
1104
	root = script = div = all = a = null;
972
})();
1105
})();
973
 
-
 
974
jQuery.props = {
-
 
975
	"for": "htmlFor",
-
 
976
	"class": "className",
-
 
977
	readonly: "readOnly",
-
 
978
	maxlength: "maxLength",
-
 
979
	cellspacing: "cellSpacing",
-
 
980
	rowspan: "rowSpan",
-
 
-
 
1106
 
-
 
1107
 
981
	colspan: "colSpan",
1108
 
982
	tabindex: "tabIndex",
-
 
983
	usemap: "useMap",
1109
var windowData = {},
984
	frameborder: "frameBorder"
-
 
985
};
-
 
986
var expando = "jQuery" + now(), uuid = 0, windowData = {};
1110
	rbrace = /^(?:\{.*\}|\[.*\])$/;
987
 
1111
 
988
jQuery.extend({
1112
jQuery.extend({
989
	cache: {},
1113
	cache: {},
-
 
1114
 
-
 
1115
	// Please use with caution
-
 
1116
	uuid: 0,
-
 
1117
 
990
	
1118
	// Unique for each copy of jQuery on the page	
991
	expando:expando,
1119
	expando: "jQuery" + jQuery.now(),
992
 
1120
 
993
	// The following elements throw uncatchable exceptions if you
1121
	// The following elements throw uncatchable exceptions if you
994
	// attempt to add expando properties to them.
1122
	// attempt to add expando properties to them.
995
	noData: {
1123
	noData: {
996
		"embed": true,
1124
		"embed": true,
-
 
1125
		// Ban all objects except for Flash (which handle expandos)
997
		"object": true,
1126
		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
998
		"applet": true
1127
		"applet": true
999
	},
1128
	},
1000
 
1129
 
1001
	data: function( elem, name, data ) {
1130
	data: function( elem, name, data ) {
1002
		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1131
		if ( !jQuery.acceptData( elem ) ) {
1003
			return;
1132
			return;
1004
		}
1133
		}
1005
 
1134
 
1006
		elem = elem == window ?
1135
		elem = elem == window ?
1007
			windowData :
1136
			windowData :
1008
			elem;
1137
			elem;
-
 
1138
 
-
 
1139
		var isNode = elem.nodeType,
1009
 
1140
			id = isNode ? elem[ jQuery.expando ] : null,
1010
		var id = elem[ expando ], cache = jQuery.cache, thisCache;
1141
			cache = jQuery.cache, thisCache;
1011
 
1142
 
1012
		if ( !id && typeof name === "string" && data === undefined ) {
1143
		if ( isNode && !id && typeof name === "string" && data === undefined ) {
-
 
1144
			return;
-
 
1145
		}
-
 
1146
 
-
 
1147
		// Get the data from the object directly
1013
			return null;
1148
		if ( !isNode ) {
1014
		}
1149
			cache = elem;
1015
 
1150
 
1016
		// Compute a unique ID for the element
1151
		// Compute a unique ID for the element
1017
		if ( !id ) { 
1152
		} else if ( !id ) {
1018
			id = ++uuid;
1153
			elem[ jQuery.expando ] = id = ++jQuery.uuid;
1019
		}
1154
		}
1020
 
1155
 
1021
		// Avoid generating a new cache unless none exists and we
1156
		// Avoid generating a new cache unless none exists and we
1022
		// want to manipulate it.
1157
		// want to manipulate it.
1023
		if ( typeof name === "object" ) {
1158
		if ( typeof name === "object" ) {
1024
			elem[ expando ] = id;
1159
			if ( isNode ) {
1025
			thisCache = cache[ id ] = jQuery.extend(true, {}, name);
1160
				cache[ id ] = jQuery.extend(cache[ id ], name);
-
 
1161
 
-
 
1162
			} else {
-
 
1163
				jQuery.extend( cache, name );
-
 
1164
			}
1026
 
1165
 
1027
		} else if ( !cache[ id ] ) {
-
 
1028
			elem[ expando ] = id;
1166
		} else if ( isNode && !cache[ id ] ) {
1029
			cache[ id ] = {};
1167
			cache[ id ] = {};
1030
		}
1168
		}
1031
 
1169
 
1032
		thisCache = cache[ id ];
1170
		thisCache = isNode ? cache[ id ] : cache;
1033
 
1171
 
1034
		// Prevent overriding the named cache with undefined values
1172
		// Prevent overriding the named cache with undefined values
1035
		if ( data !== undefined ) {
1173
		if ( data !== undefined ) {
1036
			thisCache[ name ] = data;
1174
			thisCache[ name ] = data;
1037
		}
1175
		}
1038
 
1176
 
1039
		return typeof name === "string" ? thisCache[ name ] : thisCache;
1177
		return typeof name === "string" ? thisCache[ name ] : thisCache;
1040
	},
1178
	},
1041
 
1179
 
1042
	removeData: function( elem, name ) {
1180
	removeData: function( elem, name ) {
1043
		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1181
		if ( !jQuery.acceptData( elem ) ) {
1044
			return;
1182
			return;
1045
		}
1183
		}
1046
 
1184
 
1047
		elem = elem == window ?
1185
		elem = elem == window ?
1048
			windowData :
1186
			windowData :
1049
			elem;
1187
			elem;
-
 
1188
 
1050
 
1189
		var isNode = elem.nodeType,
-
 
1190
			id = isNode ? elem[ jQuery.expando ] : elem,
-
 
1191
			cache = jQuery.cache,
1051
		var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
1192
			thisCache = isNode ? cache[ id ] : id;
1052
 
1193
 
1053
		// If we want to remove a specific section of the element's data
1194
		// If we want to remove a specific section of the element's data
1054
		if ( name ) {
1195
		if ( name ) {
1055
			if ( thisCache ) {
1196
			if ( thisCache ) {
1056
				// Remove the section of cache data
1197
				// Remove the section of cache data
1057
				delete thisCache[ name ];
1198
				delete thisCache[ name ];
1058
 
1199
 
1059
				// If we've removed all the data, remove the element's cache
1200
				// If we've removed all the data, remove the element's cache
1060
				if ( jQuery.isEmptyObject(thisCache) ) {
1201
				if ( isNode && jQuery.isEmptyObject(thisCache) ) {
1061
					jQuery.removeData( elem );
1202
					jQuery.removeData( elem );
1062
				}
1203
				}
1063
			}
1204
			}
1064
 
1205
 
1065
		// Otherwise, we want to remove all of the element's data
1206
		// Otherwise, we want to remove all of the element's data
1066
		} else {
1207
		} else {
1067
			if ( jQuery.support.deleteExpando ) {
1208
			if ( isNode && jQuery.support.deleteExpando ) {
1068
				delete elem[ jQuery.expando ];
1209
				delete elem[ jQuery.expando ];
1069
 
1210
 
1070
			} else if ( elem.removeAttribute ) {
1211
			} else if ( elem.removeAttribute ) {
1071
				elem.removeAttribute( jQuery.expando );
1212
				elem.removeAttribute( jQuery.expando );
1072
			}
-
 
1073
 
1213
 
-
 
1214
			// Completely remove the data cache
1074
			// Completely remove the data cache
1215
			} else if ( isNode ) {
-
 
1216
				delete cache[ id ];
-
 
1217
 
-
 
1218
			// Remove all fields from the object
-
 
1219
			} else {
-
 
1220
				for ( var n in elem ) {
-
 
1221
					delete elem[ n ];
-
 
1222
				}
-
 
1223
			}
-
 
1224
		}
-
 
1225
	},
-
 
1226
 
-
 
1227
	// A method for determining if a DOM node can handle the data expando
-
 
1228
	acceptData: function( elem ) {
-
 
1229
		if ( elem.nodeName ) {
-
 
1230
			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
 
1231
 
-
 
1232
			if ( match ) {
-
 
1233
				return !(match === true || elem.getAttribute("classid") !== match);
1075
			delete cache[ id ];
1234
			}
-
 
1235
		}
-
 
1236
 
1076
		}
1237
		return true;
1077
	}
1238
	}
1078
});
1239
});
1079
 
1240
 
1080
jQuery.fn.extend({
1241
jQuery.fn.extend({
1081
	data: function( key, value ) {
1242
	data: function( key, value ) {
-
 
1243
		var data = null;
-
 
1244
 
1082
		if ( typeof key === "undefined" && this.length ) {
1245
		if ( typeof key === "undefined" ) {
-
 
1246
			if ( this.length ) {
-
 
1247
				var attr = this[0].attributes, name;
1083
			return jQuery.data( this[0] );
1248
				data = jQuery.data( this[0] );
-
 
1249
 
-
 
1250
				for ( var i = 0, l = attr.length; i < l; i++ ) {
-
 
1251
					name = attr[i].name;
-
 
1252
 
-
 
1253
					if ( name.indexOf( "data-" ) === 0 ) {
-
 
1254
						name = name.substr( 5 );
-
 
1255
						dataAttr( this[0], name, data[ name ] );
-
 
1256
					}
-
 
1257
				}
-
 
1258
			}
-
 
1259
 
-
 
1260
			return data;
1084
 
1261
 
1085
		} else if ( typeof key === "object" ) {
1262
		} else if ( typeof key === "object" ) {
1086
			return this.each(function() {
1263
			return this.each(function() {
1087
				jQuery.data( this, key );
1264
				jQuery.data( this, key );
1088
			});
1265
			});
1089
		}
1266
		}
1090
 
1267
 
1091
		var parts = key.split(".");
1268
		var parts = key.split(".");
1092
		parts[1] = parts[1] ? "." + parts[1] : "";
1269
		parts[1] = parts[1] ? "." + parts[1] : "";
1093
 
1270
 
1094
		if ( value === undefined ) {
1271
		if ( value === undefined ) {
1095
			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1272
			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
 
1273
 
1096
 
1274
			// Try to fetch any internally stored data first
1097
			if ( data === undefined && this.length ) {
1275
			if ( data === undefined && this.length ) {
-
 
1276
				data = jQuery.data( this[0], key );
1098
				data = jQuery.data( this[0], key );
1277
				data = dataAttr( this[0], key, data );
-
 
1278
			}
1099
			}
1279
 
1100
			return data === undefined && parts[1] ?
1280
			return data === undefined && parts[1] ?
1101
				this.data( parts[0] ) :
1281
				this.data( parts[0] ) :
1102
				data;
1282
				data;
-
 
1283
 
1103
		} else {
1284
		} else {
-
 
1285
			return this.each(function() {
-
 
1286
				var $this = jQuery( this ),
-
 
1287
					args = [ parts[0], value ];
-
 
1288
 
1104
			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
1289
				$this.triggerHandler( "setData" + parts[1] + "!", args );
1105
				jQuery.data( this, key, value );
1290
				jQuery.data( this, key, value );
-
 
1291
				$this.triggerHandler( "changeData" + parts[1] + "!", args );
1106
			});
1292
			});
1107
		}
1293
		}
1108
	},
1294
	},
1109
 
1295
 
1110
	removeData: function( key ) {
1296
	removeData: function( key ) {
1111
		return this.each(function() {
1297
		return this.each(function() {
1112
			jQuery.removeData( this, key );
1298
			jQuery.removeData( this, key );
1113
		});
1299
		});
1114
	}
1300
	}
1115
});
1301
});
-
 
1302
 
-
 
1303
function dataAttr( elem, key, data ) {
-
 
1304
	// If nothing was found internally, try to fetch any
-
 
1305
	// data from the HTML5 data-* attribute
-
 
1306
	if ( data === undefined && elem.nodeType === 1 ) {
-
 
1307
		data = elem.getAttribute( "data-" + key );
-
 
1308
 
-
 
1309
		if ( typeof data === "string" ) {
-
 
1310
			try {
-
 
1311
				data = data === "true" ? true :
-
 
1312
				data === "false" ? false :
-
 
1313
				data === "null" ? null :
-
 
1314
				!jQuery.isNaN( data ) ? parseFloat( data ) :
-
 
1315
					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-
 
1316
					data;
-
 
1317
			} catch( e ) {}
-
 
1318
 
-
 
1319
			// Make sure we set the data so it isn't changed later
-
 
1320
			jQuery.data( elem, key, data );
-
 
1321
 
-
 
1322
		} else {
-
 
1323
			data = undefined;
-
 
1324
		}
-
 
1325
	}
-
 
1326
 
-
 
1327
	return data;
-
 
1328
}
-
 
1329
 
-
 
1330
 
-
 
1331
 
-
 
1332
 
1116
jQuery.extend({
1333
jQuery.extend({
1117
	queue: function( elem, type, data ) {
1334
	queue: function( elem, type, data ) {
1118
		if ( !elem ) {
1335
		if ( !elem ) {
1119
			return;
1336
			return;
1120
		}
1337
		}
1121
 
1338
 
1122
		type = (type || "fx") + "queue";
1339
		type = (type || "fx") + "queue";
1123
		var q = jQuery.data( elem, type );
1340
		var q = jQuery.data( elem, type );
1124
 
1341
 
1125
		// Speed up dequeue by getting out quickly if this is just a lookup
1342
		// Speed up dequeue by getting out quickly if this is just a lookup
1126
		if ( !data ) {
1343
		if ( !data ) {
1127
			return q || [];
1344
			return q || [];
1128
		}
1345
		}
1129
 
1346
 
1130
		if ( !q || jQuery.isArray(data) ) {
1347
		if ( !q || jQuery.isArray(data) ) {
1131
			q = jQuery.data( elem, type, jQuery.makeArray(data) );
1348
			q = jQuery.data( elem, type, jQuery.makeArray(data) );
1132
 
1349
 
1133
		} else {
1350
		} else {
1134
			q.push( data );
1351
			q.push( data );
1135
		}
1352
		}
1136
 
1353
 
1137
		return q;
1354
		return q;
1138
	},
1355
	},
1139
 
1356
 
1140
	dequeue: function( elem, type ) {
1357
	dequeue: function( elem, type ) {
1141
		type = type || "fx";
1358
		type = type || "fx";
1142
 
1359
 
-
 
1360
		var queue = jQuery.queue( elem, type ),
1143
		var queue = jQuery.queue( elem, type ), fn = queue.shift();
1361
			fn = queue.shift();
1144
 
1362
 
1145
		// If the fx queue is dequeued, always remove the progress sentinel
1363
		// If the fx queue is dequeued, always remove the progress sentinel
1146
		if ( fn === "inprogress" ) {
1364
		if ( fn === "inprogress" ) {
1147
			fn = queue.shift();
1365
			fn = queue.shift();
1148
		}
1366
		}
1149
 
1367
 
1150
		if ( fn ) {
1368
		if ( fn ) {
1151
			// Add a progress sentinel to prevent the fx queue from being
1369
			// Add a progress sentinel to prevent the fx queue from being
1152
			// automatically dequeued
1370
			// automatically dequeued
1153
			if ( type === "fx" ) {
1371
			if ( type === "fx" ) {
1154
				queue.unshift("inprogress");
1372
				queue.unshift("inprogress");
1155
			}
1373
			}
1156
 
1374
 
1157
			fn.call(elem, function() {
1375
			fn.call(elem, function() {
1158
				jQuery.dequeue(elem, type);
1376
				jQuery.dequeue(elem, type);
1159
			});
1377
			});
1160
		}
1378
		}
1161
	}
1379
	}
1162
});
1380
});
1163
 
1381
 
1164
jQuery.fn.extend({
1382
jQuery.fn.extend({
1165
	queue: function( type, data ) {
1383
	queue: function( type, data ) {
1166
		if ( typeof type !== "string" ) {
1384
		if ( typeof type !== "string" ) {
1167
			data = type;
1385
			data = type;
1168
			type = "fx";
1386
			type = "fx";
1169
		}
1387
		}
1170
 
1388
 
1171
		if ( data === undefined ) {
1389
		if ( data === undefined ) {
1172
			return jQuery.queue( this[0], type );
1390
			return jQuery.queue( this[0], type );
1173
		}
1391
		}
1174
		return this.each(function( i, elem ) {
1392
		return this.each(function( i ) {
1175
			var queue = jQuery.queue( this, type, data );
1393
			var queue = jQuery.queue( this, type, data );
1176
 
1394
 
1177
			if ( type === "fx" && queue[0] !== "inprogress" ) {
1395
			if ( type === "fx" && queue[0] !== "inprogress" ) {
1178
				jQuery.dequeue( this, type );
1396
				jQuery.dequeue( this, type );
1179
			}
1397
			}
1180
		});
1398
		});
1181
	},
1399
	},
1182
	dequeue: function( type ) {
1400
	dequeue: function( type ) {
1183
		return this.each(function() {
1401
		return this.each(function() {
1184
			jQuery.dequeue( this, type );
1402
			jQuery.dequeue( this, type );
1185
		});
1403
		});
1186
	},
1404
	},
1187
 
1405
 
1188
	// Based off of the plugin by Clint Helfers, with permission.
1406
	// Based off of the plugin by Clint Helfers, with permission.
1189
	// http://blindsignals.com/index.php/2009/07/jquery-delay/
1407
	// http://blindsignals.com/index.php/2009/07/jquery-delay/
1190
	delay: function( time, type ) {
1408
	delay: function( time, type ) {
1191
		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1409
		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1192
		type = type || "fx";
1410
		type = type || "fx";
1193
 
1411
 
1194
		return this.queue( type, function() {
1412
		return this.queue( type, function() {
1195
			var elem = this;
1413
			var elem = this;
1196
			setTimeout(function() {
1414
			setTimeout(function() {
1197
				jQuery.dequeue( elem, type );
1415
				jQuery.dequeue( elem, type );
1198
			}, time );
1416
			}, time );
1199
		});
1417
		});
1200
	},
1418
	},
1201
 
1419
 
1202
	clearQueue: function( type ) {
1420
	clearQueue: function( type ) {
1203
		return this.queue( type || "fx", [] );
1421
		return this.queue( type || "fx", [] );
1204
	}
1422
	}
1205
});
1423
});
-
 
1424
 
-
 
1425
 
-
 
1426
 
-
 
1427
 
1206
var rclass = /[\n\t]/g,
1428
var rclass = /[\n\t]/g,
1207
	rspace = /\s+/,
1429
	rspaces = /\s+/,
1208
	rreturn = /\r/g,
1430
	rreturn = /\r/g,
1209
	rspecialurl = /href|src|style/,
1431
	rspecialurl = /^(?:href|src|style)$/,
1210
	rtype = /(button|input)/i,
1432
	rtype = /^(?:button|input)$/i,
1211
	rfocusable = /(button|input|object|select|textarea)/i,
1433
	rfocusable = /^(?:button|input|object|select|textarea)$/i,
1212
	rclickable = /^(a|area)$/i,
1434
	rclickable = /^a(?:rea)?$/i,
1213
	rradiocheck = /radio|checkbox/;
1435
	rradiocheck = /^(?:radio|checkbox)$/i;
-
 
1436
 
-
 
1437
jQuery.props = {
-
 
1438
	"for": "htmlFor",
-
 
1439
	"class": "className",
-
 
1440
	readonly: "readOnly",
-
 
1441
	maxlength: "maxLength",
-
 
1442
	cellspacing: "cellSpacing",
-
 
1443
	rowspan: "rowSpan",
-
 
1444
	colspan: "colSpan",
-
 
1445
	tabindex: "tabIndex",
-
 
1446
	usemap: "useMap",
-
 
1447
	frameborder: "frameBorder"
-
 
1448
};
1214
 
1449
 
1215
jQuery.fn.extend({
1450
jQuery.fn.extend({
1216
	attr: function( name, value ) {
1451
	attr: function( name, value ) {
1217
		return access( this, name, value, true, jQuery.attr );
1452
		return jQuery.access( this, name, value, true, jQuery.attr );
1218
	},
1453
	},
1219
 
1454
 
1220
	removeAttr: function( name, fn ) {
1455
	removeAttr: function( name, fn ) {
1221
		return this.each(function(){
1456
		return this.each(function(){
1222
			jQuery.attr( this, name, "" );
1457
			jQuery.attr( this, name, "" );
1223
			if ( this.nodeType === 1 ) {
1458
			if ( this.nodeType === 1 ) {
1224
				this.removeAttribute( name );
1459
				this.removeAttribute( name );
1225
			}
1460
			}
1226
		});
1461
		});
1227
	},
1462
	},
1228
 
1463
 
1229
	addClass: function( value ) {
1464
	addClass: function( value ) {
1230
		if ( jQuery.isFunction(value) ) {
1465
		if ( jQuery.isFunction(value) ) {
1231
			return this.each(function(i) {
1466
			return this.each(function(i) {
1232
				var self = jQuery(this);
1467
				var self = jQuery(this);
1233
				self.addClass( value.call(this, i, self.attr("class")) );
1468
				self.addClass( value.call(this, i, self.attr("class")) );
1234
			});
1469
			});
1235
		}
1470
		}
1236
 
1471
 
1237
		if ( value && typeof value === "string" ) {
1472
		if ( value && typeof value === "string" ) {
1238
			var classNames = (value || "").split( rspace );
1473
			var classNames = (value || "").split( rspaces );
1239
 
1474
 
1240
			for ( var i = 0, l = this.length; i < l; i++ ) {
1475
			for ( var i = 0, l = this.length; i < l; i++ ) {
1241
				var elem = this[i];
1476
				var elem = this[i];
1242
 
1477
 
1243
				if ( elem.nodeType === 1 ) {
1478
				if ( elem.nodeType === 1 ) {
1244
					if ( !elem.className ) {
1479
					if ( !elem.className ) {
1245
						elem.className = value;
1480
						elem.className = value;
1246
 
1481
 
1247
					} else {
1482
					} else {
1248
						var className = " " + elem.className + " ", setClass = elem.className;
1483
						var className = " " + elem.className + " ",
-
 
1484
							setClass = elem.className;
-
 
1485
 
1249
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1486
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1250
							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1487
							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1251
								setClass += " " + classNames[c];
1488
								setClass += " " + classNames[c];
1252
							}
1489
							}
1253
						}
1490
						}
1254
						elem.className = jQuery.trim( setClass );
1491
						elem.className = jQuery.trim( setClass );
1255
					}
1492
					}
1256
				}
1493
				}
1257
			}
1494
			}
1258
		}
1495
		}
1259
 
1496
 
1260
		return this;
1497
		return this;
1261
	},
1498
	},
1262
 
1499
 
1263
	removeClass: function( value ) {
1500
	removeClass: function( value ) {
1264
		if ( jQuery.isFunction(value) ) {
1501
		if ( jQuery.isFunction(value) ) {
1265
			return this.each(function(i) {
1502
			return this.each(function(i) {
1266
				var self = jQuery(this);
1503
				var self = jQuery(this);
1267
				self.removeClass( value.call(this, i, self.attr("class")) );
1504
				self.removeClass( value.call(this, i, self.attr("class")) );
1268
			});
1505
			});
1269
		}
1506
		}
1270
 
1507
 
1271
		if ( (value && typeof value === "string") || value === undefined ) {
1508
		if ( (value && typeof value === "string") || value === undefined ) {
1272
			var classNames = (value || "").split(rspace);
1509
			var classNames = (value || "").split( rspaces );
1273
 
1510
 
1274
			for ( var i = 0, l = this.length; i < l; i++ ) {
1511
			for ( var i = 0, l = this.length; i < l; i++ ) {
1275
				var elem = this[i];
1512
				var elem = this[i];
1276
 
1513
 
1277
				if ( elem.nodeType === 1 && elem.className ) {
1514
				if ( elem.nodeType === 1 && elem.className ) {
1278
					if ( value ) {
1515
					if ( value ) {
1279
						var className = (" " + elem.className + " ").replace(rclass, " ");
1516
						var className = (" " + elem.className + " ").replace(rclass, " ");
1280
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1517
						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1281
							className = className.replace(" " + classNames[c] + " ", " ");
1518
							className = className.replace(" " + classNames[c] + " ", " ");
1282
						}
1519
						}
1283
						elem.className = jQuery.trim( className );
1520
						elem.className = jQuery.trim( className );
1284
 
1521
 
1285
					} else {
1522
					} else {
1286
						elem.className = "";
1523
						elem.className = "";
1287
					}
1524
					}
1288
				}
1525
				}
1289
			}
1526
			}
1290
		}
1527
		}
1291
 
1528
 
1292
		return this;
1529
		return this;
1293
	},
1530
	},
1294
 
1531
 
1295
	toggleClass: function( value, stateVal ) {
1532
	toggleClass: function( value, stateVal ) {
-
 
1533
		var type = typeof value,
1296
		var type = typeof value, isBool = typeof stateVal === "boolean";
1534
			isBool = typeof stateVal === "boolean";
1297
 
1535
 
1298
		if ( jQuery.isFunction( value ) ) {
1536
		if ( jQuery.isFunction( value ) ) {
1299
			return this.each(function(i) {
1537
			return this.each(function(i) {
1300
				var self = jQuery(this);
1538
				var self = jQuery(this);
1301
				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1539
				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1302
			});
1540
			});
1303
		}
1541
		}
1304
 
1542
 
1305
		return this.each(function() {
1543
		return this.each(function() {
1306
			if ( type === "string" ) {
1544
			if ( type === "string" ) {
1307
				// toggle individual class names
1545
				// toggle individual class names
-
 
1546
				var className,
-
 
1547
					i = 0,
1308
				var className, i = 0, self = jQuery(this),
1548
					self = jQuery( this ),
1309
					state = stateVal,
1549
					state = stateVal,
1310
					classNames = value.split( rspace );
1550
					classNames = value.split( rspaces );
1311
 
1551
 
1312
				while ( (className = classNames[ i++ ]) ) {
1552
				while ( (className = classNames[ i++ ]) ) {
1313
					// check each className given, space seperated list
1553
					// check each className given, space seperated list
1314
					state = isBool ? state : !self.hasClass( className );
1554
					state = isBool ? state : !self.hasClass( className );
1315
					self[ state ? "addClass" : "removeClass" ]( className );
1555
					self[ state ? "addClass" : "removeClass" ]( className );
1316
				}
1556
				}
1317
 
1557
 
1318
			} else if ( type === "undefined" || type === "boolean" ) {
1558
			} else if ( type === "undefined" || type === "boolean" ) {
1319
				if ( this.className ) {
1559
				if ( this.className ) {
1320
					// store className if set
1560
					// store className if set
1321
					jQuery.data( this, "__className__", this.className );
1561
					jQuery.data( this, "__className__", this.className );
1322
				}
1562
				}
1323
 
1563
 
1324
				// toggle whole className
1564
				// toggle whole className
1325
				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
1565
				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
1326
			}
1566
			}
1327
		});
1567
		});
1328
	},
1568
	},
1329
 
1569
 
1330
	hasClass: function( selector ) {
1570
	hasClass: function( selector ) {
1331
		var className = " " + selector + " ";
1571
		var className = " " + selector + " ";
1332
		for ( var i = 0, l = this.length; i < l; i++ ) {
1572
		for ( var i = 0, l = this.length; i < l; i++ ) {
1333
			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1573
			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1334
				return true;
1574
				return true;
1335
			}
1575
			}
1336
		}
1576
		}
1337
 
1577
 
1338
		return false;
1578
		return false;
1339
	},
1579
	},
1340
 
1580
 
1341
	val: function( value ) {
1581
	val: function( value ) {
1342
		if ( value === undefined ) {
1582
		if ( !arguments.length ) {
1343
			var elem = this[0];
1583
			var elem = this[0];
1344
 
1584
 
1345
			if ( elem ) {
1585
			if ( elem ) {
1346
				if ( jQuery.nodeName( elem, "option" ) ) {
1586
				if ( jQuery.nodeName( elem, "option" ) ) {
-
 
1587
					// attributes.value is undefined in Blackberry 4.7 but
-
 
1588
					// uses .value. See #6932
-
 
1589
					var val = elem.attributes.value;
1347
					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
1590
					return !val || val.specified ? elem.value : elem.text;
1348
				}
1591
				}
1349
 
1592
 
1350
				// We need to handle select boxes special
1593
				// We need to handle select boxes special
1351
				if ( jQuery.nodeName( elem, "select" ) ) {
1594
				if ( jQuery.nodeName( elem, "select" ) ) {
1352
					var index = elem.selectedIndex,
1595
					var index = elem.selectedIndex,
1353
						values = [],
1596
						values = [],
1354
						options = elem.options,
1597
						options = elem.options,
1355
						one = elem.type === "select-one";
1598
						one = elem.type === "select-one";
1356
 
1599
 
1357
					// Nothing was selected
1600
					// Nothing was selected
1358
					if ( index < 0 ) {
1601
					if ( index < 0 ) {
1359
						return null;
1602
						return null;
1360
					}
1603
					}
1361
 
1604
 
1362
					// Loop through all the selected options
1605
					// Loop through all the selected options
1363
					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1606
					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1364
						var option = options[ i ];
1607
						var option = options[ i ];
1365
 
1608
 
-
 
1609
						// Don't return options that are disabled or in a disabled optgroup
-
 
1610
						if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
-
 
1611
								(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
1366
						if ( option.selected ) {
1612
 
1367
							// Get the specifc value for the option
1613
							// Get the specific value for the option
1368
							value = jQuery(option).val();
1614
							value = jQuery(option).val();
1369
 
1615
 
1370
							// We don't need an array for one selects
1616
							// We don't need an array for one selects
1371
							if ( one ) {
1617
							if ( one ) {
1372
								return value;
1618
								return value;
1373
							}
1619
							}
1374
 
1620
 
1375
							// Multi-Selects return an array
1621
							// Multi-Selects return an array
1376
							values.push( value );
1622
							values.push( value );
1377
						}
1623
						}
1378
					}
1624
					}
1379
 
1625
 
1380
					return values;
1626
					return values;
1381
				}
1627
				}
1382
 
1628
 
1383
				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1629
				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1384
				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1630
				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1385
					return elem.getAttribute("value") === null ? "on" : elem.value;
1631
					return elem.getAttribute("value") === null ? "on" : elem.value;
1386
				}
1632
				}
1387
				
1633
				
1388
 
1634
 
1389
				// Everything else, we just grab the value
1635
				// Everything else, we just grab the value
1390
				return (elem.value || "").replace(rreturn, "");
1636
				return (elem.value || "").replace(rreturn, "");
1391
 
1637
 
1392
			}
1638
			}
1393
 
1639
 
1394
			return undefined;
1640
			return undefined;
1395
		}
1641
		}
1396
 
1642
 
1397
		var isFunction = jQuery.isFunction(value);
1643
		var isFunction = jQuery.isFunction(value);
1398
 
1644
 
1399
		return this.each(function(i) {
1645
		return this.each(function(i) {
1400
			var self = jQuery(this), val = value;
1646
			var self = jQuery(this), val = value;
1401
 
1647
 
1402
			if ( this.nodeType !== 1 ) {
1648
			if ( this.nodeType !== 1 ) {
1403
				return;
1649
				return;
1404
			}
1650
			}
1405
 
1651
 
1406
			if ( isFunction ) {
1652
			if ( isFunction ) {
1407
				val = value.call(this, i, self.val());
1653
				val = value.call(this, i, self.val());
1408
			}
1654
			}
1409
 
1655
 
1410
			// Typecast each time if the value is a Function and the appended
1656
			// Treat null/undefined as ""; convert numbers to string
-
 
1657
			if ( val == null ) {
1411
			// value is therefore different each time.
1658
				val = "";
1412
			if ( typeof val === "number" ) {
1659
			} else if ( typeof val === "number" ) {
-
 
1660
				val += "";
-
 
1661
			} else if ( jQuery.isArray(val) ) {
-
 
1662
				val = jQuery.map(val, function (value) {
-
 
1663
					return value == null ? "" : value + "";
1413
				val += "";
1664
				});
1414
			}
1665
			}
1415
 
1666
 
1416
			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1667
			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1417
				this.checked = jQuery.inArray( self.val(), val ) >= 0;
1668
				this.checked = jQuery.inArray( self.val(), val ) >= 0;
1418
 
1669
 
1419
			} else if ( jQuery.nodeName( this, "select" ) ) {
1670
			} else if ( jQuery.nodeName( this, "select" ) ) {
1420
				var values = jQuery.makeArray(val);
1671
				var values = jQuery.makeArray(val);
1421
 
1672
 
1422
				jQuery( "option", this ).each(function() {
1673
				jQuery( "option", this ).each(function() {
1423
					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1674
					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1424
				});
1675
				});
1425
 
1676
 
1426
				if ( !values.length ) {
1677
				if ( !values.length ) {
1427
					this.selectedIndex = -1;
1678
					this.selectedIndex = -1;
1428
				}
1679
				}
1429
 
1680
 
1430
			} else {
1681
			} else {
1431
				this.value = val;
1682
				this.value = val;
1432
			}
1683
			}
1433
		});
1684
		});
1434
	}
1685
	}
1435
});
1686
});
1436
 
1687
 
1437
jQuery.extend({
1688
jQuery.extend({
1438
	attrFn: {
1689
	attrFn: {
1439
		val: true,
1690
		val: true,
1440
		css: true,
1691
		css: true,
1441
		html: true,
1692
		html: true,
1442
		text: true,
1693
		text: true,
1443
		data: true,
1694
		data: true,
1444
		width: true,
1695
		width: true,
1445
		height: true,
1696
		height: true,
1446
		offset: true
1697
		offset: true
1447
	},
1698
	},
1448
		
1699
		
1449
	attr: function( elem, name, value, pass ) {
1700
	attr: function( elem, name, value, pass ) {
1450
		// don't set attributes on text and comment nodes
1701
		// don't set attributes on text and comment nodes
1451
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1702
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1452
			return undefined;
1703
			return undefined;
1453
		}
1704
		}
1454
 
1705
 
1455
		if ( pass && name in jQuery.attrFn ) {
1706
		if ( pass && name in jQuery.attrFn ) {
1456
			return jQuery(elem)[name](value);
1707
			return jQuery(elem)[name](value);
1457
		}
1708
		}
1458
 
1709
 
1459
		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
1710
		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
1460
			// Whether we are setting (or getting)
1711
			// Whether we are setting (or getting)
1461
			set = value !== undefined;
1712
			set = value !== undefined;
1462
 
1713
 
1463
		// Try to normalize/fix the name
1714
		// Try to normalize/fix the name
1464
		name = notxml && jQuery.props[ name ] || name;
1715
		name = notxml && jQuery.props[ name ] || name;
1465
 
-
 
1466
		// Only do all the following if this is a node (faster for style)
-
 
1467
		if ( elem.nodeType === 1 ) {
1716
 
1468
			// These attributes require special treatment
1717
		// These attributes require special treatment
1469
			var special = rspecialurl.test( name );
1718
		var special = rspecialurl.test( name );
1470
 
1719
 
1471
			// Safari mis-reports the default selected property of an option
1720
		// Safari mis-reports the default selected property of an option
1472
			// Accessing the parent's selectedIndex property fixes it
1721
		// Accessing the parent's selectedIndex property fixes it
1473
			if ( name === "selected" && !jQuery.support.optSelected ) {
1722
		if ( name === "selected" && !jQuery.support.optSelected ) {
1474
				var parent = elem.parentNode;
1723
			var parent = elem.parentNode;
1475
				if ( parent ) {
1724
			if ( parent ) {
1476
					parent.selectedIndex;
1725
				parent.selectedIndex;
1477
	
1726
 
1478
					// Make sure that it also works with optgroups, see #5701
1727
				// Make sure that it also works with optgroups, see #5701
1479
					if ( parent.parentNode ) {
1728
				if ( parent.parentNode ) {
1480
						parent.parentNode.selectedIndex;
1729
					parent.parentNode.selectedIndex;
1481
					}
1730
				}
1482
				}
1731
			}
1483
			}
1732
		}
1484
 
1733
 
1485
			// If applicable, access the attribute via the DOM 0 way
1734
		// If applicable, access the attribute via the DOM 0 way
-
 
1735
		// 'in' checks fail in Blackberry 4.7 #6931
1486
			if ( name in elem && notxml && !special ) {
1736
		if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
1487
				if ( set ) {
1737
			if ( set ) {
1488
					// We can't allow the type property to be changed (since it causes problems in IE)
1738
				// We can't allow the type property to be changed (since it causes problems in IE)
1489
					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
1739
				if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
1490
						jQuery.error( "type property can't be changed" );
1740
					jQuery.error( "type property can't be changed" );
1491
					}
1741
				}
-
 
1742
 
-
 
1743
				if ( value === null ) {
-
 
1744
					if ( elem.nodeType === 1 ) {
-
 
1745
						elem.removeAttribute( name );
-
 
1746
					}
-
 
1747
 
1492
 
1748
				} else {
1493
					elem[ name ] = value;
1749
					elem[ name ] = value;
-
 
1750
				}
1494
				}
1751
			}
1495
 
1752
 
1496
				// browsers index elements by id/name on forms, give priority to attributes.
1753
			// browsers index elements by id/name on forms, give priority to attributes.
1497
				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
1754
			if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
1498
					return elem.getAttributeNode( name ).nodeValue;
1755
				return elem.getAttributeNode( name ).nodeValue;
1499
				}
1756
			}
1500
 
1757
 
1501
				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1758
			// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1502
				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1759
			// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1503
				if ( name === "tabIndex" ) {
1760
			if ( name === "tabIndex" ) {
1504
					var attributeNode = elem.getAttributeNode( "tabIndex" );
1761
				var attributeNode = elem.getAttributeNode( "tabIndex" );
1505
 
1762
 
1506
					return attributeNode && attributeNode.specified ?
1763
				return attributeNode && attributeNode.specified ?
1507
						attributeNode.value :
1764
					attributeNode.value :
1508
						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1765
					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1509
							0 :
1766
						0 :
1510
							undefined;
1767
						undefined;
1511
				}
1768
			}
1512
 
1769
 
1513
				return elem[ name ];
1770
			return elem[ name ];
1514
			}
1771
		}
1515
 
1772
 
1516
			if ( !jQuery.support.style && notxml && name === "style" ) {
1773
		if ( !jQuery.support.style && notxml && name === "style" ) {
1517
				if ( set ) {
1774
			if ( set ) {
1518
					elem.style.cssText = "" + value;
1775
				elem.style.cssText = "" + value;
1519
				}
1776
			}
1520
 
1777
 
1521
				return elem.style.cssText;
1778
			return elem.style.cssText;
1522
			}
1779
		}
1523
 
1780
 
1524
			if ( set ) {
1781
		if ( set ) {
1525
				// convert the value to a string (all browsers do this but IE) see #1070
1782
			// convert the value to a string (all browsers do this but IE) see #1070
1526
				elem.setAttribute( name, "" + value );
1783
			elem.setAttribute( name, "" + value );
1527
			}
1784
		}
-
 
1785
 
-
 
1786
		// Ensure that missing attributes return undefined
-
 
1787
		// Blackberry 4.7 returns "" from getAttribute #6938
-
 
1788
		if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
-
 
1789
			return undefined;
-
 
1790
		}
1528
 
1791
 
1529
			var attr = !jQuery.support.hrefNormalized && notxml && special ?
1792
		var attr = !jQuery.support.hrefNormalized && notxml && special ?
1530
					// Some attributes require a special call on IE
1793
				// Some attributes require a special call on IE
1531
					elem.getAttribute( name, 2 ) :
1794
				elem.getAttribute( name, 2 ) :
1532
					elem.getAttribute( name );
1795
				elem.getAttribute( name );
1533
 
1796
 
1534
			// Non-existent attributes return null, we normalize to undefined
1797
		// Non-existent attributes return null, we normalize to undefined
1535
			return attr === null ? undefined : attr;
1798
		return attr === null ? undefined : attr;
1536
		}
1799
	}
1537
 
-
 
1538
		// elem is actually elem.style ... set the style
-
 
1539
		// Using attr for specific style information is now deprecated. Use style instead.
-
 
1540
		return jQuery.style( elem, name, value );
-
 
1541
	}
-
 
1542
});
1800
});
-
 
1801
 
-
 
1802
 
-
 
1803
 
-
 
1804
 
1543
var rnamespaces = /\.(.*)$/,
1805
var rnamespaces = /\.(.*)$/,
-
 
1806
	rformElems = /^(?:textarea|input|select)$/i,
-
 
1807
	rperiod = /\./g,
-
 
1808
	rspace = / /g,
-
 
1809
	rescape = /[^\w\s.|`]/g,
1544
	fcleanup = function( nm ) {
1810
	fcleanup = function( nm ) {
1545
		return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
1811
		return nm.replace(rescape, "\\$&");
1546
			return "\\" + ch;
-
 
1547
		});
-
 
1548
	};
1812
	},
-
 
1813
	focusCounts = { focusin: 0, focusout: 0 };
1549
 
1814
 
1550
/*
1815
/*
1551
 * A number of helper functions used for managing events.
1816
 * A number of helper functions used for managing events.
1552
 * Many of the ideas behind this code originated from
1817
 * Many of the ideas behind this code originated from
1553
 * Dean Edwards' addEvent library.
1818
 * Dean Edwards' addEvent library.
1554
 */
1819
 */
1555
jQuery.event = {
1820
jQuery.event = {
1556
 
1821
 
1557
	// Bind an event to an element
1822
	// Bind an event to an element
1558
	// Original by Dean Edwards
1823
	// Original by Dean Edwards
1559
	add: function( elem, types, handler, data ) {
1824
	add: function( elem, types, handler, data ) {
1560
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1825
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1561
			return;
1826
			return;
1562
		}
1827
		}
1563
 
1828
 
1564
		// For whatever reason, IE has trouble passing the window object
1829
		// For whatever reason, IE has trouble passing the window object
1565
		// around, causing it to be cloned in the process
1830
		// around, causing it to be cloned in the process
1566
		if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
1831
		if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
1567
			elem = window;
1832
			elem = window;
1568
		}
1833
		}
-
 
1834
 
-
 
1835
		if ( handler === false ) {
-
 
1836
			handler = returnFalse;
-
 
1837
		} else if ( !handler ) {
-
 
1838
			// Fixes bug #7229. Fix recommended by jdalton
-
 
1839
		  return;
-
 
1840
		}
1569
 
1841
 
1570
		var handleObjIn, handleObj;
1842
		var handleObjIn, handleObj;
1571
 
1843
 
1572
		if ( handler.handler ) {
1844
		if ( handler.handler ) {
1573
			handleObjIn = handler;
1845
			handleObjIn = handler;
1574
			handler = handleObjIn.handler;
1846
			handler = handleObjIn.handler;
1575
		}
1847
		}
1576
 
1848
 
1577
		// Make sure that the function being executed has a unique ID
1849
		// Make sure that the function being executed has a unique ID
1578
		if ( !handler.guid ) {
1850
		if ( !handler.guid ) {
1579
			handler.guid = jQuery.guid++;
1851
			handler.guid = jQuery.guid++;
1580
		}
1852
		}
1581
 
1853
 
1582
		// Init the element's event structure
1854
		// Init the element's event structure
1583
		var elemData = jQuery.data( elem );
1855
		var elemData = jQuery.data( elem );
1584
 
1856
 
1585
		// If no elemData is found then we must be trying to bind to one of the
1857
		// If no elemData is found then we must be trying to bind to one of the
1586
		// banned noData elements
1858
		// banned noData elements
1587
		if ( !elemData ) {
1859
		if ( !elemData ) {
1588
			return;
1860
			return;
1589
		}
1861
		}
-
 
1862
 
-
 
1863
		// Use a key less likely to result in collisions for plain JS objects.
1590
 
1864
		// Fixes bug #7150.
-
 
1865
		var eventKey = elem.nodeType ? "events" : "__events__",
1591
		var events = elemData.events = elemData.events || {},
1866
			events = elemData[ eventKey ],
-
 
1867
			eventHandle = elemData.handle;
-
 
1868
			
-
 
1869
		if ( typeof events === "function" ) {
-
 
1870
			// On plain objects events is a fn that holds the the data
-
 
1871
			// which prevents this data from being JSON serialized
-
 
1872
			// the function does not need to be called, it just contains the data
-
 
1873
			eventHandle = events.handle;
-
 
1874
			events = events.events;
-
 
1875
 
-
 
1876
		} else if ( !events ) {
-
 
1877
			if ( !elem.nodeType ) {
-
 
1878
				// On plain objects, create a fn that acts as the holder
-
 
1879
				// of the values to avoid JSON serialization of event data
-
 
1880
				elemData[ eventKey ] = elemData = function(){};
-
 
1881
			}
-
 
1882
 
-
 
1883
			elemData.events = events = {};
1592
			eventHandle = elemData.handle, eventHandle;
1884
		}
1593
 
1885
 
1594
		if ( !eventHandle ) {
1886
		if ( !eventHandle ) {
1595
			elemData.handle = eventHandle = function() {
1887
			elemData.handle = eventHandle = function() {
1596
				// Handle the second event of a trigger and when
1888
				// Handle the second event of a trigger and when
1597
				// an event is called after a page has unloaded
1889
				// an event is called after a page has unloaded
1598
				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
1890
				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
1599
					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
1891
					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
1600
					undefined;
1892
					undefined;
1601
			};
1893
			};
1602
		}
1894
		}
1603
 
1895
 
1604
		// Add elem as a property of the handle function
1896
		// Add elem as a property of the handle function
1605
		// This is to prevent a memory leak with non-native events in IE.
1897
		// This is to prevent a memory leak with non-native events in IE.
1606
		eventHandle.elem = elem;
1898
		eventHandle.elem = elem;
1607
 
1899
 
1608
		// Handle multiple events separated by a space
1900
		// Handle multiple events separated by a space
1609
		// jQuery(...).bind("mouseover mouseout", fn);
1901
		// jQuery(...).bind("mouseover mouseout", fn);
1610
		types = types.split(" ");
1902
		types = types.split(" ");
1611
 
1903
 
1612
		var type, i = 0, namespaces;
1904
		var type, i = 0, namespaces;
1613
 
1905
 
1614
		while ( (type = types[ i++ ]) ) {
1906
		while ( (type = types[ i++ ]) ) {
1615
			handleObj = handleObjIn ?
1907
			handleObj = handleObjIn ?
1616
				jQuery.extend({}, handleObjIn) :
1908
				jQuery.extend({}, handleObjIn) :
1617
				{ handler: handler, data: data };
1909
				{ handler: handler, data: data };
1618
 
1910
 
1619
			// Namespaced event handlers
1911
			// Namespaced event handlers
1620
			if ( type.indexOf(".") > -1 ) {
1912
			if ( type.indexOf(".") > -1 ) {
1621
				namespaces = type.split(".");
1913
				namespaces = type.split(".");
1622
				type = namespaces.shift();
1914
				type = namespaces.shift();
1623
				handleObj.namespace = namespaces.slice(0).sort().join(".");
1915
				handleObj.namespace = namespaces.slice(0).sort().join(".");
1624
 
1916
 
1625
			} else {
1917
			} else {
1626
				namespaces = [];
1918
				namespaces = [];
1627
				handleObj.namespace = "";
1919
				handleObj.namespace = "";
1628
			}
1920
			}
1629
 
1921
 
1630
			handleObj.type = type;
1922
			handleObj.type = type;
-
 
1923
			if ( !handleObj.guid ) {
1631
			handleObj.guid = handler.guid;
1924
				handleObj.guid = handler.guid;
-
 
1925
			}
1632
 
1926
 
1633
			// Get the current list of functions bound to this event
1927
			// Get the current list of functions bound to this event
1634
			var handlers = events[ type ],
1928
			var handlers = events[ type ],
1635
				special = jQuery.event.special[ type ] || {};
1929
				special = jQuery.event.special[ type ] || {};
1636
 
1930
 
1637
			// Init the event handler queue
1931
			// Init the event handler queue
1638
			if ( !handlers ) {
1932
			if ( !handlers ) {
1639
				handlers = events[ type ] = [];
1933
				handlers = events[ type ] = [];
1640
 
1934
 
1641
				// Check for a special event handler
1935
				// Check for a special event handler
1642
				// Only use addEventListener/attachEvent if the special
1936
				// Only use addEventListener/attachEvent if the special
1643
				// events handler returns false
1937
				// events handler returns false
1644
				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
1938
				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
1645
					// Bind the global event handler to the element
1939
					// Bind the global event handler to the element
1646
					if ( elem.addEventListener ) {
1940
					if ( elem.addEventListener ) {
1647
						elem.addEventListener( type, eventHandle, false );
1941
						elem.addEventListener( type, eventHandle, false );
1648
 
1942
 
1649
					} else if ( elem.attachEvent ) {
1943
					} else if ( elem.attachEvent ) {
1650
						elem.attachEvent( "on" + type, eventHandle );
1944
						elem.attachEvent( "on" + type, eventHandle );
1651
					}
1945
					}
1652
				}
1946
				}
1653
			}
1947
			}
1654
			
1948
			
1655
			if ( special.add ) { 
1949
			if ( special.add ) { 
1656
				special.add.call( elem, handleObj ); 
1950
				special.add.call( elem, handleObj ); 
1657
 
1951
 
1658
				if ( !handleObj.handler.guid ) {
1952
				if ( !handleObj.handler.guid ) {
1659
					handleObj.handler.guid = handler.guid;
1953
					handleObj.handler.guid = handler.guid;
1660
				}
1954
				}
1661
			}
1955
			}
1662
 
1956
 
1663
			// Add the function to the element's handler list
1957
			// Add the function to the element's handler list
1664
			handlers.push( handleObj );
1958
			handlers.push( handleObj );
1665
 
1959
 
1666
			// Keep track of which events have been used, for global triggering
1960
			// Keep track of which events have been used, for global triggering
1667
			jQuery.event.global[ type ] = true;
1961
			jQuery.event.global[ type ] = true;
1668
		}
1962
		}
1669
 
1963
 
1670
		// Nullify elem to prevent memory leaks in IE
1964
		// Nullify elem to prevent memory leaks in IE
1671
		elem = null;
1965
		elem = null;
1672
	},
1966
	},
1673
 
1967
 
1674
	global: {},
1968
	global: {},
1675
 
1969
 
1676
	// Detach an event or set of events from an element
1970
	// Detach an event or set of events from an element
1677
	remove: function( elem, types, handler, pos ) {
1971
	remove: function( elem, types, handler, pos ) {
1678
		// don't do events on text and comment nodes
1972
		// don't do events on text and comment nodes
1679
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1973
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1680
			return;
1974
			return;
1681
		}
1975
		}
-
 
1976
 
-
 
1977
		if ( handler === false ) {
-
 
1978
			handler = returnFalse;
-
 
1979
		}
1682
 
1980
 
-
 
1981
		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
1683
		var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
1982
			eventKey = elem.nodeType ? "events" : "__events__",
1684
			elemData = jQuery.data( elem ),
1983
			elemData = jQuery.data( elem ),
1685
			events = elemData && elemData.events;
1984
			events = elemData && elemData[ eventKey ];
1686
 
1985
 
1687
		if ( !elemData || !events ) {
1986
		if ( !elemData || !events ) {
1688
			return;
1987
			return;
1689
		}
1988
		}
-
 
1989
		
-
 
1990
		if ( typeof events === "function" ) {
-
 
1991
			elemData = events;
-
 
1992
			events = events.events;
-
 
1993
		}
1690
 
1994
 
1691
		// types is actually an event object here
1995
		// types is actually an event object here
1692
		if ( types && types.type ) {
1996
		if ( types && types.type ) {
1693
			handler = types.handler;
1997
			handler = types.handler;
1694
			types = types.type;
1998
			types = types.type;
1695
		}
1999
		}
1696
 
2000
 
1697
		// Unbind all events for the element
2001
		// Unbind all events for the element
1698
		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
2002
		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
1699
			types = types || "";
2003
			types = types || "";
1700
 
2004
 
1701
			for ( type in events ) {
2005
			for ( type in events ) {
1702
				jQuery.event.remove( elem, type + types );
2006
				jQuery.event.remove( elem, type + types );
1703
			}
2007
			}
1704
 
2008
 
1705
			return;
2009
			return;
1706
		}
2010
		}
1707
 
2011
 
1708
		// Handle multiple events separated by a space
2012
		// Handle multiple events separated by a space
1709
		// jQuery(...).unbind("mouseover mouseout", fn);
2013
		// jQuery(...).unbind("mouseover mouseout", fn);
1710
		types = types.split(" ");
2014
		types = types.split(" ");
1711
 
2015
 
1712
		while ( (type = types[ i++ ]) ) {
2016
		while ( (type = types[ i++ ]) ) {
1713
			origType = type;
2017
			origType = type;
1714
			handleObj = null;
2018
			handleObj = null;
1715
			all = type.indexOf(".") < 0;
2019
			all = type.indexOf(".") < 0;
1716
			namespaces = [];
2020
			namespaces = [];
1717
 
2021
 
1718
			if ( !all ) {
2022
			if ( !all ) {
1719
				// Namespaced event handlers
2023
				// Namespaced event handlers
1720
				namespaces = type.split(".");
2024
				namespaces = type.split(".");
1721
				type = namespaces.shift();
2025
				type = namespaces.shift();
1722
 
2026
 
1723
				namespace = new RegExp("(^|\\.)" + 
2027
				namespace = new RegExp("(^|\\.)" + 
1724
					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
2028
					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
1725
			}
2029
			}
1726
 
2030
 
1727
			eventType = events[ type ];
2031
			eventType = events[ type ];
1728
 
2032
 
1729
			if ( !eventType ) {
2033
			if ( !eventType ) {
1730
				continue;
2034
				continue;
1731
			}
2035
			}
1732
 
2036
 
1733
			if ( !handler ) {
2037
			if ( !handler ) {
1734
				for ( var j = 0; j < eventType.length; j++ ) {
2038
				for ( j = 0; j < eventType.length; j++ ) {
1735
					handleObj = eventType[ j ];
2039
					handleObj = eventType[ j ];
1736
 
2040
 
1737
					if ( all || namespace.test( handleObj.namespace ) ) {
2041
					if ( all || namespace.test( handleObj.namespace ) ) {
1738
						jQuery.event.remove( elem, origType, handleObj.handler, j );
2042
						jQuery.event.remove( elem, origType, handleObj.handler, j );
1739
						eventType.splice( j--, 1 );
2043
						eventType.splice( j--, 1 );
1740
					}
2044
					}
1741
				}
2045
				}
1742
 
2046
 
1743
				continue;
2047
				continue;
1744
			}
2048
			}
1745
 
2049
 
1746
			special = jQuery.event.special[ type ] || {};
2050
			special = jQuery.event.special[ type ] || {};
1747
 
2051
 
1748
			for ( var j = pos || 0; j < eventType.length; j++ ) {
2052
			for ( j = pos || 0; j < eventType.length; j++ ) {
1749
				handleObj = eventType[ j ];
2053
				handleObj = eventType[ j ];
1750
 
2054
 
1751
				if ( handler.guid === handleObj.guid ) {
2055
				if ( handler.guid === handleObj.guid ) {
1752
					// remove the given handler for the given type
2056
					// remove the given handler for the given type
1753
					if ( all || namespace.test( handleObj.namespace ) ) {
2057
					if ( all || namespace.test( handleObj.namespace ) ) {
1754
						if ( pos == null ) {
2058
						if ( pos == null ) {
1755
							eventType.splice( j--, 1 );
2059
							eventType.splice( j--, 1 );
1756
						}
2060
						}
1757
 
2061
 
1758
						if ( special.remove ) {
2062
						if ( special.remove ) {
1759
							special.remove.call( elem, handleObj );
2063
							special.remove.call( elem, handleObj );
1760
						}
2064
						}
1761
					}
2065
					}
1762
 
2066
 
1763
					if ( pos != null ) {
2067
					if ( pos != null ) {
1764
						break;
2068
						break;
1765
					}
2069
					}
1766
				}
2070
				}
1767
			}
2071
			}
1768
 
2072
 
1769
			// remove generic event handler if no more handlers exist
2073
			// remove generic event handler if no more handlers exist
1770
			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
2074
			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
1771
				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
2075
				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
1772
					removeEvent( elem, type, elemData.handle );
2076
					jQuery.removeEvent( elem, type, elemData.handle );
1773
				}
2077
				}
1774
 
2078
 
1775
				ret = null;
2079
				ret = null;
1776
				delete events[ type ];
2080
				delete events[ type ];
1777
			}
2081
			}
1778
		}
2082
		}
1779
 
2083
 
1780
		// Remove the expando if it's no longer used
2084
		// Remove the expando if it's no longer used
1781
		if ( jQuery.isEmptyObject( events ) ) {
2085
		if ( jQuery.isEmptyObject( events ) ) {
1782
			var handle = elemData.handle;
2086
			var handle = elemData.handle;
1783
			if ( handle ) {
2087
			if ( handle ) {
1784
				handle.elem = null;
2088
				handle.elem = null;
1785
			}
2089
			}
1786
 
2090
 
1787
			delete elemData.events;
2091
			delete elemData.events;
1788
			delete elemData.handle;
2092
			delete elemData.handle;
-
 
2093
 
-
 
2094
			if ( typeof elemData === "function" ) {
-
 
2095
				jQuery.removeData( elem, eventKey );
1789
 
2096
 
1790
			if ( jQuery.isEmptyObject( elemData ) ) {
2097
			} else if ( jQuery.isEmptyObject( elemData ) ) {
1791
				jQuery.removeData( elem );
2098
				jQuery.removeData( elem );
1792
			}
2099
			}
1793
		}
2100
		}
1794
	},
2101
	},
1795
 
2102
 
1796
	// bubbling is internal
2103
	// bubbling is internal
1797
	trigger: function( event, data, elem /*, bubbling */ ) {
2104
	trigger: function( event, data, elem /*, bubbling */ ) {
1798
		// Event object or event type
2105
		// Event object or event type
1799
		var type = event.type || event,
2106
		var type = event.type || event,
1800
			bubbling = arguments[3];
2107
			bubbling = arguments[3];
1801
 
2108
 
1802
		if ( !bubbling ) {
2109
		if ( !bubbling ) {
1803
			event = typeof event === "object" ?
2110
			event = typeof event === "object" ?
1804
				// jQuery.Event object
2111
				// jQuery.Event object
1805
				event[expando] ? event :
2112
				event[ jQuery.expando ] ? event :
1806
				// Object literal
2113
				// Object literal
1807
				jQuery.extend( jQuery.Event(type), event ) :
2114
				jQuery.extend( jQuery.Event(type), event ) :
1808
				// Just the event type (string)
2115
				// Just the event type (string)
1809
				jQuery.Event(type);
2116
				jQuery.Event(type);
1810
 
2117
 
1811
			if ( type.indexOf("!") >= 0 ) {
2118
			if ( type.indexOf("!") >= 0 ) {
1812
				event.type = type = type.slice(0, -1);
2119
				event.type = type = type.slice(0, -1);
1813
				event.exclusive = true;
2120
				event.exclusive = true;
1814
			}
2121
			}
1815
 
2122
 
1816
			// Handle a global trigger
2123
			// Handle a global trigger
1817
			if ( !elem ) {
2124
			if ( !elem ) {
1818
				// Don't bubble custom events when global (to avoid too much overhead)
2125
				// Don't bubble custom events when global (to avoid too much overhead)
1819
				event.stopPropagation();
2126
				event.stopPropagation();
1820
 
2127
 
1821
				// Only trigger if we've ever bound an event for it
2128
				// Only trigger if we've ever bound an event for it
1822
				if ( jQuery.event.global[ type ] ) {
2129
				if ( jQuery.event.global[ type ] ) {
1823
					jQuery.each( jQuery.cache, function() {
2130
					jQuery.each( jQuery.cache, function() {
1824
						if ( this.events && this.events[type] ) {
2131
						if ( this.events && this.events[type] ) {
1825
							jQuery.event.trigger( event, data, this.handle.elem );
2132
							jQuery.event.trigger( event, data, this.handle.elem );
1826
						}
2133
						}
1827
					});
2134
					});
1828
				}
2135
				}
1829
			}
2136
			}
1830
 
2137
 
1831
			// Handle triggering a single element
2138
			// Handle triggering a single element
1832
 
2139
 
1833
			// don't do events on text and comment nodes
2140
			// don't do events on text and comment nodes
1834
			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
2141
			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1835
				return undefined;
2142
				return undefined;
1836
			}
2143
			}
1837
 
2144
 
1838
			// Clean up in case it is reused
2145
			// Clean up in case it is reused
1839
			event.result = undefined;
2146
			event.result = undefined;
1840
			event.target = elem;
2147
			event.target = elem;
1841
 
2148
 
1842
			// Clone the incoming data, if any
2149
			// Clone the incoming data, if any
1843
			data = jQuery.makeArray( data );
2150
			data = jQuery.makeArray( data );
1844
			data.unshift( event );
2151
			data.unshift( event );
1845
		}
2152
		}
1846
 
2153
 
1847
		event.currentTarget = elem;
2154
		event.currentTarget = elem;
1848
 
2155
 
1849
		// Trigger the event, it is assumed that "handle" is a function
2156
		// Trigger the event, it is assumed that "handle" is a function
-
 
2157
		var handle = elem.nodeType ?
1850
		var handle = jQuery.data( elem, "handle" );
2158
			jQuery.data( elem, "handle" ) :
-
 
2159
			(jQuery.data( elem, "__events__" ) || {}).handle;
-
 
2160
 
1851
		if ( handle ) {
2161
		if ( handle ) {
1852
			handle.apply( elem, data );
2162
			handle.apply( elem, data );
1853
		}
2163
		}
1854
 
2164
 
1855
		var parent = elem.parentNode || elem.ownerDocument;
2165
		var parent = elem.parentNode || elem.ownerDocument;
1856
 
2166
 
1857
		// Trigger an inline bound script
2167
		// Trigger an inline bound script
1858
		try {
2168
		try {
1859
			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
2169
			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
1860
				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
2170
				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
1861
					event.result = false;
2171
					event.result = false;
-
 
2172
					event.preventDefault();
1862
				}
2173
				}
1863
			}
2174
			}
1864
 
2175
 
1865
		// prevent IE from throwing an error for some elements with some event types, see #3533
2176
		// prevent IE from throwing an error for some elements with some event types, see #3533
1866
		} catch (e) {}
2177
		} catch (inlineError) {}
1867
 
2178
 
1868
		if ( !event.isPropagationStopped() && parent ) {
2179
		if ( !event.isPropagationStopped() && parent ) {
1869
			jQuery.event.trigger( event, data, parent, true );
2180
			jQuery.event.trigger( event, data, parent, true );
1870
 
2181
 
1871
		} else if ( !event.isDefaultPrevented() ) {
2182
		} else if ( !event.isDefaultPrevented() ) {
-
 
2183
			var old,
1872
			var target = event.target, old,
2184
				target = event.target,
-
 
2185
				targetType = type.replace( rnamespaces, "" ),
1873
				isClick = jQuery.nodeName(target, "a") && type === "click",
2186
				isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
1874
				special = jQuery.event.special[ type ] || {};
2187
				special = jQuery.event.special[ targetType ] || {};
1875
 
2188
 
1876
			if ( (!special._default || special._default.call( elem, event ) === false) && 
2189
			if ( (!special._default || special._default.call( elem, event ) === false) && 
1877
				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
2190
				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
1878
 
2191
 
1879
				try {
2192
				try {
1880
					if ( target[ type ] ) {
2193
					if ( target[ targetType ] ) {
1881
						// Make sure that we don't accidentally re-trigger the onFOO events
2194
						// Make sure that we don't accidentally re-trigger the onFOO events
1882
						old = target[ "on" + type ];
2195
						old = target[ "on" + targetType ];
1883
 
2196
 
1884
						if ( old ) {
2197
						if ( old ) {
1885
							target[ "on" + type ] = null;
2198
							target[ "on" + targetType ] = null;
1886
						}
2199
						}
1887
 
2200
 
1888
						jQuery.event.triggered = true;
2201
						jQuery.event.triggered = true;
1889
						target[ type ]();
2202
						target[ targetType ]();
1890
					}
2203
					}
1891
 
2204
 
1892
				// prevent IE from throwing an error for some elements with some event types, see #3533
2205
				// prevent IE from throwing an error for some elements with some event types, see #3533
1893
				} catch (e) {}
2206
				} catch (triggerError) {}
1894
 
2207
 
1895
				if ( old ) {
2208
				if ( old ) {
1896
					target[ "on" + type ] = old;
2209
					target[ "on" + targetType ] = old;
1897
				}
2210
				}
1898
 
2211
 
1899
				jQuery.event.triggered = false;
2212
				jQuery.event.triggered = false;
1900
			}
2213
			}
1901
		}
2214
		}
1902
	},
2215
	},
1903
 
2216
 
1904
	handle: function( event ) {
2217
	handle: function( event ) {
1905
		var all, handlers, namespaces, namespace, events;
2218
		var all, handlers, namespaces, namespace_re, events,
-
 
2219
			namespace_sort = [],
-
 
2220
			args = jQuery.makeArray( arguments );
1906
 
2221
 
1907
		event = arguments[0] = jQuery.event.fix( event || window.event );
2222
		event = args[0] = jQuery.event.fix( event || window.event );
1908
		event.currentTarget = this;
2223
		event.currentTarget = this;
1909
 
2224
 
1910
		// Namespaced event handlers
2225
		// Namespaced event handlers
1911
		all = event.type.indexOf(".") < 0 && !event.exclusive;
2226
		all = event.type.indexOf(".") < 0 && !event.exclusive;
1912
 
2227
 
1913
		if ( !all ) {
2228
		if ( !all ) {
1914
			namespaces = event.type.split(".");
2229
			namespaces = event.type.split(".");
1915
			event.type = namespaces.shift();
2230
			event.type = namespaces.shift();
-
 
2231
			namespace_sort = namespaces.slice(0).sort();
1916
			namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
2232
			namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
-
 
2233
		}
-
 
2234
 
-
 
2235
		event.namespace = event.namespace || namespace_sort.join(".");
-
 
2236
 
-
 
2237
		events = jQuery.data(this, this.nodeType ? "events" : "__events__");
-
 
2238
 
-
 
2239
		if ( typeof events === "function" ) {
-
 
2240
			events = events.events;
1917
		}
2241
		}
1918
 
2242
 
1919
		var events = jQuery.data(this, "events"), handlers = events[ event.type ];
2243
		handlers = (events || {})[ event.type ];
1920
 
2244
 
1921
		if ( events && handlers ) {
2245
		if ( events && handlers ) {
1922
			// Clone the handlers to prevent manipulation
2246
			// Clone the handlers to prevent manipulation
1923
			handlers = handlers.slice(0);
2247
			handlers = handlers.slice(0);
1924
 
2248
 
1925
			for ( var j = 0, l = handlers.length; j < l; j++ ) {
2249
			for ( var j = 0, l = handlers.length; j < l; j++ ) {
1926
				var handleObj = handlers[ j ];
2250
				var handleObj = handlers[ j ];
1927
 
2251
 
1928
				// Filter the functions by class
2252
				// Filter the functions by class
1929
				if ( all || namespace.test( handleObj.namespace ) ) {
2253
				if ( all || namespace_re.test( handleObj.namespace ) ) {
1930
					// Pass in a reference to the handler function itself
2254
					// Pass in a reference to the handler function itself
1931
					// So that we can later remove it
2255
					// So that we can later remove it
1932
					event.handler = handleObj.handler;
2256
					event.handler = handleObj.handler;
1933
					event.data = handleObj.data;
2257
					event.data = handleObj.data;
1934
					event.handleObj = handleObj;
2258
					event.handleObj = handleObj;
1935
	
2259
	
1936
					var ret = handleObj.handler.apply( this, arguments );
2260
					var ret = handleObj.handler.apply( this, args );
1937
 
2261
 
1938
					if ( ret !== undefined ) {
2262
					if ( ret !== undefined ) {
1939
						event.result = ret;
2263
						event.result = ret;
1940
						if ( ret === false ) {
2264
						if ( ret === false ) {
1941
							event.preventDefault();
2265
							event.preventDefault();
1942
							event.stopPropagation();
2266
							event.stopPropagation();
1943
						}
2267
						}
1944
					}
2268
					}
1945
 
2269
 
1946
					if ( event.isImmediatePropagationStopped() ) {
2270
					if ( event.isImmediatePropagationStopped() ) {
1947
						break;
2271
						break;
1948
					}
2272
					}
1949
				}
2273
				}
1950
			}
2274
			}
1951
		}
2275
		}
1952
 
2276
 
1953
		return event.result;
2277
		return event.result;
1954
	},
2278
	},
1955
 
2279
 
1956
	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
2280
	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
1957
 
2281
 
1958
	fix: function( event ) {
2282
	fix: function( event ) {
1959
		if ( event[ expando ] ) {
2283
		if ( event[ jQuery.expando ] ) {
1960
			return event;
2284
			return event;
1961
		}
2285
		}
1962
 
2286
 
1963
		// store a copy of the original event object
2287
		// store a copy of the original event object
1964
		// and "clone" to set read-only properties
2288
		// and "clone" to set read-only properties
1965
		var originalEvent = event;
2289
		var originalEvent = event;
1966
		event = jQuery.Event( originalEvent );
2290
		event = jQuery.Event( originalEvent );
1967
 
2291
 
1968
		for ( var i = this.props.length, prop; i; ) {
2292
		for ( var i = this.props.length, prop; i; ) {
1969
			prop = this.props[ --i ];
2293
			prop = this.props[ --i ];
1970
			event[ prop ] = originalEvent[ prop ];
2294
			event[ prop ] = originalEvent[ prop ];
1971
		}
2295
		}
1972
 
2296
 
1973
		// Fix target property, if necessary
2297
		// Fix target property, if necessary
1974
		if ( !event.target ) {
2298
		if ( !event.target ) {
1975
			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
2299
			// Fixes #1925 where srcElement might not be defined either
-
 
2300
			event.target = event.srcElement || document;
1976
		}
2301
		}
1977
 
2302
 
1978
		// check if target is a textnode (safari)
2303
		// check if target is a textnode (safari)
1979
		if ( event.target.nodeType === 3 ) {
2304
		if ( event.target.nodeType === 3 ) {
1980
			event.target = event.target.parentNode;
2305
			event.target = event.target.parentNode;
1981
		}
2306
		}
1982
 
2307
 
1983
		// Add relatedTarget, if necessary
2308
		// Add relatedTarget, if necessary
1984
		if ( !event.relatedTarget && event.fromElement ) {
2309
		if ( !event.relatedTarget && event.fromElement ) {
1985
			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
2310
			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
1986
		}
2311
		}
1987
 
2312
 
1988
		// Calculate pageX/Y if missing and clientX/Y available
2313
		// Calculate pageX/Y if missing and clientX/Y available
1989
		if ( event.pageX == null && event.clientX != null ) {
2314
		if ( event.pageX == null && event.clientX != null ) {
1990
			var doc = document.documentElement, body = document.body;
2315
			var doc = document.documentElement,
-
 
2316
				body = document.body;
-
 
2317
 
1991
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
2318
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
1992
			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
2319
			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
1993
		}
2320
		}
1994
 
2321
 
1995
		// Add which for key events
2322
		// Add which for key events
1996
		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
2323
		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
1997
			event.which = event.charCode || event.keyCode;
2324
			event.which = event.charCode != null ? event.charCode : event.keyCode;
1998
		}
2325
		}
1999
 
2326
 
2000
		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2327
		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2001
		if ( !event.metaKey && event.ctrlKey ) {
2328
		if ( !event.metaKey && event.ctrlKey ) {
2002
			event.metaKey = event.ctrlKey;
2329
			event.metaKey = event.ctrlKey;
2003
		}
2330
		}
2004
 
2331
 
2005
		// Add which for click: 1 === left; 2 === middle; 3 === right
2332
		// Add which for click: 1 === left; 2 === middle; 3 === right
2006
		// Note: button is not normalized, so don't use it
2333
		// Note: button is not normalized, so don't use it
2007
		if ( !event.which && event.button !== undefined ) {
2334
		if ( !event.which && event.button !== undefined ) {
2008
			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2335
			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2009
		}
2336
		}
2010
 
2337
 
2011
		return event;
2338
		return event;
2012
	},
2339
	},
2013
 
2340
 
2014
	// Deprecated, use jQuery.guid instead
2341
	// Deprecated, use jQuery.guid instead
2015
	guid: 1E8,
2342
	guid: 1E8,
2016
 
2343
 
2017
	// Deprecated, use jQuery.proxy instead
2344
	// Deprecated, use jQuery.proxy instead
2018
	proxy: jQuery.proxy,
2345
	proxy: jQuery.proxy,
2019
 
2346
 
2020
	special: {
2347
	special: {
2021
		ready: {
2348
		ready: {
2022
			// Make sure the ready event is setup
2349
			// Make sure the ready event is setup
2023
			setup: jQuery.bindReady,
2350
			setup: jQuery.bindReady,
2024
			teardown: jQuery.noop
2351
			teardown: jQuery.noop
2025
		},
2352
		},
2026
 
2353
 
2027
		live: {
2354
		live: {
2028
			add: function( handleObj ) {
2355
			add: function( handleObj ) {
-
 
2356
				jQuery.event.add( this,
-
 
2357
					liveConvert( handleObj.origType, handleObj.selector ),
2029
				jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); 
2358
					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); 
2030
			},
2359
			},
2031
 
2360
 
2032
			remove: function( handleObj ) {
2361
			remove: function( handleObj ) {
2033
				var remove = true,
-
 
2034
					type = handleObj.origType.replace(rnamespaces, "");
-
 
2035
				
-
 
2036
				jQuery.each( jQuery.data(this, "events").live || [], function() {
-
 
2037
					if ( type === this.origType.replace(rnamespaces, "") ) {
-
 
2038
						remove = false;
-
 
2039
						return false;
-
 
2040
					}
-
 
2041
				});
-
 
2042
 
-
 
2043
				if ( remove ) {
-
 
2044
					jQuery.event.remove( this, handleObj.origType, liveHandler );
2362
				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
2045
				}
2363
			}
2046
			}
-
 
2047
 
-
 
2048
		},
2364
		},
2049
 
2365
 
2050
		beforeunload: {
2366
		beforeunload: {
2051
			setup: function( data, namespaces, eventHandle ) {
2367
			setup: function( data, namespaces, eventHandle ) {
2052
				// We only want to do this special case on windows
2368
				// We only want to do this special case on windows
2053
				if ( this.setInterval ) {
2369
				if ( jQuery.isWindow( this ) ) {
2054
					this.onbeforeunload = eventHandle;
2370
					this.onbeforeunload = eventHandle;
2055
				}
2371
				}
2056
 
-
 
2057
				return false;
-
 
2058
			},
2372
			},
-
 
2373
 
2059
			teardown: function( namespaces, eventHandle ) {
2374
			teardown: function( namespaces, eventHandle ) {
2060
				if ( this.onbeforeunload === eventHandle ) {
2375
				if ( this.onbeforeunload === eventHandle ) {
2061
					this.onbeforeunload = null;
2376
					this.onbeforeunload = null;
2062
				}
2377
				}
2063
			}
2378
			}
2064
		}
2379
		}
2065
	}
2380
	}
2066
};
2381
};
2067
 
2382
 
2068
var removeEvent = document.removeEventListener ?
2383
jQuery.removeEvent = document.removeEventListener ?
-
 
2384
	function( elem, type, handle ) {
2069
	function( elem, type, handle ) {
2385
		if ( elem.removeEventListener ) {
-
 
2386
			elem.removeEventListener( type, handle, false );
2070
		elem.removeEventListener( type, handle, false );
2387
		}
2071
	} : 
2388
	} : 
-
 
2389
	function( elem, type, handle ) {
2072
	function( elem, type, handle ) {
2390
		if ( elem.detachEvent ) {
-
 
2391
			elem.detachEvent( "on" + type, handle );
2073
		elem.detachEvent( "on" + type, handle );
2392
		}
2074
	};
2393
	};
2075
 
2394
 
2076
jQuery.Event = function( src ) {
2395
jQuery.Event = function( src ) {
2077
	// Allow instantiation without the 'new' keyword
2396
	// Allow instantiation without the 'new' keyword
2078
	if ( !this.preventDefault ) {
2397
	if ( !this.preventDefault ) {
2079
		return new jQuery.Event( src );
2398
		return new jQuery.Event( src );
2080
	}
2399
	}
2081
 
2400
 
2082
	// Event object
2401
	// Event object
2083
	if ( src && src.type ) {
2402
	if ( src && src.type ) {
2084
		this.originalEvent = src;
2403
		this.originalEvent = src;
2085
		this.type = src.type;
2404
		this.type = src.type;
2086
	// Event type
2405
	// Event type
2087
	} else {
2406
	} else {
2088
		this.type = src;
2407
		this.type = src;
2089
	}
2408
	}
2090
 
2409
 
2091
	// timeStamp is buggy for some events on Firefox(#3843)
2410
	// timeStamp is buggy for some events on Firefox(#3843)
2092
	// So we won't rely on the native value
2411
	// So we won't rely on the native value
2093
	this.timeStamp = now();
2412
	this.timeStamp = jQuery.now();
2094
 
2413
 
2095
	// Mark it as fixed
2414
	// Mark it as fixed
2096
	this[ expando ] = true;
2415
	this[ jQuery.expando ] = true;
2097
};
2416
};
2098
 
2417
 
2099
function returnFalse() {
2418
function returnFalse() {
2100
	return false;
2419
	return false;
2101
}
2420
}
2102
function returnTrue() {
2421
function returnTrue() {
2103
	return true;
2422
	return true;
2104
}
2423
}
2105
 
2424
 
2106
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2425
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2107
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2426
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2108
jQuery.Event.prototype = {
2427
jQuery.Event.prototype = {
2109
	preventDefault: function() {
2428
	preventDefault: function() {
2110
		this.isDefaultPrevented = returnTrue;
2429
		this.isDefaultPrevented = returnTrue;
2111
 
2430
 
2112
		var e = this.originalEvent;
2431
		var e = this.originalEvent;
2113
		if ( !e ) {
2432
		if ( !e ) {
2114
			return;
2433
			return;
2115
		}
2434
		}
2116
		
2435
		
2117
		// if preventDefault exists run it on the original event
2436
		// if preventDefault exists run it on the original event
2118
		if ( e.preventDefault ) {
2437
		if ( e.preventDefault ) {
2119
			e.preventDefault();
2438
			e.preventDefault();
2120
		}
2439
 
2121
		// otherwise set the returnValue property of the original event to false (IE)
2440
		// otherwise set the returnValue property of the original event to false (IE)
-
 
2441
		} else {
2122
		e.returnValue = false;
2442
			e.returnValue = false;
-
 
2443
		}
2123
	},
2444
	},
2124
	stopPropagation: function() {
2445
	stopPropagation: function() {
2125
		this.isPropagationStopped = returnTrue;
2446
		this.isPropagationStopped = returnTrue;
2126
 
2447
 
2127
		var e = this.originalEvent;
2448
		var e = this.originalEvent;
2128
		if ( !e ) {
2449
		if ( !e ) {
2129
			return;
2450
			return;
2130
		}
2451
		}
2131
		// if stopPropagation exists run it on the original event
2452
		// if stopPropagation exists run it on the original event
2132
		if ( e.stopPropagation ) {
2453
		if ( e.stopPropagation ) {
2133
			e.stopPropagation();
2454
			e.stopPropagation();
2134
		}
2455
		}
2135
		// otherwise set the cancelBubble property of the original event to true (IE)
2456
		// otherwise set the cancelBubble property of the original event to true (IE)
2136
		e.cancelBubble = true;
2457
		e.cancelBubble = true;
2137
	},
2458
	},
2138
	stopImmediatePropagation: function() {
2459
	stopImmediatePropagation: function() {
2139
		this.isImmediatePropagationStopped = returnTrue;
2460
		this.isImmediatePropagationStopped = returnTrue;
2140
		this.stopPropagation();
2461
		this.stopPropagation();
2141
	},
2462
	},
2142
	isDefaultPrevented: returnFalse,
2463
	isDefaultPrevented: returnFalse,
2143
	isPropagationStopped: returnFalse,
2464
	isPropagationStopped: returnFalse,
2144
	isImmediatePropagationStopped: returnFalse
2465
	isImmediatePropagationStopped: returnFalse
2145
};
2466
};
2146
 
2467
 
2147
// Checks if an event happened on an element within another element
2468
// Checks if an event happened on an element within another element
2148
// Used in jQuery.event.special.mouseenter and mouseleave handlers
2469
// Used in jQuery.event.special.mouseenter and mouseleave handlers
2149
var withinElement = function( event ) {
2470
var withinElement = function( event ) {
2150
	// Check if mouse(over|out) are still within the same parent element
2471
	// Check if mouse(over|out) are still within the same parent element
2151
	var parent = event.relatedTarget;
2472
	var parent = event.relatedTarget;
2152
 
2473
 
2153
	// Firefox sometimes assigns relatedTarget a XUL element
2474
	// Firefox sometimes assigns relatedTarget a XUL element
2154
	// which we cannot access the parentNode property of
2475
	// which we cannot access the parentNode property of
2155
	try {
2476
	try {
2156
		// Traverse up the tree
2477
		// Traverse up the tree
2157
		while ( parent && parent !== this ) {
2478
		while ( parent && parent !== this ) {
2158
			parent = parent.parentNode;
2479
			parent = parent.parentNode;
2159
		}
2480
		}
2160
 
2481
 
2161
		if ( parent !== this ) {
2482
		if ( parent !== this ) {
2162
			// set the correct event type
2483
			// set the correct event type
2163
			event.type = event.data;
2484
			event.type = event.data;
2164
 
2485
 
2165
			// handle event if we actually just moused on to a non sub-element
2486
			// handle event if we actually just moused on to a non sub-element
2166
			jQuery.event.handle.apply( this, arguments );
2487
			jQuery.event.handle.apply( this, arguments );
2167
		}
2488
		}
2168
 
2489
 
2169
	// assuming we've left the element since we most likely mousedover a xul element
2490
	// assuming we've left the element since we most likely mousedover a xul element
2170
	} catch(e) { }
2491
	} catch(e) { }
2171
},
2492
},
2172
 
2493
 
2173
// In case of event delegation, we only need to rename the event.type,
2494
// In case of event delegation, we only need to rename the event.type,
2174
// liveHandler will take care of the rest.
2495
// liveHandler will take care of the rest.
2175
delegate = function( event ) {
2496
delegate = function( event ) {
2176
	event.type = event.data;
2497
	event.type = event.data;
2177
	jQuery.event.handle.apply( this, arguments );
2498
	jQuery.event.handle.apply( this, arguments );
2178
};
2499
};
2179
 
2500
 
2180
// Create mouseenter and mouseleave events
2501
// Create mouseenter and mouseleave events
2181
jQuery.each({
2502
jQuery.each({
2182
	mouseenter: "mouseover",
2503
	mouseenter: "mouseover",
2183
	mouseleave: "mouseout"
2504
	mouseleave: "mouseout"
2184
}, function( orig, fix ) {
2505
}, function( orig, fix ) {
2185
	jQuery.event.special[ orig ] = {
2506
	jQuery.event.special[ orig ] = {
2186
		setup: function( data ) {
2507
		setup: function( data ) {
2187
			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
2508
			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
2188
		},
2509
		},
2189
		teardown: function( data ) {
2510
		teardown: function( data ) {
2190
			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
2511
			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
2191
		}
2512
		}
2192
	};
2513
	};
2193
});
2514
});
2194
 
2515
 
2195
// submit delegation
2516
// submit delegation
2196
if ( !jQuery.support.submitBubbles ) {
2517
if ( !jQuery.support.submitBubbles ) {
2197
 
2518
 
2198
	jQuery.event.special.submit = {
2519
	jQuery.event.special.submit = {
2199
		setup: function( data, namespaces ) {
2520
		setup: function( data, namespaces ) {
2200
			if ( this.nodeName.toLowerCase() !== "form" ) {
2521
			if ( this.nodeName.toLowerCase() !== "form" ) {
2201
				jQuery.event.add(this, "click.specialSubmit", function( e ) {
2522
				jQuery.event.add(this, "click.specialSubmit", function( e ) {
2202
					var elem = e.target, type = elem.type;
2523
					var elem = e.target,
-
 
2524
						type = elem.type;
2203
 
2525
 
-
 
2526
					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
2204
					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
2527
						e.liveFired = undefined;
2205
						return trigger( "submit", this, arguments );
2528
						return trigger( "submit", this, arguments );
2206
					}
2529
					}
2207
				});
2530
				});
2208
	 
2531
	 
2209
				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
2532
				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
2210
					var elem = e.target, type = elem.type;
2533
					var elem = e.target,
-
 
2534
						type = elem.type;
2211
 
2535
 
-
 
2536
					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
2212
					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
2537
						e.liveFired = undefined;
2213
						return trigger( "submit", this, arguments );
2538
						return trigger( "submit", this, arguments );
2214
					}
2539
					}
2215
				});
2540
				});
2216
 
2541
 
2217
			} else {
2542
			} else {
2218
				return false;
2543
				return false;
2219
			}
2544
			}
2220
		},
2545
		},
2221
 
2546
 
2222
		teardown: function( namespaces ) {
2547
		teardown: function( namespaces ) {
2223
			jQuery.event.remove( this, ".specialSubmit" );
2548
			jQuery.event.remove( this, ".specialSubmit" );
2224
		}
2549
		}
2225
	};
2550
	};
2226
 
2551
 
2227
}
2552
}
2228
 
2553
 
2229
// change delegation, happens here so we have bind.
2554
// change delegation, happens here so we have bind.
2230
if ( !jQuery.support.changeBubbles ) {
2555
if ( !jQuery.support.changeBubbles ) {
2231
 
-
 
2232
	var formElems = /textarea|input|select/i,
-
 
2233
 
2556
 
2234
	changeFilters,
2557
	var changeFilters,
2235
 
2558
 
2236
	getVal = function( elem ) {
2559
	getVal = function( elem ) {
2237
		var type = elem.type, val = elem.value;
2560
		var type = elem.type, val = elem.value;
2238
 
2561
 
2239
		if ( type === "radio" || type === "checkbox" ) {
2562
		if ( type === "radio" || type === "checkbox" ) {
2240
			val = elem.checked;
2563
			val = elem.checked;
2241
 
2564
 
2242
		} else if ( type === "select-multiple" ) {
2565
		} else if ( type === "select-multiple" ) {
2243
			val = elem.selectedIndex > -1 ?
2566
			val = elem.selectedIndex > -1 ?
2244
				jQuery.map( elem.options, function( elem ) {
2567
				jQuery.map( elem.options, function( elem ) {
2245
					return elem.selected;
2568
					return elem.selected;
2246
				}).join("-") :
2569
				}).join("-") :
2247
				"";
2570
				"";
2248
 
2571
 
2249
		} else if ( elem.nodeName.toLowerCase() === "select" ) {
2572
		} else if ( elem.nodeName.toLowerCase() === "select" ) {
2250
			val = elem.selectedIndex;
2573
			val = elem.selectedIndex;
2251
		}
2574
		}
2252
 
2575
 
2253
		return val;
2576
		return val;
2254
	},
2577
	},
2255
 
2578
 
2256
	testChange = function testChange( e ) {
2579
	testChange = function testChange( e ) {
2257
		var elem = e.target, data, val;
2580
		var elem = e.target, data, val;
2258
 
2581
 
2259
		if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
2582
		if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
2260
			return;
2583
			return;
2261
		}
2584
		}
2262
 
2585
 
2263
		data = jQuery.data( elem, "_change_data" );
2586
		data = jQuery.data( elem, "_change_data" );
2264
		val = getVal(elem);
2587
		val = getVal(elem);
2265
 
2588
 
2266
		// the current data will be also retrieved by beforeactivate
2589
		// the current data will be also retrieved by beforeactivate
2267
		if ( e.type !== "focusout" || elem.type !== "radio" ) {
2590
		if ( e.type !== "focusout" || elem.type !== "radio" ) {
2268
			jQuery.data( elem, "_change_data", val );
2591
			jQuery.data( elem, "_change_data", val );
2269
		}
2592
		}
2270
		
2593
		
2271
		if ( data === undefined || val === data ) {
2594
		if ( data === undefined || val === data ) {
2272
			return;
2595
			return;
2273
		}
2596
		}
2274
 
2597
 
2275
		if ( data != null || val ) {
2598
		if ( data != null || val ) {
2276
			e.type = "change";
2599
			e.type = "change";
-
 
2600
			e.liveFired = undefined;
2277
			return jQuery.event.trigger( e, arguments[1], elem );
2601
			return jQuery.event.trigger( e, arguments[1], elem );
2278
		}
2602
		}
2279
	};
2603
	};
2280
 
2604
 
2281
	jQuery.event.special.change = {
2605
	jQuery.event.special.change = {
2282
		filters: {
2606
		filters: {
2283
			focusout: testChange, 
2607
			focusout: testChange, 
-
 
2608
 
-
 
2609
			beforedeactivate: testChange,
2284
 
2610
 
2285
			click: function( e ) {
2611
			click: function( e ) {
2286
				var elem = e.target, type = elem.type;
2612
				var elem = e.target, type = elem.type;
2287
 
2613
 
2288
				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
2614
				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
2289
					return testChange.call( this, e );
2615
					return testChange.call( this, e );
2290
				}
2616
				}
2291
			},
2617
			},
2292
 
2618
 
2293
			// Change has to be called before submit
2619
			// Change has to be called before submit
2294
			// Keydown will be called before keypress, which is used in submit-event delegation
2620
			// Keydown will be called before keypress, which is used in submit-event delegation
2295
			keydown: function( e ) {
2621
			keydown: function( e ) {
2296
				var elem = e.target, type = elem.type;
2622
				var elem = e.target, type = elem.type;
2297
 
2623
 
2298
				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
2624
				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
2299
					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
2625
					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
2300
					type === "select-multiple" ) {
2626
					type === "select-multiple" ) {
2301
					return testChange.call( this, e );
2627
					return testChange.call( this, e );
2302
				}
2628
				}
2303
			},
2629
			},
2304
 
2630
 
2305
			// Beforeactivate happens also before the previous element is blurred
2631
			// Beforeactivate happens also before the previous element is blurred
2306
			// with this event you can't trigger a change event, but you can store
2632
			// with this event you can't trigger a change event, but you can store
2307
			// information/focus[in] is not needed anymore
2633
			// information
2308
			beforeactivate: function( e ) {
2634
			beforeactivate: function( e ) {
2309
				var elem = e.target;
2635
				var elem = e.target;
2310
				jQuery.data( elem, "_change_data", getVal(elem) );
2636
				jQuery.data( elem, "_change_data", getVal(elem) );
2311
			}
2637
			}
2312
		},
2638
		},
2313
 
2639
 
2314
		setup: function( data, namespaces ) {
2640
		setup: function( data, namespaces ) {
2315
			if ( this.type === "file" ) {
2641
			if ( this.type === "file" ) {
2316
				return false;
2642
				return false;
2317
			}
2643
			}
2318
 
2644
 
2319
			for ( var type in changeFilters ) {
2645
			for ( var type in changeFilters ) {
2320
				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
2646
				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
2321
			}
2647
			}
2322
 
2648
 
2323
			return formElems.test( this.nodeName );
2649
			return rformElems.test( this.nodeName );
2324
		},
2650
		},
2325
 
2651
 
2326
		teardown: function( namespaces ) {
2652
		teardown: function( namespaces ) {
2327
			jQuery.event.remove( this, ".specialChange" );
2653
			jQuery.event.remove( this, ".specialChange" );
2328
 
2654
 
2329
			return formElems.test( this.nodeName );
2655
			return rformElems.test( this.nodeName );
2330
		}
2656
		}
2331
	};
2657
	};
2332
 
2658
 
2333
	changeFilters = jQuery.event.special.change.filters;
2659
	changeFilters = jQuery.event.special.change.filters;
-
 
2660
 
-
 
2661
	// Handle when the input is .focus()'d
-
 
2662
	changeFilters.focus = changeFilters.beforeactivate;
2334
}
2663
}
2335
 
2664
 
2336
function trigger( type, elem, args ) {
2665
function trigger( type, elem, args ) {
2337
	args[0].type = type;
2666
	args[0].type = type;
2338
	return jQuery.event.handle.apply( elem, args );
2667
	return jQuery.event.handle.apply( elem, args );
2339
}
2668
}
2340
 
2669
 
2341
// Create "bubbling" focus and blur events
2670
// Create "bubbling" focus and blur events
2342
if ( document.addEventListener ) {
2671
if ( document.addEventListener ) {
2343
	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
2672
	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
2344
		jQuery.event.special[ fix ] = {
2673
		jQuery.event.special[ fix ] = {
2345
			setup: function() {
2674
			setup: function() {
-
 
2675
				if ( focusCounts[fix]++ === 0 ) {
2346
				this.addEventListener( orig, handler, true );
2676
					document.addEventListener( orig, handler, true );
-
 
2677
				}
2347
			}, 
2678
			}, 
2348
			teardown: function() { 
2679
			teardown: function() { 
-
 
2680
				if ( --focusCounts[fix] === 0 ) {
2349
				this.removeEventListener( orig, handler, true );
2681
					document.removeEventListener( orig, handler, true );
-
 
2682
				}
2350
			}
2683
			}
2351
		};
2684
		};
2352
 
2685
 
2353
		function handler( e ) { 
2686
		function handler( e ) { 
2354
			e = jQuery.event.fix( e );
2687
			e = jQuery.event.fix( e );
2355
			e.type = fix;
2688
			e.type = fix;
2356
			return jQuery.event.handle.call( this, e );
2689
			return jQuery.event.trigger( e, null, e.target );
2357
		}
2690
		}
2358
	});
2691
	});
2359
}
2692
}
2360
 
2693
 
2361
jQuery.each(["bind", "one"], function( i, name ) {
2694
jQuery.each(["bind", "one"], function( i, name ) {
2362
	jQuery.fn[ name ] = function( type, data, fn ) {
2695
	jQuery.fn[ name ] = function( type, data, fn ) {
2363
		// Handle object literals
2696
		// Handle object literals
2364
		if ( typeof type === "object" ) {
2697
		if ( typeof type === "object" ) {
2365
			for ( var key in type ) {
2698
			for ( var key in type ) {
2366
				this[ name ](key, data, type[key], fn);
2699
				this[ name ](key, data, type[key], fn);
2367
			}
2700
			}
2368
			return this;
2701
			return this;
2369
		}
2702
		}
2370
		
2703
		
2371
		if ( jQuery.isFunction( data ) ) {
2704
		if ( jQuery.isFunction( data ) || data === false ) {
2372
			fn = data;
2705
			fn = data;
2373
			data = undefined;
2706
			data = undefined;
2374
		}
2707
		}
2375
 
2708
 
2376
		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
2709
		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
2377
			jQuery( this ).unbind( event, handler );
2710
			jQuery( this ).unbind( event, handler );
2378
			return fn.apply( this, arguments );
2711
			return fn.apply( this, arguments );
2379
		}) : fn;
2712
		}) : fn;
2380
 
2713
 
2381
		if ( type === "unload" && name !== "one" ) {
2714
		if ( type === "unload" && name !== "one" ) {
2382
			this.one( type, data, fn );
2715
			this.one( type, data, fn );
2383
 
2716
 
2384
		} else {
2717
		} else {
2385
			for ( var i = 0, l = this.length; i < l; i++ ) {
2718
			for ( var i = 0, l = this.length; i < l; i++ ) {
2386
				jQuery.event.add( this[i], type, handler, data );
2719
				jQuery.event.add( this[i], type, handler, data );
2387
			}
2720
			}
2388
		}
2721
		}
2389
 
2722
 
2390
		return this;
2723
		return this;
2391
	};
2724
	};
2392
});
2725
});
2393
 
2726
 
2394
jQuery.fn.extend({
2727
jQuery.fn.extend({
2395
	unbind: function( type, fn ) {
2728
	unbind: function( type, fn ) {
2396
		// Handle object literals
2729
		// Handle object literals
2397
		if ( typeof type === "object" && !type.preventDefault ) {
2730
		if ( typeof type === "object" && !type.preventDefault ) {
2398
			for ( var key in type ) {
2731
			for ( var key in type ) {
2399
				this.unbind(key, type[key]);
2732
				this.unbind(key, type[key]);
2400
			}
2733
			}
2401
 
2734
 
2402
		} else {
2735
		} else {
2403
			for ( var i = 0, l = this.length; i < l; i++ ) {
2736
			for ( var i = 0, l = this.length; i < l; i++ ) {
2404
				jQuery.event.remove( this[i], type, fn );
2737
				jQuery.event.remove( this[i], type, fn );
2405
			}
2738
			}
2406
		}
2739
		}
2407
 
2740
 
2408
		return this;
2741
		return this;
2409
	},
2742
	},
2410
	
2743
	
2411
	delegate: function( selector, types, data, fn ) {
2744
	delegate: function( selector, types, data, fn ) {
2412
		return this.live( types, data, fn, selector );
2745
		return this.live( types, data, fn, selector );
2413
	},
2746
	},
2414
	
2747
	
2415
	undelegate: function( selector, types, fn ) {
2748
	undelegate: function( selector, types, fn ) {
2416
		if ( arguments.length === 0 ) {
2749
		if ( arguments.length === 0 ) {
2417
				return this.unbind( "live" );
2750
				return this.unbind( "live" );
2418
		
2751
		
2419
		} else {
2752
		} else {
2420
			return this.die( types, null, fn, selector );
2753
			return this.die( types, null, fn, selector );
2421
		}
2754
		}
2422
	},
2755
	},
2423
	
2756
	
2424
	trigger: function( type, data ) {
2757
	trigger: function( type, data ) {
2425
		return this.each(function() {
2758
		return this.each(function() {
2426
			jQuery.event.trigger( type, data, this );
2759
			jQuery.event.trigger( type, data, this );
2427
		});
2760
		});
2428
	},
2761
	},
2429
 
2762
 
2430
	triggerHandler: function( type, data ) {
2763
	triggerHandler: function( type, data ) {
2431
		if ( this[0] ) {
2764
		if ( this[0] ) {
2432
			var event = jQuery.Event( type );
2765
			var event = jQuery.Event( type );
2433
			event.preventDefault();
2766
			event.preventDefault();
2434
			event.stopPropagation();
2767
			event.stopPropagation();
2435
			jQuery.event.trigger( event, data, this[0] );
2768
			jQuery.event.trigger( event, data, this[0] );
2436
			return event.result;
2769
			return event.result;
2437
		}
2770
		}
2438
	},
2771
	},
2439
 
2772
 
2440
	toggle: function( fn ) {
2773
	toggle: function( fn ) {
2441
		// Save reference to arguments for access in closure
2774
		// Save reference to arguments for access in closure
2442
		var args = arguments, i = 1;
2775
		var args = arguments,
-
 
2776
			i = 1;
2443
 
2777
 
2444
		// link all the functions, so any of them can unbind this click handler
2778
		// link all the functions, so any of them can unbind this click handler
2445
		while ( i < args.length ) {
2779
		while ( i < args.length ) {
2446
			jQuery.proxy( fn, args[ i++ ] );
2780
			jQuery.proxy( fn, args[ i++ ] );
2447
		}
2781
		}
2448
 
2782
 
2449
		return this.click( jQuery.proxy( fn, function( event ) {
2783
		return this.click( jQuery.proxy( fn, function( event ) {
2450
			// Figure out which function to execute
2784
			// Figure out which function to execute
2451
			var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
2785
			var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
2452
			jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
2786
			jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
2453
 
2787
 
2454
			// Make sure that clicks stop
2788
			// Make sure that clicks stop
2455
			event.preventDefault();
2789
			event.preventDefault();
2456
 
2790
 
2457
			// and execute the function
2791
			// and execute the function
2458
			return args[ lastToggle ].apply( this, arguments ) || false;
2792
			return args[ lastToggle ].apply( this, arguments ) || false;
2459
		}));
2793
		}));
2460
	},
2794
	},
2461
 
2795
 
2462
	hover: function( fnOver, fnOut ) {
2796
	hover: function( fnOver, fnOut ) {
2463
		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
2797
		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
2464
	}
2798
	}
2465
});
2799
});
2466
 
2800
 
2467
var liveMap = {
2801
var liveMap = {
2468
	focus: "focusin",
2802
	focus: "focusin",
2469
	blur: "focusout",
2803
	blur: "focusout",
2470
	mouseenter: "mouseover",
2804
	mouseenter: "mouseover",
2471
	mouseleave: "mouseout"
2805
	mouseleave: "mouseout"
2472
};
2806
};
2473
 
2807
 
2474
jQuery.each(["live", "die"], function( i, name ) {
2808
jQuery.each(["live", "die"], function( i, name ) {
2475
	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
2809
	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
2476
		var type, i = 0, match, namespaces, preType,
2810
		var type, i = 0, match, namespaces, preType,
2477
			selector = origSelector || this.selector,
2811
			selector = origSelector || this.selector,
2478
			context = origSelector ? this : jQuery( this.context );
2812
			context = origSelector ? this : jQuery( this.context );
-
 
2813
		
-
 
2814
		if ( typeof types === "object" && !types.preventDefault ) {
-
 
2815
			for ( var key in types ) {
-
 
2816
				context[ name ]( key, data, types[key], selector );
-
 
2817
			}
-
 
2818
			
-
 
2819
			return this;
-
 
2820
		}
2479
 
2821
 
2480
		if ( jQuery.isFunction( data ) ) {
2822
		if ( jQuery.isFunction( data ) ) {
2481
			fn = data;
2823
			fn = data;
2482
			data = undefined;
2824
			data = undefined;
2483
		}
2825
		}
2484
 
2826
 
2485
		types = (types || "").split(" ");
2827
		types = (types || "").split(" ");
2486
 
2828
 
2487
		while ( (type = types[ i++ ]) != null ) {
2829
		while ( (type = types[ i++ ]) != null ) {
2488
			match = rnamespaces.exec( type );
2830
			match = rnamespaces.exec( type );
2489
			namespaces = "";
2831
			namespaces = "";
2490
 
2832
 
2491
			if ( match )  {
2833
			if ( match )  {
2492
				namespaces = match[0];
2834
				namespaces = match[0];
2493
				type = type.replace( rnamespaces, "" );
2835
				type = type.replace( rnamespaces, "" );
2494
			}
2836
			}
2495
 
2837
 
2496
			if ( type === "hover" ) {
2838
			if ( type === "hover" ) {
2497
				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
2839
				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
2498
				continue;
2840
				continue;
2499
			}
2841
			}
2500
 
2842
 
2501
			preType = type;
2843
			preType = type;
2502
 
2844
 
2503
			if ( type === "focus" || type === "blur" ) {
2845
			if ( type === "focus" || type === "blur" ) {
2504
				types.push( liveMap[ type ] + namespaces );
2846
				types.push( liveMap[ type ] + namespaces );
2505
				type = type + namespaces;
2847
				type = type + namespaces;
2506
 
2848
 
2507
			} else {
2849
			} else {
2508
				type = (liveMap[ type ] || type) + namespaces;
2850
				type = (liveMap[ type ] || type) + namespaces;
2509
			}
2851
			}
2510
 
2852
 
2511
			if ( name === "live" ) {
2853
			if ( name === "live" ) {
2512
				// bind live handler
2854
				// bind live handler
2513
				context.each(function(){
2855
				for ( var j = 0, l = context.length; j < l; j++ ) {
2514
					jQuery.event.add( this, liveConvert( type, selector ),
2856
					jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
2515
						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
2857
						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
2516
				});
2858
				}
2517
 
2859
 
2518
			} else {
2860
			} else {
2519
				// unbind live handler
2861
				// unbind live handler
2520
				context.unbind( liveConvert( type, selector ), fn );
2862
				context.unbind( "live." + liveConvert( type, selector ), fn );
2521
			}
2863
			}
2522
		}
2864
		}
2523
		
2865
		
2524
		return this;
2866
		return this;
2525
	}
2867
	};
2526
});
2868
});
2527
 
2869
 
2528
function liveHandler( event ) {
2870
function liveHandler( event ) {
2529
	var stop, elems = [], selectors = [], args = arguments,
2871
	var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
-
 
2872
		elems = [],
-
 
2873
		selectors = [],
2530
		related, match, handleObj, elem, j, i, l, data,
2874
		events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
-
 
2875
 
-
 
2876
	if ( typeof events === "function" ) {
2531
		events = jQuery.data( this, "events" );
2877
		events = events.events;
-
 
2878
	}
2532
 
2879
 
2533
	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
2880
	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
2534
	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
2881
	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
2535
		return;
2882
		return;
2536
	}
2883
	}
-
 
2884
	
-
 
2885
	if ( event.namespace ) {
-
 
2886
		namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
-
 
2887
	}
2537
 
2888
 
2538
	event.liveFired = this;
2889
	event.liveFired = this;
2539
 
2890
 
2540
	var live = events.live.slice(0);
2891
	var live = events.live.slice(0);
2541
 
2892
 
2542
	for ( j = 0; j < live.length; j++ ) {
2893
	for ( j = 0; j < live.length; j++ ) {
2543
		handleObj = live[j];
2894
		handleObj = live[j];
2544
 
2895
 
2545
		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
2896
		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
2546
			selectors.push( handleObj.selector );
2897
			selectors.push( handleObj.selector );
2547
 
2898
 
2548
		} else {
2899
		} else {
2549
			live.splice( j--, 1 );
2900
			live.splice( j--, 1 );
2550
		}
2901
		}
2551
	}
2902
	}
2552
 
2903
 
2553
	match = jQuery( event.target ).closest( selectors, event.currentTarget );
2904
	match = jQuery( event.target ).closest( selectors, event.currentTarget );
2554
 
2905
 
2555
	for ( i = 0, l = match.length; i < l; i++ ) {
2906
	for ( i = 0, l = match.length; i < l; i++ ) {
-
 
2907
		close = match[i];
-
 
2908
 
2556
		for ( j = 0; j < live.length; j++ ) {
2909
		for ( j = 0; j < live.length; j++ ) {
2557
			handleObj = live[j];
2910
			handleObj = live[j];
2558
 
2911
 
2559
			if ( match[i].selector === handleObj.selector ) {
2912
			if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
2560
				elem = match[i].elem;
2913
				elem = close.elem;
2561
				related = null;
2914
				related = null;
2562
 
2915
 
2563
				// Those two events require additional checking
2916
				// Those two events require additional checking
2564
				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
2917
				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
-
 
2918
					event.type = handleObj.preType;
2565
					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
2919
					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
2566
				}
2920
				}
2567
 
2921
 
2568
				if ( !related || related !== elem ) {
2922
				if ( !related || related !== elem ) {
2569
					elems.push({ elem: elem, handleObj: handleObj });
2923
					elems.push({ elem: elem, handleObj: handleObj, level: close.level });
2570
				}
2924
				}
2571
			}
2925
			}
2572
		}
2926
		}
2573
	}
2927
	}
2574
 
2928
 
2575
	for ( i = 0, l = elems.length; i < l; i++ ) {
2929
	for ( i = 0, l = elems.length; i < l; i++ ) {
2576
		match = elems[i];
2930
		match = elems[i];
-
 
2931
 
-
 
2932
		if ( maxLevel && match.level > maxLevel ) {
-
 
2933
			break;
-
 
2934
		}
-
 
2935
 
2577
		event.currentTarget = match.elem;
2936
		event.currentTarget = match.elem;
2578
		event.data = match.handleObj.data;
2937
		event.data = match.handleObj.data;
2579
		event.handleObj = match.handleObj;
2938
		event.handleObj = match.handleObj;
2580
 
2939
 
-
 
2940
		ret = match.handleObj.origHandler.apply( match.elem, arguments );
-
 
2941
 
-
 
2942
		if ( ret === false || event.isPropagationStopped() ) {
-
 
2943
			maxLevel = match.level;
-
 
2944
 
2581
		if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
2945
			if ( ret === false ) {
-
 
2946
				stop = false;
-
 
2947
			}
2582
			stop = false;
2948
			if ( event.isImmediatePropagationStopped() ) {
2583
			break;
2949
				break;
2584
		}
2950
			}
2585
	}
2951
		}
-
 
2952
	}
2586
 
2953
 
2587
	return stop;
2954
	return stop;
2588
}
2955
}
2589
 
2956
 
2590
function liveConvert( type, selector ) {
2957
function liveConvert( type, selector ) {
2591
	return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
2958
	return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
2592
}
2959
}
2593
 
2960
 
2594
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
2961
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
2595
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
2962
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
2596
	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
2963
	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
2597
 
2964
 
2598
	// Handle event binding
2965
	// Handle event binding
2599
	jQuery.fn[ name ] = function( fn ) {
2966
	jQuery.fn[ name ] = function( data, fn ) {
-
 
2967
		if ( fn == null ) {
-
 
2968
			fn = data;
-
 
2969
			data = null;
-
 
2970
		}
-
 
2971
 
-
 
2972
		return arguments.length > 0 ?
2600
		return fn ? this.bind( name, fn ) : this.trigger( name );
2973
			this.bind( name, data, fn ) :
-
 
2974
			this.trigger( name );
2601
	};
2975
	};
2602
 
2976
 
2603
	if ( jQuery.attrFn ) {
2977
	if ( jQuery.attrFn ) {
2604
		jQuery.attrFn[ name ] = true;
2978
		jQuery.attrFn[ name ] = true;
2605
	}
2979
	}
2606
});
2980
});
2607
 
2981
 
2608
// Prevent memory leaks in IE
2982
// Prevent memory leaks in IE
2609
// Window isn't included so as not to unbind existing unload events
2983
// Window isn't included so as not to unbind existing unload events
2610
// More info:
2984
// More info:
2611
//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
2985
//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
2612
if ( window.attachEvent && !window.addEventListener ) {
2986
if ( window.attachEvent && !window.addEventListener ) {
2613
	window.attachEvent("onunload", function() {
2987
	jQuery(window).bind("unload", function() {
2614
		for ( var id in jQuery.cache ) {
2988
		for ( var id in jQuery.cache ) {
2615
			if ( jQuery.cache[ id ].handle ) {
2989
			if ( jQuery.cache[ id ].handle ) {
2616
				// Try/Catch is to handle iframes being unloaded, see #4280
2990
				// Try/Catch is to handle iframes being unloaded, see #4280
2617
				try {
2991
				try {
2618
					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2992
					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2619
				} catch(e) {}
2993
				} catch(e) {}
2620
			}
2994
			}
2621
		}
2995
		}
2622
	});
2996
	});
2623
}
2997
}
-
 
2998
 
-
 
2999
 
2624
/*!
3000
/*!
2625
 * Sizzle CSS Selector Engine - v1.0
3001
 * Sizzle CSS Selector Engine - v1.0
2626
 *  Copyright 2009, The Dojo Foundation
3002
 *  Copyright 2009, The Dojo Foundation
2627
 *  Released under the MIT, BSD, and GPL Licenses.
3003
 *  Released under the MIT, BSD, and GPL Licenses.
2628
 *  More information: http://sizzlejs.com/
3004
 *  More information: http://sizzlejs.com/
2629
 */
3005
 */
2630
(function(){
3006
(function(){
2631
 
3007
 
2632
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3008
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
2633
	done = 0,
3009
	done = 0,
2634
	toString = Object.prototype.toString,
3010
	toString = Object.prototype.toString,
2635
	hasDuplicate = false,
3011
	hasDuplicate = false,
2636
	baseHasDuplicate = true;
3012
	baseHasDuplicate = true;
2637
 
3013
 
2638
// Here we check if the JavaScript engine is using some sort of
3014
// Here we check if the JavaScript engine is using some sort of
2639
// optimization where it does not always call our comparision
3015
// optimization where it does not always call our comparision
2640
// function. If that is the case, discard the hasDuplicate value.
3016
// function. If that is the case, discard the hasDuplicate value.
2641
//   Thus far that includes Google Chrome.
3017
//   Thus far that includes Google Chrome.
2642
[0, 0].sort(function(){
3018
[0, 0].sort(function() {
2643
	baseHasDuplicate = false;
3019
	baseHasDuplicate = false;
2644
	return 0;
3020
	return 0;
2645
});
3021
});
2646
 
3022
 
2647
var Sizzle = function(selector, context, results, seed) {
3023
var Sizzle = function( selector, context, results, seed ) {
2648
	results = results || [];
3024
	results = results || [];
2649
	var origContext = context = context || document;
3025
	context = context || document;
-
 
3026
 
-
 
3027
	var origContext = context;
2650
 
3028
 
2651
	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3029
	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
2652
		return [];
3030
		return [];
2653
	}
3031
	}
2654
	
3032
	
2655
	if ( !selector || typeof selector !== "string" ) {
3033
	if ( !selector || typeof selector !== "string" ) {
2656
		return results;
3034
		return results;
2657
	}
3035
	}
2658
 
3036
 
-
 
3037
	var m, set, checkSet, extra, ret, cur, pop, i,
-
 
3038
		prune = true,
-
 
3039
		contextXML = Sizzle.isXML( context ),
2659
	var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
3040
		parts = [],
2660
		soFar = selector;
3041
		soFar = selector;
2661
	
3042
	
2662
	// Reset the position of the chunker regexp (start from head)
3043
	// Reset the position of the chunker regexp (start from head)
-
 
3044
	do {
-
 
3045
		chunker.exec( "" );
2663
	while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
3046
		m = chunker.exec( soFar );
-
 
3047
 
-
 
3048
		if ( m ) {
2664
		soFar = m[3];
3049
			soFar = m[3];
2665
		
3050
		
2666
		parts.push( m[1] );
3051
			parts.push( m[1] );
2667
		
3052
		
2668
		if ( m[2] ) {
3053
			if ( m[2] ) {
2669
			extra = m[3];
3054
				extra = m[3];
2670
			break;
3055
				break;
2671
		}
3056
			}
2672
	}
3057
		}
-
 
3058
	} while ( m );
2673
 
3059
 
-
 
3060
	if ( parts.length > 1 && origPOS.exec( selector ) ) {
2674
	if ( parts.length > 1 && origPOS.exec( selector ) ) {
3061
 
2675
		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
3062
		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-
 
3063
			set = posProcess( parts[0] + parts[1], context );
2676
			set = posProcess( parts[0] + parts[1], context );
3064
 
2677
		} else {
3065
		} else {
2678
			set = Expr.relative[ parts[0] ] ?
3066
			set = Expr.relative[ parts[0] ] ?
2679
				[ context ] :
3067
				[ context ] :
2680
				Sizzle( parts.shift(), context );
3068
				Sizzle( parts.shift(), context );
2681
 
3069
 
2682
			while ( parts.length ) {
3070
			while ( parts.length ) {
2683
				selector = parts.shift();
3071
				selector = parts.shift();
2684
 
3072
 
2685
				if ( Expr.relative[ selector ] ) {
3073
				if ( Expr.relative[ selector ] ) {
2686
					selector += parts.shift();
3074
					selector += parts.shift();
2687
				}
3075
				}
2688
				
3076
				
2689
				set = posProcess( selector, set );
3077
				set = posProcess( selector, set );
2690
			}
3078
			}
2691
		}
3079
		}
-
 
3080
 
2692
	} else {
3081
	} else {
2693
		// Take a shortcut and set the context if the root selector is an ID
3082
		// Take a shortcut and set the context if the root selector is an ID
2694
		// (but not if it'll be faster if the inner selector is an ID)
3083
		// (but not if it'll be faster if the inner selector is an ID)
2695
		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
3084
		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
2696
				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
3085
				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
 
3086
 
2697
			var ret = Sizzle.find( parts.shift(), context, contextXML );
3087
			ret = Sizzle.find( parts.shift(), context, contextXML );
-
 
3088
			context = ret.expr ?
2698
			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
3089
				Sizzle.filter( ret.expr, ret.set )[0] :
-
 
3090
				ret.set[0];
2699
		}
3091
		}
2700
 
3092
 
2701
		if ( context ) {
3093
		if ( context ) {
2702
			var ret = seed ?
3094
			ret = seed ?
2703
				{ expr: parts.pop(), set: makeArray(seed) } :
3095
				{ expr: parts.pop(), set: makeArray(seed) } :
2704
				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
3096
				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
 
3097
 
-
 
3098
			set = ret.expr ?
2705
			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
3099
				Sizzle.filter( ret.expr, ret.set ) :
-
 
3100
				ret.set;
2706
 
3101
 
2707
			if ( parts.length > 0 ) {
3102
			if ( parts.length > 0 ) {
2708
				checkSet = makeArray(set);
3103
				checkSet = makeArray( set );
-
 
3104
 
2709
			} else {
3105
			} else {
2710
				prune = false;
3106
				prune = false;
2711
			}
3107
			}
2712
 
3108
 
2713
			while ( parts.length ) {
3109
			while ( parts.length ) {
2714
				var cur = parts.pop(), pop = cur;
3110
				cur = parts.pop();
-
 
3111
				pop = cur;
2715
 
3112
 
2716
				if ( !Expr.relative[ cur ] ) {
3113
				if ( !Expr.relative[ cur ] ) {
2717
					cur = "";
3114
					cur = "";
2718
				} else {
3115
				} else {
2719
					pop = parts.pop();
3116
					pop = parts.pop();
2720
				}
3117
				}
2721
 
3118
 
2722
				if ( pop == null ) {
3119
				if ( pop == null ) {
2723
					pop = context;
3120
					pop = context;
2724
				}
3121
				}
2725
 
3122
 
2726
				Expr.relative[ cur ]( checkSet, pop, contextXML );
3123
				Expr.relative[ cur ]( checkSet, pop, contextXML );
2727
			}
3124
			}
-
 
3125
 
2728
		} else {
3126
		} else {
2729
			checkSet = parts = [];
3127
			checkSet = parts = [];
2730
		}
3128
		}
2731
	}
3129
	}
2732
 
3130
 
2733
	if ( !checkSet ) {
3131
	if ( !checkSet ) {
2734
		checkSet = set;
3132
		checkSet = set;
2735
	}
3133
	}
2736
 
3134
 
2737
	if ( !checkSet ) {
3135
	if ( !checkSet ) {
2738
		Sizzle.error( cur || selector );
3136
		Sizzle.error( cur || selector );
2739
	}
3137
	}
2740
 
3138
 
2741
	if ( toString.call(checkSet) === "[object Array]" ) {
3139
	if ( toString.call(checkSet) === "[object Array]" ) {
2742
		if ( !prune ) {
3140
		if ( !prune ) {
2743
			results.push.apply( results, checkSet );
3141
			results.push.apply( results, checkSet );
-
 
3142
 
2744
		} else if ( context && context.nodeType === 1 ) {
3143
		} else if ( context && context.nodeType === 1 ) {
2745
			for ( var i = 0; checkSet[i] != null; i++ ) {
3144
			for ( i = 0; checkSet[i] != null; i++ ) {
2746
				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
3145
				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
2747
					results.push( set[i] );
3146
					results.push( set[i] );
2748
				}
3147
				}
2749
			}
3148
			}
-
 
3149
 
2750
		} else {
3150
		} else {
2751
			for ( var i = 0; checkSet[i] != null; i++ ) {
3151
			for ( i = 0; checkSet[i] != null; i++ ) {
2752
				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
3152
				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
2753
					results.push( set[i] );
3153
					results.push( set[i] );
2754
				}
3154
				}
2755
			}
3155
			}
2756
		}
3156
		}
-
 
3157
 
2757
	} else {
3158
	} else {
2758
		makeArray( checkSet, results );
3159
		makeArray( checkSet, results );
2759
	}
3160
	}
2760
 
3161
 
2761
	if ( extra ) {
3162
	if ( extra ) {
2762
		Sizzle( extra, origContext, results, seed );
3163
		Sizzle( extra, origContext, results, seed );
2763
		Sizzle.uniqueSort( results );
3164
		Sizzle.uniqueSort( results );
2764
	}
3165
	}
2765
 
3166
 
2766
	return results;
3167
	return results;
2767
};
3168
};
2768
 
3169
 
2769
Sizzle.uniqueSort = function(results){
3170
Sizzle.uniqueSort = function( results ) {
2770
	if ( sortOrder ) {
3171
	if ( sortOrder ) {
2771
		hasDuplicate = baseHasDuplicate;
3172
		hasDuplicate = baseHasDuplicate;
2772
		results.sort(sortOrder);
3173
		results.sort( sortOrder );
2773
 
3174
 
2774
		if ( hasDuplicate ) {
3175
		if ( hasDuplicate ) {
2775
			for ( var i = 1; i < results.length; i++ ) {
3176
			for ( var i = 1; i < results.length; i++ ) {
2776
				if ( results[i] === results[i-1] ) {
3177
				if ( results[i] === results[ i - 1 ] ) {
2777
					results.splice(i--, 1);
3178
					results.splice( i--, 1 );
2778
				}
3179
				}
2779
			}
3180
			}
2780
		}
3181
		}
2781
	}
3182
	}
2782
 
3183
 
2783
	return results;
3184
	return results;
2784
};
3185
};
2785
 
3186
 
2786
Sizzle.matches = function(expr, set){
3187
Sizzle.matches = function( expr, set ) {
2787
	return Sizzle(expr, null, null, set);
3188
	return Sizzle( expr, null, null, set );
2788
};
3189
};
-
 
3190
 
-
 
3191
Sizzle.matchesSelector = function( node, expr ) {
-
 
3192
	return Sizzle( expr, null, null, [node] ).length > 0;
-
 
3193
};
2789
 
3194
 
2790
Sizzle.find = function(expr, context, isXML){
3195
Sizzle.find = function( expr, context, isXML ) {
2791
	var set, match;
3196
	var set;
2792
 
3197
 
2793
	if ( !expr ) {
3198
	if ( !expr ) {
2794
		return [];
3199
		return [];
2795
	}
3200
	}
2796
 
3201
 
2797
	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
3202
	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-
 
3203
		var match,
2798
		var type = Expr.order[i], match;
3204
			type = Expr.order[i];
2799
		
3205
		
2800
		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
3206
		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
2801
			var left = match[1];
3207
			var left = match[1];
2802
			match.splice(1,1);
3208
			match.splice( 1, 1 );
2803
 
3209
 
2804
			if ( left.substr( left.length - 1 ) !== "\\" ) {
3210
			if ( left.substr( left.length - 1 ) !== "\\" ) {
2805
				match[1] = (match[1] || "").replace(/\\/g, "");
3211
				match[1] = (match[1] || "").replace(/\\/g, "");
2806
				set = Expr.find[ type ]( match, context, isXML );
3212
				set = Expr.find[ type ]( match, context, isXML );
-
 
3213
 
2807
				if ( set != null ) {
3214
				if ( set != null ) {
2808
					expr = expr.replace( Expr.match[ type ], "" );
3215
					expr = expr.replace( Expr.match[ type ], "" );
2809
					break;
3216
					break;
2810
				}
3217
				}
2811
			}
3218
			}
2812
		}
3219
		}
2813
	}
3220
	}
2814
 
3221
 
2815
	if ( !set ) {
3222
	if ( !set ) {
2816
		set = context.getElementsByTagName("*");
3223
		set = context.getElementsByTagName( "*" );
2817
	}
3224
	}
2818
 
3225
 
2819
	return {set: set, expr: expr};
3226
	return { set: set, expr: expr };
2820
};
3227
};
2821
 
3228
 
2822
Sizzle.filter = function(expr, set, inplace, not){
3229
Sizzle.filter = function( expr, set, inplace, not ) {
2823
	var old = expr, result = [], curLoop = set, match, anyFound,
3230
	var match, anyFound,
-
 
3231
		old = expr,
-
 
3232
		result = [],
-
 
3233
		curLoop = set,
2824
		isXMLFilter = set && set[0] && isXML(set[0]);
3234
		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
2825
 
3235
 
2826
	while ( expr && set.length ) {
3236
	while ( expr && set.length ) {
2827
		for ( var type in Expr.filter ) {
3237
		for ( var type in Expr.filter ) {
2828
			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
3238
			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-
 
3239
				var found, item,
2829
				var filter = Expr.filter[ type ], found, item, left = match[1];
3240
					filter = Expr.filter[ type ],
-
 
3241
					left = match[1];
-
 
3242
 
2830
				anyFound = false;
3243
				anyFound = false;
2831
 
3244
 
2832
				match.splice(1,1);
3245
				match.splice(1,1);
2833
 
3246
 
2834
				if ( left.substr( left.length - 1 ) === "\\" ) {
3247
				if ( left.substr( left.length - 1 ) === "\\" ) {
2835
					continue;
3248
					continue;
2836
				}
3249
				}
2837
 
3250
 
2838
				if ( curLoop === result ) {
3251
				if ( curLoop === result ) {
2839
					result = [];
3252
					result = [];
2840
				}
3253
				}
2841
 
3254
 
2842
				if ( Expr.preFilter[ type ] ) {
3255
				if ( Expr.preFilter[ type ] ) {
2843
					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
3256
					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
2844
 
3257
 
2845
					if ( !match ) {
3258
					if ( !match ) {
2846
						anyFound = found = true;
3259
						anyFound = found = true;
-
 
3260
 
2847
					} else if ( match === true ) {
3261
					} else if ( match === true ) {
2848
						continue;
3262
						continue;
2849
					}
3263
					}
2850
				}
3264
				}
2851
 
3265
 
2852
				if ( match ) {
3266
				if ( match ) {
2853
					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
3267
					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
2854
						if ( item ) {
3268
						if ( item ) {
2855
							found = filter( item, match, i, curLoop );
3269
							found = filter( item, match, i, curLoop );
2856
							var pass = not ^ !!found;
3270
							var pass = not ^ !!found;
2857
 
3271
 
2858
							if ( inplace && found != null ) {
3272
							if ( inplace && found != null ) {
2859
								if ( pass ) {
3273
								if ( pass ) {
2860
									anyFound = true;
3274
									anyFound = true;
-
 
3275
 
2861
								} else {
3276
								} else {
2862
									curLoop[i] = false;
3277
									curLoop[i] = false;
2863
								}
3278
								}
-
 
3279
 
2864
							} else if ( pass ) {
3280
							} else if ( pass ) {
2865
								result.push( item );
3281
								result.push( item );
2866
								anyFound = true;
3282
								anyFound = true;
2867
							}
3283
							}
2868
						}
3284
						}
2869
					}
3285
					}
2870
				}
3286
				}
2871
 
3287
 
2872
				if ( found !== undefined ) {
3288
				if ( found !== undefined ) {
2873
					if ( !inplace ) {
3289
					if ( !inplace ) {
2874
						curLoop = result;
3290
						curLoop = result;
2875
					}
3291
					}
2876
 
3292
 
2877
					expr = expr.replace( Expr.match[ type ], "" );
3293
					expr = expr.replace( Expr.match[ type ], "" );
2878
 
3294
 
2879
					if ( !anyFound ) {
3295
					if ( !anyFound ) {
2880
						return [];
3296
						return [];
2881
					}
3297
					}
2882
 
3298
 
2883
					break;
3299
					break;
2884
				}
3300
				}
2885
			}
3301
			}
2886
		}
3302
		}
2887
 
3303
 
2888
		// Improper expression
3304
		// Improper expression
2889
		if ( expr === old ) {
3305
		if ( expr === old ) {
2890
			if ( anyFound == null ) {
3306
			if ( anyFound == null ) {
2891
				Sizzle.error( expr );
3307
				Sizzle.error( expr );
-
 
3308
 
2892
			} else {
3309
			} else {
2893
				break;
3310
				break;
2894
			}
3311
			}
2895
		}
3312
		}
2896
 
3313
 
2897
		old = expr;
3314
		old = expr;
2898
	}
3315
	}
2899
 
3316
 
2900
	return curLoop;
3317
	return curLoop;
2901
};
3318
};
2902
 
3319
 
2903
Sizzle.error = function( msg ) {
3320
Sizzle.error = function( msg ) {
2904
	throw "Syntax error, unrecognized expression: " + msg;
3321
	throw "Syntax error, unrecognized expression: " + msg;
2905
};
3322
};
2906
 
3323
 
2907
var Expr = Sizzle.selectors = {
3324
var Expr = Sizzle.selectors = {
2908
	order: [ "ID", "NAME", "TAG" ],
3325
	order: [ "ID", "NAME", "TAG" ],
-
 
3326
 
2909
	match: {
3327
	match: {
2910
		ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
3328
		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
2911
		CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
3329
		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
2912
		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
3330
		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
2913
		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
3331
		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
2914
		TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
3332
		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
2915
		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
3333
		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
2916
		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
3334
		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
2917
		PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
3335
		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
2918
	},
3336
	},
-
 
3337
 
2919
	leftMatch: {},
3338
	leftMatch: {},
-
 
3339
 
2920
	attrMap: {
3340
	attrMap: {
2921
		"class": "className",
3341
		"class": "className",
2922
		"for": "htmlFor"
3342
		"for": "htmlFor"
2923
	},
3343
	},
-
 
3344
 
2924
	attrHandle: {
3345
	attrHandle: {
2925
		href: function(elem){
3346
		href: function( elem ) {
2926
			return elem.getAttribute("href");
3347
			return elem.getAttribute( "href" );
2927
		}
3348
		}
2928
	},
3349
	},
-
 
3350
 
2929
	relative: {
3351
	relative: {
2930
		"+": function(checkSet, part){
3352
		"+": function(checkSet, part){
2931
			var isPartStr = typeof part === "string",
3353
			var isPartStr = typeof part === "string",
2932
				isTag = isPartStr && !/\W/.test(part),
3354
				isTag = isPartStr && !/\W/.test( part ),
2933
				isPartStrNotTag = isPartStr && !isTag;
3355
				isPartStrNotTag = isPartStr && !isTag;
2934
 
3356
 
2935
			if ( isTag ) {
3357
			if ( isTag ) {
2936
				part = part.toLowerCase();
3358
				part = part.toLowerCase();
2937
			}
3359
			}
2938
 
3360
 
2939
			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
3361
			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
2940
				if ( (elem = checkSet[i]) ) {
3362
				if ( (elem = checkSet[i]) ) {
2941
					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
3363
					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
2942
 
3364
 
2943
					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
3365
					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
2944
						elem || false :
3366
						elem || false :
2945
						elem === part;
3367
						elem === part;
2946
				}
3368
				}
2947
			}
3369
			}
2948
 
3370
 
2949
			if ( isPartStrNotTag ) {
3371
			if ( isPartStrNotTag ) {
2950
				Sizzle.filter( part, checkSet, true );
3372
				Sizzle.filter( part, checkSet, true );
2951
			}
3373
			}
2952
		},
3374
		},
-
 
3375
 
2953
		">": function(checkSet, part){
3376
		">": function( checkSet, part ) {
-
 
3377
			var elem,
2954
			var isPartStr = typeof part === "string";
3378
				isPartStr = typeof part === "string",
-
 
3379
				i = 0,
-
 
3380
				l = checkSet.length;
2955
 
3381
 
2956
			if ( isPartStr && !/\W/.test(part) ) {
3382
			if ( isPartStr && !/\W/.test( part ) ) {
2957
				part = part.toLowerCase();
3383
				part = part.toLowerCase();
2958
 
3384
 
2959
				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3385
				for ( ; i < l; i++ ) {
-
 
3386
					elem = checkSet[i];
2960
					var elem = checkSet[i];
3387
 
2961
					if ( elem ) {
3388
					if ( elem ) {
2962
						var parent = elem.parentNode;
3389
						var parent = elem.parentNode;
2963
						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
3390
						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
2964
					}
3391
					}
2965
				}
3392
				}
-
 
3393
 
2966
			} else {
3394
			} else {
2967
				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3395
				for ( ; i < l; i++ ) {
2968
					var elem = checkSet[i];
3396
					elem = checkSet[i];
-
 
3397
 
2969
					if ( elem ) {
3398
					if ( elem ) {
2970
						checkSet[i] = isPartStr ?
3399
						checkSet[i] = isPartStr ?
2971
							elem.parentNode :
3400
							elem.parentNode :
2972
							elem.parentNode === part;
3401
							elem.parentNode === part;
2973
					}
3402
					}
2974
				}
3403
				}
2975
 
3404
 
2976
				if ( isPartStr ) {
3405
				if ( isPartStr ) {
2977
					Sizzle.filter( part, checkSet, true );
3406
					Sizzle.filter( part, checkSet, true );
2978
				}
3407
				}
2979
			}
3408
			}
2980
		},
3409
		},
-
 
3410
 
2981
		"": function(checkSet, part, isXML){
3411
		"": function(checkSet, part, isXML){
-
 
3412
			var nodeCheck,
-
 
3413
				doneName = done++,
2982
			var doneName = done++, checkFn = dirCheck;
3414
				checkFn = dirCheck;
2983
 
3415
 
2984
			if ( typeof part === "string" && !/\W/.test(part) ) {
3416
			if ( typeof part === "string" && !/\W/.test(part) ) {
-
 
3417
				part = part.toLowerCase();
2985
				var nodeCheck = part = part.toLowerCase();
3418
				nodeCheck = part;
2986
				checkFn = dirNodeCheck;
3419
				checkFn = dirNodeCheck;
2987
			}
3420
			}
2988
 
3421
 
2989
			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
3422
			checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
2990
		},
3423
		},
-
 
3424
 
2991
		"~": function(checkSet, part, isXML){
3425
		"~": function( checkSet, part, isXML ) {
-
 
3426
			var nodeCheck,
-
 
3427
				doneName = done++,
2992
			var doneName = done++, checkFn = dirCheck;
3428
				checkFn = dirCheck;
2993
 
3429
 
2994
			if ( typeof part === "string" && !/\W/.test(part) ) {
3430
			if ( typeof part === "string" && !/\W/.test( part ) ) {
-
 
3431
				part = part.toLowerCase();
2995
				var nodeCheck = part = part.toLowerCase();
3432
				nodeCheck = part;
2996
				checkFn = dirNodeCheck;
3433
				checkFn = dirNodeCheck;
2997
			}
3434
			}
2998
 
3435
 
2999
			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
3436
			checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
3000
		}
3437
		}
3001
	},
3438
	},
-
 
3439
 
3002
	find: {
3440
	find: {
3003
		ID: function(match, context, isXML){
3441
		ID: function( match, context, isXML ) {
3004
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
3442
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
3005
				var m = context.getElementById(match[1]);
3443
				var m = context.getElementById(match[1]);
-
 
3444
				// Check parentNode to catch when Blackberry 4.6 returns
-
 
3445
				// nodes that are no longer in the document #6963
3006
				return m ? [m] : [];
3446
				return m && m.parentNode ? [m] : [];
3007
			}
3447
			}
3008
		},
3448
		},
-
 
3449
 
3009
		NAME: function(match, context){
3450
		NAME: function( match, context ) {
3010
			if ( typeof context.getElementsByName !== "undefined" ) {
3451
			if ( typeof context.getElementsByName !== "undefined" ) {
-
 
3452
				var ret = [],
3011
				var ret = [], results = context.getElementsByName(match[1]);
3453
					results = context.getElementsByName( match[1] );
3012
 
3454
 
3013
				for ( var i = 0, l = results.length; i < l; i++ ) {
3455
				for ( var i = 0, l = results.length; i < l; i++ ) {
3014
					if ( results[i].getAttribute("name") === match[1] ) {
3456
					if ( results[i].getAttribute("name") === match[1] ) {
3015
						ret.push( results[i] );
3457
						ret.push( results[i] );
3016
					}
3458
					}
3017
				}
3459
				}
3018
 
3460
 
3019
				return ret.length === 0 ? null : ret;
3461
				return ret.length === 0 ? null : ret;
3020
			}
3462
			}
3021
		},
3463
		},
-
 
3464
 
3022
		TAG: function(match, context){
3465
		TAG: function( match, context ) {
3023
			return context.getElementsByTagName(match[1]);
3466
			return context.getElementsByTagName( match[1] );
3024
		}
3467
		}
3025
	},
3468
	},
3026
	preFilter: {
3469
	preFilter: {
3027
		CLASS: function(match, curLoop, inplace, result, not, isXML){
3470
		CLASS: function( match, curLoop, inplace, result, not, isXML ) {
3028
			match = " " + match[1].replace(/\\/g, "") + " ";
3471
			match = " " + match[1].replace(/\\/g, "") + " ";
3029
 
3472
 
3030
			if ( isXML ) {
3473
			if ( isXML ) {
3031
				return match;
3474
				return match;
3032
			}
3475
			}
3033
 
3476
 
3034
			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
3477
			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
3035
				if ( elem ) {
3478
				if ( elem ) {
3036
					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
3479
					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
3037
						if ( !inplace ) {
3480
						if ( !inplace ) {
3038
							result.push( elem );
3481
							result.push( elem );
3039
						}
3482
						}
-
 
3483
 
3040
					} else if ( inplace ) {
3484
					} else if ( inplace ) {
3041
						curLoop[i] = false;
3485
						curLoop[i] = false;
3042
					}
3486
					}
3043
				}
3487
				}
3044
			}
3488
			}
3045
 
3489
 
3046
			return false;
3490
			return false;
3047
		},
3491
		},
-
 
3492
 
3048
		ID: function(match){
3493
		ID: function( match ) {
3049
			return match[1].replace(/\\/g, "");
3494
			return match[1].replace(/\\/g, "");
3050
		},
3495
		},
-
 
3496
 
3051
		TAG: function(match, curLoop){
3497
		TAG: function( match, curLoop ) {
3052
			return match[1].toLowerCase();
3498
			return match[1].toLowerCase();
3053
		},
3499
		},
-
 
3500
 
3054
		CHILD: function(match){
3501
		CHILD: function( match ) {
3055
			if ( match[1] === "nth" ) {
3502
			if ( match[1] === "nth" ) {
3056
				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
3503
				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
3057
				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
3504
				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
3058
					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
3505
					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
3059
					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
3506
					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
3060
 
3507
 
3061
				// calculate the numbers (first)n+(last) including if they are negative
3508
				// calculate the numbers (first)n+(last) including if they are negative
3062
				match[2] = (test[1] + (test[2] || 1)) - 0;
3509
				match[2] = (test[1] + (test[2] || 1)) - 0;
3063
				match[3] = test[3] - 0;
3510
				match[3] = test[3] - 0;
3064
			}
3511
			}
3065
 
3512
 
3066
			// TODO: Move to normal caching system
3513
			// TODO: Move to normal caching system
3067
			match[0] = done++;
3514
			match[0] = done++;
3068
 
3515
 
3069
			return match;
3516
			return match;
3070
		},
3517
		},
-
 
3518
 
3071
		ATTR: function(match, curLoop, inplace, result, not, isXML){
3519
		ATTR: function( match, curLoop, inplace, result, not, isXML ) {
3072
			var name = match[1].replace(/\\/g, "");
3520
			var name = match[1].replace(/\\/g, "");
3073
			
3521
			
3074
			if ( !isXML && Expr.attrMap[name] ) {
3522
			if ( !isXML && Expr.attrMap[name] ) {
3075
				match[1] = Expr.attrMap[name];
3523
				match[1] = Expr.attrMap[name];
3076
			}
3524
			}
3077
 
3525
 
3078
			if ( match[2] === "~=" ) {
3526
			if ( match[2] === "~=" ) {
3079
				match[4] = " " + match[4] + " ";
3527
				match[4] = " " + match[4] + " ";
3080
			}
3528
			}
3081
 
3529
 
3082
			return match;
3530
			return match;
3083
		},
3531
		},
-
 
3532
 
3084
		PSEUDO: function(match, curLoop, inplace, result, not){
3533
		PSEUDO: function( match, curLoop, inplace, result, not ) {
3085
			if ( match[1] === "not" ) {
3534
			if ( match[1] === "not" ) {
3086
				// If we're dealing with a complex expression, or a simple one
3535
				// If we're dealing with a complex expression, or a simple one
3087
				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
3536
				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
3088
					match[3] = Sizzle(match[3], null, null, curLoop);
3537
					match[3] = Sizzle(match[3], null, null, curLoop);
-
 
3538
 
3089
				} else {
3539
				} else {
3090
					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
3540
					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
 
3541
 
3091
					if ( !inplace ) {
3542
					if ( !inplace ) {
3092
						result.push.apply( result, ret );
3543
						result.push.apply( result, ret );
3093
					}
3544
					}
-
 
3545
 
3094
					return false;
3546
					return false;
3095
				}
3547
				}
-
 
3548
 
3096
			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
3549
			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
3097
				return true;
3550
				return true;
3098
			}
3551
			}
3099
			
3552
			
3100
			return match;
3553
			return match;
3101
		},
3554
		},
-
 
3555
 
3102
		POS: function(match){
3556
		POS: function( match ) {
3103
			match.unshift( true );
3557
			match.unshift( true );
-
 
3558
 
3104
			return match;
3559
			return match;
3105
		}
3560
		}
3106
	},
3561
	},
-
 
3562
	
3107
	filters: {
3563
	filters: {
3108
		enabled: function(elem){
3564
		enabled: function( elem ) {
3109
			return elem.disabled === false && elem.type !== "hidden";
3565
			return elem.disabled === false && elem.type !== "hidden";
3110
		},
3566
		},
-
 
3567
 
3111
		disabled: function(elem){
3568
		disabled: function( elem ) {
3112
			return elem.disabled === true;
3569
			return elem.disabled === true;
3113
		},
3570
		},
-
 
3571
 
3114
		checked: function(elem){
3572
		checked: function( elem ) {
3115
			return elem.checked === true;
3573
			return elem.checked === true;
3116
		},
3574
		},
-
 
3575
		
3117
		selected: function(elem){
3576
		selected: function( elem ) {
3118
			// Accessing this property makes selected-by-default
3577
			// Accessing this property makes selected-by-default
3119
			// options in Safari work properly
3578
			// options in Safari work properly
3120
			elem.parentNode.selectedIndex;
3579
			elem.parentNode.selectedIndex;
-
 
3580
			
3121
			return elem.selected === true;
3581
			return elem.selected === true;
3122
		},
3582
		},
-
 
3583
 
3123
		parent: function(elem){
3584
		parent: function( elem ) {
3124
			return !!elem.firstChild;
3585
			return !!elem.firstChild;
3125
		},
3586
		},
-
 
3587
 
3126
		empty: function(elem){
3588
		empty: function( elem ) {
3127
			return !elem.firstChild;
3589
			return !elem.firstChild;
3128
		},
3590
		},
-
 
3591
 
3129
		has: function(elem, i, match){
3592
		has: function( elem, i, match ) {
3130
			return !!Sizzle( match[3], elem ).length;
3593
			return !!Sizzle( match[3], elem ).length;
3131
		},
3594
		},
-
 
3595
 
3132
		header: function(elem){
3596
		header: function( elem ) {
3133
			return /h\d/i.test( elem.nodeName );
3597
			return (/h\d/i).test( elem.nodeName );
3134
		},
3598
		},
-
 
3599
 
3135
		text: function(elem){
3600
		text: function( elem ) {
3136
			return "text" === elem.type;
3601
			return "text" === elem.type;
3137
		},
3602
		},
3138
		radio: function(elem){
3603
		radio: function( elem ) {
3139
			return "radio" === elem.type;
3604
			return "radio" === elem.type;
3140
		},
3605
		},
-
 
3606
 
3141
		checkbox: function(elem){
3607
		checkbox: function( elem ) {
3142
			return "checkbox" === elem.type;
3608
			return "checkbox" === elem.type;
3143
		},
3609
		},
-
 
3610
 
3144
		file: function(elem){
3611
		file: function( elem ) {
3145
			return "file" === elem.type;
3612
			return "file" === elem.type;
3146
		},
3613
		},
3147
		password: function(elem){
3614
		password: function( elem ) {
3148
			return "password" === elem.type;
3615
			return "password" === elem.type;
3149
		},
3616
		},
-
 
3617
 
3150
		submit: function(elem){
3618
		submit: function( elem ) {
3151
			return "submit" === elem.type;
3619
			return "submit" === elem.type;
3152
		},
3620
		},
-
 
3621
 
3153
		image: function(elem){
3622
		image: function( elem ) {
3154
			return "image" === elem.type;
3623
			return "image" === elem.type;
3155
		},
3624
		},
-
 
3625
 
3156
		reset: function(elem){
3626
		reset: function( elem ) {
3157
			return "reset" === elem.type;
3627
			return "reset" === elem.type;
3158
		},
3628
		},
-
 
3629
 
3159
		button: function(elem){
3630
		button: function( elem ) {
3160
			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
3631
			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
3161
		},
3632
		},
-
 
3633
 
3162
		input: function(elem){
3634
		input: function( elem ) {
3163
			return /input|select|textarea|button/i.test(elem.nodeName);
3635
			return (/input|select|textarea|button/i).test( elem.nodeName );
3164
		}
3636
		}
3165
	},
3637
	},
3166
	setFilters: {
3638
	setFilters: {
3167
		first: function(elem, i){
3639
		first: function( elem, i ) {
3168
			return i === 0;
3640
			return i === 0;
3169
		},
3641
		},
-
 
3642
 
3170
		last: function(elem, i, match, array){
3643
		last: function( elem, i, match, array ) {
3171
			return i === array.length - 1;
3644
			return i === array.length - 1;
3172
		},
3645
		},
-
 
3646
 
3173
		even: function(elem, i){
3647
		even: function( elem, i ) {
3174
			return i % 2 === 0;
3648
			return i % 2 === 0;
3175
		},
3649
		},
-
 
3650
 
3176
		odd: function(elem, i){
3651
		odd: function( elem, i ) {
3177
			return i % 2 === 1;
3652
			return i % 2 === 1;
3178
		},
3653
		},
-
 
3654
 
3179
		lt: function(elem, i, match){
3655
		lt: function( elem, i, match ) {
3180
			return i < match[3] - 0;
3656
			return i < match[3] - 0;
3181
		},
3657
		},
-
 
3658
 
3182
		gt: function(elem, i, match){
3659
		gt: function( elem, i, match ) {
3183
			return i > match[3] - 0;
3660
			return i > match[3] - 0;
3184
		},
3661
		},
-
 
3662
 
3185
		nth: function(elem, i, match){
3663
		nth: function( elem, i, match ) {
3186
			return match[3] - 0 === i;
3664
			return match[3] - 0 === i;
3187
		},
3665
		},
-
 
3666
 
3188
		eq: function(elem, i, match){
3667
		eq: function( elem, i, match ) {
3189
			return match[3] - 0 === i;
3668
			return match[3] - 0 === i;
3190
		}
3669
		}
3191
	},
3670
	},
3192
	filter: {
3671
	filter: {
3193
		PSEUDO: function(elem, match, i, array){
3672
		PSEUDO: function( elem, match, i, array ) {
-
 
3673
			var name = match[1],
3194
			var name = match[1], filter = Expr.filters[ name ];
3674
				filter = Expr.filters[ name ];
3195
 
3675
 
3196
			if ( filter ) {
3676
			if ( filter ) {
3197
				return filter( elem, i, match, array );
3677
				return filter( elem, i, match, array );
-
 
3678
 
3198
			} else if ( name === "contains" ) {
3679
			} else if ( name === "contains" ) {
3199
				return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
3680
				return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
-
 
3681
 
3200
			} else if ( name === "not" ) {
3682
			} else if ( name === "not" ) {
3201
				var not = match[3];
3683
				var not = match[3];
3202
 
3684
 
3203
				for ( var i = 0, l = not.length; i < l; i++ ) {
3685
				for ( var j = 0, l = not.length; j < l; j++ ) {
3204
					if ( not[i] === elem ) {
3686
					if ( not[j] === elem ) {
3205
						return false;
3687
						return false;
3206
					}
3688
					}
3207
				}
3689
				}
3208
 
3690
 
3209
				return true;
3691
				return true;
-
 
3692
 
3210
			} else {
3693
			} else {
3211
				Sizzle.error( "Syntax error, unrecognized expression: " + name );
3694
				Sizzle.error( "Syntax error, unrecognized expression: " + name );
3212
			}
3695
			}
3213
		},
3696
		},
-
 
3697
 
3214
		CHILD: function(elem, match){
3698
		CHILD: function( elem, match ) {
3215
			var type = match[1], node = elem;
3699
			var type = match[1],
-
 
3700
				node = elem;
-
 
3701
 
3216
			switch (type) {
3702
			switch ( type ) {
3217
				case 'only':
3703
				case "only":
3218
				case 'first':
3704
				case "first":
3219
					while ( (node = node.previousSibling) )	 {
3705
					while ( (node = node.previousSibling) )	 {
3220
						if ( node.nodeType === 1 ) { 
3706
						if ( node.nodeType === 1 ) { 
3221
							return false; 
3707
							return false; 
3222
						}
3708
						}
3223
					}
3709
					}
-
 
3710
 
3224
					if ( type === "first" ) { 
3711
					if ( type === "first" ) { 
3225
						return true; 
3712
						return true; 
3226
					}
3713
					}
-
 
3714
 
3227
					node = elem;
3715
					node = elem;
-
 
3716
 
3228
				case 'last':
3717
				case "last":
3229
					while ( (node = node.nextSibling) )	 {
3718
					while ( (node = node.nextSibling) )	 {
3230
						if ( node.nodeType === 1 ) { 
3719
						if ( node.nodeType === 1 ) { 
3231
							return false; 
3720
							return false; 
3232
						}
3721
						}
3233
					}
3722
					}
-
 
3723
 
3234
					return true;
3724
					return true;
-
 
3725
 
3235
				case 'nth':
3726
				case "nth":
3236
					var first = match[2], last = match[3];
3727
					var first = match[2],
-
 
3728
						last = match[3];
3237
 
3729
 
3238
					if ( first === 1 && last === 0 ) {
3730
					if ( first === 1 && last === 0 ) {
3239
						return true;
3731
						return true;
3240
					}
3732
					}
3241
					
3733
					
3242
					var doneName = match[0],
3734
					var doneName = match[0],
3243
						parent = elem.parentNode;
3735
						parent = elem.parentNode;
3244
	
3736
	
3245
					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
3737
					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
3246
						var count = 0;
3738
						var count = 0;
-
 
3739
						
3247
						for ( node = parent.firstChild; node; node = node.nextSibling ) {
3740
						for ( node = parent.firstChild; node; node = node.nextSibling ) {
3248
							if ( node.nodeType === 1 ) {
3741
							if ( node.nodeType === 1 ) {
3249
								node.nodeIndex = ++count;
3742
								node.nodeIndex = ++count;
3250
							}
3743
							}
3251
						} 
3744
						} 
-
 
3745
 
3252
						parent.sizcache = doneName;
3746
						parent.sizcache = doneName;
3253
					}
3747
					}
3254
					
3748
					
3255
					var diff = elem.nodeIndex - last;
3749
					var diff = elem.nodeIndex - last;
-
 
3750
 
3256
					if ( first === 0 ) {
3751
					if ( first === 0 ) {
3257
						return diff === 0;
3752
						return diff === 0;
-
 
3753
 
3258
					} else {
3754
					} else {
3259
						return ( diff % first === 0 && diff / first >= 0 );
3755
						return ( diff % first === 0 && diff / first >= 0 );
3260
					}
3756
					}
3261
			}
3757
			}
3262
		},
3758
		},
-
 
3759
 
3263
		ID: function(elem, match){
3760
		ID: function( elem, match ) {
3264
			return elem.nodeType === 1 && elem.getAttribute("id") === match;
3761
			return elem.nodeType === 1 && elem.getAttribute("id") === match;
3265
		},
3762
		},
-
 
3763
 
3266
		TAG: function(elem, match){
3764
		TAG: function( elem, match ) {
3267
			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
3765
			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
3268
		},
3766
		},
-
 
3767
		
3269
		CLASS: function(elem, match){
3768
		CLASS: function( elem, match ) {
3270
			return (" " + (elem.className || elem.getAttribute("class")) + " ")
3769
			return (" " + (elem.className || elem.getAttribute("class")) + " ")
3271
				.indexOf( match ) > -1;
3770
				.indexOf( match ) > -1;
3272
		},
3771
		},
-
 
3772
 
3273
		ATTR: function(elem, match){
3773
		ATTR: function( elem, match ) {
3274
			var name = match[1],
3774
			var name = match[1],
3275
				result = Expr.attrHandle[ name ] ?
3775
				result = Expr.attrHandle[ name ] ?
3276
					Expr.attrHandle[ name ]( elem ) :
3776
					Expr.attrHandle[ name ]( elem ) :
3277
					elem[ name ] != null ?
3777
					elem[ name ] != null ?
3278
						elem[ name ] :
3778
						elem[ name ] :
3279
						elem.getAttribute( name ),
3779
						elem.getAttribute( name ),
3280
				value = result + "",
3780
				value = result + "",
3281
				type = match[2],
3781
				type = match[2],
3282
				check = match[4];
3782
				check = match[4];
3283
 
3783
 
3284
			return result == null ?
3784
			return result == null ?
3285
				type === "!=" :
3785
				type === "!=" :
3286
				type === "=" ?
3786
				type === "=" ?
3287
				value === check :
3787
				value === check :
3288
				type === "*=" ?
3788
				type === "*=" ?
3289
				value.indexOf(check) >= 0 :
3789
				value.indexOf(check) >= 0 :
3290
				type === "~=" ?
3790
				type === "~=" ?
3291
				(" " + value + " ").indexOf(check) >= 0 :
3791
				(" " + value + " ").indexOf(check) >= 0 :
3292
				!check ?
3792
				!check ?
3293
				value && result !== false :
3793
				value && result !== false :
3294
				type === "!=" ?
3794
				type === "!=" ?
3295
				value !== check :
3795
				value !== check :
3296
				type === "^=" ?
3796
				type === "^=" ?
3297
				value.indexOf(check) === 0 :
3797
				value.indexOf(check) === 0 :
3298
				type === "$=" ?
3798
				type === "$=" ?
3299
				value.substr(value.length - check.length) === check :
3799
				value.substr(value.length - check.length) === check :
3300
				type === "|=" ?
3800
				type === "|=" ?
3301
				value === check || value.substr(0, check.length + 1) === check + "-" :
3801
				value === check || value.substr(0, check.length + 1) === check + "-" :
3302
				false;
3802
				false;
3303
		},
3803
		},
-
 
3804
 
3304
		POS: function(elem, match, i, array){
3805
		POS: function( elem, match, i, array ) {
-
 
3806
			var name = match[2],
3305
			var name = match[2], filter = Expr.setFilters[ name ];
3807
				filter = Expr.setFilters[ name ];
3306
 
3808
 
3307
			if ( filter ) {
3809
			if ( filter ) {
3308
				return filter( elem, i, match, array );
3810
				return filter( elem, i, match, array );
3309
			}
3811
			}
3310
		}
3812
		}
3311
	}
3813
	}
3312
};
3814
};
3313
 
3815
 
-
 
3816
var origPOS = Expr.match.POS,
-
 
3817
	fescape = function(all, num){
-
 
3818
		return "\\" + (num - 0 + 1);
3314
var origPOS = Expr.match.POS;
3819
	};
3315
 
3820
 
3316
for ( var type in Expr.match ) {
3821
for ( var type in Expr.match ) {
3317
	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-
 
3318
	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
-
 
3319
		return "\\" + (num - 0 + 1);
3822
	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
3320
	}));
3823
	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
3321
}
3824
}
3322
 
3825
 
3323
var makeArray = function(array, results) {
3826
var makeArray = function( array, results ) {
3324
	array = Array.prototype.slice.call( array, 0 );
3827
	array = Array.prototype.slice.call( array, 0 );
3325
 
3828
 
3326
	if ( results ) {
3829
	if ( results ) {
3327
		results.push.apply( results, array );
3830
		results.push.apply( results, array );
3328
		return results;
3831
		return results;
3329
	}
3832
	}
3330
	
3833
	
3331
	return array;
3834
	return array;
3332
};
3835
};
3333
 
3836
 
3334
// Perform a simple check to determine if the browser is capable of
3837
// Perform a simple check to determine if the browser is capable of
3335
// converting a NodeList to an array using builtin methods.
3838
// converting a NodeList to an array using builtin methods.
3336
// Also verifies that the returned array holds DOM nodes
3839
// Also verifies that the returned array holds DOM nodes
3337
// (which is not the case in the Blackberry browser)
3840
// (which is not the case in the Blackberry browser)
3338
try {
3841
try {
3339
	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
3842
	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
3340
 
3843
 
3341
// Provide a fallback method if it does not work
3844
// Provide a fallback method if it does not work
3342
} catch(e){
3845
} catch( e ) {
3343
	makeArray = function(array, results) {
3846
	makeArray = function( array, results ) {
-
 
3847
		var i = 0,
3344
		var ret = results || [];
3848
			ret = results || [];
3345
 
3849
 
3346
		if ( toString.call(array) === "[object Array]" ) {
3850
		if ( toString.call(array) === "[object Array]" ) {
3347
			Array.prototype.push.apply( ret, array );
3851
			Array.prototype.push.apply( ret, array );
-
 
3852
 
3348
		} else {
3853
		} else {
3349
			if ( typeof array.length === "number" ) {
3854
			if ( typeof array.length === "number" ) {
3350
				for ( var i = 0, l = array.length; i < l; i++ ) {
3855
				for ( var l = array.length; i < l; i++ ) {
3351
					ret.push( array[i] );
3856
					ret.push( array[i] );
3352
				}
3857
				}
-
 
3858
 
3353
			} else {
3859
			} else {
3354
				for ( var i = 0; array[i]; i++ ) {
3860
				for ( ; array[i]; i++ ) {
3355
					ret.push( array[i] );
3861
					ret.push( array[i] );
3356
				}
3862
				}
3357
			}
3863
			}
3358
		}
3864
		}
3359
 
3865
 
3360
		return ret;
3866
		return ret;
3361
	};
3867
	};
3362
}
3868
}
3363
 
3869
 
3364
var sortOrder;
3870
var sortOrder, siblingCheck;
3365
 
3871
 
3366
if ( document.documentElement.compareDocumentPosition ) {
3872
if ( document.documentElement.compareDocumentPosition ) {
3367
	sortOrder = function( a, b ) {
3873
	sortOrder = function( a, b ) {
3368
		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-
 
3369
			if ( a == b ) {
3874
		if ( a === b ) {
3370
				hasDuplicate = true;
3875
			hasDuplicate = true;
-
 
3876
			return 0;
3371
			}
3877
		}
-
 
3878
 
-
 
3879
		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
3372
			return a.compareDocumentPosition ? -1 : 1;
3880
			return a.compareDocumentPosition ? -1 : 1;
3373
		}
3881
		}
3374
 
3882
 
3375
		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-
 
3376
		if ( ret === 0 ) {
-
 
3377
			hasDuplicate = true;
-
 
3378
		}
-
 
3379
		return ret;
3883
		return a.compareDocumentPosition(b) & 4 ? -1 : 1;
-
 
3884
	};
3380
	};
3885
 
3381
} else if ( "sourceIndex" in document.documentElement ) {
3886
} else {
-
 
3887
	sortOrder = function( a, b ) {
-
 
3888
		var al, bl,
-
 
3889
			ap = [],
-
 
3890
			bp = [],
-
 
3891
			aup = a.parentNode,
-
 
3892
			bup = b.parentNode,
-
 
3893
			cur = aup;
3382
	sortOrder = function( a, b ) {
3894
 
3383
		if ( !a.sourceIndex || !b.sourceIndex ) {
3895
		// The nodes are identical, we can exit early
3384
			if ( a == b ) {
3896
		if ( a === b ) {
-
 
3897
			hasDuplicate = true;
-
 
3898
			return 0;
-
 
3899
 
-
 
3900
		// If the nodes are siblings (or identical) we can do a quick check
-
 
3901
		} else if ( aup === bup ) {
-
 
3902
			return siblingCheck( a, b );
-
 
3903
 
-
 
3904
		// If no parents were found then the nodes are disconnected
-
 
3905
		} else if ( !aup ) {
-
 
3906
			return -1;
-
 
3907
 
-
 
3908
		} else if ( !bup ) {
3385
				hasDuplicate = true;
3909
			return 1;
-
 
3910
		}
-
 
3911
 
-
 
3912
		// Otherwise they're somewhere else in the tree so we need
-
 
3913
		// to build up a full list of the parentNodes for comparison
-
 
3914
		while ( cur ) {
3386
			}
3915
			ap.unshift( cur );
3387
			return a.sourceIndex ? -1 : 1;
3916
			cur = cur.parentNode;
3388
		}
3917
		}
-
 
3918
 
3389
 
3919
		cur = bup;
3390
		var ret = a.sourceIndex - b.sourceIndex;
3920
 
-
 
3921
		while ( cur ) {
3391
		if ( ret === 0 ) {
3922
			bp.unshift( cur );
-
 
3923
			cur = cur.parentNode;
-
 
3924
		}
-
 
3925
 
-
 
3926
		al = ap.length;
-
 
3927
		bl = bp.length;
-
 
3928
 
-
 
3929
		// Start walking down the tree looking for a discrepancy
-
 
3930
		for ( var i = 0; i < al && i < bl; i++ ) {
-
 
3931
			if ( ap[i] !== bp[i] ) {
-
 
3932
				return siblingCheck( ap[i], bp[i] );
-
 
3933
			}
-
 
3934
		}
3392
			hasDuplicate = true;
3935
 
-
 
3936
		// We ended someplace up the tree so do a sibling check
-
 
3937
		return i === al ?
3393
		}
3938
			siblingCheck( a, bp[i], -1 ) :
3394
		return ret;
-
 
-
 
3939
			siblingCheck( ap[i], b, 1 );
3395
	};
3940
	};
3396
} else if ( document.createRange ) {
-
 
3397
	sortOrder = function( a, b ) {
3941
 
3398
		if ( !a.ownerDocument || !b.ownerDocument ) {
3942
	siblingCheck = function( a, b, ret ) {
3399
			if ( a == b ) {
3943
		if ( a === b ) {
-
 
3944
			return ret;
3400
				hasDuplicate = true;
3945
		}
-
 
3946
 
-
 
3947
		var cur = a.nextSibling;
-
 
3948
 
-
 
3949
		while ( cur ) {
3401
			}
3950
			if ( cur === b ) {
3402
			return a.ownerDocument ? -1 : 1;
-
 
3403
		}
-
 
3404
 
-
 
3405
		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
3951
				return -1;
3406
		aRange.setStart(a, 0);
-
 
3407
		aRange.setEnd(a, 0);
-
 
3408
		bRange.setStart(b, 0);
-
 
3409
		bRange.setEnd(b, 0);
-
 
3410
		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
3952
			}
-
 
3953
 
3411
		if ( ret === 0 ) {
3954
			cur = cur.nextSibling;
3412
			hasDuplicate = true;
3955
		}
3413
		}
3956
 
3414
		return ret;
3957
		return 1;
3415
	};
3958
	};
3416
}
3959
}
3417
 
3960
 
3418
// Utility function for retreiving the text value of an array of DOM nodes
3961
// Utility function for retreiving the text value of an array of DOM nodes
3419
function getText( elems ) {
3962
Sizzle.getText = function( elems ) {
3420
	var ret = "", elem;
3963
	var ret = "", elem;
3421
 
3964
 
3422
	for ( var i = 0; elems[i]; i++ ) {
3965
	for ( var i = 0; elems[i]; i++ ) {
3423
		elem = elems[i];
3966
		elem = elems[i];
3424
 
3967
 
3425
		// Get the text from text nodes and CDATA nodes
3968
		// Get the text from text nodes and CDATA nodes
3426
		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
3969
		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
3427
			ret += elem.nodeValue;
3970
			ret += elem.nodeValue;
3428
 
3971
 
3429
		// Traverse everything else, except comment nodes
3972
		// Traverse everything else, except comment nodes
3430
		} else if ( elem.nodeType !== 8 ) {
3973
		} else if ( elem.nodeType !== 8 ) {
3431
			ret += getText( elem.childNodes );
3974
			ret += Sizzle.getText( elem.childNodes );
3432
		}
3975
		}
3433
	}
3976
	}
3434
 
3977
 
3435
	return ret;
3978
	return ret;
3436
}
3979
};
3437
 
3980
 
3438
// Check to see if the browser returns elements by name when
3981
// Check to see if the browser returns elements by name when
3439
// querying by getElementById (and provide a workaround)
3982
// querying by getElementById (and provide a workaround)
3440
(function(){
3983
(function(){
3441
	// We're going to inject a fake input element with a specified name
3984
	// We're going to inject a fake input element with a specified name
3442
	var form = document.createElement("div"),
3985
	var form = document.createElement("div"),
3443
		id = "script" + (new Date).getTime();
3986
		id = "script" + (new Date()).getTime(),
-
 
3987
		root = document.documentElement;
-
 
3988
 
3444
	form.innerHTML = "<a name='" + id + "'/>";
3989
	form.innerHTML = "<a name='" + id + "'/>";
3445
 
3990
 
3446
	// Inject it into the root element, check its status, and remove it quickly
3991
	// Inject it into the root element, check its status, and remove it quickly
3447
	var root = document.documentElement;
-
 
3448
	root.insertBefore( form, root.firstChild );
3992
	root.insertBefore( form, root.firstChild );
3449
 
3993
 
3450
	// The workaround has to do additional checks after a getElementById
3994
	// The workaround has to do additional checks after a getElementById
3451
	// Which slows things down for other browsers (hence the branching)
3995
	// Which slows things down for other browsers (hence the branching)
3452
	if ( document.getElementById( id ) ) {
3996
	if ( document.getElementById( id ) ) {
3453
		Expr.find.ID = function(match, context, isXML){
3997
		Expr.find.ID = function( match, context, isXML ) {
3454
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
3998
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
3455
				var m = context.getElementById(match[1]);
3999
				var m = context.getElementById(match[1]);
-
 
4000
 
-
 
4001
				return m ?
3456
				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
4002
					m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
-
 
4003
						[m] :
-
 
4004
						undefined :
-
 
4005
					[];
3457
			}
4006
			}
3458
		};
4007
		};
3459
 
4008
 
3460
		Expr.filter.ID = function(elem, match){
4009
		Expr.filter.ID = function( elem, match ) {
3461
			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
4010
			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
 
4011
 
3462
			return elem.nodeType === 1 && node && node.nodeValue === match;
4012
			return elem.nodeType === 1 && node && node.nodeValue === match;
3463
		};
4013
		};
3464
	}
4014
	}
3465
 
4015
 
3466
	root.removeChild( form );
4016
	root.removeChild( form );
-
 
4017
 
3467
	root = form = null; // release memory in IE
4018
	// release memory in IE
-
 
4019
	root = form = null;
3468
})();
4020
})();
3469
 
4021
 
3470
(function(){
4022
(function(){
3471
	// Check to see if the browser returns only elements
4023
	// Check to see if the browser returns only elements
3472
	// when doing getElementsByTagName("*")
4024
	// when doing getElementsByTagName("*")
3473
 
4025
 
3474
	// Create a fake element
4026
	// Create a fake element
3475
	var div = document.createElement("div");
4027
	var div = document.createElement("div");
3476
	div.appendChild( document.createComment("") );
4028
	div.appendChild( document.createComment("") );
3477
 
4029
 
3478
	// Make sure no comments are found
4030
	// Make sure no comments are found
3479
	if ( div.getElementsByTagName("*").length > 0 ) {
4031
	if ( div.getElementsByTagName("*").length > 0 ) {
3480
		Expr.find.TAG = function(match, context){
4032
		Expr.find.TAG = function( match, context ) {
3481
			var results = context.getElementsByTagName(match[1]);
4033
			var results = context.getElementsByTagName( match[1] );
3482
 
4034
 
3483
			// Filter out possible comments
4035
			// Filter out possible comments
3484
			if ( match[1] === "*" ) {
4036
			if ( match[1] === "*" ) {
3485
				var tmp = [];
4037
				var tmp = [];
3486
 
4038
 
3487
				for ( var i = 0; results[i]; i++ ) {
4039
				for ( var i = 0; results[i]; i++ ) {
3488
					if ( results[i].nodeType === 1 ) {
4040
					if ( results[i].nodeType === 1 ) {
3489
						tmp.push( results[i] );
4041
						tmp.push( results[i] );
3490
					}
4042
					}
3491
				}
4043
				}
3492
 
4044
 
3493
				results = tmp;
4045
				results = tmp;
3494
			}
4046
			}
3495
 
4047
 
3496
			return results;
4048
			return results;
3497
		};
4049
		};
3498
	}
4050
	}
3499
 
4051
 
3500
	// Check to see if an attribute returns normalized href attributes
4052
	// Check to see if an attribute returns normalized href attributes
3501
	div.innerHTML = "<a href='#'></a>";
4053
	div.innerHTML = "<a href='#'></a>";
-
 
4054
 
3502
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
4055
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
3503
			div.firstChild.getAttribute("href") !== "#" ) {
4056
			div.firstChild.getAttribute("href") !== "#" ) {
-
 
4057
 
3504
		Expr.attrHandle.href = function(elem){
4058
		Expr.attrHandle.href = function( elem ) {
3505
			return elem.getAttribute("href", 2);
4059
			return elem.getAttribute( "href", 2 );
3506
		};
4060
		};
3507
	}
4061
	}
3508
 
4062
 
-
 
4063
	// release memory in IE
3509
	div = null; // release memory in IE
4064
	div = null;
3510
})();
4065
})();
3511
 
4066
 
3512
if ( document.querySelectorAll ) {
4067
if ( document.querySelectorAll ) {
3513
	(function(){
4068
	(function(){
-
 
4069
		var oldSizzle = Sizzle,
3514
		var oldSizzle = Sizzle, div = document.createElement("div");
4070
			div = document.createElement("div"),
-
 
4071
			id = "__sizzle__";
-
 
4072
 
3515
		div.innerHTML = "<p class='TEST'></p>";
4073
		div.innerHTML = "<p class='TEST'></p>";
3516
 
4074
 
3517
		// Safari can't handle uppercase or unicode characters when
4075
		// Safari can't handle uppercase or unicode characters when
3518
		// in quirks mode.
4076
		// in quirks mode.
3519
		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
4077
		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
3520
			return;
4078
			return;
3521
		}
4079
		}
3522
	
4080
	
3523
		Sizzle = function(query, context, extra, seed){
4081
		Sizzle = function( query, context, extra, seed ) {
3524
			context = context || document;
4082
			context = context || document;
-
 
4083
 
-
 
4084
			// Make sure that attribute selectors are quoted
-
 
4085
			query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
3525
 
4086
 
3526
			// Only use querySelectorAll on non-XML documents
4087
			// Only use querySelectorAll on non-XML documents
3527
			// (ID selectors don't work in non-HTML documents)
4088
			// (ID selectors don't work in non-HTML documents)
-
 
4089
			if ( !seed && !Sizzle.isXML(context) ) {
3528
			if ( !seed && context.nodeType === 9 && !isXML(context) ) {
4090
				if ( context.nodeType === 9 ) {
3529
				try {
4091
					try {
3530
					return makeArray( context.querySelectorAll(query), extra );
4092
						return makeArray( context.querySelectorAll(query), extra );
-
 
4093
					} catch(qsaError) {}
-
 
4094
 
-
 
4095
				// qSA works strangely on Element-rooted queries
-
 
4096
				// We can work around this by specifying an extra ID on the root
-
 
4097
				// and working up from there (Thanks to Andrew Dupont for the technique)
-
 
4098
				// IE 8 doesn't work on object elements
-
 
4099
				} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-
 
4100
					var old = context.getAttribute( "id" ),
-
 
4101
						nid = old || id;
-
 
4102
 
-
 
4103
					if ( !old ) {
-
 
4104
						context.setAttribute( "id", nid );
-
 
4105
					}
-
 
4106
 
-
 
4107
					try {
-
 
4108
						return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
-
 
4109
 
-
 
4110
					} catch(pseudoError) {
-
 
4111
					} finally {
-
 
4112
						if ( !old ) {
-
 
4113
							context.removeAttribute( "id" );
-
 
4114
						}
-
 
4115
					}
3531
				} catch(e){}
4116
				}
3532
			}
4117
			}
3533
		
4118
		
3534
			return oldSizzle(query, context, extra, seed);
4119
			return oldSizzle(query, context, extra, seed);
3535
		};
4120
		};
3536
 
4121
 
3537
		for ( var prop in oldSizzle ) {
4122
		for ( var prop in oldSizzle ) {
3538
			Sizzle[ prop ] = oldSizzle[ prop ];
4123
			Sizzle[ prop ] = oldSizzle[ prop ];
3539
		}
4124
		}
3540
 
4125
 
-
 
4126
		// release memory in IE
3541
		div = null; // release memory in IE
4127
		div = null;
3542
	})();
4128
	})();
3543
}
4129
}
3544
 
4130
 
3545
(function(){
4131
(function(){
-
 
4132
	var html = document.documentElement,
-
 
4133
		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
-
 
4134
		pseudoWorks = false;
-
 
4135
 
-
 
4136
	try {
-
 
4137
		// This should fail with an exception
-
 
4138
		// Gecko does not error, returns false instead
-
 
4139
		matches.call( document.documentElement, "[test!='']:sizzle" );
-
 
4140
	
-
 
4141
	} catch( pseudoError ) {
-
 
4142
		pseudoWorks = true;
-
 
4143
	}
-
 
4144
 
-
 
4145
	if ( matches ) {
-
 
4146
		Sizzle.matchesSelector = function( node, expr ) {
-
 
4147
			// Make sure that attribute selectors are quoted
-
 
4148
			expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
 
4149
 
-
 
4150
			if ( !Sizzle.isXML( node ) ) {
-
 
4151
				try { 
-
 
4152
					if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
-
 
4153
						return matches.call( node, expr );
-
 
4154
					}
-
 
4155
				} catch(e) {}
-
 
4156
			}
-
 
4157
 
-
 
4158
			return Sizzle(expr, null, null, [node]).length > 0;
-
 
4159
		};
-
 
4160
	}
-
 
4161
})();
-
 
4162
 
-
 
4163
(function(){
3546
	var div = document.createElement("div");
4164
	var div = document.createElement("div");
3547
 
4165
 
3548
	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
4166
	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
3549
 
4167
 
3550
	// Opera can't find a second classname (in 9.6)
4168
	// Opera can't find a second classname (in 9.6)
3551
	// Also, make sure that getElementsByClassName actually exists
4169
	// Also, make sure that getElementsByClassName actually exists
3552
	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
4170
	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
3553
		return;
4171
		return;
3554
	}
4172
	}
3555
 
4173
 
3556
	// Safari caches class attributes, doesn't catch changes (in 3.2)
4174
	// Safari caches class attributes, doesn't catch changes (in 3.2)
3557
	div.lastChild.className = "e";
4175
	div.lastChild.className = "e";
3558
 
4176
 
3559
	if ( div.getElementsByClassName("e").length === 1 ) {
4177
	if ( div.getElementsByClassName("e").length === 1 ) {
3560
		return;
4178
		return;
3561
	}
4179
	}
3562
	
4180
	
3563
	Expr.order.splice(1, 0, "CLASS");
4181
	Expr.order.splice(1, 0, "CLASS");
3564
	Expr.find.CLASS = function(match, context, isXML) {
4182
	Expr.find.CLASS = function( match, context, isXML ) {
3565
		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
4183
		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
3566
			return context.getElementsByClassName(match[1]);
4184
			return context.getElementsByClassName(match[1]);
3567
		}
4185
		}
3568
	};
4186
	};
3569
 
4187
 
-
 
4188
	// release memory in IE
3570
	div = null; // release memory in IE
4189
	div = null;
3571
})();
4190
})();
3572
 
4191
 
3573
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4192
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
3574
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4193
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3575
		var elem = checkSet[i];
4194
		var elem = checkSet[i];
-
 
4195
 
3576
		if ( elem ) {
4196
		if ( elem ) {
3577
			elem = elem[dir];
-
 
3578
			var match = false;
4197
			var match = false;
-
 
4198
 
-
 
4199
			elem = elem[dir];
3579
 
4200
 
3580
			while ( elem ) {
4201
			while ( elem ) {
3581
				if ( elem.sizcache === doneName ) {
4202
				if ( elem.sizcache === doneName ) {
3582
					match = checkSet[elem.sizset];
4203
					match = checkSet[elem.sizset];
3583
					break;
4204
					break;
3584
				}
4205
				}
3585
 
4206
 
3586
				if ( elem.nodeType === 1 && !isXML ){
4207
				if ( elem.nodeType === 1 && !isXML ){
3587
					elem.sizcache = doneName;
4208
					elem.sizcache = doneName;
3588
					elem.sizset = i;
4209
					elem.sizset = i;
3589
				}
4210
				}
3590
 
4211
 
3591
				if ( elem.nodeName.toLowerCase() === cur ) {
4212
				if ( elem.nodeName.toLowerCase() === cur ) {
3592
					match = elem;
4213
					match = elem;
3593
					break;
4214
					break;
3594
				}
4215
				}
3595
 
4216
 
3596
				elem = elem[dir];
4217
				elem = elem[dir];
3597
			}
4218
			}
3598
 
4219
 
3599
			checkSet[i] = match;
4220
			checkSet[i] = match;
3600
		}
4221
		}
3601
	}
4222
	}
3602
}
4223
}
3603
 
4224
 
3604
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4225
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
3605
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4226
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3606
		var elem = checkSet[i];
4227
		var elem = checkSet[i];
-
 
4228
 
3607
		if ( elem ) {
4229
		if ( elem ) {
3608
			elem = elem[dir];
-
 
3609
			var match = false;
4230
			var match = false;
-
 
4231
			
-
 
4232
			elem = elem[dir];
3610
 
4233
 
3611
			while ( elem ) {
4234
			while ( elem ) {
3612
				if ( elem.sizcache === doneName ) {
4235
				if ( elem.sizcache === doneName ) {
3613
					match = checkSet[elem.sizset];
4236
					match = checkSet[elem.sizset];
3614
					break;
4237
					break;
3615
				}
4238
				}
3616
 
4239
 
3617
				if ( elem.nodeType === 1 ) {
4240
				if ( elem.nodeType === 1 ) {
3618
					if ( !isXML ) {
4241
					if ( !isXML ) {
3619
						elem.sizcache = doneName;
4242
						elem.sizcache = doneName;
3620
						elem.sizset = i;
4243
						elem.sizset = i;
3621
					}
4244
					}
-
 
4245
 
3622
					if ( typeof cur !== "string" ) {
4246
					if ( typeof cur !== "string" ) {
3623
						if ( elem === cur ) {
4247
						if ( elem === cur ) {
3624
							match = true;
4248
							match = true;
3625
							break;
4249
							break;
3626
						}
4250
						}
3627
 
4251
 
3628
					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
4252
					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
3629
						match = elem;
4253
						match = elem;
3630
						break;
4254
						break;
3631
					}
4255
					}
3632
				}
4256
				}
3633
 
4257
 
3634
				elem = elem[dir];
4258
				elem = elem[dir];
3635
			}
4259
			}
3636
 
4260
 
3637
			checkSet[i] = match;
4261
			checkSet[i] = match;
3638
		}
4262
		}
3639
	}
4263
	}
3640
}
4264
}
3641
 
4265
 
3642
var contains = document.compareDocumentPosition ? function(a, b){
-
 
3643
	return !!(a.compareDocumentPosition(b) & 16);
4266
if ( document.documentElement.contains ) {
3644
} : function(a, b){
4267
	Sizzle.contains = function( a, b ) {
3645
	return a !== b && (a.contains ? a.contains(b) : true);
4268
		return a !== b && (a.contains ? a.contains(b) : true);
3646
};
4269
	};
-
 
4270
 
-
 
4271
} else if ( document.documentElement.compareDocumentPosition ) {
-
 
4272
	Sizzle.contains = function( a, b ) {
-
 
4273
		return !!(a.compareDocumentPosition(b) & 16);
-
 
4274
	};
-
 
4275
 
-
 
4276
} else {
-
 
4277
	Sizzle.contains = function() {
-
 
4278
		return false;
-
 
4279
	};
-
 
4280
}
3647
 
4281
 
3648
var isXML = function(elem){
4282
Sizzle.isXML = function( elem ) {
3649
	// documentElement is verified for cases where it doesn't yet exist
4283
	// documentElement is verified for cases where it doesn't yet exist
3650
	// (such as loading iframes in IE - #4833) 
4284
	// (such as loading iframes in IE - #4833) 
3651
	var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
4285
	var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
-
 
4286
 
3652
	return documentElement ? documentElement.nodeName !== "HTML" : false;
4287
	return documentElement ? documentElement.nodeName !== "HTML" : false;
3653
};
4288
};
3654
 
4289
 
3655
var posProcess = function(selector, context){
4290
var posProcess = function( selector, context ) {
-
 
4291
	var match,
3656
	var tmpSet = [], later = "", match,
4292
		tmpSet = [],
-
 
4293
		later = "",
3657
		root = context.nodeType ? [context] : context;
4294
		root = context.nodeType ? [context] : context;
3658
 
4295
 
3659
	// Position selectors must be done after the filter
4296
	// Position selectors must be done after the filter
3660
	// And so must :not(positional) so we move all PSEUDOs to the end
4297
	// And so must :not(positional) so we move all PSEUDOs to the end
3661
	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
4298
	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
3662
		later += match[0];
4299
		later += match[0];
3663
		selector = selector.replace( Expr.match.PSEUDO, "" );
4300
		selector = selector.replace( Expr.match.PSEUDO, "" );
3664
	}
4301
	}
3665
 
4302
 
3666
	selector = Expr.relative[selector] ? selector + "*" : selector;
4303
	selector = Expr.relative[selector] ? selector + "*" : selector;
3667
 
4304
 
3668
	for ( var i = 0, l = root.length; i < l; i++ ) {
4305
	for ( var i = 0, l = root.length; i < l; i++ ) {
3669
		Sizzle( selector, root[i], tmpSet );
4306
		Sizzle( selector, root[i], tmpSet );
3670
	}
4307
	}
3671
 
4308
 
3672
	return Sizzle.filter( later, tmpSet );
4309
	return Sizzle.filter( later, tmpSet );
3673
};
4310
};
3674
 
4311
 
3675
// EXPOSE
4312
// EXPOSE
3676
jQuery.find = Sizzle;
4313
jQuery.find = Sizzle;
3677
jQuery.expr = Sizzle.selectors;
4314
jQuery.expr = Sizzle.selectors;
3678
jQuery.expr[":"] = jQuery.expr.filters;
4315
jQuery.expr[":"] = jQuery.expr.filters;
3679
jQuery.unique = Sizzle.uniqueSort;
4316
jQuery.unique = Sizzle.uniqueSort;
3680
jQuery.text = getText;
4317
jQuery.text = Sizzle.getText;
3681
jQuery.isXMLDoc = isXML;
4318
jQuery.isXMLDoc = Sizzle.isXML;
3682
jQuery.contains = contains;
4319
jQuery.contains = Sizzle.contains;
3683
 
-
 
3684
return;
-
 
3685
 
-
 
3686
window.Sizzle = Sizzle;
4320
 
-
 
4321
 
-
 
4322
})();
3687
 
4323
 
3688
})();
4324
 
3689
var runtil = /Until$/,
4325
var runtil = /Until$/,
3690
	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
4326
	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
3691
	// Note: This RegExp should be improved, or likely pulled from Sizzle
4327
	// Note: This RegExp should be improved, or likely pulled from Sizzle
3692
	rmultiselector = /,/,
4328
	rmultiselector = /,/,
3693
	slice = Array.prototype.slice;
4329
	isSimple = /^.[^:#\[\.,]*$/,
3694
 
-
 
3695
// Implement the identical functionality for filter and not
-
 
3696
var winnow = function( elements, qualifier, keep ) {
-
 
3697
	if ( jQuery.isFunction( qualifier ) ) {
-
 
3698
		return jQuery.grep(elements, function( elem, i ) {
-
 
3699
			return !!qualifier.call( elem, i, elem ) === keep;
-
 
3700
		});
-
 
3701
 
-
 
3702
	} else if ( qualifier.nodeType ) {
4330
	slice = Array.prototype.slice,
3703
		return jQuery.grep(elements, function( elem, i ) {
-
 
3704
			return (elem === qualifier) === keep;
-
 
3705
		});
-
 
3706
 
-
 
3707
	} else if ( typeof qualifier === "string" ) {
-
 
3708
		var filtered = jQuery.grep(elements, function( elem ) {
-
 
3709
			return elem.nodeType === 1;
4331
	POS = jQuery.expr.match.POS;
3710
		});
-
 
3711
 
-
 
3712
		if ( isSimple.test( qualifier ) ) {
-
 
3713
			return jQuery.filter(qualifier, filtered, !keep);
-
 
3714
		} else {
-
 
3715
			qualifier = jQuery.filter( qualifier, filtered );
-
 
3716
		}
-
 
3717
	}
-
 
3718
 
-
 
3719
	return jQuery.grep(elements, function( elem, i ) {
-
 
3720
		return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
-
 
3721
	});
-
 
3722
};
-
 
3723
 
4332
 
3724
jQuery.fn.extend({
4333
jQuery.fn.extend({
3725
	find: function( selector ) {
4334
	find: function( selector ) {
3726
		var ret = this.pushStack( "", "find", selector ), length = 0;
4335
		var ret = this.pushStack( "", "find", selector ),
-
 
4336
			length = 0;
3727
 
4337
 
3728
		for ( var i = 0, l = this.length; i < l; i++ ) {
4338
		for ( var i = 0, l = this.length; i < l; i++ ) {
3729
			length = ret.length;
4339
			length = ret.length;
3730
			jQuery.find( selector, this[i], ret );
4340
			jQuery.find( selector, this[i], ret );
3731
 
4341
 
3732
			if ( i > 0 ) {
4342
			if ( i > 0 ) {
3733
				// Make sure that the results are unique
4343
				// Make sure that the results are unique
3734
				for ( var n = length; n < ret.length; n++ ) {
4344
				for ( var n = length; n < ret.length; n++ ) {
3735
					for ( var r = 0; r < length; r++ ) {
4345
					for ( var r = 0; r < length; r++ ) {
3736
						if ( ret[r] === ret[n] ) {
4346
						if ( ret[r] === ret[n] ) {
3737
							ret.splice(n--, 1);
4347
							ret.splice(n--, 1);
3738
							break;
4348
							break;
3739
						}
4349
						}
3740
					}
4350
					}
3741
				}
4351
				}
3742
			}
4352
			}
3743
		}
4353
		}
3744
 
4354
 
3745
		return ret;
4355
		return ret;
3746
	},
4356
	},
3747
 
4357
 
3748
	has: function( target ) {
4358
	has: function( target ) {
3749
		var targets = jQuery( target );
4359
		var targets = jQuery( target );
3750
		return this.filter(function() {
4360
		return this.filter(function() {
3751
			for ( var i = 0, l = targets.length; i < l; i++ ) {
4361
			for ( var i = 0, l = targets.length; i < l; i++ ) {
3752
				if ( jQuery.contains( this, targets[i] ) ) {
4362
				if ( jQuery.contains( this, targets[i] ) ) {
3753
					return true;
4363
					return true;
3754
				}
4364
				}
3755
			}
4365
			}
3756
		});
4366
		});
3757
	},
4367
	},
3758
 
4368
 
3759
	not: function( selector ) {
4369
	not: function( selector ) {
3760
		return this.pushStack( winnow(this, selector, false), "not", selector);
4370
		return this.pushStack( winnow(this, selector, false), "not", selector);
3761
	},
4371
	},
3762
 
4372
 
3763
	filter: function( selector ) {
4373
	filter: function( selector ) {
3764
		return this.pushStack( winnow(this, selector, true), "filter", selector );
4374
		return this.pushStack( winnow(this, selector, true), "filter", selector );
3765
	},
4375
	},
3766
	
4376
	
3767
	is: function( selector ) {
4377
	is: function( selector ) {
3768
		return !!selector && jQuery.filter( selector, this ).length > 0;
4378
		return !!selector && jQuery.filter( selector, this ).length > 0;
3769
	},
4379
	},
3770
 
4380
 
3771
	closest: function( selectors, context ) {
4381
	closest: function( selectors, context ) {
-
 
4382
		var ret = [], i, l, cur = this[0];
-
 
4383
 
3772
		if ( jQuery.isArray( selectors ) ) {
4384
		if ( jQuery.isArray( selectors ) ) {
3773
			var ret = [], cur = this[0], match, matches = {}, selector;
4385
			var match, selector,
-
 
4386
				matches = {},
-
 
4387
				level = 1;
3774
 
4388
 
3775
			if ( cur && selectors.length ) {
4389
			if ( cur && selectors.length ) {
3776
				for ( var i = 0, l = selectors.length; i < l; i++ ) {
4390
				for ( i = 0, l = selectors.length; i < l; i++ ) {
3777
					selector = selectors[i];
4391
					selector = selectors[i];
3778
 
4392
 
3779
					if ( !matches[selector] ) {
4393
					if ( !matches[selector] ) {
3780
						matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
4394
						matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
3781
							jQuery( selector, context || this.context ) :
4395
							jQuery( selector, context || this.context ) :
3782
							selector;
4396
							selector;
3783
					}
4397
					}
3784
				}
4398
				}
3785
 
4399
 
3786
				while ( cur && cur.ownerDocument && cur !== context ) {
4400
				while ( cur && cur.ownerDocument && cur !== context ) {
3787
					for ( selector in matches ) {
4401
					for ( selector in matches ) {
3788
						match = matches[selector];
4402
						match = matches[selector];
3789
 
4403
 
3790
						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
4404
						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
3791
							ret.push({ selector: selector, elem: cur });
4405
							ret.push({ selector: selector, elem: cur, level: level });
3792
							delete matches[selector];
-
 
3793
						}
4406
						}
3794
					}
4407
					}
-
 
4408
 
3795
					cur = cur.parentNode;
4409
					cur = cur.parentNode;
-
 
4410
					level++;
3796
				}
4411
				}
3797
			}
4412
			}
3798
 
4413
 
3799
			return ret;
4414
			return ret;
3800
		}
4415
		}
3801
 
4416
 
3802
		var pos = jQuery.expr.match.POS.test( selectors ) ? 
4417
		var pos = POS.test( selectors ) ? 
3803
			jQuery( selectors, context || this.context ) : null;
4418
			jQuery( selectors, context || this.context ) : null;
-
 
4419
 
-
 
4420
		for ( i = 0, l = this.length; i < l; i++ ) {
3804
 
4421
			cur = this[i];
3805
		return this.map(function( i, cur ) {
4422
 
3806
			while ( cur && cur.ownerDocument && cur !== context ) {
4423
			while ( cur ) {
-
 
4424
				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
-
 
4425
					ret.push( cur );
3807
				if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
4426
					break;
3808
					return cur;
4427
 
-
 
4428
				} else {
-
 
4429
					cur = cur.parentNode;
3809
				}
4430
					if ( !cur || !cur.ownerDocument || cur === context ) {
3810
				cur = cur.parentNode;
4431
						break;
-
 
4432
					}
3811
			}
4433
				}
-
 
4434
			}
-
 
4435
		}
-
 
4436
 
-
 
4437
		ret = ret.length > 1 ? jQuery.unique(ret) : ret;
3812
			return null;
4438
		
3813
		});
4439
		return this.pushStack( ret, "closest", selectors );
3814
	},
4440
	},
3815
	
4441
	
3816
	// Determine the position of an element within
4442
	// Determine the position of an element within
3817
	// the matched set of elements
4443
	// the matched set of elements
3818
	index: function( elem ) {
4444
	index: function( elem ) {
3819
		if ( !elem || typeof elem === "string" ) {
4445
		if ( !elem || typeof elem === "string" ) {
3820
			return jQuery.inArray( this[0],
4446
			return jQuery.inArray( this[0],
3821
				// If it receives a string, the selector is used
4447
				// If it receives a string, the selector is used
3822
				// If it receives nothing, the siblings are used
4448
				// If it receives nothing, the siblings are used
3823
				elem ? jQuery( elem ) : this.parent().children() );
4449
				elem ? jQuery( elem ) : this.parent().children() );
3824
		}
4450
		}
3825
		// Locate the position of the desired element
4451
		// Locate the position of the desired element
3826
		return jQuery.inArray(
4452
		return jQuery.inArray(
3827
			// If it receives a jQuery object, the first element is used
4453
			// If it receives a jQuery object, the first element is used
3828
			elem.jquery ? elem[0] : elem, this );
4454
			elem.jquery ? elem[0] : elem, this );
3829
	},
4455
	},
3830
 
4456
 
3831
	add: function( selector, context ) {
4457
	add: function( selector, context ) {
3832
		var set = typeof selector === "string" ?
4458
		var set = typeof selector === "string" ?
3833
				jQuery( selector, context || this.context ) :
4459
				jQuery( selector, context || this.context ) :
3834
				jQuery.makeArray( selector ),
4460
				jQuery.makeArray( selector ),
3835
			all = jQuery.merge( this.get(), set );
4461
			all = jQuery.merge( this.get(), set );
3836
 
4462
 
3837
		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
4463
		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
3838
			all :
4464
			all :
3839
			jQuery.unique( all ) );
4465
			jQuery.unique( all ) );
3840
	},
4466
	},
3841
 
4467
 
3842
	andSelf: function() {
4468
	andSelf: function() {
3843
		return this.add( this.prevObject );
4469
		return this.add( this.prevObject );
3844
	}
4470
	}
3845
});
4471
});
3846
 
4472
 
3847
// A painfully simple check to see if an element is disconnected
4473
// A painfully simple check to see if an element is disconnected
3848
// from a document (should be improved, where feasible).
4474
// from a document (should be improved, where feasible).
3849
function isDisconnected( node ) {
4475
function isDisconnected( node ) {
3850
	return !node || !node.parentNode || node.parentNode.nodeType === 11;
4476
	return !node || !node.parentNode || node.parentNode.nodeType === 11;
3851
}
4477
}
3852
 
4478
 
3853
jQuery.each({
4479
jQuery.each({
3854
	parent: function( elem ) {
4480
	parent: function( elem ) {
3855
		var parent = elem.parentNode;
4481
		var parent = elem.parentNode;
3856
		return parent && parent.nodeType !== 11 ? parent : null;
4482
		return parent && parent.nodeType !== 11 ? parent : null;
3857
	},
4483
	},
3858
	parents: function( elem ) {
4484
	parents: function( elem ) {
3859
		return jQuery.dir( elem, "parentNode" );
4485
		return jQuery.dir( elem, "parentNode" );
3860
	},
4486
	},
3861
	parentsUntil: function( elem, i, until ) {
4487
	parentsUntil: function( elem, i, until ) {
3862
		return jQuery.dir( elem, "parentNode", until );
4488
		return jQuery.dir( elem, "parentNode", until );
3863
	},
4489
	},
3864
	next: function( elem ) {
4490
	next: function( elem ) {
3865
		return jQuery.nth( elem, 2, "nextSibling" );
4491
		return jQuery.nth( elem, 2, "nextSibling" );
3866
	},
4492
	},
3867
	prev: function( elem ) {
4493
	prev: function( elem ) {
3868
		return jQuery.nth( elem, 2, "previousSibling" );
4494
		return jQuery.nth( elem, 2, "previousSibling" );
3869
	},
4495
	},
3870
	nextAll: function( elem ) {
4496
	nextAll: function( elem ) {
3871
		return jQuery.dir( elem, "nextSibling" );
4497
		return jQuery.dir( elem, "nextSibling" );
3872
	},
4498
	},
3873
	prevAll: function( elem ) {
4499
	prevAll: function( elem ) {
3874
		return jQuery.dir( elem, "previousSibling" );
4500
		return jQuery.dir( elem, "previousSibling" );
3875
	},
4501
	},
3876
	nextUntil: function( elem, i, until ) {
4502
	nextUntil: function( elem, i, until ) {
3877
		return jQuery.dir( elem, "nextSibling", until );
4503
		return jQuery.dir( elem, "nextSibling", until );
3878
	},
4504
	},
3879
	prevUntil: function( elem, i, until ) {
4505
	prevUntil: function( elem, i, until ) {
3880
		return jQuery.dir( elem, "previousSibling", until );
4506
		return jQuery.dir( elem, "previousSibling", until );
3881
	},
4507
	},
3882
	siblings: function( elem ) {
4508
	siblings: function( elem ) {
3883
		return jQuery.sibling( elem.parentNode.firstChild, elem );
4509
		return jQuery.sibling( elem.parentNode.firstChild, elem );
3884
	},
4510
	},
3885
	children: function( elem ) {
4511
	children: function( elem ) {
3886
		return jQuery.sibling( elem.firstChild );
4512
		return jQuery.sibling( elem.firstChild );
3887
	},
4513
	},
3888
	contents: function( elem ) {
4514
	contents: function( elem ) {
3889
		return jQuery.nodeName( elem, "iframe" ) ?
4515
		return jQuery.nodeName( elem, "iframe" ) ?
3890
			elem.contentDocument || elem.contentWindow.document :
4516
			elem.contentDocument || elem.contentWindow.document :
3891
			jQuery.makeArray( elem.childNodes );
4517
			jQuery.makeArray( elem.childNodes );
3892
	}
4518
	}
3893
}, function( name, fn ) {
4519
}, function( name, fn ) {
3894
	jQuery.fn[ name ] = function( until, selector ) {
4520
	jQuery.fn[ name ] = function( until, selector ) {
3895
		var ret = jQuery.map( this, fn, until );
4521
		var ret = jQuery.map( this, fn, until );
3896
		
4522
		
3897
		if ( !runtil.test( name ) ) {
4523
		if ( !runtil.test( name ) ) {
3898
			selector = until;
4524
			selector = until;
3899
		}
4525
		}
3900
 
4526
 
3901
		if ( selector && typeof selector === "string" ) {
4527
		if ( selector && typeof selector === "string" ) {
3902
			ret = jQuery.filter( selector, ret );
4528
			ret = jQuery.filter( selector, ret );
3903
		}
4529
		}
3904
 
4530
 
3905
		ret = this.length > 1 ? jQuery.unique( ret ) : ret;
4531
		ret = this.length > 1 ? jQuery.unique( ret ) : ret;
3906
 
4532
 
3907
		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
4533
		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
3908
			ret = ret.reverse();
4534
			ret = ret.reverse();
3909
		}
4535
		}
3910
 
4536
 
3911
		return this.pushStack( ret, name, slice.call(arguments).join(",") );
4537
		return this.pushStack( ret, name, slice.call(arguments).join(",") );
3912
	};
4538
	};
3913
});
4539
});
3914
 
4540
 
3915
jQuery.extend({
4541
jQuery.extend({
3916
	filter: function( expr, elems, not ) {
4542
	filter: function( expr, elems, not ) {
3917
		if ( not ) {
4543
		if ( not ) {
3918
			expr = ":not(" + expr + ")";
4544
			expr = ":not(" + expr + ")";
3919
		}
4545
		}
-
 
4546
 
-
 
4547
		return elems.length === 1 ?
3920
 
4548
			jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
3921
		return jQuery.find.matches(expr, elems);
4549
			jQuery.find.matches(expr, elems);
3922
	},
4550
	},
3923
	
4551
	
3924
	dir: function( elem, dir, until ) {
4552
	dir: function( elem, dir, until ) {
3925
		var matched = [], cur = elem[dir];
4553
		var matched = [],
-
 
4554
			cur = elem[ dir ];
-
 
4555
 
3926
		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
4556
		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
3927
			if ( cur.nodeType === 1 ) {
4557
			if ( cur.nodeType === 1 ) {
3928
				matched.push( cur );
4558
				matched.push( cur );
3929
			}
4559
			}
3930
			cur = cur[dir];
4560
			cur = cur[dir];
3931
		}
4561
		}
3932
		return matched;
4562
		return matched;
3933
	},
4563
	},
3934
 
4564
 
3935
	nth: function( cur, result, dir, elem ) {
4565
	nth: function( cur, result, dir, elem ) {
3936
		result = result || 1;
4566
		result = result || 1;
3937
		var num = 0;
4567
		var num = 0;
3938
 
4568
 
3939
		for ( ; cur; cur = cur[dir] ) {
4569
		for ( ; cur; cur = cur[dir] ) {
3940
			if ( cur.nodeType === 1 && ++num === result ) {
4570
			if ( cur.nodeType === 1 && ++num === result ) {
3941
				break;
4571
				break;
3942
			}
4572
			}
3943
		}
4573
		}
3944
 
4574
 
3945
		return cur;
4575
		return cur;
3946
	},
4576
	},
3947
 
4577
 
3948
	sibling: function( n, elem ) {
4578
	sibling: function( n, elem ) {
3949
		var r = [];
4579
		var r = [];
3950
 
4580
 
3951
		for ( ; n; n = n.nextSibling ) {
4581
		for ( ; n; n = n.nextSibling ) {
3952
			if ( n.nodeType === 1 && n !== elem ) {
4582
			if ( n.nodeType === 1 && n !== elem ) {
3953
				r.push( n );
4583
				r.push( n );
3954
			}
4584
			}
3955
		}
4585
		}
3956
 
4586
 
3957
		return r;
4587
		return r;
3958
	}
4588
	}
3959
});
4589
});
-
 
4590
 
-
 
4591
// Implement the identical functionality for filter and not
-
 
4592
function winnow( elements, qualifier, keep ) {
-
 
4593
	if ( jQuery.isFunction( qualifier ) ) {
-
 
4594
		return jQuery.grep(elements, function( elem, i ) {
-
 
4595
			var retVal = !!qualifier.call( elem, i, elem );
-
 
4596
			return retVal === keep;
-
 
4597
		});
-
 
4598
 
-
 
4599
	} else if ( qualifier.nodeType ) {
-
 
4600
		return jQuery.grep(elements, function( elem, i ) {
-
 
4601
			return (elem === qualifier) === keep;
-
 
4602
		});
-
 
4603
 
-
 
4604
	} else if ( typeof qualifier === "string" ) {
-
 
4605
		var filtered = jQuery.grep(elements, function( elem ) {
-
 
4606
			return elem.nodeType === 1;
-
 
4607
		});
-
 
4608
 
-
 
4609
		if ( isSimple.test( qualifier ) ) {
-
 
4610
			return jQuery.filter(qualifier, filtered, !keep);
-
 
4611
		} else {
-
 
4612
			qualifier = jQuery.filter( qualifier, filtered );
-
 
4613
		}
-
 
4614
	}
-
 
4615
 
-
 
4616
	return jQuery.grep(elements, function( elem, i ) {
-
 
4617
		return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
-
 
4618
	});
-
 
4619
}
-
 
4620
 
-
 
4621
 
-
 
4622
 
-
 
4623
 
3960
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
4624
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
3961
	rleadingWhitespace = /^\s+/,
4625
	rleadingWhitespace = /^\s+/,
3962
	rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
-
 
3963
	rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
4626
	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
3964
	rtagName = /<([\w:]+)/,
4627
	rtagName = /<([\w:]+)/,
3965
	rtbody = /<tbody/i,
4628
	rtbody = /<tbody/i,
3966
	rhtml = /<|&#?\w+;/,
4629
	rhtml = /<|&#?\w+;/,
3967
	rnocache = /<script|<object|<embed|<option|<style/i,
4630
	rnocache = /<(?:script|object|embed|option|style)/i,
3968
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
4631
	// checked="checked" or checked (html5)
3969
	fcloseTag = function( all, front, tag ) {
4632
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
3970
		return rselfClosing.test( tag ) ?
-
 
3971
			all :
-
 
3972
			front + "></" + tag + ">";
4633
	raction = /\=([^="'>\s]+\/)>/g,
3973
	},
-
 
3974
	wrapMap = {
4634
	wrapMap = {
3975
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
4635
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
3976
		legend: [ 1, "<fieldset>", "</fieldset>" ],
4636
		legend: [ 1, "<fieldset>", "</fieldset>" ],
3977
		thead: [ 1, "<table>", "</table>" ],
4637
		thead: [ 1, "<table>", "</table>" ],
3978
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4638
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
3979
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4639
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
3980
		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
4640
		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
3981
		area: [ 1, "<map>", "</map>" ],
4641
		area: [ 1, "<map>", "</map>" ],
3982
		_default: [ 0, "", "" ]
4642
		_default: [ 0, "", "" ]
3983
	};
4643
	};
3984
 
4644
 
3985
wrapMap.optgroup = wrapMap.option;
4645
wrapMap.optgroup = wrapMap.option;
3986
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4646
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
3987
wrapMap.th = wrapMap.td;
4647
wrapMap.th = wrapMap.td;
3988
 
4648
 
3989
// IE can't serialize <link> and <script> tags normally
4649
// IE can't serialize <link> and <script> tags normally
3990
if ( !jQuery.support.htmlSerialize ) {
4650
if ( !jQuery.support.htmlSerialize ) {
3991
	wrapMap._default = [ 1, "div<div>", "</div>" ];
4651
	wrapMap._default = [ 1, "div<div>", "</div>" ];
3992
}
4652
}
3993
 
4653
 
3994
jQuery.fn.extend({
4654
jQuery.fn.extend({
3995
	text: function( text ) {
4655
	text: function( text ) {
3996
		if ( jQuery.isFunction(text) ) {
4656
		if ( jQuery.isFunction(text) ) {
3997
			return this.each(function(i) {
4657
			return this.each(function(i) {
3998
				var self = jQuery(this);
4658
				var self = jQuery( this );
-
 
4659
 
3999
				self.text( text.call(this, i, self.text()) );
4660
				self.text( text.call(this, i, self.text()) );
4000
			});
4661
			});
4001
		}
4662
		}
4002
 
4663
 
4003
		if ( typeof text !== "object" && text !== undefined ) {
4664
		if ( typeof text !== "object" && text !== undefined ) {
4004
			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
4665
			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
4005
		}
4666
		}
4006
 
4667
 
4007
		return jQuery.text( this );
4668
		return jQuery.text( this );
4008
	},
4669
	},
4009
 
4670
 
4010
	wrapAll: function( html ) {
4671
	wrapAll: function( html ) {
4011
		if ( jQuery.isFunction( html ) ) {
4672
		if ( jQuery.isFunction( html ) ) {
4012
			return this.each(function(i) {
4673
			return this.each(function(i) {
4013
				jQuery(this).wrapAll( html.call(this, i) );
4674
				jQuery(this).wrapAll( html.call(this, i) );
4014
			});
4675
			});
4015
		}
4676
		}
4016
 
4677
 
4017
		if ( this[0] ) {
4678
		if ( this[0] ) {
4018
			// The elements to wrap the target around
4679
			// The elements to wrap the target around
4019
			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
4680
			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
4020
 
4681
 
4021
			if ( this[0].parentNode ) {
4682
			if ( this[0].parentNode ) {
4022
				wrap.insertBefore( this[0] );
4683
				wrap.insertBefore( this[0] );
4023
			}
4684
			}
4024
 
4685
 
4025
			wrap.map(function() {
4686
			wrap.map(function() {
4026
				var elem = this;
4687
				var elem = this;
4027
 
4688
 
4028
				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
4689
				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
4029
					elem = elem.firstChild;
4690
					elem = elem.firstChild;
4030
				}
4691
				}
4031
 
4692
 
4032
				return elem;
4693
				return elem;
4033
			}).append(this);
4694
			}).append(this);
4034
		}
4695
		}
4035
 
4696
 
4036
		return this;
4697
		return this;
4037
	},
4698
	},
4038
 
4699
 
4039
	wrapInner: function( html ) {
4700
	wrapInner: function( html ) {
4040
		if ( jQuery.isFunction( html ) ) {
4701
		if ( jQuery.isFunction( html ) ) {
4041
			return this.each(function(i) {
4702
			return this.each(function(i) {
4042
				jQuery(this).wrapInner( html.call(this, i) );
4703
				jQuery(this).wrapInner( html.call(this, i) );
4043
			});
4704
			});
4044
		}
4705
		}
4045
 
4706
 
4046
		return this.each(function() {
4707
		return this.each(function() {
-
 
4708
			var self = jQuery( this ),
4047
			var self = jQuery( this ), contents = self.contents();
4709
				contents = self.contents();
4048
 
4710
 
4049
			if ( contents.length ) {
4711
			if ( contents.length ) {
4050
				contents.wrapAll( html );
4712
				contents.wrapAll( html );
4051
 
4713
 
4052
			} else {
4714
			} else {
4053
				self.append( html );
4715
				self.append( html );
4054
			}
4716
			}
4055
		});
4717
		});
4056
	},
4718
	},
4057
 
4719
 
4058
	wrap: function( html ) {
4720
	wrap: function( html ) {
4059
		return this.each(function() {
4721
		return this.each(function() {
4060
			jQuery( this ).wrapAll( html );
4722
			jQuery( this ).wrapAll( html );
4061
		});
4723
		});
4062
	},
4724
	},
4063
 
4725
 
4064
	unwrap: function() {
4726
	unwrap: function() {
4065
		return this.parent().each(function() {
4727
		return this.parent().each(function() {
4066
			if ( !jQuery.nodeName( this, "body" ) ) {
4728
			if ( !jQuery.nodeName( this, "body" ) ) {
4067
				jQuery( this ).replaceWith( this.childNodes );
4729
				jQuery( this ).replaceWith( this.childNodes );
4068
			}
4730
			}
4069
		}).end();
4731
		}).end();
4070
	},
4732
	},
4071
 
4733
 
4072
	append: function() {
4734
	append: function() {
4073
		return this.domManip(arguments, true, function( elem ) {
4735
		return this.domManip(arguments, true, function( elem ) {
4074
			if ( this.nodeType === 1 ) {
4736
			if ( this.nodeType === 1 ) {
4075
				this.appendChild( elem );
4737
				this.appendChild( elem );
4076
			}
4738
			}
4077
		});
4739
		});
4078
	},
4740
	},
4079
 
4741
 
4080
	prepend: function() {
4742
	prepend: function() {
4081
		return this.domManip(arguments, true, function( elem ) {
4743
		return this.domManip(arguments, true, function( elem ) {
4082
			if ( this.nodeType === 1 ) {
4744
			if ( this.nodeType === 1 ) {
4083
				this.insertBefore( elem, this.firstChild );
4745
				this.insertBefore( elem, this.firstChild );
4084
			}
4746
			}
4085
		});
4747
		});
4086
	},
4748
	},
4087
 
4749
 
4088
	before: function() {
4750
	before: function() {
4089
		if ( this[0] && this[0].parentNode ) {
4751
		if ( this[0] && this[0].parentNode ) {
4090
			return this.domManip(arguments, false, function( elem ) {
4752
			return this.domManip(arguments, false, function( elem ) {
4091
				this.parentNode.insertBefore( elem, this );
4753
				this.parentNode.insertBefore( elem, this );
4092
			});
4754
			});
4093
		} else if ( arguments.length ) {
4755
		} else if ( arguments.length ) {
4094
			var set = jQuery(arguments[0]);
4756
			var set = jQuery(arguments[0]);
4095
			set.push.apply( set, this.toArray() );
4757
			set.push.apply( set, this.toArray() );
4096
			return this.pushStack( set, "before", arguments );
4758
			return this.pushStack( set, "before", arguments );
4097
		}
4759
		}
4098
	},
4760
	},
4099
 
4761
 
4100
	after: function() {
4762
	after: function() {
4101
		if ( this[0] && this[0].parentNode ) {
4763
		if ( this[0] && this[0].parentNode ) {
4102
			return this.domManip(arguments, false, function( elem ) {
4764
			return this.domManip(arguments, false, function( elem ) {
4103
				this.parentNode.insertBefore( elem, this.nextSibling );
4765
				this.parentNode.insertBefore( elem, this.nextSibling );
4104
			});
4766
			});
4105
		} else if ( arguments.length ) {
4767
		} else if ( arguments.length ) {
4106
			var set = this.pushStack( this, "after", arguments );
4768
			var set = this.pushStack( this, "after", arguments );
4107
			set.push.apply( set, jQuery(arguments[0]).toArray() );
4769
			set.push.apply( set, jQuery(arguments[0]).toArray() );
4108
			return set;
4770
			return set;
4109
		}
4771
		}
4110
	},
4772
	},
4111
	
4773
	
4112
	// keepData is for internal use only--do not document
4774
	// keepData is for internal use only--do not document
4113
	remove: function( selector, keepData ) {
4775
	remove: function( selector, keepData ) {
4114
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4776
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4115
			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
4777
			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
4116
				if ( !keepData && elem.nodeType === 1 ) {
4778
				if ( !keepData && elem.nodeType === 1 ) {
4117
					jQuery.cleanData( elem.getElementsByTagName("*") );
4779
					jQuery.cleanData( elem.getElementsByTagName("*") );
4118
					jQuery.cleanData( [ elem ] );
4780
					jQuery.cleanData( [ elem ] );
4119
				}
4781
				}
4120
 
4782
 
4121
				if ( elem.parentNode ) {
4783
				if ( elem.parentNode ) {
4122
					 elem.parentNode.removeChild( elem );
4784
					 elem.parentNode.removeChild( elem );
4123
				}
4785
				}
4124
			}
4786
			}
4125
		}
4787
		}
4126
		
4788
		
4127
		return this;
4789
		return this;
4128
	},
4790
	},
4129
 
4791
 
4130
	empty: function() {
4792
	empty: function() {
4131
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4793
		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4132
			// Remove element nodes and prevent memory leaks
4794
			// Remove element nodes and prevent memory leaks
4133
			if ( elem.nodeType === 1 ) {
4795
			if ( elem.nodeType === 1 ) {
4134
				jQuery.cleanData( elem.getElementsByTagName("*") );
4796
				jQuery.cleanData( elem.getElementsByTagName("*") );
4135
			}
4797
			}
4136
 
4798
 
4137
			// Remove any remaining nodes
4799
			// Remove any remaining nodes
4138
			while ( elem.firstChild ) {
4800
			while ( elem.firstChild ) {
4139
				elem.removeChild( elem.firstChild );
4801
				elem.removeChild( elem.firstChild );
4140
			}
4802
			}
4141
		}
4803
		}
4142
		
4804
		
4143
		return this;
4805
		return this;
4144
	},
4806
	},
4145
 
4807
 
4146
	clone: function( events ) {
4808
	clone: function( events ) {
4147
		// Do the clone
4809
		// Do the clone
4148
		var ret = this.map(function() {
4810
		var ret = this.map(function() {
4149
			if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
4811
			if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
4150
				// IE copies events bound via attachEvent when
4812
				// IE copies events bound via attachEvent when
4151
				// using cloneNode. Calling detachEvent on the
4813
				// using cloneNode. Calling detachEvent on the
4152
				// clone will also remove the events from the orignal
4814
				// clone will also remove the events from the orignal
4153
				// In order to get around this, we use innerHTML.
4815
				// In order to get around this, we use innerHTML.
4154
				// Unfortunately, this means some modifications to
4816
				// Unfortunately, this means some modifications to
4155
				// attributes in IE that are actually only stored
4817
				// attributes in IE that are actually only stored
4156
				// as properties will not be copied (such as the
4818
				// as properties will not be copied (such as the
4157
				// the name attribute on an input).
4819
				// the name attribute on an input).
-
 
4820
				var html = this.outerHTML,
4158
				var html = this.outerHTML, ownerDocument = this.ownerDocument;
4821
					ownerDocument = this.ownerDocument;
-
 
4822
 
4159
				if ( !html ) {
4823
				if ( !html ) {
4160
					var div = ownerDocument.createElement("div");
4824
					var div = ownerDocument.createElement("div");
4161
					div.appendChild( this.cloneNode(true) );
4825
					div.appendChild( this.cloneNode(true) );
4162
					html = div.innerHTML;
4826
					html = div.innerHTML;
4163
				}
4827
				}
4164
 
4828
 
4165
				return jQuery.clean([html.replace(rinlinejQuery, "")
4829
				return jQuery.clean([html.replace(rinlinejQuery, "")
4166
					// Handle the case in IE 8 where action=/test/> self-closes a tag
4830
					// Handle the case in IE 8 where action=/test/> self-closes a tag
4167
					.replace(/=([^="'>\s]+\/)>/g, '="$1">')
4831
					.replace(raction, '="$1">')
4168
					.replace(rleadingWhitespace, "")], ownerDocument)[0];
4832
					.replace(rleadingWhitespace, "")], ownerDocument)[0];
4169
			} else {
4833
			} else {
4170
				return this.cloneNode(true);
4834
				return this.cloneNode(true);
4171
			}
4835
			}
4172
		});
4836
		});
4173
 
4837
 
4174
		// Copy the events from the original to the clone
4838
		// Copy the events from the original to the clone
4175
		if ( events === true ) {
4839
		if ( events === true ) {
4176
			cloneCopyEvent( this, ret );
4840
			cloneCopyEvent( this, ret );
4177
			cloneCopyEvent( this.find("*"), ret.find("*") );
4841
			cloneCopyEvent( this.find("*"), ret.find("*") );
4178
		}
4842
		}
4179
 
4843
 
4180
		// Return the cloned set
4844
		// Return the cloned set
4181
		return ret;
4845
		return ret;
4182
	},
4846
	},
4183
 
4847
 
4184
	html: function( value ) {
4848
	html: function( value ) {
4185
		if ( value === undefined ) {
4849
		if ( value === undefined ) {
4186
			return this[0] && this[0].nodeType === 1 ?
4850
			return this[0] && this[0].nodeType === 1 ?
4187
				this[0].innerHTML.replace(rinlinejQuery, "") :
4851
				this[0].innerHTML.replace(rinlinejQuery, "") :
4188
				null;
4852
				null;
4189
 
4853
 
4190
		// See if we can take a shortcut and just use innerHTML
4854
		// See if we can take a shortcut and just use innerHTML
4191
		} else if ( typeof value === "string" && !rnocache.test( value ) &&
4855
		} else if ( typeof value === "string" && !rnocache.test( value ) &&
4192
			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
4856
			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
4193
			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
4857
			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
4194
 
4858
 
4195
			value = value.replace(rxhtmlTag, fcloseTag);
4859
			value = value.replace(rxhtmlTag, "<$1></$2>");
4196
 
4860
 
4197
			try {
4861
			try {
4198
				for ( var i = 0, l = this.length; i < l; i++ ) {
4862
				for ( var i = 0, l = this.length; i < l; i++ ) {
4199
					// Remove element nodes and prevent memory leaks
4863
					// Remove element nodes and prevent memory leaks
4200
					if ( this[i].nodeType === 1 ) {
4864
					if ( this[i].nodeType === 1 ) {
4201
						jQuery.cleanData( this[i].getElementsByTagName("*") );
4865
						jQuery.cleanData( this[i].getElementsByTagName("*") );
4202
						this[i].innerHTML = value;
4866
						this[i].innerHTML = value;
4203
					}
4867
					}
4204
				}
4868
				}
4205
 
4869
 
4206
			// If using innerHTML throws an exception, use the fallback method
4870
			// If using innerHTML throws an exception, use the fallback method
4207
			} catch(e) {
4871
			} catch(e) {
4208
				this.empty().append( value );
4872
				this.empty().append( value );
4209
			}
4873
			}
4210
 
4874
 
4211
		} else if ( jQuery.isFunction( value ) ) {
4875
		} else if ( jQuery.isFunction( value ) ) {
4212
			this.each(function(i){
4876
			this.each(function(i){
4213
				var self = jQuery(this), old = self.html();
4877
				var self = jQuery( this );
4214
				self.empty().append(function(){
-
 
-
 
4878
 
4215
					return value.call( this, i, old );
4879
				self.html( value.call(this, i, self.html()) );
4216
				});
-
 
4217
			});
4880
			});
4218
 
4881
 
4219
		} else {
4882
		} else {
4220
			this.empty().append( value );
4883
			this.empty().append( value );
4221
		}
4884
		}
4222
 
4885
 
4223
		return this;
4886
		return this;
4224
	},
4887
	},
4225
 
4888
 
4226
	replaceWith: function( value ) {
4889
	replaceWith: function( value ) {
4227
		if ( this[0] && this[0].parentNode ) {
4890
		if ( this[0] && this[0].parentNode ) {
4228
			// Make sure that the elements are removed from the DOM before they are inserted
4891
			// Make sure that the elements are removed from the DOM before they are inserted
4229
			// this can help fix replacing a parent with child elements
4892
			// this can help fix replacing a parent with child elements
4230
			if ( jQuery.isFunction( value ) ) {
4893
			if ( jQuery.isFunction( value ) ) {
4231
				return this.each(function(i) {
4894
				return this.each(function(i) {
4232
					var self = jQuery(this), old = self.html();
4895
					var self = jQuery(this), old = self.html();
4233
					self.replaceWith( value.call( this, i, old ) );
4896
					self.replaceWith( value.call( this, i, old ) );
4234
				});
4897
				});
4235
			}
4898
			}
4236
 
4899
 
4237
			if ( typeof value !== "string" ) {
4900
			if ( typeof value !== "string" ) {
4238
				value = jQuery(value).detach();
4901
				value = jQuery( value ).detach();
4239
			}
4902
			}
4240
 
4903
 
4241
			return this.each(function() {
4904
			return this.each(function() {
4242
				var next = this.nextSibling, parent = this.parentNode;
4905
				var next = this.nextSibling,
-
 
4906
					parent = this.parentNode;
4243
 
4907
 
4244
				jQuery(this).remove();
4908
				jQuery( this ).remove();
4245
 
4909
 
4246
				if ( next ) {
4910
				if ( next ) {
4247
					jQuery(next).before( value );
4911
					jQuery(next).before( value );
4248
				} else {
4912
				} else {
4249
					jQuery(parent).append( value );
4913
					jQuery(parent).append( value );
4250
				}
4914
				}
4251
			});
4915
			});
4252
		} else {
4916
		} else {
4253
			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
4917
			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
4254
		}
4918
		}
4255
	},
4919
	},
4256
 
4920
 
4257
	detach: function( selector ) {
4921
	detach: function( selector ) {
4258
		return this.remove( selector, true );
4922
		return this.remove( selector, true );
4259
	},
4923
	},
4260
 
4924
 
4261
	domManip: function( args, table, callback ) {
4925
	domManip: function( args, table, callback ) {
4262
		var results, first, value = args[0], scripts = [], fragment, parent;
4926
		var results, first, fragment, parent,
-
 
4927
			value = args[0],
-
 
4928
			scripts = [];
4263
 
4929
 
4264
		// We can't cloneNode fragments that contain checked, in WebKit
4930
		// We can't cloneNode fragments that contain checked, in WebKit
4265
		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
4931
		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
4266
			return this.each(function() {
4932
			return this.each(function() {
4267
				jQuery(this).domManip( args, table, callback, true );
4933
				jQuery(this).domManip( args, table, callback, true );
4268
			});
4934
			});
4269
		}
4935
		}
4270
 
4936
 
4271
		if ( jQuery.isFunction(value) ) {
4937
		if ( jQuery.isFunction(value) ) {
4272
			return this.each(function(i) {
4938
			return this.each(function(i) {
4273
				var self = jQuery(this);
4939
				var self = jQuery(this);
4274
				args[0] = value.call(this, i, table ? self.html() : undefined);
4940
				args[0] = value.call(this, i, table ? self.html() : undefined);
4275
				self.domManip( args, table, callback );
4941
				self.domManip( args, table, callback );
4276
			});
4942
			});
4277
		}
4943
		}
4278
 
4944
 
4279
		if ( this[0] ) {
4945
		if ( this[0] ) {
4280
			parent = value && value.parentNode;
4946
			parent = value && value.parentNode;
4281
 
4947
 
4282
			// If we're in a fragment, just use that instead of building a new one
4948
			// If we're in a fragment, just use that instead of building a new one
4283
			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
4949
			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
4284
				results = { fragment: parent };
4950
				results = { fragment: parent };
4285
 
4951
 
4286
			} else {
4952
			} else {
4287
				results = buildFragment( args, this, scripts );
4953
				results = jQuery.buildFragment( args, this, scripts );
4288
			}
4954
			}
4289
			
4955
			
4290
			fragment = results.fragment;
4956
			fragment = results.fragment;
4291
			
4957
			
4292
			if ( fragment.childNodes.length === 1 ) {
4958
			if ( fragment.childNodes.length === 1 ) {
4293
				first = fragment = fragment.firstChild;
4959
				first = fragment = fragment.firstChild;
4294
			} else {
4960
			} else {
4295
				first = fragment.firstChild;
4961
				first = fragment.firstChild;
4296
			}
4962
			}
4297
 
4963
 
4298
			if ( first ) {
4964
			if ( first ) {
4299
				table = table && jQuery.nodeName( first, "tr" );
4965
				table = table && jQuery.nodeName( first, "tr" );
4300
 
4966
 
4301
				for ( var i = 0, l = this.length; i < l; i++ ) {
4967
				for ( var i = 0, l = this.length; i < l; i++ ) {
4302
					callback.call(
4968
					callback.call(
4303
						table ?
4969
						table ?
4304
							root(this[i], first) :
4970
							root(this[i], first) :
4305
							this[i],
4971
							this[i],
4306
						i > 0 || results.cacheable || this.length > 1  ?
4972
						i > 0 || results.cacheable || this.length > 1  ?
4307
							fragment.cloneNode(true) :
4973
							fragment.cloneNode(true) :
4308
							fragment
4974
							fragment
4309
					);
4975
					);
4310
				}
4976
				}
4311
			}
4977
			}
4312
 
4978
 
4313
			if ( scripts.length ) {
4979
			if ( scripts.length ) {
4314
				jQuery.each( scripts, evalScript );
4980
				jQuery.each( scripts, evalScript );
4315
			}
4981
			}
4316
		}
4982
		}
4317
 
4983
 
4318
		return this;
4984
		return this;
-
 
4985
	}
-
 
4986
});
4319
 
4987
 
4320
		function root( elem, cur ) {
4988
function root( elem, cur ) {
4321
			return jQuery.nodeName(elem, "table") ?
4989
	return jQuery.nodeName(elem, "table") ?
4322
				(elem.getElementsByTagName("tbody")[0] ||
4990
		(elem.getElementsByTagName("tbody")[0] ||
4323
				elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
4991
		elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
4324
				elem;
4992
		elem;
4325
		}
4993
}
4326
	}
-
 
4327
});
-
 
4328
 
4994
 
4329
function cloneCopyEvent(orig, ret) {
4995
function cloneCopyEvent(orig, ret) {
4330
	var i = 0;
4996
	var i = 0;
4331
 
4997
 
4332
	ret.each(function() {
4998
	ret.each(function() {
4333
		if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
4999
		if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
4334
			return;
5000
			return;
4335
		}
5001
		}
-
 
5002
 
4336
 
5003
		var oldData = jQuery.data( orig[i++] ),
-
 
5004
			curData = jQuery.data( this, oldData ),
4337
		var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
5005
			events = oldData && oldData.events;
4338
 
5006
 
4339
		if ( events ) {
5007
		if ( events ) {
4340
			delete curData.handle;
5008
			delete curData.handle;
4341
			curData.events = {};
5009
			curData.events = {};
4342
 
5010
 
4343
			for ( var type in events ) {
5011
			for ( var type in events ) {
4344
				for ( var handler in events[ type ] ) {
5012
				for ( var handler in events[ type ] ) {
4345
					jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
5013
					jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
4346
				}
5014
				}
4347
			}
5015
			}
4348
		}
5016
		}
4349
	});
5017
	});
4350
}
5018
}
4351
 
5019
 
4352
function buildFragment( args, nodes, scripts ) {
5020
jQuery.buildFragment = function( args, nodes, scripts ) {
4353
	var fragment, cacheable, cacheresults,
5021
	var fragment, cacheable, cacheresults,
4354
		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
5022
		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
4355
 
5023
 
4356
	// Only cache "small" (1/2 KB) strings that are associated with the main document
5024
	// Only cache "small" (1/2 KB) strings that are associated with the main document
4357
	// Cloning options loses the selected state, so don't cache them
5025
	// Cloning options loses the selected state, so don't cache them
4358
	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
5026
	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
4359
	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
5027
	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
4360
	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
5028
	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
4361
		!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
5029
		!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
4362
 
5030
 
4363
		cacheable = true;
5031
		cacheable = true;
4364
		cacheresults = jQuery.fragments[ args[0] ];
5032
		cacheresults = jQuery.fragments[ args[0] ];
4365
		if ( cacheresults ) {
5033
		if ( cacheresults ) {
4366
			if ( cacheresults !== 1 ) {
5034
			if ( cacheresults !== 1 ) {
4367
				fragment = cacheresults;
5035
				fragment = cacheresults;
4368
			}
5036
			}
4369
		}
5037
		}
4370
	}
5038
	}
4371
 
5039
 
4372
	if ( !fragment ) {
5040
	if ( !fragment ) {
4373
		fragment = doc.createDocumentFragment();
5041
		fragment = doc.createDocumentFragment();
4374
		jQuery.clean( args, doc, fragment, scripts );
5042
		jQuery.clean( args, doc, fragment, scripts );
4375
	}
5043
	}
4376
 
5044
 
4377
	if ( cacheable ) {
5045
	if ( cacheable ) {
4378
		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
5046
		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
4379
	}
5047
	}
4380
 
5048
 
4381
	return { fragment: fragment, cacheable: cacheable };
5049
	return { fragment: fragment, cacheable: cacheable };
4382
}
5050
};
4383
 
5051
 
4384
jQuery.fragments = {};
5052
jQuery.fragments = {};
4385
 
5053
 
4386
jQuery.each({
5054
jQuery.each({
4387
	appendTo: "append",
5055
	appendTo: "append",
4388
	prependTo: "prepend",
5056
	prependTo: "prepend",
4389
	insertBefore: "before",
5057
	insertBefore: "before",
4390
	insertAfter: "after",
5058
	insertAfter: "after",
4391
	replaceAll: "replaceWith"
5059
	replaceAll: "replaceWith"
4392
}, function( name, original ) {
5060
}, function( name, original ) {
4393
	jQuery.fn[ name ] = function( selector ) {
5061
	jQuery.fn[ name ] = function( selector ) {
-
 
5062
		var ret = [],
4394
		var ret = [], insert = jQuery( selector ),
5063
			insert = jQuery( selector ),
4395
			parent = this.length === 1 && this[0].parentNode;
5064
			parent = this.length === 1 && this[0].parentNode;
4396
		
5065
		
4397
		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
5066
		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
4398
			insert[ original ]( this[0] );
5067
			insert[ original ]( this[0] );
4399
			return this;
5068
			return this;
4400
			
5069
			
4401
		} else {
5070
		} else {
4402
			for ( var i = 0, l = insert.length; i < l; i++ ) {
5071
			for ( var i = 0, l = insert.length; i < l; i++ ) {
4403
				var elems = (i > 0 ? this.clone(true) : this).get();
5072
				var elems = (i > 0 ? this.clone(true) : this).get();
4404
				jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
5073
				jQuery( insert[i] )[ original ]( elems );
4405
				ret = ret.concat( elems );
5074
				ret = ret.concat( elems );
4406
			}
5075
			}
4407
		
5076
		
4408
			return this.pushStack( ret, name, insert.selector );
5077
			return this.pushStack( ret, name, insert.selector );
4409
		}
5078
		}
4410
	};
5079
	};
4411
});
5080
});
4412
 
5081
 
4413
jQuery.extend({
5082
jQuery.extend({
4414
	clean: function( elems, context, fragment, scripts ) {
5083
	clean: function( elems, context, fragment, scripts ) {
4415
		context = context || document;
5084
		context = context || document;
4416
 
5085
 
4417
		// !context.createElement fails in IE with an error but returns typeof 'object'
5086
		// !context.createElement fails in IE with an error but returns typeof 'object'
4418
		if ( typeof context.createElement === "undefined" ) {
5087
		if ( typeof context.createElement === "undefined" ) {
4419
			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
5088
			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
4420
		}
5089
		}
4421
 
5090
 
4422
		var ret = [];
5091
		var ret = [];
4423
 
5092
 
4424
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
5093
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
4425
			if ( typeof elem === "number" ) {
5094
			if ( typeof elem === "number" ) {
4426
				elem += "";
5095
				elem += "";
4427
			}
5096
			}
4428
 
5097
 
4429
			if ( !elem ) {
5098
			if ( !elem ) {
4430
				continue;
5099
				continue;
4431
			}
5100
			}
4432
 
5101
 
4433
			// Convert html string into DOM nodes
5102
			// Convert html string into DOM nodes
4434
			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
5103
			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
4435
				elem = context.createTextNode( elem );
5104
				elem = context.createTextNode( elem );
4436
 
5105
 
4437
			} else if ( typeof elem === "string" ) {
5106
			} else if ( typeof elem === "string" ) {
4438
				// Fix "XHTML"-style tags in all browsers
5107
				// Fix "XHTML"-style tags in all browsers
4439
				elem = elem.replace(rxhtmlTag, fcloseTag);
5108
				elem = elem.replace(rxhtmlTag, "<$1></$2>");
4440
 
5109
 
4441
				// Trim whitespace, otherwise indexOf won't work as expected
5110
				// Trim whitespace, otherwise indexOf won't work as expected
4442
				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
5111
				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
4443
					wrap = wrapMap[ tag ] || wrapMap._default,
5112
					wrap = wrapMap[ tag ] || wrapMap._default,
4444
					depth = wrap[0],
5113
					depth = wrap[0],
4445
					div = context.createElement("div");
5114
					div = context.createElement("div");
4446
 
5115
 
4447
				// Go to html and back, then peel off extra wrappers
5116
				// Go to html and back, then peel off extra wrappers
4448
				div.innerHTML = wrap[1] + elem + wrap[2];
5117
				div.innerHTML = wrap[1] + elem + wrap[2];
4449
 
5118
 
4450
				// Move to the right depth
5119
				// Move to the right depth
4451
				while ( depth-- ) {
5120
				while ( depth-- ) {
4452
					div = div.lastChild;
5121
					div = div.lastChild;
4453
				}
5122
				}
4454
 
5123
 
4455
				// Remove IE's autoinserted <tbody> from table fragments
5124
				// Remove IE's autoinserted <tbody> from table fragments
4456
				if ( !jQuery.support.tbody ) {
5125
				if ( !jQuery.support.tbody ) {
4457
 
5126
 
4458
					// String was a <table>, *may* have spurious <tbody>
5127
					// String was a <table>, *may* have spurious <tbody>
4459
					var hasBody = rtbody.test(elem),
5128
					var hasBody = rtbody.test(elem),
4460
						tbody = tag === "table" && !hasBody ?
5129
						tbody = tag === "table" && !hasBody ?
4461
							div.firstChild && div.firstChild.childNodes :
5130
							div.firstChild && div.firstChild.childNodes :
4462
 
5131
 
4463
							// String was a bare <thead> or <tfoot>
5132
							// String was a bare <thead> or <tfoot>
4464
							wrap[1] === "<table>" && !hasBody ?
5133
							wrap[1] === "<table>" && !hasBody ?
4465
								div.childNodes :
5134
								div.childNodes :
4466
								[];
5135
								[];
4467
 
5136
 
4468
					for ( var j = tbody.length - 1; j >= 0 ; --j ) {
5137
					for ( var j = tbody.length - 1; j >= 0 ; --j ) {
4469
						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
5138
						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
4470
							tbody[ j ].parentNode.removeChild( tbody[ j ] );
5139
							tbody[ j ].parentNode.removeChild( tbody[ j ] );
4471
						}
5140
						}
4472
					}
5141
					}
4473
 
5142
 
4474
				}
5143
				}
4475
 
5144
 
4476
				// IE completely kills leading whitespace when innerHTML is used
5145
				// IE completely kills leading whitespace when innerHTML is used
4477
				if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5146
				if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
4478
					div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
5147
					div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
4479
				}
5148
				}
4480
 
5149
 
4481
				elem = div.childNodes;
5150
				elem = div.childNodes;
4482
			}
5151
			}
4483
 
5152
 
4484
			if ( elem.nodeType ) {
5153
			if ( elem.nodeType ) {
4485
				ret.push( elem );
5154
				ret.push( elem );
4486
			} else {
5155
			} else {
4487
				ret = jQuery.merge( ret, elem );
5156
				ret = jQuery.merge( ret, elem );
4488
			}
5157
			}
4489
		}
5158
		}
4490
 
5159
 
4491
		if ( fragment ) {
5160
		if ( fragment ) {
4492
			for ( var i = 0; ret[i]; i++ ) {
5161
			for ( i = 0; ret[i]; i++ ) {
4493
				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
5162
				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
4494
					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
5163
					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
4495
				
5164
				
4496
				} else {
5165
				} else {
4497
					if ( ret[i].nodeType === 1 ) {
5166
					if ( ret[i].nodeType === 1 ) {
4498
						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
5167
						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
4499
					}
5168
					}
4500
					fragment.appendChild( ret[i] );
5169
					fragment.appendChild( ret[i] );
4501
				}
5170
				}
4502
			}
5171
			}
4503
		}
5172
		}
4504
 
5173
 
4505
		return ret;
5174
		return ret;
4506
	},
5175
	},
4507
	
5176
	
4508
	cleanData: function( elems ) {
5177
	cleanData: function( elems ) {
4509
		var data, id, cache = jQuery.cache,
5178
		var data, id, cache = jQuery.cache,
4510
			special = jQuery.event.special,
5179
			special = jQuery.event.special,
4511
			deleteExpando = jQuery.support.deleteExpando;
5180
			deleteExpando = jQuery.support.deleteExpando;
4512
		
5181
		
4513
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
5182
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-
 
5183
			if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
-
 
5184
				continue;
-
 
5185
			}
-
 
5186
 
4514
			id = elem[ jQuery.expando ];
5187
			id = elem[ jQuery.expando ];
4515
			
5188
			
4516
			if ( id ) {
5189
			if ( id ) {
4517
				data = cache[ id ];
5190
				data = cache[ id ];
4518
				
5191
				
4519
				if ( data.events ) {
5192
				if ( data && data.events ) {
4520
					for ( var type in data.events ) {
5193
					for ( var type in data.events ) {
4521
						if ( special[ type ] ) {
5194
						if ( special[ type ] ) {
4522
							jQuery.event.remove( elem, type );
5195
							jQuery.event.remove( elem, type );
4523
 
5196
 
4524
						} else {
5197
						} else {
4525
							removeEvent( elem, type, data.handle );
5198
							jQuery.removeEvent( elem, type, data.handle );
4526
						}
5199
						}
4527
					}
5200
					}
4528
				}
5201
				}
4529
				
5202
				
4530
				if ( deleteExpando ) {
5203
				if ( deleteExpando ) {
4531
					delete elem[ jQuery.expando ];
5204
					delete elem[ jQuery.expando ];
4532
 
5205
 
4533
				} else if ( elem.removeAttribute ) {
5206
				} else if ( elem.removeAttribute ) {
4534
					elem.removeAttribute( jQuery.expando );
5207
					elem.removeAttribute( jQuery.expando );
4535
				}
5208
				}
4536
				
5209
				
4537
				delete cache[ id ];
5210
				delete cache[ id ];
4538
			}
5211
			}
4539
		}
5212
		}
4540
	}
5213
	}
4541
});
5214
});
-
 
5215
 
4542
// exclude the following css properties to add px
5216
function evalScript( i, elem ) {
-
 
5217
	if ( elem.src ) {
-
 
5218
		jQuery.ajax({
-
 
5219
			url: elem.src,
-
 
5220
			async: false,
-
 
5221
			dataType: "script"
-
 
5222
		});
-
 
5223
	} else {
4543
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
5224
		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
 
5225
	}
-
 
5226
 
-
 
5227
	if ( elem.parentNode ) {
-
 
5228
		elem.parentNode.removeChild( elem );
-
 
5229
	}
-
 
5230
}
-
 
5231
 
-
 
5232
 
-
 
5233
 
-
 
5234
 
4544
	ralpha = /alpha\([^)]*\)/,
5235
var ralpha = /alpha\([^)]*\)/i,
4545
	ropacity = /opacity=([^)]*)/,
5236
	ropacity = /opacity=([^)]*)/,
4546
	rfloat = /float/i,
-
 
4547
	rdashAlpha = /-([a-z])/ig,
5237
	rdashAlpha = /-([a-z])/ig,
4548
	rupper = /([A-Z])/g,
5238
	rupper = /([A-Z])/g,
4549
	rnumpx = /^-?\d+(?:px)?$/i,
5239
	rnumpx = /^-?\d+(?:px)?$/i,
4550
	rnum = /^-?\d/,
5240
	rnum = /^-?\d/,
4551
 
5241
 
4552
	cssShow = { position: "absolute", visibility: "hidden", display:"block" },
5242
	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
4553
	cssWidth = [ "Left", "Right" ],
5243
	cssWidth = [ "Left", "Right" ],
4554
	cssHeight = [ "Top", "Bottom" ],
5244
	cssHeight = [ "Top", "Bottom" ],
-
 
5245
	curCSS,
-
 
5246
 
-
 
5247
	getComputedStyle,
-
 
5248
	currentStyle,
4555
 
-
 
4556
	// cache check for defaultView.getComputedStyle
-
 
4557
	getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
-
 
4558
	// normalize float css property
-
 
4559
	styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
5249
 
4560
	fcamelCase = function( all, letter ) {
5250
	fcamelCase = function( all, letter ) {
4561
		return letter.toUpperCase();
5251
		return letter.toUpperCase();
4562
	};
5252
	};
4563
 
5253
 
4564
jQuery.fn.css = function( name, value ) {
5254
jQuery.fn.css = function( name, value ) {
4565
	return access( this, name, value, true, function( elem, name, value ) {
-
 
4566
		if ( value === undefined ) {
5255
	// Setting 'undefined' is a no-op
4567
			return jQuery.curCSS( elem, name );
-
 
4568
		}
-
 
4569
		
-
 
4570
		if ( typeof value === "number" && !rexclude.test(name) ) {
5256
	if ( arguments.length === 2 && value === undefined ) {
4571
			value += "px";
5257
		return this;
4572
		}
5258
	}
-
 
5259
 
-
 
5260
	return jQuery.access( this, name, value, true, function( elem, name, value ) {
4573
 
5261
		return value !== undefined ?
-
 
5262
			jQuery.style( elem, name, value ) :
4574
		jQuery.style( elem, name, value );
5263
			jQuery.css( elem, name );
4575
	});
5264
	});
4576
};
5265
};
4577
 
5266
 
4578
jQuery.extend({
5267
jQuery.extend({
-
 
5268
	// Add in style property hooks for overriding the default
-
 
5269
	// behavior of getting and setting a style property
-
 
5270
	cssHooks: {
-
 
5271
		opacity: {
4579
	style: function( elem, name, value ) {
5272
			get: function( elem, computed ) {
-
 
5273
				if ( computed ) {
4580
		// don't set styles on text and comment nodes
5274
					// We should always get a number back from opacity
4581
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
5275
					var ret = curCSS( elem, "opacity", "opacity" );
4582
			return undefined;
5276
					return ret === "" ? "1" : ret;
4583
		}
-
 
4584
 
5277
 
4585
		// ignore negative width and height values #1599
5278
				} else {
4586
		if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
5279
					return elem.style.opacity;
4587
			value = undefined;
5280
				}
-
 
5281
			}
-
 
5282
		}
4588
		}
5283
	},
-
 
5284
 
-
 
5285
	// Exclude the following css properties to add px
-
 
5286
	cssNumber: {
-
 
5287
		"zIndex": true,
-
 
5288
		"fontWeight": true,
-
 
5289
		"opacity": true,
-
 
5290
		"zoom": true,
4589
 
5291
		"lineHeight": true
4590
		var style = elem.style || elem, set = value !== undefined;
5292
	},
4591
 
5293
 
4592
		// IE uses filters for opacity
5294
	// Add in properties whose names you wish to fix before
4593
		if ( !jQuery.support.opacity && name === "opacity" ) {
5295
	// setting or getting the value
4594
			if ( set ) {
5296
	cssProps: {
4595
				// IE has trouble with opacity if it does not have layout
5297
		// normalize float css property
4596
				// Force it by setting the zoom level
5298
		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
4597
				style.zoom = 1;
5299
	},
4598
 
5300
 
-
 
5301
	// Get and set the style property on a DOM Node
4599
				// Set the alpha filter to set the opacity
5302
	style: function( elem, name, value, extra ) {
4600
				var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
5303
		// Don't set styles on text and comment nodes
4601
				var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
5304
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
4602
				style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
5305
			return;
4603
			}
-
 
-
 
5306
		}
-
 
5307
 
4604
 
5308
		// Make sure that we're working with the right name
4605
			return style.filter && style.filter.indexOf("opacity=") >= 0 ?
5309
		var ret, origName = jQuery.camelCase( name ),
-
 
5310
			style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
 
5311
 
4606
				(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
5312
		name = jQuery.cssProps[ origName ] || origName;
4607
				"";
5313
 
-
 
5314
		// Check if we're setting a value
4608
		}
5315
		if ( value !== undefined ) {
-
 
5316
			// Make sure that NaN and null values aren't set. See: #7116
-
 
5317
			if ( typeof value === "number" && isNaN( value ) || value == null ) {
-
 
5318
				return;
-
 
5319
			}
-
 
5320
 
-
 
5321
			// If a number was passed in, add 'px' to the (except for certain CSS properties)
4609
 
5322
			if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
4610
		// Make sure we're using the right name for getting the float value
5323
				value += "px";
-
 
5324
			}
-
 
5325
 
-
 
5326
			// If a hook was provided, use that value, otherwise just set the specified value
-
 
5327
			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
-
 
5328
				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-
 
5329
				// Fixes bug #5509
-
 
5330
				try {
4611
		if ( rfloat.test( name ) ) {
5331
					style[ name ] = value;
-
 
5332
				} catch(e) {}
4612
			name = styleFloat;
5333
			}
-
 
5334
 
4613
		}
5335
		} else {
4614
 
5336
			// If a hook was provided get the non-computed value from there
4615
		name = name.replace(rdashAlpha, fcamelCase);
5337
			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
4616
 
5338
				return ret;
-
 
5339
			}
4617
		if ( set ) {
-
 
4618
			style[ name ] = value;
5340
 
4619
		}
5341
			// Otherwise just get the value from the style object
-
 
5342
			return style[ name ];
4620
 
5343
		}
-
 
5344
	},
-
 
5345
 
-
 
5346
	css: function( elem, name, extra ) {
-
 
5347
		// Make sure that we're working with the right name
4621
		return style[ name ];
5348
		var ret, origName = jQuery.camelCase( name ),
-
 
5349
			hooks = jQuery.cssHooks[ origName ];
-
 
5350
 
4622
	},
5351
		name = jQuery.cssProps[ origName ] || origName;
4623
 
5352
 
-
 
5353
		// If a hook was provided get the computed value from there
4624
	css: function( elem, name, force, extra ) {
5354
		if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
-
 
5355
			return ret;
-
 
5356
 
-
 
5357
		// Otherwise, if a way to get the computed value exists, use that
4625
		if ( name === "width" || name === "height" ) {
5358
		} else if ( curCSS ) {
4626
			var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
5359
			return curCSS( elem, name, origName );
-
 
5360
		}
4627
 
5361
	},
4628
			function getWH() {
5362
 
4629
				val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
5363
	// A method for quickly swapping in/out CSS properties to get correct calculations
4630
 
5364
	swap: function( elem, options, callback ) {
4631
				if ( extra === "border" ) {
5365
		var old = {};
-
 
5366
 
-
 
5367
		// Remember the old values, and insert the new ones
-
 
5368
		for ( var name in options ) {
4632
					return;
5369
			old[ name ] = elem.style[ name ];
-
 
5370
			elem.style[ name ] = options[ name ];
-
 
5371
		}
-
 
5372
 
-
 
5373
		callback.call( elem );
-
 
5374
 
-
 
5375
		// Revert the old values
-
 
5376
		for ( name in options ) {
-
 
5377
			elem.style[ name ] = old[ name ];
-
 
5378
		}
-
 
5379
	},
4633
				}
5380
 
4634
 
5381
	camelCase: function( string ) {
-
 
5382
		return string.replace( rdashAlpha, fcamelCase );
4635
				jQuery.each( which, function() {
5383
	}
4636
					if ( !extra ) {
5384
});
-
 
5385
 
-
 
5386
// DEPRECATED, Use jQuery.css() instead
4637
						val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
5387
jQuery.curCSS = jQuery.css;
-
 
5388
 
4638
					}
5389
jQuery.each(["height", "width"], function( i, name ) {
4639
 
-
 
-
 
5390
	jQuery.cssHooks[ name ] = {
4640
					if ( extra === "margin" ) {
5391
		get: function( elem, computed, extra ) {
4641
						val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
5392
			var val;
-
 
5393
 
4642
					} else {
5394
			if ( computed ) {
4643
						val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
5395
				if ( elem.offsetWidth !== 0 ) {
-
 
5396
					val = getWH( elem, name, extra );
-
 
5397
 
-
 
5398
				} else {
4644
					}
5399
					jQuery.swap( elem, cssShow, function() {
4645
				});
-
 
4646
			}
-
 
4647
 
5400
						val = getWH( elem, name, extra );
4648
			if ( elem.offsetWidth !== 0 ) {
-
 
4649
				getWH();
5401
					});
4650
			} else {
5402
				}
4651
				jQuery.swap( elem, props, getWH );
5403
 
4652
			}
5404
				if ( val <= 0 ) {
4653
 
5405
					val = curCSS( elem, name, name );
4654
			return Math.max(0, Math.round(val));
-
 
4655
		}
-
 
4656
 
5406
 
-
 
5407
					if ( val === "0px" && currentStyle ) {
-
 
5408
						val = currentStyle( elem, name, name );
4657
		return jQuery.curCSS( elem, name, force );
5409
					}
-
 
5410
 
4658
	},
5411
					if ( val != null ) {
4659
 
5412
						// Should return "auto" instead of 0, use 0 for
-
 
5413
						// temporary backwards-compat
-
 
5414
						return val === "" || val === "auto" ? "0px" : val;
4660
	curCSS: function( elem, name, force ) {
5415
					}
4661
		var ret, style = elem.style, filter;
5416
				}
4662
 
5417
 
4663
		// IE uses filters for opacity
5418
				if ( val < 0 || val == null ) {
-
 
5419
					val = elem.style[ name ];
-
 
5420
 
-
 
5421
					// Should return "auto" instead of 0, use 0 for
-
 
5422
					// temporary backwards-compat
-
 
5423
					return val === "" || val === "auto" ? "0px" : val;
-
 
5424
				}
-
 
5425
 
4664
		if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
5426
				return typeof val === "string" ? val : val + "px";
-
 
5427
			}
-
 
5428
		},
-
 
5429
 
4665
			ret = ropacity.test(elem.currentStyle.filter || "") ?
5430
		set: function( elem, value ) {
-
 
5431
			if ( rnumpx.test( value ) ) {
4666
				(parseFloat(RegExp.$1) / 100) + "" :
5432
				// ignore negative width and height values #1599
4667
				"";
5433
				value = parseFloat(value);
-
 
5434
 
-
 
5435
				if ( value >= 0 ) {
-
 
5436
					return value + "px";
-
 
5437
				}
-
 
5438
 
-
 
5439
			} else {
-
 
5440
				return value;
-
 
5441
			}
-
 
5442
		}
-
 
5443
	};
-
 
5444
});
-
 
5445
 
4668
 
5446
if ( !jQuery.support.opacity ) {
-
 
5447
	jQuery.cssHooks.opacity = {
-
 
5448
		get: function( elem, computed ) {
4669
			return ret === "" ?
5449
			// IE uses filters for opacity
4670
				"1" :
5450
			return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
-
 
5451
				(parseFloat(RegExp.$1) / 100) + "" :
4671
				ret;
5452
				computed ? "1" : "";
-
 
5453
		},
4672
		}
5454
 
-
 
5455
		set: function( elem, value ) {
4673
 
5456
			var style = elem.style;
-
 
5457
 
4674
		// Make sure we're using the right name for getting the float value
5458
			// IE has trouble with opacity if it does not have layout
4675
		if ( rfloat.test( name ) ) {
5459
			// Force it by setting the zoom level
4676
			name = styleFloat;
5460
			style.zoom = 1;
4677
		}
5461
 
4678
 
-
 
-
 
5462
			// Set the alpha filter to set the opacity
-
 
5463
			var opacity = jQuery.isNaN(value) ?
-
 
5464
				"" :
-
 
5465
				"alpha(opacity=" + value * 100 + ")",
-
 
5466
				filter = style.filter || "";
4679
		if ( !force && style && style[ name ] ) {
5467
 
-
 
5468
			style.filter = ralpha.test(filter) ?
4680
			ret = style[ name ];
5469
				filter.replace(ralpha, opacity) :
4681
 
5470
				style.filter + ' ' + opacity;
4682
		} else if ( getComputedStyle ) {
5471
		}
4683
 
5472
	};
4684
			// Only "float" is needed here
5473
}
4685
			if ( rfloat.test( name ) ) {
5474
 
4686
				name = "float";
5475
if ( document.defaultView && document.defaultView.getComputedStyle ) {
4687
			}
5476
	getComputedStyle = function( elem, newName, name ) {
4688
 
5477
		var ret, defaultView, computedStyle;
4689
			name = name.replace( rupper, "-$1" ).toLowerCase();
5478
 
4690
 
5479
		name = name.replace( rupper, "-$1" ).toLowerCase();
4691
			var defaultView = elem.ownerDocument.defaultView;
5480
 
4692
 
5481
		if ( !(defaultView = elem.ownerDocument.defaultView) ) {
4693
			if ( !defaultView ) {
5482
			return undefined;
4694
				return null;
5483
		}
4695
			}
5484
 
4696
 
5485
		if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
4697
			var computedStyle = defaultView.getComputedStyle( elem, null );
5486
			ret = computedStyle.getPropertyValue( name );
4698
 
5487
			if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
4699
			if ( computedStyle ) {
5488
				ret = jQuery.style( elem, name );
4700
				ret = computedStyle.getPropertyValue( name );
5489
			}
4701
			}
5490
		}
4702
 
5491
 
4703
			// We should always get a number back from opacity
5492
		return ret;
4704
			if ( name === "opacity" && ret === "" ) {
5493
	};
4705
				ret = "1";
5494
}
4706
			}
5495
 
4707
 
5496
if ( document.documentElement.currentStyle ) {
4708
		} else if ( elem.currentStyle ) {
5497
	currentStyle = function( elem, name ) {
4709
			var camelCase = name.replace(rdashAlpha, fcamelCase);
5498
		var left, rsLeft,
4710
 
5499
			ret = elem.currentStyle && elem.currentStyle[ name ],
4711
			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
5500
			style = elem.style;
4712
 
5501
 
4713
			// From the awesome hack by Dean Edwards
5502
		// From the awesome hack by Dean Edwards
4714
			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
5503
		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
4715
 
5504
 
4716
			// If we're not dealing with a regular pixel number
5505
		// If we're not dealing with a regular pixel number
4717
			// but a number that has a weird ending, we need to convert it to pixels
5506
		// but a number that has a weird ending, we need to convert it to pixels
4718
			if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
5507
		if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
4719
				// Remember the original values
5508
			// Remember the original values
-
 
5509
			left = style.left;
4720
				var left = style.left, rsLeft = elem.runtimeStyle.left;
5510
			rsLeft = elem.runtimeStyle.left;
4721
 
5511
 
4722
				// Put in the new values to get a computed value out
5512
			// Put in the new values to get a computed value out
4723
				elem.runtimeStyle.left = elem.currentStyle.left;
5513
			elem.runtimeStyle.left = elem.currentStyle.left;
4724
				style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
5514
			style.left = name === "fontSize" ? "1em" : (ret || 0);
4725
				ret = style.pixelLeft + "px";
5515
			ret = style.pixelLeft + "px";
4726
 
5516
 
4727
				// Revert the changed values
5517
			// Revert the changed values
4728
				style.left = left;
5518
			style.left = left;
4729
				elem.runtimeStyle.left = rsLeft;
5519
			elem.runtimeStyle.left = rsLeft;
4730
			}
5520
		}
-
 
5521
 
-
 
5522
		return ret === "" ? "auto" : ret;
-
 
5523
	};
4731
		}
5524
}
4732
 
5525
 
4733
		return ret;
-
 
4734
	},
5526
curCSS = getComputedStyle || currentStyle;
4735
 
5527
 
4736
	// A method for quickly swapping in/out CSS properties to get correct calculations
5528
function getWH( elem, name, extra ) {
4737
	swap: function( elem, options, callback ) {
-
 
4738
		var old = {};
5529
	var which = name === "width" ? cssWidth : cssHeight,
4739
 
5530
		val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
4740
		// Remember the old values, and insert the new ones
-
 
4741
		for ( var name in options ) {
5531
 
4742
			old[ name ] = elem.style[ name ];
-
 
4743
			elem.style[ name ] = options[ name ];
-
 
4744
		}
5532
	if ( extra === "border" ) {
4745
 
5533
		return val;
4746
		callback.call( elem );
5534
	}
4747
 
5535
 
-
 
5536
	jQuery.each( which, function() {
-
 
5537
		if ( !extra ) {
-
 
5538
			val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
-
 
5539
		}
-
 
5540
 
-
 
5541
		if ( extra === "margin" ) {
4748
		// Revert the old values
5542
			val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
4749
		for ( var name in options ) {
5543
 
4750
			elem.style[ name ] = old[ name ];
5544
		} else {
4751
		}
5545
			val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
4752
	}
5546
		}
4753
});
5547
	});
-
 
5548
 
-
 
5549
	return val;
-
 
5550
}
4754
 
5551
 
4755
if ( jQuery.expr && jQuery.expr.filters ) {
5552
if ( jQuery.expr && jQuery.expr.filters ) {
4756
	jQuery.expr.filters.hidden = function( elem ) {
5553
	jQuery.expr.filters.hidden = function( elem ) {
4757
		var width = elem.offsetWidth, height = elem.offsetHeight,
5554
		var width = elem.offsetWidth,
4758
			skip = elem.nodeName.toLowerCase() === "tr";
5555
			height = elem.offsetHeight;
4759
 
-
 
4760
		return width === 0 && height === 0 && !skip ?
-
 
4761
			true :
-
 
4762
			width > 0 && height > 0 && !skip ?
-
 
4763
				false :
5556
 
4764
				jQuery.curCSS(elem, "display") === "none";
5557
		return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
4765
	};
5558
	};
4766
 
5559
 
4767
	jQuery.expr.filters.visible = function( elem ) {
5560
	jQuery.expr.filters.visible = function( elem ) {
4768
		return !jQuery.expr.filters.hidden( elem );
5561
		return !jQuery.expr.filters.hidden( elem );
4769
	};
5562
	};
4770
}
5563
}
-
 
5564
 
-
 
5565
 
-
 
5566
 
-
 
5567
 
4771
var jsc = now(),
5568
var jsc = jQuery.now(),
4772
	rscript = /<script(.|\s)*?\/script>/gi,
5569
	rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
4773
	rselectTextarea = /select|textarea/i,
5570
	rselectTextarea = /^(?:select|textarea)/i,
4774
	rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
5571
	rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
-
 
5572
	rnoContent = /^(?:GET|HEAD)$/,
-
 
5573
	rbracket = /\[\]$/,
4775
	jsre = /=\?(&|$)/,
5574
	jsre = /\=\?(&|$)/,
4776
	rquery = /\?/,
5575
	rquery = /\?/,
4777
	rts = /(\?|&)_=.*?(&|$)/,
5576
	rts = /([?&])_=[^&]*/,
4778
	rurl = /^(\w+:)?\/\/([^\/?#]+)/,
5577
	rurl = /^(\w+:)?\/\/([^\/?#]+)/,
4779
	r20 = /%20/g,
5578
	r20 = /%20/g,
-
 
5579
	rhash = /#.*$/,
4780
 
5580
 
4781
	// Keep a copy of the old load method
5581
	// Keep a copy of the old load method
4782
	_load = jQuery.fn.load;
5582
	_load = jQuery.fn.load;
4783
 
5583
 
4784
jQuery.fn.extend({
5584
jQuery.fn.extend({
4785
	load: function( url, params, callback ) {
5585
	load: function( url, params, callback ) {
4786
		if ( typeof url !== "string" ) {
5586
		if ( typeof url !== "string" && _load ) {
4787
			return _load.call( this, url );
5587
			return _load.apply( this, arguments );
4788
 
5588
 
4789
		// Don't do a request if no elements are being requested
5589
		// Don't do a request if no elements are being requested
4790
		} else if ( !this.length ) {
5590
		} else if ( !this.length ) {
4791
			return this;
5591
			return this;
4792
		}
5592
		}
4793
 
5593
 
4794
		var off = url.indexOf(" ");
5594
		var off = url.indexOf(" ");
4795
		if ( off >= 0 ) {
5595
		if ( off >= 0 ) {
4796
			var selector = url.slice(off, url.length);
5596
			var selector = url.slice(off, url.length);
4797
			url = url.slice(0, off);
5597
			url = url.slice(0, off);
4798
		}
5598
		}
4799
 
5599
 
4800
		// Default to a GET request
5600
		// Default to a GET request
4801
		var type = "GET";
5601
		var type = "GET";
4802
 
5602
 
4803
		// If the second parameter was provided
5603
		// If the second parameter was provided
4804
		if ( params ) {
5604
		if ( params ) {
4805
			// If it's a function
5605
			// If it's a function
4806
			if ( jQuery.isFunction( params ) ) {
5606
			if ( jQuery.isFunction( params ) ) {
4807
				// We assume that it's the callback
5607
				// We assume that it's the callback
4808
				callback = params;
5608
				callback = params;
4809
				params = null;
5609
				params = null;
4810
 
5610
 
4811
			// Otherwise, build a param string
5611
			// Otherwise, build a param string
4812
			} else if ( typeof params === "object" ) {
5612
			} else if ( typeof params === "object" ) {
4813
				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
5613
				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
4814
				type = "POST";
5614
				type = "POST";
4815
			}
5615
			}
4816
		}
5616
		}
4817
 
5617
 
4818
		var self = this;
5618
		var self = this;
4819
 
5619
 
4820
		// Request the remote document
5620
		// Request the remote document
4821
		jQuery.ajax({
5621
		jQuery.ajax({
4822
			url: url,
5622
			url: url,
4823
			type: type,
5623
			type: type,
4824
			dataType: "html",
5624
			dataType: "html",
4825
			data: params,
5625
			data: params,
4826
			complete: function( res, status ) {
5626
			complete: function( res, status ) {
4827
				// If successful, inject the HTML into all the matched elements
5627
				// If successful, inject the HTML into all the matched elements
4828
				if ( status === "success" || status === "notmodified" ) {
5628
				if ( status === "success" || status === "notmodified" ) {
4829
					// See if a selector was specified
5629
					// See if a selector was specified
4830
					self.html( selector ?
5630
					self.html( selector ?
4831
						// Create a dummy div to hold the results
5631
						// Create a dummy div to hold the results
4832
						jQuery("<div />")
5632
						jQuery("<div>")
4833
							// inject the contents of the document in, removing the scripts
5633
							// inject the contents of the document in, removing the scripts
4834
							// to avoid any 'Permission Denied' errors in IE
5634
							// to avoid any 'Permission Denied' errors in IE
4835
							.append(res.responseText.replace(rscript, ""))
5635
							.append(res.responseText.replace(rscript, ""))
4836
 
5636
 
4837
							// Locate the specified elements
5637
							// Locate the specified elements
4838
							.find(selector) :
5638
							.find(selector) :
4839
 
5639
 
4840
						// If not, just inject the full result
5640
						// If not, just inject the full result
4841
						res.responseText );
5641
						res.responseText );
4842
				}
5642
				}
4843
 
5643
 
4844
				if ( callback ) {
5644
				if ( callback ) {
4845
					self.each( callback, [res.responseText, status, res] );
5645
					self.each( callback, [res.responseText, status, res] );
4846
				}
5646
				}
4847
			}
5647
			}
4848
		});
5648
		});
4849
 
5649
 
4850
		return this;
5650
		return this;
4851
	},
5651
	},
4852
 
5652
 
4853
	serialize: function() {
5653
	serialize: function() {
4854
		return jQuery.param(this.serializeArray());
5654
		return jQuery.param(this.serializeArray());
4855
	},
5655
	},
-
 
5656
 
4856
	serializeArray: function() {
5657
	serializeArray: function() {
4857
		return this.map(function() {
5658
		return this.map(function() {
4858
			return this.elements ? jQuery.makeArray(this.elements) : this;
5659
			return this.elements ? jQuery.makeArray(this.elements) : this;
4859
		})
5660
		})
4860
		.filter(function() {
5661
		.filter(function() {
4861
			return this.name && !this.disabled &&
5662
			return this.name && !this.disabled &&
4862
				(this.checked || rselectTextarea.test(this.nodeName) ||
5663
				(this.checked || rselectTextarea.test(this.nodeName) ||
4863
					rinput.test(this.type));
5664
					rinput.test(this.type));
4864
		})
5665
		})
4865
		.map(function( i, elem ) {
5666
		.map(function( i, elem ) {
4866
			var val = jQuery(this).val();
5667
			var val = jQuery(this).val();
4867
 
5668
 
4868
			return val == null ?
5669
			return val == null ?
4869
				null :
5670
				null :
4870
				jQuery.isArray(val) ?
5671
				jQuery.isArray(val) ?
4871
					jQuery.map( val, function( val, i ) {
5672
					jQuery.map( val, function( val, i ) {
4872
						return { name: elem.name, value: val };
5673
						return { name: elem.name, value: val };
4873
					}) :
5674
					}) :
4874
					{ name: elem.name, value: val };
5675
					{ name: elem.name, value: val };
4875
		}).get();
5676
		}).get();
4876
	}
5677
	}
4877
});
5678
});
4878
 
5679
 
4879
// Attach a bunch of functions for handling common AJAX events
5680
// Attach a bunch of functions for handling common AJAX events
4880
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
5681
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
4881
	jQuery.fn[o] = function( f ) {
5682
	jQuery.fn[o] = function( f ) {
4882
		return this.bind(o, f);
5683
		return this.bind(o, f);
4883
	};
5684
	};
4884
});
5685
});
4885
 
5686
 
4886
jQuery.extend({
5687
jQuery.extend({
4887
 
-
 
4888
	get: function( url, data, callback, type ) {
5688
	get: function( url, data, callback, type ) {
4889
		// shift arguments if data argument was omited
5689
		// shift arguments if data argument was omited
4890
		if ( jQuery.isFunction( data ) ) {
5690
		if ( jQuery.isFunction( data ) ) {
4891
			type = type || callback;
5691
			type = type || callback;
4892
			callback = data;
5692
			callback = data;
4893
			data = null;
5693
			data = null;
4894
		}
5694
		}
4895
 
5695
 
4896
		return jQuery.ajax({
5696
		return jQuery.ajax({
4897
			type: "GET",
5697
			type: "GET",
4898
			url: url,
5698
			url: url,
4899
			data: data,
5699
			data: data,
4900
			success: callback,
5700
			success: callback,
4901
			dataType: type
5701
			dataType: type
4902
		});
5702
		});
4903
	},
5703
	},
4904
 
5704
 
4905
	getScript: function( url, callback ) {
5705
	getScript: function( url, callback ) {
4906
		return jQuery.get(url, null, callback, "script");
5706
		return jQuery.get(url, null, callback, "script");
4907
	},
5707
	},
4908
 
5708
 
4909
	getJSON: function( url, data, callback ) {
5709
	getJSON: function( url, data, callback ) {
4910
		return jQuery.get(url, data, callback, "json");
5710
		return jQuery.get(url, data, callback, "json");
4911
	},
5711
	},
4912
 
5712
 
4913
	post: function( url, data, callback, type ) {
5713
	post: function( url, data, callback, type ) {
4914
		// shift arguments if data argument was omited
5714
		// shift arguments if data argument was omited
4915
		if ( jQuery.isFunction( data ) ) {
5715
		if ( jQuery.isFunction( data ) ) {
4916
			type = type || callback;
5716
			type = type || callback;
4917
			callback = data;
5717
			callback = data;
4918
			data = {};
5718
			data = {};
4919
		}
5719
		}
4920
 
5720
 
4921
		return jQuery.ajax({
5721
		return jQuery.ajax({
4922
			type: "POST",
5722
			type: "POST",
4923
			url: url,
5723
			url: url,
4924
			data: data,
5724
			data: data,
4925
			success: callback,
5725
			success: callback,
4926
			dataType: type
5726
			dataType: type
4927
		});
5727
		});
4928
	},
5728
	},
4929
 
5729
 
4930
	ajaxSetup: function( settings ) {
5730
	ajaxSetup: function( settings ) {
4931
		jQuery.extend( jQuery.ajaxSettings, settings );
5731
		jQuery.extend( jQuery.ajaxSettings, settings );
4932
	},
5732
	},
4933
 
5733
 
4934
	ajaxSettings: {
5734
	ajaxSettings: {
4935
		url: location.href,
5735
		url: location.href,
4936
		global: true,
5736
		global: true,
4937
		type: "GET",
5737
		type: "GET",
4938
		contentType: "application/x-www-form-urlencoded",
5738
		contentType: "application/x-www-form-urlencoded",
4939
		processData: true,
5739
		processData: true,
4940
		async: true,
5740
		async: true,
4941
		/*
5741
		/*
4942
		timeout: 0,
5742
		timeout: 0,
4943
		data: null,
5743
		data: null,
4944
		username: null,
5744
		username: null,
4945
		password: null,
5745
		password: null,
4946
		traditional: false,
5746
		traditional: false,
4947
		*/
5747
		*/
4948
		// Create the request object; Microsoft failed to properly
-
 
4949
		// implement the XMLHttpRequest in IE7 (can't request local files),
-
 
4950
		// so we use the ActiveXObject when it is available
-
 
4951
		// This function can be overriden by calling jQuery.ajaxSetup
5748
		// This function can be overriden by calling jQuery.ajaxSetup
4952
		xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
-
 
4953
			function() {
5749
		xhr: function() {
4954
				return new window.XMLHttpRequest();
5750
			return new window.XMLHttpRequest();
4955
			} :
-
 
4956
			function() {
-
 
4957
				try {
-
 
4958
					return new window.ActiveXObject("Microsoft.XMLHTTP");
-
 
4959
				} catch(e) {}
-
 
4960
			},
5751
		},
4961
		accepts: {
5752
		accepts: {
4962
			xml: "application/xml, text/xml",
5753
			xml: "application/xml, text/xml",
4963
			html: "text/html",
5754
			html: "text/html",
4964
			script: "text/javascript, application/javascript",
5755
			script: "text/javascript, application/javascript",
4965
			json: "application/json, text/javascript",
5756
			json: "application/json, text/javascript",
4966
			text: "text/plain",
5757
			text: "text/plain",
4967
			_default: "*/*"
5758
			_default: "*/*"
4968
		}
5759
		}
4969
	},
5760
	},
4970
 
-
 
4971
	// Last-Modified header cache for next request
-
 
4972
	lastModified: {},
-
 
4973
	etag: {},
-
 
4974
 
5761
 
4975
	ajax: function( origSettings ) {
5762
	ajax: function( origSettings ) {
-
 
5763
		var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
4976
		var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
5764
			jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
-
 
5765
 
4977
		
5766
		s.url = s.url.replace( rhash, "" );
4978
		var jsonp, status, data,
5767
 
4979
			callbackContext = origSettings && origSettings.context || s,
5768
		// Use original (not extended) context object if it was provided
4980
			type = s.type.toUpperCase();
5769
		s.context = origSettings && origSettings.context != null ? origSettings.context : s;
4981
 
5770
 
4982
		// convert data if not already a string
5771
		// convert data if not already a string
4983
		if ( s.data && s.processData && typeof s.data !== "string" ) {
5772
		if ( s.data && s.processData && typeof s.data !== "string" ) {
4984
			s.data = jQuery.param( s.data, s.traditional );
5773
			s.data = jQuery.param( s.data, s.traditional );
4985
		}
5774
		}
4986
 
5775
 
4987
		// Handle JSONP Parameter Callbacks
5776
		// Handle JSONP Parameter Callbacks
4988
		if ( s.dataType === "jsonp" ) {
5777
		if ( s.dataType === "jsonp" ) {
4989
			if ( type === "GET" ) {
5778
			if ( type === "GET" ) {
4990
				if ( !jsre.test( s.url ) ) {
5779
				if ( !jsre.test( s.url ) ) {
4991
					s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
5780
					s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
4992
				}
5781
				}
4993
			} else if ( !s.data || !jsre.test(s.data) ) {
5782
			} else if ( !s.data || !jsre.test(s.data) ) {
4994
				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
5783
				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
4995
			}
5784
			}
4996
			s.dataType = "json";
5785
			s.dataType = "json";
4997
		}
5786
		}
4998
 
5787
 
4999
		// Build temporary JSONP function
5788
		// Build temporary JSONP function
5000
		if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
5789
		if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
5001
			jsonp = s.jsonpCallback || ("jsonp" + jsc++);
5790
			jsonp = s.jsonpCallback || ("jsonp" + jsc++);
5002
 
5791
 
5003
			// Replace the =? sequence both in the query string and the data
5792
			// Replace the =? sequence both in the query string and the data
5004
			if ( s.data ) {
5793
			if ( s.data ) {
5005
				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
5794
				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
5006
			}
5795
			}
5007
 
5796
 
5008
			s.url = s.url.replace(jsre, "=" + jsonp + "$1");
5797
			s.url = s.url.replace(jsre, "=" + jsonp + "$1");
5009
 
5798
 
5010
			// We need to make sure
5799
			// We need to make sure
5011
			// that a JSONP style response is executed properly
5800
			// that a JSONP style response is executed properly
5012
			s.dataType = "script";
5801
			s.dataType = "script";
5013
 
5802
 
5014
			// Handle JSONP-style loading
5803
			// Handle JSONP-style loading
-
 
5804
			var customJsonp = window[ jsonp ];
-
 
5805
 
5015
			window[ jsonp ] = window[ jsonp ] || function( tmp ) {
5806
			window[ jsonp ] = function( tmp ) {
5016
				data = tmp;
5807
				if ( jQuery.isFunction( customJsonp ) ) {
5017
				success();
5808
					customJsonp( tmp );
-
 
5809
 
5018
				complete();
5810
				} else {
5019
				// Garbage collect
5811
					// Garbage collect
5020
				window[ jsonp ] = undefined;
5812
					window[ jsonp ] = undefined;
5021
 
5813
 
5022
				try {
5814
					try {
5023
					delete window[ jsonp ];
5815
						delete window[ jsonp ];
5024
				} catch(e) {}
5816
					} catch( jsonpError ) {}
-
 
5817
				}
-
 
5818
 
-
 
5819
				data = tmp;
-
 
5820
				jQuery.handleSuccess( s, xhr, status, data );
-
 
5821
				jQuery.handleComplete( s, xhr, status, data );
5025
 
5822
				
5026
				if ( head ) {
5823
				if ( head ) {
5027
					head.removeChild( script );
5824
					head.removeChild( script );
5028
				}
5825
				}
5029
			};
5826
			};
5030
		}
5827
		}
5031
 
5828
 
5032
		if ( s.dataType === "script" && s.cache === null ) {
5829
		if ( s.dataType === "script" && s.cache === null ) {
5033
			s.cache = false;
5830
			s.cache = false;
5034
		}
5831
		}
5035
 
5832
 
5036
		if ( s.cache === false && type === "GET" ) {
5833
		if ( s.cache === false && noContent ) {
5037
			var ts = now();
5834
			var ts = jQuery.now();
5038
 
5835
 
5039
			// try replacing _= if it is there
5836
			// try replacing _= if it is there
5040
			var ret = s.url.replace(rts, "$1_=" + ts + "$2");
5837
			var ret = s.url.replace(rts, "$1_=" + ts);
5041
 
5838
 
5042
			// if nothing was replaced, add timestamp to the end
5839
			// if nothing was replaced, add timestamp to the end
5043
			s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
5840
			s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
5044
		}
5841
		}
5045
 
5842
 
5046
		// If data is available, append data to url for get requests
5843
		// If data is available, append data to url for GET/HEAD requests
5047
		if ( s.data && type === "GET" ) {
5844
		if ( s.data && noContent ) {
5048
			s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
5845
			s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
5049
		}
5846
		}
5050
 
5847
 
5051
		// Watch for a new set of requests
5848
		// Watch for a new set of requests
5052
		if ( s.global && ! jQuery.active++ ) {
5849
		if ( s.global && jQuery.active++ === 0 ) {
5053
			jQuery.event.trigger( "ajaxStart" );
5850
			jQuery.event.trigger( "ajaxStart" );
5054
		}
5851
		}
5055
 
5852
 
5056
		// Matches an absolute URL, and saves the domain
5853
		// Matches an absolute URL, and saves the domain
5057
		var parts = rurl.exec( s.url ),
5854
		var parts = rurl.exec( s.url ),
5058
			remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
5855
			remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
5059
 
5856
 
5060
		// If we're requesting a remote document
5857
		// If we're requesting a remote document
5061
		// and trying to load JSON or Script with a GET
5858
		// and trying to load JSON or Script with a GET
5062
		if ( s.dataType === "script" && type === "GET" && remote ) {
5859
		if ( s.dataType === "script" && type === "GET" && remote ) {
5063
			var head = document.getElementsByTagName("head")[0] || document.documentElement;
5860
			var head = document.getElementsByTagName("head")[0] || document.documentElement;
5064
			var script = document.createElement("script");
5861
			var script = document.createElement("script");
5065
			script.src = s.url;
-
 
5066
			if ( s.scriptCharset ) {
5862
			if ( s.scriptCharset ) {
5067
				script.charset = s.scriptCharset;
5863
				script.charset = s.scriptCharset;
5068
			}
5864
			}
-
 
5865
			script.src = s.url;
5069
 
5866
 
5070
			// Handle Script loading
5867
			// Handle Script loading
5071
			if ( !jsonp ) {
5868
			if ( !jsonp ) {
5072
				var done = false;
5869
				var done = false;
5073
 
5870
 
5074
				// Attach handlers for all browsers
5871
				// Attach handlers for all browsers
5075
				script.onload = script.onreadystatechange = function() {
5872
				script.onload = script.onreadystatechange = function() {
5076
					if ( !done && (!this.readyState ||
5873
					if ( !done && (!this.readyState ||
5077
							this.readyState === "loaded" || this.readyState === "complete") ) {
5874
							this.readyState === "loaded" || this.readyState === "complete") ) {
5078
						done = true;
5875
						done = true;
5079
						success();
5876
						jQuery.handleSuccess( s, xhr, status, data );
5080
						complete();
5877
						jQuery.handleComplete( s, xhr, status, data );
5081
 
5878
 
5082
						// Handle memory leak in IE
5879
						// Handle memory leak in IE
5083
						script.onload = script.onreadystatechange = null;
5880
						script.onload = script.onreadystatechange = null;
5084
						if ( head && script.parentNode ) {
5881
						if ( head && script.parentNode ) {
5085
							head.removeChild( script );
5882
							head.removeChild( script );
5086
						}
5883
						}
5087
					}
5884
					}
5088
				};
5885
				};
5089
			}
5886
			}
5090
 
5887
 
5091
			// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
5888
			// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
5092
			// This arises when a base node is used (#2709 and #4378).
5889
			// This arises when a base node is used (#2709 and #4378).
5093
			head.insertBefore( script, head.firstChild );
5890
			head.insertBefore( script, head.firstChild );
5094
 
5891
 
5095
			// We handle everything using the script element injection
5892
			// We handle everything using the script element injection
5096
			return undefined;
5893
			return undefined;
5097
		}
5894
		}
5098
 
5895
 
5099
		var requestDone = false;
5896
		var requestDone = false;
5100
 
5897
 
5101
		// Create the request object
5898
		// Create the request object
5102
		var xhr = s.xhr();
5899
		var xhr = s.xhr();
5103
 
5900
 
5104
		if ( !xhr ) {
5901
		if ( !xhr ) {
5105
			return;
5902
			return;
5106
		}
5903
		}
5107
 
5904
 
5108
		// Open the socket
5905
		// Open the socket
5109
		// Passing null username, generates a login popup on Opera (#2865)
5906
		// Passing null username, generates a login popup on Opera (#2865)
5110
		if ( s.username ) {
5907
		if ( s.username ) {
5111
			xhr.open(type, s.url, s.async, s.username, s.password);
5908
			xhr.open(type, s.url, s.async, s.username, s.password);
5112
		} else {
5909
		} else {
5113
			xhr.open(type, s.url, s.async);
5910
			xhr.open(type, s.url, s.async);
5114
		}
5911
		}
5115
 
5912
 
5116
		// Need an extra try/catch for cross domain requests in Firefox 3
5913
		// Need an extra try/catch for cross domain requests in Firefox 3
5117
		try {
5914
		try {
5118
			// Set the correct header, if data is being sent
5915
			// Set content-type if data specified and content-body is valid for this type
5119
			if ( s.data || origSettings && origSettings.contentType ) {
5916
			if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
5120
				xhr.setRequestHeader("Content-Type", s.contentType);
5917
				xhr.setRequestHeader("Content-Type", s.contentType);
5121
			}
5918
			}
5122
 
5919
 
5123
			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
5920
			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
5124
			if ( s.ifModified ) {
5921
			if ( s.ifModified ) {
5125
				if ( jQuery.lastModified[s.url] ) {
5922
				if ( jQuery.lastModified[s.url] ) {
5126
					xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
5923
					xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
5127
				}
5924
				}
5128
 
5925
 
5129
				if ( jQuery.etag[s.url] ) {
5926
				if ( jQuery.etag[s.url] ) {
5130
					xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
5927
					xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
5131
				}
5928
				}
5132
			}
5929
			}
5133
 
5930
 
5134
			// Set header so the called script knows that it's an XMLHttpRequest
5931
			// Set header so the called script knows that it's an XMLHttpRequest
5135
			// Only send the header if it's not a remote XHR
5932
			// Only send the header if it's not a remote XHR
5136
			if ( !remote ) {
5933
			if ( !remote ) {
5137
				xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
5934
				xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
5138
			}
5935
			}
5139
 
5936
 
5140
			// Set the Accepts header for the server, depending on the dataType
5937
			// Set the Accepts header for the server, depending on the dataType
5141
			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
5938
			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
5142
				s.accepts[ s.dataType ] + ", */*" :
5939
				s.accepts[ s.dataType ] + ", */*; q=0.01" :
5143
				s.accepts._default );
5940
				s.accepts._default );
5144
		} catch(e) {}
5941
		} catch( headerError ) {}
5145
 
5942
 
5146
		// Allow custom headers/mimetypes and early abort
5943
		// Allow custom headers/mimetypes and early abort
5147
		if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
5944
		if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
5148
			// Handle the global AJAX counter
5945
			// Handle the global AJAX counter
5149
			if ( s.global && ! --jQuery.active ) {
5946
			if ( s.global && jQuery.active-- === 1 ) {
5150
				jQuery.event.trigger( "ajaxStop" );
5947
				jQuery.event.trigger( "ajaxStop" );
5151
			}
5948
			}
5152
 
5949
 
5153
			// close opended socket
5950
			// close opended socket
5154
			xhr.abort();
5951
			xhr.abort();
5155
			return false;
5952
			return false;
5156
		}
5953
		}
5157
 
5954
 
5158
		if ( s.global ) {
5955
		if ( s.global ) {
5159
			trigger("ajaxSend", [xhr, s]);
5956
			jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
5160
		}
5957
		}
5161
 
5958
 
5162
		// Wait for a response to come back
5959
		// Wait for a response to come back
5163
		var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
5960
		var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
5164
			// The request was aborted
5961
			// The request was aborted
5165
			if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
5962
			if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
5166
				// Opera doesn't call onreadystatechange before this point
5963
				// Opera doesn't call onreadystatechange before this point
5167
				// so we simulate the call
5964
				// so we simulate the call
5168
				if ( !requestDone ) {
5965
				if ( !requestDone ) {
5169
					complete();
5966
					jQuery.handleComplete( s, xhr, status, data );
5170
				}
5967
				}
5171
 
5968
 
5172
				requestDone = true;
5969
				requestDone = true;
5173
				if ( xhr ) {
5970
				if ( xhr ) {
5174
					xhr.onreadystatechange = jQuery.noop;
5971
					xhr.onreadystatechange = jQuery.noop;
5175
				}
5972
				}
5176
 
5973
 
5177
			// The transfer is complete and the data is available, or the request timed out
5974
			// The transfer is complete and the data is available, or the request timed out
5178
			} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
5975
			} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
5179
				requestDone = true;
5976
				requestDone = true;
5180
				xhr.onreadystatechange = jQuery.noop;
5977
				xhr.onreadystatechange = jQuery.noop;
5181
 
5978
 
5182
				status = isTimeout === "timeout" ?
5979
				status = isTimeout === "timeout" ?
5183
					"timeout" :
5980
					"timeout" :
5184
					!jQuery.httpSuccess( xhr ) ?
5981
					!jQuery.httpSuccess( xhr ) ?
5185
						"error" :
5982
						"error" :
5186
						s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
5983
						s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
5187
							"notmodified" :
5984
							"notmodified" :
5188
							"success";
5985
							"success";
5189
 
5986
 
5190
				var errMsg;
5987
				var errMsg;
5191
 
5988
 
5192
				if ( status === "success" ) {
5989
				if ( status === "success" ) {
5193
					// Watch for, and catch, XML document parse errors
5990
					// Watch for, and catch, XML document parse errors
5194
					try {
5991
					try {
5195
						// process the data (runs the xml through httpData regardless of callback)
5992
						// process the data (runs the xml through httpData regardless of callback)
5196
						data = jQuery.httpData( xhr, s.dataType, s );
5993
						data = jQuery.httpData( xhr, s.dataType, s );
5197
					} catch(err) {
5994
					} catch( parserError ) {
5198
						status = "parsererror";
5995
						status = "parsererror";
5199
						errMsg = err;
5996
						errMsg = parserError;
5200
					}
5997
					}
5201
				}
5998
				}
5202
 
5999
 
5203
				// Make sure that the request was successful or notmodified
6000
				// Make sure that the request was successful or notmodified
5204
				if ( status === "success" || status === "notmodified" ) {
6001
				if ( status === "success" || status === "notmodified" ) {
5205
					// JSONP handles its own success callback
6002
					// JSONP handles its own success callback
5206
					if ( !jsonp ) {
6003
					if ( !jsonp ) {
5207
						success();
6004
						jQuery.handleSuccess( s, xhr, status, data );
5208
					}
6005
					}
5209
				} else {
6006
				} else {
5210
					jQuery.handleError(s, xhr, status, errMsg);
6007
					jQuery.handleError( s, xhr, status, errMsg );
5211
				}
6008
				}
5212
 
6009
 
5213
				// Fire the complete handlers
6010
				// Fire the complete handlers
5214
				complete();
6011
				if ( !jsonp ) {
-
 
6012
					jQuery.handleComplete( s, xhr, status, data );
-
 
6013
				}
5215
 
6014
 
5216
				if ( isTimeout === "timeout" ) {
6015
				if ( isTimeout === "timeout" ) {
5217
					xhr.abort();
6016
					xhr.abort();
5218
				}
6017
				}
5219
 
6018
 
5220
				// Stop memory leaks
6019
				// Stop memory leaks
5221
				if ( s.async ) {
6020
				if ( s.async ) {
5222
					xhr = null;
6021
					xhr = null;
5223
				}
6022
				}
5224
			}
6023
			}
5225
		};
6024
		};
5226
 
6025
 
5227
		// Override the abort handler, if we can (IE doesn't allow it, but that's OK)
6026
		// Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
5228
		// Opera doesn't fire onreadystatechange at all on abort
6027
		// Opera doesn't fire onreadystatechange at all on abort
5229
		try {
6028
		try {
5230
			var oldAbort = xhr.abort;
6029
			var oldAbort = xhr.abort;
5231
			xhr.abort = function() {
6030
			xhr.abort = function() {
5232
				if ( xhr ) {
6031
				if ( xhr ) {
5233
					oldAbort.call( xhr );
6032
					// oldAbort has no call property in IE7 so
-
 
6033
					// just do it this way, which works in all
-
 
6034
					// browsers
-
 
6035
					Function.prototype.call.call( oldAbort, xhr );
5234
				}
6036
				}
5235
 
6037
 
5236
				onreadystatechange( "abort" );
6038
				onreadystatechange( "abort" );
5237
			};
6039
			};
5238
		} catch(e) { }
6040
		} catch( abortError ) {}
5239
 
6041
 
5240
		// Timeout checker
6042
		// Timeout checker
5241
		if ( s.async && s.timeout > 0 ) {
6043
		if ( s.async && s.timeout > 0 ) {
5242
			setTimeout(function() {
6044
			setTimeout(function() {
5243
				// Check to see if the request is still happening
6045
				// Check to see if the request is still happening
5244
				if ( xhr && !requestDone ) {
6046
				if ( xhr && !requestDone ) {
5245
					onreadystatechange( "timeout" );
6047
					onreadystatechange( "timeout" );
5246
				}
6048
				}
5247
			}, s.timeout);
6049
			}, s.timeout);
5248
		}
6050
		}
5249
 
6051
 
5250
		// Send the data
6052
		// Send the data
5251
		try {
6053
		try {
5252
			xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
6054
			xhr.send( noContent || s.data == null ? null : s.data );
-
 
6055
 
5253
		} catch(e) {
6056
		} catch( sendError ) {
5254
			jQuery.handleError(s, xhr, null, e);
6057
			jQuery.handleError( s, xhr, null, sendError );
-
 
6058
 
5255
			// Fire the complete handlers
6059
			// Fire the complete handlers
5256
			complete();
6060
			jQuery.handleComplete( s, xhr, status, data );
5257
		}
6061
		}
5258
 
6062
 
5259
		// firefox 1.5 doesn't fire statechange for sync requests
6063
		// firefox 1.5 doesn't fire statechange for sync requests
5260
		if ( !s.async ) {
6064
		if ( !s.async ) {
5261
			onreadystatechange();
6065
			onreadystatechange();
5262
		}
6066
		}
-
 
6067
 
-
 
6068
		// return XMLHttpRequest to allow aborting the request etc.
-
 
6069
		return xhr;
-
 
6070
	},
-
 
6071
 
-
 
6072
	// Serialize an array of form elements or a set of
-
 
6073
	// key/values into a query string
-
 
6074
	param: function( a, traditional ) {
5263
 
6075
		var s = [],
5264
		function success() {
6076
			add = function( key, value ) {
-
 
6077
				// If value is a function, invoke it and return its value
-
 
6078
				value = jQuery.isFunction(value) ? value() : value;
-
 
6079
				s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
-
 
6080
			};
-
 
6081
		
5265
			// If a local callback was specified, fire it and pass it the data
6082
		// Set traditional to true for jQuery <= 1.3.2 behavior.
5266
			if ( s.success ) {
6083
		if ( traditional === undefined ) {
5267
				s.success.call( callbackContext, data, status, xhr );
6084
			traditional = jQuery.ajaxSettings.traditional;
-
 
6085
		}
-
 
6086
		
5268
			}
6087
		// If an array was passed in, assume that it is an array of form elements.
-
 
6088
		if ( jQuery.isArray(a) || a.jquery ) {
-
 
6089
			// Serialize the form elements
-
 
6090
			jQuery.each( a, function() {
-
 
6091
				add( this.name, this.value );
-
 
6092
			});
-
 
6093
			
-
 
6094
		} else {
5269
 
6095
			// If traditional, encode the "old" way (the way 1.3.2 or older
5270
			// Fire the global callback
6096
			// did it), otherwise encode params recursively.
5271
			if ( s.global ) {
6097
			for ( var prefix in a ) {
5272
				trigger( "ajaxSuccess", [xhr, s] );
6098
				buildParams( prefix, a[prefix], traditional, add );
5273
			}
6099
			}
5274
		}
6100
		}
5275
 
-
 
5276
		function complete() {
6101
 
5277
			// Process result
-
 
5278
			if ( s.complete ) {
6102
		// Return the resulting serialization
5279
				s.complete.call( callbackContext, xhr, status);
6103
		return s.join("&").replace(r20, "+");
-
 
6104
	}
-
 
6105
});
-
 
6106
 
5280
			}
6107
function buildParams( prefix, obj, traditional, add ) {
5281
 
6108
	if ( jQuery.isArray(obj) && obj.length ) {
-
 
6109
		// Serialize array item.
5282
			// The request was completed
6110
		jQuery.each( obj, function( i, v ) {
5283
			if ( s.global ) {
6111
			if ( traditional || rbracket.test( prefix ) ) {
-
 
6112
				// Treat each array item as a scalar.
-
 
6113
				add( prefix, v );
-
 
6114
 
5284
				trigger( "ajaxComplete", [xhr, s] );
6115
			} else {
-
 
6116
				// If array item is non-scalar (array or object), encode its
-
 
6117
				// numeric index to resolve deserialization ambiguity issues.
5285
			}
6118
				// Note that rack (as of 1.0.0) can't currently deserialize
5286
 
6119
				// nested arrays properly, and attempting to do so may cause
-
 
6120
				// a server error. Possible fixes are to modify rack's
5287
			// Handle the global AJAX counter
6121
				// deserialization algorithm or to provide an option or flag
-
 
6122
				// to force array serialization to be shallow.
-
 
6123
				buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
-
 
6124
			}
-
 
6125
		});
-
 
6126
			
-
 
6127
	} else if ( !traditional && obj != null && typeof obj === "object" ) {
-
 
6128
		if ( jQuery.isEmptyObject( obj ) ) {
-
 
6129
			add( prefix, "" );
-
 
6130
 
-
 
6131
		// Serialize object item.
-
 
6132
		} else {
5288
			if ( s.global && ! --jQuery.active ) {
6133
			jQuery.each( obj, function( k, v ) {
-
 
6134
				buildParams( prefix + "[" + k + "]", v, traditional, add );
5289
				jQuery.event.trigger( "ajaxStop" );
6135
			});
5290
			}
6136
		}
-
 
6137
					
5291
		}
6138
	} else {
-
 
6139
		// Serialize scalar item.
-
 
6140
		add( prefix, obj );
-
 
6141
	}
-
 
6142
}
5292
		
6143
 
5293
		function trigger(type, args) {
6144
// This is still on the jQuery object... for now
-
 
6145
// Want to move this to jQuery.ajax some day
-
 
6146
jQuery.extend({
-
 
6147
 
5294
			(s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
6148
	// Counter for holding the number of active queries
5295
		}
6149
	active: 0,
5296
 
6150
 
5297
		// return XMLHttpRequest to allow aborting the request etc.
6151
	// Last-Modified header cache for next request
5298
		return xhr;
6152
	lastModified: {},
5299
	},
6153
	etag: {},
5300
 
6154
 
5301
	handleError: function( s, xhr, status, e ) {
6155
	handleError: function( s, xhr, status, e ) {
5302
		// If a local callback was specified, fire it
6156
		// If a local callback was specified, fire it
5303
		if ( s.error ) {
6157
		if ( s.error ) {
5304
			s.error.call( s.context || s, xhr, status, e );
6158
			s.error.call( s.context, xhr, status, e );
5305
		}
6159
		}
5306
 
6160
 
5307
		// Fire the global callback
6161
		// Fire the global callback
5308
		if ( s.global ) {
6162
		if ( s.global ) {
5309
			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
6163
			jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
5310
		}
6164
		}
5311
	},
6165
	},
-
 
6166
 
-
 
6167
	handleSuccess: function( s, xhr, status, data ) {
-
 
6168
		// If a local callback was specified, fire it and pass it the data
5312
 
6169
		if ( s.success ) {
-
 
6170
			s.success.call( s.context, data, status, xhr );
-
 
6171
		}
-
 
6172
 
-
 
6173
		// Fire the global callback
-
 
6174
		if ( s.global ) {
-
 
6175
			jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
-
 
6176
		}
-
 
6177
	},
-
 
6178
 
5313
	// Counter for holding the number of active queries
6179
	handleComplete: function( s, xhr, status ) {
-
 
6180
		// Process result
-
 
6181
		if ( s.complete ) {
-
 
6182
			s.complete.call( s.context, xhr, status );
-
 
6183
		}
-
 
6184
 
-
 
6185
		// The request was completed
-
 
6186
		if ( s.global ) {
-
 
6187
			jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
-
 
6188
		}
-
 
6189
 
-
 
6190
		// Handle the global AJAX counter
-
 
6191
		if ( s.global && jQuery.active-- === 1 ) {
-
 
6192
			jQuery.event.trigger( "ajaxStop" );
-
 
6193
		}
-
 
6194
	},
-
 
6195
		
-
 
6196
	triggerGlobal: function( s, type, args ) {
-
 
6197
		(s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
5314
	active: 0,
6198
	},
5315
 
6199
 
5316
	// Determines if an XMLHttpRequest was successful or not
6200
	// Determines if an XMLHttpRequest was successful or not
5317
	httpSuccess: function( xhr ) {
6201
	httpSuccess: function( xhr ) {
5318
		try {
6202
		try {
5319
			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
6203
			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
5320
			return !xhr.status && location.protocol === "file:" ||
6204
			return !xhr.status && location.protocol === "file:" ||
5321
				// Opera returns 0 when status is 304
-
 
5322
				( xhr.status >= 200 && xhr.status < 300 ) ||
6205
				xhr.status >= 200 && xhr.status < 300 ||
5323
				xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
6206
				xhr.status === 304 || xhr.status === 1223;
5324
		} catch(e) {}
6207
		} catch(e) {}
5325
 
6208
 
5326
		return false;
6209
		return false;
5327
	},
6210
	},
5328
 
6211
 
5329
	// Determines if an XMLHttpRequest returns NotModified
6212
	// Determines if an XMLHttpRequest returns NotModified
5330
	httpNotModified: function( xhr, url ) {
6213
	httpNotModified: function( xhr, url ) {
5331
		var lastModified = xhr.getResponseHeader("Last-Modified"),
6214
		var lastModified = xhr.getResponseHeader("Last-Modified"),
5332
			etag = xhr.getResponseHeader("Etag");
6215
			etag = xhr.getResponseHeader("Etag");
5333
 
6216
 
5334
		if ( lastModified ) {
6217
		if ( lastModified ) {
5335
			jQuery.lastModified[url] = lastModified;
6218
			jQuery.lastModified[url] = lastModified;
5336
		}
6219
		}
5337
 
6220
 
5338
		if ( etag ) {
6221
		if ( etag ) {
5339
			jQuery.etag[url] = etag;
6222
			jQuery.etag[url] = etag;
5340
		}
6223
		}
5341
 
-
 
5342
		// Opera returns 0 when status is 304
6224
 
5343
		return xhr.status === 304 || xhr.status === 0;
6225
		return xhr.status === 304;
5344
	},
6226
	},
5345
 
6227
 
5346
	httpData: function( xhr, type, s ) {
6228
	httpData: function( xhr, type, s ) {
5347
		var ct = xhr.getResponseHeader("content-type") || "",
6229
		var ct = xhr.getResponseHeader("content-type") || "",
5348
			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
6230
			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
5349
			data = xml ? xhr.responseXML : xhr.responseText;
6231
			data = xml ? xhr.responseXML : xhr.responseText;
5350
 
6232
 
5351
		if ( xml && data.documentElement.nodeName === "parsererror" ) {
6233
		if ( xml && data.documentElement.nodeName === "parsererror" ) {
5352
			jQuery.error( "parsererror" );
6234
			jQuery.error( "parsererror" );
5353
		}
6235
		}
5354
 
6236
 
5355
		// Allow a pre-filtering function to sanitize the response
6237
		// Allow a pre-filtering function to sanitize the response
5356
		// s is checked to keep backwards compatibility
6238
		// s is checked to keep backwards compatibility
5357
		if ( s && s.dataFilter ) {
6239
		if ( s && s.dataFilter ) {
5358
			data = s.dataFilter( data, type );
6240
			data = s.dataFilter( data, type );
5359
		}
6241
		}
5360
 
6242
 
5361
		// The filter can actually parse the response
6243
		// The filter can actually parse the response
5362
		if ( typeof data === "string" ) {
6244
		if ( typeof data === "string" ) {
5363
			// Get the JavaScript object, if JSON is used.
6245
			// Get the JavaScript object, if JSON is used.
5364
			if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
6246
			if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
5365
				data = jQuery.parseJSON( data );
6247
				data = jQuery.parseJSON( data );
5366
 
6248
 
5367
			// If the type is "script", eval it in global context
6249
			// If the type is "script", eval it in global context
5368
			} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
6250
			} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
5369
				jQuery.globalEval( data );
6251
				jQuery.globalEval( data );
5370
			}
6252
			}
5371
		}
6253
		}
5372
 
6254
 
5373
		return data;
6255
		return data;
5374
	},
-
 
5375
 
-
 
5376
	// Serialize an array of form elements or a set of
-
 
5377
	// key/values into a query string
-
 
5378
	param: function( a, traditional ) {
-
 
5379
		var s = [];
-
 
5380
		
-
 
5381
		// Set traditional to true for jQuery <= 1.3.2 behavior.
-
 
5382
		if ( traditional === undefined ) {
-
 
5383
			traditional = jQuery.ajaxSettings.traditional;
-
 
5384
		}
6256
	}
5385
		
-
 
5386
		// If an array was passed in, assume that it is an array of form elements.
-
 
5387
		if ( jQuery.isArray(a) || a.jquery ) {
-
 
5388
			// Serialize the form elements
-
 
5389
			jQuery.each( a, function() {
-
 
5390
				add( this.name, this.value );
6257
 
5391
			});
6258
});
5392
			
6259
 
-
 
6260
/*
5393
		} else {
6261
 * Create the request object; Microsoft failed to properly
-
 
6262
 * implement the XMLHttpRequest in IE7 (can't request local files),
-
 
6263
 * so we use the ActiveXObject when it is available
-
 
6264
 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
5394
			// If traditional, encode the "old" way (the way 1.3.2 or older
6265
 * we need a fallback.
-
 
6266
 */
-
 
6267
if ( window.ActiveXObject ) {
-
 
6268
	jQuery.ajaxSettings.xhr = function() {
5395
			// did it), otherwise encode params recursively.
6269
		if ( window.location.protocol !== "file:" ) {
-
 
6270
			try {
5396
			for ( var prefix in a ) {
6271
				return new window.XMLHttpRequest();
-
 
6272
			} catch(xhrError) {}
-
 
6273
		}
-
 
6274
 
-
 
6275
		try {
-
 
6276
			return new window.ActiveXObject("Microsoft.XMLHTTP");
5397
				buildParams( prefix, a[prefix] );
6277
		} catch(activeError) {}
5398
			}
6278
	};
5399
		}
6279
}
5400
 
-
 
5401
		// Return the resulting serialization
-
 
5402
		return s.join("&").replace(r20, "+");
-
 
5403
 
-
 
5404
		function buildParams( prefix, obj ) {
-
 
5405
			if ( jQuery.isArray(obj) ) {
-
 
5406
				// Serialize array item.
-
 
5407
				jQuery.each( obj, function( i, v ) {
-
 
5408
					if ( traditional || /\[\]$/.test( prefix ) ) {
-
 
5409
						// Treat each array item as a scalar.
-
 
5410
						add( prefix, v );
-
 
5411
					} else {
-
 
5412
						// If array item is non-scalar (array or object), encode its
-
 
5413
						// numeric index to resolve deserialization ambiguity issues.
-
 
5414
						// Note that rack (as of 1.0.0) can't currently deserialize
-
 
5415
						// nested arrays properly, and attempting to do so may cause
-
 
5416
						// a server error. Possible fixes are to modify rack's
-
 
5417
						// deserialization algorithm or to provide an option or flag
-
 
5418
						// to force array serialization to be shallow.
-
 
5419
						buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
-
 
5420
					}
-
 
5421
				});
-
 
5422
					
-
 
5423
			} else if ( !traditional && obj != null && typeof obj === "object" ) {
-
 
5424
				// Serialize object item.
-
 
5425
				jQuery.each( obj, function( k, v ) {
-
 
5426
					buildParams( prefix + "[" + k + "]", v );
-
 
5427
				});
-
 
5428
					
-
 
5429
			} else {
-
 
5430
				// Serialize scalar item.
-
 
5431
				add( prefix, obj );
-
 
5432
			}
-
 
5433
		}
-
 
5434
 
-
 
5435
		function add( key, value ) {
6280
 
5436
			// If value is a function, invoke it and return its value
6281
// Does this browser support XHR requests?
5437
			value = jQuery.isFunction(value) ? value() : value;
6282
jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
5438
			s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
6283
 
5439
		}
6284
 
5440
	}
6285
 
5441
});
6286
 
5442
var elemdisplay = {},
6287
var elemdisplay = {},
5443
	rfxtypes = /toggle|show|hide/,
6288
	rfxtypes = /^(?:toggle|show|hide)$/,
5444
	rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
6289
	rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
5445
	timerId,
6290
	timerId,
5446
	fxAttrs = [
6291
	fxAttrs = [
5447
		// height animations
6292
		// height animations
5448
		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
6293
		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
5449
		// width animations
6294
		// width animations
5450
		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
6295
		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
5451
		// opacity animations
6296
		// opacity animations
5452
		[ "opacity" ]
6297
		[ "opacity" ]
5453
	];
6298
	];
5454
 
6299
 
5455
jQuery.fn.extend({
6300
jQuery.fn.extend({
5456
	show: function( speed, callback ) {
6301
	show: function( speed, easing, callback ) {
5457
		if ( speed || speed === 0) {
-
 
5458
			return this.animate( genFx("show", 3), speed, callback);
-
 
5459
 
-
 
5460
		} else {
6302
		var elem, display;
5461
			for ( var i = 0, l = this.length; i < l; i++ ) {
-
 
5462
				var old = jQuery.data(this[i], "olddisplay");
-
 
5463
 
-
 
5464
				this[i].style.display = old || "";
-
 
5465
 
-
 
5466
				if ( jQuery.css(this[i], "display") === "none" ) {
-
 
5467
					var nodeName = this[i].nodeName, display;
-
 
5468
 
6303
 
5469
					if ( elemdisplay[ nodeName ] ) {
6304
		if ( speed || speed === 0 ) {
5470
						display = elemdisplay[ nodeName ];
6305
			return this.animate( genFx("show", 3), speed, easing, callback);
5471
 
6306
 
-
 
6307
		} else {
-
 
6308
			for ( var i = 0, j = this.length; i < j; i++ ) {
-
 
6309
				elem = this[i];
5472
					} else {
6310
				display = elem.style.display;
5473
						var elem = jQuery("<" + nodeName + " />").appendTo("body");
-
 
5474
 
6311
 
5475
						display = elem.css("display");
6312
				// Reset the inline display of this element to learn if it is
5476
 
6313
				// being hidden by cascaded rules or not
-
 
6314
				if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
-
 
6315
					display = elem.style.display = "";
5477
						if ( display === "none" ) {
6316
				}
5478
							display = "block";
-
 
5479
						}
6317
 
5480
 
-
 
5481
						elem.remove();
-
 
5482
 
6318
				// Set elements which have been overridden with display: none
5483
						elemdisplay[ nodeName ] = display;
6319
				// in a stylesheet to whatever the default browser style is
5484
					}
6320
				// for such an element
5485
 
6321
				if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
5486
					jQuery.data(this[i], "olddisplay", display);
6322
					jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
5487
				}
6323
				}
5488
			}
6324
			}
5489
 
6325
 
5490
			// Set the display of the elements in a second loop
6326
			// Set the display of most of the elements in a second loop
5491
			// to avoid the constant reflow
6327
			// to avoid the constant reflow
-
 
6328
			for ( i = 0; i < j; i++ ) {
-
 
6329
				elem = this[i];
-
 
6330
				display = elem.style.display;
-
 
6331
 
5492
			for ( var j = 0, k = this.length; j < k; j++ ) {
6332
				if ( display === "" || display === "none" ) {
-
 
6333
					elem.style.display = jQuery.data(elem, "olddisplay") || "";
5493
				this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
6334
				}
5494
			}
6335
			}
5495
 
6336
 
5496
			return this;
6337
			return this;
5497
		}
6338
		}
5498
	},
6339
	},
5499
 
6340
 
5500
	hide: function( speed, callback ) {
6341
	hide: function( speed, easing, callback ) {
5501
		if ( speed || speed === 0 ) {
6342
		if ( speed || speed === 0 ) {
5502
			return this.animate( genFx("hide", 3), speed, callback);
6343
			return this.animate( genFx("hide", 3), speed, easing, callback);
5503
 
6344
 
5504
		} else {
6345
		} else {
-
 
6346
			for ( var i = 0, j = this.length; i < j; i++ ) {
5505
			for ( var i = 0, l = this.length; i < l; i++ ) {
6347
				var display = jQuery.css( this[i], "display" );
5506
				var old = jQuery.data(this[i], "olddisplay");
6348
 
5507
				if ( !old && old !== "none" ) {
6349
				if ( display !== "none" ) {
5508
					jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
6350
					jQuery.data( this[i], "olddisplay", display );
5509
				}
6351
				}
5510
			}
6352
			}
5511
 
6353
 
5512
			// Set the display of the elements in a second loop
6354
			// Set the display of the elements in a second loop
5513
			// to avoid the constant reflow
6355
			// to avoid the constant reflow
5514
			for ( var j = 0, k = this.length; j < k; j++ ) {
6356
			for ( i = 0; i < j; i++ ) {
5515
				this[j].style.display = "none";
6357
				this[i].style.display = "none";
5516
			}
6358
			}
5517
 
6359
 
5518
			return this;
6360
			return this;
5519
		}
6361
		}
5520
	},
6362
	},
5521
 
6363
 
5522
	// Save the old toggle function
6364
	// Save the old toggle function
5523
	_toggle: jQuery.fn.toggle,
6365
	_toggle: jQuery.fn.toggle,
5524
 
6366
 
5525
	toggle: function( fn, fn2 ) {
6367
	toggle: function( fn, fn2, callback ) {
5526
		var bool = typeof fn === "boolean";
6368
		var bool = typeof fn === "boolean";
5527
 
6369
 
5528
		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
6370
		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
5529
			this._toggle.apply( this, arguments );
6371
			this._toggle.apply( this, arguments );
5530
 
6372
 
5531
		} else if ( fn == null || bool ) {
6373
		} else if ( fn == null || bool ) {
5532
			this.each(function() {
6374
			this.each(function() {
5533
				var state = bool ? fn : jQuery(this).is(":hidden");
6375
				var state = bool ? fn : jQuery(this).is(":hidden");
5534
				jQuery(this)[ state ? "show" : "hide" ]();
6376
				jQuery(this)[ state ? "show" : "hide" ]();
5535
			});
6377
			});
5536
 
6378
 
5537
		} else {
6379
		} else {
5538
			this.animate(genFx("toggle", 3), fn, fn2);
6380
			this.animate(genFx("toggle", 3), fn, fn2, callback);
5539
		}
6381
		}
5540
 
6382
 
5541
		return this;
6383
		return this;
5542
	},
6384
	},
5543
 
6385
 
5544
	fadeTo: function( speed, to, callback ) {
6386
	fadeTo: function( speed, to, easing, callback ) {
5545
		return this.filter(":hidden").css("opacity", 0).show().end()
6387
		return this.filter(":hidden").css("opacity", 0).show().end()
5546
					.animate({opacity: to}, speed, callback);
6388
					.animate({opacity: to}, speed, easing, callback);
5547
	},
6389
	},
5548
 
6390
 
5549
	animate: function( prop, speed, easing, callback ) {
6391
	animate: function( prop, speed, easing, callback ) {
5550
		var optall = jQuery.speed(speed, easing, callback);
6392
		var optall = jQuery.speed(speed, easing, callback);
5551
 
6393
 
5552
		if ( jQuery.isEmptyObject( prop ) ) {
6394
		if ( jQuery.isEmptyObject( prop ) ) {
5553
			return this.each( optall.complete );
6395
			return this.each( optall.complete );
5554
		}
6396
		}
5555
 
6397
 
5556
		return this[ optall.queue === false ? "each" : "queue" ](function() {
6398
		return this[ optall.queue === false ? "each" : "queue" ](function() {
-
 
6399
			// XXX 'this' does not always have a nodeName when running the
-
 
6400
			// test suite
-
 
6401
 
5557
			var opt = jQuery.extend({}, optall), p,
6402
			var opt = jQuery.extend({}, optall), p,
-
 
6403
				isElement = this.nodeType === 1,
5558
				hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
6404
				hidden = isElement && jQuery(this).is(":hidden"),
5559
				self = this;
6405
				self = this;
5560
 
6406
 
5561
			for ( p in prop ) {
6407
			for ( p in prop ) {
5562
				var name = p.replace(rdashAlpha, fcamelCase);
6408
				var name = jQuery.camelCase( p );
5563
 
6409
 
5564
				if ( p !== name ) {
6410
				if ( p !== name ) {
5565
					prop[ name ] = prop[ p ];
6411
					prop[ name ] = prop[ p ];
5566
					delete prop[ p ];
6412
					delete prop[ p ];
5567
					p = name;
6413
					p = name;
5568
				}
6414
				}
5569
 
6415
 
5570
				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
6416
				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
5571
					return opt.complete.call(this);
6417
					return opt.complete.call(this);
5572
				}
6418
				}
5573
 
6419
 
5574
				if ( ( p === "height" || p === "width" ) && this.style ) {
-
 
5575
					// Store display property
-
 
5576
					opt.display = jQuery.css(this, "display");
-
 
5577
 
6420
				if ( isElement && ( p === "height" || p === "width" ) ) {
-
 
6421
					// Make sure that nothing sneaks out
5578
					// Make sure that nothing sneaks out
6422
					// Record all 3 overflow attributes because IE does not
-
 
6423
					// change the overflow attribute when overflowX and
-
 
6424
					// overflowY are set to the same value
-
 
6425
					opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
 
6426
 
-
 
6427
					// Set display property to inline-block for height/width
-
 
6428
					// animations on inline elements that are having width/height
-
 
6429
					// animated
-
 
6430
					if ( jQuery.css( this, "display" ) === "inline" &&
-
 
6431
							jQuery.css( this, "float" ) === "none" ) {
-
 
6432
						if ( !jQuery.support.inlineBlockNeedsLayout ) {
-
 
6433
							this.style.display = "inline-block";
-
 
6434
 
-
 
6435
						} else {
-
 
6436
							var display = defaultDisplay(this.nodeName);
-
 
6437
 
-
 
6438
							// inline-level elements accept inline-block;
-
 
6439
							// block-level elements need to be inline with layout
-
 
6440
							if ( display === "inline" ) {
-
 
6441
								this.style.display = "inline-block";
-
 
6442
 
-
 
6443
							} else {
-
 
6444
								this.style.display = "inline";
-
 
6445
								this.style.zoom = 1;
-
 
6446
							}
-
 
6447
						}
5579
					opt.overflow = this.style.overflow;
6448
					}
5580
				}
6449
				}
5581
 
6450
 
5582
				if ( jQuery.isArray( prop[p] ) ) {
6451
				if ( jQuery.isArray( prop[p] ) ) {
5583
					// Create (if needed) and add to specialEasing
6452
					// Create (if needed) and add to specialEasing
5584
					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
6453
					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
5585
					prop[p] = prop[p][0];
6454
					prop[p] = prop[p][0];
5586
				}
6455
				}
5587
			}
6456
			}
5588
 
6457
 
5589
			if ( opt.overflow != null ) {
6458
			if ( opt.overflow != null ) {
5590
				this.style.overflow = "hidden";
6459
				this.style.overflow = "hidden";
5591
			}
6460
			}
5592
 
6461
 
5593
			opt.curAnim = jQuery.extend({}, prop);
6462
			opt.curAnim = jQuery.extend({}, prop);
5594
 
6463
 
5595
			jQuery.each( prop, function( name, val ) {
6464
			jQuery.each( prop, function( name, val ) {
5596
				var e = new jQuery.fx( self, opt, name );
6465
				var e = new jQuery.fx( self, opt, name );
5597
 
6466
 
5598
				if ( rfxtypes.test(val) ) {
6467
				if ( rfxtypes.test(val) ) {
5599
					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
6468
					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
5600
 
6469
 
5601
				} else {
6470
				} else {
5602
					var parts = rfxnum.exec(val),
6471
					var parts = rfxnum.exec(val),
5603
						start = e.cur(true) || 0;
6472
						start = e.cur() || 0;
5604
 
6473
 
5605
					if ( parts ) {
6474
					if ( parts ) {
5606
						var end = parseFloat( parts[2] ),
6475
						var end = parseFloat( parts[2] ),
5607
							unit = parts[3] || "px";
6476
							unit = parts[3] || "px";
5608
 
6477
 
5609
						// We need to compute starting value
6478
						// We need to compute starting value
5610
						if ( unit !== "px" ) {
6479
						if ( unit !== "px" ) {
5611
							self.style[ name ] = (end || 1) + unit;
6480
							jQuery.style( self, name, (end || 1) + unit);
5612
							start = ((end || 1) / e.cur(true)) * start;
6481
							start = ((end || 1) / e.cur()) * start;
5613
							self.style[ name ] = start + unit;
6482
							jQuery.style( self, name, start + unit);
5614
						}
6483
						}
5615
 
6484
 
5616
						// If a +=/-= token was provided, we're doing a relative animation
6485
						// If a +=/-= token was provided, we're doing a relative animation
5617
						if ( parts[1] ) {
6486
						if ( parts[1] ) {
5618
							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
6487
							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
5619
						}
6488
						}
5620
 
6489
 
5621
						e.custom( start, end, unit );
6490
						e.custom( start, end, unit );
5622
 
6491
 
5623
					} else {
6492
					} else {
5624
						e.custom( start, val, "" );
6493
						e.custom( start, val, "" );
5625
					}
6494
					}
5626
				}
6495
				}
5627
			});
6496
			});
5628
 
6497
 
5629
			// For JS strict compliance
6498
			// For JS strict compliance
5630
			return true;
6499
			return true;
5631
		});
6500
		});
5632
	},
6501
	},
5633
 
6502
 
5634
	stop: function( clearQueue, gotoEnd ) {
6503
	stop: function( clearQueue, gotoEnd ) {
5635
		var timers = jQuery.timers;
6504
		var timers = jQuery.timers;
5636
 
6505
 
5637
		if ( clearQueue ) {
6506
		if ( clearQueue ) {
5638
			this.queue([]);
6507
			this.queue([]);
5639
		}
6508
		}
5640
 
6509
 
5641
		this.each(function() {
6510
		this.each(function() {
5642
			// go in reverse order so anything added to the queue during the loop is ignored
6511
			// go in reverse order so anything added to the queue during the loop is ignored
5643
			for ( var i = timers.length - 1; i >= 0; i-- ) {
6512
			for ( var i = timers.length - 1; i >= 0; i-- ) {
5644
				if ( timers[i].elem === this ) {
6513
				if ( timers[i].elem === this ) {
5645
					if (gotoEnd) {
6514
					if (gotoEnd) {
5646
						// force the next step to be the last
6515
						// force the next step to be the last
5647
						timers[i](true);
6516
						timers[i](true);
5648
					}
6517
					}
5649
 
6518
 
5650
					timers.splice(i, 1);
6519
					timers.splice(i, 1);
5651
				}
6520
				}
5652
			}
6521
			}
5653
		});
6522
		});
5654
 
6523
 
5655
		// start the next in the queue if the last step wasn't forced
6524
		// start the next in the queue if the last step wasn't forced
5656
		if ( !gotoEnd ) {
6525
		if ( !gotoEnd ) {
5657
			this.dequeue();
6526
			this.dequeue();
5658
		}
6527
		}
5659
 
6528
 
5660
		return this;
6529
		return this;
5661
	}
6530
	}
5662
 
6531
 
5663
});
6532
});
-
 
6533
 
-
 
6534
function genFx( type, num ) {
-
 
6535
	var obj = {};
-
 
6536
 
-
 
6537
	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
-
 
6538
		obj[ this ] = type;
-
 
6539
	});
-
 
6540
 
-
 
6541
	return obj;
-
 
6542
}
5664
 
6543
 
5665
// Generate shortcuts for custom animations
6544
// Generate shortcuts for custom animations
5666
jQuery.each({
6545
jQuery.each({
5667
	slideDown: genFx("show", 1),
6546
	slideDown: genFx("show", 1),
5668
	slideUp: genFx("hide", 1),
6547
	slideUp: genFx("hide", 1),
5669
	slideToggle: genFx("toggle", 1),
6548
	slideToggle: genFx("toggle", 1),
5670
	fadeIn: { opacity: "show" },
6549
	fadeIn: { opacity: "show" },
5671
	fadeOut: { opacity: "hide" }
6550
	fadeOut: { opacity: "hide" },
-
 
6551
	fadeToggle: { opacity: "toggle" }
5672
}, function( name, props ) {
6552
}, function( name, props ) {
5673
	jQuery.fn[ name ] = function( speed, callback ) {
6553
	jQuery.fn[ name ] = function( speed, easing, callback ) {
5674
		return this.animate( props, speed, callback );
6554
		return this.animate( props, speed, easing, callback );
5675
	};
6555
	};
5676
});
6556
});
5677
 
6557
 
5678
jQuery.extend({
6558
jQuery.extend({
5679
	speed: function( speed, easing, fn ) {
6559
	speed: function( speed, easing, fn ) {
5680
		var opt = speed && typeof speed === "object" ? speed : {
6560
		var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
5681
			complete: fn || !fn && easing ||
6561
			complete: fn || !fn && easing ||
5682
				jQuery.isFunction( speed ) && speed,
6562
				jQuery.isFunction( speed ) && speed,
5683
			duration: speed,
6563
			duration: speed,
5684
			easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
6564
			easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
5685
		};
6565
		};
5686
 
6566
 
5687
		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
6567
		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
5688
			jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
6568
			opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
5689
 
6569
 
5690
		// Queueing
6570
		// Queueing
5691
		opt.old = opt.complete;
6571
		opt.old = opt.complete;
5692
		opt.complete = function() {
6572
		opt.complete = function() {
5693
			if ( opt.queue !== false ) {
6573
			if ( opt.queue !== false ) {
5694
				jQuery(this).dequeue();
6574
				jQuery(this).dequeue();
5695
			}
6575
			}
5696
			if ( jQuery.isFunction( opt.old ) ) {
6576
			if ( jQuery.isFunction( opt.old ) ) {
5697
				opt.old.call( this );
6577
				opt.old.call( this );
5698
			}
6578
			}
5699
		};
6579
		};
5700
 
6580
 
5701
		return opt;
6581
		return opt;
5702
	},
6582
	},
5703
 
6583
 
5704
	easing: {
6584
	easing: {
5705
		linear: function( p, n, firstNum, diff ) {
6585
		linear: function( p, n, firstNum, diff ) {
5706
			return firstNum + diff * p;
6586
			return firstNum + diff * p;
5707
		},
6587
		},
5708
		swing: function( p, n, firstNum, diff ) {
6588
		swing: function( p, n, firstNum, diff ) {
5709
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
6589
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
5710
		}
6590
		}
5711
	},
6591
	},
5712
 
6592
 
5713
	timers: [],
6593
	timers: [],
5714
 
6594
 
5715
	fx: function( elem, options, prop ) {
6595
	fx: function( elem, options, prop ) {
5716
		this.options = options;
6596
		this.options = options;
5717
		this.elem = elem;
6597
		this.elem = elem;
5718
		this.prop = prop;
6598
		this.prop = prop;
5719
 
6599
 
5720
		if ( !options.orig ) {
6600
		if ( !options.orig ) {
5721
			options.orig = {};
6601
			options.orig = {};
5722
		}
6602
		}
5723
	}
6603
	}
5724
 
6604
 
5725
});
6605
});
5726
 
6606
 
5727
jQuery.fx.prototype = {
6607
jQuery.fx.prototype = {
5728
	// Simple function for setting a style value
6608
	// Simple function for setting a style value
5729
	update: function() {
6609
	update: function() {
5730
		if ( this.options.step ) {
6610
		if ( this.options.step ) {
5731
			this.options.step.call( this.elem, this.now, this );
6611
			this.options.step.call( this.elem, this.now, this );
5732
		}
6612
		}
5733
 
6613
 
5734
		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
6614
		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
5735
 
-
 
5736
		// Set display property to block for height/width animations
-
 
5737
		if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
-
 
5738
			this.elem.style.display = "block";
-
 
5739
		}
-
 
5740
	},
6615
	},
5741
 
6616
 
5742
	// Get the current size
6617
	// Get the current size
5743
	cur: function( force ) {
6618
	cur: function() {
5744
		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
6619
		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
5745
			return this.elem[ this.prop ];
6620
			return this.elem[ this.prop ];
5746
		}
6621
		}
5747
 
6622
 
5748
		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
6623
		var r = parseFloat( jQuery.css( this.elem, this.prop ) );
5749
		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
6624
		return r && r > -10000 ? r : 0;
5750
	},
6625
	},
5751
 
6626
 
5752
	// Start an animation from one number to another
6627
	// Start an animation from one number to another
5753
	custom: function( from, to, unit ) {
6628
	custom: function( from, to, unit ) {
-
 
6629
		var self = this,
-
 
6630
			fx = jQuery.fx;
-
 
6631
 
5754
		this.startTime = now();
6632
		this.startTime = jQuery.now();
5755
		this.start = from;
6633
		this.start = from;
5756
		this.end = to;
6634
		this.end = to;
5757
		this.unit = unit || this.unit || "px";
6635
		this.unit = unit || this.unit || "px";
5758
		this.now = this.start;
6636
		this.now = this.start;
5759
		this.pos = this.state = 0;
6637
		this.pos = this.state = 0;
5760
 
-
 
5761
		var self = this;
6638
 
5762
		function t( gotoEnd ) {
6639
		function t( gotoEnd ) {
5763
			return self.step(gotoEnd);
6640
			return self.step(gotoEnd);
5764
		}
6641
		}
5765
 
6642
 
5766
		t.elem = this.elem;
6643
		t.elem = this.elem;
5767
 
6644
 
5768
		if ( t() && jQuery.timers.push(t) && !timerId ) {
6645
		if ( t() && jQuery.timers.push(t) && !timerId ) {
5769
			timerId = setInterval(jQuery.fx.tick, 13);
6646
			timerId = setInterval(fx.tick, fx.interval);
5770
		}
6647
		}
5771
	},
6648
	},
5772
 
6649
 
5773
	// Simple 'show' function
6650
	// Simple 'show' function
5774
	show: function() {
6651
	show: function() {
5775
		// Remember where we started, so that we can go back to it later
6652
		// Remember where we started, so that we can go back to it later
5776
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
6653
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
5777
		this.options.show = true;
6654
		this.options.show = true;
5778
 
6655
 
5779
		// Begin the animation
6656
		// Begin the animation
5780
		// Make sure that we start at a small width/height to avoid any
6657
		// Make sure that we start at a small width/height to avoid any
5781
		// flash of content
6658
		// flash of content
5782
		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
6659
		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
5783
 
6660
 
5784
		// Start by showing the element
6661
		// Start by showing the element
5785
		jQuery( this.elem ).show();
6662
		jQuery( this.elem ).show();
5786
	},
6663
	},
5787
 
6664
 
5788
	// Simple 'hide' function
6665
	// Simple 'hide' function
5789
	hide: function() {
6666
	hide: function() {
5790
		// Remember where we started, so that we can go back to it later
6667
		// Remember where we started, so that we can go back to it later
5791
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
6668
		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
5792
		this.options.hide = true;
6669
		this.options.hide = true;
5793
 
6670
 
5794
		// Begin the animation
6671
		// Begin the animation
5795
		this.custom(this.cur(), 0);
6672
		this.custom(this.cur(), 0);
5796
	},
6673
	},
5797
 
6674
 
5798
	// Each step of an animation
6675
	// Each step of an animation
5799
	step: function( gotoEnd ) {
6676
	step: function( gotoEnd ) {
5800
		var t = now(), done = true;
6677
		var t = jQuery.now(), done = true;
5801
 
6678
 
5802
		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
6679
		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
5803
			this.now = this.end;
6680
			this.now = this.end;
5804
			this.pos = this.state = 1;
6681
			this.pos = this.state = 1;
5805
			this.update();
6682
			this.update();
5806
 
6683
 
5807
			this.options.curAnim[ this.prop ] = true;
6684
			this.options.curAnim[ this.prop ] = true;
5808
 
6685
 
5809
			for ( var i in this.options.curAnim ) {
6686
			for ( var i in this.options.curAnim ) {
5810
				if ( this.options.curAnim[i] !== true ) {
6687
				if ( this.options.curAnim[i] !== true ) {
5811
					done = false;
6688
					done = false;
5812
				}
6689
				}
5813
			}
6690
			}
5814
 
6691
 
5815
			if ( done ) {
6692
			if ( done ) {
5816
				if ( this.options.display != null ) {
-
 
5817
					// Reset the overflow
6693
				// Reset the overflow
5818
					this.elem.style.overflow = this.options.overflow;
6694
				if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
5819
 
-
 
5820
					// Reset the display
6695
					var elem = this.elem,
5821
					var old = jQuery.data(this.elem, "olddisplay");
-
 
5822
					this.elem.style.display = old ? old : this.options.display;
6696
						options = this.options;
5823
 
6697
 
5824
					if ( jQuery.css(this.elem, "display") === "none" ) {
6698
					jQuery.each( [ "", "X", "Y" ], function (index, value) {
5825
						this.elem.style.display = "block";
6699
						elem.style[ "overflow" + value ] = options.overflow[index];
5826
					}
6700
					} );
5827
				}
6701
				}
5828
 
6702
 
5829
				// Hide the element if the "hide" operation was done
6703
				// Hide the element if the "hide" operation was done
5830
				if ( this.options.hide ) {
6704
				if ( this.options.hide ) {
5831
					jQuery(this.elem).hide();
6705
					jQuery(this.elem).hide();
5832
				}
6706
				}
5833
 
6707
 
5834
				// Reset the properties, if the item has been hidden or shown
6708
				// Reset the properties, if the item has been hidden or shown
5835
				if ( this.options.hide || this.options.show ) {
6709
				if ( this.options.hide || this.options.show ) {
5836
					for ( var p in this.options.curAnim ) {
6710
					for ( var p in this.options.curAnim ) {
5837
						jQuery.style(this.elem, p, this.options.orig[p]);
6711
						jQuery.style( this.elem, p, this.options.orig[p] );
5838
					}
6712
					}
5839
				}
6713
				}
5840
 
6714
 
5841
				// Execute the complete function
6715
				// Execute the complete function
5842
				this.options.complete.call( this.elem );
6716
				this.options.complete.call( this.elem );
5843
			}
6717
			}
5844
 
6718
 
5845
			return false;
6719
			return false;
5846
 
6720
 
5847
		} else {
6721
		} else {
5848
			var n = t - this.startTime;
6722
			var n = t - this.startTime;
5849
			this.state = n / this.options.duration;
6723
			this.state = n / this.options.duration;
5850
 
6724
 
5851
			// Perform the easing function, defaults to swing
6725
			// Perform the easing function, defaults to swing
5852
			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
6726
			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
5853
			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
6727
			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
5854
			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
6728
			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
5855
			this.now = this.start + ((this.end - this.start) * this.pos);
6729
			this.now = this.start + ((this.end - this.start) * this.pos);
5856
 
6730
 
5857
			// Perform the next step of the animation
6731
			// Perform the next step of the animation
5858
			this.update();
6732
			this.update();
5859
		}
6733
		}
5860
 
6734
 
5861
		return true;
6735
		return true;
5862
	}
6736
	}
5863
};
6737
};
5864
 
6738
 
5865
jQuery.extend( jQuery.fx, {
6739
jQuery.extend( jQuery.fx, {
5866
	tick: function() {
6740
	tick: function() {
5867
		var timers = jQuery.timers;
6741
		var timers = jQuery.timers;
5868
 
6742
 
5869
		for ( var i = 0; i < timers.length; i++ ) {
6743
		for ( var i = 0; i < timers.length; i++ ) {
5870
			if ( !timers[i]() ) {
6744
			if ( !timers[i]() ) {
5871
				timers.splice(i--, 1);
6745
				timers.splice(i--, 1);
5872
			}
6746
			}
5873
		}
6747
		}
5874
 
6748
 
5875
		if ( !timers.length ) {
6749
		if ( !timers.length ) {
5876
			jQuery.fx.stop();
6750
			jQuery.fx.stop();
5877
		}
6751
		}
5878
	},
6752
	},
-
 
6753
 
-
 
6754
	interval: 13,
5879
		
6755
 
5880
	stop: function() {
6756
	stop: function() {
5881
		clearInterval( timerId );
6757
		clearInterval( timerId );
5882
		timerId = null;
6758
		timerId = null;
5883
	},
6759
	},
5884
	
6760
 
5885
	speeds: {
6761
	speeds: {
5886
		slow: 600,
6762
		slow: 600,
5887
 		fast: 200,
6763
		fast: 200,
5888
 		// Default speed
6764
		// Default speed
5889
 		_default: 400
6765
		_default: 400
5890
	},
6766
	},
5891
 
6767
 
5892
	step: {
6768
	step: {
5893
		opacity: function( fx ) {
6769
		opacity: function( fx ) {
5894
			jQuery.style(fx.elem, "opacity", fx.now);
6770
			jQuery.style( fx.elem, "opacity", fx.now );
5895
		},
6771
		},
5896
 
6772
 
5897
		_default: function( fx ) {
6773
		_default: function( fx ) {
5898
			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
6774
			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
5899
				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
6775
				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
5900
			} else {
6776
			} else {
5901
				fx.elem[ fx.prop ] = fx.now;
6777
				fx.elem[ fx.prop ] = fx.now;
5902
			}
6778
			}
5903
		}
6779
		}
5904
	}
6780
	}
5905
});
6781
});
5906
 
6782
 
5907
if ( jQuery.expr && jQuery.expr.filters ) {
6783
if ( jQuery.expr && jQuery.expr.filters ) {
5908
	jQuery.expr.filters.animated = function( elem ) {
6784
	jQuery.expr.filters.animated = function( elem ) {
5909
		return jQuery.grep(jQuery.timers, function( fn ) {
6785
		return jQuery.grep(jQuery.timers, function( fn ) {
5910
			return elem === fn.elem;
6786
			return elem === fn.elem;
5911
		}).length;
6787
		}).length;
5912
	};
6788
	};
5913
}
6789
}
5914
 
6790
 
5915
function genFx( type, num ) {
6791
function defaultDisplay( nodeName ) {
-
 
6792
	if ( !elemdisplay[ nodeName ] ) {
-
 
6793
		var elem = jQuery("<" + nodeName + ">").appendTo("body"),
5916
	var obj = {};
-
 
5917
 
6794
			display = elem.css("display");
5918
	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
-
 
-
 
6795
 
5919
		obj[ this ] = type;
6796
		elem.remove();
5920
	});
6797
 
-
 
6798
		if ( display === "none" || display === "" ) {
-
 
6799
			display = "block";
-
 
6800
		}
-
 
6801
 
-
 
6802
		elemdisplay[ nodeName ] = display;
-
 
6803
	}
-
 
6804
 
-
 
6805
	return elemdisplay[ nodeName ];
-
 
6806
}
-
 
6807
 
-
 
6808
 
-
 
6809
 
-
 
6810
 
5921
 
6811
var rtable = /^t(?:able|d|h)$/i,
5922
	return obj;
6812
	rroot = /^(?:body|html)$/i;
5923
}
6813
 
5924
if ( "getBoundingClientRect" in document.documentElement ) {
6814
if ( "getBoundingClientRect" in document.documentElement ) {
5925
	jQuery.fn.offset = function( options ) {
6815
	jQuery.fn.offset = function( options ) {
5926
		var elem = this[0];
6816
		var elem = this[0], box;
5927
 
6817
 
5928
		if ( options ) { 
6818
		if ( options ) { 
5929
			return this.each(function( i ) {
6819
			return this.each(function( i ) {
5930
				jQuery.offset.setOffset( this, options, i );
6820
				jQuery.offset.setOffset( this, options, i );
5931
			});
6821
			});
5932
		}
6822
		}
5933
 
6823
 
5934
		if ( !elem || !elem.ownerDocument ) {
6824
		if ( !elem || !elem.ownerDocument ) {
5935
			return null;
6825
			return null;
5936
		}
6826
		}
5937
 
6827
 
5938
		if ( elem === elem.ownerDocument.body ) {
6828
		if ( elem === elem.ownerDocument.body ) {
5939
			return jQuery.offset.bodyOffset( elem );
6829
			return jQuery.offset.bodyOffset( elem );
5940
		}
6830
		}
-
 
6831
 
-
 
6832
		try {
-
 
6833
			box = elem.getBoundingClientRect();
-
 
6834
		} catch(e) {}
-
 
6835
 
-
 
6836
		var doc = elem.ownerDocument,
-
 
6837
			docElem = doc.documentElement;
-
 
6838
 
-
 
6839
		// Make sure we're not dealing with a disconnected DOM node
-
 
6840
		if ( !box || !jQuery.contains( docElem, elem ) ) {
-
 
6841
			return box || { top: 0, left: 0 };
-
 
6842
		}
-
 
6843
 
-
 
6844
		var body = doc.body,
5941
 
6845
			win = getWindow(doc),
5942
		var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
6846
			clientTop  = docElem.clientTop  || body.clientTop  || 0,
5943
			clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
6847
			clientLeft = docElem.clientLeft || body.clientLeft || 0,
5944
			top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
6848
			scrollTop  = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ),
-
 
6849
			scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
-
 
6850
			top  = box.top  + scrollTop  - clientTop,
5945
			left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
6851
			left = box.left + scrollLeft - clientLeft;
5946
 
6852
 
5947
		return { top: top, left: left };
6853
		return { top: top, left: left };
5948
	};
6854
	};
5949
 
6855
 
5950
} else {
6856
} else {
5951
	jQuery.fn.offset = function( options ) {
6857
	jQuery.fn.offset = function( options ) {
5952
		var elem = this[0];
6858
		var elem = this[0];
5953
 
6859
 
5954
		if ( options ) { 
6860
		if ( options ) { 
5955
			return this.each(function( i ) {
6861
			return this.each(function( i ) {
5956
				jQuery.offset.setOffset( this, options, i );
6862
				jQuery.offset.setOffset( this, options, i );
5957
			});
6863
			});
5958
		}
6864
		}
5959
 
6865
 
5960
		if ( !elem || !elem.ownerDocument ) {
6866
		if ( !elem || !elem.ownerDocument ) {
5961
			return null;
6867
			return null;
5962
		}
6868
		}
5963
 
6869
 
5964
		if ( elem === elem.ownerDocument.body ) {
6870
		if ( elem === elem.ownerDocument.body ) {
5965
			return jQuery.offset.bodyOffset( elem );
6871
			return jQuery.offset.bodyOffset( elem );
5966
		}
6872
		}
5967
 
6873
 
5968
		jQuery.offset.initialize();
6874
		jQuery.offset.initialize();
-
 
6875
 
5969
 
6876
		var computedStyle,
-
 
6877
			offsetParent = elem.offsetParent,
-
 
6878
			prevOffsetParent = elem,
5970
		var offsetParent = elem.offsetParent, prevOffsetParent = elem,
6879
			doc = elem.ownerDocument,
-
 
6880
			docElem = doc.documentElement,
5971
			doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
6881
			body = doc.body,
5972
			body = doc.body, defaultView = doc.defaultView,
6882
			defaultView = doc.defaultView,
-
 
6883
			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
5973
			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
6884
			top = elem.offsetTop,
5974
			top = elem.offsetTop, left = elem.offsetLeft;
6885
			left = elem.offsetLeft;
5975
 
6886
 
5976
		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
6887
		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
5977
			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
6888
			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
5978
				break;
6889
				break;
5979
			}
6890
			}
5980
 
6891
 
5981
			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
6892
			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
5982
			top  -= elem.scrollTop;
6893
			top  -= elem.scrollTop;
5983
			left -= elem.scrollLeft;
6894
			left -= elem.scrollLeft;
5984
 
6895
 
5985
			if ( elem === offsetParent ) {
6896
			if ( elem === offsetParent ) {
5986
				top  += elem.offsetTop;
6897
				top  += elem.offsetTop;
5987
				left += elem.offsetLeft;
6898
				left += elem.offsetLeft;
5988
 
6899
 
5989
				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
6900
				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
5990
					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
6901
					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
5991
					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
6902
					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
5992
				}
6903
				}
-
 
6904
 
5993
 
6905
				prevOffsetParent = offsetParent;
5994
				prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
6906
				offsetParent = elem.offsetParent;
5995
			}
6907
			}
5996
 
6908
 
5997
			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
6909
			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
5998
				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
6910
				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
5999
				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
6911
				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
6000
			}
6912
			}
6001
 
6913
 
6002
			prevComputedStyle = computedStyle;
6914
			prevComputedStyle = computedStyle;
6003
		}
6915
		}
6004
 
6916
 
6005
		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
6917
		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
6006
			top  += body.offsetTop;
6918
			top  += body.offsetTop;
6007
			left += body.offsetLeft;
6919
			left += body.offsetLeft;
6008
		}
6920
		}
6009
 
6921
 
6010
		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
6922
		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
6011
			top  += Math.max( docElem.scrollTop, body.scrollTop );
6923
			top  += Math.max( docElem.scrollTop, body.scrollTop );
6012
			left += Math.max( docElem.scrollLeft, body.scrollLeft );
6924
			left += Math.max( docElem.scrollLeft, body.scrollLeft );
6013
		}
6925
		}
6014
 
6926
 
6015
		return { top: top, left: left };
6927
		return { top: top, left: left };
6016
	};
6928
	};
6017
}
6929
}
6018
 
6930
 
6019
jQuery.offset = {
6931
jQuery.offset = {
6020
	initialize: function() {
6932
	initialize: function() {
6021
		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
6933
		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
6022
			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
6934
			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
6023
 
6935
 
6024
		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
6936
		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
6025
 
6937
 
6026
		container.innerHTML = html;
6938
		container.innerHTML = html;
6027
		body.insertBefore( container, body.firstChild );
6939
		body.insertBefore( container, body.firstChild );
6028
		innerDiv = container.firstChild;
6940
		innerDiv = container.firstChild;
6029
		checkDiv = innerDiv.firstChild;
6941
		checkDiv = innerDiv.firstChild;
6030
		td = innerDiv.nextSibling.firstChild.firstChild;
6942
		td = innerDiv.nextSibling.firstChild.firstChild;
6031
 
6943
 
6032
		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
6944
		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
6033
		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
6945
		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
6034
 
6946
 
-
 
6947
		checkDiv.style.position = "fixed";
-
 
6948
		checkDiv.style.top = "20px";
6035
		checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
6949
 
6036
		// safari subtracts parent border width here which is 5px
6950
		// safari subtracts parent border width here which is 5px
6037
		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
6951
		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
6038
		checkDiv.style.position = checkDiv.style.top = "";
6952
		checkDiv.style.position = checkDiv.style.top = "";
-
 
6953
 
6039
 
6954
		innerDiv.style.overflow = "hidden";
-
 
6955
		innerDiv.style.position = "relative";
6040
		innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
6956
 
6041
		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
6957
		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
6042
 
6958
 
6043
		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
6959
		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
6044
 
6960
 
6045
		body.removeChild( container );
6961
		body.removeChild( container );
6046
		body = container = innerDiv = checkDiv = table = td = null;
6962
		body = container = innerDiv = checkDiv = table = td = null;
6047
		jQuery.offset.initialize = jQuery.noop;
6963
		jQuery.offset.initialize = jQuery.noop;
6048
	},
6964
	},
6049
 
6965
 
6050
	bodyOffset: function( body ) {
6966
	bodyOffset: function( body ) {
6051
		var top = body.offsetTop, left = body.offsetLeft;
6967
		var top = body.offsetTop,
-
 
6968
			left = body.offsetLeft;
6052
 
6969
 
6053
		jQuery.offset.initialize();
6970
		jQuery.offset.initialize();
6054
 
6971
 
6055
		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
6972
		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
6056
			top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
6973
			top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
6057
			left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
6974
			left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
6058
		}
6975
		}
6059
 
6976
 
6060
		return { top: top, left: left };
6977
		return { top: top, left: left };
6061
	},
6978
	},
6062
	
6979
	
6063
	setOffset: function( elem, options, i ) {
6980
	setOffset: function( elem, options, i ) {
-
 
6981
		var position = jQuery.css( elem, "position" );
-
 
6982
 
6064
		// set position first, in-case top/left are set even on static elem
6983
		// set position first, in-case top/left are set even on static elem
6065
		if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
6984
		if ( position === "static" ) {
6066
			elem.style.position = "relative";
6985
			elem.style.position = "relative";
6067
		}
6986
		}
-
 
6987
 
6068
		var curElem   = jQuery( elem ),
6988
		var curElem = jQuery( elem ),
6069
			curOffset = curElem.offset(),
6989
			curOffset = curElem.offset(),
6070
			curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
6990
			curCSSTop = jQuery.css( elem, "top" ),
6071
			curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
6991
			curCSSLeft = jQuery.css( elem, "left" ),
-
 
6992
			calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
-
 
6993
			props = {}, curPosition = {}, curTop, curLeft;
-
 
6994
 
-
 
6995
		// need to be able to calculate position if either top or left is auto and position is absolute
-
 
6996
		if ( calculatePosition ) {
-
 
6997
			curPosition = curElem.position();
-
 
6998
		}
-
 
6999
 
-
 
7000
		curTop  = calculatePosition ? curPosition.top  : parseInt( curCSSTop,  10 ) || 0;
-
 
7001
		curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
6072
 
7002
 
6073
		if ( jQuery.isFunction( options ) ) {
7003
		if ( jQuery.isFunction( options ) ) {
6074
			options = options.call( elem, i, curOffset );
7004
			options = options.call( elem, i, curOffset );
6075
		}
7005
		}
6076
 
7006
 
6077
		var props = {
7007
		if (options.top != null) {
-
 
7008
			props.top = (options.top - curOffset.top) + curTop;
-
 
7009
		}
6078
			top:  (options.top  - curOffset.top)  + curTop,
7010
		if (options.left != null) {
6079
			left: (options.left - curOffset.left) + curLeft
7011
			props.left = (options.left - curOffset.left) + curLeft;
6080
		};
7012
		}
6081
		
7013
		
6082
		if ( "using" in options ) {
7014
		if ( "using" in options ) {
6083
			options.using.call( elem, props );
7015
			options.using.call( elem, props );
6084
		} else {
7016
		} else {
6085
			curElem.css( props );
7017
			curElem.css( props );
6086
		}
7018
		}
6087
	}
7019
	}
6088
};
7020
};
6089
 
7021
 
6090
 
7022
 
6091
jQuery.fn.extend({
7023
jQuery.fn.extend({
6092
	position: function() {
7024
	position: function() {
6093
		if ( !this[0] ) {
7025
		if ( !this[0] ) {
6094
			return null;
7026
			return null;
6095
		}
7027
		}
6096
 
7028
 
6097
		var elem = this[0],
7029
		var elem = this[0],
6098
 
7030
 
6099
		// Get *real* offsetParent
7031
		// Get *real* offsetParent
6100
		offsetParent = this.offsetParent(),
7032
		offsetParent = this.offsetParent(),
6101
 
7033
 
6102
		// Get correct offsets
7034
		// Get correct offsets
6103
		offset       = this.offset(),
7035
		offset       = this.offset(),
6104
		parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
7036
		parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
6105
 
7037
 
6106
		// Subtract element margins
7038
		// Subtract element margins
6107
		// note: when an element has margin: auto the offsetLeft and marginLeft
7039
		// note: when an element has margin: auto the offsetLeft and marginLeft
6108
		// are the same in Safari causing offset.left to incorrectly be 0
7040
		// are the same in Safari causing offset.left to incorrectly be 0
6109
		offset.top  -= parseFloat( jQuery.curCSS(elem, "marginTop",  true) ) || 0;
7041
		offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
6110
		offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
7042
		offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
6111
 
7043
 
6112
		// Add offsetParent borders
7044
		// Add offsetParent borders
6113
		parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
7045
		parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
6114
		parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
7046
		parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
6115
 
7047
 
6116
		// Subtract the two offsets
7048
		// Subtract the two offsets
6117
		return {
7049
		return {
6118
			top:  offset.top  - parentOffset.top,
7050
			top:  offset.top  - parentOffset.top,
6119
			left: offset.left - parentOffset.left
7051
			left: offset.left - parentOffset.left
6120
		};
7052
		};
6121
	},
7053
	},
6122
 
7054
 
6123
	offsetParent: function() {
7055
	offsetParent: function() {
6124
		return this.map(function() {
7056
		return this.map(function() {
6125
			var offsetParent = this.offsetParent || document.body;
7057
			var offsetParent = this.offsetParent || document.body;
6126
			while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
7058
			while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
6127
				offsetParent = offsetParent.offsetParent;
7059
				offsetParent = offsetParent.offsetParent;
6128
			}
7060
			}
6129
			return offsetParent;
7061
			return offsetParent;
6130
		});
7062
		});
6131
	}
7063
	}
6132
});
7064
});
6133
 
7065
 
6134
 
7066
 
6135
// Create scrollLeft and scrollTop methods
7067
// Create scrollLeft and scrollTop methods
6136
jQuery.each( ["Left", "Top"], function( i, name ) {
7068
jQuery.each( ["Left", "Top"], function( i, name ) {
6137
	var method = "scroll" + name;
7069
	var method = "scroll" + name;
6138
 
7070
 
6139
	jQuery.fn[ method ] = function(val) {
7071
	jQuery.fn[ method ] = function(val) {
6140
		var elem = this[0], win;
7072
		var elem = this[0], win;
6141
		
7073
		
6142
		if ( !elem ) {
7074
		if ( !elem ) {
6143
			return null;
7075
			return null;
6144
		}
7076
		}
6145
 
7077
 
6146
		if ( val !== undefined ) {
7078
		if ( val !== undefined ) {
6147
			// Set the scroll offset
7079
			// Set the scroll offset
6148
			return this.each(function() {
7080
			return this.each(function() {
6149
				win = getWindow( this );
7081
				win = getWindow( this );
6150
 
7082
 
6151
				if ( win ) {
7083
				if ( win ) {
6152
					win.scrollTo(
7084
					win.scrollTo(
6153
						!i ? val : jQuery(win).scrollLeft(),
7085
						!i ? val : jQuery(win).scrollLeft(),
6154
						 i ? val : jQuery(win).scrollTop()
7086
						 i ? val : jQuery(win).scrollTop()
6155
					);
7087
					);
6156
 
7088
 
6157
				} else {
7089
				} else {
6158
					this[ method ] = val;
7090
					this[ method ] = val;
6159
				}
7091
				}
6160
			});
7092
			});
6161
		} else {
7093
		} else {
6162
			win = getWindow( elem );
7094
			win = getWindow( elem );
6163
 
7095
 
6164
			// Return the scroll offset
7096
			// Return the scroll offset
6165
			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
7097
			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
6166
				jQuery.support.boxModel && win.document.documentElement[ method ] ||
7098
				jQuery.support.boxModel && win.document.documentElement[ method ] ||
6167
					win.document.body[ method ] :
7099
					win.document.body[ method ] :
6168
				elem[ method ];
7100
				elem[ method ];
6169
		}
7101
		}
6170
	};
7102
	};
6171
});
7103
});
6172
 
7104
 
6173
function getWindow( elem ) {
7105
function getWindow( elem ) {
6174
	return ("scrollTo" in elem && elem.document) ?
7106
	return jQuery.isWindow( elem ) ?
6175
		elem :
7107
		elem :
6176
		elem.nodeType === 9 ?
7108
		elem.nodeType === 9 ?
6177
			elem.defaultView || elem.parentWindow :
7109
			elem.defaultView || elem.parentWindow :
6178
			false;
7110
			false;
6179
}
7111
}
-
 
7112
 
-
 
7113
 
-
 
7114
 
-
 
7115
 
6180
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
7116
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
6181
jQuery.each([ "Height", "Width" ], function( i, name ) {
7117
jQuery.each([ "Height", "Width" ], function( i, name ) {
6182
 
7118
 
6183
	var type = name.toLowerCase();
7119
	var type = name.toLowerCase();
6184
 
7120
 
6185
	// innerHeight and innerWidth
7121
	// innerHeight and innerWidth
6186
	jQuery.fn["inner" + name] = function() {
7122
	jQuery.fn["inner" + name] = function() {
6187
		return this[0] ?
7123
		return this[0] ?
6188
			jQuery.css( this[0], type, false, "padding" ) :
7124
			parseFloat( jQuery.css( this[0], type, "padding" ) ) :
6189
			null;
7125
			null;
6190
	};
7126
	};
6191
 
7127
 
6192
	// outerHeight and outerWidth
7128
	// outerHeight and outerWidth
6193
	jQuery.fn["outer" + name] = function( margin ) {
7129
	jQuery.fn["outer" + name] = function( margin ) {
6194
		return this[0] ?
7130
		return this[0] ?
6195
			jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
7131
			parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
6196
			null;
7132
			null;
6197
	};
7133
	};
6198
 
7134
 
6199
	jQuery.fn[ type ] = function( size ) {
7135
	jQuery.fn[ type ] = function( size ) {
6200
		// Get window width or height
7136
		// Get window width or height
6201
		var elem = this[0];
7137
		var elem = this[0];
6202
		if ( !elem ) {
7138
		if ( !elem ) {
6203
			return size == null ? null : this;
7139
			return size == null ? null : this;
6204
		}
7140
		}
6205
		
7141
		
6206
		if ( jQuery.isFunction( size ) ) {
7142
		if ( jQuery.isFunction( size ) ) {
6207
			return this.each(function( i ) {
7143
			return this.each(function( i ) {
6208
				var self = jQuery( this );
7144
				var self = jQuery( this );
6209
				self[ type ]( size.call( this, i, self[ type ]() ) );
7145
				self[ type ]( size.call( this, i, self[ type ]() ) );
6210
			});
7146
			});
6211
		}
7147
		}
6212
 
7148
 
6213
		return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
7149
		if ( jQuery.isWindow( elem ) ) {
6214
			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
7150
			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
6215
			elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
7151
			return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
6216
			elem.document.body[ "client" + name ] :
7152
				elem.document.body[ "client" + name ];
6217
 
7153
 
6218
			// Get document width or height
7154
		// Get document width or height
6219
			(elem.nodeType === 9) ? // is it a document
7155
		} else if ( elem.nodeType === 9 ) {
6220
				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
7156
			// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
6221
				Math.max(
7157
			return Math.max(
6222
					elem.documentElement["client" + name],
7158
				elem.documentElement["client" + name],
6223
					elem.body["scroll" + name], elem.documentElement["scroll" + name],
7159
				elem.body["scroll" + name], elem.documentElement["scroll" + name],
6224
					elem.body["offset" + name], elem.documentElement["offset" + name]
7160
				elem.body["offset" + name], elem.documentElement["offset" + name]
6225
				) :
7161
			);
6226
 
7162
 
6227
				// Get or set width or height on the element
7163
		// Get or set width or height on the element
6228
				size === undefined ?
7164
		} else if ( size === undefined ) {
-
 
7165
			var orig = jQuery.css( elem, type ),
-
 
7166
				ret = parseFloat( orig );
6229
					// Get width or height on the element
7167
 
6230
					jQuery.css( elem, type ) :
7168
			return jQuery.isNaN( ret ) ? orig : ret;
-
 
7169
 
6231
 
7170
		// Set the width or height on the element (default to pixels if value is unitless)
-
 
7171
		} else {
6232
					// Set the width or height on the element (default to pixels if value is unitless)
7172
			return this.css( type, typeof size === "string" ? size : size + "px" );
6233
					this.css( type, typeof size === "string" ? size : size + "px" );
7173
		}
6234
	};
7174
	};
6235
 
7175
 
6236
});
7176
});
6237
// Expose jQuery to the global object
-
 
6238
window.jQuery = window.$ = jQuery;
-
 
-
 
7177
 
6239
 
7178
 
6240
})(window);
7179
})(window);