View | Details | Raw Unified | Return to bug 15883
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-1.12.0.js (+11027 lines)
Line 0 Link Here
1
/*!
2
 * jQuery JavaScript Library v1.12.0
3
 * http://jquery.com/
4
 *
5
 * Includes Sizzle.js
6
 * http://sizzlejs.com/
7
 *
8
 * Copyright jQuery Foundation and other contributors
9
 * Released under the MIT license
10
 * http://jquery.org/license
11
 *
12
 * Date: 2016-01-08T19:56Z
13
 */
14
15
(function( global, factory ) {
16
17
	if ( typeof module === "object" && typeof module.exports === "object" ) {
18
		// For CommonJS and CommonJS-like environments where a proper `window`
19
		// is present, execute the factory and get jQuery.
20
		// For environments that do not have a `window` with a `document`
21
		// (such as Node.js), expose a factory as module.exports.
22
		// This accentuates the need for the creation of a real `window`.
23
		// e.g. var jQuery = require("jquery")(window);
24
		// See ticket #14549 for more info.
25
		module.exports = global.document ?
26
			factory( global, true ) :
27
			function( w ) {
28
				if ( !w.document ) {
29
					throw new Error( "jQuery requires a window with a document" );
30
				}
31
				return factory( w );
32
			};
33
	} else {
34
		factory( global );
35
	}
36
37
// Pass this if window is not defined yet
38
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
39
40
// Support: Firefox 18+
41
// Can't be in strict mode, several libs including ASP.NET trace
42
// the stack via arguments.caller.callee and Firefox dies if
43
// you try to trace through "use strict" call chains. (#13335)
44
//"use strict";
45
var deletedIds = [];
46
47
var document = window.document;
48
49
var slice = deletedIds.slice;
50
51
var concat = deletedIds.concat;
52
53
var push = deletedIds.push;
54
55
var indexOf = deletedIds.indexOf;
56
57
var class2type = {};
58
59
var toString = class2type.toString;
60
61
var hasOwn = class2type.hasOwnProperty;
62
63
var support = {};
64
65
66
67
var
68
	version = "1.12.0",
69
70
	// Define a local copy of jQuery
71
	jQuery = function( selector, context ) {
72
73
		// The jQuery object is actually just the init constructor 'enhanced'
74
		// Need init if jQuery is called (just allow error to be thrown if not included)
75
		return new jQuery.fn.init( selector, context );
76
	},
77
78
	// Support: Android<4.1, IE<9
79
	// Make sure we trim BOM and NBSP
80
	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
81
82
	// Matches dashed string for camelizing
83
	rmsPrefix = /^-ms-/,
84
	rdashAlpha = /-([\da-z])/gi,
85
86
	// Used by jQuery.camelCase as callback to replace()
87
	fcamelCase = function( all, letter ) {
88
		return letter.toUpperCase();
89
	};
90
91
jQuery.fn = jQuery.prototype = {
92
93
	// The current version of jQuery being used
94
	jquery: version,
95
96
	constructor: jQuery,
97
98
	// Start with an empty selector
99
	selector: "",
100
101
	// The default length of a jQuery object is 0
102
	length: 0,
103
104
	toArray: function() {
105
		return slice.call( this );
106
	},
107
108
	// Get the Nth element in the matched element set OR
109
	// Get the whole matched element set as a clean array
110
	get: function( num ) {
111
		return num != null ?
112
113
			// Return just the one element from the set
114
			( num < 0 ? this[ num + this.length ] : this[ num ] ) :
115
116
			// Return all the elements in a clean array
117
			slice.call( this );
118
	},
119
120
	// Take an array of elements and push it onto the stack
121
	// (returning the new matched element set)
122
	pushStack: function( elems ) {
123
124
		// Build a new jQuery matched element set
125
		var ret = jQuery.merge( this.constructor(), elems );
126
127
		// Add the old object onto the stack (as a reference)
128
		ret.prevObject = this;
129
		ret.context = this.context;
130
131
		// Return the newly-formed element set
132
		return ret;
133
	},
134
135
	// Execute a callback for every element in the matched set.
136
	each: function( callback ) {
137
		return jQuery.each( this, callback );
138
	},
139
140
	map: function( callback ) {
141
		return this.pushStack( jQuery.map( this, function( elem, i ) {
142
			return callback.call( elem, i, elem );
143
		} ) );
144
	},
145
146
	slice: function() {
147
		return this.pushStack( slice.apply( this, arguments ) );
148
	},
149
150
	first: function() {
151
		return this.eq( 0 );
152
	},
153
154
	last: function() {
155
		return this.eq( -1 );
156
	},
157
158
	eq: function( i ) {
159
		var len = this.length,
160
			j = +i + ( i < 0 ? len : 0 );
161
		return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
162
	},
163
164
	end: function() {
165
		return this.prevObject || this.constructor();
166
	},
167
168
	// For internal use only.
169
	// Behaves like an Array's method, not like a jQuery method.
170
	push: push,
171
	sort: deletedIds.sort,
172
	splice: deletedIds.splice
173
};
174
175
jQuery.extend = jQuery.fn.extend = function() {
176
	var src, copyIsArray, copy, name, options, clone,
177
		target = arguments[ 0 ] || {},
178
		i = 1,
179
		length = arguments.length,
180
		deep = false;
181
182
	// Handle a deep copy situation
183
	if ( typeof target === "boolean" ) {
184
		deep = target;
185
186
		// skip the boolean and the target
187
		target = arguments[ i ] || {};
188
		i++;
189
	}
190
191
	// Handle case when target is a string or something (possible in deep copy)
192
	if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
193
		target = {};
194
	}
195
196
	// extend jQuery itself if only one argument is passed
197
	if ( i === length ) {
198
		target = this;
199
		i--;
200
	}
201
202
	for ( ; i < length; i++ ) {
203
204
		// Only deal with non-null/undefined values
205
		if ( ( options = arguments[ i ] ) != null ) {
206
207
			// Extend the base object
208
			for ( name in options ) {
209
				src = target[ name ];
210
				copy = options[ name ];
211
212
				// Prevent never-ending loop
213
				if ( target === copy ) {
214
					continue;
215
				}
216
217
				// Recurse if we're merging plain objects or arrays
218
				if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
219
					( copyIsArray = jQuery.isArray( copy ) ) ) ) {
220
221
					if ( copyIsArray ) {
222
						copyIsArray = false;
223
						clone = src && jQuery.isArray( src ) ? src : [];
224
225
					} else {
226
						clone = src && jQuery.isPlainObject( src ) ? src : {};
227
					}
228
229
					// Never move original objects, clone them
230
					target[ name ] = jQuery.extend( deep, clone, copy );
231
232
				// Don't bring in undefined values
233
				} else if ( copy !== undefined ) {
234
					target[ name ] = copy;
235
				}
236
			}
237
		}
238
	}
239
240
	// Return the modified object
241
	return target;
242
};
243
244
jQuery.extend( {
245
246
	// Unique for each copy of jQuery on the page
247
	expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
248
249
	// Assume jQuery is ready without the ready module
250
	isReady: true,
251
252
	error: function( msg ) {
253
		throw new Error( msg );
254
	},
255
256
	noop: function() {},
257
258
	// See test/unit/core.js for details concerning isFunction.
259
	// Since version 1.3, DOM methods and functions like alert
260
	// aren't supported. They return false on IE (#2968).
261
	isFunction: function( obj ) {
262
		return jQuery.type( obj ) === "function";
263
	},
264
265
	isArray: Array.isArray || function( obj ) {
266
		return jQuery.type( obj ) === "array";
267
	},
268
269
	isWindow: function( obj ) {
270
		/* jshint eqeqeq: false */
271
		return obj != null && obj == obj.window;
272
	},
273
274
	isNumeric: function( obj ) {
275
276
		// parseFloat NaNs numeric-cast false positives (null|true|false|"")
277
		// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
278
		// subtraction forces infinities to NaN
279
		// adding 1 corrects loss of precision from parseFloat (#15100)
280
		var realStringObj = obj && obj.toString();
281
		return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
282
	},
283
284
	isEmptyObject: function( obj ) {
285
		var name;
286
		for ( name in obj ) {
287
			return false;
288
		}
289
		return true;
290
	},
291
292
	isPlainObject: function( obj ) {
293
		var key;
294
295
		// Must be an Object.
296
		// Because of IE, we also have to check the presence of the constructor property.
297
		// Make sure that DOM nodes and window objects don't pass through, as well
298
		if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
299
			return false;
300
		}
301
302
		try {
303
304
			// Not own constructor property must be Object
305
			if ( obj.constructor &&
306
				!hasOwn.call( obj, "constructor" ) &&
307
				!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
308
				return false;
309
			}
310
		} catch ( e ) {
311
312
			// IE8,9 Will throw exceptions on certain host objects #9897
313
			return false;
314
		}
315
316
		// Support: IE<9
317
		// Handle iteration over inherited properties before own properties.
318
		if ( !support.ownFirst ) {
319
			for ( key in obj ) {
320
				return hasOwn.call( obj, key );
321
			}
322
		}
323
324
		// Own properties are enumerated firstly, so to speed up,
325
		// if last one is own, then all properties are own.
326
		for ( key in obj ) {}
327
328
		return key === undefined || hasOwn.call( obj, key );
329
	},
330
331
	type: function( obj ) {
332
		if ( obj == null ) {
333
			return obj + "";
334
		}
335
		return typeof obj === "object" || typeof obj === "function" ?
336
			class2type[ toString.call( obj ) ] || "object" :
337
			typeof obj;
338
	},
339
340
	// Workarounds based on findings by Jim Driscoll
341
	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
342
	globalEval: function( data ) {
343
		if ( data && jQuery.trim( data ) ) {
344
345
			// We use execScript on Internet Explorer
346
			// We use an anonymous function so that context is window
347
			// rather than jQuery in Firefox
348
			( window.execScript || function( data ) {
349
				window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation
350
			} )( data );
351
		}
352
	},
353
354
	// Convert dashed to camelCase; used by the css and data modules
355
	// Microsoft forgot to hump their vendor prefix (#9572)
356
	camelCase: function( string ) {
357
		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
358
	},
359
360
	nodeName: function( elem, name ) {
361
		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
362
	},
363
364
	each: function( obj, callback ) {
365
		var length, i = 0;
366
367
		if ( isArrayLike( obj ) ) {
368
			length = obj.length;
369
			for ( ; i < length; i++ ) {
370
				if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
371
					break;
372
				}
373
			}
374
		} else {
375
			for ( i in obj ) {
376
				if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
377
					break;
378
				}
379
			}
380
		}
381
382
		return obj;
383
	},
384
385
	// Support: Android<4.1, IE<9
386
	trim: function( text ) {
387
		return text == null ?
388
			"" :
389
			( text + "" ).replace( rtrim, "" );
390
	},
391
392
	// results is for internal usage only
393
	makeArray: function( arr, results ) {
394
		var ret = results || [];
395
396
		if ( arr != null ) {
397
			if ( isArrayLike( Object( arr ) ) ) {
398
				jQuery.merge( ret,
399
					typeof arr === "string" ?
400
					[ arr ] : arr
401
				);
402
			} else {
403
				push.call( ret, arr );
404
			}
405
		}
406
407
		return ret;
408
	},
409
410
	inArray: function( elem, arr, i ) {
411
		var len;
412
413
		if ( arr ) {
414
			if ( indexOf ) {
415
				return indexOf.call( arr, elem, i );
416
			}
417
418
			len = arr.length;
419
			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
420
421
			for ( ; i < len; i++ ) {
422
423
				// Skip accessing in sparse arrays
424
				if ( i in arr && arr[ i ] === elem ) {
425
					return i;
426
				}
427
			}
428
		}
429
430
		return -1;
431
	},
432
433
	merge: function( first, second ) {
434
		var len = +second.length,
435
			j = 0,
436
			i = first.length;
437
438
		while ( j < len ) {
439
			first[ i++ ] = second[ j++ ];
440
		}
441
442
		// Support: IE<9
443
		// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
444
		if ( len !== len ) {
445
			while ( second[ j ] !== undefined ) {
446
				first[ i++ ] = second[ j++ ];
447
			}
448
		}
449
450
		first.length = i;
451
452
		return first;
453
	},
454
455
	grep: function( elems, callback, invert ) {
456
		var callbackInverse,
457
			matches = [],
458
			i = 0,
459
			length = elems.length,
460
			callbackExpect = !invert;
461
462
		// Go through the array, only saving the items
463
		// that pass the validator function
464
		for ( ; i < length; i++ ) {
465
			callbackInverse = !callback( elems[ i ], i );
466
			if ( callbackInverse !== callbackExpect ) {
467
				matches.push( elems[ i ] );
468
			}
469
		}
470
471
		return matches;
472
	},
473
474
	// arg is for internal usage only
475
	map: function( elems, callback, arg ) {
476
		var length, value,
477
			i = 0,
478
			ret = [];
479
480
		// Go through the array, translating each of the items to their new values
481
		if ( isArrayLike( elems ) ) {
482
			length = elems.length;
483
			for ( ; i < length; i++ ) {
484
				value = callback( elems[ i ], i, arg );
485
486
				if ( value != null ) {
487
					ret.push( value );
488
				}
489
			}
490
491
		// Go through every key on the object,
492
		} else {
493
			for ( i in elems ) {
494
				value = callback( elems[ i ], i, arg );
495
496
				if ( value != null ) {
497
					ret.push( value );
498
				}
499
			}
500
		}
501
502
		// Flatten any nested arrays
503
		return concat.apply( [], ret );
504
	},
505
506
	// A global GUID counter for objects
507
	guid: 1,
508
509
	// Bind a function to a context, optionally partially applying any
510
	// arguments.
511
	proxy: function( fn, context ) {
512
		var args, proxy, tmp;
513
514
		if ( typeof context === "string" ) {
515
			tmp = fn[ context ];
516
			context = fn;
517
			fn = tmp;
518
		}
519
520
		// Quick check to determine if target is callable, in the spec
521
		// this throws a TypeError, but we will just return undefined.
522
		if ( !jQuery.isFunction( fn ) ) {
523
			return undefined;
524
		}
525
526
		// Simulated bind
527
		args = slice.call( arguments, 2 );
528
		proxy = function() {
529
			return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
530
		};
531
532
		// Set the guid of unique handler to the same of original handler, so it can be removed
533
		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
534
535
		return proxy;
536
	},
537
538
	now: function() {
539
		return +( new Date() );
540
	},
541
542
	// jQuery.support is not used in Core but other projects attach their
543
	// properties to it so it needs to exist.
544
	support: support
545
} );
546
547
// JSHint would error on this code due to the Symbol not being defined in ES5.
548
// Defining this global in .jshintrc would create a danger of using the global
549
// unguarded in another place, it seems safer to just disable JSHint for these
550
// three lines.
551
/* jshint ignore: start */
552
if ( typeof Symbol === "function" ) {
553
	jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ];
554
}
555
/* jshint ignore: end */
556
557
// Populate the class2type map
558
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
559
function( i, name ) {
560
	class2type[ "[object " + name + "]" ] = name.toLowerCase();
561
} );
562
563
function isArrayLike( obj ) {
564
565
	// Support: iOS 8.2 (not reproducible in simulator)
566
	// `in` check used to prevent JIT error (gh-2145)
567
	// hasOwn isn't used here due to false negatives
568
	// regarding Nodelist length in IE
569
	var length = !!obj && "length" in obj && obj.length,
570
		type = jQuery.type( obj );
571
572
	if ( type === "function" || jQuery.isWindow( obj ) ) {
573
		return false;
574
	}
575
576
	return type === "array" || length === 0 ||
577
		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
578
}
579
var Sizzle =
580
/*!
581
 * Sizzle CSS Selector Engine v2.2.1
582
 * http://sizzlejs.com/
583
 *
584
 * Copyright jQuery Foundation and other contributors
585
 * Released under the MIT license
586
 * http://jquery.org/license
587
 *
588
 * Date: 2015-10-17
589
 */
590
(function( window ) {
591
592
var i,
593
	support,
594
	Expr,
595
	getText,
596
	isXML,
597
	tokenize,
598
	compile,
599
	select,
600
	outermostContext,
601
	sortInput,
602
	hasDuplicate,
603
604
	// Local document vars
605
	setDocument,
606
	document,
607
	docElem,
608
	documentIsHTML,
609
	rbuggyQSA,
610
	rbuggyMatches,
611
	matches,
612
	contains,
613
614
	// Instance-specific data
615
	expando = "sizzle" + 1 * new Date(),
616
	preferredDoc = window.document,
617
	dirruns = 0,
618
	done = 0,
619
	classCache = createCache(),
620
	tokenCache = createCache(),
621
	compilerCache = createCache(),
622
	sortOrder = function( a, b ) {
623
		if ( a === b ) {
624
			hasDuplicate = true;
625
		}
626
		return 0;
627
	},
628
629
	// General-purpose constants
630
	MAX_NEGATIVE = 1 << 31,
631
632
	// Instance methods
633
	hasOwn = ({}).hasOwnProperty,
634
	arr = [],
635
	pop = arr.pop,
636
	push_native = arr.push,
637
	push = arr.push,
638
	slice = arr.slice,
639
	// Use a stripped-down indexOf as it's faster than native
640
	// http://jsperf.com/thor-indexof-vs-for/5
641
	indexOf = function( list, elem ) {
642
		var i = 0,
643
			len = list.length;
644
		for ( ; i < len; i++ ) {
645
			if ( list[i] === elem ) {
646
				return i;
647
			}
648
		}
649
		return -1;
650
	},
651
652
	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
653
654
	// Regular expressions
655
656
	// http://www.w3.org/TR/css3-selectors/#whitespace
657
	whitespace = "[\\x20\\t\\r\\n\\f]",
658
659
	// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
660
	identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
661
662
	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
663
	attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
664
		// Operator (capture 2)
665
		"*([*^$|!~]?=)" + whitespace +
666
		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
667
		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
668
		"*\\]",
669
670
	pseudos = ":(" + identifier + ")(?:\\((" +
671
		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
672
		// 1. quoted (capture 3; capture 4 or capture 5)
673
		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
674
		// 2. simple (capture 6)
675
		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
676
		// 3. anything else (capture 2)
677
		".*" +
678
		")\\)|)",
679
680
	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
681
	rwhitespace = new RegExp( whitespace + "+", "g" ),
682
	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
683
684
	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
685
	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
686
687
	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
688
689
	rpseudo = new RegExp( pseudos ),
690
	ridentifier = new RegExp( "^" + identifier + "$" ),
691
692
	matchExpr = {
693
		"ID": new RegExp( "^#(" + identifier + ")" ),
694
		"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
695
		"TAG": new RegExp( "^(" + identifier + "|[*])" ),
696
		"ATTR": new RegExp( "^" + attributes ),
697
		"PSEUDO": new RegExp( "^" + pseudos ),
698
		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
699
			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
700
			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
701
		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
702
		// For use in libraries implementing .is()
703
		// We use this for POS matching in `select`
704
		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
705
			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
706
	},
707
708
	rinputs = /^(?:input|select|textarea|button)$/i,
709
	rheader = /^h\d$/i,
710
711
	rnative = /^[^{]+\{\s*\[native \w/,
712
713
	// Easily-parseable/retrievable ID or TAG or CLASS selectors
714
	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
715
716
	rsibling = /[+~]/,
717
	rescape = /'|\\/g,
718
719
	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
720
	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
721
	funescape = function( _, escaped, escapedWhitespace ) {
722
		var high = "0x" + escaped - 0x10000;
723
		// NaN means non-codepoint
724
		// Support: Firefox<24
725
		// Workaround erroneous numeric interpretation of +"0x"
726
		return high !== high || escapedWhitespace ?
727
			escaped :
728
			high < 0 ?
729
				// BMP codepoint
730
				String.fromCharCode( high + 0x10000 ) :
731
				// Supplemental Plane codepoint (surrogate pair)
732
				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
733
	},
734
735
	// Used for iframes
736
	// See setDocument()
737
	// Removing the function wrapper causes a "Permission Denied"
738
	// error in IE
739
	unloadHandler = function() {
740
		setDocument();
741
	};
742
743
// Optimize for push.apply( _, NodeList )
744
try {
745
	push.apply(
746
		(arr = slice.call( preferredDoc.childNodes )),
747
		preferredDoc.childNodes
748
	);
749
	// Support: Android<4.0
750
	// Detect silently failing push.apply
751
	arr[ preferredDoc.childNodes.length ].nodeType;
752
} catch ( e ) {
753
	push = { apply: arr.length ?
754
755
		// Leverage slice if possible
756
		function( target, els ) {
757
			push_native.apply( target, slice.call(els) );
758
		} :
759
760
		// Support: IE<9
761
		// Otherwise append directly
762
		function( target, els ) {
763
			var j = target.length,
764
				i = 0;
765
			// Can't trust NodeList.length
766
			while ( (target[j++] = els[i++]) ) {}
767
			target.length = j - 1;
768
		}
769
	};
770
}
771
772
function Sizzle( selector, context, results, seed ) {
773
	var m, i, elem, nid, nidselect, match, groups, newSelector,
774
		newContext = context && context.ownerDocument,
775
776
		// nodeType defaults to 9, since context defaults to document
777
		nodeType = context ? context.nodeType : 9;
778
779
	results = results || [];
780
781
	// Return early from calls with invalid selector or context
782
	if ( typeof selector !== "string" || !selector ||
783
		nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
784
785
		return results;
786
	}
787
788
	// Try to shortcut find operations (as opposed to filters) in HTML documents
789
	if ( !seed ) {
790
791
		if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
792
			setDocument( context );
793
		}
794
		context = context || document;
795
796
		if ( documentIsHTML ) {
797
798
			// If the selector is sufficiently simple, try using a "get*By*" DOM method
799
			// (excepting DocumentFragment context, where the methods don't exist)
800
			if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
801
802
				// ID selector
803
				if ( (m = match[1]) ) {
804
805
					// Document context
806
					if ( nodeType === 9 ) {
807
						if ( (elem = context.getElementById( m )) ) {
808
809
							// Support: IE, Opera, Webkit
810
							// TODO: identify versions
811
							// getElementById can match elements by name instead of ID
812
							if ( elem.id === m ) {
813
								results.push( elem );
814
								return results;
815
							}
816
						} else {
817
							return results;
818
						}
819
820
					// Element context
821
					} else {
822
823
						// Support: IE, Opera, Webkit
824
						// TODO: identify versions
825
						// getElementById can match elements by name instead of ID
826
						if ( newContext && (elem = newContext.getElementById( m )) &&
827
							contains( context, elem ) &&
828
							elem.id === m ) {
829
830
							results.push( elem );
831
							return results;
832
						}
833
					}
834
835
				// Type selector
836
				} else if ( match[2] ) {
837
					push.apply( results, context.getElementsByTagName( selector ) );
838
					return results;
839
840
				// Class selector
841
				} else if ( (m = match[3]) && support.getElementsByClassName &&
842
					context.getElementsByClassName ) {
843
844
					push.apply( results, context.getElementsByClassName( m ) );
845
					return results;
846
				}
847
			}
848
849
			// Take advantage of querySelectorAll
850
			if ( support.qsa &&
851
				!compilerCache[ selector + " " ] &&
852
				(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
853
854
				if ( nodeType !== 1 ) {
855
					newContext = context;
856
					newSelector = selector;
857
858
				// qSA looks outside Element context, which is not what we want
859
				// Thanks to Andrew Dupont for this workaround technique
860
				// Support: IE <=8
861
				// Exclude object elements
862
				} else if ( context.nodeName.toLowerCase() !== "object" ) {
863
864
					// Capture the context ID, setting it first if necessary
865
					if ( (nid = context.getAttribute( "id" )) ) {
866
						nid = nid.replace( rescape, "\\$&" );
867
					} else {
868
						context.setAttribute( "id", (nid = expando) );
869
					}
870
871
					// Prefix every selector in the list
872
					groups = tokenize( selector );
873
					i = groups.length;
874
					nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
875
					while ( i-- ) {
876
						groups[i] = nidselect + " " + toSelector( groups[i] );
877
					}
878
					newSelector = groups.join( "," );
879
880
					// Expand context for sibling selectors
881
					newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
882
						context;
883
				}
884
885
				if ( newSelector ) {
886
					try {
887
						push.apply( results,
888
							newContext.querySelectorAll( newSelector )
889
						);
890
						return results;
891
					} catch ( qsaError ) {
892
					} finally {
893
						if ( nid === expando ) {
894
							context.removeAttribute( "id" );
895
						}
896
					}
897
				}
898
			}
899
		}
900
	}
901
902
	// All others
903
	return select( selector.replace( rtrim, "$1" ), context, results, seed );
904
}
905
906
/**
907
 * Create key-value caches of limited size
908
 * @returns {function(string, object)} Returns the Object data after storing it on itself with
909
 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
910
 *	deleting the oldest entry
911
 */
912
function createCache() {
913
	var keys = [];
914
915
	function cache( key, value ) {
916
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
917
		if ( keys.push( key + " " ) > Expr.cacheLength ) {
918
			// Only keep the most recent entries
919
			delete cache[ keys.shift() ];
920
		}
921
		return (cache[ key + " " ] = value);
922
	}
923
	return cache;
924
}
925
926
/**
927
 * Mark a function for special use by Sizzle
928
 * @param {Function} fn The function to mark
929
 */
930
function markFunction( fn ) {
931
	fn[ expando ] = true;
932
	return fn;
933
}
934
935
/**
936
 * Support testing using an element
937
 * @param {Function} fn Passed the created div and expects a boolean result
938
 */
939
function assert( fn ) {
940
	var div = document.createElement("div");
941
942
	try {
943
		return !!fn( div );
944
	} catch (e) {
945
		return false;
946
	} finally {
947
		// Remove from its parent by default
948
		if ( div.parentNode ) {
949
			div.parentNode.removeChild( div );
950
		}
951
		// release memory in IE
952
		div = null;
953
	}
954
}
955
956
/**
957
 * Adds the same handler for all of the specified attrs
958
 * @param {String} attrs Pipe-separated list of attributes
959
 * @param {Function} handler The method that will be applied
960
 */
961
function addHandle( attrs, handler ) {
962
	var arr = attrs.split("|"),
963
		i = arr.length;
964
965
	while ( i-- ) {
966
		Expr.attrHandle[ arr[i] ] = handler;
967
	}
968
}
969
970
/**
971
 * Checks document order of two siblings
972
 * @param {Element} a
973
 * @param {Element} b
974
 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
975
 */
976
function siblingCheck( a, b ) {
977
	var cur = b && a,
978
		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
979
			( ~b.sourceIndex || MAX_NEGATIVE ) -
980
			( ~a.sourceIndex || MAX_NEGATIVE );
981
982
	// Use IE sourceIndex if available on both nodes
983
	if ( diff ) {
984
		return diff;
985
	}
986
987
	// Check if b follows a
988
	if ( cur ) {
989
		while ( (cur = cur.nextSibling) ) {
990
			if ( cur === b ) {
991
				return -1;
992
			}
993
		}
994
	}
995
996
	return a ? 1 : -1;
997
}
998
999
/**
1000
 * Returns a function to use in pseudos for input types
1001
 * @param {String} type
1002
 */
1003
function createInputPseudo( type ) {
1004
	return function( elem ) {
1005
		var name = elem.nodeName.toLowerCase();
1006
		return name === "input" && elem.type === type;
1007
	};
1008
}
1009
1010
/**
1011
 * Returns a function to use in pseudos for buttons
1012
 * @param {String} type
1013
 */
1014
function createButtonPseudo( type ) {
1015
	return function( elem ) {
1016
		var name = elem.nodeName.toLowerCase();
1017
		return (name === "input" || name === "button") && elem.type === type;
1018
	};
1019
}
1020
1021
/**
1022
 * Returns a function to use in pseudos for positionals
1023
 * @param {Function} fn
1024
 */
1025
function createPositionalPseudo( fn ) {
1026
	return markFunction(function( argument ) {
1027
		argument = +argument;
1028
		return markFunction(function( seed, matches ) {
1029
			var j,
1030
				matchIndexes = fn( [], seed.length, argument ),
1031
				i = matchIndexes.length;
1032
1033
			// Match elements found at the specified indexes
1034
			while ( i-- ) {
1035
				if ( seed[ (j = matchIndexes[i]) ] ) {
1036
					seed[j] = !(matches[j] = seed[j]);
1037
				}
1038
			}
1039
		});
1040
	});
1041
}
1042
1043
/**
1044
 * Checks a node for validity as a Sizzle context
1045
 * @param {Element|Object=} context
1046
 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1047
 */
1048
function testContext( context ) {
1049
	return context && typeof context.getElementsByTagName !== "undefined" && context;
1050
}
1051
1052
// Expose support vars for convenience
1053
support = Sizzle.support = {};
1054
1055
/**
1056
 * Detects XML nodes
1057
 * @param {Element|Object} elem An element or a document
1058
 * @returns {Boolean} True iff elem is a non-HTML XML node
1059
 */
1060
isXML = Sizzle.isXML = function( elem ) {
1061
	// documentElement is verified for cases where it doesn't yet exist
1062
	// (such as loading iframes in IE - #4833)
1063
	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1064
	return documentElement ? documentElement.nodeName !== "HTML" : false;
1065
};
1066
1067
/**
1068
 * Sets document-related variables once based on the current document
1069
 * @param {Element|Object} [doc] An element or document object to use to set the document
1070
 * @returns {Object} Returns the current document
1071
 */
1072
setDocument = Sizzle.setDocument = function( node ) {
1073
	var hasCompare, parent,
1074
		doc = node ? node.ownerDocument || node : preferredDoc;
1075
1076
	// Return early if doc is invalid or already selected
1077
	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1078
		return document;
1079
	}
1080
1081
	// Update global variables
1082
	document = doc;
1083
	docElem = document.documentElement;
1084
	documentIsHTML = !isXML( document );
1085
1086
	// Support: IE 9-11, Edge
1087
	// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1088
	if ( (parent = document.defaultView) && parent.top !== parent ) {
1089
		// Support: IE 11
1090
		if ( parent.addEventListener ) {
1091
			parent.addEventListener( "unload", unloadHandler, false );
1092
1093
		// Support: IE 9 - 10 only
1094
		} else if ( parent.attachEvent ) {
1095
			parent.attachEvent( "onunload", unloadHandler );
1096
		}
1097
	}
1098
1099
	/* Attributes
1100
	---------------------------------------------------------------------- */
1101
1102
	// Support: IE<8
1103
	// Verify that getAttribute really returns attributes and not properties
1104
	// (excepting IE8 booleans)
1105
	support.attributes = assert(function( div ) {
1106
		div.className = "i";
1107
		return !div.getAttribute("className");
1108
	});
1109
1110
	/* getElement(s)By*
1111
	---------------------------------------------------------------------- */
1112
1113
	// Check if getElementsByTagName("*") returns only elements
1114
	support.getElementsByTagName = assert(function( div ) {
1115
		div.appendChild( document.createComment("") );
1116
		return !div.getElementsByTagName("*").length;
1117
	});
1118
1119
	// Support: IE<9
1120
	support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1121
1122
	// Support: IE<10
1123
	// Check if getElementById returns elements by name
1124
	// The broken getElementById methods don't pick up programatically-set names,
1125
	// so use a roundabout getElementsByName test
1126
	support.getById = assert(function( div ) {
1127
		docElem.appendChild( div ).id = expando;
1128
		return !document.getElementsByName || !document.getElementsByName( expando ).length;
1129
	});
1130
1131
	// ID find and filter
1132
	if ( support.getById ) {
1133
		Expr.find["ID"] = function( id, context ) {
1134
			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1135
				var m = context.getElementById( id );
1136
				return m ? [ m ] : [];
1137
			}
1138
		};
1139
		Expr.filter["ID"] = function( id ) {
1140
			var attrId = id.replace( runescape, funescape );
1141
			return function( elem ) {
1142
				return elem.getAttribute("id") === attrId;
1143
			};
1144
		};
1145
	} else {
1146
		// Support: IE6/7
1147
		// getElementById is not reliable as a find shortcut
1148
		delete Expr.find["ID"];
1149
1150
		Expr.filter["ID"] =  function( id ) {
1151
			var attrId = id.replace( runescape, funescape );
1152
			return function( elem ) {
1153
				var node = typeof elem.getAttributeNode !== "undefined" &&
1154
					elem.getAttributeNode("id");
1155
				return node && node.value === attrId;
1156
			};
1157
		};
1158
	}
1159
1160
	// Tag
1161
	Expr.find["TAG"] = support.getElementsByTagName ?
1162
		function( tag, context ) {
1163
			if ( typeof context.getElementsByTagName !== "undefined" ) {
1164
				return context.getElementsByTagName( tag );
1165
1166
			// DocumentFragment nodes don't have gEBTN
1167
			} else if ( support.qsa ) {
1168
				return context.querySelectorAll( tag );
1169
			}
1170
		} :
1171
1172
		function( tag, context ) {
1173
			var elem,
1174
				tmp = [],
1175
				i = 0,
1176
				// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1177
				results = context.getElementsByTagName( tag );
1178
1179
			// Filter out possible comments
1180
			if ( tag === "*" ) {
1181
				while ( (elem = results[i++]) ) {
1182
					if ( elem.nodeType === 1 ) {
1183
						tmp.push( elem );
1184
					}
1185
				}
1186
1187
				return tmp;
1188
			}
1189
			return results;
1190
		};
1191
1192
	// Class
1193
	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1194
		if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1195
			return context.getElementsByClassName( className );
1196
		}
1197
	};
1198
1199
	/* QSA/matchesSelector
1200
	---------------------------------------------------------------------- */
1201
1202
	// QSA and matchesSelector support
1203
1204
	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1205
	rbuggyMatches = [];
1206
1207
	// qSa(:focus) reports false when true (Chrome 21)
1208
	// We allow this because of a bug in IE8/9 that throws an error
1209
	// whenever `document.activeElement` is accessed on an iframe
1210
	// So, we allow :focus to pass through QSA all the time to avoid the IE error
1211
	// See http://bugs.jquery.com/ticket/13378
1212
	rbuggyQSA = [];
1213
1214
	if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1215
		// Build QSA regex
1216
		// Regex strategy adopted from Diego Perini
1217
		assert(function( div ) {
1218
			// Select is set to empty string on purpose
1219
			// This is to test IE's treatment of not explicitly
1220
			// setting a boolean content attribute,
1221
			// since its presence should be enough
1222
			// http://bugs.jquery.com/ticket/12359
1223
			docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
1224
				"<select id='" + expando + "-\r\\' msallowcapture=''>" +
1225
				"<option selected=''></option></select>";
1226
1227
			// Support: IE8, Opera 11-12.16
1228
			// Nothing should be selected when empty strings follow ^= or $= or *=
1229
			// The test attribute must be unknown in Opera but "safe" for WinRT
1230
			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1231
			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
1232
				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1233
			}
1234
1235
			// Support: IE8
1236
			// Boolean attributes and "value" are not treated correctly
1237
			if ( !div.querySelectorAll("[selected]").length ) {
1238
				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1239
			}
1240
1241
			// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1242
			if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1243
				rbuggyQSA.push("~=");
1244
			}
1245
1246
			// Webkit/Opera - :checked should return selected option elements
1247
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1248
			// IE8 throws error here and will not see later tests
1249
			if ( !div.querySelectorAll(":checked").length ) {
1250
				rbuggyQSA.push(":checked");
1251
			}
1252
1253
			// Support: Safari 8+, iOS 8+
1254
			// https://bugs.webkit.org/show_bug.cgi?id=136851
1255
			// In-page `selector#id sibing-combinator selector` fails
1256
			if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
1257
				rbuggyQSA.push(".#.+[+~]");
1258
			}
1259
		});
1260
1261
		assert(function( div ) {
1262
			// Support: Windows 8 Native Apps
1263
			// The type and name attributes are restricted during .innerHTML assignment
1264
			var input = document.createElement("input");
1265
			input.setAttribute( "type", "hidden" );
1266
			div.appendChild( input ).setAttribute( "name", "D" );
1267
1268
			// Support: IE8
1269
			// Enforce case-sensitivity of name attribute
1270
			if ( div.querySelectorAll("[name=d]").length ) {
1271
				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1272
			}
1273
1274
			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1275
			// IE8 throws error here and will not see later tests
1276
			if ( !div.querySelectorAll(":enabled").length ) {
1277
				rbuggyQSA.push( ":enabled", ":disabled" );
1278
			}
1279
1280
			// Opera 10-11 does not throw on post-comma invalid pseudos
1281
			div.querySelectorAll("*,:x");
1282
			rbuggyQSA.push(",.*:");
1283
		});
1284
	}
1285
1286
	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1287
		docElem.webkitMatchesSelector ||
1288
		docElem.mozMatchesSelector ||
1289
		docElem.oMatchesSelector ||
1290
		docElem.msMatchesSelector) )) ) {
1291
1292
		assert(function( div ) {
1293
			// Check to see if it's possible to do matchesSelector
1294
			// on a disconnected node (IE 9)
1295
			support.disconnectedMatch = matches.call( div, "div" );
1296
1297
			// This should fail with an exception
1298
			// Gecko does not error, returns false instead
1299
			matches.call( div, "[s!='']:x" );
1300
			rbuggyMatches.push( "!=", pseudos );
1301
		});
1302
	}
1303
1304
	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1305
	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1306
1307
	/* Contains
1308
	---------------------------------------------------------------------- */
1309
	hasCompare = rnative.test( docElem.compareDocumentPosition );
1310
1311
	// Element contains another
1312
	// Purposefully self-exclusive
1313
	// As in, an element does not contain itself
1314
	contains = hasCompare || rnative.test( docElem.contains ) ?
1315
		function( a, b ) {
1316
			var adown = a.nodeType === 9 ? a.documentElement : a,
1317
				bup = b && b.parentNode;
1318
			return a === bup || !!( bup && bup.nodeType === 1 && (
1319
				adown.contains ?
1320
					adown.contains( bup ) :
1321
					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1322
			));
1323
		} :
1324
		function( a, b ) {
1325
			if ( b ) {
1326
				while ( (b = b.parentNode) ) {
1327
					if ( b === a ) {
1328
						return true;
1329
					}
1330
				}
1331
			}
1332
			return false;
1333
		};
1334
1335
	/* Sorting
1336
	---------------------------------------------------------------------- */
1337
1338
	// Document order sorting
1339
	sortOrder = hasCompare ?
1340
	function( a, b ) {
1341
1342
		// Flag for duplicate removal
1343
		if ( a === b ) {
1344
			hasDuplicate = true;
1345
			return 0;
1346
		}
1347
1348
		// Sort on method existence if only one input has compareDocumentPosition
1349
		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1350
		if ( compare ) {
1351
			return compare;
1352
		}
1353
1354
		// Calculate position if both inputs belong to the same document
1355
		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1356
			a.compareDocumentPosition( b ) :
1357
1358
			// Otherwise we know they are disconnected
1359
			1;
1360
1361
		// Disconnected nodes
1362
		if ( compare & 1 ||
1363
			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1364
1365
			// Choose the first element that is related to our preferred document
1366
			if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1367
				return -1;
1368
			}
1369
			if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1370
				return 1;
1371
			}
1372
1373
			// Maintain original order
1374
			return sortInput ?
1375
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1376
				0;
1377
		}
1378
1379
		return compare & 4 ? -1 : 1;
1380
	} :
1381
	function( a, b ) {
1382
		// Exit early if the nodes are identical
1383
		if ( a === b ) {
1384
			hasDuplicate = true;
1385
			return 0;
1386
		}
1387
1388
		var cur,
1389
			i = 0,
1390
			aup = a.parentNode,
1391
			bup = b.parentNode,
1392
			ap = [ a ],
1393
			bp = [ b ];
1394
1395
		// Parentless nodes are either documents or disconnected
1396
		if ( !aup || !bup ) {
1397
			return a === document ? -1 :
1398
				b === document ? 1 :
1399
				aup ? -1 :
1400
				bup ? 1 :
1401
				sortInput ?
1402
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1403
				0;
1404
1405
		// If the nodes are siblings, we can do a quick check
1406
		} else if ( aup === bup ) {
1407
			return siblingCheck( a, b );
1408
		}
1409
1410
		// Otherwise we need full lists of their ancestors for comparison
1411
		cur = a;
1412
		while ( (cur = cur.parentNode) ) {
1413
			ap.unshift( cur );
1414
		}
1415
		cur = b;
1416
		while ( (cur = cur.parentNode) ) {
1417
			bp.unshift( cur );
1418
		}
1419
1420
		// Walk down the tree looking for a discrepancy
1421
		while ( ap[i] === bp[i] ) {
1422
			i++;
1423
		}
1424
1425
		return i ?
1426
			// Do a sibling check if the nodes have a common ancestor
1427
			siblingCheck( ap[i], bp[i] ) :
1428
1429
			// Otherwise nodes in our document sort first
1430
			ap[i] === preferredDoc ? -1 :
1431
			bp[i] === preferredDoc ? 1 :
1432
			0;
1433
	};
1434
1435
	return document;
1436
};
1437
1438
Sizzle.matches = function( expr, elements ) {
1439
	return Sizzle( expr, null, null, elements );
1440
};
1441
1442
Sizzle.matchesSelector = function( elem, expr ) {
1443
	// Set document vars if needed
1444
	if ( ( elem.ownerDocument || elem ) !== document ) {
1445
		setDocument( elem );
1446
	}
1447
1448
	// Make sure that attribute selectors are quoted
1449
	expr = expr.replace( rattributeQuotes, "='$1']" );
1450
1451
	if ( support.matchesSelector && documentIsHTML &&
1452
		!compilerCache[ expr + " " ] &&
1453
		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1454
		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
1455
1456
		try {
1457
			var ret = matches.call( elem, expr );
1458
1459
			// IE 9's matchesSelector returns false on disconnected nodes
1460
			if ( ret || support.disconnectedMatch ||
1461
					// As well, disconnected nodes are said to be in a document
1462
					// fragment in IE 9
1463
					elem.document && elem.document.nodeType !== 11 ) {
1464
				return ret;
1465
			}
1466
		} catch (e) {}
1467
	}
1468
1469
	return Sizzle( expr, document, null, [ elem ] ).length > 0;
1470
};
1471
1472
Sizzle.contains = function( context, elem ) {
1473
	// Set document vars if needed
1474
	if ( ( context.ownerDocument || context ) !== document ) {
1475
		setDocument( context );
1476
	}
1477
	return contains( context, elem );
1478
};
1479
1480
Sizzle.attr = function( elem, name ) {
1481
	// Set document vars if needed
1482
	if ( ( elem.ownerDocument || elem ) !== document ) {
1483
		setDocument( elem );
1484
	}
1485
1486
	var fn = Expr.attrHandle[ name.toLowerCase() ],
1487
		// Don't get fooled by Object.prototype properties (jQuery #13807)
1488
		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1489
			fn( elem, name, !documentIsHTML ) :
1490
			undefined;
1491
1492
	return val !== undefined ?
1493
		val :
1494
		support.attributes || !documentIsHTML ?
1495
			elem.getAttribute( name ) :
1496
			(val = elem.getAttributeNode(name)) && val.specified ?
1497
				val.value :
1498
				null;
1499
};
1500
1501
Sizzle.error = function( msg ) {
1502
	throw new Error( "Syntax error, unrecognized expression: " + msg );
1503
};
1504
1505
/**
1506
 * Document sorting and removing duplicates
1507
 * @param {ArrayLike} results
1508
 */
1509
Sizzle.uniqueSort = function( results ) {
1510
	var elem,
1511
		duplicates = [],
1512
		j = 0,
1513
		i = 0;
1514
1515
	// Unless we *know* we can detect duplicates, assume their presence
1516
	hasDuplicate = !support.detectDuplicates;
1517
	sortInput = !support.sortStable && results.slice( 0 );
1518
	results.sort( sortOrder );
1519
1520
	if ( hasDuplicate ) {
1521
		while ( (elem = results[i++]) ) {
1522
			if ( elem === results[ i ] ) {
1523
				j = duplicates.push( i );
1524
			}
1525
		}
1526
		while ( j-- ) {
1527
			results.splice( duplicates[ j ], 1 );
1528
		}
1529
	}
1530
1531
	// Clear input after sorting to release objects
1532
	// See https://github.com/jquery/sizzle/pull/225
1533
	sortInput = null;
1534
1535
	return results;
1536
};
1537
1538
/**
1539
 * Utility function for retrieving the text value of an array of DOM nodes
1540
 * @param {Array|Element} elem
1541
 */
1542
getText = Sizzle.getText = function( elem ) {
1543
	var node,
1544
		ret = "",
1545
		i = 0,
1546
		nodeType = elem.nodeType;
1547
1548
	if ( !nodeType ) {
1549
		// If no nodeType, this is expected to be an array
1550
		while ( (node = elem[i++]) ) {
1551
			// Do not traverse comment nodes
1552
			ret += getText( node );
1553
		}
1554
	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1555
		// Use textContent for elements
1556
		// innerText usage removed for consistency of new lines (jQuery #11153)
1557
		if ( typeof elem.textContent === "string" ) {
1558
			return elem.textContent;
1559
		} else {
1560
			// Traverse its children
1561
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1562
				ret += getText( elem );
1563
			}
1564
		}
1565
	} else if ( nodeType === 3 || nodeType === 4 ) {
1566
		return elem.nodeValue;
1567
	}
1568
	// Do not include comment or processing instruction nodes
1569
1570
	return ret;
1571
};
1572
1573
Expr = Sizzle.selectors = {
1574
1575
	// Can be adjusted by the user
1576
	cacheLength: 50,
1577
1578
	createPseudo: markFunction,
1579
1580
	match: matchExpr,
1581
1582
	attrHandle: {},
1583
1584
	find: {},
1585
1586
	relative: {
1587
		">": { dir: "parentNode", first: true },
1588
		" ": { dir: "parentNode" },
1589
		"+": { dir: "previousSibling", first: true },
1590
		"~": { dir: "previousSibling" }
1591
	},
1592
1593
	preFilter: {
1594
		"ATTR": function( match ) {
1595
			match[1] = match[1].replace( runescape, funescape );
1596
1597
			// Move the given value to match[3] whether quoted or unquoted
1598
			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1599
1600
			if ( match[2] === "~=" ) {
1601
				match[3] = " " + match[3] + " ";
1602
			}
1603
1604
			return match.slice( 0, 4 );
1605
		},
1606
1607
		"CHILD": function( match ) {
1608
			/* matches from matchExpr["CHILD"]
1609
				1 type (only|nth|...)
1610
				2 what (child|of-type)
1611
				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1612
				4 xn-component of xn+y argument ([+-]?\d*n|)
1613
				5 sign of xn-component
1614
				6 x of xn-component
1615
				7 sign of y-component
1616
				8 y of y-component
1617
			*/
1618
			match[1] = match[1].toLowerCase();
1619
1620
			if ( match[1].slice( 0, 3 ) === "nth" ) {
1621
				// nth-* requires argument
1622
				if ( !match[3] ) {
1623
					Sizzle.error( match[0] );
1624
				}
1625
1626
				// numeric x and y parameters for Expr.filter.CHILD
1627
				// remember that false/true cast respectively to 0/1
1628
				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1629
				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1630
1631
			// other types prohibit arguments
1632
			} else if ( match[3] ) {
1633
				Sizzle.error( match[0] );
1634
			}
1635
1636
			return match;
1637
		},
1638
1639
		"PSEUDO": function( match ) {
1640
			var excess,
1641
				unquoted = !match[6] && match[2];
1642
1643
			if ( matchExpr["CHILD"].test( match[0] ) ) {
1644
				return null;
1645
			}
1646
1647
			// Accept quoted arguments as-is
1648
			if ( match[3] ) {
1649
				match[2] = match[4] || match[5] || "";
1650
1651
			// Strip excess characters from unquoted arguments
1652
			} else if ( unquoted && rpseudo.test( unquoted ) &&
1653
				// Get excess from tokenize (recursively)
1654
				(excess = tokenize( unquoted, true )) &&
1655
				// advance to the next closing parenthesis
1656
				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1657
1658
				// excess is a negative index
1659
				match[0] = match[0].slice( 0, excess );
1660
				match[2] = unquoted.slice( 0, excess );
1661
			}
1662
1663
			// Return only captures needed by the pseudo filter method (type and argument)
1664
			return match.slice( 0, 3 );
1665
		}
1666
	},
1667
1668
	filter: {
1669
1670
		"TAG": function( nodeNameSelector ) {
1671
			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1672
			return nodeNameSelector === "*" ?
1673
				function() { return true; } :
1674
				function( elem ) {
1675
					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1676
				};
1677
		},
1678
1679
		"CLASS": function( className ) {
1680
			var pattern = classCache[ className + " " ];
1681
1682
			return pattern ||
1683
				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1684
				classCache( className, function( elem ) {
1685
					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1686
				});
1687
		},
1688
1689
		"ATTR": function( name, operator, check ) {
1690
			return function( elem ) {
1691
				var result = Sizzle.attr( elem, name );
1692
1693
				if ( result == null ) {
1694
					return operator === "!=";
1695
				}
1696
				if ( !operator ) {
1697
					return true;
1698
				}
1699
1700
				result += "";
1701
1702
				return operator === "=" ? result === check :
1703
					operator === "!=" ? result !== check :
1704
					operator === "^=" ? check && result.indexOf( check ) === 0 :
1705
					operator === "*=" ? check && result.indexOf( check ) > -1 :
1706
					operator === "$=" ? check && result.slice( -check.length ) === check :
1707
					operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1708
					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1709
					false;
1710
			};
1711
		},
1712
1713
		"CHILD": function( type, what, argument, first, last ) {
1714
			var simple = type.slice( 0, 3 ) !== "nth",
1715
				forward = type.slice( -4 ) !== "last",
1716
				ofType = what === "of-type";
1717
1718
			return first === 1 && last === 0 ?
1719
1720
				// Shortcut for :nth-*(n)
1721
				function( elem ) {
1722
					return !!elem.parentNode;
1723
				} :
1724
1725
				function( elem, context, xml ) {
1726
					var cache, uniqueCache, outerCache, node, nodeIndex, start,
1727
						dir = simple !== forward ? "nextSibling" : "previousSibling",
1728
						parent = elem.parentNode,
1729
						name = ofType && elem.nodeName.toLowerCase(),
1730
						useCache = !xml && !ofType,
1731
						diff = false;
1732
1733
					if ( parent ) {
1734
1735
						// :(first|last|only)-(child|of-type)
1736
						if ( simple ) {
1737
							while ( dir ) {
1738
								node = elem;
1739
								while ( (node = node[ dir ]) ) {
1740
									if ( ofType ?
1741
										node.nodeName.toLowerCase() === name :
1742
										node.nodeType === 1 ) {
1743
1744
										return false;
1745
									}
1746
								}
1747
								// Reverse direction for :only-* (if we haven't yet done so)
1748
								start = dir = type === "only" && !start && "nextSibling";
1749
							}
1750
							return true;
1751
						}
1752
1753
						start = [ forward ? parent.firstChild : parent.lastChild ];
1754
1755
						// non-xml :nth-child(...) stores cache data on `parent`
1756
						if ( forward && useCache ) {
1757
1758
							// Seek `elem` from a previously-cached index
1759
1760
							// ...in a gzip-friendly way
1761
							node = parent;
1762
							outerCache = node[ expando ] || (node[ expando ] = {});
1763
1764
							// Support: IE <9 only
1765
							// Defend against cloned attroperties (jQuery gh-1709)
1766
							uniqueCache = outerCache[ node.uniqueID ] ||
1767
								(outerCache[ node.uniqueID ] = {});
1768
1769
							cache = uniqueCache[ type ] || [];
1770
							nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1771
							diff = nodeIndex && cache[ 2 ];
1772
							node = nodeIndex && parent.childNodes[ nodeIndex ];
1773
1774
							while ( (node = ++nodeIndex && node && node[ dir ] ||
1775
1776
								// Fallback to seeking `elem` from the start
1777
								(diff = nodeIndex = 0) || start.pop()) ) {
1778
1779
								// When found, cache indexes on `parent` and break
1780
								if ( node.nodeType === 1 && ++diff && node === elem ) {
1781
									uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1782
									break;
1783
								}
1784
							}
1785
1786
						} else {
1787
							// Use previously-cached element index if available
1788
							if ( useCache ) {
1789
								// ...in a gzip-friendly way
1790
								node = elem;
1791
								outerCache = node[ expando ] || (node[ expando ] = {});
1792
1793
								// Support: IE <9 only
1794
								// Defend against cloned attroperties (jQuery gh-1709)
1795
								uniqueCache = outerCache[ node.uniqueID ] ||
1796
									(outerCache[ node.uniqueID ] = {});
1797
1798
								cache = uniqueCache[ type ] || [];
1799
								nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1800
								diff = nodeIndex;
1801
							}
1802
1803
							// xml :nth-child(...)
1804
							// or :nth-last-child(...) or :nth(-last)?-of-type(...)
1805
							if ( diff === false ) {
1806
								// Use the same loop as above to seek `elem` from the start
1807
								while ( (node = ++nodeIndex && node && node[ dir ] ||
1808
									(diff = nodeIndex = 0) || start.pop()) ) {
1809
1810
									if ( ( ofType ?
1811
										node.nodeName.toLowerCase() === name :
1812
										node.nodeType === 1 ) &&
1813
										++diff ) {
1814
1815
										// Cache the index of each encountered element
1816
										if ( useCache ) {
1817
											outerCache = node[ expando ] || (node[ expando ] = {});
1818
1819
											// Support: IE <9 only
1820
											// Defend against cloned attroperties (jQuery gh-1709)
1821
											uniqueCache = outerCache[ node.uniqueID ] ||
1822
												(outerCache[ node.uniqueID ] = {});
1823
1824
											uniqueCache[ type ] = [ dirruns, diff ];
1825
										}
1826
1827
										if ( node === elem ) {
1828
											break;
1829
										}
1830
									}
1831
								}
1832
							}
1833
						}
1834
1835
						// Incorporate the offset, then check against cycle size
1836
						diff -= last;
1837
						return diff === first || ( diff % first === 0 && diff / first >= 0 );
1838
					}
1839
				};
1840
		},
1841
1842
		"PSEUDO": function( pseudo, argument ) {
1843
			// pseudo-class names are case-insensitive
1844
			// http://www.w3.org/TR/selectors/#pseudo-classes
1845
			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1846
			// Remember that setFilters inherits from pseudos
1847
			var args,
1848
				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1849
					Sizzle.error( "unsupported pseudo: " + pseudo );
1850
1851
			// The user may use createPseudo to indicate that
1852
			// arguments are needed to create the filter function
1853
			// just as Sizzle does
1854
			if ( fn[ expando ] ) {
1855
				return fn( argument );
1856
			}
1857
1858
			// But maintain support for old signatures
1859
			if ( fn.length > 1 ) {
1860
				args = [ pseudo, pseudo, "", argument ];
1861
				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1862
					markFunction(function( seed, matches ) {
1863
						var idx,
1864
							matched = fn( seed, argument ),
1865
							i = matched.length;
1866
						while ( i-- ) {
1867
							idx = indexOf( seed, matched[i] );
1868
							seed[ idx ] = !( matches[ idx ] = matched[i] );
1869
						}
1870
					}) :
1871
					function( elem ) {
1872
						return fn( elem, 0, args );
1873
					};
1874
			}
1875
1876
			return fn;
1877
		}
1878
	},
1879
1880
	pseudos: {
1881
		// Potentially complex pseudos
1882
		"not": markFunction(function( selector ) {
1883
			// Trim the selector passed to compile
1884
			// to avoid treating leading and trailing
1885
			// spaces as combinators
1886
			var input = [],
1887
				results = [],
1888
				matcher = compile( selector.replace( rtrim, "$1" ) );
1889
1890
			return matcher[ expando ] ?
1891
				markFunction(function( seed, matches, context, xml ) {
1892
					var elem,
1893
						unmatched = matcher( seed, null, xml, [] ),
1894
						i = seed.length;
1895
1896
					// Match elements unmatched by `matcher`
1897
					while ( i-- ) {
1898
						if ( (elem = unmatched[i]) ) {
1899
							seed[i] = !(matches[i] = elem);
1900
						}
1901
					}
1902
				}) :
1903
				function( elem, context, xml ) {
1904
					input[0] = elem;
1905
					matcher( input, null, xml, results );
1906
					// Don't keep the element (issue #299)
1907
					input[0] = null;
1908
					return !results.pop();
1909
				};
1910
		}),
1911
1912
		"has": markFunction(function( selector ) {
1913
			return function( elem ) {
1914
				return Sizzle( selector, elem ).length > 0;
1915
			};
1916
		}),
1917
1918
		"contains": markFunction(function( text ) {
1919
			text = text.replace( runescape, funescape );
1920
			return function( elem ) {
1921
				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1922
			};
1923
		}),
1924
1925
		// "Whether an element is represented by a :lang() selector
1926
		// is based solely on the element's language value
1927
		// being equal to the identifier C,
1928
		// or beginning with the identifier C immediately followed by "-".
1929
		// The matching of C against the element's language value is performed case-insensitively.
1930
		// The identifier C does not have to be a valid language name."
1931
		// http://www.w3.org/TR/selectors/#lang-pseudo
1932
		"lang": markFunction( function( lang ) {
1933
			// lang value must be a valid identifier
1934
			if ( !ridentifier.test(lang || "") ) {
1935
				Sizzle.error( "unsupported lang: " + lang );
1936
			}
1937
			lang = lang.replace( runescape, funescape ).toLowerCase();
1938
			return function( elem ) {
1939
				var elemLang;
1940
				do {
1941
					if ( (elemLang = documentIsHTML ?
1942
						elem.lang :
1943
						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1944
1945
						elemLang = elemLang.toLowerCase();
1946
						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1947
					}
1948
				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1949
				return false;
1950
			};
1951
		}),
1952
1953
		// Miscellaneous
1954
		"target": function( elem ) {
1955
			var hash = window.location && window.location.hash;
1956
			return hash && hash.slice( 1 ) === elem.id;
1957
		},
1958
1959
		"root": function( elem ) {
1960
			return elem === docElem;
1961
		},
1962
1963
		"focus": function( elem ) {
1964
			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1965
		},
1966
1967
		// Boolean properties
1968
		"enabled": function( elem ) {
1969
			return elem.disabled === false;
1970
		},
1971
1972
		"disabled": function( elem ) {
1973
			return elem.disabled === true;
1974
		},
1975
1976
		"checked": function( elem ) {
1977
			// In CSS3, :checked should return both checked and selected elements
1978
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1979
			var nodeName = elem.nodeName.toLowerCase();
1980
			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1981
		},
1982
1983
		"selected": function( elem ) {
1984
			// Accessing this property makes selected-by-default
1985
			// options in Safari work properly
1986
			if ( elem.parentNode ) {
1987
				elem.parentNode.selectedIndex;
1988
			}
1989
1990
			return elem.selected === true;
1991
		},
1992
1993
		// Contents
1994
		"empty": function( elem ) {
1995
			// http://www.w3.org/TR/selectors/#empty-pseudo
1996
			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1997
			//   but not by others (comment: 8; processing instruction: 7; etc.)
1998
			// nodeType < 6 works because attributes (2) do not appear as children
1999
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2000
				if ( elem.nodeType < 6 ) {
2001
					return false;
2002
				}
2003
			}
2004
			return true;
2005
		},
2006
2007
		"parent": function( elem ) {
2008
			return !Expr.pseudos["empty"]( elem );
2009
		},
2010
2011
		// Element/input types
2012
		"header": function( elem ) {
2013
			return rheader.test( elem.nodeName );
2014
		},
2015
2016
		"input": function( elem ) {
2017
			return rinputs.test( elem.nodeName );
2018
		},
2019
2020
		"button": function( elem ) {
2021
			var name = elem.nodeName.toLowerCase();
2022
			return name === "input" && elem.type === "button" || name === "button";
2023
		},
2024
2025
		"text": function( elem ) {
2026
			var attr;
2027
			return elem.nodeName.toLowerCase() === "input" &&
2028
				elem.type === "text" &&
2029
2030
				// Support: IE<8
2031
				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2032
				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2033
		},
2034
2035
		// Position-in-collection
2036
		"first": createPositionalPseudo(function() {
2037
			return [ 0 ];
2038
		}),
2039
2040
		"last": createPositionalPseudo(function( matchIndexes, length ) {
2041
			return [ length - 1 ];
2042
		}),
2043
2044
		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2045
			return [ argument < 0 ? argument + length : argument ];
2046
		}),
2047
2048
		"even": createPositionalPseudo(function( matchIndexes, length ) {
2049
			var i = 0;
2050
			for ( ; i < length; i += 2 ) {
2051
				matchIndexes.push( i );
2052
			}
2053
			return matchIndexes;
2054
		}),
2055
2056
		"odd": createPositionalPseudo(function( matchIndexes, length ) {
2057
			var i = 1;
2058
			for ( ; i < length; i += 2 ) {
2059
				matchIndexes.push( i );
2060
			}
2061
			return matchIndexes;
2062
		}),
2063
2064
		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2065
			var i = argument < 0 ? argument + length : argument;
2066
			for ( ; --i >= 0; ) {
2067
				matchIndexes.push( i );
2068
			}
2069
			return matchIndexes;
2070
		}),
2071
2072
		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2073
			var i = argument < 0 ? argument + length : argument;
2074
			for ( ; ++i < length; ) {
2075
				matchIndexes.push( i );
2076
			}
2077
			return matchIndexes;
2078
		})
2079
	}
2080
};
2081
2082
Expr.pseudos["nth"] = Expr.pseudos["eq"];
2083
2084
// Add button/input type pseudos
2085
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2086
	Expr.pseudos[ i ] = createInputPseudo( i );
2087
}
2088
for ( i in { submit: true, reset: true } ) {
2089
	Expr.pseudos[ i ] = createButtonPseudo( i );
2090
}
2091
2092
// Easy API for creating new setFilters
2093
function setFilters() {}
2094
setFilters.prototype = Expr.filters = Expr.pseudos;
2095
Expr.setFilters = new setFilters();
2096
2097
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2098
	var matched, match, tokens, type,
2099
		soFar, groups, preFilters,
2100
		cached = tokenCache[ selector + " " ];
2101
2102
	if ( cached ) {
2103
		return parseOnly ? 0 : cached.slice( 0 );
2104
	}
2105
2106
	soFar = selector;
2107
	groups = [];
2108
	preFilters = Expr.preFilter;
2109
2110
	while ( soFar ) {
2111
2112
		// Comma and first run
2113
		if ( !matched || (match = rcomma.exec( soFar )) ) {
2114
			if ( match ) {
2115
				// Don't consume trailing commas as valid
2116
				soFar = soFar.slice( match[0].length ) || soFar;
2117
			}
2118
			groups.push( (tokens = []) );
2119
		}
2120
2121
		matched = false;
2122
2123
		// Combinators
2124
		if ( (match = rcombinators.exec( soFar )) ) {
2125
			matched = match.shift();
2126
			tokens.push({
2127
				value: matched,
2128
				// Cast descendant combinators to space
2129
				type: match[0].replace( rtrim, " " )
2130
			});
2131
			soFar = soFar.slice( matched.length );
2132
		}
2133
2134
		// Filters
2135
		for ( type in Expr.filter ) {
2136
			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2137
				(match = preFilters[ type ]( match ))) ) {
2138
				matched = match.shift();
2139
				tokens.push({
2140
					value: matched,
2141
					type: type,
2142
					matches: match
2143
				});
2144
				soFar = soFar.slice( matched.length );
2145
			}
2146
		}
2147
2148
		if ( !matched ) {
2149
			break;
2150
		}
2151
	}
2152
2153
	// Return the length of the invalid excess
2154
	// if we're just parsing
2155
	// Otherwise, throw an error or return tokens
2156
	return parseOnly ?
2157
		soFar.length :
2158
		soFar ?
2159
			Sizzle.error( selector ) :
2160
			// Cache the tokens
2161
			tokenCache( selector, groups ).slice( 0 );
2162
};
2163
2164
function toSelector( tokens ) {
2165
	var i = 0,
2166
		len = tokens.length,
2167
		selector = "";
2168
	for ( ; i < len; i++ ) {
2169
		selector += tokens[i].value;
2170
	}
2171
	return selector;
2172
}
2173
2174
function addCombinator( matcher, combinator, base ) {
2175
	var dir = combinator.dir,
2176
		checkNonElements = base && dir === "parentNode",
2177
		doneName = done++;
2178
2179
	return combinator.first ?
2180
		// Check against closest ancestor/preceding element
2181
		function( elem, context, xml ) {
2182
			while ( (elem = elem[ dir ]) ) {
2183
				if ( elem.nodeType === 1 || checkNonElements ) {
2184
					return matcher( elem, context, xml );
2185
				}
2186
			}
2187
		} :
2188
2189
		// Check against all ancestor/preceding elements
2190
		function( elem, context, xml ) {
2191
			var oldCache, uniqueCache, outerCache,
2192
				newCache = [ dirruns, doneName ];
2193
2194
			// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2195
			if ( xml ) {
2196
				while ( (elem = elem[ dir ]) ) {
2197
					if ( elem.nodeType === 1 || checkNonElements ) {
2198
						if ( matcher( elem, context, xml ) ) {
2199
							return true;
2200
						}
2201
					}
2202
				}
2203
			} else {
2204
				while ( (elem = elem[ dir ]) ) {
2205
					if ( elem.nodeType === 1 || checkNonElements ) {
2206
						outerCache = elem[ expando ] || (elem[ expando ] = {});
2207
2208
						// Support: IE <9 only
2209
						// Defend against cloned attroperties (jQuery gh-1709)
2210
						uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2211
2212
						if ( (oldCache = uniqueCache[ dir ]) &&
2213
							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2214
2215
							// Assign to newCache so results back-propagate to previous elements
2216
							return (newCache[ 2 ] = oldCache[ 2 ]);
2217
						} else {
2218
							// Reuse newcache so results back-propagate to previous elements
2219
							uniqueCache[ dir ] = newCache;
2220
2221
							// A match means we're done; a fail means we have to keep checking
2222
							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2223
								return true;
2224
							}
2225
						}
2226
					}
2227
				}
2228
			}
2229
		};
2230
}
2231
2232
function elementMatcher( matchers ) {
2233
	return matchers.length > 1 ?
2234
		function( elem, context, xml ) {
2235
			var i = matchers.length;
2236
			while ( i-- ) {
2237
				if ( !matchers[i]( elem, context, xml ) ) {
2238
					return false;
2239
				}
2240
			}
2241
			return true;
2242
		} :
2243
		matchers[0];
2244
}
2245
2246
function multipleContexts( selector, contexts, results ) {
2247
	var i = 0,
2248
		len = contexts.length;
2249
	for ( ; i < len; i++ ) {
2250
		Sizzle( selector, contexts[i], results );
2251
	}
2252
	return results;
2253
}
2254
2255
function condense( unmatched, map, filter, context, xml ) {
2256
	var elem,
2257
		newUnmatched = [],
2258
		i = 0,
2259
		len = unmatched.length,
2260
		mapped = map != null;
2261
2262
	for ( ; i < len; i++ ) {
2263
		if ( (elem = unmatched[i]) ) {
2264
			if ( !filter || filter( elem, context, xml ) ) {
2265
				newUnmatched.push( elem );
2266
				if ( mapped ) {
2267
					map.push( i );
2268
				}
2269
			}
2270
		}
2271
	}
2272
2273
	return newUnmatched;
2274
}
2275
2276
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2277
	if ( postFilter && !postFilter[ expando ] ) {
2278
		postFilter = setMatcher( postFilter );
2279
	}
2280
	if ( postFinder && !postFinder[ expando ] ) {
2281
		postFinder = setMatcher( postFinder, postSelector );
2282
	}
2283
	return markFunction(function( seed, results, context, xml ) {
2284
		var temp, i, elem,
2285
			preMap = [],
2286
			postMap = [],
2287
			preexisting = results.length,
2288
2289
			// Get initial elements from seed or context
2290
			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2291
2292
			// Prefilter to get matcher input, preserving a map for seed-results synchronization
2293
			matcherIn = preFilter && ( seed || !selector ) ?
2294
				condense( elems, preMap, preFilter, context, xml ) :
2295
				elems,
2296
2297
			matcherOut = matcher ?
2298
				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2299
				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2300
2301
					// ...intermediate processing is necessary
2302
					[] :
2303
2304
					// ...otherwise use results directly
2305
					results :
2306
				matcherIn;
2307
2308
		// Find primary matches
2309
		if ( matcher ) {
2310
			matcher( matcherIn, matcherOut, context, xml );
2311
		}
2312
2313
		// Apply postFilter
2314
		if ( postFilter ) {
2315
			temp = condense( matcherOut, postMap );
2316
			postFilter( temp, [], context, xml );
2317
2318
			// Un-match failing elements by moving them back to matcherIn
2319
			i = temp.length;
2320
			while ( i-- ) {
2321
				if ( (elem = temp[i]) ) {
2322
					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2323
				}
2324
			}
2325
		}
2326
2327
		if ( seed ) {
2328
			if ( postFinder || preFilter ) {
2329
				if ( postFinder ) {
2330
					// Get the final matcherOut by condensing this intermediate into postFinder contexts
2331
					temp = [];
2332
					i = matcherOut.length;
2333
					while ( i-- ) {
2334
						if ( (elem = matcherOut[i]) ) {
2335
							// Restore matcherIn since elem is not yet a final match
2336
							temp.push( (matcherIn[i] = elem) );
2337
						}
2338
					}
2339
					postFinder( null, (matcherOut = []), temp, xml );
2340
				}
2341
2342
				// Move matched elements from seed to results to keep them synchronized
2343
				i = matcherOut.length;
2344
				while ( i-- ) {
2345
					if ( (elem = matcherOut[i]) &&
2346
						(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2347
2348
						seed[temp] = !(results[temp] = elem);
2349
					}
2350
				}
2351
			}
2352
2353
		// Add elements to results, through postFinder if defined
2354
		} else {
2355
			matcherOut = condense(
2356
				matcherOut === results ?
2357
					matcherOut.splice( preexisting, matcherOut.length ) :
2358
					matcherOut
2359
			);
2360
			if ( postFinder ) {
2361
				postFinder( null, results, matcherOut, xml );
2362
			} else {
2363
				push.apply( results, matcherOut );
2364
			}
2365
		}
2366
	});
2367
}
2368
2369
function matcherFromTokens( tokens ) {
2370
	var checkContext, matcher, j,
2371
		len = tokens.length,
2372
		leadingRelative = Expr.relative[ tokens[0].type ],
2373
		implicitRelative = leadingRelative || Expr.relative[" "],
2374
		i = leadingRelative ? 1 : 0,
2375
2376
		// The foundational matcher ensures that elements are reachable from top-level context(s)
2377
		matchContext = addCombinator( function( elem ) {
2378
			return elem === checkContext;
2379
		}, implicitRelative, true ),
2380
		matchAnyContext = addCombinator( function( elem ) {
2381
			return indexOf( checkContext, elem ) > -1;
2382
		}, implicitRelative, true ),
2383
		matchers = [ function( elem, context, xml ) {
2384
			var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2385
				(checkContext = context).nodeType ?
2386
					matchContext( elem, context, xml ) :
2387
					matchAnyContext( elem, context, xml ) );
2388
			// Avoid hanging onto element (issue #299)
2389
			checkContext = null;
2390
			return ret;
2391
		} ];
2392
2393
	for ( ; i < len; i++ ) {
2394
		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2395
			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2396
		} else {
2397
			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2398
2399
			// Return special upon seeing a positional matcher
2400
			if ( matcher[ expando ] ) {
2401
				// Find the next relative operator (if any) for proper handling
2402
				j = ++i;
2403
				for ( ; j < len; j++ ) {
2404
					if ( Expr.relative[ tokens[j].type ] ) {
2405
						break;
2406
					}
2407
				}
2408
				return setMatcher(
2409
					i > 1 && elementMatcher( matchers ),
2410
					i > 1 && toSelector(
2411
						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
2412
						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2413
					).replace( rtrim, "$1" ),
2414
					matcher,
2415
					i < j && matcherFromTokens( tokens.slice( i, j ) ),
2416
					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2417
					j < len && toSelector( tokens )
2418
				);
2419
			}
2420
			matchers.push( matcher );
2421
		}
2422
	}
2423
2424
	return elementMatcher( matchers );
2425
}
2426
2427
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2428
	var bySet = setMatchers.length > 0,
2429
		byElement = elementMatchers.length > 0,
2430
		superMatcher = function( seed, context, xml, results, outermost ) {
2431
			var elem, j, matcher,
2432
				matchedCount = 0,
2433
				i = "0",
2434
				unmatched = seed && [],
2435
				setMatched = [],
2436
				contextBackup = outermostContext,
2437
				// We must always have either seed elements or outermost context
2438
				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2439
				// Use integer dirruns iff this is the outermost matcher
2440
				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2441
				len = elems.length;
2442
2443
			if ( outermost ) {
2444
				outermostContext = context === document || context || outermost;
2445
			}
2446
2447
			// Add elements passing elementMatchers directly to results
2448
			// Support: IE<9, Safari
2449
			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2450
			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2451
				if ( byElement && elem ) {
2452
					j = 0;
2453
					if ( !context && elem.ownerDocument !== document ) {
2454
						setDocument( elem );
2455
						xml = !documentIsHTML;
2456
					}
2457
					while ( (matcher = elementMatchers[j++]) ) {
2458
						if ( matcher( elem, context || document, xml) ) {
2459
							results.push( elem );
2460
							break;
2461
						}
2462
					}
2463
					if ( outermost ) {
2464
						dirruns = dirrunsUnique;
2465
					}
2466
				}
2467
2468
				// Track unmatched elements for set filters
2469
				if ( bySet ) {
2470
					// They will have gone through all possible matchers
2471
					if ( (elem = !matcher && elem) ) {
2472
						matchedCount--;
2473
					}
2474
2475
					// Lengthen the array for every element, matched or not
2476
					if ( seed ) {
2477
						unmatched.push( elem );
2478
					}
2479
				}
2480
			}
2481
2482
			// `i` is now the count of elements visited above, and adding it to `matchedCount`
2483
			// makes the latter nonnegative.
2484
			matchedCount += i;
2485
2486
			// Apply set filters to unmatched elements
2487
			// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2488
			// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2489
			// no element matchers and no seed.
2490
			// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2491
			// case, which will result in a "00" `matchedCount` that differs from `i` but is also
2492
			// numerically zero.
2493
			if ( bySet && i !== matchedCount ) {
2494
				j = 0;
2495
				while ( (matcher = setMatchers[j++]) ) {
2496
					matcher( unmatched, setMatched, context, xml );
2497
				}
2498
2499
				if ( seed ) {
2500
					// Reintegrate element matches to eliminate the need for sorting
2501
					if ( matchedCount > 0 ) {
2502
						while ( i-- ) {
2503
							if ( !(unmatched[i] || setMatched[i]) ) {
2504
								setMatched[i] = pop.call( results );
2505
							}
2506
						}
2507
					}
2508
2509
					// Discard index placeholder values to get only actual matches
2510
					setMatched = condense( setMatched );
2511
				}
2512
2513
				// Add matches to results
2514
				push.apply( results, setMatched );
2515
2516
				// Seedless set matches succeeding multiple successful matchers stipulate sorting
2517
				if ( outermost && !seed && setMatched.length > 0 &&
2518
					( matchedCount + setMatchers.length ) > 1 ) {
2519
2520
					Sizzle.uniqueSort( results );
2521
				}
2522
			}
2523
2524
			// Override manipulation of globals by nested matchers
2525
			if ( outermost ) {
2526
				dirruns = dirrunsUnique;
2527
				outermostContext = contextBackup;
2528
			}
2529
2530
			return unmatched;
2531
		};
2532
2533
	return bySet ?
2534
		markFunction( superMatcher ) :
2535
		superMatcher;
2536
}
2537
2538
compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2539
	var i,
2540
		setMatchers = [],
2541
		elementMatchers = [],
2542
		cached = compilerCache[ selector + " " ];
2543
2544
	if ( !cached ) {
2545
		// Generate a function of recursive functions that can be used to check each element
2546
		if ( !match ) {
2547
			match = tokenize( selector );
2548
		}
2549
		i = match.length;
2550
		while ( i-- ) {
2551
			cached = matcherFromTokens( match[i] );
2552
			if ( cached[ expando ] ) {
2553
				setMatchers.push( cached );
2554
			} else {
2555
				elementMatchers.push( cached );
2556
			}
2557
		}
2558
2559
		// Cache the compiled function
2560
		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2561
2562
		// Save selector and tokenization
2563
		cached.selector = selector;
2564
	}
2565
	return cached;
2566
};
2567
2568
/**
2569
 * A low-level selection function that works with Sizzle's compiled
2570
 *  selector functions
2571
 * @param {String|Function} selector A selector or a pre-compiled
2572
 *  selector function built with Sizzle.compile
2573
 * @param {Element} context
2574
 * @param {Array} [results]
2575
 * @param {Array} [seed] A set of elements to match against
2576
 */
2577
select = Sizzle.select = function( selector, context, results, seed ) {
2578
	var i, tokens, token, type, find,
2579
		compiled = typeof selector === "function" && selector,
2580
		match = !seed && tokenize( (selector = compiled.selector || selector) );
2581
2582
	results = results || [];
2583
2584
	// Try to minimize operations if there is only one selector in the list and no seed
2585
	// (the latter of which guarantees us context)
2586
	if ( match.length === 1 ) {
2587
2588
		// Reduce context if the leading compound selector is an ID
2589
		tokens = match[0] = match[0].slice( 0 );
2590
		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2591
				support.getById && context.nodeType === 9 && documentIsHTML &&
2592
				Expr.relative[ tokens[1].type ] ) {
2593
2594
			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2595
			if ( !context ) {
2596
				return results;
2597
2598
			// Precompiled matchers will still verify ancestry, so step up a level
2599
			} else if ( compiled ) {
2600
				context = context.parentNode;
2601
			}
2602
2603
			selector = selector.slice( tokens.shift().value.length );
2604
		}
2605
2606
		// Fetch a seed set for right-to-left matching
2607
		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2608
		while ( i-- ) {
2609
			token = tokens[i];
2610
2611
			// Abort if we hit a combinator
2612
			if ( Expr.relative[ (type = token.type) ] ) {
2613
				break;
2614
			}
2615
			if ( (find = Expr.find[ type ]) ) {
2616
				// Search, expanding context for leading sibling combinators
2617
				if ( (seed = find(
2618
					token.matches[0].replace( runescape, funescape ),
2619
					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2620
				)) ) {
2621
2622
					// If seed is empty or no tokens remain, we can return early
2623
					tokens.splice( i, 1 );
2624
					selector = seed.length && toSelector( tokens );
2625
					if ( !selector ) {
2626
						push.apply( results, seed );
2627
						return results;
2628
					}
2629
2630
					break;
2631
				}
2632
			}
2633
		}
2634
	}
2635
2636
	// Compile and execute a filtering function if one is not provided
2637
	// Provide `match` to avoid retokenization if we modified the selector above
2638
	( compiled || compile( selector, match ) )(
2639
		seed,
2640
		context,
2641
		!documentIsHTML,
2642
		results,
2643
		!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2644
	);
2645
	return results;
2646
};
2647
2648
// One-time assignments
2649
2650
// Sort stability
2651
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2652
2653
// Support: Chrome 14-35+
2654
// Always assume duplicates if they aren't passed to the comparison function
2655
support.detectDuplicates = !!hasDuplicate;
2656
2657
// Initialize against the default document
2658
setDocument();
2659
2660
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2661
// Detached nodes confoundingly follow *each other*
2662
support.sortDetached = assert(function( div1 ) {
2663
	// Should return 1, but returns 4 (following)
2664
	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2665
});
2666
2667
// Support: IE<8
2668
// Prevent attribute/property "interpolation"
2669
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2670
if ( !assert(function( div ) {
2671
	div.innerHTML = "<a href='#'></a>";
2672
	return div.firstChild.getAttribute("href") === "#" ;
2673
}) ) {
2674
	addHandle( "type|href|height|width", function( elem, name, isXML ) {
2675
		if ( !isXML ) {
2676
			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2677
		}
2678
	});
2679
}
2680
2681
// Support: IE<9
2682
// Use defaultValue in place of getAttribute("value")
2683
if ( !support.attributes || !assert(function( div ) {
2684
	div.innerHTML = "<input/>";
2685
	div.firstChild.setAttribute( "value", "" );
2686
	return div.firstChild.getAttribute( "value" ) === "";
2687
}) ) {
2688
	addHandle( "value", function( elem, name, isXML ) {
2689
		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2690
			return elem.defaultValue;
2691
		}
2692
	});
2693
}
2694
2695
// Support: IE<9
2696
// Use getAttributeNode to fetch booleans when getAttribute lies
2697
if ( !assert(function( div ) {
2698
	return div.getAttribute("disabled") == null;
2699
}) ) {
2700
	addHandle( booleans, function( elem, name, isXML ) {
2701
		var val;
2702
		if ( !isXML ) {
2703
			return elem[ name ] === true ? name.toLowerCase() :
2704
					(val = elem.getAttributeNode( name )) && val.specified ?
2705
					val.value :
2706
				null;
2707
		}
2708
	});
2709
}
2710
2711
return Sizzle;
2712
2713
})( window );
2714
2715
2716
2717
jQuery.find = Sizzle;
2718
jQuery.expr = Sizzle.selectors;
2719
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2720
jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2721
jQuery.text = Sizzle.getText;
2722
jQuery.isXMLDoc = Sizzle.isXML;
2723
jQuery.contains = Sizzle.contains;
2724
2725
2726
2727
var dir = function( elem, dir, until ) {
2728
	var matched = [],
2729
		truncate = until !== undefined;
2730
2731
	while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2732
		if ( elem.nodeType === 1 ) {
2733
			if ( truncate && jQuery( elem ).is( until ) ) {
2734
				break;
2735
			}
2736
			matched.push( elem );
2737
		}
2738
	}
2739
	return matched;
2740
};
2741
2742
2743
var siblings = function( n, elem ) {
2744
	var matched = [];
2745
2746
	for ( ; n; n = n.nextSibling ) {
2747
		if ( n.nodeType === 1 && n !== elem ) {
2748
			matched.push( n );
2749
		}
2750
	}
2751
2752
	return matched;
2753
};
2754
2755
2756
var rneedsContext = jQuery.expr.match.needsContext;
2757
2758
var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
2759
2760
2761
2762
var risSimple = /^.[^:#\[\.,]*$/;
2763
2764
// Implement the identical functionality for filter and not
2765
function winnow( elements, qualifier, not ) {
2766
	if ( jQuery.isFunction( qualifier ) ) {
2767
		return jQuery.grep( elements, function( elem, i ) {
2768
			/* jshint -W018 */
2769
			return !!qualifier.call( elem, i, elem ) !== not;
2770
		} );
2771
2772
	}
2773
2774
	if ( qualifier.nodeType ) {
2775
		return jQuery.grep( elements, function( elem ) {
2776
			return ( elem === qualifier ) !== not;
2777
		} );
2778
2779
	}
2780
2781
	if ( typeof qualifier === "string" ) {
2782
		if ( risSimple.test( qualifier ) ) {
2783
			return jQuery.filter( qualifier, elements, not );
2784
		}
2785
2786
		qualifier = jQuery.filter( qualifier, elements );
2787
	}
2788
2789
	return jQuery.grep( elements, function( elem ) {
2790
		return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not;
2791
	} );
2792
}
2793
2794
jQuery.filter = function( expr, elems, not ) {
2795
	var elem = elems[ 0 ];
2796
2797
	if ( not ) {
2798
		expr = ":not(" + expr + ")";
2799
	}
2800
2801
	return elems.length === 1 && elem.nodeType === 1 ?
2802
		jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2803
		jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2804
			return elem.nodeType === 1;
2805
		} ) );
2806
};
2807
2808
jQuery.fn.extend( {
2809
	find: function( selector ) {
2810
		var i,
2811
			ret = [],
2812
			self = this,
2813
			len = self.length;
2814
2815
		if ( typeof selector !== "string" ) {
2816
			return this.pushStack( jQuery( selector ).filter( function() {
2817
				for ( i = 0; i < len; i++ ) {
2818
					if ( jQuery.contains( self[ i ], this ) ) {
2819
						return true;
2820
					}
2821
				}
2822
			} ) );
2823
		}
2824
2825
		for ( i = 0; i < len; i++ ) {
2826
			jQuery.find( selector, self[ i ], ret );
2827
		}
2828
2829
		// Needed because $( selector, context ) becomes $( context ).find( selector )
2830
		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2831
		ret.selector = this.selector ? this.selector + " " + selector : selector;
2832
		return ret;
2833
	},
2834
	filter: function( selector ) {
2835
		return this.pushStack( winnow( this, selector || [], false ) );
2836
	},
2837
	not: function( selector ) {
2838
		return this.pushStack( winnow( this, selector || [], true ) );
2839
	},
2840
	is: function( selector ) {
2841
		return !!winnow(
2842
			this,
2843
2844
			// If this is a positional/relative selector, check membership in the returned set
2845
			// so $("p:first").is("p:last") won't return true for a doc with two "p".
2846
			typeof selector === "string" && rneedsContext.test( selector ) ?
2847
				jQuery( selector ) :
2848
				selector || [],
2849
			false
2850
		).length;
2851
	}
2852
} );
2853
2854
2855
// Initialize a jQuery object
2856
2857
2858
// A central reference to the root jQuery(document)
2859
var rootjQuery,
2860
2861
	// A simple way to check for HTML strings
2862
	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2863
	// Strict HTML recognition (#11290: must start with <)
2864
	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2865
2866
	init = jQuery.fn.init = function( selector, context, root ) {
2867
		var match, elem;
2868
2869
		// HANDLE: $(""), $(null), $(undefined), $(false)
2870
		if ( !selector ) {
2871
			return this;
2872
		}
2873
2874
		// init accepts an alternate rootjQuery
2875
		// so migrate can support jQuery.sub (gh-2101)
2876
		root = root || rootjQuery;
2877
2878
		// Handle HTML strings
2879
		if ( typeof selector === "string" ) {
2880
			if ( selector.charAt( 0 ) === "<" &&
2881
				selector.charAt( selector.length - 1 ) === ">" &&
2882
				selector.length >= 3 ) {
2883
2884
				// Assume that strings that start and end with <> are HTML and skip the regex check
2885
				match = [ null, selector, null ];
2886
2887
			} else {
2888
				match = rquickExpr.exec( selector );
2889
			}
2890
2891
			// Match html or make sure no context is specified for #id
2892
			if ( match && ( match[ 1 ] || !context ) ) {
2893
2894
				// HANDLE: $(html) -> $(array)
2895
				if ( match[ 1 ] ) {
2896
					context = context instanceof jQuery ? context[ 0 ] : context;
2897
2898
					// scripts is true for back-compat
2899
					// Intentionally let the error be thrown if parseHTML is not present
2900
					jQuery.merge( this, jQuery.parseHTML(
2901
						match[ 1 ],
2902
						context && context.nodeType ? context.ownerDocument || context : document,
2903
						true
2904
					) );
2905
2906
					// HANDLE: $(html, props)
2907
					if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
2908
						for ( match in context ) {
2909
2910
							// Properties of context are called as methods if possible
2911
							if ( jQuery.isFunction( this[ match ] ) ) {
2912
								this[ match ]( context[ match ] );
2913
2914
							// ...and otherwise set as attributes
2915
							} else {
2916
								this.attr( match, context[ match ] );
2917
							}
2918
						}
2919
					}
2920
2921
					return this;
2922
2923
				// HANDLE: $(#id)
2924
				} else {
2925
					elem = document.getElementById( match[ 2 ] );
2926
2927
					// Check parentNode to catch when Blackberry 4.6 returns
2928
					// nodes that are no longer in the document #6963
2929
					if ( elem && elem.parentNode ) {
2930
2931
						// Handle the case where IE and Opera return items
2932
						// by name instead of ID
2933
						if ( elem.id !== match[ 2 ] ) {
2934
							return rootjQuery.find( selector );
2935
						}
2936
2937
						// Otherwise, we inject the element directly into the jQuery object
2938
						this.length = 1;
2939
						this[ 0 ] = elem;
2940
					}
2941
2942
					this.context = document;
2943
					this.selector = selector;
2944
					return this;
2945
				}
2946
2947
			// HANDLE: $(expr, $(...))
2948
			} else if ( !context || context.jquery ) {
2949
				return ( context || root ).find( selector );
2950
2951
			// HANDLE: $(expr, context)
2952
			// (which is just equivalent to: $(context).find(expr)
2953
			} else {
2954
				return this.constructor( context ).find( selector );
2955
			}
2956
2957
		// HANDLE: $(DOMElement)
2958
		} else if ( selector.nodeType ) {
2959
			this.context = this[ 0 ] = selector;
2960
			this.length = 1;
2961
			return this;
2962
2963
		// HANDLE: $(function)
2964
		// Shortcut for document ready
2965
		} else if ( jQuery.isFunction( selector ) ) {
2966
			return typeof root.ready !== "undefined" ?
2967
				root.ready( selector ) :
2968
2969
				// Execute immediately if ready is not present
2970
				selector( jQuery );
2971
		}
2972
2973
		if ( selector.selector !== undefined ) {
2974
			this.selector = selector.selector;
2975
			this.context = selector.context;
2976
		}
2977
2978
		return jQuery.makeArray( selector, this );
2979
	};
2980
2981
// Give the init function the jQuery prototype for later instantiation
2982
init.prototype = jQuery.fn;
2983
2984
// Initialize central reference
2985
rootjQuery = jQuery( document );
2986
2987
2988
var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2989
2990
	// methods guaranteed to produce a unique set when starting from a unique set
2991
	guaranteedUnique = {
2992
		children: true,
2993
		contents: true,
2994
		next: true,
2995
		prev: true
2996
	};
2997
2998
jQuery.fn.extend( {
2999
	has: function( target ) {
3000
		var i,
3001
			targets = jQuery( target, this ),
3002
			len = targets.length;
3003
3004
		return this.filter( function() {
3005
			for ( i = 0; i < len; i++ ) {
3006
				if ( jQuery.contains( this, targets[ i ] ) ) {
3007
					return true;
3008
				}
3009
			}
3010
		} );
3011
	},
3012
3013
	closest: function( selectors, context ) {
3014
		var cur,
3015
			i = 0,
3016
			l = this.length,
3017
			matched = [],
3018
			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
3019
				jQuery( selectors, context || this.context ) :
3020
				0;
3021
3022
		for ( ; i < l; i++ ) {
3023
			for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3024
3025
				// Always skip document fragments
3026
				if ( cur.nodeType < 11 && ( pos ?
3027
					pos.index( cur ) > -1 :
3028
3029
					// Don't pass non-elements to Sizzle
3030
					cur.nodeType === 1 &&
3031
						jQuery.find.matchesSelector( cur, selectors ) ) ) {
3032
3033
					matched.push( cur );
3034
					break;
3035
				}
3036
			}
3037
		}
3038
3039
		return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3040
	},
3041
3042
	// Determine the position of an element within
3043
	// the matched set of elements
3044
	index: function( elem ) {
3045
3046
		// No argument, return index in parent
3047
		if ( !elem ) {
3048
			return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3049
		}
3050
3051
		// index in selector
3052
		if ( typeof elem === "string" ) {
3053
			return jQuery.inArray( this[ 0 ], jQuery( elem ) );
3054
		}
3055
3056
		// Locate the position of the desired element
3057
		return jQuery.inArray(
3058
3059
			// If it receives a jQuery object, the first element is used
3060
			elem.jquery ? elem[ 0 ] : elem, this );
3061
	},
3062
3063
	add: function( selector, context ) {
3064
		return this.pushStack(
3065
			jQuery.uniqueSort(
3066
				jQuery.merge( this.get(), jQuery( selector, context ) )
3067
			)
3068
		);
3069
	},
3070
3071
	addBack: function( selector ) {
3072
		return this.add( selector == null ?
3073
			this.prevObject : this.prevObject.filter( selector )
3074
		);
3075
	}
3076
} );
3077
3078
function sibling( cur, dir ) {
3079
	do {
3080
		cur = cur[ dir ];
3081
	} while ( cur && cur.nodeType !== 1 );
3082
3083
	return cur;
3084
}
3085
3086
jQuery.each( {
3087
	parent: function( elem ) {
3088
		var parent = elem.parentNode;
3089
		return parent && parent.nodeType !== 11 ? parent : null;
3090
	},
3091
	parents: function( elem ) {
3092
		return dir( elem, "parentNode" );
3093
	},
3094
	parentsUntil: function( elem, i, until ) {
3095
		return dir( elem, "parentNode", until );
3096
	},
3097
	next: function( elem ) {
3098
		return sibling( elem, "nextSibling" );
3099
	},
3100
	prev: function( elem ) {
3101
		return sibling( elem, "previousSibling" );
3102
	},
3103
	nextAll: function( elem ) {
3104
		return dir( elem, "nextSibling" );
3105
	},
3106
	prevAll: function( elem ) {
3107
		return dir( elem, "previousSibling" );
3108
	},
3109
	nextUntil: function( elem, i, until ) {
3110
		return dir( elem, "nextSibling", until );
3111
	},
3112
	prevUntil: function( elem, i, until ) {
3113
		return dir( elem, "previousSibling", until );
3114
	},
3115
	siblings: function( elem ) {
3116
		return siblings( ( elem.parentNode || {} ).firstChild, elem );
3117
	},
3118
	children: function( elem ) {
3119
		return siblings( elem.firstChild );
3120
	},
3121
	contents: function( elem ) {
3122
		return jQuery.nodeName( elem, "iframe" ) ?
3123
			elem.contentDocument || elem.contentWindow.document :
3124
			jQuery.merge( [], elem.childNodes );
3125
	}
3126
}, function( name, fn ) {
3127
	jQuery.fn[ name ] = function( until, selector ) {
3128
		var ret = jQuery.map( this, fn, until );
3129
3130
		if ( name.slice( -5 ) !== "Until" ) {
3131
			selector = until;
3132
		}
3133
3134
		if ( selector && typeof selector === "string" ) {
3135
			ret = jQuery.filter( selector, ret );
3136
		}
3137
3138
		if ( this.length > 1 ) {
3139
3140
			// Remove duplicates
3141
			if ( !guaranteedUnique[ name ] ) {
3142
				ret = jQuery.uniqueSort( ret );
3143
			}
3144
3145
			// Reverse order for parents* and prev-derivatives
3146
			if ( rparentsprev.test( name ) ) {
3147
				ret = ret.reverse();
3148
			}
3149
		}
3150
3151
		return this.pushStack( ret );
3152
	};
3153
} );
3154
var rnotwhite = ( /\S+/g );
3155
3156
3157
3158
// Convert String-formatted options into Object-formatted ones
3159
function createOptions( options ) {
3160
	var object = {};
3161
	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3162
		object[ flag ] = true;
3163
	} );
3164
	return object;
3165
}
3166
3167
/*
3168
 * Create a callback list using the following parameters:
3169
 *
3170
 *	options: an optional list of space-separated options that will change how
3171
 *			the callback list behaves or a more traditional option object
3172
 *
3173
 * By default a callback list will act like an event callback list and can be
3174
 * "fired" multiple times.
3175
 *
3176
 * Possible options:
3177
 *
3178
 *	once:			will ensure the callback list can only be fired once (like a Deferred)
3179
 *
3180
 *	memory:			will keep track of previous values and will call any callback added
3181
 *					after the list has been fired right away with the latest "memorized"
3182
 *					values (like a Deferred)
3183
 *
3184
 *	unique:			will ensure a callback can only be added once (no duplicate in the list)
3185
 *
3186
 *	stopOnFalse:	interrupt callings when a callback returns false
3187
 *
3188
 */
3189
jQuery.Callbacks = function( options ) {
3190
3191
	// Convert options from String-formatted to Object-formatted if needed
3192
	// (we check in cache first)
3193
	options = typeof options === "string" ?
3194
		createOptions( options ) :
3195
		jQuery.extend( {}, options );
3196
3197
	var // Flag to know if list is currently firing
3198
		firing,
3199
3200
		// Last fire value for non-forgettable lists
3201
		memory,
3202
3203
		// Flag to know if list was already fired
3204
		fired,
3205
3206
		// Flag to prevent firing
3207
		locked,
3208
3209
		// Actual callback list
3210
		list = [],
3211
3212
		// Queue of execution data for repeatable lists
3213
		queue = [],
3214
3215
		// Index of currently firing callback (modified by add/remove as needed)
3216
		firingIndex = -1,
3217
3218
		// Fire callbacks
3219
		fire = function() {
3220
3221
			// Enforce single-firing
3222
			locked = options.once;
3223
3224
			// Execute callbacks for all pending executions,
3225
			// respecting firingIndex overrides and runtime changes
3226
			fired = firing = true;
3227
			for ( ; queue.length; firingIndex = -1 ) {
3228
				memory = queue.shift();
3229
				while ( ++firingIndex < list.length ) {
3230
3231
					// Run callback and check for early termination
3232
					if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3233
						options.stopOnFalse ) {
3234
3235
						// Jump to end and forget the data so .add doesn't re-fire
3236
						firingIndex = list.length;
3237
						memory = false;
3238
					}
3239
				}
3240
			}
3241
3242
			// Forget the data if we're done with it
3243
			if ( !options.memory ) {
3244
				memory = false;
3245
			}
3246
3247
			firing = false;
3248
3249
			// Clean up if we're done firing for good
3250
			if ( locked ) {
3251
3252
				// Keep an empty list if we have data for future add calls
3253
				if ( memory ) {
3254
					list = [];
3255
3256
				// Otherwise, this object is spent
3257
				} else {
3258
					list = "";
3259
				}
3260
			}
3261
		},
3262
3263
		// Actual Callbacks object
3264
		self = {
3265
3266
			// Add a callback or a collection of callbacks to the list
3267
			add: function() {
3268
				if ( list ) {
3269
3270
					// If we have memory from a past run, we should fire after adding
3271
					if ( memory && !firing ) {
3272
						firingIndex = list.length - 1;
3273
						queue.push( memory );
3274
					}
3275
3276
					( function add( args ) {
3277
						jQuery.each( args, function( _, arg ) {
3278
							if ( jQuery.isFunction( arg ) ) {
3279
								if ( !options.unique || !self.has( arg ) ) {
3280
									list.push( arg );
3281
								}
3282
							} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
3283
3284
								// Inspect recursively
3285
								add( arg );
3286
							}
3287
						} );
3288
					} )( arguments );
3289
3290
					if ( memory && !firing ) {
3291
						fire();
3292
					}
3293
				}
3294
				return this;
3295
			},
3296
3297
			// Remove a callback from the list
3298
			remove: function() {
3299
				jQuery.each( arguments, function( _, arg ) {
3300
					var index;
3301
					while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3302
						list.splice( index, 1 );
3303
3304
						// Handle firing indexes
3305
						if ( index <= firingIndex ) {
3306
							firingIndex--;
3307
						}
3308
					}
3309
				} );
3310
				return this;
3311
			},
3312
3313
			// Check if a given callback is in the list.
3314
			// If no argument is given, return whether or not list has callbacks attached.
3315
			has: function( fn ) {
3316
				return fn ?
3317
					jQuery.inArray( fn, list ) > -1 :
3318
					list.length > 0;
3319
			},
3320
3321
			// Remove all callbacks from the list
3322
			empty: function() {
3323
				if ( list ) {
3324
					list = [];
3325
				}
3326
				return this;
3327
			},
3328
3329
			// Disable .fire and .add
3330
			// Abort any current/pending executions
3331
			// Clear all callbacks and values
3332
			disable: function() {
3333
				locked = queue = [];
3334
				list = memory = "";
3335
				return this;
3336
			},
3337
			disabled: function() {
3338
				return !list;
3339
			},
3340
3341
			// Disable .fire
3342
			// Also disable .add unless we have memory (since it would have no effect)
3343
			// Abort any pending executions
3344
			lock: function() {
3345
				locked = true;
3346
				if ( !memory ) {
3347
					self.disable();
3348
				}
3349
				return this;
3350
			},
3351
			locked: function() {
3352
				return !!locked;
3353
			},
3354
3355
			// Call all callbacks with the given context and arguments
3356
			fireWith: function( context, args ) {
3357
				if ( !locked ) {
3358
					args = args || [];
3359
					args = [ context, args.slice ? args.slice() : args ];
3360
					queue.push( args );
3361
					if ( !firing ) {
3362
						fire();
3363
					}
3364
				}
3365
				return this;
3366
			},
3367
3368
			// Call all the callbacks with the given arguments
3369
			fire: function() {
3370
				self.fireWith( this, arguments );
3371
				return this;
3372
			},
3373
3374
			// To know if the callbacks have already been called at least once
3375
			fired: function() {
3376
				return !!fired;
3377
			}
3378
		};
3379
3380
	return self;
3381
};
3382
3383
3384
jQuery.extend( {
3385
3386
	Deferred: function( func ) {
3387
		var tuples = [
3388
3389
				// action, add listener, listener list, final state
3390
				[ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
3391
				[ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
3392
				[ "notify", "progress", jQuery.Callbacks( "memory" ) ]
3393
			],
3394
			state = "pending",
3395
			promise = {
3396
				state: function() {
3397
					return state;
3398
				},
3399
				always: function() {
3400
					deferred.done( arguments ).fail( arguments );
3401
					return this;
3402
				},
3403
				then: function( /* fnDone, fnFail, fnProgress */ ) {
3404
					var fns = arguments;
3405
					return jQuery.Deferred( function( newDefer ) {
3406
						jQuery.each( tuples, function( i, tuple ) {
3407
							var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3408
3409
							// deferred[ done | fail | progress ] for forwarding actions to newDefer
3410
							deferred[ tuple[ 1 ] ]( function() {
3411
								var returned = fn && fn.apply( this, arguments );
3412
								if ( returned && jQuery.isFunction( returned.promise ) ) {
3413
									returned.promise()
3414
										.progress( newDefer.notify )
3415
										.done( newDefer.resolve )
3416
										.fail( newDefer.reject );
3417
								} else {
3418
									newDefer[ tuple[ 0 ] + "With" ](
3419
										this === promise ? newDefer.promise() : this,
3420
										fn ? [ returned ] : arguments
3421
									);
3422
								}
3423
							} );
3424
						} );
3425
						fns = null;
3426
					} ).promise();
3427
				},
3428
3429
				// Get a promise for this deferred
3430
				// If obj is provided, the promise aspect is added to the object
3431
				promise: function( obj ) {
3432
					return obj != null ? jQuery.extend( obj, promise ) : promise;
3433
				}
3434
			},
3435
			deferred = {};
3436
3437
		// Keep pipe for back-compat
3438
		promise.pipe = promise.then;
3439
3440
		// Add list-specific methods
3441
		jQuery.each( tuples, function( i, tuple ) {
3442
			var list = tuple[ 2 ],
3443
				stateString = tuple[ 3 ];
3444
3445
			// promise[ done | fail | progress ] = list.add
3446
			promise[ tuple[ 1 ] ] = list.add;
3447
3448
			// Handle state
3449
			if ( stateString ) {
3450
				list.add( function() {
3451
3452
					// state = [ resolved | rejected ]
3453
					state = stateString;
3454
3455
				// [ reject_list | resolve_list ].disable; progress_list.lock
3456
				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3457
			}
3458
3459
			// deferred[ resolve | reject | notify ]
3460
			deferred[ tuple[ 0 ] ] = function() {
3461
				deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
3462
				return this;
3463
			};
3464
			deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3465
		} );
3466
3467
		// Make the deferred a promise
3468
		promise.promise( deferred );
3469
3470
		// Call given func if any
3471
		if ( func ) {
3472
			func.call( deferred, deferred );
3473
		}
3474
3475
		// All done!
3476
		return deferred;
3477
	},
3478
3479
	// Deferred helper
3480
	when: function( subordinate /* , ..., subordinateN */ ) {
3481
		var i = 0,
3482
			resolveValues = slice.call( arguments ),
3483
			length = resolveValues.length,
3484
3485
			// the count of uncompleted subordinates
3486
			remaining = length !== 1 ||
3487
				( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3488
3489
			// the master Deferred.
3490
			// If resolveValues consist of only a single Deferred, just use that.
3491
			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3492
3493
			// Update function for both resolve and progress values
3494
			updateFunc = function( i, contexts, values ) {
3495
				return function( value ) {
3496
					contexts[ i ] = this;
3497
					values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3498
					if ( values === progressValues ) {
3499
						deferred.notifyWith( contexts, values );
3500
3501
					} else if ( !( --remaining ) ) {
3502
						deferred.resolveWith( contexts, values );
3503
					}
3504
				};
3505
			},
3506
3507
			progressValues, progressContexts, resolveContexts;
3508
3509
		// add listeners to Deferred subordinates; treat others as resolved
3510
		if ( length > 1 ) {
3511
			progressValues = new Array( length );
3512
			progressContexts = new Array( length );
3513
			resolveContexts = new Array( length );
3514
			for ( ; i < length; i++ ) {
3515
				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3516
					resolveValues[ i ].promise()
3517
						.progress( updateFunc( i, progressContexts, progressValues ) )
3518
						.done( updateFunc( i, resolveContexts, resolveValues ) )
3519
						.fail( deferred.reject );
3520
				} else {
3521
					--remaining;
3522
				}
3523
			}
3524
		}
3525
3526
		// if we're not waiting on anything, resolve the master
3527
		if ( !remaining ) {
3528
			deferred.resolveWith( resolveContexts, resolveValues );
3529
		}
3530
3531
		return deferred.promise();
3532
	}
3533
} );
3534
3535
3536
// The deferred used on DOM ready
3537
var readyList;
3538
3539
jQuery.fn.ready = function( fn ) {
3540
3541
	// Add the callback
3542
	jQuery.ready.promise().done( fn );
3543
3544
	return this;
3545
};
3546
3547
jQuery.extend( {
3548
3549
	// Is the DOM ready to be used? Set to true once it occurs.
3550
	isReady: false,
3551
3552
	// A counter to track how many items to wait for before
3553
	// the ready event fires. See #6781
3554
	readyWait: 1,
3555
3556
	// Hold (or release) the ready event
3557
	holdReady: function( hold ) {
3558
		if ( hold ) {
3559
			jQuery.readyWait++;
3560
		} else {
3561
			jQuery.ready( true );
3562
		}
3563
	},
3564
3565
	// Handle when the DOM is ready
3566
	ready: function( wait ) {
3567
3568
		// Abort if there are pending holds or we're already ready
3569
		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3570
			return;
3571
		}
3572
3573
		// Remember that the DOM is ready
3574
		jQuery.isReady = true;
3575
3576
		// If a normal DOM Ready event fired, decrement, and wait if need be
3577
		if ( wait !== true && --jQuery.readyWait > 0 ) {
3578
			return;
3579
		}
3580
3581
		// If there are functions bound, to execute
3582
		readyList.resolveWith( document, [ jQuery ] );
3583
3584
		// Trigger any bound ready events
3585
		if ( jQuery.fn.triggerHandler ) {
3586
			jQuery( document ).triggerHandler( "ready" );
3587
			jQuery( document ).off( "ready" );
3588
		}
3589
	}
3590
} );
3591
3592
/**
3593
 * Clean-up method for dom ready events
3594
 */
3595
function detach() {
3596
	if ( document.addEventListener ) {
3597
		document.removeEventListener( "DOMContentLoaded", completed );
3598
		window.removeEventListener( "load", completed );
3599
3600
	} else {
3601
		document.detachEvent( "onreadystatechange", completed );
3602
		window.detachEvent( "onload", completed );
3603
	}
3604
}
3605
3606
/**
3607
 * The ready event handler and self cleanup method
3608
 */
3609
function completed() {
3610
3611
	// readyState === "complete" is good enough for us to call the dom ready in oldIE
3612
	if ( document.addEventListener ||
3613
		window.event.type === "load" ||
3614
		document.readyState === "complete" ) {
3615
3616
		detach();
3617
		jQuery.ready();
3618
	}
3619
}
3620
3621
jQuery.ready.promise = function( obj ) {
3622
	if ( !readyList ) {
3623
3624
		readyList = jQuery.Deferred();
3625
3626
		// Catch cases where $(document).ready() is called
3627
		// after the browser event has already occurred.
3628
		// we once tried to use readyState "interactive" here,
3629
		// but it caused issues like the one
3630
		// discovered by ChrisS here:
3631
		// http://bugs.jquery.com/ticket/12282#comment:15
3632
		if ( document.readyState === "complete" ) {
3633
3634
			// Handle it asynchronously to allow scripts the opportunity to delay ready
3635
			window.setTimeout( jQuery.ready );
3636
3637
		// Standards-based browsers support DOMContentLoaded
3638
		} else if ( document.addEventListener ) {
3639
3640
			// Use the handy event callback
3641
			document.addEventListener( "DOMContentLoaded", completed );
3642
3643
			// A fallback to window.onload, that will always work
3644
			window.addEventListener( "load", completed );
3645
3646
		// If IE event model is used
3647
		} else {
3648
3649
			// Ensure firing before onload, maybe late but safe also for iframes
3650
			document.attachEvent( "onreadystatechange", completed );
3651
3652
			// A fallback to window.onload, that will always work
3653
			window.attachEvent( "onload", completed );
3654
3655
			// If IE and not a frame
3656
			// continually check to see if the document is ready
3657
			var top = false;
3658
3659
			try {
3660
				top = window.frameElement == null && document.documentElement;
3661
			} catch ( e ) {}
3662
3663
			if ( top && top.doScroll ) {
3664
				( function doScrollCheck() {
3665
					if ( !jQuery.isReady ) {
3666
3667
						try {
3668
3669
							// Use the trick by Diego Perini
3670
							// http://javascript.nwbox.com/IEContentLoaded/
3671
							top.doScroll( "left" );
3672
						} catch ( e ) {
3673
							return window.setTimeout( doScrollCheck, 50 );
3674
						}
3675
3676
						// detach all dom ready events
3677
						detach();
3678
3679
						// and execute any waiting functions
3680
						jQuery.ready();
3681
					}
3682
				} )();
3683
			}
3684
		}
3685
	}
3686
	return readyList.promise( obj );
3687
};
3688
3689
// Kick off the DOM ready check even if the user does not
3690
jQuery.ready.promise();
3691
3692
3693
3694
3695
// Support: IE<9
3696
// Iteration over object's inherited properties before its own
3697
var i;
3698
for ( i in jQuery( support ) ) {
3699
	break;
3700
}
3701
support.ownFirst = i === "0";
3702
3703
// Note: most support tests are defined in their respective modules.
3704
// false until the test is run
3705
support.inlineBlockNeedsLayout = false;
3706
3707
// Execute ASAP in case we need to set body.style.zoom
3708
jQuery( function() {
3709
3710
	// Minified: var a,b,c,d
3711
	var val, div, body, container;
3712
3713
	body = document.getElementsByTagName( "body" )[ 0 ];
3714
	if ( !body || !body.style ) {
3715
3716
		// Return for frameset docs that don't have a body
3717
		return;
3718
	}
3719
3720
	// Setup
3721
	div = document.createElement( "div" );
3722
	container = document.createElement( "div" );
3723
	container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
3724
	body.appendChild( container ).appendChild( div );
3725
3726
	if ( typeof div.style.zoom !== "undefined" ) {
3727
3728
		// Support: IE<8
3729
		// Check if natively block-level elements act like inline-block
3730
		// elements when setting their display to 'inline' and giving
3731
		// them layout
3732
		div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
3733
3734
		support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
3735
		if ( val ) {
3736
3737
			// Prevent IE 6 from affecting layout for positioned elements #11048
3738
			// Prevent IE from shrinking the body in IE 7 mode #12869
3739
			// Support: IE<8
3740
			body.style.zoom = 1;
3741
		}
3742
	}
3743
3744
	body.removeChild( container );
3745
} );
3746
3747
3748
( function() {
3749
	var div = document.createElement( "div" );
3750
3751
	// Support: IE<9
3752
	support.deleteExpando = true;
3753
	try {
3754
		delete div.test;
3755
	} catch ( e ) {
3756
		support.deleteExpando = false;
3757
	}
3758
3759
	// Null elements to avoid leaks in IE.
3760
	div = null;
3761
} )();
3762
var acceptData = function( elem ) {
3763
	var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
3764
		nodeType = +elem.nodeType || 1;
3765
3766
	// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3767
	return nodeType !== 1 && nodeType !== 9 ?
3768
		false :
3769
3770
		// Nodes accept data unless otherwise specified; rejection can be conditional
3771
		!noData || noData !== true && elem.getAttribute( "classid" ) === noData;
3772
};
3773
3774
3775
3776
3777
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3778
	rmultiDash = /([A-Z])/g;
3779
3780
function dataAttr( elem, key, data ) {
3781
3782
	// If nothing was found internally, try to fetch any
3783
	// data from the HTML5 data-* attribute
3784
	if ( data === undefined && elem.nodeType === 1 ) {
3785
3786
		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3787
3788
		data = elem.getAttribute( name );
3789
3790
		if ( typeof data === "string" ) {
3791
			try {
3792
				data = data === "true" ? true :
3793
					data === "false" ? false :
3794
					data === "null" ? null :
3795
3796
					// Only convert to a number if it doesn't change the string
3797
					+data + "" === data ? +data :
3798
					rbrace.test( data ) ? jQuery.parseJSON( data ) :
3799
					data;
3800
			} catch ( e ) {}
3801
3802
			// Make sure we set the data so it isn't changed later
3803
			jQuery.data( elem, key, data );
3804
3805
		} else {
3806
			data = undefined;
3807
		}
3808
	}
3809
3810
	return data;
3811
}
3812
3813
// checks a cache object for emptiness
3814
function isEmptyDataObject( obj ) {
3815
	var name;
3816
	for ( name in obj ) {
3817
3818
		// if the public data object is empty, the private is still empty
3819
		if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) {
3820
			continue;
3821
		}
3822
		if ( name !== "toJSON" ) {
3823
			return false;
3824
		}
3825
	}
3826
3827
	return true;
3828
}
3829
3830
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3831
	if ( !acceptData( elem ) ) {
3832
		return;
3833
	}
3834
3835
	var ret, thisCache,
3836
		internalKey = jQuery.expando,
3837
3838
		// We have to handle DOM nodes and JS objects differently because IE6-7
3839
		// can't GC object references properly across the DOM-JS boundary
3840
		isNode = elem.nodeType,
3841
3842
		// Only DOM nodes need the global jQuery cache; JS object data is
3843
		// attached directly to the object so GC can occur automatically
3844
		cache = isNode ? jQuery.cache : elem,
3845
3846
		// Only defining an ID for JS objects if its cache already exists allows
3847
		// the code to shortcut on the same path as a DOM node with no cache
3848
		id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3849
3850
	// Avoid doing any more work than we need to when trying to get data on an
3851
	// object that has no data at all
3852
	if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) &&
3853
		data === undefined && typeof name === "string" ) {
3854
		return;
3855
	}
3856
3857
	if ( !id ) {
3858
3859
		// Only DOM nodes need a new unique ID for each element since their data
3860
		// ends up in the global cache
3861
		if ( isNode ) {
3862
			id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3863
		} else {
3864
			id = internalKey;
3865
		}
3866
	}
3867
3868
	if ( !cache[ id ] ) {
3869
3870
		// Avoid exposing jQuery metadata on plain JS objects when the object
3871
		// is serialized using JSON.stringify
3872
		cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3873
	}
3874
3875
	// An object can be passed to jQuery.data instead of a key/value pair; this gets
3876
	// shallow copied over onto the existing cache
3877
	if ( typeof name === "object" || typeof name === "function" ) {
3878
		if ( pvt ) {
3879
			cache[ id ] = jQuery.extend( cache[ id ], name );
3880
		} else {
3881
			cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3882
		}
3883
	}
3884
3885
	thisCache = cache[ id ];
3886
3887
	// jQuery data() is stored in a separate object inside the object's internal data
3888
	// cache in order to avoid key collisions between internal data and user-defined
3889
	// data.
3890
	if ( !pvt ) {
3891
		if ( !thisCache.data ) {
3892
			thisCache.data = {};
3893
		}
3894
3895
		thisCache = thisCache.data;
3896
	}
3897
3898
	if ( data !== undefined ) {
3899
		thisCache[ jQuery.camelCase( name ) ] = data;
3900
	}
3901
3902
	// Check for both converted-to-camel and non-converted data property names
3903
	// If a data property was specified
3904
	if ( typeof name === "string" ) {
3905
3906
		// First Try to find as-is property data
3907
		ret = thisCache[ name ];
3908
3909
		// Test for null|undefined property data
3910
		if ( ret == null ) {
3911
3912
			// Try to find the camelCased property
3913
			ret = thisCache[ jQuery.camelCase( name ) ];
3914
		}
3915
	} else {
3916
		ret = thisCache;
3917
	}
3918
3919
	return ret;
3920
}
3921
3922
function internalRemoveData( elem, name, pvt ) {
3923
	if ( !acceptData( elem ) ) {
3924
		return;
3925
	}
3926
3927
	var thisCache, i,
3928
		isNode = elem.nodeType,
3929
3930
		// See jQuery.data for more information
3931
		cache = isNode ? jQuery.cache : elem,
3932
		id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3933
3934
	// If there is already no cache entry for this object, there is no
3935
	// purpose in continuing
3936
	if ( !cache[ id ] ) {
3937
		return;
3938
	}
3939
3940
	if ( name ) {
3941
3942
		thisCache = pvt ? cache[ id ] : cache[ id ].data;
3943
3944
		if ( thisCache ) {
3945
3946
			// Support array or space separated string names for data keys
3947
			if ( !jQuery.isArray( name ) ) {
3948
3949
				// try the string as a key before any manipulation
3950
				if ( name in thisCache ) {
3951
					name = [ name ];
3952
				} else {
3953
3954
					// split the camel cased version by spaces unless a key with the spaces exists
3955
					name = jQuery.camelCase( name );
3956
					if ( name in thisCache ) {
3957
						name = [ name ];
3958
					} else {
3959
						name = name.split( " " );
3960
					}
3961
				}
3962
			} else {
3963
3964
				// If "name" is an array of keys...
3965
				// When data is initially created, via ("key", "val") signature,
3966
				// keys will be converted to camelCase.
3967
				// Since there is no way to tell _how_ a key was added, remove
3968
				// both plain key and camelCase key. #12786
3969
				// This will only penalize the array argument path.
3970
				name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3971
			}
3972
3973
			i = name.length;
3974
			while ( i-- ) {
3975
				delete thisCache[ name[ i ] ];
3976
			}
3977
3978
			// If there is no data left in the cache, we want to continue
3979
			// and let the cache object itself get destroyed
3980
			if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) {
3981
				return;
3982
			}
3983
		}
3984
	}
3985
3986
	// See jQuery.data for more information
3987
	if ( !pvt ) {
3988
		delete cache[ id ].data;
3989
3990
		// Don't destroy the parent cache unless the internal data object
3991
		// had been the only thing left in it
3992
		if ( !isEmptyDataObject( cache[ id ] ) ) {
3993
			return;
3994
		}
3995
	}
3996
3997
	// Destroy the cache
3998
	if ( isNode ) {
3999
		jQuery.cleanData( [ elem ], true );
4000
4001
	// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
4002
	/* jshint eqeqeq: false */
4003
	} else if ( support.deleteExpando || cache != cache.window ) {
4004
		/* jshint eqeqeq: true */
4005
		delete cache[ id ];
4006
4007
	// When all else fails, undefined
4008
	} else {
4009
		cache[ id ] = undefined;
4010
	}
4011
}
4012
4013
jQuery.extend( {
4014
	cache: {},
4015
4016
	// The following elements (space-suffixed to avoid Object.prototype collisions)
4017
	// throw uncatchable exceptions if you attempt to set expando properties
4018
	noData: {
4019
		"applet ": true,
4020
		"embed ": true,
4021
4022
		// ...but Flash objects (which have this classid) *can* handle expandos
4023
		"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
4024
	},
4025
4026
	hasData: function( elem ) {
4027
		elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ];
4028
		return !!elem && !isEmptyDataObject( elem );
4029
	},
4030
4031
	data: function( elem, name, data ) {
4032
		return internalData( elem, name, data );
4033
	},
4034
4035
	removeData: function( elem, name ) {
4036
		return internalRemoveData( elem, name );
4037
	},
4038
4039
	// For internal use only.
4040
	_data: function( elem, name, data ) {
4041
		return internalData( elem, name, data, true );
4042
	},
4043
4044
	_removeData: function( elem, name ) {
4045
		return internalRemoveData( elem, name, true );
4046
	}
4047
} );
4048
4049
jQuery.fn.extend( {
4050
	data: function( key, value ) {
4051
		var i, name, data,
4052
			elem = this[ 0 ],
4053
			attrs = elem && elem.attributes;
4054
4055
		// Special expections of .data basically thwart jQuery.access,
4056
		// so implement the relevant behavior ourselves
4057
4058
		// Gets all values
4059
		if ( key === undefined ) {
4060
			if ( this.length ) {
4061
				data = jQuery.data( elem );
4062
4063
				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
4064
					i = attrs.length;
4065
					while ( i-- ) {
4066
4067
						// Support: IE11+
4068
						// The attrs elements can be null (#14894)
4069
						if ( attrs[ i ] ) {
4070
							name = attrs[ i ].name;
4071
							if ( name.indexOf( "data-" ) === 0 ) {
4072
								name = jQuery.camelCase( name.slice( 5 ) );
4073
								dataAttr( elem, name, data[ name ] );
4074
							}
4075
						}
4076
					}
4077
					jQuery._data( elem, "parsedAttrs", true );
4078
				}
4079
			}
4080
4081
			return data;
4082
		}
4083
4084
		// Sets multiple values
4085
		if ( typeof key === "object" ) {
4086
			return this.each( function() {
4087
				jQuery.data( this, key );
4088
			} );
4089
		}
4090
4091
		return arguments.length > 1 ?
4092
4093
			// Sets one value
4094
			this.each( function() {
4095
				jQuery.data( this, key, value );
4096
			} ) :
4097
4098
			// Gets one value
4099
			// Try to fetch any internally stored data first
4100
			elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
4101
	},
4102
4103
	removeData: function( key ) {
4104
		return this.each( function() {
4105
			jQuery.removeData( this, key );
4106
		} );
4107
	}
4108
} );
4109
4110
4111
jQuery.extend( {
4112
	queue: function( elem, type, data ) {
4113
		var queue;
4114
4115
		if ( elem ) {
4116
			type = ( type || "fx" ) + "queue";
4117
			queue = jQuery._data( elem, type );
4118
4119
			// Speed up dequeue by getting out quickly if this is just a lookup
4120
			if ( data ) {
4121
				if ( !queue || jQuery.isArray( data ) ) {
4122
					queue = jQuery._data( elem, type, jQuery.makeArray( data ) );
4123
				} else {
4124
					queue.push( data );
4125
				}
4126
			}
4127
			return queue || [];
4128
		}
4129
	},
4130
4131
	dequeue: function( elem, type ) {
4132
		type = type || "fx";
4133
4134
		var queue = jQuery.queue( elem, type ),
4135
			startLength = queue.length,
4136
			fn = queue.shift(),
4137
			hooks = jQuery._queueHooks( elem, type ),
4138
			next = function() {
4139
				jQuery.dequeue( elem, type );
4140
			};
4141
4142
		// If the fx queue is dequeued, always remove the progress sentinel
4143
		if ( fn === "inprogress" ) {
4144
			fn = queue.shift();
4145
			startLength--;
4146
		}
4147
4148
		if ( fn ) {
4149
4150
			// Add a progress sentinel to prevent the fx queue from being
4151
			// automatically dequeued
4152
			if ( type === "fx" ) {
4153
				queue.unshift( "inprogress" );
4154
			}
4155
4156
			// clear up the last queue stop function
4157
			delete hooks.stop;
4158
			fn.call( elem, next, hooks );
4159
		}
4160
4161
		if ( !startLength && hooks ) {
4162
			hooks.empty.fire();
4163
		}
4164
	},
4165
4166
	// not intended for public consumption - generates a queueHooks object,
4167
	// or returns the current one
4168
	_queueHooks: function( elem, type ) {
4169
		var key = type + "queueHooks";
4170
		return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4171
			empty: jQuery.Callbacks( "once memory" ).add( function() {
4172
				jQuery._removeData( elem, type + "queue" );
4173
				jQuery._removeData( elem, key );
4174
			} )
4175
		} );
4176
	}
4177
} );
4178
4179
jQuery.fn.extend( {
4180
	queue: function( type, data ) {
4181
		var setter = 2;
4182
4183
		if ( typeof type !== "string" ) {
4184
			data = type;
4185
			type = "fx";
4186
			setter--;
4187
		}
4188
4189
		if ( arguments.length < setter ) {
4190
			return jQuery.queue( this[ 0 ], type );
4191
		}
4192
4193
		return data === undefined ?
4194
			this :
4195
			this.each( function() {
4196
				var queue = jQuery.queue( this, type, data );
4197
4198
				// ensure a hooks for this queue
4199
				jQuery._queueHooks( this, type );
4200
4201
				if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4202
					jQuery.dequeue( this, type );
4203
				}
4204
			} );
4205
	},
4206
	dequeue: function( type ) {
4207
		return this.each( function() {
4208
			jQuery.dequeue( this, type );
4209
		} );
4210
	},
4211
	clearQueue: function( type ) {
4212
		return this.queue( type || "fx", [] );
4213
	},
4214
4215
	// Get a promise resolved when queues of a certain type
4216
	// are emptied (fx is the type by default)
4217
	promise: function( type, obj ) {
4218
		var tmp,
4219
			count = 1,
4220
			defer = jQuery.Deferred(),
4221
			elements = this,
4222
			i = this.length,
4223
			resolve = function() {
4224
				if ( !( --count ) ) {
4225
					defer.resolveWith( elements, [ elements ] );
4226
				}
4227
			};
4228
4229
		if ( typeof type !== "string" ) {
4230
			obj = type;
4231
			type = undefined;
4232
		}
4233
		type = type || "fx";
4234
4235
		while ( i-- ) {
4236
			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4237
			if ( tmp && tmp.empty ) {
4238
				count++;
4239
				tmp.empty.add( resolve );
4240
			}
4241
		}
4242
		resolve();
4243
		return defer.promise( obj );
4244
	}
4245
} );
4246
4247
4248
( function() {
4249
	var shrinkWrapBlocksVal;
4250
4251
	support.shrinkWrapBlocks = function() {
4252
		if ( shrinkWrapBlocksVal != null ) {
4253
			return shrinkWrapBlocksVal;
4254
		}
4255
4256
		// Will be changed later if needed.
4257
		shrinkWrapBlocksVal = false;
4258
4259
		// Minified: var b,c,d
4260
		var div, body, container;
4261
4262
		body = document.getElementsByTagName( "body" )[ 0 ];
4263
		if ( !body || !body.style ) {
4264
4265
			// Test fired too early or in an unsupported environment, exit.
4266
			return;
4267
		}
4268
4269
		// Setup
4270
		div = document.createElement( "div" );
4271
		container = document.createElement( "div" );
4272
		container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
4273
		body.appendChild( container ).appendChild( div );
4274
4275
		// Support: IE6
4276
		// Check if elements with layout shrink-wrap their children
4277
		if ( typeof div.style.zoom !== "undefined" ) {
4278
4279
			// Reset CSS: box-sizing; display; margin; border
4280
			div.style.cssText =
4281
4282
				// Support: Firefox<29, Android 2.3
4283
				// Vendor-prefix box-sizing
4284
				"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
4285
				"box-sizing:content-box;display:block;margin:0;border:0;" +
4286
				"padding:1px;width:1px;zoom:1";
4287
			div.appendChild( document.createElement( "div" ) ).style.width = "5px";
4288
			shrinkWrapBlocksVal = div.offsetWidth !== 3;
4289
		}
4290
4291
		body.removeChild( container );
4292
4293
		return shrinkWrapBlocksVal;
4294
	};
4295
4296
} )();
4297
var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4298
4299
var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4300
4301
4302
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4303
4304
var isHidden = function( elem, el ) {
4305
4306
		// isHidden might be called from jQuery#filter function;
4307
		// in that case, element will be second argument
4308
		elem = el || elem;
4309
		return jQuery.css( elem, "display" ) === "none" ||
4310
			!jQuery.contains( elem.ownerDocument, elem );
4311
	};
4312
4313
4314
4315
function adjustCSS( elem, prop, valueParts, tween ) {
4316
	var adjusted,
4317
		scale = 1,
4318
		maxIterations = 20,
4319
		currentValue = tween ?
4320
			function() { return tween.cur(); } :
4321
			function() { return jQuery.css( elem, prop, "" ); },
4322
		initial = currentValue(),
4323
		unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4324
4325
		// Starting value computation is required for potential unit mismatches
4326
		initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4327
			rcssNum.exec( jQuery.css( elem, prop ) );
4328
4329
	if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4330
4331
		// Trust units reported by jQuery.css
4332
		unit = unit || initialInUnit[ 3 ];
4333
4334
		// Make sure we update the tween properties later on
4335
		valueParts = valueParts || [];
4336
4337
		// Iteratively approximate from a nonzero starting point
4338
		initialInUnit = +initial || 1;
4339
4340
		do {
4341
4342
			// If previous iteration zeroed out, double until we get *something*.
4343
			// Use string for doubling so we don't accidentally see scale as unchanged below
4344
			scale = scale || ".5";
4345
4346
			// Adjust and apply
4347
			initialInUnit = initialInUnit / scale;
4348
			jQuery.style( elem, prop, initialInUnit + unit );
4349
4350
		// Update scale, tolerating zero or NaN from tween.cur()
4351
		// Break the loop if scale is unchanged or perfect, or if we've just had enough.
4352
		} while (
4353
			scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
4354
		);
4355
	}
4356
4357
	if ( valueParts ) {
4358
		initialInUnit = +initialInUnit || +initial || 0;
4359
4360
		// Apply relative offset (+=/-=) if specified
4361
		adjusted = valueParts[ 1 ] ?
4362
			initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4363
			+valueParts[ 2 ];
4364
		if ( tween ) {
4365
			tween.unit = unit;
4366
			tween.start = initialInUnit;
4367
			tween.end = adjusted;
4368
		}
4369
	}
4370
	return adjusted;
4371
}
4372
4373
4374
// Multifunctional method to get and set values of a collection
4375
// The value/s can optionally be executed if it's a function
4376
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4377
	var i = 0,
4378
		length = elems.length,
4379
		bulk = key == null;
4380
4381
	// Sets many values
4382
	if ( jQuery.type( key ) === "object" ) {
4383
		chainable = true;
4384
		for ( i in key ) {
4385
			access( elems, fn, i, key[ i ], true, emptyGet, raw );
4386
		}
4387
4388
	// Sets one value
4389
	} else if ( value !== undefined ) {
4390
		chainable = true;
4391
4392
		if ( !jQuery.isFunction( value ) ) {
4393
			raw = true;
4394
		}
4395
4396
		if ( bulk ) {
4397
4398
			// Bulk operations run against the entire set
4399
			if ( raw ) {
4400
				fn.call( elems, value );
4401
				fn = null;
4402
4403
			// ...except when executing function values
4404
			} else {
4405
				bulk = fn;
4406
				fn = function( elem, key, value ) {
4407
					return bulk.call( jQuery( elem ), value );
4408
				};
4409
			}
4410
		}
4411
4412
		if ( fn ) {
4413
			for ( ; i < length; i++ ) {
4414
				fn(
4415
					elems[ i ],
4416
					key,
4417
					raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
4418
				);
4419
			}
4420
		}
4421
	}
4422
4423
	return chainable ?
4424
		elems :
4425
4426
		// Gets
4427
		bulk ?
4428
			fn.call( elems ) :
4429
			length ? fn( elems[ 0 ], key ) : emptyGet;
4430
};
4431
var rcheckableType = ( /^(?:checkbox|radio)$/i );
4432
4433
var rtagName = ( /<([\w:-]+)/ );
4434
4435
var rscriptType = ( /^$|\/(?:java|ecma)script/i );
4436
4437
var rleadingWhitespace = ( /^\s+/ );
4438
4439
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
4440
		"details|dialog|figcaption|figure|footer|header|hgroup|main|" +
4441
		"mark|meter|nav|output|picture|progress|section|summary|template|time|video";
4442
4443
4444
4445
function createSafeFragment( document ) {
4446
	var list = nodeNames.split( "|" ),
4447
		safeFrag = document.createDocumentFragment();
4448
4449
	if ( safeFrag.createElement ) {
4450
		while ( list.length ) {
4451
			safeFrag.createElement(
4452
				list.pop()
4453
			);
4454
		}
4455
	}
4456
	return safeFrag;
4457
}
4458
4459
4460
( function() {
4461
	var div = document.createElement( "div" ),
4462
		fragment = document.createDocumentFragment(),
4463
		input = document.createElement( "input" );
4464
4465
	// Setup
4466
	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4467
4468
	// IE strips leading whitespace when .innerHTML is used
4469
	support.leadingWhitespace = div.firstChild.nodeType === 3;
4470
4471
	// Make sure that tbody elements aren't automatically inserted
4472
	// IE will insert them into empty tables
4473
	support.tbody = !div.getElementsByTagName( "tbody" ).length;
4474
4475
	// Make sure that link elements get serialized correctly by innerHTML
4476
	// This requires a wrapper element in IE
4477
	support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4478
4479
	// Makes sure cloning an html5 element does not cause problems
4480
	// Where outerHTML is undefined, this still works
4481
	support.html5Clone =
4482
		document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4483
4484
	// Check if a disconnected checkbox will retain its checked
4485
	// value of true after appended to the DOM (IE6/7)
4486
	input.type = "checkbox";
4487
	input.checked = true;
4488
	fragment.appendChild( input );
4489
	support.appendChecked = input.checked;
4490
4491
	// Make sure textarea (and checkbox) defaultValue is properly cloned
4492
	// Support: IE6-IE11+
4493
	div.innerHTML = "<textarea>x</textarea>";
4494
	support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4495
4496
	// #11217 - WebKit loses check when the name is after the checked attribute
4497
	fragment.appendChild( div );
4498
4499
	// Support: Windows Web Apps (WWA)
4500
	// `name` and `type` must use .setAttribute for WWA (#14901)
4501
	input = document.createElement( "input" );
4502
	input.setAttribute( "type", "radio" );
4503
	input.setAttribute( "checked", "checked" );
4504
	input.setAttribute( "name", "t" );
4505
4506
	div.appendChild( input );
4507
4508
	// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4509
	// old WebKit doesn't clone checked state correctly in fragments
4510
	support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4511
4512
	// Support: IE<9
4513
	// Cloned elements keep attachEvent handlers, we use addEventListener on IE9+
4514
	support.noCloneEvent = !!div.addEventListener;
4515
4516
	// Support: IE<9
4517
	// Since attributes and properties are the same in IE,
4518
	// cleanData must set properties to undefined rather than use removeAttribute
4519
	div[ jQuery.expando ] = 1;
4520
	support.attributes = !div.getAttribute( jQuery.expando );
4521
} )();
4522
4523
4524
// We have to close these tags to support XHTML (#13200)
4525
var wrapMap = {
4526
	option: [ 1, "<select multiple='multiple'>", "</select>" ],
4527
	legend: [ 1, "<fieldset>", "</fieldset>" ],
4528
	area: [ 1, "<map>", "</map>" ],
4529
4530
	// Support: IE8
4531
	param: [ 1, "<object>", "</object>" ],
4532
	thead: [ 1, "<table>", "</table>" ],
4533
	tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4534
	col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
4535
	td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4536
4537
	// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
4538
	// unless wrapped in a div with non-breaking characters in front of it.
4539
	_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
4540
};
4541
4542
// Support: IE8-IE9
4543
wrapMap.optgroup = wrapMap.option;
4544
4545
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4546
wrapMap.th = wrapMap.td;
4547
4548
4549
function getAll( context, tag ) {
4550
	var elems, elem,
4551
		i = 0,
4552
		found = typeof context.getElementsByTagName !== "undefined" ?
4553
			context.getElementsByTagName( tag || "*" ) :
4554
			typeof context.querySelectorAll !== "undefined" ?
4555
				context.querySelectorAll( tag || "*" ) :
4556
				undefined;
4557
4558
	if ( !found ) {
4559
		for ( found = [], elems = context.childNodes || context;
4560
			( elem = elems[ i ] ) != null;
4561
			i++
4562
		) {
4563
			if ( !tag || jQuery.nodeName( elem, tag ) ) {
4564
				found.push( elem );
4565
			} else {
4566
				jQuery.merge( found, getAll( elem, tag ) );
4567
			}
4568
		}
4569
	}
4570
4571
	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4572
		jQuery.merge( [ context ], found ) :
4573
		found;
4574
}
4575
4576
4577
// Mark scripts as having already been evaluated
4578
function setGlobalEval( elems, refElements ) {
4579
	var elem,
4580
		i = 0;
4581
	for ( ; ( elem = elems[ i ] ) != null; i++ ) {
4582
		jQuery._data(
4583
			elem,
4584
			"globalEval",
4585
			!refElements || jQuery._data( refElements[ i ], "globalEval" )
4586
		);
4587
	}
4588
}
4589
4590
4591
var rhtml = /<|&#?\w+;/,
4592
	rtbody = /<tbody/i;
4593
4594
function fixDefaultChecked( elem ) {
4595
	if ( rcheckableType.test( elem.type ) ) {
4596
		elem.defaultChecked = elem.checked;
4597
	}
4598
}
4599
4600
function buildFragment( elems, context, scripts, selection, ignored ) {
4601
	var j, elem, contains,
4602
		tmp, tag, tbody, wrap,
4603
		l = elems.length,
4604
4605
		// Ensure a safe fragment
4606
		safe = createSafeFragment( context ),
4607
4608
		nodes = [],
4609
		i = 0;
4610
4611
	for ( ; i < l; i++ ) {
4612
		elem = elems[ i ];
4613
4614
		if ( elem || elem === 0 ) {
4615
4616
			// Add nodes directly
4617
			if ( jQuery.type( elem ) === "object" ) {
4618
				jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4619
4620
			// Convert non-html into a text node
4621
			} else if ( !rhtml.test( elem ) ) {
4622
				nodes.push( context.createTextNode( elem ) );
4623
4624
			// Convert html into DOM nodes
4625
			} else {
4626
				tmp = tmp || safe.appendChild( context.createElement( "div" ) );
4627
4628
				// Deserialize a standard representation
4629
				tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4630
				wrap = wrapMap[ tag ] || wrapMap._default;
4631
4632
				tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4633
4634
				// Descend through wrappers to the right content
4635
				j = wrap[ 0 ];
4636
				while ( j-- ) {
4637
					tmp = tmp.lastChild;
4638
				}
4639
4640
				// Manually add leading whitespace removed by IE
4641
				if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
4642
					nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) );
4643
				}
4644
4645
				// Remove IE's autoinserted <tbody> from table fragments
4646
				if ( !support.tbody ) {
4647
4648
					// String was a <table>, *may* have spurious <tbody>
4649
					elem = tag === "table" && !rtbody.test( elem ) ?
4650
						tmp.firstChild :
4651
4652
						// String was a bare <thead> or <tfoot>
4653
						wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ?
4654
							tmp :
4655
							0;
4656
4657
					j = elem && elem.childNodes.length;
4658
					while ( j-- ) {
4659
						if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) &&
4660
							!tbody.childNodes.length ) {
4661
4662
							elem.removeChild( tbody );
4663
						}
4664
					}
4665
				}
4666
4667
				jQuery.merge( nodes, tmp.childNodes );
4668
4669
				// Fix #12392 for WebKit and IE > 9
4670
				tmp.textContent = "";
4671
4672
				// Fix #12392 for oldIE
4673
				while ( tmp.firstChild ) {
4674
					tmp.removeChild( tmp.firstChild );
4675
				}
4676
4677
				// Remember the top-level container for proper cleanup
4678
				tmp = safe.lastChild;
4679
			}
4680
		}
4681
	}
4682
4683
	// Fix #11356: Clear elements from fragment
4684
	if ( tmp ) {
4685
		safe.removeChild( tmp );
4686
	}
4687
4688
	// Reset defaultChecked for any radios and checkboxes
4689
	// about to be appended to the DOM in IE 6/7 (#8060)
4690
	if ( !support.appendChecked ) {
4691
		jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
4692
	}
4693
4694
	i = 0;
4695
	while ( ( elem = nodes[ i++ ] ) ) {
4696
4697
		// Skip elements already in the context collection (trac-4087)
4698
		if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4699
			if ( ignored ) {
4700
				ignored.push( elem );
4701
			}
4702
4703
			continue;
4704
		}
4705
4706
		contains = jQuery.contains( elem.ownerDocument, elem );
4707
4708
		// Append to fragment
4709
		tmp = getAll( safe.appendChild( elem ), "script" );
4710
4711
		// Preserve script evaluation history
4712
		if ( contains ) {
4713
			setGlobalEval( tmp );
4714
		}
4715
4716
		// Capture executables
4717
		if ( scripts ) {
4718
			j = 0;
4719
			while ( ( elem = tmp[ j++ ] ) ) {
4720
				if ( rscriptType.test( elem.type || "" ) ) {
4721
					scripts.push( elem );
4722
				}
4723
			}
4724
		}
4725
	}
4726
4727
	tmp = null;
4728
4729
	return safe;
4730
}
4731
4732
4733
( function() {
4734
	var i, eventName,
4735
		div = document.createElement( "div" );
4736
4737
	// Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
4738
	for ( i in { submit: true, change: true, focusin: true } ) {
4739
		eventName = "on" + i;
4740
4741
		if ( !( support[ i ] = eventName in window ) ) {
4742
4743
			// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4744
			div.setAttribute( eventName, "t" );
4745
			support[ i ] = div.attributes[ eventName ].expando === false;
4746
		}
4747
	}
4748
4749
	// Null elements to avoid leaks in IE.
4750
	div = null;
4751
} )();
4752
4753
4754
var rformElems = /^(?:input|select|textarea)$/i,
4755
	rkeyEvent = /^key/,
4756
	rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4757
	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4758
	rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4759
4760
function returnTrue() {
4761
	return true;
4762
}
4763
4764
function returnFalse() {
4765
	return false;
4766
}
4767
4768
// Support: IE9
4769
// See #13393 for more info
4770
function safeActiveElement() {
4771
	try {
4772
		return document.activeElement;
4773
	} catch ( err ) { }
4774
}
4775
4776
function on( elem, types, selector, data, fn, one ) {
4777
	var origFn, type;
4778
4779
	// Types can be a map of types/handlers
4780
	if ( typeof types === "object" ) {
4781
4782
		// ( types-Object, selector, data )
4783
		if ( typeof selector !== "string" ) {
4784
4785
			// ( types-Object, data )
4786
			data = data || selector;
4787
			selector = undefined;
4788
		}
4789
		for ( type in types ) {
4790
			on( elem, type, selector, data, types[ type ], one );
4791
		}
4792
		return elem;
4793
	}
4794
4795
	if ( data == null && fn == null ) {
4796
4797
		// ( types, fn )
4798
		fn = selector;
4799
		data = selector = undefined;
4800
	} else if ( fn == null ) {
4801
		if ( typeof selector === "string" ) {
4802
4803
			// ( types, selector, fn )
4804
			fn = data;
4805
			data = undefined;
4806
		} else {
4807
4808
			// ( types, data, fn )
4809
			fn = data;
4810
			data = selector;
4811
			selector = undefined;
4812
		}
4813
	}
4814
	if ( fn === false ) {
4815
		fn = returnFalse;
4816
	} else if ( !fn ) {
4817
		return elem;
4818
	}
4819
4820
	if ( one === 1 ) {
4821
		origFn = fn;
4822
		fn = function( event ) {
4823
4824
			// Can use an empty set, since event contains the info
4825
			jQuery().off( event );
4826
			return origFn.apply( this, arguments );
4827
		};
4828
4829
		// Use same guid so caller can remove using origFn
4830
		fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4831
	}
4832
	return elem.each( function() {
4833
		jQuery.event.add( this, types, fn, data, selector );
4834
	} );
4835
}
4836
4837
/*
4838
 * Helper functions for managing events -- not part of the public interface.
4839
 * Props to Dean Edwards' addEvent library for many of the ideas.
4840
 */
4841
jQuery.event = {
4842
4843
	global: {},
4844
4845
	add: function( elem, types, handler, data, selector ) {
4846
		var tmp, events, t, handleObjIn,
4847
			special, eventHandle, handleObj,
4848
			handlers, type, namespaces, origType,
4849
			elemData = jQuery._data( elem );
4850
4851
		// Don't attach events to noData or text/comment nodes (but allow plain objects)
4852
		if ( !elemData ) {
4853
			return;
4854
		}
4855
4856
		// Caller can pass in an object of custom data in lieu of the handler
4857
		if ( handler.handler ) {
4858
			handleObjIn = handler;
4859
			handler = handleObjIn.handler;
4860
			selector = handleObjIn.selector;
4861
		}
4862
4863
		// Make sure that the handler has a unique ID, used to find/remove it later
4864
		if ( !handler.guid ) {
4865
			handler.guid = jQuery.guid++;
4866
		}
4867
4868
		// Init the element's event structure and main handler, if this is the first
4869
		if ( !( events = elemData.events ) ) {
4870
			events = elemData.events = {};
4871
		}
4872
		if ( !( eventHandle = elemData.handle ) ) {
4873
			eventHandle = elemData.handle = function( e ) {
4874
4875
				// Discard the second event of a jQuery.event.trigger() and
4876
				// when an event is called after a page has unloaded
4877
				return typeof jQuery !== "undefined" &&
4878
					( !e || jQuery.event.triggered !== e.type ) ?
4879
					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4880
					undefined;
4881
			};
4882
4883
			// Add elem as a property of the handle fn to prevent a memory leak
4884
			// with IE non-native events
4885
			eventHandle.elem = elem;
4886
		}
4887
4888
		// Handle multiple events separated by a space
4889
		types = ( types || "" ).match( rnotwhite ) || [ "" ];
4890
		t = types.length;
4891
		while ( t-- ) {
4892
			tmp = rtypenamespace.exec( types[ t ] ) || [];
4893
			type = origType = tmp[ 1 ];
4894
			namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
4895
4896
			// There *must* be a type, no attaching namespace-only handlers
4897
			if ( !type ) {
4898
				continue;
4899
			}
4900
4901
			// If event changes its type, use the special event handlers for the changed type
4902
			special = jQuery.event.special[ type ] || {};
4903
4904
			// If selector defined, determine special event api type, otherwise given type
4905
			type = ( selector ? special.delegateType : special.bindType ) || type;
4906
4907
			// Update special based on newly reset type
4908
			special = jQuery.event.special[ type ] || {};
4909
4910
			// handleObj is passed to all event handlers
4911
			handleObj = jQuery.extend( {
4912
				type: type,
4913
				origType: origType,
4914
				data: data,
4915
				handler: handler,
4916
				guid: handler.guid,
4917
				selector: selector,
4918
				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4919
				namespace: namespaces.join( "." )
4920
			}, handleObjIn );
4921
4922
			// Init the event handler queue if we're the first
4923
			if ( !( handlers = events[ type ] ) ) {
4924
				handlers = events[ type ] = [];
4925
				handlers.delegateCount = 0;
4926
4927
				// Only use addEventListener/attachEvent if the special events handler returns false
4928
				if ( !special.setup ||
4929
					special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4930
4931
					// Bind the global event handler to the element
4932
					if ( elem.addEventListener ) {
4933
						elem.addEventListener( type, eventHandle, false );
4934
4935
					} else if ( elem.attachEvent ) {
4936
						elem.attachEvent( "on" + type, eventHandle );
4937
					}
4938
				}
4939
			}
4940
4941
			if ( special.add ) {
4942
				special.add.call( elem, handleObj );
4943
4944
				if ( !handleObj.handler.guid ) {
4945
					handleObj.handler.guid = handler.guid;
4946
				}
4947
			}
4948
4949
			// Add to the element's handler list, delegates in front
4950
			if ( selector ) {
4951
				handlers.splice( handlers.delegateCount++, 0, handleObj );
4952
			} else {
4953
				handlers.push( handleObj );
4954
			}
4955
4956
			// Keep track of which events have ever been used, for event optimization
4957
			jQuery.event.global[ type ] = true;
4958
		}
4959
4960
		// Nullify elem to prevent memory leaks in IE
4961
		elem = null;
4962
	},
4963
4964
	// Detach an event or set of events from an element
4965
	remove: function( elem, types, handler, selector, mappedTypes ) {
4966
		var j, handleObj, tmp,
4967
			origCount, t, events,
4968
			special, handlers, type,
4969
			namespaces, origType,
4970
			elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4971
4972
		if ( !elemData || !( events = elemData.events ) ) {
4973
			return;
4974
		}
4975
4976
		// Once for each type.namespace in types; type may be omitted
4977
		types = ( types || "" ).match( rnotwhite ) || [ "" ];
4978
		t = types.length;
4979
		while ( t-- ) {
4980
			tmp = rtypenamespace.exec( types[ t ] ) || [];
4981
			type = origType = tmp[ 1 ];
4982
			namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
4983
4984
			// Unbind all events (on this namespace, if provided) for the element
4985
			if ( !type ) {
4986
				for ( type in events ) {
4987
					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4988
				}
4989
				continue;
4990
			}
4991
4992
			special = jQuery.event.special[ type ] || {};
4993
			type = ( selector ? special.delegateType : special.bindType ) || type;
4994
			handlers = events[ type ] || [];
4995
			tmp = tmp[ 2 ] &&
4996
				new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
4997
4998
			// Remove matching events
4999
			origCount = j = handlers.length;
5000
			while ( j-- ) {
5001
				handleObj = handlers[ j ];
5002
5003
				if ( ( mappedTypes || origType === handleObj.origType ) &&
5004
					( !handler || handler.guid === handleObj.guid ) &&
5005
					( !tmp || tmp.test( handleObj.namespace ) ) &&
5006
					( !selector || selector === handleObj.selector ||
5007
						selector === "**" && handleObj.selector ) ) {
5008
					handlers.splice( j, 1 );
5009
5010
					if ( handleObj.selector ) {
5011
						handlers.delegateCount--;
5012
					}
5013
					if ( special.remove ) {
5014
						special.remove.call( elem, handleObj );
5015
					}
5016
				}
5017
			}
5018
5019
			// Remove generic event handler if we removed something and no more handlers exist
5020
			// (avoids potential for endless recursion during removal of special event handlers)
5021
			if ( origCount && !handlers.length ) {
5022
				if ( !special.teardown ||
5023
					special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5024
5025
					jQuery.removeEvent( elem, type, elemData.handle );
5026
				}
5027
5028
				delete events[ type ];
5029
			}
5030
		}
5031
5032
		// Remove the expando if it's no longer used
5033
		if ( jQuery.isEmptyObject( events ) ) {
5034
			delete elemData.handle;
5035
5036
			// removeData also checks for emptiness and clears the expando if empty
5037
			// so use it instead of delete
5038
			jQuery._removeData( elem, "events" );
5039
		}
5040
	},
5041
5042
	trigger: function( event, data, elem, onlyHandlers ) {
5043
		var handle, ontype, cur,
5044
			bubbleType, special, tmp, i,
5045
			eventPath = [ elem || document ],
5046
			type = hasOwn.call( event, "type" ) ? event.type : event,
5047
			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
5048
5049
		cur = tmp = elem = elem || document;
5050
5051
		// Don't do events on text and comment nodes
5052
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
5053
			return;
5054
		}
5055
5056
		// focus/blur morphs to focusin/out; ensure we're not firing them right now
5057
		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
5058
			return;
5059
		}
5060
5061
		if ( type.indexOf( "." ) > -1 ) {
5062
5063
			// Namespaced trigger; create a regexp to match event type in handle()
5064
			namespaces = type.split( "." );
5065
			type = namespaces.shift();
5066
			namespaces.sort();
5067
		}
5068
		ontype = type.indexOf( ":" ) < 0 && "on" + type;
5069
5070
		// Caller can pass in a jQuery.Event object, Object, or just an event type string
5071
		event = event[ jQuery.expando ] ?
5072
			event :
5073
			new jQuery.Event( type, typeof event === "object" && event );
5074
5075
		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
5076
		event.isTrigger = onlyHandlers ? 2 : 3;
5077
		event.namespace = namespaces.join( "." );
5078
		event.rnamespace = event.namespace ?
5079
			new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
5080
			null;
5081
5082
		// Clean up the event in case it is being reused
5083
		event.result = undefined;
5084
		if ( !event.target ) {
5085
			event.target = elem;
5086
		}
5087
5088
		// Clone any incoming data and prepend the event, creating the handler arg list
5089
		data = data == null ?
5090
			[ event ] :
5091
			jQuery.makeArray( data, [ event ] );
5092
5093
		// Allow special events to draw outside the lines
5094
		special = jQuery.event.special[ type ] || {};
5095
		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
5096
			return;
5097
		}
5098
5099
		// Determine event propagation path in advance, per W3C events spec (#9951)
5100
		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
5101
		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
5102
5103
			bubbleType = special.delegateType || type;
5104
			if ( !rfocusMorph.test( bubbleType + type ) ) {
5105
				cur = cur.parentNode;
5106
			}
5107
			for ( ; cur; cur = cur.parentNode ) {
5108
				eventPath.push( cur );
5109
				tmp = cur;
5110
			}
5111
5112
			// Only add window if we got to document (e.g., not plain obj or detached DOM)
5113
			if ( tmp === ( elem.ownerDocument || document ) ) {
5114
				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
5115
			}
5116
		}
5117
5118
		// Fire handlers on the event path
5119
		i = 0;
5120
		while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
5121
5122
			event.type = i > 1 ?
5123
				bubbleType :
5124
				special.bindType || type;
5125
5126
			// jQuery handler
5127
			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] &&
5128
				jQuery._data( cur, "handle" );
5129
5130
			if ( handle ) {
5131
				handle.apply( cur, data );
5132
			}
5133
5134
			// Native handler
5135
			handle = ontype && cur[ ontype ];
5136
			if ( handle && handle.apply && acceptData( cur ) ) {
5137
				event.result = handle.apply( cur, data );
5138
				if ( event.result === false ) {
5139
					event.preventDefault();
5140
				}
5141
			}
5142
		}
5143
		event.type = type;
5144
5145
		// If nobody prevented the default action, do it now
5146
		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
5147
5148
			if (
5149
				( !special._default ||
5150
				 special._default.apply( eventPath.pop(), data ) === false
5151
				) && acceptData( elem )
5152
			) {
5153
5154
				// Call a native DOM method on the target with the same name name as the event.
5155
				// Can't use an .isFunction() check here because IE6/7 fails that test.
5156
				// Don't do default actions on window, that's where global variables be (#6170)
5157
				if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
5158
5159
					// Don't re-trigger an onFOO event when we call its FOO() method
5160
					tmp = elem[ ontype ];
5161
5162
					if ( tmp ) {
5163
						elem[ ontype ] = null;
5164
					}
5165
5166
					// Prevent re-triggering of the same event, since we already bubbled it above
5167
					jQuery.event.triggered = type;
5168
					try {
5169
						elem[ type ]();
5170
					} catch ( e ) {
5171
5172
						// IE<9 dies on focus/blur to hidden element (#1486,#12518)
5173
						// only reproducible on winXP IE8 native, not IE9 in IE8 mode
5174
					}
5175
					jQuery.event.triggered = undefined;
5176
5177
					if ( tmp ) {
5178
						elem[ ontype ] = tmp;
5179
					}
5180
				}
5181
			}
5182
		}
5183
5184
		return event.result;
5185
	},
5186
5187
	dispatch: function( event ) {
5188
5189
		// Make a writable jQuery.Event from the native event object
5190
		event = jQuery.event.fix( event );
5191
5192
		var i, j, ret, matched, handleObj,
5193
			handlerQueue = [],
5194
			args = slice.call( arguments ),
5195
			handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
5196
			special = jQuery.event.special[ event.type ] || {};
5197
5198
		// Use the fix-ed jQuery.Event rather than the (read-only) native event
5199
		args[ 0 ] = event;
5200
		event.delegateTarget = this;
5201
5202
		// Call the preDispatch hook for the mapped type, and let it bail if desired
5203
		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5204
			return;
5205
		}
5206
5207
		// Determine handlers
5208
		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5209
5210
		// Run delegates first; they may want to stop propagation beneath us
5211
		i = 0;
5212
		while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5213
			event.currentTarget = matched.elem;
5214
5215
			j = 0;
5216
			while ( ( handleObj = matched.handlers[ j++ ] ) &&
5217
				!event.isImmediatePropagationStopped() ) {
5218
5219
				// Triggered event must either 1) have no namespace, or 2) have namespace(s)
5220
				// a subset or equal to those in the bound event (both can have no namespace).
5221
				if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
5222
5223
					event.handleObj = handleObj;
5224
					event.data = handleObj.data;
5225
5226
					ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5227
						handleObj.handler ).apply( matched.elem, args );
5228
5229
					if ( ret !== undefined ) {
5230
						if ( ( event.result = ret ) === false ) {
5231
							event.preventDefault();
5232
							event.stopPropagation();
5233
						}
5234
					}
5235
				}
5236
			}
5237
		}
5238
5239
		// Call the postDispatch hook for the mapped type
5240
		if ( special.postDispatch ) {
5241
			special.postDispatch.call( this, event );
5242
		}
5243
5244
		return event.result;
5245
	},
5246
5247
	handlers: function( event, handlers ) {
5248
		var i, matches, sel, handleObj,
5249
			handlerQueue = [],
5250
			delegateCount = handlers.delegateCount,
5251
			cur = event.target;
5252
5253
		// Support (at least): Chrome, IE9
5254
		// Find delegate handlers
5255
		// Black-hole SVG <use> instance trees (#13180)
5256
		//
5257
		// Support: Firefox<=42+
5258
		// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
5259
		if ( delegateCount && cur.nodeType &&
5260
			( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
5261
5262
			/* jshint eqeqeq: false */
5263
			for ( ; cur != this; cur = cur.parentNode || this ) {
5264
				/* jshint eqeqeq: true */
5265
5266
				// Don't check non-elements (#13208)
5267
				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5268
				if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
5269
					matches = [];
5270
					for ( i = 0; i < delegateCount; i++ ) {
5271
						handleObj = handlers[ i ];
5272
5273
						// Don't conflict with Object.prototype properties (#13203)
5274
						sel = handleObj.selector + " ";
5275
5276
						if ( matches[ sel ] === undefined ) {
5277
							matches[ sel ] = handleObj.needsContext ?
5278
								jQuery( sel, this ).index( cur ) > -1 :
5279
								jQuery.find( sel, this, null, [ cur ] ).length;
5280
						}
5281
						if ( matches[ sel ] ) {
5282
							matches.push( handleObj );
5283
						}
5284
					}
5285
					if ( matches.length ) {
5286
						handlerQueue.push( { elem: cur, handlers: matches } );
5287
					}
5288
				}
5289
			}
5290
		}
5291
5292
		// Add the remaining (directly-bound) handlers
5293
		if ( delegateCount < handlers.length ) {
5294
			handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
5295
		}
5296
5297
		return handlerQueue;
5298
	},
5299
5300
	fix: function( event ) {
5301
		if ( event[ jQuery.expando ] ) {
5302
			return event;
5303
		}
5304
5305
		// Create a writable copy of the event object and normalize some properties
5306
		var i, prop, copy,
5307
			type = event.type,
5308
			originalEvent = event,
5309
			fixHook = this.fixHooks[ type ];
5310
5311
		if ( !fixHook ) {
5312
			this.fixHooks[ type ] = fixHook =
5313
				rmouseEvent.test( type ) ? this.mouseHooks :
5314
				rkeyEvent.test( type ) ? this.keyHooks :
5315
				{};
5316
		}
5317
		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
5318
5319
		event = new jQuery.Event( originalEvent );
5320
5321
		i = copy.length;
5322
		while ( i-- ) {
5323
			prop = copy[ i ];
5324
			event[ prop ] = originalEvent[ prop ];
5325
		}
5326
5327
		// Support: IE<9
5328
		// Fix target property (#1925)
5329
		if ( !event.target ) {
5330
			event.target = originalEvent.srcElement || document;
5331
		}
5332
5333
		// Support: Safari 6-8+
5334
		// Target should not be a text node (#504, #13143)
5335
		if ( event.target.nodeType === 3 ) {
5336
			event.target = event.target.parentNode;
5337
		}
5338
5339
		// Support: IE<9
5340
		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
5341
		event.metaKey = !!event.metaKey;
5342
5343
		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
5344
	},
5345
5346
	// Includes some event props shared by KeyEvent and MouseEvent
5347
	props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
5348
		"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
5349
5350
	fixHooks: {},
5351
5352
	keyHooks: {
5353
		props: "char charCode key keyCode".split( " " ),
5354
		filter: function( event, original ) {
5355
5356
			// Add which for key events
5357
			if ( event.which == null ) {
5358
				event.which = original.charCode != null ? original.charCode : original.keyCode;
5359
			}
5360
5361
			return event;
5362
		}
5363
	},
5364
5365
	mouseHooks: {
5366
		props: ( "button buttons clientX clientY fromElement offsetX offsetY " +
5367
			"pageX pageY screenX screenY toElement" ).split( " " ),
5368
		filter: function( event, original ) {
5369
			var body, eventDoc, doc,
5370
				button = original.button,
5371
				fromElement = original.fromElement;
5372
5373
			// Calculate pageX/Y if missing and clientX/Y available
5374
			if ( event.pageX == null && original.clientX != null ) {
5375
				eventDoc = event.target.ownerDocument || document;
5376
				doc = eventDoc.documentElement;
5377
				body = eventDoc.body;
5378
5379
				event.pageX = original.clientX +
5380
					( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
5381
					( doc && doc.clientLeft || body && body.clientLeft || 0 );
5382
				event.pageY = original.clientY +
5383
					( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) -
5384
					( doc && doc.clientTop  || body && body.clientTop  || 0 );
5385
			}
5386
5387
			// Add relatedTarget, if necessary
5388
			if ( !event.relatedTarget && fromElement ) {
5389
				event.relatedTarget = fromElement === event.target ?
5390
					original.toElement :
5391
					fromElement;
5392
			}
5393
5394
			// Add which for click: 1 === left; 2 === middle; 3 === right
5395
			// Note: button is not normalized, so don't use it
5396
			if ( !event.which && button !== undefined ) {
5397
				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
5398
			}
5399
5400
			return event;
5401
		}
5402
	},
5403
5404
	special: {
5405
		load: {
5406
5407
			// Prevent triggered image.load events from bubbling to window.load
5408
			noBubble: true
5409
		},
5410
		focus: {
5411
5412
			// Fire native event if possible so blur/focus sequence is correct
5413
			trigger: function() {
5414
				if ( this !== safeActiveElement() && this.focus ) {
5415
					try {
5416
						this.focus();
5417
						return false;
5418
					} catch ( e ) {
5419
5420
						// Support: IE<9
5421
						// If we error on focus to hidden element (#1486, #12518),
5422
						// let .trigger() run the handlers
5423
					}
5424
				}
5425
			},
5426
			delegateType: "focusin"
5427
		},
5428
		blur: {
5429
			trigger: function() {
5430
				if ( this === safeActiveElement() && this.blur ) {
5431
					this.blur();
5432
					return false;
5433
				}
5434
			},
5435
			delegateType: "focusout"
5436
		},
5437
		click: {
5438
5439
			// For checkbox, fire native event so checked state will be right
5440
			trigger: function() {
5441
				if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
5442
					this.click();
5443
					return false;
5444
				}
5445
			},
5446
5447
			// For cross-browser consistency, don't fire native .click() on links
5448
			_default: function( event ) {
5449
				return jQuery.nodeName( event.target, "a" );
5450
			}
5451
		},
5452
5453
		beforeunload: {
5454
			postDispatch: function( event ) {
5455
5456
				// Support: Firefox 20+
5457
				// Firefox doesn't alert if the returnValue field is not set.
5458
				if ( event.result !== undefined && event.originalEvent ) {
5459
					event.originalEvent.returnValue = event.result;
5460
				}
5461
			}
5462
		}
5463
	},
5464
5465
	// Piggyback on a donor event to simulate a different one
5466
	simulate: function( type, elem, event ) {
5467
		var e = jQuery.extend(
5468
			new jQuery.Event(),
5469
			event,
5470
			{
5471
				type: type,
5472
				isSimulated: true
5473
5474
				// Previously, `originalEvent: {}` was set here, so stopPropagation call
5475
				// would not be triggered on donor event, since in our own
5476
				// jQuery.event.stopPropagation function we had a check for existence of
5477
				// originalEvent.stopPropagation method, so, consequently it would be a noop.
5478
				//
5479
				// Guard for simulated events was moved to jQuery.event.stopPropagation function
5480
				// since `originalEvent` should point to the original event for the
5481
				// constancy with other events and for more focused logic
5482
			}
5483
		);
5484
5485
		jQuery.event.trigger( e, null, elem );
5486
5487
		if ( e.isDefaultPrevented() ) {
5488
			event.preventDefault();
5489
		}
5490
	}
5491
};
5492
5493
jQuery.removeEvent = document.removeEventListener ?
5494
	function( elem, type, handle ) {
5495
5496
		// This "if" is needed for plain objects
5497
		if ( elem.removeEventListener ) {
5498
			elem.removeEventListener( type, handle );
5499
		}
5500
	} :
5501
	function( elem, type, handle ) {
5502
		var name = "on" + type;
5503
5504
		if ( elem.detachEvent ) {
5505
5506
			// #8545, #7054, preventing memory leaks for custom events in IE6-8
5507
			// detachEvent needed property on element, by name of that event,
5508
			// to properly expose it to GC
5509
			if ( typeof elem[ name ] === "undefined" ) {
5510
				elem[ name ] = null;
5511
			}
5512
5513
			elem.detachEvent( name, handle );
5514
		}
5515
	};
5516
5517
jQuery.Event = function( src, props ) {
5518
5519
	// Allow instantiation without the 'new' keyword
5520
	if ( !( this instanceof jQuery.Event ) ) {
5521
		return new jQuery.Event( src, props );
5522
	}
5523
5524
	// Event object
5525
	if ( src && src.type ) {
5526
		this.originalEvent = src;
5527
		this.type = src.type;
5528
5529
		// Events bubbling up the document may have been marked as prevented
5530
		// by a handler lower down the tree; reflect the correct value.
5531
		this.isDefaultPrevented = src.defaultPrevented ||
5532
				src.defaultPrevented === undefined &&
5533
5534
				// Support: IE < 9, Android < 4.0
5535
				src.returnValue === false ?
5536
			returnTrue :
5537
			returnFalse;
5538
5539
	// Event type
5540
	} else {
5541
		this.type = src;
5542
	}
5543
5544
	// Put explicitly provided properties onto the event object
5545
	if ( props ) {
5546
		jQuery.extend( this, props );
5547
	}
5548
5549
	// Create a timestamp if incoming event doesn't have one
5550
	this.timeStamp = src && src.timeStamp || jQuery.now();
5551
5552
	// Mark it as fixed
5553
	this[ jQuery.expando ] = true;
5554
};
5555
5556
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5557
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5558
jQuery.Event.prototype = {
5559
	constructor: jQuery.Event,
5560
	isDefaultPrevented: returnFalse,
5561
	isPropagationStopped: returnFalse,
5562
	isImmediatePropagationStopped: returnFalse,
5563
5564
	preventDefault: function() {
5565
		var e = this.originalEvent;
5566
5567
		this.isDefaultPrevented = returnTrue;
5568
		if ( !e ) {
5569
			return;
5570
		}
5571
5572
		// If preventDefault exists, run it on the original event
5573
		if ( e.preventDefault ) {
5574
			e.preventDefault();
5575
5576
		// Support: IE
5577
		// Otherwise set the returnValue property of the original event to false
5578
		} else {
5579
			e.returnValue = false;
5580
		}
5581
	},
5582
	stopPropagation: function() {
5583
		var e = this.originalEvent;
5584
5585
		this.isPropagationStopped = returnTrue;
5586
5587
		if ( !e || this.isSimulated ) {
5588
			return;
5589
		}
5590
5591
		// If stopPropagation exists, run it on the original event
5592
		if ( e.stopPropagation ) {
5593
			e.stopPropagation();
5594
		}
5595
5596
		// Support: IE
5597
		// Set the cancelBubble property of the original event to true
5598
		e.cancelBubble = true;
5599
	},
5600
	stopImmediatePropagation: function() {
5601
		var e = this.originalEvent;
5602
5603
		this.isImmediatePropagationStopped = returnTrue;
5604
5605
		if ( e && e.stopImmediatePropagation ) {
5606
			e.stopImmediatePropagation();
5607
		}
5608
5609
		this.stopPropagation();
5610
	}
5611
};
5612
5613
// Create mouseenter/leave events using mouseover/out and event-time checks
5614
// so that event delegation works in jQuery.
5615
// Do the same for pointerenter/pointerleave and pointerover/pointerout
5616
//
5617
// Support: Safari 7 only
5618
// Safari sends mouseenter too often; see:
5619
// https://code.google.com/p/chromium/issues/detail?id=470258
5620
// for the description of the bug (it existed in older Chrome versions as well).
5621
jQuery.each( {
5622
	mouseenter: "mouseover",
5623
	mouseleave: "mouseout",
5624
	pointerenter: "pointerover",
5625
	pointerleave: "pointerout"
5626
}, function( orig, fix ) {
5627
	jQuery.event.special[ orig ] = {
5628
		delegateType: fix,
5629
		bindType: fix,
5630
5631
		handle: function( event ) {
5632
			var ret,
5633
				target = this,
5634
				related = event.relatedTarget,
5635
				handleObj = event.handleObj;
5636
5637
			// For mouseenter/leave call the handler if related is outside the target.
5638
			// NB: No relatedTarget if the mouse left/entered the browser window
5639
			if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5640
				event.type = handleObj.origType;
5641
				ret = handleObj.handler.apply( this, arguments );
5642
				event.type = fix;
5643
			}
5644
			return ret;
5645
		}
5646
	};
5647
} );
5648
5649
// IE submit delegation
5650
if ( !support.submit ) {
5651
5652
	jQuery.event.special.submit = {
5653
		setup: function() {
5654
5655
			// Only need this for delegated form submit events
5656
			if ( jQuery.nodeName( this, "form" ) ) {
5657
				return false;
5658
			}
5659
5660
			// Lazy-add a submit handler when a descendant form may potentially be submitted
5661
			jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5662
5663
				// Node name check avoids a VML-related crash in IE (#9807)
5664
				var elem = e.target,
5665
					form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ?
5666
5667
						// Support: IE <=8
5668
						// We use jQuery.prop instead of elem.form
5669
						// to allow fixing the IE8 delegated submit issue (gh-2332)
5670
						// by 3rd party polyfills/workarounds.
5671
						jQuery.prop( elem, "form" ) :
5672
						undefined;
5673
5674
				if ( form && !jQuery._data( form, "submit" ) ) {
5675
					jQuery.event.add( form, "submit._submit", function( event ) {
5676
						event._submitBubble = true;
5677
					} );
5678
					jQuery._data( form, "submit", true );
5679
				}
5680
			} );
5681
5682
			// return undefined since we don't need an event listener
5683
		},
5684
5685
		postDispatch: function( event ) {
5686
5687
			// If form was submitted by the user, bubble the event up the tree
5688
			if ( event._submitBubble ) {
5689
				delete event._submitBubble;
5690
				if ( this.parentNode && !event.isTrigger ) {
5691
					jQuery.event.simulate( "submit", this.parentNode, event );
5692
				}
5693
			}
5694
		},
5695
5696
		teardown: function() {
5697
5698
			// Only need this for delegated form submit events
5699
			if ( jQuery.nodeName( this, "form" ) ) {
5700
				return false;
5701
			}
5702
5703
			// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5704
			jQuery.event.remove( this, "._submit" );
5705
		}
5706
	};
5707
}
5708
5709
// IE change delegation and checkbox/radio fix
5710
if ( !support.change ) {
5711
5712
	jQuery.event.special.change = {
5713
5714
		setup: function() {
5715
5716
			if ( rformElems.test( this.nodeName ) ) {
5717
5718
				// IE doesn't fire change on a check/radio until blur; trigger it on click
5719
				// after a propertychange. Eat the blur-change in special.change.handle.
5720
				// This still fires onchange a second time for check/radio after blur.
5721
				if ( this.type === "checkbox" || this.type === "radio" ) {
5722
					jQuery.event.add( this, "propertychange._change", function( event ) {
5723
						if ( event.originalEvent.propertyName === "checked" ) {
5724
							this._justChanged = true;
5725
						}
5726
					} );
5727
					jQuery.event.add( this, "click._change", function( event ) {
5728
						if ( this._justChanged && !event.isTrigger ) {
5729
							this._justChanged = false;
5730
						}
5731
5732
						// Allow triggered, simulated change events (#11500)
5733
						jQuery.event.simulate( "change", this, event );
5734
					} );
5735
				}
5736
				return false;
5737
			}
5738
5739
			// Delegated event; lazy-add a change handler on descendant inputs
5740
			jQuery.event.add( this, "beforeactivate._change", function( e ) {
5741
				var elem = e.target;
5742
5743
				if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) {
5744
					jQuery.event.add( elem, "change._change", function( event ) {
5745
						if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5746
							jQuery.event.simulate( "change", this.parentNode, event );
5747
						}
5748
					} );
5749
					jQuery._data( elem, "change", true );
5750
				}
5751
			} );
5752
		},
5753
5754
		handle: function( event ) {
5755
			var elem = event.target;
5756
5757
			// Swallow native change events from checkbox/radio, we already triggered them above
5758
			if ( this !== elem || event.isSimulated || event.isTrigger ||
5759
				( elem.type !== "radio" && elem.type !== "checkbox" ) ) {
5760
5761
				return event.handleObj.handler.apply( this, arguments );
5762
			}
5763
		},
5764
5765
		teardown: function() {
5766
			jQuery.event.remove( this, "._change" );
5767
5768
			return !rformElems.test( this.nodeName );
5769
		}
5770
	};
5771
}
5772
5773
// Support: Firefox
5774
// Firefox doesn't have focus(in | out) events
5775
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
5776
//
5777
// Support: Chrome, Safari
5778
// focus(in | out) events fire after focus & blur events,
5779
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
5780
// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
5781
if ( !support.focusin ) {
5782
	jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5783
5784
		// Attach a single capturing handler on the document while someone wants focusin/focusout
5785
		var handler = function( event ) {
5786
			jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
5787
		};
5788
5789
		jQuery.event.special[ fix ] = {
5790
			setup: function() {
5791
				var doc = this.ownerDocument || this,
5792
					attaches = jQuery._data( doc, fix );
5793
5794
				if ( !attaches ) {
5795
					doc.addEventListener( orig, handler, true );
5796
				}
5797
				jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5798
			},
5799
			teardown: function() {
5800
				var doc = this.ownerDocument || this,
5801
					attaches = jQuery._data( doc, fix ) - 1;
5802
5803
				if ( !attaches ) {
5804
					doc.removeEventListener( orig, handler, true );
5805
					jQuery._removeData( doc, fix );
5806
				} else {
5807
					jQuery._data( doc, fix, attaches );
5808
				}
5809
			}
5810
		};
5811
	} );
5812
}
5813
5814
jQuery.fn.extend( {
5815
5816
	on: function( types, selector, data, fn ) {
5817
		return on( this, types, selector, data, fn );
5818
	},
5819
	one: function( types, selector, data, fn ) {
5820
		return on( this, types, selector, data, fn, 1 );
5821
	},
5822
	off: function( types, selector, fn ) {
5823
		var handleObj, type;
5824
		if ( types && types.preventDefault && types.handleObj ) {
5825
5826
			// ( event )  dispatched jQuery.Event
5827
			handleObj = types.handleObj;
5828
			jQuery( types.delegateTarget ).off(
5829
				handleObj.namespace ?
5830
					handleObj.origType + "." + handleObj.namespace :
5831
					handleObj.origType,
5832
				handleObj.selector,
5833
				handleObj.handler
5834
			);
5835
			return this;
5836
		}
5837
		if ( typeof types === "object" ) {
5838
5839
			// ( types-object [, selector] )
5840
			for ( type in types ) {
5841
				this.off( type, selector, types[ type ] );
5842
			}
5843
			return this;
5844
		}
5845
		if ( selector === false || typeof selector === "function" ) {
5846
5847
			// ( types [, fn] )
5848
			fn = selector;
5849
			selector = undefined;
5850
		}
5851
		if ( fn === false ) {
5852
			fn = returnFalse;
5853
		}
5854
		return this.each( function() {
5855
			jQuery.event.remove( this, types, fn, selector );
5856
		} );
5857
	},
5858
5859
	trigger: function( type, data ) {
5860
		return this.each( function() {
5861
			jQuery.event.trigger( type, data, this );
5862
		} );
5863
	},
5864
	triggerHandler: function( type, data ) {
5865
		var elem = this[ 0 ];
5866
		if ( elem ) {
5867
			return jQuery.event.trigger( type, data, elem, true );
5868
		}
5869
	}
5870
} );
5871
5872
5873
var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5874
	rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
5875
	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
5876
5877
	// Support: IE 10-11, Edge 10240+
5878
	// In IE/Edge using regex groups here causes severe slowdowns.
5879
	// See https://connect.microsoft.com/IE/feedback/details/1736512/
5880
	rnoInnerhtml = /<script|<style|<link/i,
5881
5882
	// checked="checked" or checked
5883
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5884
	rscriptTypeMasked = /^true\/(.*)/,
5885
	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5886
	safeFragment = createSafeFragment( document ),
5887
	fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) );
5888
5889
// Support: IE<8
5890
// Manipulating tables requires a tbody
5891
function manipulationTarget( elem, content ) {
5892
	return jQuery.nodeName( elem, "table" ) &&
5893
		jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5894
5895
		elem.getElementsByTagName( "tbody" )[ 0 ] ||
5896
			elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
5897
		elem;
5898
}
5899
5900
// Replace/restore the type attribute of script elements for safe DOM manipulation
5901
function disableScript( elem ) {
5902
	elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type;
5903
	return elem;
5904
}
5905
function restoreScript( elem ) {
5906
	var match = rscriptTypeMasked.exec( elem.type );
5907
	if ( match ) {
5908
		elem.type = match[ 1 ];
5909
	} else {
5910
		elem.removeAttribute( "type" );
5911
	}
5912
	return elem;
5913
}
5914
5915
function cloneCopyEvent( src, dest ) {
5916
	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5917
		return;
5918
	}
5919
5920
	var type, i, l,
5921
		oldData = jQuery._data( src ),
5922
		curData = jQuery._data( dest, oldData ),
5923
		events = oldData.events;
5924
5925
	if ( events ) {
5926
		delete curData.handle;
5927
		curData.events = {};
5928
5929
		for ( type in events ) {
5930
			for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5931
				jQuery.event.add( dest, type, events[ type ][ i ] );
5932
			}
5933
		}
5934
	}
5935
5936
	// make the cloned public data object a copy from the original
5937
	if ( curData.data ) {
5938
		curData.data = jQuery.extend( {}, curData.data );
5939
	}
5940
}
5941
5942
function fixCloneNodeIssues( src, dest ) {
5943
	var nodeName, e, data;
5944
5945
	// We do not need to do anything for non-Elements
5946
	if ( dest.nodeType !== 1 ) {
5947
		return;
5948
	}
5949
5950
	nodeName = dest.nodeName.toLowerCase();
5951
5952
	// IE6-8 copies events bound via attachEvent when using cloneNode.
5953
	if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5954
		data = jQuery._data( dest );
5955
5956
		for ( e in data.events ) {
5957
			jQuery.removeEvent( dest, e, data.handle );
5958
		}
5959
5960
		// Event data gets referenced instead of copied if the expando gets copied too
5961
		dest.removeAttribute( jQuery.expando );
5962
	}
5963
5964
	// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5965
	if ( nodeName === "script" && dest.text !== src.text ) {
5966
		disableScript( dest ).text = src.text;
5967
		restoreScript( dest );
5968
5969
	// IE6-10 improperly clones children of object elements using classid.
5970
	// IE10 throws NoModificationAllowedError if parent is null, #12132.
5971
	} else if ( nodeName === "object" ) {
5972
		if ( dest.parentNode ) {
5973
			dest.outerHTML = src.outerHTML;
5974
		}
5975
5976
		// This path appears unavoidable for IE9. When cloning an object
5977
		// element in IE9, the outerHTML strategy above is not sufficient.
5978
		// If the src has innerHTML and the destination does not,
5979
		// copy the src.innerHTML into the dest.innerHTML. #10324
5980
		if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) {
5981
			dest.innerHTML = src.innerHTML;
5982
		}
5983
5984
	} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5985
5986
		// IE6-8 fails to persist the checked state of a cloned checkbox
5987
		// or radio button. Worse, IE6-7 fail to give the cloned element
5988
		// a checked appearance if the defaultChecked value isn't also set
5989
5990
		dest.defaultChecked = dest.checked = src.checked;
5991
5992
		// IE6-7 get confused and end up setting the value of a cloned
5993
		// checkbox/radio button to an empty string instead of "on"
5994
		if ( dest.value !== src.value ) {
5995
			dest.value = src.value;
5996
		}
5997
5998
	// IE6-8 fails to return the selected option to the default selected
5999
	// state when cloning options
6000
	} else if ( nodeName === "option" ) {
6001
		dest.defaultSelected = dest.selected = src.defaultSelected;
6002
6003
	// IE6-8 fails to set the defaultValue to the correct value when
6004
	// cloning other types of input fields
6005
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
6006
		dest.defaultValue = src.defaultValue;
6007
	}
6008
}
6009
6010
function domManip( collection, args, callback, ignored ) {
6011
6012
	// Flatten any nested arrays
6013
	args = concat.apply( [], args );
6014
6015
	var first, node, hasScripts,
6016
		scripts, doc, fragment,
6017
		i = 0,
6018
		l = collection.length,
6019
		iNoClone = l - 1,
6020
		value = args[ 0 ],
6021
		isFunction = jQuery.isFunction( value );
6022
6023
	// We can't cloneNode fragments that contain checked, in WebKit
6024
	if ( isFunction ||
6025
			( l > 1 && typeof value === "string" &&
6026
				!support.checkClone && rchecked.test( value ) ) ) {
6027
		return collection.each( function( index ) {
6028
			var self = collection.eq( index );
6029
			if ( isFunction ) {
6030
				args[ 0 ] = value.call( this, index, self.html() );
6031
			}
6032
			domManip( self, args, callback, ignored );
6033
		} );
6034
	}
6035
6036
	if ( l ) {
6037
		fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
6038
		first = fragment.firstChild;
6039
6040
		if ( fragment.childNodes.length === 1 ) {
6041
			fragment = first;
6042
		}
6043
6044
		// Require either new content or an interest in ignored elements to invoke the callback
6045
		if ( first || ignored ) {
6046
			scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6047
			hasScripts = scripts.length;
6048
6049
			// Use the original fragment for the last item
6050
			// instead of the first because it can end up
6051
			// being emptied incorrectly in certain situations (#8070).
6052
			for ( ; i < l; i++ ) {
6053
				node = fragment;
6054
6055
				if ( i !== iNoClone ) {
6056
					node = jQuery.clone( node, true, true );
6057
6058
					// Keep references to cloned scripts for later restoration
6059
					if ( hasScripts ) {
6060
6061
						// Support: Android<4.1, PhantomJS<2
6062
						// push.apply(_, arraylike) throws on ancient WebKit
6063
						jQuery.merge( scripts, getAll( node, "script" ) );
6064
					}
6065
				}
6066
6067
				callback.call( collection[ i ], node, i );
6068
			}
6069
6070
			if ( hasScripts ) {
6071
				doc = scripts[ scripts.length - 1 ].ownerDocument;
6072
6073
				// Reenable scripts
6074
				jQuery.map( scripts, restoreScript );
6075
6076
				// Evaluate executable scripts on first document insertion
6077
				for ( i = 0; i < hasScripts; i++ ) {
6078
					node = scripts[ i ];
6079
					if ( rscriptType.test( node.type || "" ) &&
6080
						!jQuery._data( node, "globalEval" ) &&
6081
						jQuery.contains( doc, node ) ) {
6082
6083
						if ( node.src ) {
6084
6085
							// Optional AJAX dependency, but won't run scripts if not present
6086
							if ( jQuery._evalUrl ) {
6087
								jQuery._evalUrl( node.src );
6088
							}
6089
						} else {
6090
							jQuery.globalEval(
6091
								( node.text || node.textContent || node.innerHTML || "" )
6092
									.replace( rcleanScript, "" )
6093
							);
6094
						}
6095
					}
6096
				}
6097
			}
6098
6099
			// Fix #11809: Avoid leaking memory
6100
			fragment = first = null;
6101
		}
6102
	}
6103
6104
	return collection;
6105
}
6106
6107
function remove( elem, selector, keepData ) {
6108
	var node,
6109
		elems = selector ? jQuery.filter( selector, elem ) : elem,
6110
		i = 0;
6111
6112
	for ( ; ( node = elems[ i ] ) != null; i++ ) {
6113
6114
		if ( !keepData && node.nodeType === 1 ) {
6115
			jQuery.cleanData( getAll( node ) );
6116
		}
6117
6118
		if ( node.parentNode ) {
6119
			if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
6120
				setGlobalEval( getAll( node, "script" ) );
6121
			}
6122
			node.parentNode.removeChild( node );
6123
		}
6124
	}
6125
6126
	return elem;
6127
}
6128
6129
jQuery.extend( {
6130
	htmlPrefilter: function( html ) {
6131
		return html.replace( rxhtmlTag, "<$1></$2>" );
6132
	},
6133
6134
	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6135
		var destElements, node, clone, i, srcElements,
6136
			inPage = jQuery.contains( elem.ownerDocument, elem );
6137
6138
		if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
6139
			!rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
6140
6141
			clone = elem.cloneNode( true );
6142
6143
		// IE<=8 does not properly clone detached, unknown element nodes
6144
		} else {
6145
			fragmentDiv.innerHTML = elem.outerHTML;
6146
			fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
6147
		}
6148
6149
		if ( ( !support.noCloneEvent || !support.noCloneChecked ) &&
6150
				( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
6151
6152
			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
6153
			destElements = getAll( clone );
6154
			srcElements = getAll( elem );
6155
6156
			// Fix all IE cloning issues
6157
			for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) {
6158
6159
				// Ensure that the destination node is not null; Fixes #9587
6160
				if ( destElements[ i ] ) {
6161
					fixCloneNodeIssues( node, destElements[ i ] );
6162
				}
6163
			}
6164
		}
6165
6166
		// Copy the events from the original to the clone
6167
		if ( dataAndEvents ) {
6168
			if ( deepDataAndEvents ) {
6169
				srcElements = srcElements || getAll( elem );
6170
				destElements = destElements || getAll( clone );
6171
6172
				for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
6173
					cloneCopyEvent( node, destElements[ i ] );
6174
				}
6175
			} else {
6176
				cloneCopyEvent( elem, clone );
6177
			}
6178
		}
6179
6180
		// Preserve script evaluation history
6181
		destElements = getAll( clone, "script" );
6182
		if ( destElements.length > 0 ) {
6183
			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6184
		}
6185
6186
		destElements = srcElements = node = null;
6187
6188
		// Return the cloned set
6189
		return clone;
6190
	},
6191
6192
	cleanData: function( elems, /* internal */ forceAcceptData ) {
6193
		var elem, type, id, data,
6194
			i = 0,
6195
			internalKey = jQuery.expando,
6196
			cache = jQuery.cache,
6197
			attributes = support.attributes,
6198
			special = jQuery.event.special;
6199
6200
		for ( ; ( elem = elems[ i ] ) != null; i++ ) {
6201
			if ( forceAcceptData || acceptData( elem ) ) {
6202
6203
				id = elem[ internalKey ];
6204
				data = id && cache[ id ];
6205
6206
				if ( data ) {
6207
					if ( data.events ) {
6208
						for ( type in data.events ) {
6209
							if ( special[ type ] ) {
6210
								jQuery.event.remove( elem, type );
6211
6212
							// This is a shortcut to avoid jQuery.event.remove's overhead
6213
							} else {
6214
								jQuery.removeEvent( elem, type, data.handle );
6215
							}
6216
						}
6217
					}
6218
6219
					// Remove cache only if it was not already removed by jQuery.event.remove
6220
					if ( cache[ id ] ) {
6221
6222
						delete cache[ id ];
6223
6224
						// Support: IE<9
6225
						// IE does not allow us to delete expando properties from nodes
6226
						// IE creates expando attributes along with the property
6227
						// IE does not have a removeAttribute function on Document nodes
6228
						if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
6229
							elem.removeAttribute( internalKey );
6230
6231
						// Webkit & Blink performance suffers when deleting properties
6232
						// from DOM nodes, so set to undefined instead
6233
						// https://code.google.com/p/chromium/issues/detail?id=378607
6234
						} else {
6235
							elem[ internalKey ] = undefined;
6236
						}
6237
6238
						deletedIds.push( id );
6239
					}
6240
				}
6241
			}
6242
		}
6243
	}
6244
} );
6245
6246
jQuery.fn.extend( {
6247
6248
	// Keep domManip exposed until 3.0 (gh-2225)
6249
	domManip: domManip,
6250
6251
	detach: function( selector ) {
6252
		return remove( this, selector, true );
6253
	},
6254
6255
	remove: function( selector ) {
6256
		return remove( this, selector );
6257
	},
6258
6259
	text: function( value ) {
6260
		return access( this, function( value ) {
6261
			return value === undefined ?
6262
				jQuery.text( this ) :
6263
				this.empty().append(
6264
					( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value )
6265
				);
6266
		}, null, value, arguments.length );
6267
	},
6268
6269
	append: function() {
6270
		return domManip( this, arguments, function( elem ) {
6271
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6272
				var target = manipulationTarget( this, elem );
6273
				target.appendChild( elem );
6274
			}
6275
		} );
6276
	},
6277
6278
	prepend: function() {
6279
		return domManip( this, arguments, function( elem ) {
6280
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6281
				var target = manipulationTarget( this, elem );
6282
				target.insertBefore( elem, target.firstChild );
6283
			}
6284
		} );
6285
	},
6286
6287
	before: function() {
6288
		return domManip( this, arguments, function( elem ) {
6289
			if ( this.parentNode ) {
6290
				this.parentNode.insertBefore( elem, this );
6291
			}
6292
		} );
6293
	},
6294
6295
	after: function() {
6296
		return domManip( this, arguments, function( elem ) {
6297
			if ( this.parentNode ) {
6298
				this.parentNode.insertBefore( elem, this.nextSibling );
6299
			}
6300
		} );
6301
	},
6302
6303
	empty: function() {
6304
		var elem,
6305
			i = 0;
6306
6307
		for ( ; ( elem = this[ i ] ) != null; i++ ) {
6308
6309
			// Remove element nodes and prevent memory leaks
6310
			if ( elem.nodeType === 1 ) {
6311
				jQuery.cleanData( getAll( elem, false ) );
6312
			}
6313
6314
			// Remove any remaining nodes
6315
			while ( elem.firstChild ) {
6316
				elem.removeChild( elem.firstChild );
6317
			}
6318
6319
			// If this is a select, ensure that it displays empty (#12336)
6320
			// Support: IE<9
6321
			if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6322
				elem.options.length = 0;
6323
			}
6324
		}
6325
6326
		return this;
6327
	},
6328
6329
	clone: function( dataAndEvents, deepDataAndEvents ) {
6330
		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6331
		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6332
6333
		return this.map( function() {
6334
			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6335
		} );
6336
	},
6337
6338
	html: function( value ) {
6339
		return access( this, function( value ) {
6340
			var elem = this[ 0 ] || {},
6341
				i = 0,
6342
				l = this.length;
6343
6344
			if ( value === undefined ) {
6345
				return elem.nodeType === 1 ?
6346
					elem.innerHTML.replace( rinlinejQuery, "" ) :
6347
					undefined;
6348
			}
6349
6350
			// See if we can take a shortcut and just use innerHTML
6351
			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6352
				( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
6353
				( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
6354
				!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
6355
6356
				value = jQuery.htmlPrefilter( value );
6357
6358
				try {
6359
					for ( ; i < l; i++ ) {
6360
6361
						// Remove element nodes and prevent memory leaks
6362
						elem = this[ i ] || {};
6363
						if ( elem.nodeType === 1 ) {
6364
							jQuery.cleanData( getAll( elem, false ) );
6365
							elem.innerHTML = value;
6366
						}
6367
					}
6368
6369
					elem = 0;
6370
6371
				// If using innerHTML throws an exception, use the fallback method
6372
				} catch ( e ) {}
6373
			}
6374
6375
			if ( elem ) {
6376
				this.empty().append( value );
6377
			}
6378
		}, null, value, arguments.length );
6379
	},
6380
6381
	replaceWith: function() {
6382
		var ignored = [];
6383
6384
		// Make the changes, replacing each non-ignored context element with the new content
6385
		return domManip( this, arguments, function( elem ) {
6386
			var parent = this.parentNode;
6387
6388
			if ( jQuery.inArray( this, ignored ) < 0 ) {
6389
				jQuery.cleanData( getAll( this ) );
6390
				if ( parent ) {
6391
					parent.replaceChild( elem, this );
6392
				}
6393
			}
6394
6395
		// Force callback invocation
6396
		}, ignored );
6397
	}
6398
} );
6399
6400
jQuery.each( {
6401
	appendTo: "append",
6402
	prependTo: "prepend",
6403
	insertBefore: "before",
6404
	insertAfter: "after",
6405
	replaceAll: "replaceWith"
6406
}, function( name, original ) {
6407
	jQuery.fn[ name ] = function( selector ) {
6408
		var elems,
6409
			i = 0,
6410
			ret = [],
6411
			insert = jQuery( selector ),
6412
			last = insert.length - 1;
6413
6414
		for ( ; i <= last; i++ ) {
6415
			elems = i === last ? this : this.clone( true );
6416
			jQuery( insert[ i ] )[ original ]( elems );
6417
6418
			// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6419
			push.apply( ret, elems.get() );
6420
		}
6421
6422
		return this.pushStack( ret );
6423
	};
6424
} );
6425
6426
6427
var iframe,
6428
	elemdisplay = {
6429
6430
		// Support: Firefox
6431
		// We have to pre-define these values for FF (#10227)
6432
		HTML: "block",
6433
		BODY: "block"
6434
	};
6435
6436
/**
6437
 * Retrieve the actual display of a element
6438
 * @param {String} name nodeName of the element
6439
 * @param {Object} doc Document object
6440
 */
6441
6442
// Called only from within defaultDisplay
6443
function actualDisplay( name, doc ) {
6444
	var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6445
6446
		display = jQuery.css( elem[ 0 ], "display" );
6447
6448
	// We don't have any data stored on the element,
6449
	// so use "detach" method as fast way to get rid of the element
6450
	elem.detach();
6451
6452
	return display;
6453
}
6454
6455
/**
6456
 * Try to determine the default display value of an element
6457
 * @param {String} nodeName
6458
 */
6459
function defaultDisplay( nodeName ) {
6460
	var doc = document,
6461
		display = elemdisplay[ nodeName ];
6462
6463
	if ( !display ) {
6464
		display = actualDisplay( nodeName, doc );
6465
6466
		// If the simple way fails, read from inside an iframe
6467
		if ( display === "none" || !display ) {
6468
6469
			// Use the already-created iframe if possible
6470
			iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
6471
				.appendTo( doc.documentElement );
6472
6473
			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6474
			doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6475
6476
			// Support: IE
6477
			doc.write();
6478
			doc.close();
6479
6480
			display = actualDisplay( nodeName, doc );
6481
			iframe.detach();
6482
		}
6483
6484
		// Store the correct default display
6485
		elemdisplay[ nodeName ] = display;
6486
	}
6487
6488
	return display;
6489
}
6490
var rmargin = ( /^margin/ );
6491
6492
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6493
6494
var swap = function( elem, options, callback, args ) {
6495
	var ret, name,
6496
		old = {};
6497
6498
	// Remember the old values, and insert the new ones
6499
	for ( name in options ) {
6500
		old[ name ] = elem.style[ name ];
6501
		elem.style[ name ] = options[ name ];
6502
	}
6503
6504
	ret = callback.apply( elem, args || [] );
6505
6506
	// Revert the old values
6507
	for ( name in options ) {
6508
		elem.style[ name ] = old[ name ];
6509
	}
6510
6511
	return ret;
6512
};
6513
6514
6515
var documentElement = document.documentElement;
6516
6517
6518
6519
( function() {
6520
	var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
6521
		reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
6522
		container = document.createElement( "div" ),
6523
		div = document.createElement( "div" );
6524
6525
	// Finish early in limited (non-browser) environments
6526
	if ( !div.style ) {
6527
		return;
6528
	}
6529
6530
	div.style.cssText = "float:left;opacity:.5";
6531
6532
	// Support: IE<9
6533
	// Make sure that element opacity exists (as opposed to filter)
6534
	support.opacity = div.style.opacity === "0.5";
6535
6536
	// Verify style float existence
6537
	// (IE uses styleFloat instead of cssFloat)
6538
	support.cssFloat = !!div.style.cssFloat;
6539
6540
	div.style.backgroundClip = "content-box";
6541
	div.cloneNode( true ).style.backgroundClip = "";
6542
	support.clearCloneStyle = div.style.backgroundClip === "content-box";
6543
6544
	container = document.createElement( "div" );
6545
	container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
6546
		"padding:0;margin-top:1px;position:absolute";
6547
	div.innerHTML = "";
6548
	container.appendChild( div );
6549
6550
	// Support: Firefox<29, Android 2.3
6551
	// Vendor-prefix box-sizing
6552
	support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
6553
		div.style.WebkitBoxSizing === "";
6554
6555
	jQuery.extend( support, {
6556
		reliableHiddenOffsets: function() {
6557
			if ( pixelPositionVal == null ) {
6558
				computeStyleTests();
6559
			}
6560
			return reliableHiddenOffsetsVal;
6561
		},
6562
6563
		boxSizingReliable: function() {
6564
6565
			// We're checking for pixelPositionVal here instead of boxSizingReliableVal
6566
			// since that compresses better and they're computed together anyway.
6567
			if ( pixelPositionVal == null ) {
6568
				computeStyleTests();
6569
			}
6570
			return boxSizingReliableVal;
6571
		},
6572
6573
		pixelMarginRight: function() {
6574
6575
			// Support: Android 4.0-4.3
6576
			if ( pixelPositionVal == null ) {
6577
				computeStyleTests();
6578
			}
6579
			return pixelMarginRightVal;
6580
		},
6581
6582
		pixelPosition: function() {
6583
			if ( pixelPositionVal == null ) {
6584
				computeStyleTests();
6585
			}
6586
			return pixelPositionVal;
6587
		},
6588
6589
		reliableMarginRight: function() {
6590
6591
			// Support: Android 2.3
6592
			if ( pixelPositionVal == null ) {
6593
				computeStyleTests();
6594
			}
6595
			return reliableMarginRightVal;
6596
		},
6597
6598
		reliableMarginLeft: function() {
6599
6600
			// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
6601
			if ( pixelPositionVal == null ) {
6602
				computeStyleTests();
6603
			}
6604
			return reliableMarginLeftVal;
6605
		}
6606
	} );
6607
6608
	function computeStyleTests() {
6609
		var contents, divStyle,
6610
			documentElement = document.documentElement;
6611
6612
		// Setup
6613
		documentElement.appendChild( container );
6614
6615
		div.style.cssText =
6616
6617
			// Support: Android 2.3
6618
			// Vendor-prefix box-sizing
6619
			"-webkit-box-sizing:border-box;box-sizing:border-box;" +
6620
			"position:relative;display:block;" +
6621
			"margin:auto;border:1px;padding:1px;" +
6622
			"top:1%;width:50%";
6623
6624
		// Support: IE<9
6625
		// Assume reasonable values in the absence of getComputedStyle
6626
		pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
6627
		pixelMarginRightVal = reliableMarginRightVal = true;
6628
6629
		// Check for getComputedStyle so that this code is not run in IE<9.
6630
		if ( window.getComputedStyle ) {
6631
			divStyle = window.getComputedStyle( div );
6632
			pixelPositionVal = ( divStyle || {} ).top !== "1%";
6633
			reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
6634
			boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
6635
6636
			// Support: Android 4.0 - 4.3 only
6637
			// Some styles come back with percentage values, even though they shouldn't
6638
			div.style.marginRight = "50%";
6639
			pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
6640
6641
			// Support: Android 2.3 only
6642
			// Div with explicit width and no margin-right incorrectly
6643
			// gets computed margin-right based on width of container (#3333)
6644
			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6645
			contents = div.appendChild( document.createElement( "div" ) );
6646
6647
			// Reset CSS: box-sizing; display; margin; border; padding
6648
			contents.style.cssText = div.style.cssText =
6649
6650
				// Support: Android 2.3
6651
				// Vendor-prefix box-sizing
6652
				"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6653
				"box-sizing:content-box;display:block;margin:0;border:0;padding:0";
6654
			contents.style.marginRight = contents.style.width = "0";
6655
			div.style.width = "1px";
6656
6657
			reliableMarginRightVal =
6658
				!parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
6659
6660
			div.removeChild( contents );
6661
		}
6662
6663
		// Support: IE6-8
6664
		// First check that getClientRects works as expected
6665
		// Check if table cells still have offsetWidth/Height when they are set
6666
		// to display:none and there are still other visible table cells in a
6667
		// table row; if so, offsetWidth/Height are not reliable for use when
6668
		// determining if an element has been hidden directly using
6669
		// display:none (it is still safe to use offsets if a parent element is
6670
		// hidden; don safety goggles and see bug #4512 for more information).
6671
		div.style.display = "none";
6672
		reliableHiddenOffsetsVal = div.getClientRects().length === 0;
6673
		if ( reliableHiddenOffsetsVal ) {
6674
			div.style.display = "";
6675
			div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6676
			contents = div.getElementsByTagName( "td" );
6677
			contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
6678
			reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6679
			if ( reliableHiddenOffsetsVal ) {
6680
				contents[ 0 ].style.display = "";
6681
				contents[ 1 ].style.display = "none";
6682
				reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6683
			}
6684
		}
6685
6686
		// Teardown
6687
		documentElement.removeChild( container );
6688
	}
6689
6690
} )();
6691
6692
6693
var getStyles, curCSS,
6694
	rposition = /^(top|right|bottom|left)$/;
6695
6696
if ( window.getComputedStyle ) {
6697
	getStyles = function( elem ) {
6698
6699
		// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
6700
		// IE throws on elements created in popups
6701
		// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6702
		var view = elem.ownerDocument.defaultView;
6703
6704
		if ( !view.opener ) {
6705
			view = window;
6706
		}
6707
6708
		return view.getComputedStyle( elem );
6709
	};
6710
6711
	curCSS = function( elem, name, computed ) {
6712
		var width, minWidth, maxWidth, ret,
6713
			style = elem.style;
6714
6715
		computed = computed || getStyles( elem );
6716
6717
		// getPropertyValue is only needed for .css('filter') in IE9, see #12537
6718
		ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6719
6720
		if ( computed ) {
6721
6722
			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6723
				ret = jQuery.style( elem, name );
6724
			}
6725
6726
			// A tribute to the "awesome hack by Dean Edwards"
6727
			// Chrome < 17 and Safari 5.0 uses "computed value"
6728
			// instead of "used value" for margin-right
6729
			// Safari 5.1.7 (at least) returns percentage for a larger set of values,
6730
			// but width seems to be reliably pixels
6731
			// this is against the CSSOM draft spec:
6732
			// http://dev.w3.org/csswg/cssom/#resolved-values
6733
			if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6734
6735
				// Remember the original values
6736
				width = style.width;
6737
				minWidth = style.minWidth;
6738
				maxWidth = style.maxWidth;
6739
6740
				// Put in the new values to get a computed value out
6741
				style.minWidth = style.maxWidth = style.width = ret;
6742
				ret = computed.width;
6743
6744
				// Revert the changed values
6745
				style.width = width;
6746
				style.minWidth = minWidth;
6747
				style.maxWidth = maxWidth;
6748
			}
6749
		}
6750
6751
		// Support: IE
6752
		// IE returns zIndex value as an integer.
6753
		return ret === undefined ?
6754
			ret :
6755
			ret + "";
6756
	};
6757
} else if ( documentElement.currentStyle ) {
6758
	getStyles = function( elem ) {
6759
		return elem.currentStyle;
6760
	};
6761
6762
	curCSS = function( elem, name, computed ) {
6763
		var left, rs, rsLeft, ret,
6764
			style = elem.style;
6765
6766
		computed = computed || getStyles( elem );
6767
		ret = computed ? computed[ name ] : undefined;
6768
6769
		// Avoid setting ret to empty string here
6770
		// so we don't default to auto
6771
		if ( ret == null && style && style[ name ] ) {
6772
			ret = style[ name ];
6773
		}
6774
6775
		// From the awesome hack by Dean Edwards
6776
		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6777
6778
		// If we're not dealing with a regular pixel number
6779
		// but a number that has a weird ending, we need to convert it to pixels
6780
		// but not position css attributes, as those are
6781
		// proportional to the parent element instead
6782
		// and we can't measure the parent instead because it
6783
		// might trigger a "stacking dolls" problem
6784
		if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6785
6786
			// Remember the original values
6787
			left = style.left;
6788
			rs = elem.runtimeStyle;
6789
			rsLeft = rs && rs.left;
6790
6791
			// Put in the new values to get a computed value out
6792
			if ( rsLeft ) {
6793
				rs.left = elem.currentStyle.left;
6794
			}
6795
			style.left = name === "fontSize" ? "1em" : ret;
6796
			ret = style.pixelLeft + "px";
6797
6798
			// Revert the changed values
6799
			style.left = left;
6800
			if ( rsLeft ) {
6801
				rs.left = rsLeft;
6802
			}
6803
		}
6804
6805
		// Support: IE
6806
		// IE returns zIndex value as an integer.
6807
		return ret === undefined ?
6808
			ret :
6809
			ret + "" || "auto";
6810
	};
6811
}
6812
6813
6814
6815
6816
function addGetHookIf( conditionFn, hookFn ) {
6817
6818
	// Define the hook, we'll check on the first run if it's really needed.
6819
	return {
6820
		get: function() {
6821
			if ( conditionFn() ) {
6822
6823
				// Hook not needed (or it's not possible to use it due
6824
				// to missing dependency), remove it.
6825
				delete this.get;
6826
				return;
6827
			}
6828
6829
			// Hook needed; redefine it so that the support test is not executed again.
6830
			return ( this.get = hookFn ).apply( this, arguments );
6831
		}
6832
	};
6833
}
6834
6835
6836
var
6837
6838
		ralpha = /alpha\([^)]*\)/i,
6839
	ropacity = /opacity\s*=\s*([^)]*)/i,
6840
6841
	// swappable if display is none or starts with table except
6842
	// "table", "table-cell", or "table-caption"
6843
	// see here for display values:
6844
	// https://developer.mozilla.org/en-US/docs/CSS/display
6845
	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6846
	rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6847
6848
	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6849
	cssNormalTransform = {
6850
		letterSpacing: "0",
6851
		fontWeight: "400"
6852
	},
6853
6854
	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
6855
	emptyStyle = document.createElement( "div" ).style;
6856
6857
6858
// return a css property mapped to a potentially vendor prefixed property
6859
function vendorPropName( name ) {
6860
6861
	// shortcut for names that are not vendor prefixed
6862
	if ( name in emptyStyle ) {
6863
		return name;
6864
	}
6865
6866
	// check for vendor prefixed names
6867
	var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),
6868
		i = cssPrefixes.length;
6869
6870
	while ( i-- ) {
6871
		name = cssPrefixes[ i ] + capName;
6872
		if ( name in emptyStyle ) {
6873
			return name;
6874
		}
6875
	}
6876
}
6877
6878
function showHide( elements, show ) {
6879
	var display, elem, hidden,
6880
		values = [],
6881
		index = 0,
6882
		length = elements.length;
6883
6884
	for ( ; index < length; index++ ) {
6885
		elem = elements[ index ];
6886
		if ( !elem.style ) {
6887
			continue;
6888
		}
6889
6890
		values[ index ] = jQuery._data( elem, "olddisplay" );
6891
		display = elem.style.display;
6892
		if ( show ) {
6893
6894
			// Reset the inline display of this element to learn if it is
6895
			// being hidden by cascaded rules or not
6896
			if ( !values[ index ] && display === "none" ) {
6897
				elem.style.display = "";
6898
			}
6899
6900
			// Set elements which have been overridden with display: none
6901
			// in a stylesheet to whatever the default browser style is
6902
			// for such an element
6903
			if ( elem.style.display === "" && isHidden( elem ) ) {
6904
				values[ index ] =
6905
					jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) );
6906
			}
6907
		} else {
6908
			hidden = isHidden( elem );
6909
6910
			if ( display && display !== "none" || !hidden ) {
6911
				jQuery._data(
6912
					elem,
6913
					"olddisplay",
6914
					hidden ? display : jQuery.css( elem, "display" )
6915
				);
6916
			}
6917
		}
6918
	}
6919
6920
	// Set the display of most of the elements in a second loop
6921
	// to avoid the constant reflow
6922
	for ( index = 0; index < length; index++ ) {
6923
		elem = elements[ index ];
6924
		if ( !elem.style ) {
6925
			continue;
6926
		}
6927
		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6928
			elem.style.display = show ? values[ index ] || "" : "none";
6929
		}
6930
	}
6931
6932
	return elements;
6933
}
6934
6935
function setPositiveNumber( elem, value, subtract ) {
6936
	var matches = rnumsplit.exec( value );
6937
	return matches ?
6938
6939
		// Guard against undefined "subtract", e.g., when used as in cssHooks
6940
		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6941
		value;
6942
}
6943
6944
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6945
	var i = extra === ( isBorderBox ? "border" : "content" ) ?
6946
6947
		// If we already have the right measurement, avoid augmentation
6948
		4 :
6949
6950
		// Otherwise initialize for horizontal or vertical properties
6951
		name === "width" ? 1 : 0,
6952
6953
		val = 0;
6954
6955
	for ( ; i < 4; i += 2 ) {
6956
6957
		// both box models exclude margin, so add it if we want it
6958
		if ( extra === "margin" ) {
6959
			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6960
		}
6961
6962
		if ( isBorderBox ) {
6963
6964
			// border-box includes padding, so remove it if we want content
6965
			if ( extra === "content" ) {
6966
				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6967
			}
6968
6969
			// at this point, extra isn't border nor margin, so remove border
6970
			if ( extra !== "margin" ) {
6971
				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6972
			}
6973
		} else {
6974
6975
			// at this point, extra isn't content, so add padding
6976
			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6977
6978
			// at this point, extra isn't content nor padding, so add border
6979
			if ( extra !== "padding" ) {
6980
				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6981
			}
6982
		}
6983
	}
6984
6985
	return val;
6986
}
6987
6988
function getWidthOrHeight( elem, name, extra ) {
6989
6990
	// Start with offset property, which is equivalent to the border-box value
6991
	var valueIsBorderBox = true,
6992
		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6993
		styles = getStyles( elem ),
6994
		isBorderBox = support.boxSizing &&
6995
			jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6996
6997
	// Support: IE11 only
6998
	// In IE 11 fullscreen elements inside of an iframe have
6999
	// 100x too small dimensions (gh-1764).
7000
	if ( document.msFullscreenElement && window.top !== window ) {
7001
7002
		// Support: IE11 only
7003
		// Running getBoundingClientRect on a disconnected node
7004
		// in IE throws an error.
7005
		if ( elem.getClientRects().length ) {
7006
			val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
7007
		}
7008
	}
7009
7010
	// some non-html elements return undefined for offsetWidth, so check for null/undefined
7011
	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
7012
	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
7013
	if ( val <= 0 || val == null ) {
7014
7015
		// Fall back to computed then uncomputed css if necessary
7016
		val = curCSS( elem, name, styles );
7017
		if ( val < 0 || val == null ) {
7018
			val = elem.style[ name ];
7019
		}
7020
7021
		// Computed unit is not pixels. Stop here and return.
7022
		if ( rnumnonpx.test( val ) ) {
7023
			return val;
7024
		}
7025
7026
		// we need the check for style in case a browser which returns unreliable values
7027
		// for getComputedStyle silently falls back to the reliable elem.style
7028
		valueIsBorderBox = isBorderBox &&
7029
			( support.boxSizingReliable() || val === elem.style[ name ] );
7030
7031
		// Normalize "", auto, and prepare for extra
7032
		val = parseFloat( val ) || 0;
7033
	}
7034
7035
	// use the active box-sizing model to add/subtract irrelevant styles
7036
	return ( val +
7037
		augmentWidthOrHeight(
7038
			elem,
7039
			name,
7040
			extra || ( isBorderBox ? "border" : "content" ),
7041
			valueIsBorderBox,
7042
			styles
7043
		)
7044
	) + "px";
7045
}
7046
7047
jQuery.extend( {
7048
7049
	// Add in style property hooks for overriding the default
7050
	// behavior of getting and setting a style property
7051
	cssHooks: {
7052
		opacity: {
7053
			get: function( elem, computed ) {
7054
				if ( computed ) {
7055
7056
					// We should always get a number back from opacity
7057
					var ret = curCSS( elem, "opacity" );
7058
					return ret === "" ? "1" : ret;
7059
				}
7060
			}
7061
		}
7062
	},
7063
7064
	// Don't automatically add "px" to these possibly-unitless properties
7065
	cssNumber: {
7066
		"animationIterationCount": true,
7067
		"columnCount": true,
7068
		"fillOpacity": true,
7069
		"flexGrow": true,
7070
		"flexShrink": true,
7071
		"fontWeight": true,
7072
		"lineHeight": true,
7073
		"opacity": true,
7074
		"order": true,
7075
		"orphans": true,
7076
		"widows": true,
7077
		"zIndex": true,
7078
		"zoom": true
7079
	},
7080
7081
	// Add in properties whose names you wish to fix before
7082
	// setting or getting the value
7083
	cssProps: {
7084
7085
		// normalize float css property
7086
		"float": support.cssFloat ? "cssFloat" : "styleFloat"
7087
	},
7088
7089
	// Get and set the style property on a DOM Node
7090
	style: function( elem, name, value, extra ) {
7091
7092
		// Don't set styles on text and comment nodes
7093
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
7094
			return;
7095
		}
7096
7097
		// Make sure that we're working with the right name
7098
		var ret, type, hooks,
7099
			origName = jQuery.camelCase( name ),
7100
			style = elem.style;
7101
7102
		name = jQuery.cssProps[ origName ] ||
7103
			( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
7104
7105
		// gets hook for the prefixed version
7106
		// followed by the unprefixed version
7107
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7108
7109
		// Check if we're setting a value
7110
		if ( value !== undefined ) {
7111
			type = typeof value;
7112
7113
			// Convert "+=" or "-=" to relative numbers (#7345)
7114
			if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
7115
				value = adjustCSS( elem, name, ret );
7116
7117
				// Fixes bug #9237
7118
				type = "number";
7119
			}
7120
7121
			// Make sure that null and NaN values aren't set. See: #7116
7122
			if ( value == null || value !== value ) {
7123
				return;
7124
			}
7125
7126
			// If a number was passed in, add the unit (except for certain CSS properties)
7127
			if ( type === "number" ) {
7128
				value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
7129
			}
7130
7131
			// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
7132
			// but it would mean to define eight
7133
			// (for every problematic property) identical functions
7134
			if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
7135
				style[ name ] = "inherit";
7136
			}
7137
7138
			// If a hook was provided, use that value, otherwise just set the specified value
7139
			if ( !hooks || !( "set" in hooks ) ||
7140
				( value = hooks.set( elem, value, extra ) ) !== undefined ) {
7141
7142
				// Support: IE
7143
				// Swallow errors from 'invalid' CSS values (#5509)
7144
				try {
7145
					style[ name ] = value;
7146
				} catch ( e ) {}
7147
			}
7148
7149
		} else {
7150
7151
			// If a hook was provided get the non-computed value from there
7152
			if ( hooks && "get" in hooks &&
7153
				( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
7154
7155
				return ret;
7156
			}
7157
7158
			// Otherwise just get the value from the style object
7159
			return style[ name ];
7160
		}
7161
	},
7162
7163
	css: function( elem, name, extra, styles ) {
7164
		var num, val, hooks,
7165
			origName = jQuery.camelCase( name );
7166
7167
		// Make sure that we're working with the right name
7168
		name = jQuery.cssProps[ origName ] ||
7169
			( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
7170
7171
		// gets hook for the prefixed version
7172
		// followed by the unprefixed version
7173
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7174
7175
		// If a hook was provided get the computed value from there
7176
		if ( hooks && "get" in hooks ) {
7177
			val = hooks.get( elem, true, extra );
7178
		}
7179
7180
		// Otherwise, if a way to get the computed value exists, use that
7181
		if ( val === undefined ) {
7182
			val = curCSS( elem, name, styles );
7183
		}
7184
7185
		//convert "normal" to computed value
7186
		if ( val === "normal" && name in cssNormalTransform ) {
7187
			val = cssNormalTransform[ name ];
7188
		}
7189
7190
		// Return, converting to number if forced or a qualifier was provided and val looks numeric
7191
		if ( extra === "" || extra ) {
7192
			num = parseFloat( val );
7193
			return extra === true || isFinite( num ) ? num || 0 : val;
7194
		}
7195
		return val;
7196
	}
7197
} );
7198
7199
jQuery.each( [ "height", "width" ], function( i, name ) {
7200
	jQuery.cssHooks[ name ] = {
7201
		get: function( elem, computed, extra ) {
7202
			if ( computed ) {
7203
7204
				// certain elements can have dimension info if we invisibly show them
7205
				// however, it must have a current display style that would benefit from this
7206
				return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
7207
					elem.offsetWidth === 0 ?
7208
						swap( elem, cssShow, function() {
7209
							return getWidthOrHeight( elem, name, extra );
7210
						} ) :
7211
						getWidthOrHeight( elem, name, extra );
7212
			}
7213
		},
7214
7215
		set: function( elem, value, extra ) {
7216
			var styles = extra && getStyles( elem );
7217
			return setPositiveNumber( elem, value, extra ?
7218
				augmentWidthOrHeight(
7219
					elem,
7220
					name,
7221
					extra,
7222
					support.boxSizing &&
7223
						jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7224
					styles
7225
				) : 0
7226
			);
7227
		}
7228
	};
7229
} );
7230
7231
if ( !support.opacity ) {
7232
	jQuery.cssHooks.opacity = {
7233
		get: function( elem, computed ) {
7234
7235
			// IE uses filters for opacity
7236
			return ropacity.test( ( computed && elem.currentStyle ?
7237
				elem.currentStyle.filter :
7238
				elem.style.filter ) || "" ) ?
7239
					( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
7240
					computed ? "1" : "";
7241
		},
7242
7243
		set: function( elem, value ) {
7244
			var style = elem.style,
7245
				currentStyle = elem.currentStyle,
7246
				opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
7247
				filter = currentStyle && currentStyle.filter || style.filter || "";
7248
7249
			// IE has trouble with opacity if it does not have layout
7250
			// Force it by setting the zoom level
7251
			style.zoom = 1;
7252
7253
			// if setting opacity to 1, and no other filters exist -
7254
			// attempt to remove filter attribute #6652
7255
			// if value === "", then remove inline opacity #12685
7256
			if ( ( value >= 1 || value === "" ) &&
7257
					jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
7258
					style.removeAttribute ) {
7259
7260
				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
7261
				// if "filter:" is present at all, clearType is disabled, we want to avoid this
7262
				// style.removeAttribute is IE Only, but so apparently is this code path...
7263
				style.removeAttribute( "filter" );
7264
7265
				// if there is no filter style applied in a css rule
7266
				// or unset inline opacity, we are done
7267
				if ( value === "" || currentStyle && !currentStyle.filter ) {
7268
					return;
7269
				}
7270
			}
7271
7272
			// otherwise, set new filter values
7273
			style.filter = ralpha.test( filter ) ?
7274
				filter.replace( ralpha, opacity ) :
7275
				filter + " " + opacity;
7276
		}
7277
	};
7278
}
7279
7280
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
7281
	function( elem, computed ) {
7282
		if ( computed ) {
7283
			return swap( elem, { "display": "inline-block" },
7284
				curCSS, [ elem, "marginRight" ] );
7285
		}
7286
	}
7287
);
7288
7289
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
7290
	function( elem, computed ) {
7291
		if ( computed ) {
7292
			return (
7293
				parseFloat( curCSS( elem, "marginLeft" ) ) ||
7294
7295
				// Support: IE<=11+
7296
				// Running getBoundingClientRect on a disconnected node in IE throws an error
7297
				// Support: IE8 only
7298
				// getClientRects() errors on disconnected elems
7299
				( jQuery.contains( elem.ownerDocument, elem ) ?
7300
					elem.getBoundingClientRect().left -
7301
						swap( elem, { marginLeft: 0 }, function() {
7302
							return elem.getBoundingClientRect().left;
7303
						} ) :
7304
					0
7305
				)
7306
			) + "px";
7307
		}
7308
	}
7309
);
7310
7311
// These hooks are used by animate to expand properties
7312
jQuery.each( {
7313
	margin: "",
7314
	padding: "",
7315
	border: "Width"
7316
}, function( prefix, suffix ) {
7317
	jQuery.cssHooks[ prefix + suffix ] = {
7318
		expand: function( value ) {
7319
			var i = 0,
7320
				expanded = {},
7321
7322
				// assumes a single number if not a string
7323
				parts = typeof value === "string" ? value.split( " " ) : [ value ];
7324
7325
			for ( ; i < 4; i++ ) {
7326
				expanded[ prefix + cssExpand[ i ] + suffix ] =
7327
					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7328
			}
7329
7330
			return expanded;
7331
		}
7332
	};
7333
7334
	if ( !rmargin.test( prefix ) ) {
7335
		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7336
	}
7337
} );
7338
7339
jQuery.fn.extend( {
7340
	css: function( name, value ) {
7341
		return access( this, function( elem, name, value ) {
7342
			var styles, len,
7343
				map = {},
7344
				i = 0;
7345
7346
			if ( jQuery.isArray( name ) ) {
7347
				styles = getStyles( elem );
7348
				len = name.length;
7349
7350
				for ( ; i < len; i++ ) {
7351
					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
7352
				}
7353
7354
				return map;
7355
			}
7356
7357
			return value !== undefined ?
7358
				jQuery.style( elem, name, value ) :
7359
				jQuery.css( elem, name );
7360
		}, name, value, arguments.length > 1 );
7361
	},
7362
	show: function() {
7363
		return showHide( this, true );
7364
	},
7365
	hide: function() {
7366
		return showHide( this );
7367
	},
7368
	toggle: function( state ) {
7369
		if ( typeof state === "boolean" ) {
7370
			return state ? this.show() : this.hide();
7371
		}
7372
7373
		return this.each( function() {
7374
			if ( isHidden( this ) ) {
7375
				jQuery( this ).show();
7376
			} else {
7377
				jQuery( this ).hide();
7378
			}
7379
		} );
7380
	}
7381
} );
7382
7383
7384
function Tween( elem, options, prop, end, easing ) {
7385
	return new Tween.prototype.init( elem, options, prop, end, easing );
7386
}
7387
jQuery.Tween = Tween;
7388
7389
Tween.prototype = {
7390
	constructor: Tween,
7391
	init: function( elem, options, prop, end, easing, unit ) {
7392
		this.elem = elem;
7393
		this.prop = prop;
7394
		this.easing = easing || jQuery.easing._default;
7395
		this.options = options;
7396
		this.start = this.now = this.cur();
7397
		this.end = end;
7398
		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
7399
	},
7400
	cur: function() {
7401
		var hooks = Tween.propHooks[ this.prop ];
7402
7403
		return hooks && hooks.get ?
7404
			hooks.get( this ) :
7405
			Tween.propHooks._default.get( this );
7406
	},
7407
	run: function( percent ) {
7408
		var eased,
7409
			hooks = Tween.propHooks[ this.prop ];
7410
7411
		if ( this.options.duration ) {
7412
			this.pos = eased = jQuery.easing[ this.easing ](
7413
				percent, this.options.duration * percent, 0, 1, this.options.duration
7414
			);
7415
		} else {
7416
			this.pos = eased = percent;
7417
		}
7418
		this.now = ( this.end - this.start ) * eased + this.start;
7419
7420
		if ( this.options.step ) {
7421
			this.options.step.call( this.elem, this.now, this );
7422
		}
7423
7424
		if ( hooks && hooks.set ) {
7425
			hooks.set( this );
7426
		} else {
7427
			Tween.propHooks._default.set( this );
7428
		}
7429
		return this;
7430
	}
7431
};
7432
7433
Tween.prototype.init.prototype = Tween.prototype;
7434
7435
Tween.propHooks = {
7436
	_default: {
7437
		get: function( tween ) {
7438
			var result;
7439
7440
			// Use a property on the element directly when it is not a DOM element,
7441
			// or when there is no matching style property that exists.
7442
			if ( tween.elem.nodeType !== 1 ||
7443
				tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
7444
				return tween.elem[ tween.prop ];
7445
			}
7446
7447
			// passing an empty string as a 3rd parameter to .css will automatically
7448
			// attempt a parseFloat and fallback to a string if the parse fails
7449
			// so, simple values such as "10px" are parsed to Float.
7450
			// complex values such as "rotate(1rad)" are returned as is.
7451
			result = jQuery.css( tween.elem, tween.prop, "" );
7452
7453
			// Empty strings, null, undefined and "auto" are converted to 0.
7454
			return !result || result === "auto" ? 0 : result;
7455
		},
7456
		set: function( tween ) {
7457
7458
			// use step hook for back compat - use cssHook if its there - use .style if its
7459
			// available and use plain properties where available
7460
			if ( jQuery.fx.step[ tween.prop ] ) {
7461
				jQuery.fx.step[ tween.prop ]( tween );
7462
			} else if ( tween.elem.nodeType === 1 &&
7463
				( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
7464
					jQuery.cssHooks[ tween.prop ] ) ) {
7465
				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7466
			} else {
7467
				tween.elem[ tween.prop ] = tween.now;
7468
			}
7469
		}
7470
	}
7471
};
7472
7473
// Support: IE <=9
7474
// Panic based approach to setting things on disconnected nodes
7475
7476
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7477
	set: function( tween ) {
7478
		if ( tween.elem.nodeType && tween.elem.parentNode ) {
7479
			tween.elem[ tween.prop ] = tween.now;
7480
		}
7481
	}
7482
};
7483
7484
jQuery.easing = {
7485
	linear: function( p ) {
7486
		return p;
7487
	},
7488
	swing: function( p ) {
7489
		return 0.5 - Math.cos( p * Math.PI ) / 2;
7490
	},
7491
	_default: "swing"
7492
};
7493
7494
jQuery.fx = Tween.prototype.init;
7495
7496
// Back Compat <1.8 extension point
7497
jQuery.fx.step = {};
7498
7499
7500
7501
7502
var
7503
	fxNow, timerId,
7504
	rfxtypes = /^(?:toggle|show|hide)$/,
7505
	rrun = /queueHooks$/;
7506
7507
// Animations created synchronously will run synchronously
7508
function createFxNow() {
7509
	window.setTimeout( function() {
7510
		fxNow = undefined;
7511
	} );
7512
	return ( fxNow = jQuery.now() );
7513
}
7514
7515
// Generate parameters to create a standard animation
7516
function genFx( type, includeWidth ) {
7517
	var which,
7518
		attrs = { height: type },
7519
		i = 0;
7520
7521
	// if we include width, step value is 1 to do all cssExpand values,
7522
	// if we don't include width, step value is 2 to skip over Left and Right
7523
	includeWidth = includeWidth ? 1 : 0;
7524
	for ( ; i < 4 ; i += 2 - includeWidth ) {
7525
		which = cssExpand[ i ];
7526
		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7527
	}
7528
7529
	if ( includeWidth ) {
7530
		attrs.opacity = attrs.width = type;
7531
	}
7532
7533
	return attrs;
7534
}
7535
7536
function createTween( value, prop, animation ) {
7537
	var tween,
7538
		collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
7539
		index = 0,
7540
		length = collection.length;
7541
	for ( ; index < length; index++ ) {
7542
		if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
7543
7544
			// we're done with this property
7545
			return tween;
7546
		}
7547
	}
7548
}
7549
7550
function defaultPrefilter( elem, props, opts ) {
7551
	/* jshint validthis: true */
7552
	var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7553
		anim = this,
7554
		orig = {},
7555
		style = elem.style,
7556
		hidden = elem.nodeType && isHidden( elem ),
7557
		dataShow = jQuery._data( elem, "fxshow" );
7558
7559
	// handle queue: false promises
7560
	if ( !opts.queue ) {
7561
		hooks = jQuery._queueHooks( elem, "fx" );
7562
		if ( hooks.unqueued == null ) {
7563
			hooks.unqueued = 0;
7564
			oldfire = hooks.empty.fire;
7565
			hooks.empty.fire = function() {
7566
				if ( !hooks.unqueued ) {
7567
					oldfire();
7568
				}
7569
			};
7570
		}
7571
		hooks.unqueued++;
7572
7573
		anim.always( function() {
7574
7575
			// doing this makes sure that the complete handler will be called
7576
			// before this completes
7577
			anim.always( function() {
7578
				hooks.unqueued--;
7579
				if ( !jQuery.queue( elem, "fx" ).length ) {
7580
					hooks.empty.fire();
7581
				}
7582
			} );
7583
		} );
7584
	}
7585
7586
	// height/width overflow pass
7587
	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7588
7589
		// Make sure that nothing sneaks out
7590
		// Record all 3 overflow attributes because IE does not
7591
		// change the overflow attribute when overflowX and
7592
		// overflowY are set to the same value
7593
		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7594
7595
		// Set display property to inline-block for height/width
7596
		// animations on inline elements that are having width/height animated
7597
		display = jQuery.css( elem, "display" );
7598
7599
		// Test default display if display is currently "none"
7600
		checkDisplay = display === "none" ?
7601
			jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7602
7603
		if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7604
7605
			// inline-level elements accept inline-block;
7606
			// block-level elements need to be inline with layout
7607
			if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7608
				style.display = "inline-block";
7609
			} else {
7610
				style.zoom = 1;
7611
			}
7612
		}
7613
	}
7614
7615
	if ( opts.overflow ) {
7616
		style.overflow = "hidden";
7617
		if ( !support.shrinkWrapBlocks() ) {
7618
			anim.always( function() {
7619
				style.overflow = opts.overflow[ 0 ];
7620
				style.overflowX = opts.overflow[ 1 ];
7621
				style.overflowY = opts.overflow[ 2 ];
7622
			} );
7623
		}
7624
	}
7625
7626
	// show/hide pass
7627
	for ( prop in props ) {
7628
		value = props[ prop ];
7629
		if ( rfxtypes.exec( value ) ) {
7630
			delete props[ prop ];
7631
			toggle = toggle || value === "toggle";
7632
			if ( value === ( hidden ? "hide" : "show" ) ) {
7633
7634
				// If there is dataShow left over from a stopped hide or show
7635
				// and we are going to proceed with show, we should pretend to be hidden
7636
				if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7637
					hidden = true;
7638
				} else {
7639
					continue;
7640
				}
7641
			}
7642
			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7643
7644
		// Any non-fx value stops us from restoring the original display value
7645
		} else {
7646
			display = undefined;
7647
		}
7648
	}
7649
7650
	if ( !jQuery.isEmptyObject( orig ) ) {
7651
		if ( dataShow ) {
7652
			if ( "hidden" in dataShow ) {
7653
				hidden = dataShow.hidden;
7654
			}
7655
		} else {
7656
			dataShow = jQuery._data( elem, "fxshow", {} );
7657
		}
7658
7659
		// store state if its toggle - enables .stop().toggle() to "reverse"
7660
		if ( toggle ) {
7661
			dataShow.hidden = !hidden;
7662
		}
7663
		if ( hidden ) {
7664
			jQuery( elem ).show();
7665
		} else {
7666
			anim.done( function() {
7667
				jQuery( elem ).hide();
7668
			} );
7669
		}
7670
		anim.done( function() {
7671
			var prop;
7672
			jQuery._removeData( elem, "fxshow" );
7673
			for ( prop in orig ) {
7674
				jQuery.style( elem, prop, orig[ prop ] );
7675
			}
7676
		} );
7677
		for ( prop in orig ) {
7678
			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7679
7680
			if ( !( prop in dataShow ) ) {
7681
				dataShow[ prop ] = tween.start;
7682
				if ( hidden ) {
7683
					tween.end = tween.start;
7684
					tween.start = prop === "width" || prop === "height" ? 1 : 0;
7685
				}
7686
			}
7687
		}
7688
7689
	// If this is a noop like .hide().hide(), restore an overwritten display value
7690
	} else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
7691
		style.display = display;
7692
	}
7693
}
7694
7695
function propFilter( props, specialEasing ) {
7696
	var index, name, easing, value, hooks;
7697
7698
	// camelCase, specialEasing and expand cssHook pass
7699
	for ( index in props ) {
7700
		name = jQuery.camelCase( index );
7701
		easing = specialEasing[ name ];
7702
		value = props[ index ];
7703
		if ( jQuery.isArray( value ) ) {
7704
			easing = value[ 1 ];
7705
			value = props[ index ] = value[ 0 ];
7706
		}
7707
7708
		if ( index !== name ) {
7709
			props[ name ] = value;
7710
			delete props[ index ];
7711
		}
7712
7713
		hooks = jQuery.cssHooks[ name ];
7714
		if ( hooks && "expand" in hooks ) {
7715
			value = hooks.expand( value );
7716
			delete props[ name ];
7717
7718
			// not quite $.extend, this wont overwrite keys already present.
7719
			// also - reusing 'index' from above because we have the correct "name"
7720
			for ( index in value ) {
7721
				if ( !( index in props ) ) {
7722
					props[ index ] = value[ index ];
7723
					specialEasing[ index ] = easing;
7724
				}
7725
			}
7726
		} else {
7727
			specialEasing[ name ] = easing;
7728
		}
7729
	}
7730
}
7731
7732
function Animation( elem, properties, options ) {
7733
	var result,
7734
		stopped,
7735
		index = 0,
7736
		length = Animation.prefilters.length,
7737
		deferred = jQuery.Deferred().always( function() {
7738
7739
			// don't match elem in the :animated selector
7740
			delete tick.elem;
7741
		} ),
7742
		tick = function() {
7743
			if ( stopped ) {
7744
				return false;
7745
			}
7746
			var currentTime = fxNow || createFxNow(),
7747
				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7748
7749
				// Support: Android 2.3
7750
				// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7751
				temp = remaining / animation.duration || 0,
7752
				percent = 1 - temp,
7753
				index = 0,
7754
				length = animation.tweens.length;
7755
7756
			for ( ; index < length ; index++ ) {
7757
				animation.tweens[ index ].run( percent );
7758
			}
7759
7760
			deferred.notifyWith( elem, [ animation, percent, remaining ] );
7761
7762
			if ( percent < 1 && length ) {
7763
				return remaining;
7764
			} else {
7765
				deferred.resolveWith( elem, [ animation ] );
7766
				return false;
7767
			}
7768
		},
7769
		animation = deferred.promise( {
7770
			elem: elem,
7771
			props: jQuery.extend( {}, properties ),
7772
			opts: jQuery.extend( true, {
7773
				specialEasing: {},
7774
				easing: jQuery.easing._default
7775
			}, options ),
7776
			originalProperties: properties,
7777
			originalOptions: options,
7778
			startTime: fxNow || createFxNow(),
7779
			duration: options.duration,
7780
			tweens: [],
7781
			createTween: function( prop, end ) {
7782
				var tween = jQuery.Tween( elem, animation.opts, prop, end,
7783
						animation.opts.specialEasing[ prop ] || animation.opts.easing );
7784
				animation.tweens.push( tween );
7785
				return tween;
7786
			},
7787
			stop: function( gotoEnd ) {
7788
				var index = 0,
7789
7790
					// if we are going to the end, we want to run all the tweens
7791
					// otherwise we skip this part
7792
					length = gotoEnd ? animation.tweens.length : 0;
7793
				if ( stopped ) {
7794
					return this;
7795
				}
7796
				stopped = true;
7797
				for ( ; index < length ; index++ ) {
7798
					animation.tweens[ index ].run( 1 );
7799
				}
7800
7801
				// resolve when we played the last frame
7802
				// otherwise, reject
7803
				if ( gotoEnd ) {
7804
					deferred.notifyWith( elem, [ animation, 1, 0 ] );
7805
					deferred.resolveWith( elem, [ animation, gotoEnd ] );
7806
				} else {
7807
					deferred.rejectWith( elem, [ animation, gotoEnd ] );
7808
				}
7809
				return this;
7810
			}
7811
		} ),
7812
		props = animation.props;
7813
7814
	propFilter( props, animation.opts.specialEasing );
7815
7816
	for ( ; index < length ; index++ ) {
7817
		result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
7818
		if ( result ) {
7819
			if ( jQuery.isFunction( result.stop ) ) {
7820
				jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
7821
					jQuery.proxy( result.stop, result );
7822
			}
7823
			return result;
7824
		}
7825
	}
7826
7827
	jQuery.map( props, createTween, animation );
7828
7829
	if ( jQuery.isFunction( animation.opts.start ) ) {
7830
		animation.opts.start.call( elem, animation );
7831
	}
7832
7833
	jQuery.fx.timer(
7834
		jQuery.extend( tick, {
7835
			elem: elem,
7836
			anim: animation,
7837
			queue: animation.opts.queue
7838
		} )
7839
	);
7840
7841
	// attach callbacks from options
7842
	return animation.progress( animation.opts.progress )
7843
		.done( animation.opts.done, animation.opts.complete )
7844
		.fail( animation.opts.fail )
7845
		.always( animation.opts.always );
7846
}
7847
7848
jQuery.Animation = jQuery.extend( Animation, {
7849
7850
	tweeners: {
7851
		"*": [ function( prop, value ) {
7852
			var tween = this.createTween( prop, value );
7853
			adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
7854
			return tween;
7855
		} ]
7856
	},
7857
7858
	tweener: function( props, callback ) {
7859
		if ( jQuery.isFunction( props ) ) {
7860
			callback = props;
7861
			props = [ "*" ];
7862
		} else {
7863
			props = props.match( rnotwhite );
7864
		}
7865
7866
		var prop,
7867
			index = 0,
7868
			length = props.length;
7869
7870
		for ( ; index < length ; index++ ) {
7871
			prop = props[ index ];
7872
			Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
7873
			Animation.tweeners[ prop ].unshift( callback );
7874
		}
7875
	},
7876
7877
	prefilters: [ defaultPrefilter ],
7878
7879
	prefilter: function( callback, prepend ) {
7880
		if ( prepend ) {
7881
			Animation.prefilters.unshift( callback );
7882
		} else {
7883
			Animation.prefilters.push( callback );
7884
		}
7885
	}
7886
} );
7887
7888
jQuery.speed = function( speed, easing, fn ) {
7889
	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7890
		complete: fn || !fn && easing ||
7891
			jQuery.isFunction( speed ) && speed,
7892
		duration: speed,
7893
		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7894
	};
7895
7896
	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7897
		opt.duration in jQuery.fx.speeds ?
7898
			jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7899
7900
	// normalize opt.queue - true/undefined/null -> "fx"
7901
	if ( opt.queue == null || opt.queue === true ) {
7902
		opt.queue = "fx";
7903
	}
7904
7905
	// Queueing
7906
	opt.old = opt.complete;
7907
7908
	opt.complete = function() {
7909
		if ( jQuery.isFunction( opt.old ) ) {
7910
			opt.old.call( this );
7911
		}
7912
7913
		if ( opt.queue ) {
7914
			jQuery.dequeue( this, opt.queue );
7915
		}
7916
	};
7917
7918
	return opt;
7919
};
7920
7921
jQuery.fn.extend( {
7922
	fadeTo: function( speed, to, easing, callback ) {
7923
7924
		// show any hidden elements after setting opacity to 0
7925
		return this.filter( isHidden ).css( "opacity", 0 ).show()
7926
7927
			// animate to the value specified
7928
			.end().animate( { opacity: to }, speed, easing, callback );
7929
	},
7930
	animate: function( prop, speed, easing, callback ) {
7931
		var empty = jQuery.isEmptyObject( prop ),
7932
			optall = jQuery.speed( speed, easing, callback ),
7933
			doAnimation = function() {
7934
7935
				// Operate on a copy of prop so per-property easing won't be lost
7936
				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7937
7938
				// Empty animations, or finishing resolves immediately
7939
				if ( empty || jQuery._data( this, "finish" ) ) {
7940
					anim.stop( true );
7941
				}
7942
			};
7943
			doAnimation.finish = doAnimation;
7944
7945
		return empty || optall.queue === false ?
7946
			this.each( doAnimation ) :
7947
			this.queue( optall.queue, doAnimation );
7948
	},
7949
	stop: function( type, clearQueue, gotoEnd ) {
7950
		var stopQueue = function( hooks ) {
7951
			var stop = hooks.stop;
7952
			delete hooks.stop;
7953
			stop( gotoEnd );
7954
		};
7955
7956
		if ( typeof type !== "string" ) {
7957
			gotoEnd = clearQueue;
7958
			clearQueue = type;
7959
			type = undefined;
7960
		}
7961
		if ( clearQueue && type !== false ) {
7962
			this.queue( type || "fx", [] );
7963
		}
7964
7965
		return this.each( function() {
7966
			var dequeue = true,
7967
				index = type != null && type + "queueHooks",
7968
				timers = jQuery.timers,
7969
				data = jQuery._data( this );
7970
7971
			if ( index ) {
7972
				if ( data[ index ] && data[ index ].stop ) {
7973
					stopQueue( data[ index ] );
7974
				}
7975
			} else {
7976
				for ( index in data ) {
7977
					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7978
						stopQueue( data[ index ] );
7979
					}
7980
				}
7981
			}
7982
7983
			for ( index = timers.length; index--; ) {
7984
				if ( timers[ index ].elem === this &&
7985
					( type == null || timers[ index ].queue === type ) ) {
7986
7987
					timers[ index ].anim.stop( gotoEnd );
7988
					dequeue = false;
7989
					timers.splice( index, 1 );
7990
				}
7991
			}
7992
7993
			// start the next in the queue if the last step wasn't forced
7994
			// timers currently will call their complete callbacks, which will dequeue
7995
			// but only if they were gotoEnd
7996
			if ( dequeue || !gotoEnd ) {
7997
				jQuery.dequeue( this, type );
7998
			}
7999
		} );
8000
	},
8001
	finish: function( type ) {
8002
		if ( type !== false ) {
8003
			type = type || "fx";
8004
		}
8005
		return this.each( function() {
8006
			var index,
8007
				data = jQuery._data( this ),
8008
				queue = data[ type + "queue" ],
8009
				hooks = data[ type + "queueHooks" ],
8010
				timers = jQuery.timers,
8011
				length = queue ? queue.length : 0;
8012
8013
			// enable finishing flag on private data
8014
			data.finish = true;
8015
8016
			// empty the queue first
8017
			jQuery.queue( this, type, [] );
8018
8019
			if ( hooks && hooks.stop ) {
8020
				hooks.stop.call( this, true );
8021
			}
8022
8023
			// look for any active animations, and finish them
8024
			for ( index = timers.length; index--; ) {
8025
				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
8026
					timers[ index ].anim.stop( true );
8027
					timers.splice( index, 1 );
8028
				}
8029
			}
8030
8031
			// look for any animations in the old queue and finish them
8032
			for ( index = 0; index < length; index++ ) {
8033
				if ( queue[ index ] && queue[ index ].finish ) {
8034
					queue[ index ].finish.call( this );
8035
				}
8036
			}
8037
8038
			// turn off finishing flag
8039
			delete data.finish;
8040
		} );
8041
	}
8042
} );
8043
8044
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
8045
	var cssFn = jQuery.fn[ name ];
8046
	jQuery.fn[ name ] = function( speed, easing, callback ) {
8047
		return speed == null || typeof speed === "boolean" ?
8048
			cssFn.apply( this, arguments ) :
8049
			this.animate( genFx( name, true ), speed, easing, callback );
8050
	};
8051
} );
8052
8053
// Generate shortcuts for custom animations
8054
jQuery.each( {
8055
	slideDown: genFx( "show" ),
8056
	slideUp: genFx( "hide" ),
8057
	slideToggle: genFx( "toggle" ),
8058
	fadeIn: { opacity: "show" },
8059
	fadeOut: { opacity: "hide" },
8060
	fadeToggle: { opacity: "toggle" }
8061
}, function( name, props ) {
8062
	jQuery.fn[ name ] = function( speed, easing, callback ) {
8063
		return this.animate( props, speed, easing, callback );
8064
	};
8065
} );
8066
8067
jQuery.timers = [];
8068
jQuery.fx.tick = function() {
8069
	var timer,
8070
		timers = jQuery.timers,
8071
		i = 0;
8072
8073
	fxNow = jQuery.now();
8074
8075
	for ( ; i < timers.length; i++ ) {
8076
		timer = timers[ i ];
8077
8078
		// Checks the timer has not already been removed
8079
		if ( !timer() && timers[ i ] === timer ) {
8080
			timers.splice( i--, 1 );
8081
		}
8082
	}
8083
8084
	if ( !timers.length ) {
8085
		jQuery.fx.stop();
8086
	}
8087
	fxNow = undefined;
8088
};
8089
8090
jQuery.fx.timer = function( timer ) {
8091
	jQuery.timers.push( timer );
8092
	if ( timer() ) {
8093
		jQuery.fx.start();
8094
	} else {
8095
		jQuery.timers.pop();
8096
	}
8097
};
8098
8099
jQuery.fx.interval = 13;
8100
8101
jQuery.fx.start = function() {
8102
	if ( !timerId ) {
8103
		timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
8104
	}
8105
};
8106
8107
jQuery.fx.stop = function() {
8108
	window.clearInterval( timerId );
8109
	timerId = null;
8110
};
8111
8112
jQuery.fx.speeds = {
8113
	slow: 600,
8114
	fast: 200,
8115
8116
	// Default speed
8117
	_default: 400
8118
};
8119
8120
8121
// Based off of the plugin by Clint Helfers, with permission.
8122
// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
8123
jQuery.fn.delay = function( time, type ) {
8124
	time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
8125
	type = type || "fx";
8126
8127
	return this.queue( type, function( next, hooks ) {
8128
		var timeout = window.setTimeout( next, time );
8129
		hooks.stop = function() {
8130
			window.clearTimeout( timeout );
8131
		};
8132
	} );
8133
};
8134
8135
8136
( function() {
8137
	var a,
8138
		input = document.createElement( "input" ),
8139
		div = document.createElement( "div" ),
8140
		select = document.createElement( "select" ),
8141
		opt = select.appendChild( document.createElement( "option" ) );
8142
8143
	// Setup
8144
	div = document.createElement( "div" );
8145
	div.setAttribute( "className", "t" );
8146
	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
8147
	a = div.getElementsByTagName( "a" )[ 0 ];
8148
8149
	// Support: Windows Web Apps (WWA)
8150
	// `type` must use .setAttribute for WWA (#14901)
8151
	input.setAttribute( "type", "checkbox" );
8152
	div.appendChild( input );
8153
8154
	a = div.getElementsByTagName( "a" )[ 0 ];
8155
8156
	// First batch of tests.
8157
	a.style.cssText = "top:1px";
8158
8159
	// Test setAttribute on camelCase class.
8160
	// If it works, we need attrFixes when doing get/setAttribute (ie6/7)
8161
	support.getSetAttribute = div.className !== "t";
8162
8163
	// Get the style information from getAttribute
8164
	// (IE uses .cssText instead)
8165
	support.style = /top/.test( a.getAttribute( "style" ) );
8166
8167
	// Make sure that URLs aren't manipulated
8168
	// (IE normalizes it by default)
8169
	support.hrefNormalized = a.getAttribute( "href" ) === "/a";
8170
8171
	// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
8172
	support.checkOn = !!input.value;
8173
8174
	// Make sure that a selected-by-default option has a working selected property.
8175
	// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
8176
	support.optSelected = opt.selected;
8177
8178
	// Tests for enctype support on a form (#6743)
8179
	support.enctype = !!document.createElement( "form" ).enctype;
8180
8181
	// Make sure that the options inside disabled selects aren't marked as disabled
8182
	// (WebKit marks them as disabled)
8183
	select.disabled = true;
8184
	support.optDisabled = !opt.disabled;
8185
8186
	// Support: IE8 only
8187
	// Check if we can trust getAttribute("value")
8188
	input = document.createElement( "input" );
8189
	input.setAttribute( "value", "" );
8190
	support.input = input.getAttribute( "value" ) === "";
8191
8192
	// Check if an input maintains its value after becoming a radio
8193
	input.value = "t";
8194
	input.setAttribute( "type", "radio" );
8195
	support.radioValue = input.value === "t";
8196
} )();
8197
8198
8199
var rreturn = /\r/g;
8200
8201
jQuery.fn.extend( {
8202
	val: function( value ) {
8203
		var hooks, ret, isFunction,
8204
			elem = this[ 0 ];
8205
8206
		if ( !arguments.length ) {
8207
			if ( elem ) {
8208
				hooks = jQuery.valHooks[ elem.type ] ||
8209
					jQuery.valHooks[ elem.nodeName.toLowerCase() ];
8210
8211
				if (
8212
					hooks &&
8213
					"get" in hooks &&
8214
					( ret = hooks.get( elem, "value" ) ) !== undefined
8215
				) {
8216
					return ret;
8217
				}
8218
8219
				ret = elem.value;
8220
8221
				return typeof ret === "string" ?
8222
8223
					// handle most common string cases
8224
					ret.replace( rreturn, "" ) :
8225
8226
					// handle cases where value is null/undef or number
8227
					ret == null ? "" : ret;
8228
			}
8229
8230
			return;
8231
		}
8232
8233
		isFunction = jQuery.isFunction( value );
8234
8235
		return this.each( function( i ) {
8236
			var val;
8237
8238
			if ( this.nodeType !== 1 ) {
8239
				return;
8240
			}
8241
8242
			if ( isFunction ) {
8243
				val = value.call( this, i, jQuery( this ).val() );
8244
			} else {
8245
				val = value;
8246
			}
8247
8248
			// Treat null/undefined as ""; convert numbers to string
8249
			if ( val == null ) {
8250
				val = "";
8251
			} else if ( typeof val === "number" ) {
8252
				val += "";
8253
			} else if ( jQuery.isArray( val ) ) {
8254
				val = jQuery.map( val, function( value ) {
8255
					return value == null ? "" : value + "";
8256
				} );
8257
			}
8258
8259
			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
8260
8261
			// If set returns undefined, fall back to normal setting
8262
			if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
8263
				this.value = val;
8264
			}
8265
		} );
8266
	}
8267
} );
8268
8269
jQuery.extend( {
8270
	valHooks: {
8271
		option: {
8272
			get: function( elem ) {
8273
				var val = jQuery.find.attr( elem, "value" );
8274
				return val != null ?
8275
					val :
8276
8277
					// Support: IE10-11+
8278
					// option.text throws exceptions (#14686, #14858)
8279
					jQuery.trim( jQuery.text( elem ) );
8280
			}
8281
		},
8282
		select: {
8283
			get: function( elem ) {
8284
				var value, option,
8285
					options = elem.options,
8286
					index = elem.selectedIndex,
8287
					one = elem.type === "select-one" || index < 0,
8288
					values = one ? null : [],
8289
					max = one ? index + 1 : options.length,
8290
					i = index < 0 ?
8291
						max :
8292
						one ? index : 0;
8293
8294
				// Loop through all the selected options
8295
				for ( ; i < max; i++ ) {
8296
					option = options[ i ];
8297
8298
					// oldIE doesn't update selected after form reset (#2551)
8299
					if ( ( option.selected || i === index ) &&
8300
8301
							// Don't return options that are disabled or in a disabled optgroup
8302
							( support.optDisabled ?
8303
								!option.disabled :
8304
								option.getAttribute( "disabled" ) === null ) &&
8305
							( !option.parentNode.disabled ||
8306
								!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
8307
8308
						// Get the specific value for the option
8309
						value = jQuery( option ).val();
8310
8311
						// We don't need an array for one selects
8312
						if ( one ) {
8313
							return value;
8314
						}
8315
8316
						// Multi-Selects return an array
8317
						values.push( value );
8318
					}
8319
				}
8320
8321
				return values;
8322
			},
8323
8324
			set: function( elem, value ) {
8325
				var optionSet, option,
8326
					options = elem.options,
8327
					values = jQuery.makeArray( value ),
8328
					i = options.length;
8329
8330
				while ( i-- ) {
8331
					option = options[ i ];
8332
8333
					if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
8334
8335
						// Support: IE6
8336
						// When new option element is added to select box we need to
8337
						// force reflow of newly added node in order to workaround delay
8338
						// of initialization properties
8339
						try {
8340
							option.selected = optionSet = true;
8341
8342
						} catch ( _ ) {
8343
8344
							// Will be executed only in IE6
8345
							option.scrollHeight;
8346
						}
8347
8348
					} else {
8349
						option.selected = false;
8350
					}
8351
				}
8352
8353
				// Force browsers to behave consistently when non-matching value is set
8354
				if ( !optionSet ) {
8355
					elem.selectedIndex = -1;
8356
				}
8357
8358
				return options;
8359
			}
8360
		}
8361
	}
8362
} );
8363
8364
// Radios and checkboxes getter/setter
8365
jQuery.each( [ "radio", "checkbox" ], function() {
8366
	jQuery.valHooks[ this ] = {
8367
		set: function( elem, value ) {
8368
			if ( jQuery.isArray( value ) ) {
8369
				return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
8370
			}
8371
		}
8372
	};
8373
	if ( !support.checkOn ) {
8374
		jQuery.valHooks[ this ].get = function( elem ) {
8375
			return elem.getAttribute( "value" ) === null ? "on" : elem.value;
8376
		};
8377
	}
8378
} );
8379
8380
8381
8382
8383
var nodeHook, boolHook,
8384
	attrHandle = jQuery.expr.attrHandle,
8385
	ruseDefault = /^(?:checked|selected)$/i,
8386
	getSetAttribute = support.getSetAttribute,
8387
	getSetInput = support.input;
8388
8389
jQuery.fn.extend( {
8390
	attr: function( name, value ) {
8391
		return access( this, jQuery.attr, name, value, arguments.length > 1 );
8392
	},
8393
8394
	removeAttr: function( name ) {
8395
		return this.each( function() {
8396
			jQuery.removeAttr( this, name );
8397
		} );
8398
	}
8399
} );
8400
8401
jQuery.extend( {
8402
	attr: function( elem, name, value ) {
8403
		var ret, hooks,
8404
			nType = elem.nodeType;
8405
8406
		// Don't get/set attributes on text, comment and attribute nodes
8407
		if ( nType === 3 || nType === 8 || nType === 2 ) {
8408
			return;
8409
		}
8410
8411
		// Fallback to prop when attributes are not supported
8412
		if ( typeof elem.getAttribute === "undefined" ) {
8413
			return jQuery.prop( elem, name, value );
8414
		}
8415
8416
		// All attributes are lowercase
8417
		// Grab necessary hook if one is defined
8418
		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
8419
			name = name.toLowerCase();
8420
			hooks = jQuery.attrHooks[ name ] ||
8421
				( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
8422
		}
8423
8424
		if ( value !== undefined ) {
8425
			if ( value === null ) {
8426
				jQuery.removeAttr( elem, name );
8427
				return;
8428
			}
8429
8430
			if ( hooks && "set" in hooks &&
8431
				( ret = hooks.set( elem, value, name ) ) !== undefined ) {
8432
				return ret;
8433
			}
8434
8435
			elem.setAttribute( name, value + "" );
8436
			return value;
8437
		}
8438
8439
		if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
8440
			return ret;
8441
		}
8442
8443
		ret = jQuery.find.attr( elem, name );
8444
8445
		// Non-existent attributes return null, we normalize to undefined
8446
		return ret == null ? undefined : ret;
8447
	},
8448
8449
	attrHooks: {
8450
		type: {
8451
			set: function( elem, value ) {
8452
				if ( !support.radioValue && value === "radio" &&
8453
					jQuery.nodeName( elem, "input" ) ) {
8454
8455
					// Setting the type on a radio button after the value resets the value in IE8-9
8456
					// Reset value to default in case type is set after value during creation
8457
					var val = elem.value;
8458
					elem.setAttribute( "type", value );
8459
					if ( val ) {
8460
						elem.value = val;
8461
					}
8462
					return value;
8463
				}
8464
			}
8465
		}
8466
	},
8467
8468
	removeAttr: function( elem, value ) {
8469
		var name, propName,
8470
			i = 0,
8471
			attrNames = value && value.match( rnotwhite );
8472
8473
		if ( attrNames && elem.nodeType === 1 ) {
8474
			while ( ( name = attrNames[ i++ ] ) ) {
8475
				propName = jQuery.propFix[ name ] || name;
8476
8477
				// Boolean attributes get special treatment (#10870)
8478
				if ( jQuery.expr.match.bool.test( name ) ) {
8479
8480
					// Set corresponding property to false
8481
					if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8482
						elem[ propName ] = false;
8483
8484
					// Support: IE<9
8485
					// Also clear defaultChecked/defaultSelected (if appropriate)
8486
					} else {
8487
						elem[ jQuery.camelCase( "default-" + name ) ] =
8488
							elem[ propName ] = false;
8489
					}
8490
8491
				// See #9699 for explanation of this approach (setting first, then removal)
8492
				} else {
8493
					jQuery.attr( elem, name, "" );
8494
				}
8495
8496
				elem.removeAttribute( getSetAttribute ? name : propName );
8497
			}
8498
		}
8499
	}
8500
} );
8501
8502
// Hooks for boolean attributes
8503
boolHook = {
8504
	set: function( elem, value, name ) {
8505
		if ( value === false ) {
8506
8507
			// Remove boolean attributes when set to false
8508
			jQuery.removeAttr( elem, name );
8509
		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8510
8511
			// IE<8 needs the *property* name
8512
			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
8513
8514
		} else {
8515
8516
			// Support: IE<9
8517
			// Use defaultChecked and defaultSelected for oldIE
8518
			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
8519
		}
8520
		return name;
8521
	}
8522
};
8523
8524
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8525
	var getter = attrHandle[ name ] || jQuery.find.attr;
8526
8527
	if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8528
		attrHandle[ name ] = function( elem, name, isXML ) {
8529
			var ret, handle;
8530
			if ( !isXML ) {
8531
8532
				// Avoid an infinite loop by temporarily removing this function from the getter
8533
				handle = attrHandle[ name ];
8534
				attrHandle[ name ] = ret;
8535
				ret = getter( elem, name, isXML ) != null ?
8536
					name.toLowerCase() :
8537
					null;
8538
				attrHandle[ name ] = handle;
8539
			}
8540
			return ret;
8541
		};
8542
	} else {
8543
		attrHandle[ name ] = function( elem, name, isXML ) {
8544
			if ( !isXML ) {
8545
				return elem[ jQuery.camelCase( "default-" + name ) ] ?
8546
					name.toLowerCase() :
8547
					null;
8548
			}
8549
		};
8550
	}
8551
} );
8552
8553
// fix oldIE attroperties
8554
if ( !getSetInput || !getSetAttribute ) {
8555
	jQuery.attrHooks.value = {
8556
		set: function( elem, value, name ) {
8557
			if ( jQuery.nodeName( elem, "input" ) ) {
8558
8559
				// Does not return so that setAttribute is also used
8560
				elem.defaultValue = value;
8561
			} else {
8562
8563
				// Use nodeHook if defined (#1954); otherwise setAttribute is fine
8564
				return nodeHook && nodeHook.set( elem, value, name );
8565
			}
8566
		}
8567
	};
8568
}
8569
8570
// IE6/7 do not support getting/setting some attributes with get/setAttribute
8571
if ( !getSetAttribute ) {
8572
8573
	// Use this for any attribute in IE6/7
8574
	// This fixes almost every IE6/7 issue
8575
	nodeHook = {
8576
		set: function( elem, value, name ) {
8577
8578
			// Set the existing or create a new attribute node
8579
			var ret = elem.getAttributeNode( name );
8580
			if ( !ret ) {
8581
				elem.setAttributeNode(
8582
					( ret = elem.ownerDocument.createAttribute( name ) )
8583
				);
8584
			}
8585
8586
			ret.value = value += "";
8587
8588
			// Break association with cloned elements by also using setAttribute (#9646)
8589
			if ( name === "value" || value === elem.getAttribute( name ) ) {
8590
				return value;
8591
			}
8592
		}
8593
	};
8594
8595
	// Some attributes are constructed with empty-string values when not defined
8596
	attrHandle.id = attrHandle.name = attrHandle.coords =
8597
		function( elem, name, isXML ) {
8598
			var ret;
8599
			if ( !isXML ) {
8600
				return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
8601
					ret.value :
8602
					null;
8603
			}
8604
		};
8605
8606
	// Fixing value retrieval on a button requires this module
8607
	jQuery.valHooks.button = {
8608
		get: function( elem, name ) {
8609
			var ret = elem.getAttributeNode( name );
8610
			if ( ret && ret.specified ) {
8611
				return ret.value;
8612
			}
8613
		},
8614
		set: nodeHook.set
8615
	};
8616
8617
	// Set contenteditable to false on removals(#10429)
8618
	// Setting to empty string throws an error as an invalid value
8619
	jQuery.attrHooks.contenteditable = {
8620
		set: function( elem, value, name ) {
8621
			nodeHook.set( elem, value === "" ? false : value, name );
8622
		}
8623
	};
8624
8625
	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
8626
	// This is for removals
8627
	jQuery.each( [ "width", "height" ], function( i, name ) {
8628
		jQuery.attrHooks[ name ] = {
8629
			set: function( elem, value ) {
8630
				if ( value === "" ) {
8631
					elem.setAttribute( name, "auto" );
8632
					return value;
8633
				}
8634
			}
8635
		};
8636
	} );
8637
}
8638
8639
if ( !support.style ) {
8640
	jQuery.attrHooks.style = {
8641
		get: function( elem ) {
8642
8643
			// Return undefined in the case of empty string
8644
			// Note: IE uppercases css property names, but if we were to .toLowerCase()
8645
			// .cssText, that would destroy case sensitivity in URL's, like in "background"
8646
			return elem.style.cssText || undefined;
8647
		},
8648
		set: function( elem, value ) {
8649
			return ( elem.style.cssText = value + "" );
8650
		}
8651
	};
8652
}
8653
8654
8655
8656
8657
var rfocusable = /^(?:input|select|textarea|button|object)$/i,
8658
	rclickable = /^(?:a|area)$/i;
8659
8660
jQuery.fn.extend( {
8661
	prop: function( name, value ) {
8662
		return access( this, jQuery.prop, name, value, arguments.length > 1 );
8663
	},
8664
8665
	removeProp: function( name ) {
8666
		name = jQuery.propFix[ name ] || name;
8667
		return this.each( function() {
8668
8669
			// try/catch handles cases where IE balks (such as removing a property on window)
8670
			try {
8671
				this[ name ] = undefined;
8672
				delete this[ name ];
8673
			} catch ( e ) {}
8674
		} );
8675
	}
8676
} );
8677
8678
jQuery.extend( {
8679
	prop: function( elem, name, value ) {
8680
		var ret, hooks,
8681
			nType = elem.nodeType;
8682
8683
		// Don't get/set properties on text, comment and attribute nodes
8684
		if ( nType === 3 || nType === 8 || nType === 2 ) {
8685
			return;
8686
		}
8687
8688
		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
8689
8690
			// Fix name and attach hooks
8691
			name = jQuery.propFix[ name ] || name;
8692
			hooks = jQuery.propHooks[ name ];
8693
		}
8694
8695
		if ( value !== undefined ) {
8696
			if ( hooks && "set" in hooks &&
8697
				( ret = hooks.set( elem, value, name ) ) !== undefined ) {
8698
				return ret;
8699
			}
8700
8701
			return ( elem[ name ] = value );
8702
		}
8703
8704
		if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
8705
			return ret;
8706
		}
8707
8708
		return elem[ name ];
8709
	},
8710
8711
	propHooks: {
8712
		tabIndex: {
8713
			get: function( elem ) {
8714
8715
				// elem.tabIndex doesn't always return the
8716
				// correct value when it hasn't been explicitly set
8717
				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8718
				// Use proper attribute retrieval(#12072)
8719
				var tabindex = jQuery.find.attr( elem, "tabindex" );
8720
8721
				return tabindex ?
8722
					parseInt( tabindex, 10 ) :
8723
					rfocusable.test( elem.nodeName ) ||
8724
						rclickable.test( elem.nodeName ) && elem.href ?
8725
							0 :
8726
							-1;
8727
			}
8728
		}
8729
	},
8730
8731
	propFix: {
8732
		"for": "htmlFor",
8733
		"class": "className"
8734
	}
8735
} );
8736
8737
// Some attributes require a special call on IE
8738
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
8739
if ( !support.hrefNormalized ) {
8740
8741
	// href/src property should get the full normalized URL (#10299/#12915)
8742
	jQuery.each( [ "href", "src" ], function( i, name ) {
8743
		jQuery.propHooks[ name ] = {
8744
			get: function( elem ) {
8745
				return elem.getAttribute( name, 4 );
8746
			}
8747
		};
8748
	} );
8749
}
8750
8751
// Support: Safari, IE9+
8752
// mis-reports the default selected property of an option
8753
// Accessing the parent's selectedIndex property fixes it
8754
if ( !support.optSelected ) {
8755
	jQuery.propHooks.selected = {
8756
		get: function( elem ) {
8757
			var parent = elem.parentNode;
8758
8759
			if ( parent ) {
8760
				parent.selectedIndex;
8761
8762
				// Make sure that it also works with optgroups, see #5701
8763
				if ( parent.parentNode ) {
8764
					parent.parentNode.selectedIndex;
8765
				}
8766
			}
8767
			return null;
8768
		}
8769
	};
8770
}
8771
8772
jQuery.each( [
8773
	"tabIndex",
8774
	"readOnly",
8775
	"maxLength",
8776
	"cellSpacing",
8777
	"cellPadding",
8778
	"rowSpan",
8779
	"colSpan",
8780
	"useMap",
8781
	"frameBorder",
8782
	"contentEditable"
8783
], function() {
8784
	jQuery.propFix[ this.toLowerCase() ] = this;
8785
} );
8786
8787
// IE6/7 call enctype encoding
8788
if ( !support.enctype ) {
8789
	jQuery.propFix.enctype = "encoding";
8790
}
8791
8792
8793
8794
8795
var rclass = /[\t\r\n\f]/g;
8796
8797
function getClass( elem ) {
8798
	return jQuery.attr( elem, "class" ) || "";
8799
}
8800
8801
jQuery.fn.extend( {
8802
	addClass: function( value ) {
8803
		var classes, elem, cur, curValue, clazz, j, finalValue,
8804
			i = 0;
8805
8806
		if ( jQuery.isFunction( value ) ) {
8807
			return this.each( function( j ) {
8808
				jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
8809
			} );
8810
		}
8811
8812
		if ( typeof value === "string" && value ) {
8813
			classes = value.match( rnotwhite ) || [];
8814
8815
			while ( ( elem = this[ i++ ] ) ) {
8816
				curValue = getClass( elem );
8817
				cur = elem.nodeType === 1 &&
8818
					( " " + curValue + " " ).replace( rclass, " " );
8819
8820
				if ( cur ) {
8821
					j = 0;
8822
					while ( ( clazz = classes[ j++ ] ) ) {
8823
						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8824
							cur += clazz + " ";
8825
						}
8826
					}
8827
8828
					// only assign if different to avoid unneeded rendering.
8829
					finalValue = jQuery.trim( cur );
8830
					if ( curValue !== finalValue ) {
8831
						jQuery.attr( elem, "class", finalValue );
8832
					}
8833
				}
8834
			}
8835
		}
8836
8837
		return this;
8838
	},
8839
8840
	removeClass: function( value ) {
8841
		var classes, elem, cur, curValue, clazz, j, finalValue,
8842
			i = 0;
8843
8844
		if ( jQuery.isFunction( value ) ) {
8845
			return this.each( function( j ) {
8846
				jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
8847
			} );
8848
		}
8849
8850
		if ( !arguments.length ) {
8851
			return this.attr( "class", "" );
8852
		}
8853
8854
		if ( typeof value === "string" && value ) {
8855
			classes = value.match( rnotwhite ) || [];
8856
8857
			while ( ( elem = this[ i++ ] ) ) {
8858
				curValue = getClass( elem );
8859
8860
				// This expression is here for better compressibility (see addClass)
8861
				cur = elem.nodeType === 1 &&
8862
					( " " + curValue + " " ).replace( rclass, " " );
8863
8864
				if ( cur ) {
8865
					j = 0;
8866
					while ( ( clazz = classes[ j++ ] ) ) {
8867
8868
						// Remove *all* instances
8869
						while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8870
							cur = cur.replace( " " + clazz + " ", " " );
8871
						}
8872
					}
8873
8874
					// Only assign if different to avoid unneeded rendering.
8875
					finalValue = jQuery.trim( cur );
8876
					if ( curValue !== finalValue ) {
8877
						jQuery.attr( elem, "class", finalValue );
8878
					}
8879
				}
8880
			}
8881
		}
8882
8883
		return this;
8884
	},
8885
8886
	toggleClass: function( value, stateVal ) {
8887
		var type = typeof value;
8888
8889
		if ( typeof stateVal === "boolean" && type === "string" ) {
8890
			return stateVal ? this.addClass( value ) : this.removeClass( value );
8891
		}
8892
8893
		if ( jQuery.isFunction( value ) ) {
8894
			return this.each( function( i ) {
8895
				jQuery( this ).toggleClass(
8896
					value.call( this, i, getClass( this ), stateVal ),
8897
					stateVal
8898
				);
8899
			} );
8900
		}
8901
8902
		return this.each( function() {
8903
			var className, i, self, classNames;
8904
8905
			if ( type === "string" ) {
8906
8907
				// Toggle individual class names
8908
				i = 0;
8909
				self = jQuery( this );
8910
				classNames = value.match( rnotwhite ) || [];
8911
8912
				while ( ( className = classNames[ i++ ] ) ) {
8913
8914
					// Check each className given, space separated list
8915
					if ( self.hasClass( className ) ) {
8916
						self.removeClass( className );
8917
					} else {
8918
						self.addClass( className );
8919
					}
8920
				}
8921
8922
			// Toggle whole class name
8923
			} else if ( value === undefined || type === "boolean" ) {
8924
				className = getClass( this );
8925
				if ( className ) {
8926
8927
					// store className if set
8928
					jQuery._data( this, "__className__", className );
8929
				}
8930
8931
				// If the element has a class name or if we're passed "false",
8932
				// then remove the whole classname (if there was one, the above saved it).
8933
				// Otherwise bring back whatever was previously saved (if anything),
8934
				// falling back to the empty string if nothing was stored.
8935
				jQuery.attr( this, "class",
8936
					className || value === false ?
8937
					"" :
8938
					jQuery._data( this, "__className__" ) || ""
8939
				);
8940
			}
8941
		} );
8942
	},
8943
8944
	hasClass: function( selector ) {
8945
		var className, elem,
8946
			i = 0;
8947
8948
		className = " " + selector + " ";
8949
		while ( ( elem = this[ i++ ] ) ) {
8950
			if ( elem.nodeType === 1 &&
8951
				( " " + getClass( elem ) + " " ).replace( rclass, " " )
8952
					.indexOf( className ) > -1
8953
			) {
8954
				return true;
8955
			}
8956
		}
8957
8958
		return false;
8959
	}
8960
} );
8961
8962
8963
8964
8965
// Return jQuery for attributes-only inclusion
8966
8967
8968
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
8969
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8970
	"change select submit keydown keypress keyup error contextmenu" ).split( " " ),
8971
	function( i, name ) {
8972
8973
	// Handle event binding
8974
	jQuery.fn[ name ] = function( data, fn ) {
8975
		return arguments.length > 0 ?
8976
			this.on( name, null, data, fn ) :
8977
			this.trigger( name );
8978
	};
8979
} );
8980
8981
jQuery.fn.extend( {
8982
	hover: function( fnOver, fnOut ) {
8983
		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8984
	}
8985
} );
8986
8987
8988
var location = window.location;
8989
8990
var nonce = jQuery.now();
8991
8992
var rquery = ( /\?/ );
8993
8994
8995
8996
var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
8997
8998
jQuery.parseJSON = function( data ) {
8999
9000
	// Attempt to parse using the native JSON parser first
9001
	if ( window.JSON && window.JSON.parse ) {
9002
9003
		// Support: Android 2.3
9004
		// Workaround failure to string-cast null input
9005
		return window.JSON.parse( data + "" );
9006
	}
9007
9008
	var requireNonComma,
9009
		depth = null,
9010
		str = jQuery.trim( data + "" );
9011
9012
	// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
9013
	// after removing valid tokens
9014
	return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
9015
9016
		// Force termination if we see a misplaced comma
9017
		if ( requireNonComma && comma ) {
9018
			depth = 0;
9019
		}
9020
9021
		// Perform no more replacements after returning to outermost depth
9022
		if ( depth === 0 ) {
9023
			return token;
9024
		}
9025
9026
		// Commas must not follow "[", "{", or ","
9027
		requireNonComma = open || comma;
9028
9029
		// Determine new depth
9030
		// array/object open ("[" or "{"): depth += true - false (increment)
9031
		// array/object close ("]" or "}"): depth += false - true (decrement)
9032
		// other cases ("," or primitive): depth += true - true (numeric cast)
9033
		depth += !close - !open;
9034
9035
		// Remove this token
9036
		return "";
9037
	} ) ) ?
9038
		( Function( "return " + str ) )() :
9039
		jQuery.error( "Invalid JSON: " + data );
9040
};
9041
9042
9043
// Cross-browser xml parsing
9044
jQuery.parseXML = function( data ) {
9045
	var xml, tmp;
9046
	if ( !data || typeof data !== "string" ) {
9047
		return null;
9048
	}
9049
	try {
9050
		if ( window.DOMParser ) { // Standard
9051
			tmp = new window.DOMParser();
9052
			xml = tmp.parseFromString( data, "text/xml" );
9053
		} else { // IE
9054
			xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
9055
			xml.async = "false";
9056
			xml.loadXML( data );
9057
		}
9058
	} catch ( e ) {
9059
		xml = undefined;
9060
	}
9061
	if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
9062
		jQuery.error( "Invalid XML: " + data );
9063
	}
9064
	return xml;
9065
};
9066
9067
9068
var
9069
	rhash = /#.*$/,
9070
	rts = /([?&])_=[^&]*/,
9071
9072
	// IE leaves an \r character at EOL
9073
	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
9074
9075
	// #7653, #8125, #8152: local protocol detection
9076
	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
9077
	rnoContent = /^(?:GET|HEAD)$/,
9078
	rprotocol = /^\/\//,
9079
	rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
9080
9081
	/* Prefilters
9082
	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
9083
	 * 2) These are called:
9084
	 *    - BEFORE asking for a transport
9085
	 *    - AFTER param serialization (s.data is a string if s.processData is true)
9086
	 * 3) key is the dataType
9087
	 * 4) the catchall symbol "*" can be used
9088
	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
9089
	 */
9090
	prefilters = {},
9091
9092
	/* Transports bindings
9093
	 * 1) key is the dataType
9094
	 * 2) the catchall symbol "*" can be used
9095
	 * 3) selection will start with transport dataType and THEN go to "*" if needed
9096
	 */
9097
	transports = {},
9098
9099
	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
9100
	allTypes = "*/".concat( "*" ),
9101
9102
	// Document location
9103
	ajaxLocation = location.href,
9104
9105
	// Segment location into parts
9106
	ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
9107
9108
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
9109
function addToPrefiltersOrTransports( structure ) {
9110
9111
	// dataTypeExpression is optional and defaults to "*"
9112
	return function( dataTypeExpression, func ) {
9113
9114
		if ( typeof dataTypeExpression !== "string" ) {
9115
			func = dataTypeExpression;
9116
			dataTypeExpression = "*";
9117
		}
9118
9119
		var dataType,
9120
			i = 0,
9121
			dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
9122
9123
		if ( jQuery.isFunction( func ) ) {
9124
9125
			// For each dataType in the dataTypeExpression
9126
			while ( ( dataType = dataTypes[ i++ ] ) ) {
9127
9128
				// Prepend if requested
9129
				if ( dataType.charAt( 0 ) === "+" ) {
9130
					dataType = dataType.slice( 1 ) || "*";
9131
					( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
9132
9133
				// Otherwise append
9134
				} else {
9135
					( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
9136
				}
9137
			}
9138
		}
9139
	};
9140
}
9141
9142
// Base inspection function for prefilters and transports
9143
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
9144
9145
	var inspected = {},
9146
		seekingTransport = ( structure === transports );
9147
9148
	function inspect( dataType ) {
9149
		var selected;
9150
		inspected[ dataType ] = true;
9151
		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
9152
			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
9153
			if ( typeof dataTypeOrTransport === "string" &&
9154
				!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
9155
9156
				options.dataTypes.unshift( dataTypeOrTransport );
9157
				inspect( dataTypeOrTransport );
9158
				return false;
9159
			} else if ( seekingTransport ) {
9160
				return !( selected = dataTypeOrTransport );
9161
			}
9162
		} );
9163
		return selected;
9164
	}
9165
9166
	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
9167
}
9168
9169
// A special extend for ajax options
9170
// that takes "flat" options (not to be deep extended)
9171
// Fixes #9887
9172
function ajaxExtend( target, src ) {
9173
	var deep, key,
9174
		flatOptions = jQuery.ajaxSettings.flatOptions || {};
9175
9176
	for ( key in src ) {
9177
		if ( src[ key ] !== undefined ) {
9178
			( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
9179
		}
9180
	}
9181
	if ( deep ) {
9182
		jQuery.extend( true, target, deep );
9183
	}
9184
9185
	return target;
9186
}
9187
9188
/* Handles responses to an ajax request:
9189
 * - finds the right dataType (mediates between content-type and expected dataType)
9190
 * - returns the corresponding response
9191
 */
9192
function ajaxHandleResponses( s, jqXHR, responses ) {
9193
	var firstDataType, ct, finalDataType, type,
9194
		contents = s.contents,
9195
		dataTypes = s.dataTypes;
9196
9197
	// Remove auto dataType and get content-type in the process
9198
	while ( dataTypes[ 0 ] === "*" ) {
9199
		dataTypes.shift();
9200
		if ( ct === undefined ) {
9201
			ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
9202
		}
9203
	}
9204
9205
	// Check if we're dealing with a known content-type
9206
	if ( ct ) {
9207
		for ( type in contents ) {
9208
			if ( contents[ type ] && contents[ type ].test( ct ) ) {
9209
				dataTypes.unshift( type );
9210
				break;
9211
			}
9212
		}
9213
	}
9214
9215
	// Check to see if we have a response for the expected dataType
9216
	if ( dataTypes[ 0 ] in responses ) {
9217
		finalDataType = dataTypes[ 0 ];
9218
	} else {
9219
9220
		// Try convertible dataTypes
9221
		for ( type in responses ) {
9222
			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
9223
				finalDataType = type;
9224
				break;
9225
			}
9226
			if ( !firstDataType ) {
9227
				firstDataType = type;
9228
			}
9229
		}
9230
9231
		// Or just use first one
9232
		finalDataType = finalDataType || firstDataType;
9233
	}
9234
9235
	// If we found a dataType
9236
	// We add the dataType to the list if needed
9237
	// and return the corresponding response
9238
	if ( finalDataType ) {
9239
		if ( finalDataType !== dataTypes[ 0 ] ) {
9240
			dataTypes.unshift( finalDataType );
9241
		}
9242
		return responses[ finalDataType ];
9243
	}
9244
}
9245
9246
/* Chain conversions given the request and the original response
9247
 * Also sets the responseXXX fields on the jqXHR instance
9248
 */
9249
function ajaxConvert( s, response, jqXHR, isSuccess ) {
9250
	var conv2, current, conv, tmp, prev,
9251
		converters = {},
9252
9253
		// Work with a copy of dataTypes in case we need to modify it for conversion
9254
		dataTypes = s.dataTypes.slice();
9255
9256
	// Create converters map with lowercased keys
9257
	if ( dataTypes[ 1 ] ) {
9258
		for ( conv in s.converters ) {
9259
			converters[ conv.toLowerCase() ] = s.converters[ conv ];
9260
		}
9261
	}
9262
9263
	current = dataTypes.shift();
9264
9265
	// Convert to each sequential dataType
9266
	while ( current ) {
9267
9268
		if ( s.responseFields[ current ] ) {
9269
			jqXHR[ s.responseFields[ current ] ] = response;
9270
		}
9271
9272
		// Apply the dataFilter if provided
9273
		if ( !prev && isSuccess && s.dataFilter ) {
9274
			response = s.dataFilter( response, s.dataType );
9275
		}
9276
9277
		prev = current;
9278
		current = dataTypes.shift();
9279
9280
		if ( current ) {
9281
9282
			// There's only work to do if current dataType is non-auto
9283
			if ( current === "*" ) {
9284
9285
				current = prev;
9286
9287
			// Convert response if prev dataType is non-auto and differs from current
9288
			} else if ( prev !== "*" && prev !== current ) {
9289
9290
				// Seek a direct converter
9291
				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
9292
9293
				// If none found, seek a pair
9294
				if ( !conv ) {
9295
					for ( conv2 in converters ) {
9296
9297
						// If conv2 outputs current
9298
						tmp = conv2.split( " " );
9299
						if ( tmp[ 1 ] === current ) {
9300
9301
							// If prev can be converted to accepted input
9302
							conv = converters[ prev + " " + tmp[ 0 ] ] ||
9303
								converters[ "* " + tmp[ 0 ] ];
9304
							if ( conv ) {
9305
9306
								// Condense equivalence converters
9307
								if ( conv === true ) {
9308
									conv = converters[ conv2 ];
9309
9310
								// Otherwise, insert the intermediate dataType
9311
								} else if ( converters[ conv2 ] !== true ) {
9312
									current = tmp[ 0 ];
9313
									dataTypes.unshift( tmp[ 1 ] );
9314
								}
9315
								break;
9316
							}
9317
						}
9318
					}
9319
				}
9320
9321
				// Apply converter (if not an equivalence)
9322
				if ( conv !== true ) {
9323
9324
					// Unless errors are allowed to bubble, catch and return them
9325
					if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation
9326
						response = conv( response );
9327
					} else {
9328
						try {
9329
							response = conv( response );
9330
						} catch ( e ) {
9331
							return {
9332
								state: "parsererror",
9333
								error: conv ? e : "No conversion from " + prev + " to " + current
9334
							};
9335
						}
9336
					}
9337
				}
9338
			}
9339
		}
9340
	}
9341
9342
	return { state: "success", data: response };
9343
}
9344
9345
jQuery.extend( {
9346
9347
	// Counter for holding the number of active queries
9348
	active: 0,
9349
9350
	// Last-Modified header cache for next request
9351
	lastModified: {},
9352
	etag: {},
9353
9354
	ajaxSettings: {
9355
		url: ajaxLocation,
9356
		type: "GET",
9357
		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
9358
		global: true,
9359
		processData: true,
9360
		async: true,
9361
		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
9362
		/*
9363
		timeout: 0,
9364
		data: null,
9365
		dataType: null,
9366
		username: null,
9367
		password: null,
9368
		cache: null,
9369
		throws: false,
9370
		traditional: false,
9371
		headers: {},
9372
		*/
9373
9374
		accepts: {
9375
			"*": allTypes,
9376
			text: "text/plain",
9377
			html: "text/html",
9378
			xml: "application/xml, text/xml",
9379
			json: "application/json, text/javascript"
9380
		},
9381
9382
		contents: {
9383
			xml: /\bxml\b/,
9384
			html: /\bhtml/,
9385
			json: /\bjson\b/
9386
		},
9387
9388
		responseFields: {
9389
			xml: "responseXML",
9390
			text: "responseText",
9391
			json: "responseJSON"
9392
		},
9393
9394
		// Data converters
9395
		// Keys separate source (or catchall "*") and destination types with a single space
9396
		converters: {
9397
9398
			// Convert anything to text
9399
			"* text": String,
9400
9401
			// Text to html (true = no transformation)
9402
			"text html": true,
9403
9404
			// Evaluate text as a json expression
9405
			"text json": jQuery.parseJSON,
9406
9407
			// Parse text as xml
9408
			"text xml": jQuery.parseXML
9409
		},
9410
9411
		// For options that shouldn't be deep extended:
9412
		// you can add your own custom options here if
9413
		// and when you create one that shouldn't be
9414
		// deep extended (see ajaxExtend)
9415
		flatOptions: {
9416
			url: true,
9417
			context: true
9418
		}
9419
	},
9420
9421
	// Creates a full fledged settings object into target
9422
	// with both ajaxSettings and settings fields.
9423
	// If target is omitted, writes into ajaxSettings.
9424
	ajaxSetup: function( target, settings ) {
9425
		return settings ?
9426
9427
			// Building a settings object
9428
			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
9429
9430
			// Extending ajaxSettings
9431
			ajaxExtend( jQuery.ajaxSettings, target );
9432
	},
9433
9434
	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
9435
	ajaxTransport: addToPrefiltersOrTransports( transports ),
9436
9437
	// Main method
9438
	ajax: function( url, options ) {
9439
9440
		// If url is an object, simulate pre-1.5 signature
9441
		if ( typeof url === "object" ) {
9442
			options = url;
9443
			url = undefined;
9444
		}
9445
9446
		// Force options to be an object
9447
		options = options || {};
9448
9449
		var
9450
9451
			// Cross-domain detection vars
9452
			parts,
9453
9454
			// Loop variable
9455
			i,
9456
9457
			// URL without anti-cache param
9458
			cacheURL,
9459
9460
			// Response headers as string
9461
			responseHeadersString,
9462
9463
			// timeout handle
9464
			timeoutTimer,
9465
9466
			// To know if global events are to be dispatched
9467
			fireGlobals,
9468
9469
			transport,
9470
9471
			// Response headers
9472
			responseHeaders,
9473
9474
			// Create the final options object
9475
			s = jQuery.ajaxSetup( {}, options ),
9476
9477
			// Callbacks context
9478
			callbackContext = s.context || s,
9479
9480
			// Context for global events is callbackContext if it is a DOM node or jQuery collection
9481
			globalEventContext = s.context &&
9482
				( callbackContext.nodeType || callbackContext.jquery ) ?
9483
					jQuery( callbackContext ) :
9484
					jQuery.event,
9485
9486
			// Deferreds
9487
			deferred = jQuery.Deferred(),
9488
			completeDeferred = jQuery.Callbacks( "once memory" ),
9489
9490
			// Status-dependent callbacks
9491
			statusCode = s.statusCode || {},
9492
9493
			// Headers (they are sent all at once)
9494
			requestHeaders = {},
9495
			requestHeadersNames = {},
9496
9497
			// The jqXHR state
9498
			state = 0,
9499
9500
			// Default abort message
9501
			strAbort = "canceled",
9502
9503
			// Fake xhr
9504
			jqXHR = {
9505
				readyState: 0,
9506
9507
				// Builds headers hashtable if needed
9508
				getResponseHeader: function( key ) {
9509
					var match;
9510
					if ( state === 2 ) {
9511
						if ( !responseHeaders ) {
9512
							responseHeaders = {};
9513
							while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
9514
								responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
9515
							}
9516
						}
9517
						match = responseHeaders[ key.toLowerCase() ];
9518
					}
9519
					return match == null ? null : match;
9520
				},
9521
9522
				// Raw string
9523
				getAllResponseHeaders: function() {
9524
					return state === 2 ? responseHeadersString : null;
9525
				},
9526
9527
				// Caches the header
9528
				setRequestHeader: function( name, value ) {
9529
					var lname = name.toLowerCase();
9530
					if ( !state ) {
9531
						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
9532
						requestHeaders[ name ] = value;
9533
					}
9534
					return this;
9535
				},
9536
9537
				// Overrides response content-type header
9538
				overrideMimeType: function( type ) {
9539
					if ( !state ) {
9540
						s.mimeType = type;
9541
					}
9542
					return this;
9543
				},
9544
9545
				// Status-dependent callbacks
9546
				statusCode: function( map ) {
9547
					var code;
9548
					if ( map ) {
9549
						if ( state < 2 ) {
9550
							for ( code in map ) {
9551
9552
								// Lazy-add the new callback in a way that preserves old ones
9553
								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9554
							}
9555
						} else {
9556
9557
							// Execute the appropriate callbacks
9558
							jqXHR.always( map[ jqXHR.status ] );
9559
						}
9560
					}
9561
					return this;
9562
				},
9563
9564
				// Cancel the request
9565
				abort: function( statusText ) {
9566
					var finalText = statusText || strAbort;
9567
					if ( transport ) {
9568
						transport.abort( finalText );
9569
					}
9570
					done( 0, finalText );
9571
					return this;
9572
				}
9573
			};
9574
9575
		// Attach deferreds
9576
		deferred.promise( jqXHR ).complete = completeDeferred.add;
9577
		jqXHR.success = jqXHR.done;
9578
		jqXHR.error = jqXHR.fail;
9579
9580
		// Remove hash character (#7531: and string promotion)
9581
		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
9582
		// Handle falsy url in the settings object (#10093: consistency with old signature)
9583
		// We also use the url parameter if available
9584
		s.url = ( ( url || s.url || ajaxLocation ) + "" )
9585
			.replace( rhash, "" )
9586
			.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
9587
9588
		// Alias method option to type as per ticket #12004
9589
		s.type = options.method || options.type || s.method || s.type;
9590
9591
		// Extract dataTypes list
9592
		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
9593
9594
		// A cross-domain request is in order when we have a protocol:host:port mismatch
9595
		if ( s.crossDomain == null ) {
9596
			parts = rurl.exec( s.url.toLowerCase() );
9597
			s.crossDomain = !!( parts &&
9598
				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
9599
					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
9600
						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
9601
			);
9602
		}
9603
9604
		// Convert data if not already a string
9605
		if ( s.data && s.processData && typeof s.data !== "string" ) {
9606
			s.data = jQuery.param( s.data, s.traditional );
9607
		}
9608
9609
		// Apply prefilters
9610
		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9611
9612
		// If request was aborted inside a prefilter, stop there
9613
		if ( state === 2 ) {
9614
			return jqXHR;
9615
		}
9616
9617
		// We can fire global events as of now if asked to
9618
		// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9619
		fireGlobals = jQuery.event && s.global;
9620
9621
		// Watch for a new set of requests
9622
		if ( fireGlobals && jQuery.active++ === 0 ) {
9623
			jQuery.event.trigger( "ajaxStart" );
9624
		}
9625
9626
		// Uppercase the type
9627
		s.type = s.type.toUpperCase();
9628
9629
		// Determine if request has content
9630
		s.hasContent = !rnoContent.test( s.type );
9631
9632
		// Save the URL in case we're toying with the If-Modified-Since
9633
		// and/or If-None-Match header later on
9634
		cacheURL = s.url;
9635
9636
		// More options handling for requests with no content
9637
		if ( !s.hasContent ) {
9638
9639
			// If data is available, append data to url
9640
			if ( s.data ) {
9641
				cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
9642
9643
				// #9682: remove data so that it's not used in an eventual retry
9644
				delete s.data;
9645
			}
9646
9647
			// Add anti-cache in url if needed
9648
			if ( s.cache === false ) {
9649
				s.url = rts.test( cacheURL ) ?
9650
9651
					// If there is already a '_' parameter, set its value
9652
					cacheURL.replace( rts, "$1_=" + nonce++ ) :
9653
9654
					// Otherwise add one to the end
9655
					cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
9656
			}
9657
		}
9658
9659
		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9660
		if ( s.ifModified ) {
9661
			if ( jQuery.lastModified[ cacheURL ] ) {
9662
				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9663
			}
9664
			if ( jQuery.etag[ cacheURL ] ) {
9665
				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9666
			}
9667
		}
9668
9669
		// Set the correct header, if data is being sent
9670
		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9671
			jqXHR.setRequestHeader( "Content-Type", s.contentType );
9672
		}
9673
9674
		// Set the Accepts header for the server, depending on the dataType
9675
		jqXHR.setRequestHeader(
9676
			"Accept",
9677
			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
9678
				s.accepts[ s.dataTypes[ 0 ] ] +
9679
					( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9680
				s.accepts[ "*" ]
9681
		);
9682
9683
		// Check for headers option
9684
		for ( i in s.headers ) {
9685
			jqXHR.setRequestHeader( i, s.headers[ i ] );
9686
		}
9687
9688
		// Allow custom headers/mimetypes and early abort
9689
		if ( s.beforeSend &&
9690
			( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
9691
9692
			// Abort if not done already and return
9693
			return jqXHR.abort();
9694
		}
9695
9696
		// aborting is no longer a cancellation
9697
		strAbort = "abort";
9698
9699
		// Install callbacks on deferreds
9700
		for ( i in { success: 1, error: 1, complete: 1 } ) {
9701
			jqXHR[ i ]( s[ i ] );
9702
		}
9703
9704
		// Get transport
9705
		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9706
9707
		// If no transport, we auto-abort
9708
		if ( !transport ) {
9709
			done( -1, "No Transport" );
9710
		} else {
9711
			jqXHR.readyState = 1;
9712
9713
			// Send global event
9714
			if ( fireGlobals ) {
9715
				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9716
			}
9717
9718
			// If request was aborted inside ajaxSend, stop there
9719
			if ( state === 2 ) {
9720
				return jqXHR;
9721
			}
9722
9723
			// Timeout
9724
			if ( s.async && s.timeout > 0 ) {
9725
				timeoutTimer = window.setTimeout( function() {
9726
					jqXHR.abort( "timeout" );
9727
				}, s.timeout );
9728
			}
9729
9730
			try {
9731
				state = 1;
9732
				transport.send( requestHeaders, done );
9733
			} catch ( e ) {
9734
9735
				// Propagate exception as error if not done
9736
				if ( state < 2 ) {
9737
					done( -1, e );
9738
9739
				// Simply rethrow otherwise
9740
				} else {
9741
					throw e;
9742
				}
9743
			}
9744
		}
9745
9746
		// Callback for when everything is done
9747
		function done( status, nativeStatusText, responses, headers ) {
9748
			var isSuccess, success, error, response, modified,
9749
				statusText = nativeStatusText;
9750
9751
			// Called once
9752
			if ( state === 2 ) {
9753
				return;
9754
			}
9755
9756
			// State is "done" now
9757
			state = 2;
9758
9759
			// Clear timeout if it exists
9760
			if ( timeoutTimer ) {
9761
				window.clearTimeout( timeoutTimer );
9762
			}
9763
9764
			// Dereference transport for early garbage collection
9765
			// (no matter how long the jqXHR object will be used)
9766
			transport = undefined;
9767
9768
			// Cache response headers
9769
			responseHeadersString = headers || "";
9770
9771
			// Set readyState
9772
			jqXHR.readyState = status > 0 ? 4 : 0;
9773
9774
			// Determine if successful
9775
			isSuccess = status >= 200 && status < 300 || status === 304;
9776
9777
			// Get response data
9778
			if ( responses ) {
9779
				response = ajaxHandleResponses( s, jqXHR, responses );
9780
			}
9781
9782
			// Convert no matter what (that way responseXXX fields are always set)
9783
			response = ajaxConvert( s, response, jqXHR, isSuccess );
9784
9785
			// If successful, handle type chaining
9786
			if ( isSuccess ) {
9787
9788
				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9789
				if ( s.ifModified ) {
9790
					modified = jqXHR.getResponseHeader( "Last-Modified" );
9791
					if ( modified ) {
9792
						jQuery.lastModified[ cacheURL ] = modified;
9793
					}
9794
					modified = jqXHR.getResponseHeader( "etag" );
9795
					if ( modified ) {
9796
						jQuery.etag[ cacheURL ] = modified;
9797
					}
9798
				}
9799
9800
				// if no content
9801
				if ( status === 204 || s.type === "HEAD" ) {
9802
					statusText = "nocontent";
9803
9804
				// if not modified
9805
				} else if ( status === 304 ) {
9806
					statusText = "notmodified";
9807
9808
				// If we have data, let's convert it
9809
				} else {
9810
					statusText = response.state;
9811
					success = response.data;
9812
					error = response.error;
9813
					isSuccess = !error;
9814
				}
9815
			} else {
9816
9817
				// We extract error from statusText
9818
				// then normalize statusText and status for non-aborts
9819
				error = statusText;
9820
				if ( status || !statusText ) {
9821
					statusText = "error";
9822
					if ( status < 0 ) {
9823
						status = 0;
9824
					}
9825
				}
9826
			}
9827
9828
			// Set data for the fake xhr object
9829
			jqXHR.status = status;
9830
			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9831
9832
			// Success/Error
9833
			if ( isSuccess ) {
9834
				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9835
			} else {
9836
				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9837
			}
9838
9839
			// Status-dependent callbacks
9840
			jqXHR.statusCode( statusCode );
9841
			statusCode = undefined;
9842
9843
			if ( fireGlobals ) {
9844
				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9845
					[ jqXHR, s, isSuccess ? success : error ] );
9846
			}
9847
9848
			// Complete
9849
			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9850
9851
			if ( fireGlobals ) {
9852
				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9853
9854
				// Handle the global AJAX counter
9855
				if ( !( --jQuery.active ) ) {
9856
					jQuery.event.trigger( "ajaxStop" );
9857
				}
9858
			}
9859
		}
9860
9861
		return jqXHR;
9862
	},
9863
9864
	getJSON: function( url, data, callback ) {
9865
		return jQuery.get( url, data, callback, "json" );
9866
	},
9867
9868
	getScript: function( url, callback ) {
9869
		return jQuery.get( url, undefined, callback, "script" );
9870
	}
9871
} );
9872
9873
jQuery.each( [ "get", "post" ], function( i, method ) {
9874
	jQuery[ method ] = function( url, data, callback, type ) {
9875
9876
		// shift arguments if data argument was omitted
9877
		if ( jQuery.isFunction( data ) ) {
9878
			type = type || callback;
9879
			callback = data;
9880
			data = undefined;
9881
		}
9882
9883
		// The url can be an options object (which then must have .url)
9884
		return jQuery.ajax( jQuery.extend( {
9885
			url: url,
9886
			type: method,
9887
			dataType: type,
9888
			data: data,
9889
			success: callback
9890
		}, jQuery.isPlainObject( url ) && url ) );
9891
	};
9892
} );
9893
9894
9895
jQuery._evalUrl = function( url ) {
9896
	return jQuery.ajax( {
9897
		url: url,
9898
9899
		// Make this explicit, since user can override this through ajaxSetup (#11264)
9900
		type: "GET",
9901
		dataType: "script",
9902
		cache: true,
9903
		async: false,
9904
		global: false,
9905
		"throws": true
9906
	} );
9907
};
9908
9909
9910
jQuery.fn.extend( {
9911
	wrapAll: function( html ) {
9912
		if ( jQuery.isFunction( html ) ) {
9913
			return this.each( function( i ) {
9914
				jQuery( this ).wrapAll( html.call( this, i ) );
9915
			} );
9916
		}
9917
9918
		if ( this[ 0 ] ) {
9919
9920
			// The elements to wrap the target around
9921
			var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
9922
9923
			if ( this[ 0 ].parentNode ) {
9924
				wrap.insertBefore( this[ 0 ] );
9925
			}
9926
9927
			wrap.map( function() {
9928
				var elem = this;
9929
9930
				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
9931
					elem = elem.firstChild;
9932
				}
9933
9934
				return elem;
9935
			} ).append( this );
9936
		}
9937
9938
		return this;
9939
	},
9940
9941
	wrapInner: function( html ) {
9942
		if ( jQuery.isFunction( html ) ) {
9943
			return this.each( function( i ) {
9944
				jQuery( this ).wrapInner( html.call( this, i ) );
9945
			} );
9946
		}
9947
9948
		return this.each( function() {
9949
			var self = jQuery( this ),
9950
				contents = self.contents();
9951
9952
			if ( contents.length ) {
9953
				contents.wrapAll( html );
9954
9955
			} else {
9956
				self.append( html );
9957
			}
9958
		} );
9959
	},
9960
9961
	wrap: function( html ) {
9962
		var isFunction = jQuery.isFunction( html );
9963
9964
		return this.each( function( i ) {
9965
			jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
9966
		} );
9967
	},
9968
9969
	unwrap: function() {
9970
		return this.parent().each( function() {
9971
			if ( !jQuery.nodeName( this, "body" ) ) {
9972
				jQuery( this ).replaceWith( this.childNodes );
9973
			}
9974
		} ).end();
9975
	}
9976
} );
9977
9978
9979
function getDisplay( elem ) {
9980
	return elem.style && elem.style.display || jQuery.css( elem, "display" );
9981
}
9982
9983
function filterHidden( elem ) {
9984
	while ( elem && elem.nodeType === 1 ) {
9985
		if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
9986
			return true;
9987
		}
9988
		elem = elem.parentNode;
9989
	}
9990
	return false;
9991
}
9992
9993
jQuery.expr.filters.hidden = function( elem ) {
9994
9995
	// Support: Opera <= 12.12
9996
	// Opera reports offsetWidths and offsetHeights less than zero on some elements
9997
	return support.reliableHiddenOffsets() ?
9998
		( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
9999
			!elem.getClientRects().length ) :
10000
			filterHidden( elem );
10001
};
10002
10003
jQuery.expr.filters.visible = function( elem ) {
10004
	return !jQuery.expr.filters.hidden( elem );
10005
};
10006
10007
10008
10009
10010
var r20 = /%20/g,
10011
	rbracket = /\[\]$/,
10012
	rCRLF = /\r?\n/g,
10013
	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
10014
	rsubmittable = /^(?:input|select|textarea|keygen)/i;
10015
10016
function buildParams( prefix, obj, traditional, add ) {
10017
	var name;
10018
10019
	if ( jQuery.isArray( obj ) ) {
10020
10021
		// Serialize array item.
10022
		jQuery.each( obj, function( i, v ) {
10023
			if ( traditional || rbracket.test( prefix ) ) {
10024
10025
				// Treat each array item as a scalar.
10026
				add( prefix, v );
10027
10028
			} else {
10029
10030
				// Item is non-scalar (array or object), encode its numeric index.
10031
				buildParams(
10032
					prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
10033
					v,
10034
					traditional,
10035
					add
10036
				);
10037
			}
10038
		} );
10039
10040
	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
10041
10042
		// Serialize object item.
10043
		for ( name in obj ) {
10044
			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
10045
		}
10046
10047
	} else {
10048
10049
		// Serialize scalar item.
10050
		add( prefix, obj );
10051
	}
10052
}
10053
10054
// Serialize an array of form elements or a set of
10055
// key/values into a query string
10056
jQuery.param = function( a, traditional ) {
10057
	var prefix,
10058
		s = [],
10059
		add = function( key, value ) {
10060
10061
			// If value is a function, invoke it and return its value
10062
			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
10063
			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
10064
		};
10065
10066
	// Set traditional to true for jQuery <= 1.3.2 behavior.
10067
	if ( traditional === undefined ) {
10068
		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
10069
	}
10070
10071
	// If an array was passed in, assume that it is an array of form elements.
10072
	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
10073
10074
		// Serialize the form elements
10075
		jQuery.each( a, function() {
10076
			add( this.name, this.value );
10077
		} );
10078
10079
	} else {
10080
10081
		// If traditional, encode the "old" way (the way 1.3.2 or older
10082
		// did it), otherwise encode params recursively.
10083
		for ( prefix in a ) {
10084
			buildParams( prefix, a[ prefix ], traditional, add );
10085
		}
10086
	}
10087
10088
	// Return the resulting serialization
10089
	return s.join( "&" ).replace( r20, "+" );
10090
};
10091
10092
jQuery.fn.extend( {
10093
	serialize: function() {
10094
		return jQuery.param( this.serializeArray() );
10095
	},
10096
	serializeArray: function() {
10097
		return this.map( function() {
10098
10099
			// Can add propHook for "elements" to filter or add form elements
10100
			var elements = jQuery.prop( this, "elements" );
10101
			return elements ? jQuery.makeArray( elements ) : this;
10102
		} )
10103
		.filter( function() {
10104
			var type = this.type;
10105
10106
			// Use .is(":disabled") so that fieldset[disabled] works
10107
			return this.name && !jQuery( this ).is( ":disabled" ) &&
10108
				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
10109
				( this.checked || !rcheckableType.test( type ) );
10110
		} )
10111
		.map( function( i, elem ) {
10112
			var val = jQuery( this ).val();
10113
10114
			return val == null ?
10115
				null :
10116
				jQuery.isArray( val ) ?
10117
					jQuery.map( val, function( val ) {
10118
						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
10119
					} ) :
10120
					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
10121
		} ).get();
10122
	}
10123
} );
10124
10125
10126
// Create the request object
10127
// (This is still attached to ajaxSettings for backward compatibility)
10128
jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
10129
10130
	// Support: IE6-IE8
10131
	function() {
10132
10133
		// XHR cannot access local files, always use ActiveX for that case
10134
		if ( this.isLocal ) {
10135
			return createActiveXHR();
10136
		}
10137
10138
		// Support: IE 9-11
10139
		// IE seems to error on cross-domain PATCH requests when ActiveX XHR
10140
		// is used. In IE 9+ always use the native XHR.
10141
		// Note: this condition won't catch Edge as it doesn't define
10142
		// document.documentMode but it also doesn't support ActiveX so it won't
10143
		// reach this code.
10144
		if ( document.documentMode > 8 ) {
10145
			return createStandardXHR();
10146
		}
10147
10148
		// Support: IE<9
10149
		// oldIE XHR does not support non-RFC2616 methods (#13240)
10150
		// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
10151
		// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
10152
		// Although this check for six methods instead of eight
10153
		// since IE also does not support "trace" and "connect"
10154
		return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
10155
			createStandardXHR() || createActiveXHR();
10156
	} :
10157
10158
	// For all other browsers, use the standard XMLHttpRequest object
10159
	createStandardXHR;
10160
10161
var xhrId = 0,
10162
	xhrCallbacks = {},
10163
	xhrSupported = jQuery.ajaxSettings.xhr();
10164
10165
// Support: IE<10
10166
// Open requests must be manually aborted on unload (#5280)
10167
// See https://support.microsoft.com/kb/2856746 for more info
10168
if ( window.attachEvent ) {
10169
	window.attachEvent( "onunload", function() {
10170
		for ( var key in xhrCallbacks ) {
10171
			xhrCallbacks[ key ]( undefined, true );
10172
		}
10173
	} );
10174
}
10175
10176
// Determine support properties
10177
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
10178
xhrSupported = support.ajax = !!xhrSupported;
10179
10180
// Create transport if the browser can provide an xhr
10181
if ( xhrSupported ) {
10182
10183
	jQuery.ajaxTransport( function( options ) {
10184
10185
		// Cross domain only allowed if supported through XMLHttpRequest
10186
		if ( !options.crossDomain || support.cors ) {
10187
10188
			var callback;
10189
10190
			return {
10191
				send: function( headers, complete ) {
10192
					var i,
10193
						xhr = options.xhr(),
10194
						id = ++xhrId;
10195
10196
					// Open the socket
10197
					xhr.open(
10198
						options.type,
10199
						options.url,
10200
						options.async,
10201
						options.username,
10202
						options.password
10203
					);
10204
10205
					// Apply custom fields if provided
10206
					if ( options.xhrFields ) {
10207
						for ( i in options.xhrFields ) {
10208
							xhr[ i ] = options.xhrFields[ i ];
10209
						}
10210
					}
10211
10212
					// Override mime type if needed
10213
					if ( options.mimeType && xhr.overrideMimeType ) {
10214
						xhr.overrideMimeType( options.mimeType );
10215
					}
10216
10217
					// X-Requested-With header
10218
					// For cross-domain requests, seeing as conditions for a preflight are
10219
					// akin to a jigsaw puzzle, we simply never set it to be sure.
10220
					// (it can always be set on a per-request basis or even using ajaxSetup)
10221
					// For same-domain requests, won't change header if already provided.
10222
					if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
10223
						headers[ "X-Requested-With" ] = "XMLHttpRequest";
10224
					}
10225
10226
					// Set headers
10227
					for ( i in headers ) {
10228
10229
						// Support: IE<9
10230
						// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
10231
						// request header to a null-value.
10232
						//
10233
						// To keep consistent with other XHR implementations, cast the value
10234
						// to string and ignore `undefined`.
10235
						if ( headers[ i ] !== undefined ) {
10236
							xhr.setRequestHeader( i, headers[ i ] + "" );
10237
						}
10238
					}
10239
10240
					// Do send the request
10241
					// This may raise an exception which is actually
10242
					// handled in jQuery.ajax (so no try/catch here)
10243
					xhr.send( ( options.hasContent && options.data ) || null );
10244
10245
					// Listener
10246
					callback = function( _, isAbort ) {
10247
						var status, statusText, responses;
10248
10249
						// Was never called and is aborted or complete
10250
						if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
10251
10252
							// Clean up
10253
							delete xhrCallbacks[ id ];
10254
							callback = undefined;
10255
							xhr.onreadystatechange = jQuery.noop;
10256
10257
							// Abort manually if needed
10258
							if ( isAbort ) {
10259
								if ( xhr.readyState !== 4 ) {
10260
									xhr.abort();
10261
								}
10262
							} else {
10263
								responses = {};
10264
								status = xhr.status;
10265
10266
								// Support: IE<10
10267
								// Accessing binary-data responseText throws an exception
10268
								// (#11426)
10269
								if ( typeof xhr.responseText === "string" ) {
10270
									responses.text = xhr.responseText;
10271
								}
10272
10273
								// Firefox throws an exception when accessing
10274
								// statusText for faulty cross-domain requests
10275
								try {
10276
									statusText = xhr.statusText;
10277
								} catch ( e ) {
10278
10279
									// We normalize with Webkit giving an empty statusText
10280
									statusText = "";
10281
								}
10282
10283
								// Filter status for non standard behaviors
10284
10285
								// If the request is local and we have data: assume a success
10286
								// (success with no data won't get notified, that's the best we
10287
								// can do given current implementations)
10288
								if ( !status && options.isLocal && !options.crossDomain ) {
10289
									status = responses.text ? 200 : 404;
10290
10291
								// IE - #1450: sometimes returns 1223 when it should be 204
10292
								} else if ( status === 1223 ) {
10293
									status = 204;
10294
								}
10295
							}
10296
						}
10297
10298
						// Call complete if needed
10299
						if ( responses ) {
10300
							complete( status, statusText, responses, xhr.getAllResponseHeaders() );
10301
						}
10302
					};
10303
10304
					// Do send the request
10305
					// `xhr.send` may raise an exception, but it will be
10306
					// handled in jQuery.ajax (so no try/catch here)
10307
					if ( !options.async ) {
10308
10309
						// If we're in sync mode we fire the callback
10310
						callback();
10311
					} else if ( xhr.readyState === 4 ) {
10312
10313
						// (IE6 & IE7) if it's in cache and has been
10314
						// retrieved directly we need to fire the callback
10315
						window.setTimeout( callback );
10316
					} else {
10317
10318
						// Register the callback, but delay it in case `xhr.send` throws
10319
						// Add to the list of active xhr callbacks
10320
						xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
10321
					}
10322
				},
10323
10324
				abort: function() {
10325
					if ( callback ) {
10326
						callback( undefined, true );
10327
					}
10328
				}
10329
			};
10330
		}
10331
	} );
10332
}
10333
10334
// Functions to create xhrs
10335
function createStandardXHR() {
10336
	try {
10337
		return new window.XMLHttpRequest();
10338
	} catch ( e ) {}
10339
}
10340
10341
function createActiveXHR() {
10342
	try {
10343
		return new window.ActiveXObject( "Microsoft.XMLHTTP" );
10344
	} catch ( e ) {}
10345
}
10346
10347
10348
10349
10350
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
10351
jQuery.ajaxPrefilter( function( s ) {
10352
	if ( s.crossDomain ) {
10353
		s.contents.script = false;
10354
	}
10355
} );
10356
10357
// Install script dataType
10358
jQuery.ajaxSetup( {
10359
	accepts: {
10360
		script: "text/javascript, application/javascript, " +
10361
			"application/ecmascript, application/x-ecmascript"
10362
	},
10363
	contents: {
10364
		script: /\b(?:java|ecma)script\b/
10365
	},
10366
	converters: {
10367
		"text script": function( text ) {
10368
			jQuery.globalEval( text );
10369
			return text;
10370
		}
10371
	}
10372
} );
10373
10374
// Handle cache's special case and global
10375
jQuery.ajaxPrefilter( "script", function( s ) {
10376
	if ( s.cache === undefined ) {
10377
		s.cache = false;
10378
	}
10379
	if ( s.crossDomain ) {
10380
		s.type = "GET";
10381
		s.global = false;
10382
	}
10383
} );
10384
10385
// Bind script tag hack transport
10386
jQuery.ajaxTransport( "script", function( s ) {
10387
10388
	// This transport only deals with cross domain requests
10389
	if ( s.crossDomain ) {
10390
10391
		var script,
10392
			head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
10393
10394
		return {
10395
10396
			send: function( _, callback ) {
10397
10398
				script = document.createElement( "script" );
10399
10400
				script.async = true;
10401
10402
				if ( s.scriptCharset ) {
10403
					script.charset = s.scriptCharset;
10404
				}
10405
10406
				script.src = s.url;
10407
10408
				// Attach handlers for all browsers
10409
				script.onload = script.onreadystatechange = function( _, isAbort ) {
10410
10411
					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
10412
10413
						// Handle memory leak in IE
10414
						script.onload = script.onreadystatechange = null;
10415
10416
						// Remove the script
10417
						if ( script.parentNode ) {
10418
							script.parentNode.removeChild( script );
10419
						}
10420
10421
						// Dereference the script
10422
						script = null;
10423
10424
						// Callback if not abort
10425
						if ( !isAbort ) {
10426
							callback( 200, "success" );
10427
						}
10428
					}
10429
				};
10430
10431
				// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
10432
				// Use native DOM manipulation to avoid our domManip AJAX trickery
10433
				head.insertBefore( script, head.firstChild );
10434
			},
10435
10436
			abort: function() {
10437
				if ( script ) {
10438
					script.onload( undefined, true );
10439
				}
10440
			}
10441
		};
10442
	}
10443
} );
10444
10445
10446
10447
10448
var oldCallbacks = [],
10449
	rjsonp = /(=)\?(?=&|$)|\?\?/;
10450
10451
// Default jsonp settings
10452
jQuery.ajaxSetup( {
10453
	jsonp: "callback",
10454
	jsonpCallback: function() {
10455
		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
10456
		this[ callback ] = true;
10457
		return callback;
10458
	}
10459
} );
10460
10461
// Detect, normalize options and install callbacks for jsonp requests
10462
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
10463
10464
	var callbackName, overwritten, responseContainer,
10465
		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
10466
			"url" :
10467
			typeof s.data === "string" &&
10468
				( s.contentType || "" )
10469
					.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
10470
				rjsonp.test( s.data ) && "data"
10471
		);
10472
10473
	// Handle iff the expected data type is "jsonp" or we have a parameter to set
10474
	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
10475
10476
		// Get callback name, remembering preexisting value associated with it
10477
		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
10478
			s.jsonpCallback() :
10479
			s.jsonpCallback;
10480
10481
		// Insert callback into url or form data
10482
		if ( jsonProp ) {
10483
			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
10484
		} else if ( s.jsonp !== false ) {
10485
			s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
10486
		}
10487
10488
		// Use data converter to retrieve json after script execution
10489
		s.converters[ "script json" ] = function() {
10490
			if ( !responseContainer ) {
10491
				jQuery.error( callbackName + " was not called" );
10492
			}
10493
			return responseContainer[ 0 ];
10494
		};
10495
10496
		// force json dataType
10497
		s.dataTypes[ 0 ] = "json";
10498
10499
		// Install callback
10500
		overwritten = window[ callbackName ];
10501
		window[ callbackName ] = function() {
10502
			responseContainer = arguments;
10503
		};
10504
10505
		// Clean-up function (fires after converters)
10506
		jqXHR.always( function() {
10507
10508
			// If previous value didn't exist - remove it
10509
			if ( overwritten === undefined ) {
10510
				jQuery( window ).removeProp( callbackName );
10511
10512
			// Otherwise restore preexisting value
10513
			} else {
10514
				window[ callbackName ] = overwritten;
10515
			}
10516
10517
			// Save back as free
10518
			if ( s[ callbackName ] ) {
10519
10520
				// make sure that re-using the options doesn't screw things around
10521
				s.jsonpCallback = originalSettings.jsonpCallback;
10522
10523
				// save the callback name for future use
10524
				oldCallbacks.push( callbackName );
10525
			}
10526
10527
			// Call if it was a function and we have a response
10528
			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
10529
				overwritten( responseContainer[ 0 ] );
10530
			}
10531
10532
			responseContainer = overwritten = undefined;
10533
		} );
10534
10535
		// Delegate to script
10536
		return "script";
10537
	}
10538
} );
10539
10540
10541
10542
10543
// Support: Safari 8+
10544
// In Safari 8 documents created via document.implementation.createHTMLDocument
10545
// collapse sibling forms: the second one becomes a child of the first one.
10546
// Because of that, this security measure has to be disabled in Safari 8.
10547
// https://bugs.webkit.org/show_bug.cgi?id=137337
10548
support.createHTMLDocument = ( function() {
10549
	if ( !document.implementation.createHTMLDocument ) {
10550
		return false;
10551
	}
10552
	var doc = document.implementation.createHTMLDocument( "" );
10553
	doc.body.innerHTML = "<form></form><form></form>";
10554
	return doc.body.childNodes.length === 2;
10555
} )();
10556
10557
10558
// data: string of html
10559
// context (optional): If specified, the fragment will be created in this context,
10560
// defaults to document
10561
// keepScripts (optional): If true, will include scripts passed in the html string
10562
jQuery.parseHTML = function( data, context, keepScripts ) {
10563
	if ( !data || typeof data !== "string" ) {
10564
		return null;
10565
	}
10566
	if ( typeof context === "boolean" ) {
10567
		keepScripts = context;
10568
		context = false;
10569
	}
10570
10571
	// document.implementation stops scripts or inline event handlers from
10572
	// being executed immediately
10573
	context = context || ( support.createHTMLDocument ?
10574
		document.implementation.createHTMLDocument( "" ) :
10575
		document );
10576
10577
	var parsed = rsingleTag.exec( data ),
10578
		scripts = !keepScripts && [];
10579
10580
	// Single tag
10581
	if ( parsed ) {
10582
		return [ context.createElement( parsed[ 1 ] ) ];
10583
	}
10584
10585
	parsed = buildFragment( [ data ], context, scripts );
10586
10587
	if ( scripts && scripts.length ) {
10588
		jQuery( scripts ).remove();
10589
	}
10590
10591
	return jQuery.merge( [], parsed.childNodes );
10592
};
10593
10594
10595
// Keep a copy of the old load method
10596
var _load = jQuery.fn.load;
10597
10598
/**
10599
 * Load a url into a page
10600
 */
10601
jQuery.fn.load = function( url, params, callback ) {
10602
	if ( typeof url !== "string" && _load ) {
10603
		return _load.apply( this, arguments );
10604
	}
10605
10606
	var selector, type, response,
10607
		self = this,
10608
		off = url.indexOf( " " );
10609
10610
	if ( off > -1 ) {
10611
		selector = jQuery.trim( url.slice( off, url.length ) );
10612
		url = url.slice( 0, off );
10613
	}
10614
10615
	// If it's a function
10616
	if ( jQuery.isFunction( params ) ) {
10617
10618
		// We assume that it's the callback
10619
		callback = params;
10620
		params = undefined;
10621
10622
	// Otherwise, build a param string
10623
	} else if ( params && typeof params === "object" ) {
10624
		type = "POST";
10625
	}
10626
10627
	// If we have elements to modify, make the request
10628
	if ( self.length > 0 ) {
10629
		jQuery.ajax( {
10630
			url: url,
10631
10632
			// If "type" variable is undefined, then "GET" method will be used.
10633
			// Make value of this field explicit since
10634
			// user can override it through ajaxSetup method
10635
			type: type || "GET",
10636
			dataType: "html",
10637
			data: params
10638
		} ).done( function( responseText ) {
10639
10640
			// Save response for use in complete callback
10641
			response = arguments;
10642
10643
			self.html( selector ?
10644
10645
				// If a selector was specified, locate the right elements in a dummy div
10646
				// Exclude scripts to avoid IE 'Permission Denied' errors
10647
				jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
10648
10649
				// Otherwise use the full result
10650
				responseText );
10651
10652
		// If the request succeeds, this function gets "data", "status", "jqXHR"
10653
		// but they are ignored because response was set above.
10654
		// If it fails, this function gets "jqXHR", "status", "error"
10655
		} ).always( callback && function( jqXHR, status ) {
10656
			self.each( function() {
10657
				callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
10658
			} );
10659
		} );
10660
	}
10661
10662
	return this;
10663
};
10664
10665
10666
10667
10668
// Attach a bunch of functions for handling common AJAX events
10669
jQuery.each( [
10670
	"ajaxStart",
10671
	"ajaxStop",
10672
	"ajaxComplete",
10673
	"ajaxError",
10674
	"ajaxSuccess",
10675
	"ajaxSend"
10676
], function( i, type ) {
10677
	jQuery.fn[ type ] = function( fn ) {
10678
		return this.on( type, fn );
10679
	};
10680
} );
10681
10682
10683
10684
10685
jQuery.expr.filters.animated = function( elem ) {
10686
	return jQuery.grep( jQuery.timers, function( fn ) {
10687
		return elem === fn.elem;
10688
	} ).length;
10689
};
10690
10691
10692
10693
10694
10695
/**
10696
 * Gets a window from an element
10697
 */
10698
function getWindow( elem ) {
10699
	return jQuery.isWindow( elem ) ?
10700
		elem :
10701
		elem.nodeType === 9 ?
10702
			elem.defaultView || elem.parentWindow :
10703
			false;
10704
}
10705
10706
jQuery.offset = {
10707
	setOffset: function( elem, options, i ) {
10708
		var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10709
			position = jQuery.css( elem, "position" ),
10710
			curElem = jQuery( elem ),
10711
			props = {};
10712
10713
		// set position first, in-case top/left are set even on static elem
10714
		if ( position === "static" ) {
10715
			elem.style.position = "relative";
10716
		}
10717
10718
		curOffset = curElem.offset();
10719
		curCSSTop = jQuery.css( elem, "top" );
10720
		curCSSLeft = jQuery.css( elem, "left" );
10721
		calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10722
			jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1;
10723
10724
		// need to be able to calculate position if either top or left
10725
		// is auto and position is either absolute or fixed
10726
		if ( calculatePosition ) {
10727
			curPosition = curElem.position();
10728
			curTop = curPosition.top;
10729
			curLeft = curPosition.left;
10730
		} else {
10731
			curTop = parseFloat( curCSSTop ) || 0;
10732
			curLeft = parseFloat( curCSSLeft ) || 0;
10733
		}
10734
10735
		if ( jQuery.isFunction( options ) ) {
10736
10737
			// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
10738
			options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
10739
		}
10740
10741
		if ( options.top != null ) {
10742
			props.top = ( options.top - curOffset.top ) + curTop;
10743
		}
10744
		if ( options.left != null ) {
10745
			props.left = ( options.left - curOffset.left ) + curLeft;
10746
		}
10747
10748
		if ( "using" in options ) {
10749
			options.using.call( elem, props );
10750
		} else {
10751
			curElem.css( props );
10752
		}
10753
	}
10754
};
10755
10756
jQuery.fn.extend( {
10757
	offset: function( options ) {
10758
		if ( arguments.length ) {
10759
			return options === undefined ?
10760
				this :
10761
				this.each( function( i ) {
10762
					jQuery.offset.setOffset( this, options, i );
10763
				} );
10764
		}
10765
10766
		var docElem, win,
10767
			box = { top: 0, left: 0 },
10768
			elem = this[ 0 ],
10769
			doc = elem && elem.ownerDocument;
10770
10771
		if ( !doc ) {
10772
			return;
10773
		}
10774
10775
		docElem = doc.documentElement;
10776
10777
		// Make sure it's not a disconnected DOM node
10778
		if ( !jQuery.contains( docElem, elem ) ) {
10779
			return box;
10780
		}
10781
10782
		// If we don't have gBCR, just use 0,0 rather than error
10783
		// BlackBerry 5, iOS 3 (original iPhone)
10784
		if ( typeof elem.getBoundingClientRect !== "undefined" ) {
10785
			box = elem.getBoundingClientRect();
10786
		}
10787
		win = getWindow( doc );
10788
		return {
10789
			top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
10790
			left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10791
		};
10792
	},
10793
10794
	position: function() {
10795
		if ( !this[ 0 ] ) {
10796
			return;
10797
		}
10798
10799
		var offsetParent, offset,
10800
			parentOffset = { top: 0, left: 0 },
10801
			elem = this[ 0 ];
10802
10803
		// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
10804
		// because it is its only offset parent
10805
		if ( jQuery.css( elem, "position" ) === "fixed" ) {
10806
10807
			// we assume that getBoundingClientRect is available when computed position is fixed
10808
			offset = elem.getBoundingClientRect();
10809
		} else {
10810
10811
			// Get *real* offsetParent
10812
			offsetParent = this.offsetParent();
10813
10814
			// Get correct offsets
10815
			offset = this.offset();
10816
			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10817
				parentOffset = offsetParent.offset();
10818
			}
10819
10820
			// Add offsetParent borders
10821
			// Subtract offsetParent scroll positions
10822
			parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ) -
10823
				offsetParent.scrollTop();
10824
			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) -
10825
				offsetParent.scrollLeft();
10826
		}
10827
10828
		// Subtract parent offsets and element margins
10829
		// note: when an element has margin: auto the offsetLeft and marginLeft
10830
		// are the same in Safari causing offset.left to incorrectly be 0
10831
		return {
10832
			top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10833
			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
10834
		};
10835
	},
10836
10837
	offsetParent: function() {
10838
		return this.map( function() {
10839
			var offsetParent = this.offsetParent;
10840
10841
			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
10842
				jQuery.css( offsetParent, "position" ) === "static" ) ) {
10843
				offsetParent = offsetParent.offsetParent;
10844
			}
10845
			return offsetParent || documentElement;
10846
		} );
10847
	}
10848
} );
10849
10850
// Create scrollLeft and scrollTop methods
10851
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10852
	var top = /Y/.test( prop );
10853
10854
	jQuery.fn[ method ] = function( val ) {
10855
		return access( this, function( elem, method, val ) {
10856
			var win = getWindow( elem );
10857
10858
			if ( val === undefined ) {
10859
				return win ? ( prop in win ) ? win[ prop ] :
10860
					win.document.documentElement[ method ] :
10861
					elem[ method ];
10862
			}
10863
10864
			if ( win ) {
10865
				win.scrollTo(
10866
					!top ? val : jQuery( win ).scrollLeft(),
10867
					top ? val : jQuery( win ).scrollTop()
10868
				);
10869
10870
			} else {
10871
				elem[ method ] = val;
10872
			}
10873
		}, method, val, arguments.length, null );
10874
	};
10875
} );
10876
10877
// Support: Safari<7-8+, Chrome<37-44+
10878
// Add the top/left cssHooks using jQuery.fn.position
10879
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10880
// getComputedStyle returns percent when specified for top/left/bottom/right
10881
// rather than make the css module depend on the offset module, we just check for it here
10882
jQuery.each( [ "top", "left" ], function( i, prop ) {
10883
	jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10884
		function( elem, computed ) {
10885
			if ( computed ) {
10886
				computed = curCSS( elem, prop );
10887
10888
				// if curCSS returns percentage, fallback to offset
10889
				return rnumnonpx.test( computed ) ?
10890
					jQuery( elem ).position()[ prop ] + "px" :
10891
					computed;
10892
			}
10893
		}
10894
	);
10895
} );
10896
10897
10898
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10899
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10900
	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10901
	function( defaultExtra, funcName ) {
10902
10903
		// margin is only for outerHeight, outerWidth
10904
		jQuery.fn[ funcName ] = function( margin, value ) {
10905
			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10906
				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10907
10908
			return access( this, function( elem, type, value ) {
10909
				var doc;
10910
10911
				if ( jQuery.isWindow( elem ) ) {
10912
10913
					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10914
					// isn't a whole lot we can do. See pull request at this URL for discussion:
10915
					// https://github.com/jquery/jquery/pull/764
10916
					return elem.document.documentElement[ "client" + name ];
10917
				}
10918
10919
				// Get document width or height
10920
				if ( elem.nodeType === 9 ) {
10921
					doc = elem.documentElement;
10922
10923
					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
10924
					// whichever is greatest
10925
					// unfortunately, this causes bug #3838 in IE6/8 only,
10926
					// but there is currently no good, small way to fix it.
10927
					return Math.max(
10928
						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10929
						elem.body[ "offset" + name ], doc[ "offset" + name ],
10930
						doc[ "client" + name ]
10931
					);
10932
				}
10933
10934
				return value === undefined ?
10935
10936
					// Get width or height on the element, requesting but not forcing parseFloat
10937
					jQuery.css( elem, type, extra ) :
10938
10939
					// Set width or height on the element
10940
					jQuery.style( elem, type, value, extra );
10941
			}, type, chainable ? margin : undefined, chainable, null );
10942
		};
10943
	} );
10944
} );
10945
10946
10947
jQuery.fn.extend( {
10948
10949
	bind: function( types, data, fn ) {
10950
		return this.on( types, null, data, fn );
10951
	},
10952
	unbind: function( types, fn ) {
10953
		return this.off( types, null, fn );
10954
	},
10955
10956
	delegate: function( selector, types, data, fn ) {
10957
		return this.on( types, selector, data, fn );
10958
	},
10959
	undelegate: function( selector, types, fn ) {
10960
10961
		// ( namespace ) or ( selector, types [, fn] )
10962
		return arguments.length === 1 ?
10963
			this.off( selector, "**" ) :
10964
			this.off( types, selector || "**", fn );
10965
	}
10966
} );
10967
10968
// The number of elements contained in the matched element set
10969
jQuery.fn.size = function() {
10970
	return this.length;
10971
};
10972
10973
jQuery.fn.andSelf = jQuery.fn.addBack;
10974
10975
10976
10977
10978
// Register as a named AMD module, since jQuery can be concatenated with other
10979
// files that may use define, but not via a proper concatenation script that
10980
// understands anonymous AMD modules. A named AMD is safest and most robust
10981
// way to register. Lowercase jquery is used because AMD module names are
10982
// derived from file names, and jQuery is normally delivered in a lowercase
10983
// file name. Do this after creating the global so that if an AMD module wants
10984
// to call noConflict to hide this version of jQuery, it will work.
10985
10986
// Note that for maximum portability, libraries that are not jQuery should
10987
// declare themselves as anonymous modules, and avoid setting a global if an
10988
// AMD loader is present. jQuery is a special case. For more information, see
10989
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10990
10991
if ( typeof define === "function" && define.amd ) {
10992
	define( "jquery", [], function() {
10993
		return jQuery;
10994
	} );
10995
}
10996
10997
10998
10999
var
11000
11001
	// Map over jQuery in case of overwrite
11002
	_jQuery = window.jQuery,
11003
11004
	// Map over the $ in case of overwrite
11005
	_$ = window.$;
11006
11007
jQuery.noConflict = function( deep ) {
11008
	if ( window.$ === jQuery ) {
11009
		window.$ = _$;
11010
	}
11011
11012
	if ( deep && window.jQuery === jQuery ) {
11013
		window.jQuery = _jQuery;
11014
	}
11015
11016
	return jQuery;
11017
};
11018
11019
// Expose jQuery and $ identifiers, even in
11020
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
11021
// and CommonJS for browser emulators (#13566)
11022
if ( !noGlobal ) {
11023
	window.jQuery = window.$ = jQuery;
11024
}
11025
11026
return jQuery;
11027
}));
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-1.12.0.min.js (+5 lines)
Line 0 Link Here
1
/*! jQuery v1.12.0 | (c) jQuery Foundation | jquery.org/license */
2
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
3
return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
4
marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),c.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){
5
n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.css (+971 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.css, draggable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, menu.css, progressbar.css, slider.css, tabs.css, theme.css
4
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
* Copyright jQuery Foundation and other contributors; Licensed MIT */
6
7
/* Layout helpers
8
----------------------------------*/
9
.ui-helper-hidden {
10
	display: none;
11
}
12
.ui-helper-hidden-accessible {
13
	border: 0;
14
	clip: rect(0 0 0 0);
15
	height: 1px;
16
	margin: -1px;
17
	overflow: hidden;
18
	padding: 0;
19
	position: absolute;
20
	width: 1px;
21
}
22
.ui-helper-reset {
23
	margin: 0;
24
	padding: 0;
25
	border: 0;
26
	outline: 0;
27
	line-height: 1.3;
28
	text-decoration: none;
29
	font-size: 100%;
30
	list-style: none;
31
}
32
.ui-helper-clearfix:before,
33
.ui-helper-clearfix:after {
34
	content: "";
35
	display: table;
36
	border-collapse: collapse;
37
}
38
.ui-helper-clearfix:after {
39
	clear: both;
40
}
41
.ui-helper-clearfix {
42
	min-height: 0; /* support: IE7 */
43
}
44
.ui-helper-zfix {
45
	width: 100%;
46
	height: 100%;
47
	top: 0;
48
	left: 0;
49
	position: absolute;
50
	opacity: 0;
51
	filter:Alpha(Opacity=0); /* support: IE8 */
52
}
53
54
.ui-front {
55
	z-index: 100;
56
}
57
58
59
/* Interaction Cues
60
----------------------------------*/
61
.ui-state-disabled {
62
	cursor: default !important;
63
}
64
65
66
/* Icons
67
----------------------------------*/
68
69
/* states and images */
70
.ui-icon {
71
	display: block;
72
	text-indent: -99999px;
73
	overflow: hidden;
74
	background-repeat: no-repeat;
75
}
76
77
78
/* Misc visuals
79
----------------------------------*/
80
81
/* Overlays */
82
.ui-widget-overlay {
83
	position: fixed;
84
	top: 0;
85
	left: 0;
86
	width: 100%;
87
	height: 100%;
88
}
89
.ui-draggable-handle {
90
	-ms-touch-action: none;
91
	touch-action: none;
92
}
93
.ui-sortable-handle {
94
	-ms-touch-action: none;
95
	touch-action: none;
96
}
97
.ui-accordion .ui-accordion-header {
98
	display: block;
99
	cursor: pointer;
100
	position: relative;
101
	margin: 2px 0 0 0;
102
	padding: .5em .5em .5em .7em;
103
	min-height: 0; /* support: IE7 */
104
	font-size: 100%;
105
}
106
.ui-accordion .ui-accordion-icons {
107
	padding-left: 2.2em;
108
}
109
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
110
	padding-left: 2.2em;
111
}
112
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
113
	position: absolute;
114
	left: .5em;
115
	top: 50%;
116
	margin-top: -8px;
117
}
118
.ui-accordion .ui-accordion-content {
119
	padding: 1em 2.2em;
120
	border-top: 0;
121
	overflow: auto;
122
}
123
.ui-autocomplete {
124
	position: absolute;
125
	top: 0;
126
	left: 0;
127
	cursor: default;
128
}
129
.ui-button {
130
	display: inline-block;
131
	position: relative;
132
	padding: 0;
133
	line-height: normal;
134
	margin-right: .1em;
135
	cursor: pointer;
136
	vertical-align: middle;
137
	text-align: center;
138
	overflow: visible; /* removes extra width in IE */
139
}
140
.ui-button,
141
.ui-button:link,
142
.ui-button:visited,
143
.ui-button:hover,
144
.ui-button:active {
145
	text-decoration: none;
146
}
147
/* to make room for the icon, a width needs to be set here */
148
.ui-button-icon-only {
149
	width: 2.2em;
150
}
151
/* button elements seem to need a little more width */
152
button.ui-button-icon-only {
153
	width: 2.4em;
154
}
155
.ui-button-icons-only {
156
	width: 3.4em;
157
}
158
button.ui-button-icons-only {
159
	width: 3.7em;
160
}
161
162
/* button text element */
163
.ui-button .ui-button-text {
164
	display: block;
165
	line-height: normal;
166
}
167
.ui-button-text-only .ui-button-text {
168
	padding: .4em 1em;
169
}
170
.ui-button-icon-only .ui-button-text,
171
.ui-button-icons-only .ui-button-text {
172
	padding: .4em;
173
	text-indent: -9999999px;
174
}
175
.ui-button-text-icon-primary .ui-button-text,
176
.ui-button-text-icons .ui-button-text {
177
	padding: .4em 1em .4em 2.1em;
178
}
179
.ui-button-text-icon-secondary .ui-button-text,
180
.ui-button-text-icons .ui-button-text {
181
	padding: .4em 2.1em .4em 1em;
182
}
183
.ui-button-text-icons .ui-button-text {
184
	padding-left: 2.1em;
185
	padding-right: 2.1em;
186
}
187
/* no icon support for input elements, provide padding by default */
188
input.ui-button {
189
	padding: .4em 1em;
190
}
191
192
/* button icon element(s) */
193
.ui-button-icon-only .ui-icon,
194
.ui-button-text-icon-primary .ui-icon,
195
.ui-button-text-icon-secondary .ui-icon,
196
.ui-button-text-icons .ui-icon,
197
.ui-button-icons-only .ui-icon {
198
	position: absolute;
199
	top: 50%;
200
	margin-top: -8px;
201
}
202
.ui-button-icon-only .ui-icon {
203
	left: 50%;
204
	margin-left: -8px;
205
}
206
.ui-button-text-icon-primary .ui-button-icon-primary,
207
.ui-button-text-icons .ui-button-icon-primary,
208
.ui-button-icons-only .ui-button-icon-primary {
209
	left: .5em;
210
}
211
.ui-button-text-icon-secondary .ui-button-icon-secondary,
212
.ui-button-text-icons .ui-button-icon-secondary,
213
.ui-button-icons-only .ui-button-icon-secondary {
214
	right: .5em;
215
}
216
217
/* button sets */
218
.ui-buttonset {
219
	margin-right: 7px;
220
}
221
.ui-buttonset .ui-button {
222
	margin-left: 0;
223
	margin-right: -.3em;
224
}
225
226
/* workarounds */
227
/* reset extra padding in Firefox, see h5bp.com/l */
228
input.ui-button::-moz-focus-inner,
229
button.ui-button::-moz-focus-inner {
230
	border: 0;
231
	padding: 0;
232
}
233
.ui-datepicker {
234
	width: 17em;
235
	padding: .2em .2em 0;
236
	display: none;
237
}
238
.ui-datepicker .ui-datepicker-header {
239
	position: relative;
240
	padding: .2em 0;
241
}
242
.ui-datepicker .ui-datepicker-prev,
243
.ui-datepicker .ui-datepicker-next {
244
	position: absolute;
245
	top: 2px;
246
	width: 1.8em;
247
	height: 1.8em;
248
}
249
.ui-datepicker .ui-datepicker-prev-hover,
250
.ui-datepicker .ui-datepicker-next-hover {
251
	top: 1px;
252
}
253
.ui-datepicker .ui-datepicker-prev {
254
	left: 2px;
255
}
256
.ui-datepicker .ui-datepicker-next {
257
	right: 2px;
258
}
259
.ui-datepicker .ui-datepicker-prev-hover {
260
	left: 1px;
261
}
262
.ui-datepicker .ui-datepicker-next-hover {
263
	right: 1px;
264
}
265
.ui-datepicker .ui-datepicker-prev span,
266
.ui-datepicker .ui-datepicker-next span {
267
	display: block;
268
	position: absolute;
269
	left: 50%;
270
	margin-left: -8px;
271
	top: 50%;
272
	margin-top: -8px;
273
}
274
.ui-datepicker .ui-datepicker-title {
275
	margin: 0 2.3em;
276
	line-height: 1.8em;
277
	text-align: center;
278
}
279
.ui-datepicker .ui-datepicker-title select {
280
	font-size: 1em;
281
	margin: 1px 0;
282
}
283
.ui-datepicker select.ui-datepicker-month,
284
.ui-datepicker select.ui-datepicker-year {
285
	width: 45%;
286
}
287
.ui-datepicker table {
288
	width: 100%;
289
	font-size: .9em;
290
	border-collapse: collapse;
291
	margin: 0 0 .4em;
292
}
293
.ui-datepicker th {
294
	padding: .7em .3em;
295
	text-align: center;
296
	font-weight: bold;
297
	border: 0;
298
}
299
.ui-datepicker td {
300
	border: 0;
301
	padding: 1px;
302
}
303
.ui-datepicker td span,
304
.ui-datepicker td a {
305
	display: block;
306
	padding: .2em;
307
	text-align: right;
308
	text-decoration: none;
309
}
310
.ui-datepicker .ui-datepicker-buttonpane {
311
	background-image: none;
312
	margin: .7em 0 0 0;
313
	padding: 0 .2em;
314
	border-left: 0;
315
	border-right: 0;
316
	border-bottom: 0;
317
}
318
.ui-datepicker .ui-datepicker-buttonpane button {
319
	float: right;
320
	margin: .5em .2em .4em;
321
	cursor: pointer;
322
	padding: .2em .6em .3em .6em;
323
	width: auto;
324
	overflow: visible;
325
}
326
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
327
	float: left;
328
}
329
330
/* with multiple calendars */
331
.ui-datepicker.ui-datepicker-multi {
332
	width: auto;
333
}
334
.ui-datepicker-multi .ui-datepicker-group {
335
	float: left;
336
}
337
.ui-datepicker-multi .ui-datepicker-group table {
338
	width: 95%;
339
	margin: 0 auto .4em;
340
}
341
.ui-datepicker-multi-2 .ui-datepicker-group {
342
	width: 50%;
343
}
344
.ui-datepicker-multi-3 .ui-datepicker-group {
345
	width: 33.3%;
346
}
347
.ui-datepicker-multi-4 .ui-datepicker-group {
348
	width: 25%;
349
}
350
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
351
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
352
	border-left-width: 0;
353
}
354
.ui-datepicker-multi .ui-datepicker-buttonpane {
355
	clear: left;
356
}
357
.ui-datepicker-row-break {
358
	clear: both;
359
	width: 100%;
360
	font-size: 0;
361
}
362
363
/* RTL support */
364
.ui-datepicker-rtl {
365
	direction: rtl;
366
}
367
.ui-datepicker-rtl .ui-datepicker-prev {
368
	right: 2px;
369
	left: auto;
370
}
371
.ui-datepicker-rtl .ui-datepicker-next {
372
	left: 2px;
373
	right: auto;
374
}
375
.ui-datepicker-rtl .ui-datepicker-prev:hover {
376
	right: 1px;
377
	left: auto;
378
}
379
.ui-datepicker-rtl .ui-datepicker-next:hover {
380
	left: 1px;
381
	right: auto;
382
}
383
.ui-datepicker-rtl .ui-datepicker-buttonpane {
384
	clear: right;
385
}
386
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
387
	float: left;
388
}
389
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
390
.ui-datepicker-rtl .ui-datepicker-group {
391
	float: right;
392
}
393
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
394
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
395
	border-right-width: 0;
396
	border-left-width: 1px;
397
}
398
.ui-menu {
399
	list-style: none;
400
	padding: 0;
401
	margin: 0;
402
	display: block;
403
	outline: none;
404
}
405
.ui-menu .ui-menu {
406
	position: absolute;
407
}
408
.ui-menu .ui-menu-item {
409
	position: relative;
410
	margin: 0;
411
	padding: 3px 1em 3px .4em;
412
	cursor: pointer;
413
	min-height: 0; /* support: IE7 */
414
	/* support: IE10, see #8844 */
415
	list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
416
}
417
.ui-menu .ui-menu-divider {
418
	margin: 5px 0;
419
	height: 0;
420
	font-size: 0;
421
	line-height: 0;
422
	border-width: 1px 0 0 0;
423
}
424
.ui-menu .ui-state-focus,
425
.ui-menu .ui-state-active {
426
	margin: -1px;
427
}
428
429
/* icon support */
430
.ui-menu-icons {
431
	position: relative;
432
}
433
.ui-menu-icons .ui-menu-item {
434
	padding-left: 2em;
435
}
436
437
/* left-aligned */
438
.ui-menu .ui-icon {
439
	position: absolute;
440
	top: 0;
441
	bottom: 0;
442
	left: .2em;
443
	margin: auto 0;
444
}
445
446
/* right-aligned */
447
.ui-menu .ui-menu-icon {
448
	left: auto;
449
	right: 0;
450
}
451
.ui-progressbar {
452
	height: 2em;
453
	text-align: left;
454
	overflow: hidden;
455
}
456
.ui-progressbar .ui-progressbar-value {
457
	margin: -1px;
458
	height: 100%;
459
}
460
.ui-progressbar .ui-progressbar-overlay {
461
	background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
462
	height: 100%;
463
	filter: alpha(opacity=25); /* support: IE8 */
464
	opacity: 0.25;
465
}
466
.ui-progressbar-indeterminate .ui-progressbar-value {
467
	background-image: none;
468
}
469
.ui-slider {
470
	position: relative;
471
	text-align: left;
472
}
473
.ui-slider .ui-slider-handle {
474
	position: absolute;
475
	z-index: 2;
476
	width: 1.2em;
477
	height: 1.2em;
478
	cursor: default;
479
	-ms-touch-action: none;
480
	touch-action: none;
481
}
482
.ui-slider .ui-slider-range {
483
	position: absolute;
484
	z-index: 1;
485
	font-size: .7em;
486
	display: block;
487
	border: 0;
488
	background-position: 0 0;
489
}
490
491
/* support: IE8 - See #6727 */
492
.ui-slider.ui-state-disabled .ui-slider-handle,
493
.ui-slider.ui-state-disabled .ui-slider-range {
494
	filter: inherit;
495
}
496
497
.ui-slider-horizontal {
498
	height: .8em;
499
}
500
.ui-slider-horizontal .ui-slider-handle {
501
	top: -.3em;
502
	margin-left: -.6em;
503
}
504
.ui-slider-horizontal .ui-slider-range {
505
	top: 0;
506
	height: 100%;
507
}
508
.ui-slider-horizontal .ui-slider-range-min {
509
	left: 0;
510
}
511
.ui-slider-horizontal .ui-slider-range-max {
512
	right: 0;
513
}
514
515
.ui-slider-vertical {
516
	width: .8em;
517
	height: 100px;
518
}
519
.ui-slider-vertical .ui-slider-handle {
520
	left: -.3em;
521
	margin-left: 0;
522
	margin-bottom: -.6em;
523
}
524
.ui-slider-vertical .ui-slider-range {
525
	left: 0;
526
	width: 100%;
527
}
528
.ui-slider-vertical .ui-slider-range-min {
529
	bottom: 0;
530
}
531
.ui-slider-vertical .ui-slider-range-max {
532
	top: 0;
533
}
534
.ui-tabs {
535
	position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
536
	padding: .2em;
537
}
538
.ui-tabs .ui-tabs-nav {
539
	margin: 0;
540
	padding: .2em .2em 0;
541
}
542
.ui-tabs .ui-tabs-nav li {
543
	list-style: none;
544
	float: left;
545
	position: relative;
546
	top: 0;
547
	margin: 1px .2em 0 0;
548
	border-bottom-width: 0;
549
	padding: 0;
550
	white-space: nowrap;
551
}
552
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
553
	float: left;
554
	padding: .5em 1em;
555
	text-decoration: none;
556
}
557
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
558
	margin-bottom: -1px;
559
	padding-bottom: 1px;
560
}
561
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
562
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
563
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
564
	cursor: text;
565
}
566
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
567
	cursor: pointer;
568
}
569
.ui-tabs .ui-tabs-panel {
570
	display: block;
571
	border-width: 0;
572
	padding: 1em 1.4em;
573
	background: none;
574
}
575
576
/* Component containers
577
----------------------------------*/
578
.ui-widget {
579
	font-family: Verdana,Arial,sans-serif;
580
	font-size: 1.1em;
581
}
582
.ui-widget .ui-widget {
583
	font-size: 1em;
584
}
585
.ui-widget input,
586
.ui-widget select,
587
.ui-widget textarea,
588
.ui-widget button {
589
	font-family: Verdana,Arial,sans-serif;
590
	font-size: 1em;
591
}
592
.ui-widget-content {
593
	border: 1px solid #aaaaaa;
594
	background: #ffffff;
595
	color: #222222;
596
}
597
.ui-widget-content a {
598
	color: #222222;
599
}
600
.ui-widget-header {
601
	border: 1px solid #aaaaaa;
602
	background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
603
	color: #222222;
604
	font-weight: bold;
605
}
606
.ui-widget-header a {
607
	color: #222222;
608
}
609
610
/* Interaction states
611
----------------------------------*/
612
.ui-state-default,
613
.ui-widget-content .ui-state-default,
614
.ui-widget-header .ui-state-default {
615
	border: 1px solid #d3d3d3;
616
	background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
617
	font-weight: normal;
618
	color: #555555;
619
}
620
.ui-state-default a,
621
.ui-state-default a:link,
622
.ui-state-default a:visited {
623
	color: #555555;
624
	text-decoration: none;
625
}
626
.ui-state-hover,
627
.ui-widget-content .ui-state-hover,
628
.ui-widget-header .ui-state-hover,
629
.ui-state-focus,
630
.ui-widget-content .ui-state-focus,
631
.ui-widget-header .ui-state-focus {
632
	border: 1px solid #999999;
633
	background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
634
	font-weight: normal;
635
	color: #212121;
636
}
637
.ui-state-hover a,
638
.ui-state-hover a:hover,
639
.ui-state-hover a:link,
640
.ui-state-hover a:visited,
641
.ui-state-focus a,
642
.ui-state-focus a:hover,
643
.ui-state-focus a:link,
644
.ui-state-focus a:visited {
645
	color: #212121;
646
	text-decoration: none;
647
}
648
.ui-state-active,
649
.ui-widget-content .ui-state-active,
650
.ui-widget-header .ui-state-active {
651
	border: 1px solid #aaaaaa;
652
	background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
653
	font-weight: normal;
654
	color: #212121;
655
}
656
.ui-state-active a,
657
.ui-state-active a:link,
658
.ui-state-active a:visited {
659
	color: #212121;
660
	text-decoration: none;
661
}
662
663
/* Interaction Cues
664
----------------------------------*/
665
.ui-state-highlight,
666
.ui-widget-content .ui-state-highlight,
667
.ui-widget-header .ui-state-highlight {
668
	border: 1px solid #fcefa1;
669
	background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
670
	color: #363636;
671
}
672
.ui-state-highlight a,
673
.ui-widget-content .ui-state-highlight a,
674
.ui-widget-header .ui-state-highlight a {
675
	color: #363636;
676
}
677
.ui-state-error,
678
.ui-widget-content .ui-state-error,
679
.ui-widget-header .ui-state-error {
680
	border: 1px solid #cd0a0a;
681
	background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
682
	color: #cd0a0a;
683
}
684
.ui-state-error a,
685
.ui-widget-content .ui-state-error a,
686
.ui-widget-header .ui-state-error a {
687
	color: #cd0a0a;
688
}
689
.ui-state-error-text,
690
.ui-widget-content .ui-state-error-text,
691
.ui-widget-header .ui-state-error-text {
692
	color: #cd0a0a;
693
}
694
.ui-priority-primary,
695
.ui-widget-content .ui-priority-primary,
696
.ui-widget-header .ui-priority-primary {
697
	font-weight: bold;
698
}
699
.ui-priority-secondary,
700
.ui-widget-content .ui-priority-secondary,
701
.ui-widget-header .ui-priority-secondary {
702
	opacity: .7;
703
	filter:Alpha(Opacity=70); /* support: IE8 */
704
	font-weight: normal;
705
}
706
.ui-state-disabled,
707
.ui-widget-content .ui-state-disabled,
708
.ui-widget-header .ui-state-disabled {
709
	opacity: .35;
710
	filter:Alpha(Opacity=35); /* support: IE8 */
711
	background-image: none;
712
}
713
.ui-state-disabled .ui-icon {
714
	filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
715
}
716
717
/* Icons
718
----------------------------------*/
719
720
/* states and images */
721
.ui-icon {
722
	width: 16px;
723
	height: 16px;
724
}
725
.ui-icon,
726
.ui-widget-content .ui-icon {
727
	background-image: url("images/ui-icons_222222_256x240.png");
728
}
729
.ui-widget-header .ui-icon {
730
	background-image: url("images/ui-icons_222222_256x240.png");
731
}
732
.ui-state-default .ui-icon {
733
	background-image: url("images/ui-icons_888888_256x240.png");
734
}
735
.ui-state-hover .ui-icon,
736
.ui-state-focus .ui-icon {
737
	background-image: url("images/ui-icons_454545_256x240.png");
738
}
739
.ui-state-active .ui-icon {
740
	background-image: url("images/ui-icons_454545_256x240.png");
741
}
742
.ui-state-highlight .ui-icon {
743
	background-image: url("images/ui-icons_2e83ff_256x240.png");
744
}
745
.ui-state-error .ui-icon,
746
.ui-state-error-text .ui-icon {
747
	background-image: url("images/ui-icons_cd0a0a_256x240.png");
748
}
749
750
/* positioning */
751
.ui-icon-blank { background-position: 16px 16px; }
752
.ui-icon-carat-1-n { background-position: 0 0; }
753
.ui-icon-carat-1-ne { background-position: -16px 0; }
754
.ui-icon-carat-1-e { background-position: -32px 0; }
755
.ui-icon-carat-1-se { background-position: -48px 0; }
756
.ui-icon-carat-1-s { background-position: -64px 0; }
757
.ui-icon-carat-1-sw { background-position: -80px 0; }
758
.ui-icon-carat-1-w { background-position: -96px 0; }
759
.ui-icon-carat-1-nw { background-position: -112px 0; }
760
.ui-icon-carat-2-n-s { background-position: -128px 0; }
761
.ui-icon-carat-2-e-w { background-position: -144px 0; }
762
.ui-icon-triangle-1-n { background-position: 0 -16px; }
763
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
764
.ui-icon-triangle-1-e { background-position: -32px -16px; }
765
.ui-icon-triangle-1-se { background-position: -48px -16px; }
766
.ui-icon-triangle-1-s { background-position: -64px -16px; }
767
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
768
.ui-icon-triangle-1-w { background-position: -96px -16px; }
769
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
770
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
771
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
772
.ui-icon-arrow-1-n { background-position: 0 -32px; }
773
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
774
.ui-icon-arrow-1-e { background-position: -32px -32px; }
775
.ui-icon-arrow-1-se { background-position: -48px -32px; }
776
.ui-icon-arrow-1-s { background-position: -64px -32px; }
777
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
778
.ui-icon-arrow-1-w { background-position: -96px -32px; }
779
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
780
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
781
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
782
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
783
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
784
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
785
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
786
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
787
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
788
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
789
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
790
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
791
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
792
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
793
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
794
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
795
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
796
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
797
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
798
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
799
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
800
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
801
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
802
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
803
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
804
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
805
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
806
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
807
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
808
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
809
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
810
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
811
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
812
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
813
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
814
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
815
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
816
.ui-icon-arrow-4 { background-position: 0 -80px; }
817
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
818
.ui-icon-extlink { background-position: -32px -80px; }
819
.ui-icon-newwin { background-position: -48px -80px; }
820
.ui-icon-refresh { background-position: -64px -80px; }
821
.ui-icon-shuffle { background-position: -80px -80px; }
822
.ui-icon-transfer-e-w { background-position: -96px -80px; }
823
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
824
.ui-icon-folder-collapsed { background-position: 0 -96px; }
825
.ui-icon-folder-open { background-position: -16px -96px; }
826
.ui-icon-document { background-position: -32px -96px; }
827
.ui-icon-document-b { background-position: -48px -96px; }
828
.ui-icon-note { background-position: -64px -96px; }
829
.ui-icon-mail-closed { background-position: -80px -96px; }
830
.ui-icon-mail-open { background-position: -96px -96px; }
831
.ui-icon-suitcase { background-position: -112px -96px; }
832
.ui-icon-comment { background-position: -128px -96px; }
833
.ui-icon-person { background-position: -144px -96px; }
834
.ui-icon-print { background-position: -160px -96px; }
835
.ui-icon-trash { background-position: -176px -96px; }
836
.ui-icon-locked { background-position: -192px -96px; }
837
.ui-icon-unlocked { background-position: -208px -96px; }
838
.ui-icon-bookmark { background-position: -224px -96px; }
839
.ui-icon-tag { background-position: -240px -96px; }
840
.ui-icon-home { background-position: 0 -112px; }
841
.ui-icon-flag { background-position: -16px -112px; }
842
.ui-icon-calendar { background-position: -32px -112px; }
843
.ui-icon-cart { background-position: -48px -112px; }
844
.ui-icon-pencil { background-position: -64px -112px; }
845
.ui-icon-clock { background-position: -80px -112px; }
846
.ui-icon-disk { background-position: -96px -112px; }
847
.ui-icon-calculator { background-position: -112px -112px; }
848
.ui-icon-zoomin { background-position: -128px -112px; }
849
.ui-icon-zoomout { background-position: -144px -112px; }
850
.ui-icon-search { background-position: -160px -112px; }
851
.ui-icon-wrench { background-position: -176px -112px; }
852
.ui-icon-gear { background-position: -192px -112px; }
853
.ui-icon-heart { background-position: -208px -112px; }
854
.ui-icon-star { background-position: -224px -112px; }
855
.ui-icon-link { background-position: -240px -112px; }
856
.ui-icon-cancel { background-position: 0 -128px; }
857
.ui-icon-plus { background-position: -16px -128px; }
858
.ui-icon-plusthick { background-position: -32px -128px; }
859
.ui-icon-minus { background-position: -48px -128px; }
860
.ui-icon-minusthick { background-position: -64px -128px; }
861
.ui-icon-close { background-position: -80px -128px; }
862
.ui-icon-closethick { background-position: -96px -128px; }
863
.ui-icon-key { background-position: -112px -128px; }
864
.ui-icon-lightbulb { background-position: -128px -128px; }
865
.ui-icon-scissors { background-position: -144px -128px; }
866
.ui-icon-clipboard { background-position: -160px -128px; }
867
.ui-icon-copy { background-position: -176px -128px; }
868
.ui-icon-contact { background-position: -192px -128px; }
869
.ui-icon-image { background-position: -208px -128px; }
870
.ui-icon-video { background-position: -224px -128px; }
871
.ui-icon-script { background-position: -240px -128px; }
872
.ui-icon-alert { background-position: 0 -144px; }
873
.ui-icon-info { background-position: -16px -144px; }
874
.ui-icon-notice { background-position: -32px -144px; }
875
.ui-icon-help { background-position: -48px -144px; }
876
.ui-icon-check { background-position: -64px -144px; }
877
.ui-icon-bullet { background-position: -80px -144px; }
878
.ui-icon-radio-on { background-position: -96px -144px; }
879
.ui-icon-radio-off { background-position: -112px -144px; }
880
.ui-icon-pin-w { background-position: -128px -144px; }
881
.ui-icon-pin-s { background-position: -144px -144px; }
882
.ui-icon-play { background-position: 0 -160px; }
883
.ui-icon-pause { background-position: -16px -160px; }
884
.ui-icon-seek-next { background-position: -32px -160px; }
885
.ui-icon-seek-prev { background-position: -48px -160px; }
886
.ui-icon-seek-end { background-position: -64px -160px; }
887
.ui-icon-seek-start { background-position: -80px -160px; }
888
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
889
.ui-icon-seek-first { background-position: -80px -160px; }
890
.ui-icon-stop { background-position: -96px -160px; }
891
.ui-icon-eject { background-position: -112px -160px; }
892
.ui-icon-volume-off { background-position: -128px -160px; }
893
.ui-icon-volume-on { background-position: -144px -160px; }
894
.ui-icon-power { background-position: 0 -176px; }
895
.ui-icon-signal-diag { background-position: -16px -176px; }
896
.ui-icon-signal { background-position: -32px -176px; }
897
.ui-icon-battery-0 { background-position: -48px -176px; }
898
.ui-icon-battery-1 { background-position: -64px -176px; }
899
.ui-icon-battery-2 { background-position: -80px -176px; }
900
.ui-icon-battery-3 { background-position: -96px -176px; }
901
.ui-icon-circle-plus { background-position: 0 -192px; }
902
.ui-icon-circle-minus { background-position: -16px -192px; }
903
.ui-icon-circle-close { background-position: -32px -192px; }
904
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
905
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
906
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
907
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
908
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
909
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
910
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
911
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
912
.ui-icon-circle-zoomin { background-position: -176px -192px; }
913
.ui-icon-circle-zoomout { background-position: -192px -192px; }
914
.ui-icon-circle-check { background-position: -208px -192px; }
915
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
916
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
917
.ui-icon-circlesmall-close { background-position: -32px -208px; }
918
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
919
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
920
.ui-icon-squaresmall-close { background-position: -80px -208px; }
921
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
922
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
923
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
924
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
925
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
926
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
927
928
929
/* Misc visuals
930
----------------------------------*/
931
932
/* Corner radius */
933
.ui-corner-all,
934
.ui-corner-top,
935
.ui-corner-left,
936
.ui-corner-tl {
937
	border-top-left-radius: 4px;
938
}
939
.ui-corner-all,
940
.ui-corner-top,
941
.ui-corner-right,
942
.ui-corner-tr {
943
	border-top-right-radius: 4px;
944
}
945
.ui-corner-all,
946
.ui-corner-bottom,
947
.ui-corner-left,
948
.ui-corner-bl {
949
	border-bottom-left-radius: 4px;
950
}
951
.ui-corner-all,
952
.ui-corner-bottom,
953
.ui-corner-right,
954
.ui-corner-br {
955
	border-bottom-right-radius: 4px;
956
}
957
958
/* Overlays */
959
.ui-widget-overlay {
960
	background: #aaaaaa;
961
	opacity: .3;
962
	filter: Alpha(Opacity=30); /* support: IE8 */
963
}
964
.ui-widget-shadow {
965
	margin: -8px 0 0 -8px;
966
	padding: 8px;
967
	background: #aaaaaa;
968
	opacity: .3;
969
	filter: Alpha(Opacity=30); /* support: IE8 */
970
	border-radius: 8px;
971
}
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.js (+11711 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, menu.js, progressbar.js, slider.js, tabs.js, effect.js, effect-highlight.js
4
* Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6
(function( factory ) {
7
	if ( typeof define === "function" && define.amd ) {
8
9
		// AMD. Register as an anonymous module.
10
		define([ "jquery" ], factory );
11
	} else {
12
13
		// Browser globals
14
		factory( jQuery );
15
	}
16
}(function( $ ) {
17
/*!
18
 * jQuery UI Core 1.11.4
19
 * http://jqueryui.com
20
 *
21
 * Copyright jQuery Foundation and other contributors
22
 * Released under the MIT license.
23
 * http://jquery.org/license
24
 *
25
 * http://api.jqueryui.com/category/ui-core/
26
 */
27
28
29
// $.ui might exist from components with no dependencies, e.g., $.ui.position
30
$.ui = $.ui || {};
31
32
$.extend( $.ui, {
33
	version: "1.11.4",
34
35
	keyCode: {
36
		BACKSPACE: 8,
37
		COMMA: 188,
38
		DELETE: 46,
39
		DOWN: 40,
40
		END: 35,
41
		ENTER: 13,
42
		ESCAPE: 27,
43
		HOME: 36,
44
		LEFT: 37,
45
		PAGE_DOWN: 34,
46
		PAGE_UP: 33,
47
		PERIOD: 190,
48
		RIGHT: 39,
49
		SPACE: 32,
50
		TAB: 9,
51
		UP: 38
52
	}
53
});
54
55
// plugins
56
$.fn.extend({
57
	scrollParent: function( includeHidden ) {
58
		var position = this.css( "position" ),
59
			excludeStaticParent = position === "absolute",
60
			overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
61
			scrollParent = this.parents().filter( function() {
62
				var parent = $( this );
63
				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
64
					return false;
65
				}
66
				return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
67
			}).eq( 0 );
68
69
		return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
70
	},
71
72
	uniqueId: (function() {
73
		var uuid = 0;
74
75
		return function() {
76
			return this.each(function() {
77
				if ( !this.id ) {
78
					this.id = "ui-id-" + ( ++uuid );
79
				}
80
			});
81
		};
82
	})(),
83
84
	removeUniqueId: function() {
85
		return this.each(function() {
86
			if ( /^ui-id-\d+$/.test( this.id ) ) {
87
				$( this ).removeAttr( "id" );
88
			}
89
		});
90
	}
91
});
92
93
// selectors
94
function focusable( element, isTabIndexNotNaN ) {
95
	var map, mapName, img,
96
		nodeName = element.nodeName.toLowerCase();
97
	if ( "area" === nodeName ) {
98
		map = element.parentNode;
99
		mapName = map.name;
100
		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
101
			return false;
102
		}
103
		img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
104
		return !!img && visible( img );
105
	}
106
	return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
107
		!element.disabled :
108
		"a" === nodeName ?
109
			element.href || isTabIndexNotNaN :
110
			isTabIndexNotNaN) &&
111
		// the element and all of its ancestors must be visible
112
		visible( element );
113
}
114
115
function visible( element ) {
116
	return $.expr.filters.visible( element ) &&
117
		!$( element ).parents().addBack().filter(function() {
118
			return $.css( this, "visibility" ) === "hidden";
119
		}).length;
120
}
121
122
$.extend( $.expr[ ":" ], {
123
	data: $.expr.createPseudo ?
124
		$.expr.createPseudo(function( dataName ) {
125
			return function( elem ) {
126
				return !!$.data( elem, dataName );
127
			};
128
		}) :
129
		// support: jQuery <1.8
130
		function( elem, i, match ) {
131
			return !!$.data( elem, match[ 3 ] );
132
		},
133
134
	focusable: function( element ) {
135
		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
136
	},
137
138
	tabbable: function( element ) {
139
		var tabIndex = $.attr( element, "tabindex" ),
140
			isTabIndexNaN = isNaN( tabIndex );
141
		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
142
	}
143
});
144
145
// support: jQuery <1.8
146
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
147
	$.each( [ "Width", "Height" ], function( i, name ) {
148
		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149
			type = name.toLowerCase(),
150
			orig = {
151
				innerWidth: $.fn.innerWidth,
152
				innerHeight: $.fn.innerHeight,
153
				outerWidth: $.fn.outerWidth,
154
				outerHeight: $.fn.outerHeight
155
			};
156
157
		function reduce( elem, size, border, margin ) {
158
			$.each( side, function() {
159
				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
160
				if ( border ) {
161
					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
162
				}
163
				if ( margin ) {
164
					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
165
				}
166
			});
167
			return size;
168
		}
169
170
		$.fn[ "inner" + name ] = function( size ) {
171
			if ( size === undefined ) {
172
				return orig[ "inner" + name ].call( this );
173
			}
174
175
			return this.each(function() {
176
				$( this ).css( type, reduce( this, size ) + "px" );
177
			});
178
		};
179
180
		$.fn[ "outer" + name] = function( size, margin ) {
181
			if ( typeof size !== "number" ) {
182
				return orig[ "outer" + name ].call( this, size );
183
			}
184
185
			return this.each(function() {
186
				$( this).css( type, reduce( this, size, true, margin ) + "px" );
187
			});
188
		};
189
	});
190
}
191
192
// support: jQuery <1.8
193
if ( !$.fn.addBack ) {
194
	$.fn.addBack = function( selector ) {
195
		return this.add( selector == null ?
196
			this.prevObject : this.prevObject.filter( selector )
197
		);
198
	};
199
}
200
201
// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
202
if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
203
	$.fn.removeData = (function( removeData ) {
204
		return function( key ) {
205
			if ( arguments.length ) {
206
				return removeData.call( this, $.camelCase( key ) );
207
			} else {
208
				return removeData.call( this );
209
			}
210
		};
211
	})( $.fn.removeData );
212
}
213
214
// deprecated
215
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
216
217
$.fn.extend({
218
	focus: (function( orig ) {
219
		return function( delay, fn ) {
220
			return typeof delay === "number" ?
221
				this.each(function() {
222
					var elem = this;
223
					setTimeout(function() {
224
						$( elem ).focus();
225
						if ( fn ) {
226
							fn.call( elem );
227
						}
228
					}, delay );
229
				}) :
230
				orig.apply( this, arguments );
231
		};
232
	})( $.fn.focus ),
233
234
	disableSelection: (function() {
235
		var eventType = "onselectstart" in document.createElement( "div" ) ?
236
			"selectstart" :
237
			"mousedown";
238
239
		return function() {
240
			return this.bind( eventType + ".ui-disableSelection", function( event ) {
241
				event.preventDefault();
242
			});
243
		};
244
	})(),
245
246
	enableSelection: function() {
247
		return this.unbind( ".ui-disableSelection" );
248
	},
249
250
	zIndex: function( zIndex ) {
251
		if ( zIndex !== undefined ) {
252
			return this.css( "zIndex", zIndex );
253
		}
254
255
		if ( this.length ) {
256
			var elem = $( this[ 0 ] ), position, value;
257
			while ( elem.length && elem[ 0 ] !== document ) {
258
				// Ignore z-index if position is set to a value where z-index is ignored by the browser
259
				// This makes behavior of this function consistent across browsers
260
				// WebKit always returns auto if the element is positioned
261
				position = elem.css( "position" );
262
				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
263
					// IE returns 0 when zIndex is not specified
264
					// other browsers return a string
265
					// we ignore the case of nested elements with an explicit value of 0
266
					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
267
					value = parseInt( elem.css( "zIndex" ), 10 );
268
					if ( !isNaN( value ) && value !== 0 ) {
269
						return value;
270
					}
271
				}
272
				elem = elem.parent();
273
			}
274
		}
275
276
		return 0;
277
	}
278
});
279
280
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
281
$.ui.plugin = {
282
	add: function( module, option, set ) {
283
		var i,
284
			proto = $.ui[ module ].prototype;
285
		for ( i in set ) {
286
			proto.plugins[ i ] = proto.plugins[ i ] || [];
287
			proto.plugins[ i ].push( [ option, set[ i ] ] );
288
		}
289
	},
290
	call: function( instance, name, args, allowDisconnected ) {
291
		var i,
292
			set = instance.plugins[ name ];
293
294
		if ( !set ) {
295
			return;
296
		}
297
298
		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
299
			return;
300
		}
301
302
		for ( i = 0; i < set.length; i++ ) {
303
			if ( instance.options[ set[ i ][ 0 ] ] ) {
304
				set[ i ][ 1 ].apply( instance.element, args );
305
			}
306
		}
307
	}
308
};
309
310
311
/*!
312
 * jQuery UI Widget 1.11.4
313
 * http://jqueryui.com
314
 *
315
 * Copyright jQuery Foundation and other contributors
316
 * Released under the MIT license.
317
 * http://jquery.org/license
318
 *
319
 * http://api.jqueryui.com/jQuery.widget/
320
 */
321
322
323
var widget_uuid = 0,
324
	widget_slice = Array.prototype.slice;
325
326
$.cleanData = (function( orig ) {
327
	return function( elems ) {
328
		var events, elem, i;
329
		for ( i = 0; (elem = elems[i]) != null; i++ ) {
330
			try {
331
332
				// Only trigger remove when necessary to save time
333
				events = $._data( elem, "events" );
334
				if ( events && events.remove ) {
335
					$( elem ).triggerHandler( "remove" );
336
				}
337
338
			// http://bugs.jquery.com/ticket/8235
339
			} catch ( e ) {}
340
		}
341
		orig( elems );
342
	};
343
})( $.cleanData );
344
345
$.widget = function( name, base, prototype ) {
346
	var fullName, existingConstructor, constructor, basePrototype,
347
		// proxiedPrototype allows the provided prototype to remain unmodified
348
		// so that it can be used as a mixin for multiple widgets (#8876)
349
		proxiedPrototype = {},
350
		namespace = name.split( "." )[ 0 ];
351
352
	name = name.split( "." )[ 1 ];
353
	fullName = namespace + "-" + name;
354
355
	if ( !prototype ) {
356
		prototype = base;
357
		base = $.Widget;
358
	}
359
360
	// create selector for plugin
361
	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
362
		return !!$.data( elem, fullName );
363
	};
364
365
	$[ namespace ] = $[ namespace ] || {};
366
	existingConstructor = $[ namespace ][ name ];
367
	constructor = $[ namespace ][ name ] = function( options, element ) {
368
		// allow instantiation without "new" keyword
369
		if ( !this._createWidget ) {
370
			return new constructor( options, element );
371
		}
372
373
		// allow instantiation without initializing for simple inheritance
374
		// must use "new" keyword (the code above always passes args)
375
		if ( arguments.length ) {
376
			this._createWidget( options, element );
377
		}
378
	};
379
	// extend with the existing constructor to carry over any static properties
380
	$.extend( constructor, existingConstructor, {
381
		version: prototype.version,
382
		// copy the object used to create the prototype in case we need to
383
		// redefine the widget later
384
		_proto: $.extend( {}, prototype ),
385
		// track widgets that inherit from this widget in case this widget is
386
		// redefined after a widget inherits from it
387
		_childConstructors: []
388
	});
389
390
	basePrototype = new base();
391
	// we need to make the options hash a property directly on the new instance
392
	// otherwise we'll modify the options hash on the prototype that we're
393
	// inheriting from
394
	basePrototype.options = $.widget.extend( {}, basePrototype.options );
395
	$.each( prototype, function( prop, value ) {
396
		if ( !$.isFunction( value ) ) {
397
			proxiedPrototype[ prop ] = value;
398
			return;
399
		}
400
		proxiedPrototype[ prop ] = (function() {
401
			var _super = function() {
402
					return base.prototype[ prop ].apply( this, arguments );
403
				},
404
				_superApply = function( args ) {
405
					return base.prototype[ prop ].apply( this, args );
406
				};
407
			return function() {
408
				var __super = this._super,
409
					__superApply = this._superApply,
410
					returnValue;
411
412
				this._super = _super;
413
				this._superApply = _superApply;
414
415
				returnValue = value.apply( this, arguments );
416
417
				this._super = __super;
418
				this._superApply = __superApply;
419
420
				return returnValue;
421
			};
422
		})();
423
	});
424
	constructor.prototype = $.widget.extend( basePrototype, {
425
		// TODO: remove support for widgetEventPrefix
426
		// always use the name + a colon as the prefix, e.g., draggable:start
427
		// don't prefix for widgets that aren't DOM-based
428
		widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
429
	}, proxiedPrototype, {
430
		constructor: constructor,
431
		namespace: namespace,
432
		widgetName: name,
433
		widgetFullName: fullName
434
	});
435
436
	// If this widget is being redefined then we need to find all widgets that
437
	// are inheriting from it and redefine all of them so that they inherit from
438
	// the new version of this widget. We're essentially trying to replace one
439
	// level in the prototype chain.
440
	if ( existingConstructor ) {
441
		$.each( existingConstructor._childConstructors, function( i, child ) {
442
			var childPrototype = child.prototype;
443
444
			// redefine the child widget using the same prototype that was
445
			// originally used, but inherit from the new version of the base
446
			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
447
		});
448
		// remove the list of existing child constructors from the old constructor
449
		// so the old child constructors can be garbage collected
450
		delete existingConstructor._childConstructors;
451
	} else {
452
		base._childConstructors.push( constructor );
453
	}
454
455
	$.widget.bridge( name, constructor );
456
457
	return constructor;
458
};
459
460
$.widget.extend = function( target ) {
461
	var input = widget_slice.call( arguments, 1 ),
462
		inputIndex = 0,
463
		inputLength = input.length,
464
		key,
465
		value;
466
	for ( ; inputIndex < inputLength; inputIndex++ ) {
467
		for ( key in input[ inputIndex ] ) {
468
			value = input[ inputIndex ][ key ];
469
			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
470
				// Clone objects
471
				if ( $.isPlainObject( value ) ) {
472
					target[ key ] = $.isPlainObject( target[ key ] ) ?
473
						$.widget.extend( {}, target[ key ], value ) :
474
						// Don't extend strings, arrays, etc. with objects
475
						$.widget.extend( {}, value );
476
				// Copy everything else by reference
477
				} else {
478
					target[ key ] = value;
479
				}
480
			}
481
		}
482
	}
483
	return target;
484
};
485
486
$.widget.bridge = function( name, object ) {
487
	var fullName = object.prototype.widgetFullName || name;
488
	$.fn[ name ] = function( options ) {
489
		var isMethodCall = typeof options === "string",
490
			args = widget_slice.call( arguments, 1 ),
491
			returnValue = this;
492
493
		if ( isMethodCall ) {
494
			this.each(function() {
495
				var methodValue,
496
					instance = $.data( this, fullName );
497
				if ( options === "instance" ) {
498
					returnValue = instance;
499
					return false;
500
				}
501
				if ( !instance ) {
502
					return $.error( "cannot call methods on " + name + " prior to initialization; " +
503
						"attempted to call method '" + options + "'" );
504
				}
505
				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
506
					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
507
				}
508
				methodValue = instance[ options ].apply( instance, args );
509
				if ( methodValue !== instance && methodValue !== undefined ) {
510
					returnValue = methodValue && methodValue.jquery ?
511
						returnValue.pushStack( methodValue.get() ) :
512
						methodValue;
513
					return false;
514
				}
515
			});
516
		} else {
517
518
			// Allow multiple hashes to be passed on init
519
			if ( args.length ) {
520
				options = $.widget.extend.apply( null, [ options ].concat(args) );
521
			}
522
523
			this.each(function() {
524
				var instance = $.data( this, fullName );
525
				if ( instance ) {
526
					instance.option( options || {} );
527
					if ( instance._init ) {
528
						instance._init();
529
					}
530
				} else {
531
					$.data( this, fullName, new object( options, this ) );
532
				}
533
			});
534
		}
535
536
		return returnValue;
537
	};
538
};
539
540
$.Widget = function( /* options, element */ ) {};
541
$.Widget._childConstructors = [];
542
543
$.Widget.prototype = {
544
	widgetName: "widget",
545
	widgetEventPrefix: "",
546
	defaultElement: "<div>",
547
	options: {
548
		disabled: false,
549
550
		// callbacks
551
		create: null
552
	},
553
	_createWidget: function( options, element ) {
554
		element = $( element || this.defaultElement || this )[ 0 ];
555
		this.element = $( element );
556
		this.uuid = widget_uuid++;
557
		this.eventNamespace = "." + this.widgetName + this.uuid;
558
559
		this.bindings = $();
560
		this.hoverable = $();
561
		this.focusable = $();
562
563
		if ( element !== this ) {
564
			$.data( element, this.widgetFullName, this );
565
			this._on( true, this.element, {
566
				remove: function( event ) {
567
					if ( event.target === element ) {
568
						this.destroy();
569
					}
570
				}
571
			});
572
			this.document = $( element.style ?
573
				// element within the document
574
				element.ownerDocument :
575
				// element is window or document
576
				element.document || element );
577
			this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
578
		}
579
580
		this.options = $.widget.extend( {},
581
			this.options,
582
			this._getCreateOptions(),
583
			options );
584
585
		this._create();
586
		this._trigger( "create", null, this._getCreateEventData() );
587
		this._init();
588
	},
589
	_getCreateOptions: $.noop,
590
	_getCreateEventData: $.noop,
591
	_create: $.noop,
592
	_init: $.noop,
593
594
	destroy: function() {
595
		this._destroy();
596
		// we can probably remove the unbind calls in 2.0
597
		// all event bindings should go through this._on()
598
		this.element
599
			.unbind( this.eventNamespace )
600
			.removeData( this.widgetFullName )
601
			// support: jquery <1.6.3
602
			// http://bugs.jquery.com/ticket/9413
603
			.removeData( $.camelCase( this.widgetFullName ) );
604
		this.widget()
605
			.unbind( this.eventNamespace )
606
			.removeAttr( "aria-disabled" )
607
			.removeClass(
608
				this.widgetFullName + "-disabled " +
609
				"ui-state-disabled" );
610
611
		// clean up events and states
612
		this.bindings.unbind( this.eventNamespace );
613
		this.hoverable.removeClass( "ui-state-hover" );
614
		this.focusable.removeClass( "ui-state-focus" );
615
	},
616
	_destroy: $.noop,
617
618
	widget: function() {
619
		return this.element;
620
	},
621
622
	option: function( key, value ) {
623
		var options = key,
624
			parts,
625
			curOption,
626
			i;
627
628
		if ( arguments.length === 0 ) {
629
			// don't return a reference to the internal hash
630
			return $.widget.extend( {}, this.options );
631
		}
632
633
		if ( typeof key === "string" ) {
634
			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
635
			options = {};
636
			parts = key.split( "." );
637
			key = parts.shift();
638
			if ( parts.length ) {
639
				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
640
				for ( i = 0; i < parts.length - 1; i++ ) {
641
					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
642
					curOption = curOption[ parts[ i ] ];
643
				}
644
				key = parts.pop();
645
				if ( arguments.length === 1 ) {
646
					return curOption[ key ] === undefined ? null : curOption[ key ];
647
				}
648
				curOption[ key ] = value;
649
			} else {
650
				if ( arguments.length === 1 ) {
651
					return this.options[ key ] === undefined ? null : this.options[ key ];
652
				}
653
				options[ key ] = value;
654
			}
655
		}
656
657
		this._setOptions( options );
658
659
		return this;
660
	},
661
	_setOptions: function( options ) {
662
		var key;
663
664
		for ( key in options ) {
665
			this._setOption( key, options[ key ] );
666
		}
667
668
		return this;
669
	},
670
	_setOption: function( key, value ) {
671
		this.options[ key ] = value;
672
673
		if ( key === "disabled" ) {
674
			this.widget()
675
				.toggleClass( this.widgetFullName + "-disabled", !!value );
676
677
			// If the widget is becoming disabled, then nothing is interactive
678
			if ( value ) {
679
				this.hoverable.removeClass( "ui-state-hover" );
680
				this.focusable.removeClass( "ui-state-focus" );
681
			}
682
		}
683
684
		return this;
685
	},
686
687
	enable: function() {
688
		return this._setOptions({ disabled: false });
689
	},
690
	disable: function() {
691
		return this._setOptions({ disabled: true });
692
	},
693
694
	_on: function( suppressDisabledCheck, element, handlers ) {
695
		var delegateElement,
696
			instance = this;
697
698
		// no suppressDisabledCheck flag, shuffle arguments
699
		if ( typeof suppressDisabledCheck !== "boolean" ) {
700
			handlers = element;
701
			element = suppressDisabledCheck;
702
			suppressDisabledCheck = false;
703
		}
704
705
		// no element argument, shuffle and use this.element
706
		if ( !handlers ) {
707
			handlers = element;
708
			element = this.element;
709
			delegateElement = this.widget();
710
		} else {
711
			element = delegateElement = $( element );
712
			this.bindings = this.bindings.add( element );
713
		}
714
715
		$.each( handlers, function( event, handler ) {
716
			function handlerProxy() {
717
				// allow widgets to customize the disabled handling
718
				// - disabled as an array instead of boolean
719
				// - disabled class as method for disabling individual parts
720
				if ( !suppressDisabledCheck &&
721
						( instance.options.disabled === true ||
722
							$( this ).hasClass( "ui-state-disabled" ) ) ) {
723
					return;
724
				}
725
				return ( typeof handler === "string" ? instance[ handler ] : handler )
726
					.apply( instance, arguments );
727
			}
728
729
			// copy the guid so direct unbinding works
730
			if ( typeof handler !== "string" ) {
731
				handlerProxy.guid = handler.guid =
732
					handler.guid || handlerProxy.guid || $.guid++;
733
			}
734
735
			var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
736
				eventName = match[1] + instance.eventNamespace,
737
				selector = match[2];
738
			if ( selector ) {
739
				delegateElement.delegate( selector, eventName, handlerProxy );
740
			} else {
741
				element.bind( eventName, handlerProxy );
742
			}
743
		});
744
	},
745
746
	_off: function( element, eventName ) {
747
		eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
748
			this.eventNamespace;
749
		element.unbind( eventName ).undelegate( eventName );
750
751
		// Clear the stack to avoid memory leaks (#10056)
752
		this.bindings = $( this.bindings.not( element ).get() );
753
		this.focusable = $( this.focusable.not( element ).get() );
754
		this.hoverable = $( this.hoverable.not( element ).get() );
755
	},
756
757
	_delay: function( handler, delay ) {
758
		function handlerProxy() {
759
			return ( typeof handler === "string" ? instance[ handler ] : handler )
760
				.apply( instance, arguments );
761
		}
762
		var instance = this;
763
		return setTimeout( handlerProxy, delay || 0 );
764
	},
765
766
	_hoverable: function( element ) {
767
		this.hoverable = this.hoverable.add( element );
768
		this._on( element, {
769
			mouseenter: function( event ) {
770
				$( event.currentTarget ).addClass( "ui-state-hover" );
771
			},
772
			mouseleave: function( event ) {
773
				$( event.currentTarget ).removeClass( "ui-state-hover" );
774
			}
775
		});
776
	},
777
778
	_focusable: function( element ) {
779
		this.focusable = this.focusable.add( element );
780
		this._on( element, {
781
			focusin: function( event ) {
782
				$( event.currentTarget ).addClass( "ui-state-focus" );
783
			},
784
			focusout: function( event ) {
785
				$( event.currentTarget ).removeClass( "ui-state-focus" );
786
			}
787
		});
788
	},
789
790
	_trigger: function( type, event, data ) {
791
		var prop, orig,
792
			callback = this.options[ type ];
793
794
		data = data || {};
795
		event = $.Event( event );
796
		event.type = ( type === this.widgetEventPrefix ?
797
			type :
798
			this.widgetEventPrefix + type ).toLowerCase();
799
		// the original event may come from any element
800
		// so we need to reset the target on the new event
801
		event.target = this.element[ 0 ];
802
803
		// copy original event properties over to the new event
804
		orig = event.originalEvent;
805
		if ( orig ) {
806
			for ( prop in orig ) {
807
				if ( !( prop in event ) ) {
808
					event[ prop ] = orig[ prop ];
809
				}
810
			}
811
		}
812
813
		this.element.trigger( event, data );
814
		return !( $.isFunction( callback ) &&
815
			callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
816
			event.isDefaultPrevented() );
817
	}
818
};
819
820
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
821
	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
822
		if ( typeof options === "string" ) {
823
			options = { effect: options };
824
		}
825
		var hasOptions,
826
			effectName = !options ?
827
				method :
828
				options === true || typeof options === "number" ?
829
					defaultEffect :
830
					options.effect || defaultEffect;
831
		options = options || {};
832
		if ( typeof options === "number" ) {
833
			options = { duration: options };
834
		}
835
		hasOptions = !$.isEmptyObject( options );
836
		options.complete = callback;
837
		if ( options.delay ) {
838
			element.delay( options.delay );
839
		}
840
		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
841
			element[ method ]( options );
842
		} else if ( effectName !== method && element[ effectName ] ) {
843
			element[ effectName ]( options.duration, options.easing, callback );
844
		} else {
845
			element.queue(function( next ) {
846
				$( this )[ method ]();
847
				if ( callback ) {
848
					callback.call( element[ 0 ] );
849
				}
850
				next();
851
			});
852
		}
853
	};
854
});
855
856
var widget = $.widget;
857
858
859
/*!
860
 * jQuery UI Mouse 1.11.4
861
 * http://jqueryui.com
862
 *
863
 * Copyright jQuery Foundation and other contributors
864
 * Released under the MIT license.
865
 * http://jquery.org/license
866
 *
867
 * http://api.jqueryui.com/mouse/
868
 */
869
870
871
var mouseHandled = false;
872
$( document ).mouseup( function() {
873
	mouseHandled = false;
874
});
875
876
var mouse = $.widget("ui.mouse", {
877
	version: "1.11.4",
878
	options: {
879
		cancel: "input,textarea,button,select,option",
880
		distance: 1,
881
		delay: 0
882
	},
883
	_mouseInit: function() {
884
		var that = this;
885
886
		this.element
887
			.bind("mousedown." + this.widgetName, function(event) {
888
				return that._mouseDown(event);
889
			})
890
			.bind("click." + this.widgetName, function(event) {
891
				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
892
					$.removeData(event.target, that.widgetName + ".preventClickEvent");
893
					event.stopImmediatePropagation();
894
					return false;
895
				}
896
			});
897
898
		this.started = false;
899
	},
900
901
	// TODO: make sure destroying one instance of mouse doesn't mess with
902
	// other instances of mouse
903
	_mouseDestroy: function() {
904
		this.element.unbind("." + this.widgetName);
905
		if ( this._mouseMoveDelegate ) {
906
			this.document
907
				.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
908
				.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
909
		}
910
	},
911
912
	_mouseDown: function(event) {
913
		// don't let more than one widget handle mouseStart
914
		if ( mouseHandled ) {
915
			return;
916
		}
917
918
		this._mouseMoved = false;
919
920
		// we may have missed mouseup (out of window)
921
		(this._mouseStarted && this._mouseUp(event));
922
923
		this._mouseDownEvent = event;
924
925
		var that = this,
926
			btnIsLeft = (event.which === 1),
927
			// event.target.nodeName works around a bug in IE 8 with
928
			// disabled inputs (#7620)
929
			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
930
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
931
			return true;
932
		}
933
934
		this.mouseDelayMet = !this.options.delay;
935
		if (!this.mouseDelayMet) {
936
			this._mouseDelayTimer = setTimeout(function() {
937
				that.mouseDelayMet = true;
938
			}, this.options.delay);
939
		}
940
941
		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
942
			this._mouseStarted = (this._mouseStart(event) !== false);
943
			if (!this._mouseStarted) {
944
				event.preventDefault();
945
				return true;
946
			}
947
		}
948
949
		// Click event may never have fired (Gecko & Opera)
950
		if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
951
			$.removeData(event.target, this.widgetName + ".preventClickEvent");
952
		}
953
954
		// these delegates are required to keep context
955
		this._mouseMoveDelegate = function(event) {
956
			return that._mouseMove(event);
957
		};
958
		this._mouseUpDelegate = function(event) {
959
			return that._mouseUp(event);
960
		};
961
962
		this.document
963
			.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
964
			.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
965
966
		event.preventDefault();
967
968
		mouseHandled = true;
969
		return true;
970
	},
971
972
	_mouseMove: function(event) {
973
		// Only check for mouseups outside the document if you've moved inside the document
974
		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
975
		// fire a mousemove event if content is placed under the cursor. See #7778
976
		// Support: IE <9
977
		if ( this._mouseMoved ) {
978
			// IE mouseup check - mouseup happened when mouse was out of window
979
			if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
980
				return this._mouseUp(event);
981
982
			// Iframe mouseup check - mouseup occurred in another document
983
			} else if ( !event.which ) {
984
				return this._mouseUp( event );
985
			}
986
		}
987
988
		if ( event.which || event.button ) {
989
			this._mouseMoved = true;
990
		}
991
992
		if (this._mouseStarted) {
993
			this._mouseDrag(event);
994
			return event.preventDefault();
995
		}
996
997
		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
998
			this._mouseStarted =
999
				(this._mouseStart(this._mouseDownEvent, event) !== false);
1000
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1001
		}
1002
1003
		return !this._mouseStarted;
1004
	},
1005
1006
	_mouseUp: function(event) {
1007
		this.document
1008
			.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1009
			.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1010
1011
		if (this._mouseStarted) {
1012
			this._mouseStarted = false;
1013
1014
			if (event.target === this._mouseDownEvent.target) {
1015
				$.data(event.target, this.widgetName + ".preventClickEvent", true);
1016
			}
1017
1018
			this._mouseStop(event);
1019
		}
1020
1021
		mouseHandled = false;
1022
		return false;
1023
	},
1024
1025
	_mouseDistanceMet: function(event) {
1026
		return (Math.max(
1027
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
1028
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
1029
			) >= this.options.distance
1030
		);
1031
	},
1032
1033
	_mouseDelayMet: function(/* event */) {
1034
		return this.mouseDelayMet;
1035
	},
1036
1037
	// These are placeholder methods, to be overriden by extending plugin
1038
	_mouseStart: function(/* event */) {},
1039
	_mouseDrag: function(/* event */) {},
1040
	_mouseStop: function(/* event */) {},
1041
	_mouseCapture: function(/* event */) { return true; }
1042
});
1043
1044
1045
/*!
1046
 * jQuery UI Position 1.11.4
1047
 * http://jqueryui.com
1048
 *
1049
 * Copyright jQuery Foundation and other contributors
1050
 * Released under the MIT license.
1051
 * http://jquery.org/license
1052
 *
1053
 * http://api.jqueryui.com/position/
1054
 */
1055
1056
(function() {
1057
1058
$.ui = $.ui || {};
1059
1060
var cachedScrollbarWidth, supportsOffsetFractions,
1061
	max = Math.max,
1062
	abs = Math.abs,
1063
	round = Math.round,
1064
	rhorizontal = /left|center|right/,
1065
	rvertical = /top|center|bottom/,
1066
	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
1067
	rposition = /^\w+/,
1068
	rpercent = /%$/,
1069
	_position = $.fn.position;
1070
1071
function getOffsets( offsets, width, height ) {
1072
	return [
1073
		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
1074
		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
1075
	];
1076
}
1077
1078
function parseCss( element, property ) {
1079
	return parseInt( $.css( element, property ), 10 ) || 0;
1080
}
1081
1082
function getDimensions( elem ) {
1083
	var raw = elem[0];
1084
	if ( raw.nodeType === 9 ) {
1085
		return {
1086
			width: elem.width(),
1087
			height: elem.height(),
1088
			offset: { top: 0, left: 0 }
1089
		};
1090
	}
1091
	if ( $.isWindow( raw ) ) {
1092
		return {
1093
			width: elem.width(),
1094
			height: elem.height(),
1095
			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1096
		};
1097
	}
1098
	if ( raw.preventDefault ) {
1099
		return {
1100
			width: 0,
1101
			height: 0,
1102
			offset: { top: raw.pageY, left: raw.pageX }
1103
		};
1104
	}
1105
	return {
1106
		width: elem.outerWidth(),
1107
		height: elem.outerHeight(),
1108
		offset: elem.offset()
1109
	};
1110
}
1111
1112
$.position = {
1113
	scrollbarWidth: function() {
1114
		if ( cachedScrollbarWidth !== undefined ) {
1115
			return cachedScrollbarWidth;
1116
		}
1117
		var w1, w2,
1118
			div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
1119
			innerDiv = div.children()[0];
1120
1121
		$( "body" ).append( div );
1122
		w1 = innerDiv.offsetWidth;
1123
		div.css( "overflow", "scroll" );
1124
1125
		w2 = innerDiv.offsetWidth;
1126
1127
		if ( w1 === w2 ) {
1128
			w2 = div[0].clientWidth;
1129
		}
1130
1131
		div.remove();
1132
1133
		return (cachedScrollbarWidth = w1 - w2);
1134
	},
1135
	getScrollInfo: function( within ) {
1136
		var overflowX = within.isWindow || within.isDocument ? "" :
1137
				within.element.css( "overflow-x" ),
1138
			overflowY = within.isWindow || within.isDocument ? "" :
1139
				within.element.css( "overflow-y" ),
1140
			hasOverflowX = overflowX === "scroll" ||
1141
				( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
1142
			hasOverflowY = overflowY === "scroll" ||
1143
				( overflowY === "auto" && within.height < within.element[0].scrollHeight );
1144
		return {
1145
			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
1146
			height: hasOverflowX ? $.position.scrollbarWidth() : 0
1147
		};
1148
	},
1149
	getWithinInfo: function( element ) {
1150
		var withinElement = $( element || window ),
1151
			isWindow = $.isWindow( withinElement[0] ),
1152
			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
1153
		return {
1154
			element: withinElement,
1155
			isWindow: isWindow,
1156
			isDocument: isDocument,
1157
			offset: withinElement.offset() || { left: 0, top: 0 },
1158
			scrollLeft: withinElement.scrollLeft(),
1159
			scrollTop: withinElement.scrollTop(),
1160
1161
			// support: jQuery 1.6.x
1162
			// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1163
			width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1164
			height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
1165
		};
1166
	}
1167
};
1168
1169
$.fn.position = function( options ) {
1170
	if ( !options || !options.of ) {
1171
		return _position.apply( this, arguments );
1172
	}
1173
1174
	// make a copy, we don't want to modify arguments
1175
	options = $.extend( {}, options );
1176
1177
	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1178
		target = $( options.of ),
1179
		within = $.position.getWithinInfo( options.within ),
1180
		scrollInfo = $.position.getScrollInfo( within ),
1181
		collision = ( options.collision || "flip" ).split( " " ),
1182
		offsets = {};
1183
1184
	dimensions = getDimensions( target );
1185
	if ( target[0].preventDefault ) {
1186
		// force left top to allow flipping
1187
		options.at = "left top";
1188
	}
1189
	targetWidth = dimensions.width;
1190
	targetHeight = dimensions.height;
1191
	targetOffset = dimensions.offset;
1192
	// clone to reuse original targetOffset later
1193
	basePosition = $.extend( {}, targetOffset );
1194
1195
	// force my and at to have valid horizontal and vertical positions
1196
	// if a value is missing or invalid, it will be converted to center
1197
	$.each( [ "my", "at" ], function() {
1198
		var pos = ( options[ this ] || "" ).split( " " ),
1199
			horizontalOffset,
1200
			verticalOffset;
1201
1202
		if ( pos.length === 1) {
1203
			pos = rhorizontal.test( pos[ 0 ] ) ?
1204
				pos.concat( [ "center" ] ) :
1205
				rvertical.test( pos[ 0 ] ) ?
1206
					[ "center" ].concat( pos ) :
1207
					[ "center", "center" ];
1208
		}
1209
		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1210
		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1211
1212
		// calculate offsets
1213
		horizontalOffset = roffset.exec( pos[ 0 ] );
1214
		verticalOffset = roffset.exec( pos[ 1 ] );
1215
		offsets[ this ] = [
1216
			horizontalOffset ? horizontalOffset[ 0 ] : 0,
1217
			verticalOffset ? verticalOffset[ 0 ] : 0
1218
		];
1219
1220
		// reduce to just the positions without the offsets
1221
		options[ this ] = [
1222
			rposition.exec( pos[ 0 ] )[ 0 ],
1223
			rposition.exec( pos[ 1 ] )[ 0 ]
1224
		];
1225
	});
1226
1227
	// normalize collision option
1228
	if ( collision.length === 1 ) {
1229
		collision[ 1 ] = collision[ 0 ];
1230
	}
1231
1232
	if ( options.at[ 0 ] === "right" ) {
1233
		basePosition.left += targetWidth;
1234
	} else if ( options.at[ 0 ] === "center" ) {
1235
		basePosition.left += targetWidth / 2;
1236
	}
1237
1238
	if ( options.at[ 1 ] === "bottom" ) {
1239
		basePosition.top += targetHeight;
1240
	} else if ( options.at[ 1 ] === "center" ) {
1241
		basePosition.top += targetHeight / 2;
1242
	}
1243
1244
	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1245
	basePosition.left += atOffset[ 0 ];
1246
	basePosition.top += atOffset[ 1 ];
1247
1248
	return this.each(function() {
1249
		var collisionPosition, using,
1250
			elem = $( this ),
1251
			elemWidth = elem.outerWidth(),
1252
			elemHeight = elem.outerHeight(),
1253
			marginLeft = parseCss( this, "marginLeft" ),
1254
			marginTop = parseCss( this, "marginTop" ),
1255
			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1256
			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1257
			position = $.extend( {}, basePosition ),
1258
			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1259
1260
		if ( options.my[ 0 ] === "right" ) {
1261
			position.left -= elemWidth;
1262
		} else if ( options.my[ 0 ] === "center" ) {
1263
			position.left -= elemWidth / 2;
1264
		}
1265
1266
		if ( options.my[ 1 ] === "bottom" ) {
1267
			position.top -= elemHeight;
1268
		} else if ( options.my[ 1 ] === "center" ) {
1269
			position.top -= elemHeight / 2;
1270
		}
1271
1272
		position.left += myOffset[ 0 ];
1273
		position.top += myOffset[ 1 ];
1274
1275
		// if the browser doesn't support fractions, then round for consistent results
1276
		if ( !supportsOffsetFractions ) {
1277
			position.left = round( position.left );
1278
			position.top = round( position.top );
1279
		}
1280
1281
		collisionPosition = {
1282
			marginLeft: marginLeft,
1283
			marginTop: marginTop
1284
		};
1285
1286
		$.each( [ "left", "top" ], function( i, dir ) {
1287
			if ( $.ui.position[ collision[ i ] ] ) {
1288
				$.ui.position[ collision[ i ] ][ dir ]( position, {
1289
					targetWidth: targetWidth,
1290
					targetHeight: targetHeight,
1291
					elemWidth: elemWidth,
1292
					elemHeight: elemHeight,
1293
					collisionPosition: collisionPosition,
1294
					collisionWidth: collisionWidth,
1295
					collisionHeight: collisionHeight,
1296
					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1297
					my: options.my,
1298
					at: options.at,
1299
					within: within,
1300
					elem: elem
1301
				});
1302
			}
1303
		});
1304
1305
		if ( options.using ) {
1306
			// adds feedback as second argument to using callback, if present
1307
			using = function( props ) {
1308
				var left = targetOffset.left - position.left,
1309
					right = left + targetWidth - elemWidth,
1310
					top = targetOffset.top - position.top,
1311
					bottom = top + targetHeight - elemHeight,
1312
					feedback = {
1313
						target: {
1314
							element: target,
1315
							left: targetOffset.left,
1316
							top: targetOffset.top,
1317
							width: targetWidth,
1318
							height: targetHeight
1319
						},
1320
						element: {
1321
							element: elem,
1322
							left: position.left,
1323
							top: position.top,
1324
							width: elemWidth,
1325
							height: elemHeight
1326
						},
1327
						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1328
						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1329
					};
1330
				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1331
					feedback.horizontal = "center";
1332
				}
1333
				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1334
					feedback.vertical = "middle";
1335
				}
1336
				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1337
					feedback.important = "horizontal";
1338
				} else {
1339
					feedback.important = "vertical";
1340
				}
1341
				options.using.call( this, props, feedback );
1342
			};
1343
		}
1344
1345
		elem.offset( $.extend( position, { using: using } ) );
1346
	});
1347
};
1348
1349
$.ui.position = {
1350
	fit: {
1351
		left: function( position, data ) {
1352
			var within = data.within,
1353
				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1354
				outerWidth = within.width,
1355
				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1356
				overLeft = withinOffset - collisionPosLeft,
1357
				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1358
				newOverRight;
1359
1360
			// element is wider than within
1361
			if ( data.collisionWidth > outerWidth ) {
1362
				// element is initially over the left side of within
1363
				if ( overLeft > 0 && overRight <= 0 ) {
1364
					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1365
					position.left += overLeft - newOverRight;
1366
				// element is initially over right side of within
1367
				} else if ( overRight > 0 && overLeft <= 0 ) {
1368
					position.left = withinOffset;
1369
				// element is initially over both left and right sides of within
1370
				} else {
1371
					if ( overLeft > overRight ) {
1372
						position.left = withinOffset + outerWidth - data.collisionWidth;
1373
					} else {
1374
						position.left = withinOffset;
1375
					}
1376
				}
1377
			// too far left -> align with left edge
1378
			} else if ( overLeft > 0 ) {
1379
				position.left += overLeft;
1380
			// too far right -> align with right edge
1381
			} else if ( overRight > 0 ) {
1382
				position.left -= overRight;
1383
			// adjust based on position and margin
1384
			} else {
1385
				position.left = max( position.left - collisionPosLeft, position.left );
1386
			}
1387
		},
1388
		top: function( position, data ) {
1389
			var within = data.within,
1390
				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1391
				outerHeight = data.within.height,
1392
				collisionPosTop = position.top - data.collisionPosition.marginTop,
1393
				overTop = withinOffset - collisionPosTop,
1394
				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1395
				newOverBottom;
1396
1397
			// element is taller than within
1398
			if ( data.collisionHeight > outerHeight ) {
1399
				// element is initially over the top of within
1400
				if ( overTop > 0 && overBottom <= 0 ) {
1401
					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1402
					position.top += overTop - newOverBottom;
1403
				// element is initially over bottom of within
1404
				} else if ( overBottom > 0 && overTop <= 0 ) {
1405
					position.top = withinOffset;
1406
				// element is initially over both top and bottom of within
1407
				} else {
1408
					if ( overTop > overBottom ) {
1409
						position.top = withinOffset + outerHeight - data.collisionHeight;
1410
					} else {
1411
						position.top = withinOffset;
1412
					}
1413
				}
1414
			// too far up -> align with top
1415
			} else if ( overTop > 0 ) {
1416
				position.top += overTop;
1417
			// too far down -> align with bottom edge
1418
			} else if ( overBottom > 0 ) {
1419
				position.top -= overBottom;
1420
			// adjust based on position and margin
1421
			} else {
1422
				position.top = max( position.top - collisionPosTop, position.top );
1423
			}
1424
		}
1425
	},
1426
	flip: {
1427
		left: function( position, data ) {
1428
			var within = data.within,
1429
				withinOffset = within.offset.left + within.scrollLeft,
1430
				outerWidth = within.width,
1431
				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1432
				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1433
				overLeft = collisionPosLeft - offsetLeft,
1434
				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1435
				myOffset = data.my[ 0 ] === "left" ?
1436
					-data.elemWidth :
1437
					data.my[ 0 ] === "right" ?
1438
						data.elemWidth :
1439
						0,
1440
				atOffset = data.at[ 0 ] === "left" ?
1441
					data.targetWidth :
1442
					data.at[ 0 ] === "right" ?
1443
						-data.targetWidth :
1444
						0,
1445
				offset = -2 * data.offset[ 0 ],
1446
				newOverRight,
1447
				newOverLeft;
1448
1449
			if ( overLeft < 0 ) {
1450
				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1451
				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1452
					position.left += myOffset + atOffset + offset;
1453
				}
1454
			} else if ( overRight > 0 ) {
1455
				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1456
				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1457
					position.left += myOffset + atOffset + offset;
1458
				}
1459
			}
1460
		},
1461
		top: function( position, data ) {
1462
			var within = data.within,
1463
				withinOffset = within.offset.top + within.scrollTop,
1464
				outerHeight = within.height,
1465
				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1466
				collisionPosTop = position.top - data.collisionPosition.marginTop,
1467
				overTop = collisionPosTop - offsetTop,
1468
				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1469
				top = data.my[ 1 ] === "top",
1470
				myOffset = top ?
1471
					-data.elemHeight :
1472
					data.my[ 1 ] === "bottom" ?
1473
						data.elemHeight :
1474
						0,
1475
				atOffset = data.at[ 1 ] === "top" ?
1476
					data.targetHeight :
1477
					data.at[ 1 ] === "bottom" ?
1478
						-data.targetHeight :
1479
						0,
1480
				offset = -2 * data.offset[ 1 ],
1481
				newOverTop,
1482
				newOverBottom;
1483
			if ( overTop < 0 ) {
1484
				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1485
				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1486
					position.top += myOffset + atOffset + offset;
1487
				}
1488
			} else if ( overBottom > 0 ) {
1489
				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1490
				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1491
					position.top += myOffset + atOffset + offset;
1492
				}
1493
			}
1494
		}
1495
	},
1496
	flipfit: {
1497
		left: function() {
1498
			$.ui.position.flip.left.apply( this, arguments );
1499
			$.ui.position.fit.left.apply( this, arguments );
1500
		},
1501
		top: function() {
1502
			$.ui.position.flip.top.apply( this, arguments );
1503
			$.ui.position.fit.top.apply( this, arguments );
1504
		}
1505
	}
1506
};
1507
1508
// fraction support test
1509
(function() {
1510
	var testElement, testElementParent, testElementStyle, offsetLeft, i,
1511
		body = document.getElementsByTagName( "body" )[ 0 ],
1512
		div = document.createElement( "div" );
1513
1514
	//Create a "fake body" for testing based on method used in jQuery.support
1515
	testElement = document.createElement( body ? "div" : "body" );
1516
	testElementStyle = {
1517
		visibility: "hidden",
1518
		width: 0,
1519
		height: 0,
1520
		border: 0,
1521
		margin: 0,
1522
		background: "none"
1523
	};
1524
	if ( body ) {
1525
		$.extend( testElementStyle, {
1526
			position: "absolute",
1527
			left: "-1000px",
1528
			top: "-1000px"
1529
		});
1530
	}
1531
	for ( i in testElementStyle ) {
1532
		testElement.style[ i ] = testElementStyle[ i ];
1533
	}
1534
	testElement.appendChild( div );
1535
	testElementParent = body || document.documentElement;
1536
	testElementParent.insertBefore( testElement, testElementParent.firstChild );
1537
1538
	div.style.cssText = "position: absolute; left: 10.7432222px;";
1539
1540
	offsetLeft = $( div ).offset().left;
1541
	supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1542
1543
	testElement.innerHTML = "";
1544
	testElementParent.removeChild( testElement );
1545
})();
1546
1547
})();
1548
1549
var position = $.ui.position;
1550
1551
1552
/*!
1553
 * jQuery UI Draggable 1.11.4
1554
 * http://jqueryui.com
1555
 *
1556
 * Copyright jQuery Foundation and other contributors
1557
 * Released under the MIT license.
1558
 * http://jquery.org/license
1559
 *
1560
 * http://api.jqueryui.com/draggable/
1561
 */
1562
1563
1564
$.widget("ui.draggable", $.ui.mouse, {
1565
	version: "1.11.4",
1566
	widgetEventPrefix: "drag",
1567
	options: {
1568
		addClasses: true,
1569
		appendTo: "parent",
1570
		axis: false,
1571
		connectToSortable: false,
1572
		containment: false,
1573
		cursor: "auto",
1574
		cursorAt: false,
1575
		grid: false,
1576
		handle: false,
1577
		helper: "original",
1578
		iframeFix: false,
1579
		opacity: false,
1580
		refreshPositions: false,
1581
		revert: false,
1582
		revertDuration: 500,
1583
		scope: "default",
1584
		scroll: true,
1585
		scrollSensitivity: 20,
1586
		scrollSpeed: 20,
1587
		snap: false,
1588
		snapMode: "both",
1589
		snapTolerance: 20,
1590
		stack: false,
1591
		zIndex: false,
1592
1593
		// callbacks
1594
		drag: null,
1595
		start: null,
1596
		stop: null
1597
	},
1598
	_create: function() {
1599
1600
		if ( this.options.helper === "original" ) {
1601
			this._setPositionRelative();
1602
		}
1603
		if (this.options.addClasses){
1604
			this.element.addClass("ui-draggable");
1605
		}
1606
		if (this.options.disabled){
1607
			this.element.addClass("ui-draggable-disabled");
1608
		}
1609
		this._setHandleClassName();
1610
1611
		this._mouseInit();
1612
	},
1613
1614
	_setOption: function( key, value ) {
1615
		this._super( key, value );
1616
		if ( key === "handle" ) {
1617
			this._removeHandleClassName();
1618
			this._setHandleClassName();
1619
		}
1620
	},
1621
1622
	_destroy: function() {
1623
		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
1624
			this.destroyOnClear = true;
1625
			return;
1626
		}
1627
		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
1628
		this._removeHandleClassName();
1629
		this._mouseDestroy();
1630
	},
1631
1632
	_mouseCapture: function(event) {
1633
		var o = this.options;
1634
1635
		this._blurActiveElement( event );
1636
1637
		// among others, prevent a drag on a resizable-handle
1638
		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
1639
			return false;
1640
		}
1641
1642
		//Quit if we're not on a valid handle
1643
		this.handle = this._getHandle(event);
1644
		if (!this.handle) {
1645
			return false;
1646
		}
1647
1648
		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
1649
1650
		return true;
1651
1652
	},
1653
1654
	_blockFrames: function( selector ) {
1655
		this.iframeBlocks = this.document.find( selector ).map(function() {
1656
			var iframe = $( this );
1657
1658
			return $( "<div>" )
1659
				.css( "position", "absolute" )
1660
				.appendTo( iframe.parent() )
1661
				.outerWidth( iframe.outerWidth() )
1662
				.outerHeight( iframe.outerHeight() )
1663
				.offset( iframe.offset() )[ 0 ];
1664
		});
1665
	},
1666
1667
	_unblockFrames: function() {
1668
		if ( this.iframeBlocks ) {
1669
			this.iframeBlocks.remove();
1670
			delete this.iframeBlocks;
1671
		}
1672
	},
1673
1674
	_blurActiveElement: function( event ) {
1675
		var document = this.document[ 0 ];
1676
1677
		// Only need to blur if the event occurred on the draggable itself, see #10527
1678
		if ( !this.handleElement.is( event.target ) ) {
1679
			return;
1680
		}
1681
1682
		// support: IE9
1683
		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
1684
		try {
1685
1686
			// Support: IE9, IE10
1687
			// If the <body> is blurred, IE will switch windows, see #9520
1688
			if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
1689
1690
				// Blur any element that currently has focus, see #4261
1691
				$( document.activeElement ).blur();
1692
			}
1693
		} catch ( error ) {}
1694
	},
1695
1696
	_mouseStart: function(event) {
1697
1698
		var o = this.options;
1699
1700
		//Create and append the visible helper
1701
		this.helper = this._createHelper(event);
1702
1703
		this.helper.addClass("ui-draggable-dragging");
1704
1705
		//Cache the helper size
1706
		this._cacheHelperProportions();
1707
1708
		//If ddmanager is used for droppables, set the global draggable
1709
		if ($.ui.ddmanager) {
1710
			$.ui.ddmanager.current = this;
1711
		}
1712
1713
		/*
1714
		 * - Position generation -
1715
		 * This block generates everything position related - it's the core of draggables.
1716
		 */
1717
1718
		//Cache the margins of the original element
1719
		this._cacheMargins();
1720
1721
		//Store the helper's css position
1722
		this.cssPosition = this.helper.css( "position" );
1723
		this.scrollParent = this.helper.scrollParent( true );
1724
		this.offsetParent = this.helper.offsetParent();
1725
		this.hasFixedAncestor = this.helper.parents().filter(function() {
1726
				return $( this ).css( "position" ) === "fixed";
1727
			}).length > 0;
1728
1729
		//The element's absolute position on the page minus margins
1730
		this.positionAbs = this.element.offset();
1731
		this._refreshOffsets( event );
1732
1733
		//Generate the original position
1734
		this.originalPosition = this.position = this._generatePosition( event, false );
1735
		this.originalPageX = event.pageX;
1736
		this.originalPageY = event.pageY;
1737
1738
		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
1739
		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
1740
1741
		//Set a containment if given in the options
1742
		this._setContainment();
1743
1744
		//Trigger event + callbacks
1745
		if (this._trigger("start", event) === false) {
1746
			this._clear();
1747
			return false;
1748
		}
1749
1750
		//Recache the helper size
1751
		this._cacheHelperProportions();
1752
1753
		//Prepare the droppable offsets
1754
		if ($.ui.ddmanager && !o.dropBehaviour) {
1755
			$.ui.ddmanager.prepareOffsets(this, event);
1756
		}
1757
1758
		// Reset helper's right/bottom css if they're set and set explicit width/height instead
1759
		// as this prevents resizing of elements with right/bottom set (see #7772)
1760
		this._normalizeRightBottom();
1761
1762
		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
1763
1764
		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
1765
		if ( $.ui.ddmanager ) {
1766
			$.ui.ddmanager.dragStart(this, event);
1767
		}
1768
1769
		return true;
1770
	},
1771
1772
	_refreshOffsets: function( event ) {
1773
		this.offset = {
1774
			top: this.positionAbs.top - this.margins.top,
1775
			left: this.positionAbs.left - this.margins.left,
1776
			scroll: false,
1777
			parent: this._getParentOffset(),
1778
			relative: this._getRelativeOffset()
1779
		};
1780
1781
		this.offset.click = {
1782
			left: event.pageX - this.offset.left,
1783
			top: event.pageY - this.offset.top
1784
		};
1785
	},
1786
1787
	_mouseDrag: function(event, noPropagation) {
1788
		// reset any necessary cached properties (see #5009)
1789
		if ( this.hasFixedAncestor ) {
1790
			this.offset.parent = this._getParentOffset();
1791
		}
1792
1793
		//Compute the helpers position
1794
		this.position = this._generatePosition( event, true );
1795
		this.positionAbs = this._convertPositionTo("absolute");
1796
1797
		//Call plugins and callbacks and use the resulting position if something is returned
1798
		if (!noPropagation) {
1799
			var ui = this._uiHash();
1800
			if (this._trigger("drag", event, ui) === false) {
1801
				this._mouseUp({});
1802
				return false;
1803
			}
1804
			this.position = ui.position;
1805
		}
1806
1807
		this.helper[ 0 ].style.left = this.position.left + "px";
1808
		this.helper[ 0 ].style.top = this.position.top + "px";
1809
1810
		if ($.ui.ddmanager) {
1811
			$.ui.ddmanager.drag(this, event);
1812
		}
1813
1814
		return false;
1815
	},
1816
1817
	_mouseStop: function(event) {
1818
1819
		//If we are using droppables, inform the manager about the drop
1820
		var that = this,
1821
			dropped = false;
1822
		if ($.ui.ddmanager && !this.options.dropBehaviour) {
1823
			dropped = $.ui.ddmanager.drop(this, event);
1824
		}
1825
1826
		//if a drop comes from outside (a sortable)
1827
		if (this.dropped) {
1828
			dropped = this.dropped;
1829
			this.dropped = false;
1830
		}
1831
1832
		if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
1833
			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
1834
				if (that._trigger("stop", event) !== false) {
1835
					that._clear();
1836
				}
1837
			});
1838
		} else {
1839
			if (this._trigger("stop", event) !== false) {
1840
				this._clear();
1841
			}
1842
		}
1843
1844
		return false;
1845
	},
1846
1847
	_mouseUp: function( event ) {
1848
		this._unblockFrames();
1849
1850
		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
1851
		if ( $.ui.ddmanager ) {
1852
			$.ui.ddmanager.dragStop(this, event);
1853
		}
1854
1855
		// Only need to focus if the event occurred on the draggable itself, see #10527
1856
		if ( this.handleElement.is( event.target ) ) {
1857
			// The interaction is over; whether or not the click resulted in a drag, focus the element
1858
			this.element.focus();
1859
		}
1860
1861
		return $.ui.mouse.prototype._mouseUp.call(this, event);
1862
	},
1863
1864
	cancel: function() {
1865
1866
		if (this.helper.is(".ui-draggable-dragging")) {
1867
			this._mouseUp({});
1868
		} else {
1869
			this._clear();
1870
		}
1871
1872
		return this;
1873
1874
	},
1875
1876
	_getHandle: function(event) {
1877
		return this.options.handle ?
1878
			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
1879
			true;
1880
	},
1881
1882
	_setHandleClassName: function() {
1883
		this.handleElement = this.options.handle ?
1884
			this.element.find( this.options.handle ) : this.element;
1885
		this.handleElement.addClass( "ui-draggable-handle" );
1886
	},
1887
1888
	_removeHandleClassName: function() {
1889
		this.handleElement.removeClass( "ui-draggable-handle" );
1890
	},
1891
1892
	_createHelper: function(event) {
1893
1894
		var o = this.options,
1895
			helperIsFunction = $.isFunction( o.helper ),
1896
			helper = helperIsFunction ?
1897
				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
1898
				( o.helper === "clone" ?
1899
					this.element.clone().removeAttr( "id" ) :
1900
					this.element );
1901
1902
		if (!helper.parents("body").length) {
1903
			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
1904
		}
1905
1906
		// http://bugs.jqueryui.com/ticket/9446
1907
		// a helper function can return the original element
1908
		// which wouldn't have been set to relative in _create
1909
		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
1910
			this._setPositionRelative();
1911
		}
1912
1913
		if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
1914
			helper.css("position", "absolute");
1915
		}
1916
1917
		return helper;
1918
1919
	},
1920
1921
	_setPositionRelative: function() {
1922
		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
1923
			this.element[ 0 ].style.position = "relative";
1924
		}
1925
	},
1926
1927
	_adjustOffsetFromHelper: function(obj) {
1928
		if (typeof obj === "string") {
1929
			obj = obj.split(" ");
1930
		}
1931
		if ($.isArray(obj)) {
1932
			obj = { left: +obj[0], top: +obj[1] || 0 };
1933
		}
1934
		if ("left" in obj) {
1935
			this.offset.click.left = obj.left + this.margins.left;
1936
		}
1937
		if ("right" in obj) {
1938
			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1939
		}
1940
		if ("top" in obj) {
1941
			this.offset.click.top = obj.top + this.margins.top;
1942
		}
1943
		if ("bottom" in obj) {
1944
			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1945
		}
1946
	},
1947
1948
	_isRootNode: function( element ) {
1949
		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
1950
	},
1951
1952
	_getParentOffset: function() {
1953
1954
		//Get the offsetParent and cache its position
1955
		var po = this.offsetParent.offset(),
1956
			document = this.document[ 0 ];
1957
1958
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
1959
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1960
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1961
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1962
		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
1963
			po.left += this.scrollParent.scrollLeft();
1964
			po.top += this.scrollParent.scrollTop();
1965
		}
1966
1967
		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
1968
			po = { top: 0, left: 0 };
1969
		}
1970
1971
		return {
1972
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
1973
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
1974
		};
1975
1976
	},
1977
1978
	_getRelativeOffset: function() {
1979
		if ( this.cssPosition !== "relative" ) {
1980
			return { top: 0, left: 0 };
1981
		}
1982
1983
		var p = this.element.position(),
1984
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
1985
1986
		return {
1987
			top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
1988
			left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
1989
		};
1990
1991
	},
1992
1993
	_cacheMargins: function() {
1994
		this.margins = {
1995
			left: (parseInt(this.element.css("marginLeft"), 10) || 0),
1996
			top: (parseInt(this.element.css("marginTop"), 10) || 0),
1997
			right: (parseInt(this.element.css("marginRight"), 10) || 0),
1998
			bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
1999
		};
2000
	},
2001
2002
	_cacheHelperProportions: function() {
2003
		this.helperProportions = {
2004
			width: this.helper.outerWidth(),
2005
			height: this.helper.outerHeight()
2006
		};
2007
	},
2008
2009
	_setContainment: function() {
2010
2011
		var isUserScrollable, c, ce,
2012
			o = this.options,
2013
			document = this.document[ 0 ];
2014
2015
		this.relativeContainer = null;
2016
2017
		if ( !o.containment ) {
2018
			this.containment = null;
2019
			return;
2020
		}
2021
2022
		if ( o.containment === "window" ) {
2023
			this.containment = [
2024
				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
2025
				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
2026
				$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
2027
				$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2028
			];
2029
			return;
2030
		}
2031
2032
		if ( o.containment === "document") {
2033
			this.containment = [
2034
				0,
2035
				0,
2036
				$( document ).width() - this.helperProportions.width - this.margins.left,
2037
				( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2038
			];
2039
			return;
2040
		}
2041
2042
		if ( o.containment.constructor === Array ) {
2043
			this.containment = o.containment;
2044
			return;
2045
		}
2046
2047
		if ( o.containment === "parent" ) {
2048
			o.containment = this.helper[ 0 ].parentNode;
2049
		}
2050
2051
		c = $( o.containment );
2052
		ce = c[ 0 ];
2053
2054
		if ( !ce ) {
2055
			return;
2056
		}
2057
2058
		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
2059
2060
		this.containment = [
2061
			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
2062
			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
2063
			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
2064
				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
2065
				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
2066
				this.helperProportions.width -
2067
				this.margins.left -
2068
				this.margins.right,
2069
			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
2070
				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
2071
				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
2072
				this.helperProportions.height -
2073
				this.margins.top -
2074
				this.margins.bottom
2075
		];
2076
		this.relativeContainer = c;
2077
	},
2078
2079
	_convertPositionTo: function(d, pos) {
2080
2081
		if (!pos) {
2082
			pos = this.position;
2083
		}
2084
2085
		var mod = d === "absolute" ? 1 : -1,
2086
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
2087
2088
		return {
2089
			top: (
2090
				pos.top	+																// The absolute mouse position
2091
				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2092
				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
2093
				( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
2094
			),
2095
			left: (
2096
				pos.left +																// The absolute mouse position
2097
				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2098
				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
2099
				( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
2100
			)
2101
		};
2102
2103
	},
2104
2105
	_generatePosition: function( event, constrainPosition ) {
2106
2107
		var containment, co, top, left,
2108
			o = this.options,
2109
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
2110
			pageX = event.pageX,
2111
			pageY = event.pageY;
2112
2113
		// Cache the scroll
2114
		if ( !scrollIsRootNode || !this.offset.scroll ) {
2115
			this.offset.scroll = {
2116
				top: this.scrollParent.scrollTop(),
2117
				left: this.scrollParent.scrollLeft()
2118
			};
2119
		}
2120
2121
		/*
2122
		 * - Position constraining -
2123
		 * Constrain the position to a mix of grid, containment.
2124
		 */
2125
2126
		// If we are not dragging yet, we won't check for options
2127
		if ( constrainPosition ) {
2128
			if ( this.containment ) {
2129
				if ( this.relativeContainer ){
2130
					co = this.relativeContainer.offset();
2131
					containment = [
2132
						this.containment[ 0 ] + co.left,
2133
						this.containment[ 1 ] + co.top,
2134
						this.containment[ 2 ] + co.left,
2135
						this.containment[ 3 ] + co.top
2136
					];
2137
				} else {
2138
					containment = this.containment;
2139
				}
2140
2141
				if (event.pageX - this.offset.click.left < containment[0]) {
2142
					pageX = containment[0] + this.offset.click.left;
2143
				}
2144
				if (event.pageY - this.offset.click.top < containment[1]) {
2145
					pageY = containment[1] + this.offset.click.top;
2146
				}
2147
				if (event.pageX - this.offset.click.left > containment[2]) {
2148
					pageX = containment[2] + this.offset.click.left;
2149
				}
2150
				if (event.pageY - this.offset.click.top > containment[3]) {
2151
					pageY = containment[3] + this.offset.click.top;
2152
				}
2153
			}
2154
2155
			if (o.grid) {
2156
				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
2157
				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
2158
				pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
2159
2160
				left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
2161
				pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
2162
			}
2163
2164
			if ( o.axis === "y" ) {
2165
				pageX = this.originalPageX;
2166
			}
2167
2168
			if ( o.axis === "x" ) {
2169
				pageY = this.originalPageY;
2170
			}
2171
		}
2172
2173
		return {
2174
			top: (
2175
				pageY -																	// The absolute mouse position
2176
				this.offset.click.top	-												// Click offset (relative to the element)
2177
				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
2178
				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
2179
				( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
2180
			),
2181
			left: (
2182
				pageX -																	// The absolute mouse position
2183
				this.offset.click.left -												// Click offset (relative to the element)
2184
				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
2185
				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
2186
				( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
2187
			)
2188
		};
2189
2190
	},
2191
2192
	_clear: function() {
2193
		this.helper.removeClass("ui-draggable-dragging");
2194
		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
2195
			this.helper.remove();
2196
		}
2197
		this.helper = null;
2198
		this.cancelHelperRemoval = false;
2199
		if ( this.destroyOnClear ) {
2200
			this.destroy();
2201
		}
2202
	},
2203
2204
	_normalizeRightBottom: function() {
2205
		if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
2206
			this.helper.width( this.helper.width() );
2207
			this.helper.css( "right", "auto" );
2208
		}
2209
		if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
2210
			this.helper.height( this.helper.height() );
2211
			this.helper.css( "bottom", "auto" );
2212
		}
2213
	},
2214
2215
	// From now on bulk stuff - mainly helpers
2216
2217
	_trigger: function( type, event, ui ) {
2218
		ui = ui || this._uiHash();
2219
		$.ui.plugin.call( this, type, [ event, ui, this ], true );
2220
2221
		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
2222
		if ( /^(drag|start|stop)/.test( type ) ) {
2223
			this.positionAbs = this._convertPositionTo( "absolute" );
2224
			ui.offset = this.positionAbs;
2225
		}
2226
		return $.Widget.prototype._trigger.call( this, type, event, ui );
2227
	},
2228
2229
	plugins: {},
2230
2231
	_uiHash: function() {
2232
		return {
2233
			helper: this.helper,
2234
			position: this.position,
2235
			originalPosition: this.originalPosition,
2236
			offset: this.positionAbs
2237
		};
2238
	}
2239
2240
});
2241
2242
$.ui.plugin.add( "draggable", "connectToSortable", {
2243
	start: function( event, ui, draggable ) {
2244
		var uiSortable = $.extend( {}, ui, {
2245
			item: draggable.element
2246
		});
2247
2248
		draggable.sortables = [];
2249
		$( draggable.options.connectToSortable ).each(function() {
2250
			var sortable = $( this ).sortable( "instance" );
2251
2252
			if ( sortable && !sortable.options.disabled ) {
2253
				draggable.sortables.push( sortable );
2254
2255
				// refreshPositions is called at drag start to refresh the containerCache
2256
				// which is used in drag. This ensures it's initialized and synchronized
2257
				// with any changes that might have happened on the page since initialization.
2258
				sortable.refreshPositions();
2259
				sortable._trigger("activate", event, uiSortable);
2260
			}
2261
		});
2262
	},
2263
	stop: function( event, ui, draggable ) {
2264
		var uiSortable = $.extend( {}, ui, {
2265
			item: draggable.element
2266
		});
2267
2268
		draggable.cancelHelperRemoval = false;
2269
2270
		$.each( draggable.sortables, function() {
2271
			var sortable = this;
2272
2273
			if ( sortable.isOver ) {
2274
				sortable.isOver = 0;
2275
2276
				// Allow this sortable to handle removing the helper
2277
				draggable.cancelHelperRemoval = true;
2278
				sortable.cancelHelperRemoval = false;
2279
2280
				// Use _storedCSS To restore properties in the sortable,
2281
				// as this also handles revert (#9675) since the draggable
2282
				// may have modified them in unexpected ways (#8809)
2283
				sortable._storedCSS = {
2284
					position: sortable.placeholder.css( "position" ),
2285
					top: sortable.placeholder.css( "top" ),
2286
					left: sortable.placeholder.css( "left" )
2287
				};
2288
2289
				sortable._mouseStop(event);
2290
2291
				// Once drag has ended, the sortable should return to using
2292
				// its original helper, not the shared helper from draggable
2293
				sortable.options.helper = sortable.options._helper;
2294
			} else {
2295
				// Prevent this Sortable from removing the helper.
2296
				// However, don't set the draggable to remove the helper
2297
				// either as another connected Sortable may yet handle the removal.
2298
				sortable.cancelHelperRemoval = true;
2299
2300
				sortable._trigger( "deactivate", event, uiSortable );
2301
			}
2302
		});
2303
	},
2304
	drag: function( event, ui, draggable ) {
2305
		$.each( draggable.sortables, function() {
2306
			var innermostIntersecting = false,
2307
				sortable = this;
2308
2309
			// Copy over variables that sortable's _intersectsWith uses
2310
			sortable.positionAbs = draggable.positionAbs;
2311
			sortable.helperProportions = draggable.helperProportions;
2312
			sortable.offset.click = draggable.offset.click;
2313
2314
			if ( sortable._intersectsWith( sortable.containerCache ) ) {
2315
				innermostIntersecting = true;
2316
2317
				$.each( draggable.sortables, function() {
2318
					// Copy over variables that sortable's _intersectsWith uses
2319
					this.positionAbs = draggable.positionAbs;
2320
					this.helperProportions = draggable.helperProportions;
2321
					this.offset.click = draggable.offset.click;
2322
2323
					if ( this !== sortable &&
2324
							this._intersectsWith( this.containerCache ) &&
2325
							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
2326
						innermostIntersecting = false;
2327
					}
2328
2329
					return innermostIntersecting;
2330
				});
2331
			}
2332
2333
			if ( innermostIntersecting ) {
2334
				// If it intersects, we use a little isOver variable and set it once,
2335
				// so that the move-in stuff gets fired only once.
2336
				if ( !sortable.isOver ) {
2337
					sortable.isOver = 1;
2338
2339
					// Store draggable's parent in case we need to reappend to it later.
2340
					draggable._parent = ui.helper.parent();
2341
2342
					sortable.currentItem = ui.helper
2343
						.appendTo( sortable.element )
2344
						.data( "ui-sortable-item", true );
2345
2346
					// Store helper option to later restore it
2347
					sortable.options._helper = sortable.options.helper;
2348
2349
					sortable.options.helper = function() {
2350
						return ui.helper[ 0 ];
2351
					};
2352
2353
					// Fire the start events of the sortable with our passed browser event,
2354
					// and our own helper (so it doesn't create a new one)
2355
					event.target = sortable.currentItem[ 0 ];
2356
					sortable._mouseCapture( event, true );
2357
					sortable._mouseStart( event, true, true );
2358
2359
					// Because the browser event is way off the new appended portlet,
2360
					// modify necessary variables to reflect the changes
2361
					sortable.offset.click.top = draggable.offset.click.top;
2362
					sortable.offset.click.left = draggable.offset.click.left;
2363
					sortable.offset.parent.left -= draggable.offset.parent.left -
2364
						sortable.offset.parent.left;
2365
					sortable.offset.parent.top -= draggable.offset.parent.top -
2366
						sortable.offset.parent.top;
2367
2368
					draggable._trigger( "toSortable", event );
2369
2370
					// Inform draggable that the helper is in a valid drop zone,
2371
					// used solely in the revert option to handle "valid/invalid".
2372
					draggable.dropped = sortable.element;
2373
2374
					// Need to refreshPositions of all sortables in the case that
2375
					// adding to one sortable changes the location of the other sortables (#9675)
2376
					$.each( draggable.sortables, function() {
2377
						this.refreshPositions();
2378
					});
2379
2380
					// hack so receive/update callbacks work (mostly)
2381
					draggable.currentItem = draggable.element;
2382
					sortable.fromOutside = draggable;
2383
				}
2384
2385
				if ( sortable.currentItem ) {
2386
					sortable._mouseDrag( event );
2387
					// Copy the sortable's position because the draggable's can potentially reflect
2388
					// a relative position, while sortable is always absolute, which the dragged
2389
					// element has now become. (#8809)
2390
					ui.position = sortable.position;
2391
				}
2392
			} else {
2393
				// If it doesn't intersect with the sortable, and it intersected before,
2394
				// we fake the drag stop of the sortable, but make sure it doesn't remove
2395
				// the helper by using cancelHelperRemoval.
2396
				if ( sortable.isOver ) {
2397
2398
					sortable.isOver = 0;
2399
					sortable.cancelHelperRemoval = true;
2400
2401
					// Calling sortable's mouseStop would trigger a revert,
2402
					// so revert must be temporarily false until after mouseStop is called.
2403
					sortable.options._revert = sortable.options.revert;
2404
					sortable.options.revert = false;
2405
2406
					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
2407
					sortable._mouseStop( event, true );
2408
2409
					// restore sortable behaviors that were modfied
2410
					// when the draggable entered the sortable area (#9481)
2411
					sortable.options.revert = sortable.options._revert;
2412
					sortable.options.helper = sortable.options._helper;
2413
2414
					if ( sortable.placeholder ) {
2415
						sortable.placeholder.remove();
2416
					}
2417
2418
					// Restore and recalculate the draggable's offset considering the sortable
2419
					// may have modified them in unexpected ways. (#8809, #10669)
2420
					ui.helper.appendTo( draggable._parent );
2421
					draggable._refreshOffsets( event );
2422
					ui.position = draggable._generatePosition( event, true );
2423
2424
					draggable._trigger( "fromSortable", event );
2425
2426
					// Inform draggable that the helper is no longer in a valid drop zone
2427
					draggable.dropped = false;
2428
2429
					// Need to refreshPositions of all sortables just in case removing
2430
					// from one sortable changes the location of other sortables (#9675)
2431
					$.each( draggable.sortables, function() {
2432
						this.refreshPositions();
2433
					});
2434
				}
2435
			}
2436
		});
2437
	}
2438
});
2439
2440
$.ui.plugin.add("draggable", "cursor", {
2441
	start: function( event, ui, instance ) {
2442
		var t = $( "body" ),
2443
			o = instance.options;
2444
2445
		if (t.css("cursor")) {
2446
			o._cursor = t.css("cursor");
2447
		}
2448
		t.css("cursor", o.cursor);
2449
	},
2450
	stop: function( event, ui, instance ) {
2451
		var o = instance.options;
2452
		if (o._cursor) {
2453
			$("body").css("cursor", o._cursor);
2454
		}
2455
	}
2456
});
2457
2458
$.ui.plugin.add("draggable", "opacity", {
2459
	start: function( event, ui, instance ) {
2460
		var t = $( ui.helper ),
2461
			o = instance.options;
2462
		if (t.css("opacity")) {
2463
			o._opacity = t.css("opacity");
2464
		}
2465
		t.css("opacity", o.opacity);
2466
	},
2467
	stop: function( event, ui, instance ) {
2468
		var o = instance.options;
2469
		if (o._opacity) {
2470
			$(ui.helper).css("opacity", o._opacity);
2471
		}
2472
	}
2473
});
2474
2475
$.ui.plugin.add("draggable", "scroll", {
2476
	start: function( event, ui, i ) {
2477
		if ( !i.scrollParentNotHidden ) {
2478
			i.scrollParentNotHidden = i.helper.scrollParent( false );
2479
		}
2480
2481
		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
2482
			i.overflowOffset = i.scrollParentNotHidden.offset();
2483
		}
2484
	},
2485
	drag: function( event, ui, i  ) {
2486
2487
		var o = i.options,
2488
			scrolled = false,
2489
			scrollParent = i.scrollParentNotHidden[ 0 ],
2490
			document = i.document[ 0 ];
2491
2492
		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
2493
			if ( !o.axis || o.axis !== "x" ) {
2494
				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
2495
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
2496
				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
2497
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
2498
				}
2499
			}
2500
2501
			if ( !o.axis || o.axis !== "y" ) {
2502
				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
2503
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
2504
				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
2505
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
2506
				}
2507
			}
2508
2509
		} else {
2510
2511
			if (!o.axis || o.axis !== "x") {
2512
				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
2513
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
2514
				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
2515
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
2516
				}
2517
			}
2518
2519
			if (!o.axis || o.axis !== "y") {
2520
				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
2521
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
2522
				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
2523
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
2524
				}
2525
			}
2526
2527
		}
2528
2529
		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
2530
			$.ui.ddmanager.prepareOffsets(i, event);
2531
		}
2532
2533
	}
2534
});
2535
2536
$.ui.plugin.add("draggable", "snap", {
2537
	start: function( event, ui, i ) {
2538
2539
		var o = i.options;
2540
2541
		i.snapElements = [];
2542
2543
		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
2544
			var $t = $(this),
2545
				$o = $t.offset();
2546
			if (this !== i.element[0]) {
2547
				i.snapElements.push({
2548
					item: this,
2549
					width: $t.outerWidth(), height: $t.outerHeight(),
2550
					top: $o.top, left: $o.left
2551
				});
2552
			}
2553
		});
2554
2555
	},
2556
	drag: function( event, ui, inst ) {
2557
2558
		var ts, bs, ls, rs, l, r, t, b, i, first,
2559
			o = inst.options,
2560
			d = o.snapTolerance,
2561
			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
2562
			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
2563
2564
		for (i = inst.snapElements.length - 1; i >= 0; i--){
2565
2566
			l = inst.snapElements[i].left - inst.margins.left;
2567
			r = l + inst.snapElements[i].width;
2568
			t = inst.snapElements[i].top - inst.margins.top;
2569
			b = t + inst.snapElements[i].height;
2570
2571
			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
2572
				if (inst.snapElements[i].snapping) {
2573
					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2574
				}
2575
				inst.snapElements[i].snapping = false;
2576
				continue;
2577
			}
2578
2579
			if (o.snapMode !== "inner") {
2580
				ts = Math.abs(t - y2) <= d;
2581
				bs = Math.abs(b - y1) <= d;
2582
				ls = Math.abs(l - x2) <= d;
2583
				rs = Math.abs(r - x1) <= d;
2584
				if (ts) {
2585
					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
2586
				}
2587
				if (bs) {
2588
					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
2589
				}
2590
				if (ls) {
2591
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
2592
				}
2593
				if (rs) {
2594
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
2595
				}
2596
			}
2597
2598
			first = (ts || bs || ls || rs);
2599
2600
			if (o.snapMode !== "outer") {
2601
				ts = Math.abs(t - y1) <= d;
2602
				bs = Math.abs(b - y2) <= d;
2603
				ls = Math.abs(l - x1) <= d;
2604
				rs = Math.abs(r - x2) <= d;
2605
				if (ts) {
2606
					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
2607
				}
2608
				if (bs) {
2609
					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
2610
				}
2611
				if (ls) {
2612
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
2613
				}
2614
				if (rs) {
2615
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
2616
				}
2617
			}
2618
2619
			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
2620
				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2621
			}
2622
			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
2623
2624
		}
2625
2626
	}
2627
});
2628
2629
$.ui.plugin.add("draggable", "stack", {
2630
	start: function( event, ui, instance ) {
2631
		var min,
2632
			o = instance.options,
2633
			group = $.makeArray($(o.stack)).sort(function(a, b) {
2634
				return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
2635
			});
2636
2637
		if (!group.length) { return; }
2638
2639
		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
2640
		$(group).each(function(i) {
2641
			$(this).css("zIndex", min + i);
2642
		});
2643
		this.css("zIndex", (min + group.length));
2644
	}
2645
});
2646
2647
$.ui.plugin.add("draggable", "zIndex", {
2648
	start: function( event, ui, instance ) {
2649
		var t = $( ui.helper ),
2650
			o = instance.options;
2651
2652
		if (t.css("zIndex")) {
2653
			o._zIndex = t.css("zIndex");
2654
		}
2655
		t.css("zIndex", o.zIndex);
2656
	},
2657
	stop: function( event, ui, instance ) {
2658
		var o = instance.options;
2659
2660
		if (o._zIndex) {
2661
			$(ui.helper).css("zIndex", o._zIndex);
2662
		}
2663
	}
2664
});
2665
2666
var draggable = $.ui.draggable;
2667
2668
2669
/*!
2670
 * jQuery UI Droppable 1.11.4
2671
 * http://jqueryui.com
2672
 *
2673
 * Copyright jQuery Foundation and other contributors
2674
 * Released under the MIT license.
2675
 * http://jquery.org/license
2676
 *
2677
 * http://api.jqueryui.com/droppable/
2678
 */
2679
2680
2681
$.widget( "ui.droppable", {
2682
	version: "1.11.4",
2683
	widgetEventPrefix: "drop",
2684
	options: {
2685
		accept: "*",
2686
		activeClass: false,
2687
		addClasses: true,
2688
		greedy: false,
2689
		hoverClass: false,
2690
		scope: "default",
2691
		tolerance: "intersect",
2692
2693
		// callbacks
2694
		activate: null,
2695
		deactivate: null,
2696
		drop: null,
2697
		out: null,
2698
		over: null
2699
	},
2700
	_create: function() {
2701
2702
		var proportions,
2703
			o = this.options,
2704
			accept = o.accept;
2705
2706
		this.isover = false;
2707
		this.isout = true;
2708
2709
		this.accept = $.isFunction( accept ) ? accept : function( d ) {
2710
			return d.is( accept );
2711
		};
2712
2713
		this.proportions = function( /* valueToWrite */ ) {
2714
			if ( arguments.length ) {
2715
				// Store the droppable's proportions
2716
				proportions = arguments[ 0 ];
2717
			} else {
2718
				// Retrieve or derive the droppable's proportions
2719
				return proportions ?
2720
					proportions :
2721
					proportions = {
2722
						width: this.element[ 0 ].offsetWidth,
2723
						height: this.element[ 0 ].offsetHeight
2724
					};
2725
			}
2726
		};
2727
2728
		this._addToManager( o.scope );
2729
2730
		o.addClasses && this.element.addClass( "ui-droppable" );
2731
2732
	},
2733
2734
	_addToManager: function( scope ) {
2735
		// Add the reference and positions to the manager
2736
		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
2737
		$.ui.ddmanager.droppables[ scope ].push( this );
2738
	},
2739
2740
	_splice: function( drop ) {
2741
		var i = 0;
2742
		for ( ; i < drop.length; i++ ) {
2743
			if ( drop[ i ] === this ) {
2744
				drop.splice( i, 1 );
2745
			}
2746
		}
2747
	},
2748
2749
	_destroy: function() {
2750
		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2751
2752
		this._splice( drop );
2753
2754
		this.element.removeClass( "ui-droppable ui-droppable-disabled" );
2755
	},
2756
2757
	_setOption: function( key, value ) {
2758
2759
		if ( key === "accept" ) {
2760
			this.accept = $.isFunction( value ) ? value : function( d ) {
2761
				return d.is( value );
2762
			};
2763
		} else if ( key === "scope" ) {
2764
			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2765
2766
			this._splice( drop );
2767
			this._addToManager( value );
2768
		}
2769
2770
		this._super( key, value );
2771
	},
2772
2773
	_activate: function( event ) {
2774
		var draggable = $.ui.ddmanager.current;
2775
		if ( this.options.activeClass ) {
2776
			this.element.addClass( this.options.activeClass );
2777
		}
2778
		if ( draggable ){
2779
			this._trigger( "activate", event, this.ui( draggable ) );
2780
		}
2781
	},
2782
2783
	_deactivate: function( event ) {
2784
		var draggable = $.ui.ddmanager.current;
2785
		if ( this.options.activeClass ) {
2786
			this.element.removeClass( this.options.activeClass );
2787
		}
2788
		if ( draggable ){
2789
			this._trigger( "deactivate", event, this.ui( draggable ) );
2790
		}
2791
	},
2792
2793
	_over: function( event ) {
2794
2795
		var draggable = $.ui.ddmanager.current;
2796
2797
		// Bail if draggable and droppable are same element
2798
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2799
			return;
2800
		}
2801
2802
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2803
			if ( this.options.hoverClass ) {
2804
				this.element.addClass( this.options.hoverClass );
2805
			}
2806
			this._trigger( "over", event, this.ui( draggable ) );
2807
		}
2808
2809
	},
2810
2811
	_out: function( event ) {
2812
2813
		var draggable = $.ui.ddmanager.current;
2814
2815
		// Bail if draggable and droppable are same element
2816
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2817
			return;
2818
		}
2819
2820
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2821
			if ( this.options.hoverClass ) {
2822
				this.element.removeClass( this.options.hoverClass );
2823
			}
2824
			this._trigger( "out", event, this.ui( draggable ) );
2825
		}
2826
2827
	},
2828
2829
	_drop: function( event, custom ) {
2830
2831
		var draggable = custom || $.ui.ddmanager.current,
2832
			childrenIntersection = false;
2833
2834
		// Bail if draggable and droppable are same element
2835
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2836
			return false;
2837
		}
2838
2839
		this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
2840
			var inst = $( this ).droppable( "instance" );
2841
			if (
2842
				inst.options.greedy &&
2843
				!inst.options.disabled &&
2844
				inst.options.scope === draggable.options.scope &&
2845
				inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
2846
				$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
2847
			) { childrenIntersection = true; return false; }
2848
		});
2849
		if ( childrenIntersection ) {
2850
			return false;
2851
		}
2852
2853
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2854
			if ( this.options.activeClass ) {
2855
				this.element.removeClass( this.options.activeClass );
2856
			}
2857
			if ( this.options.hoverClass ) {
2858
				this.element.removeClass( this.options.hoverClass );
2859
			}
2860
			this._trigger( "drop", event, this.ui( draggable ) );
2861
			return this.element;
2862
		}
2863
2864
		return false;
2865
2866
	},
2867
2868
	ui: function( c ) {
2869
		return {
2870
			draggable: ( c.currentItem || c.element ),
2871
			helper: c.helper,
2872
			position: c.position,
2873
			offset: c.positionAbs
2874
		};
2875
	}
2876
2877
});
2878
2879
$.ui.intersect = (function() {
2880
	function isOverAxis( x, reference, size ) {
2881
		return ( x >= reference ) && ( x < ( reference + size ) );
2882
	}
2883
2884
	return function( draggable, droppable, toleranceMode, event ) {
2885
2886
		if ( !droppable.offset ) {
2887
			return false;
2888
		}
2889
2890
		var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
2891
			y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
2892
			x2 = x1 + draggable.helperProportions.width,
2893
			y2 = y1 + draggable.helperProportions.height,
2894
			l = droppable.offset.left,
2895
			t = droppable.offset.top,
2896
			r = l + droppable.proportions().width,
2897
			b = t + droppable.proportions().height;
2898
2899
		switch ( toleranceMode ) {
2900
		case "fit":
2901
			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
2902
		case "intersect":
2903
			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
2904
				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
2905
				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
2906
				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
2907
		case "pointer":
2908
			return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
2909
		case "touch":
2910
			return (
2911
				( y1 >= t && y1 <= b ) || // Top edge touching
2912
				( y2 >= t && y2 <= b ) || // Bottom edge touching
2913
				( y1 < t && y2 > b ) // Surrounded vertically
2914
			) && (
2915
				( x1 >= l && x1 <= r ) || // Left edge touching
2916
				( x2 >= l && x2 <= r ) || // Right edge touching
2917
				( x1 < l && x2 > r ) // Surrounded horizontally
2918
			);
2919
		default:
2920
			return false;
2921
		}
2922
	};
2923
})();
2924
2925
/*
2926
	This manager tracks offsets of draggables and droppables
2927
*/
2928
$.ui.ddmanager = {
2929
	current: null,
2930
	droppables: { "default": [] },
2931
	prepareOffsets: function( t, event ) {
2932
2933
		var i, j,
2934
			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
2935
			type = event ? event.type : null, // workaround for #2317
2936
			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
2937
2938
		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
2939
2940
			// No disabled and non-accepted
2941
			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
2942
				continue;
2943
			}
2944
2945
			// Filter out elements in the current dragged item
2946
			for ( j = 0; j < list.length; j++ ) {
2947
				if ( list[ j ] === m[ i ].element[ 0 ] ) {
2948
					m[ i ].proportions().height = 0;
2949
					continue droppablesLoop;
2950
				}
2951
			}
2952
2953
			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
2954
			if ( !m[ i ].visible ) {
2955
				continue;
2956
			}
2957
2958
			// Activate the droppable if used directly from draggables
2959
			if ( type === "mousedown" ) {
2960
				m[ i ]._activate.call( m[ i ], event );
2961
			}
2962
2963
			m[ i ].offset = m[ i ].element.offset();
2964
			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
2965
2966
		}
2967
2968
	},
2969
	drop: function( draggable, event ) {
2970
2971
		var dropped = false;
2972
		// Create a copy of the droppables in case the list changes during the drop (#9116)
2973
		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
2974
2975
			if ( !this.options ) {
2976
				return;
2977
			}
2978
			if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
2979
				dropped = this._drop.call( this, event ) || dropped;
2980
			}
2981
2982
			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2983
				this.isout = true;
2984
				this.isover = false;
2985
				this._deactivate.call( this, event );
2986
			}
2987
2988
		});
2989
		return dropped;
2990
2991
	},
2992
	dragStart: function( draggable, event ) {
2993
		// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
2994
		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
2995
			if ( !draggable.options.refreshPositions ) {
2996
				$.ui.ddmanager.prepareOffsets( draggable, event );
2997
			}
2998
		});
2999
	},
3000
	drag: function( draggable, event ) {
3001
3002
		// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
3003
		if ( draggable.options.refreshPositions ) {
3004
			$.ui.ddmanager.prepareOffsets( draggable, event );
3005
		}
3006
3007
		// Run through all droppables and check their positions based on specific tolerance options
3008
		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
3009
3010
			if ( this.options.disabled || this.greedyChild || !this.visible ) {
3011
				return;
3012
			}
3013
3014
			var parentInstance, scope, parent,
3015
				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
3016
				c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
3017
			if ( !c ) {
3018
				return;
3019
			}
3020
3021
			if ( this.options.greedy ) {
3022
				// find droppable parents with same scope
3023
				scope = this.options.scope;
3024
				parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
3025
					return $( this ).droppable( "instance" ).options.scope === scope;
3026
				});
3027
3028
				if ( parent.length ) {
3029
					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
3030
					parentInstance.greedyChild = ( c === "isover" );
3031
				}
3032
			}
3033
3034
			// we just moved into a greedy child
3035
			if ( parentInstance && c === "isover" ) {
3036
				parentInstance.isover = false;
3037
				parentInstance.isout = true;
3038
				parentInstance._out.call( parentInstance, event );
3039
			}
3040
3041
			this[ c ] = true;
3042
			this[c === "isout" ? "isover" : "isout"] = false;
3043
			this[c === "isover" ? "_over" : "_out"].call( this, event );
3044
3045
			// we just moved out of a greedy child
3046
			if ( parentInstance && c === "isout" ) {
3047
				parentInstance.isout = false;
3048
				parentInstance.isover = true;
3049
				parentInstance._over.call( parentInstance, event );
3050
			}
3051
		});
3052
3053
	},
3054
	dragStop: function( draggable, event ) {
3055
		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
3056
		// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
3057
		if ( !draggable.options.refreshPositions ) {
3058
			$.ui.ddmanager.prepareOffsets( draggable, event );
3059
		}
3060
	}
3061
};
3062
3063
var droppable = $.ui.droppable;
3064
3065
3066
/*!
3067
 * jQuery UI Sortable 1.11.4
3068
 * http://jqueryui.com
3069
 *
3070
 * Copyright jQuery Foundation and other contributors
3071
 * Released under the MIT license.
3072
 * http://jquery.org/license
3073
 *
3074
 * http://api.jqueryui.com/sortable/
3075
 */
3076
3077
3078
var sortable = $.widget("ui.sortable", $.ui.mouse, {
3079
	version: "1.11.4",
3080
	widgetEventPrefix: "sort",
3081
	ready: false,
3082
	options: {
3083
		appendTo: "parent",
3084
		axis: false,
3085
		connectWith: false,
3086
		containment: false,
3087
		cursor: "auto",
3088
		cursorAt: false,
3089
		dropOnEmpty: true,
3090
		forcePlaceholderSize: false,
3091
		forceHelperSize: false,
3092
		grid: false,
3093
		handle: false,
3094
		helper: "original",
3095
		items: "> *",
3096
		opacity: false,
3097
		placeholder: false,
3098
		revert: false,
3099
		scroll: true,
3100
		scrollSensitivity: 20,
3101
		scrollSpeed: 20,
3102
		scope: "default",
3103
		tolerance: "intersect",
3104
		zIndex: 1000,
3105
3106
		// callbacks
3107
		activate: null,
3108
		beforeStop: null,
3109
		change: null,
3110
		deactivate: null,
3111
		out: null,
3112
		over: null,
3113
		receive: null,
3114
		remove: null,
3115
		sort: null,
3116
		start: null,
3117
		stop: null,
3118
		update: null
3119
	},
3120
3121
	_isOverAxis: function( x, reference, size ) {
3122
		return ( x >= reference ) && ( x < ( reference + size ) );
3123
	},
3124
3125
	_isFloating: function( item ) {
3126
		return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
3127
	},
3128
3129
	_create: function() {
3130
		this.containerCache = {};
3131
		this.element.addClass("ui-sortable");
3132
3133
		//Get the items
3134
		this.refresh();
3135
3136
		//Let's determine the parent's offset
3137
		this.offset = this.element.offset();
3138
3139
		//Initialize mouse events for interaction
3140
		this._mouseInit();
3141
3142
		this._setHandleClassName();
3143
3144
		//We're ready to go
3145
		this.ready = true;
3146
3147
	},
3148
3149
	_setOption: function( key, value ) {
3150
		this._super( key, value );
3151
3152
		if ( key === "handle" ) {
3153
			this._setHandleClassName();
3154
		}
3155
	},
3156
3157
	_setHandleClassName: function() {
3158
		this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
3159
		$.each( this.items, function() {
3160
			( this.instance.options.handle ?
3161
				this.item.find( this.instance.options.handle ) : this.item )
3162
				.addClass( "ui-sortable-handle" );
3163
		});
3164
	},
3165
3166
	_destroy: function() {
3167
		this.element
3168
			.removeClass( "ui-sortable ui-sortable-disabled" )
3169
			.find( ".ui-sortable-handle" )
3170
				.removeClass( "ui-sortable-handle" );
3171
		this._mouseDestroy();
3172
3173
		for ( var i = this.items.length - 1; i >= 0; i-- ) {
3174
			this.items[i].item.removeData(this.widgetName + "-item");
3175
		}
3176
3177
		return this;
3178
	},
3179
3180
	_mouseCapture: function(event, overrideHandle) {
3181
		var currentItem = null,
3182
			validHandle = false,
3183
			that = this;
3184
3185
		if (this.reverting) {
3186
			return false;
3187
		}
3188
3189
		if(this.options.disabled || this.options.type === "static") {
3190
			return false;
3191
		}
3192
3193
		//We have to refresh the items data once first
3194
		this._refreshItems(event);
3195
3196
		//Find out if the clicked node (or one of its parents) is a actual item in this.items
3197
		$(event.target).parents().each(function() {
3198
			if($.data(this, that.widgetName + "-item") === that) {
3199
				currentItem = $(this);
3200
				return false;
3201
			}
3202
		});
3203
		if($.data(event.target, that.widgetName + "-item") === that) {
3204
			currentItem = $(event.target);
3205
		}
3206
3207
		if(!currentItem) {
3208
			return false;
3209
		}
3210
		if(this.options.handle && !overrideHandle) {
3211
			$(this.options.handle, currentItem).find("*").addBack().each(function() {
3212
				if(this === event.target) {
3213
					validHandle = true;
3214
				}
3215
			});
3216
			if(!validHandle) {
3217
				return false;
3218
			}
3219
		}
3220
3221
		this.currentItem = currentItem;
3222
		this._removeCurrentsFromItems();
3223
		return true;
3224
3225
	},
3226
3227
	_mouseStart: function(event, overrideHandle, noActivation) {
3228
3229
		var i, body,
3230
			o = this.options;
3231
3232
		this.currentContainer = this;
3233
3234
		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
3235
		this.refreshPositions();
3236
3237
		//Create and append the visible helper
3238
		this.helper = this._createHelper(event);
3239
3240
		//Cache the helper size
3241
		this._cacheHelperProportions();
3242
3243
		/*
3244
		 * - Position generation -
3245
		 * This block generates everything position related - it's the core of draggables.
3246
		 */
3247
3248
		//Cache the margins of the original element
3249
		this._cacheMargins();
3250
3251
		//Get the next scrolling parent
3252
		this.scrollParent = this.helper.scrollParent();
3253
3254
		//The element's absolute position on the page minus margins
3255
		this.offset = this.currentItem.offset();
3256
		this.offset = {
3257
			top: this.offset.top - this.margins.top,
3258
			left: this.offset.left - this.margins.left
3259
		};
3260
3261
		$.extend(this.offset, {
3262
			click: { //Where the click happened, relative to the element
3263
				left: event.pageX - this.offset.left,
3264
				top: event.pageY - this.offset.top
3265
			},
3266
			parent: this._getParentOffset(),
3267
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
3268
		});
3269
3270
		// Only after we got the offset, we can change the helper's position to absolute
3271
		// TODO: Still need to figure out a way to make relative sorting possible
3272
		this.helper.css("position", "absolute");
3273
		this.cssPosition = this.helper.css("position");
3274
3275
		//Generate the original position
3276
		this.originalPosition = this._generatePosition(event);
3277
		this.originalPageX = event.pageX;
3278
		this.originalPageY = event.pageY;
3279
3280
		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
3281
		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
3282
3283
		//Cache the former DOM position
3284
		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
3285
3286
		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
3287
		if(this.helper[0] !== this.currentItem[0]) {
3288
			this.currentItem.hide();
3289
		}
3290
3291
		//Create the placeholder
3292
		this._createPlaceholder();
3293
3294
		//Set a containment if given in the options
3295
		if(o.containment) {
3296
			this._setContainment();
3297
		}
3298
3299
		if( o.cursor && o.cursor !== "auto" ) { // cursor option
3300
			body = this.document.find( "body" );
3301
3302
			// support: IE
3303
			this.storedCursor = body.css( "cursor" );
3304
			body.css( "cursor", o.cursor );
3305
3306
			this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
3307
		}
3308
3309
		if(o.opacity) { // opacity option
3310
			if (this.helper.css("opacity")) {
3311
				this._storedOpacity = this.helper.css("opacity");
3312
			}
3313
			this.helper.css("opacity", o.opacity);
3314
		}
3315
3316
		if(o.zIndex) { // zIndex option
3317
			if (this.helper.css("zIndex")) {
3318
				this._storedZIndex = this.helper.css("zIndex");
3319
			}
3320
			this.helper.css("zIndex", o.zIndex);
3321
		}
3322
3323
		//Prepare scrolling
3324
		if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
3325
			this.overflowOffset = this.scrollParent.offset();
3326
		}
3327
3328
		//Call callbacks
3329
		this._trigger("start", event, this._uiHash());
3330
3331
		//Recache the helper size
3332
		if(!this._preserveHelperProportions) {
3333
			this._cacheHelperProportions();
3334
		}
3335
3336
3337
		//Post "activate" events to possible containers
3338
		if( !noActivation ) {
3339
			for ( i = this.containers.length - 1; i >= 0; i-- ) {
3340
				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
3341
			}
3342
		}
3343
3344
		//Prepare possible droppables
3345
		if($.ui.ddmanager) {
3346
			$.ui.ddmanager.current = this;
3347
		}
3348
3349
		if ($.ui.ddmanager && !o.dropBehaviour) {
3350
			$.ui.ddmanager.prepareOffsets(this, event);
3351
		}
3352
3353
		this.dragging = true;
3354
3355
		this.helper.addClass("ui-sortable-helper");
3356
		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
3357
		return true;
3358
3359
	},
3360
3361
	_mouseDrag: function(event) {
3362
		var i, item, itemElement, intersection,
3363
			o = this.options,
3364
			scrolled = false;
3365
3366
		//Compute the helpers position
3367
		this.position = this._generatePosition(event);
3368
		this.positionAbs = this._convertPositionTo("absolute");
3369
3370
		if (!this.lastPositionAbs) {
3371
			this.lastPositionAbs = this.positionAbs;
3372
		}
3373
3374
		//Do scrolling
3375
		if(this.options.scroll) {
3376
			if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
3377
3378
				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
3379
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
3380
				} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
3381
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
3382
				}
3383
3384
				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
3385
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
3386
				} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
3387
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
3388
				}
3389
3390
			} else {
3391
3392
				if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
3393
					scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
3394
				} else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
3395
					scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
3396
				}
3397
3398
				if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
3399
					scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
3400
				} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
3401
					scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
3402
				}
3403
3404
			}
3405
3406
			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
3407
				$.ui.ddmanager.prepareOffsets(this, event);
3408
			}
3409
		}
3410
3411
		//Regenerate the absolute position used for position checks
3412
		this.positionAbs = this._convertPositionTo("absolute");
3413
3414
		//Set the helper position
3415
		if(!this.options.axis || this.options.axis !== "y") {
3416
			this.helper[0].style.left = this.position.left+"px";
3417
		}
3418
		if(!this.options.axis || this.options.axis !== "x") {
3419
			this.helper[0].style.top = this.position.top+"px";
3420
		}
3421
3422
		//Rearrange
3423
		for (i = this.items.length - 1; i >= 0; i--) {
3424
3425
			//Cache variables and intersection, continue if no intersection
3426
			item = this.items[i];
3427
			itemElement = item.item[0];
3428
			intersection = this._intersectsWithPointer(item);
3429
			if (!intersection) {
3430
				continue;
3431
			}
3432
3433
			// Only put the placeholder inside the current Container, skip all
3434
			// items from other containers. This works because when moving
3435
			// an item from one container to another the
3436
			// currentContainer is switched before the placeholder is moved.
3437
			//
3438
			// Without this, moving items in "sub-sortables" can cause
3439
			// the placeholder to jitter between the outer and inner container.
3440
			if (item.instance !== this.currentContainer) {
3441
				continue;
3442
			}
3443
3444
			// cannot intersect with itself
3445
			// no useless actions that have been done before
3446
			// no action if the item moved is the parent of the item checked
3447
			if (itemElement !== this.currentItem[0] &&
3448
				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
3449
				!$.contains(this.placeholder[0], itemElement) &&
3450
				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
3451
			) {
3452
3453
				this.direction = intersection === 1 ? "down" : "up";
3454
3455
				if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
3456
					this._rearrange(event, item);
3457
				} else {
3458
					break;
3459
				}
3460
3461
				this._trigger("change", event, this._uiHash());
3462
				break;
3463
			}
3464
		}
3465
3466
		//Post events to containers
3467
		this._contactContainers(event);
3468
3469
		//Interconnect with droppables
3470
		if($.ui.ddmanager) {
3471
			$.ui.ddmanager.drag(this, event);
3472
		}
3473
3474
		//Call callbacks
3475
		this._trigger("sort", event, this._uiHash());
3476
3477
		this.lastPositionAbs = this.positionAbs;
3478
		return false;
3479
3480
	},
3481
3482
	_mouseStop: function(event, noPropagation) {
3483
3484
		if(!event) {
3485
			return;
3486
		}
3487
3488
		//If we are using droppables, inform the manager about the drop
3489
		if ($.ui.ddmanager && !this.options.dropBehaviour) {
3490
			$.ui.ddmanager.drop(this, event);
3491
		}
3492
3493
		if(this.options.revert) {
3494
			var that = this,
3495
				cur = this.placeholder.offset(),
3496
				axis = this.options.axis,
3497
				animation = {};
3498
3499
			if ( !axis || axis === "x" ) {
3500
				animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
3501
			}
3502
			if ( !axis || axis === "y" ) {
3503
				animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
3504
			}
3505
			this.reverting = true;
3506
			$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
3507
				that._clear(event);
3508
			});
3509
		} else {
3510
			this._clear(event, noPropagation);
3511
		}
3512
3513
		return false;
3514
3515
	},
3516
3517
	cancel: function() {
3518
3519
		if(this.dragging) {
3520
3521
			this._mouseUp({ target: null });
3522
3523
			if(this.options.helper === "original") {
3524
				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
3525
			} else {
3526
				this.currentItem.show();
3527
			}
3528
3529
			//Post deactivating events to containers
3530
			for (var i = this.containers.length - 1; i >= 0; i--){
3531
				this.containers[i]._trigger("deactivate", null, this._uiHash(this));
3532
				if(this.containers[i].containerCache.over) {
3533
					this.containers[i]._trigger("out", null, this._uiHash(this));
3534
					this.containers[i].containerCache.over = 0;
3535
				}
3536
			}
3537
3538
		}
3539
3540
		if (this.placeholder) {
3541
			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
3542
			if(this.placeholder[0].parentNode) {
3543
				this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
3544
			}
3545
			if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
3546
				this.helper.remove();
3547
			}
3548
3549
			$.extend(this, {
3550
				helper: null,
3551
				dragging: false,
3552
				reverting: false,
3553
				_noFinalSort: null
3554
			});
3555
3556
			if(this.domPosition.prev) {
3557
				$(this.domPosition.prev).after(this.currentItem);
3558
			} else {
3559
				$(this.domPosition.parent).prepend(this.currentItem);
3560
			}
3561
		}
3562
3563
		return this;
3564
3565
	},
3566
3567
	serialize: function(o) {
3568
3569
		var items = this._getItemsAsjQuery(o && o.connected),
3570
			str = [];
3571
		o = o || {};
3572
3573
		$(items).each(function() {
3574
			var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
3575
			if (res) {
3576
				str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
3577
			}
3578
		});
3579
3580
		if(!str.length && o.key) {
3581
			str.push(o.key + "=");
3582
		}
3583
3584
		return str.join("&");
3585
3586
	},
3587
3588
	toArray: function(o) {
3589
3590
		var items = this._getItemsAsjQuery(o && o.connected),
3591
			ret = [];
3592
3593
		o = o || {};
3594
3595
		items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
3596
		return ret;
3597
3598
	},
3599
3600
	/* Be careful with the following core functions */
3601
	_intersectsWith: function(item) {
3602
3603
		var x1 = this.positionAbs.left,
3604
			x2 = x1 + this.helperProportions.width,
3605
			y1 = this.positionAbs.top,
3606
			y2 = y1 + this.helperProportions.height,
3607
			l = item.left,
3608
			r = l + item.width,
3609
			t = item.top,
3610
			b = t + item.height,
3611
			dyClick = this.offset.click.top,
3612
			dxClick = this.offset.click.left,
3613
			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
3614
			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
3615
			isOverElement = isOverElementHeight && isOverElementWidth;
3616
3617
		if ( this.options.tolerance === "pointer" ||
3618
			this.options.forcePointerForContainers ||
3619
			(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
3620
		) {
3621
			return isOverElement;
3622
		} else {
3623
3624
			return (l < x1 + (this.helperProportions.width / 2) && // Right Half
3625
				x2 - (this.helperProportions.width / 2) < r && // Left Half
3626
				t < y1 + (this.helperProportions.height / 2) && // Bottom Half
3627
				y2 - (this.helperProportions.height / 2) < b ); // Top Half
3628
3629
		}
3630
	},
3631
3632
	_intersectsWithPointer: function(item) {
3633
3634
		var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
3635
			isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
3636
			isOverElement = isOverElementHeight && isOverElementWidth,
3637
			verticalDirection = this._getDragVerticalDirection(),
3638
			horizontalDirection = this._getDragHorizontalDirection();
3639
3640
		if (!isOverElement) {
3641
			return false;
3642
		}
3643
3644
		return this.floating ?
3645
			( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
3646
			: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
3647
3648
	},
3649
3650
	_intersectsWithSides: function(item) {
3651
3652
		var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
3653
			isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
3654
			verticalDirection = this._getDragVerticalDirection(),
3655
			horizontalDirection = this._getDragHorizontalDirection();
3656
3657
		if (this.floating && horizontalDirection) {
3658
			return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
3659
		} else {
3660
			return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
3661
		}
3662
3663
	},
3664
3665
	_getDragVerticalDirection: function() {
3666
		var delta = this.positionAbs.top - this.lastPositionAbs.top;
3667
		return delta !== 0 && (delta > 0 ? "down" : "up");
3668
	},
3669
3670
	_getDragHorizontalDirection: function() {
3671
		var delta = this.positionAbs.left - this.lastPositionAbs.left;
3672
		return delta !== 0 && (delta > 0 ? "right" : "left");
3673
	},
3674
3675
	refresh: function(event) {
3676
		this._refreshItems(event);
3677
		this._setHandleClassName();
3678
		this.refreshPositions();
3679
		return this;
3680
	},
3681
3682
	_connectWith: function() {
3683
		var options = this.options;
3684
		return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
3685
	},
3686
3687
	_getItemsAsjQuery: function(connected) {
3688
3689
		var i, j, cur, inst,
3690
			items = [],
3691
			queries = [],
3692
			connectWith = this._connectWith();
3693
3694
		if(connectWith && connected) {
3695
			for (i = connectWith.length - 1; i >= 0; i--){
3696
				cur = $(connectWith[i], this.document[0]);
3697
				for ( j = cur.length - 1; j >= 0; j--){
3698
					inst = $.data(cur[j], this.widgetFullName);
3699
					if(inst && inst !== this && !inst.options.disabled) {
3700
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
3701
					}
3702
				}
3703
			}
3704
		}
3705
3706
		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
3707
3708
		function addItems() {
3709
			items.push( this );
3710
		}
3711
		for (i = queries.length - 1; i >= 0; i--){
3712
			queries[i][0].each( addItems );
3713
		}
3714
3715
		return $(items);
3716
3717
	},
3718
3719
	_removeCurrentsFromItems: function() {
3720
3721
		var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
3722
3723
		this.items = $.grep(this.items, function (item) {
3724
			for (var j=0; j < list.length; j++) {
3725
				if(list[j] === item.item[0]) {
3726
					return false;
3727
				}
3728
			}
3729
			return true;
3730
		});
3731
3732
	},
3733
3734
	_refreshItems: function(event) {
3735
3736
		this.items = [];
3737
		this.containers = [this];
3738
3739
		var i, j, cur, inst, targetData, _queries, item, queriesLength,
3740
			items = this.items,
3741
			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
3742
			connectWith = this._connectWith();
3743
3744
		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
3745
			for (i = connectWith.length - 1; i >= 0; i--){
3746
				cur = $(connectWith[i], this.document[0]);
3747
				for (j = cur.length - 1; j >= 0; j--){
3748
					inst = $.data(cur[j], this.widgetFullName);
3749
					if(inst && inst !== this && !inst.options.disabled) {
3750
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
3751
						this.containers.push(inst);
3752
					}
3753
				}
3754
			}
3755
		}
3756
3757
		for (i = queries.length - 1; i >= 0; i--) {
3758
			targetData = queries[i][1];
3759
			_queries = queries[i][0];
3760
3761
			for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
3762
				item = $(_queries[j]);
3763
3764
				item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
3765
3766
				items.push({
3767
					item: item,
3768
					instance: targetData,
3769
					width: 0, height: 0,
3770
					left: 0, top: 0
3771
				});
3772
			}
3773
		}
3774
3775
	},
3776
3777
	refreshPositions: function(fast) {
3778
3779
		// Determine whether items are being displayed horizontally
3780
		this.floating = this.items.length ?
3781
			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
3782
			false;
3783
3784
		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
3785
		if(this.offsetParent && this.helper) {
3786
			this.offset.parent = this._getParentOffset();
3787
		}
3788
3789
		var i, item, t, p;
3790
3791
		for (i = this.items.length - 1; i >= 0; i--){
3792
			item = this.items[i];
3793
3794
			//We ignore calculating positions of all connected containers when we're not over them
3795
			if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
3796
				continue;
3797
			}
3798
3799
			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
3800
3801
			if (!fast) {
3802
				item.width = t.outerWidth();
3803
				item.height = t.outerHeight();
3804
			}
3805
3806
			p = t.offset();
3807
			item.left = p.left;
3808
			item.top = p.top;
3809
		}
3810
3811
		if(this.options.custom && this.options.custom.refreshContainers) {
3812
			this.options.custom.refreshContainers.call(this);
3813
		} else {
3814
			for (i = this.containers.length - 1; i >= 0; i--){
3815
				p = this.containers[i].element.offset();
3816
				this.containers[i].containerCache.left = p.left;
3817
				this.containers[i].containerCache.top = p.top;
3818
				this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
3819
				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
3820
			}
3821
		}
3822
3823
		return this;
3824
	},
3825
3826
	_createPlaceholder: function(that) {
3827
		that = that || this;
3828
		var className,
3829
			o = that.options;
3830
3831
		if(!o.placeholder || o.placeholder.constructor === String) {
3832
			className = o.placeholder;
3833
			o.placeholder = {
3834
				element: function() {
3835
3836
					var nodeName = that.currentItem[0].nodeName.toLowerCase(),
3837
						element = $( "<" + nodeName + ">", that.document[0] )
3838
							.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
3839
							.removeClass("ui-sortable-helper");
3840
3841
					if ( nodeName === "tbody" ) {
3842
						that._createTrPlaceholder(
3843
							that.currentItem.find( "tr" ).eq( 0 ),
3844
							$( "<tr>", that.document[ 0 ] ).appendTo( element )
3845
						);
3846
					} else if ( nodeName === "tr" ) {
3847
						that._createTrPlaceholder( that.currentItem, element );
3848
					} else if ( nodeName === "img" ) {
3849
						element.attr( "src", that.currentItem.attr( "src" ) );
3850
					}
3851
3852
					if ( !className ) {
3853
						element.css( "visibility", "hidden" );
3854
					}
3855
3856
					return element;
3857
				},
3858
				update: function(container, p) {
3859
3860
					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
3861
					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
3862
					if(className && !o.forcePlaceholderSize) {
3863
						return;
3864
					}
3865
3866
					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
3867
					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
3868
					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
3869
				}
3870
			};
3871
		}
3872
3873
		//Create the placeholder
3874
		that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
3875
3876
		//Append it after the actual current item
3877
		that.currentItem.after(that.placeholder);
3878
3879
		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
3880
		o.placeholder.update(that, that.placeholder);
3881
3882
	},
3883
3884
	_createTrPlaceholder: function( sourceTr, targetTr ) {
3885
		var that = this;
3886
3887
		sourceTr.children().each(function() {
3888
			$( "<td>&#160;</td>", that.document[ 0 ] )
3889
				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
3890
				.appendTo( targetTr );
3891
		});
3892
	},
3893
3894
	_contactContainers: function(event) {
3895
		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
3896
			innermostContainer = null,
3897
			innermostIndex = null;
3898
3899
		// get innermost container that intersects with item
3900
		for (i = this.containers.length - 1; i >= 0; i--) {
3901
3902
			// never consider a container that's located within the item itself
3903
			if($.contains(this.currentItem[0], this.containers[i].element[0])) {
3904
				continue;
3905
			}
3906
3907
			if(this._intersectsWith(this.containers[i].containerCache)) {
3908
3909
				// if we've already found a container and it's more "inner" than this, then continue
3910
				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
3911
					continue;
3912
				}
3913
3914
				innermostContainer = this.containers[i];
3915
				innermostIndex = i;
3916
3917
			} else {
3918
				// container doesn't intersect. trigger "out" event if necessary
3919
				if(this.containers[i].containerCache.over) {
3920
					this.containers[i]._trigger("out", event, this._uiHash(this));
3921
					this.containers[i].containerCache.over = 0;
3922
				}
3923
			}
3924
3925
		}
3926
3927
		// if no intersecting containers found, return
3928
		if(!innermostContainer) {
3929
			return;
3930
		}
3931
3932
		// move the item into the container if it's not there already
3933
		if(this.containers.length === 1) {
3934
			if (!this.containers[innermostIndex].containerCache.over) {
3935
				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3936
				this.containers[innermostIndex].containerCache.over = 1;
3937
			}
3938
		} else {
3939
3940
			//When entering a new container, we will find the item with the least distance and append our item near it
3941
			dist = 10000;
3942
			itemWithLeastDistance = null;
3943
			floating = innermostContainer.floating || this._isFloating(this.currentItem);
3944
			posProperty = floating ? "left" : "top";
3945
			sizeProperty = floating ? "width" : "height";
3946
			axis = floating ? "clientX" : "clientY";
3947
3948
			for (j = this.items.length - 1; j >= 0; j--) {
3949
				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
3950
					continue;
3951
				}
3952
				if(this.items[j].item[0] === this.currentItem[0]) {
3953
					continue;
3954
				}
3955
3956
				cur = this.items[j].item.offset()[posProperty];
3957
				nearBottom = false;
3958
				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
3959
					nearBottom = true;
3960
				}
3961
3962
				if ( Math.abs( event[ axis ] - cur ) < dist ) {
3963
					dist = Math.abs( event[ axis ] - cur );
3964
					itemWithLeastDistance = this.items[ j ];
3965
					this.direction = nearBottom ? "up": "down";
3966
				}
3967
			}
3968
3969
			//Check if dropOnEmpty is enabled
3970
			if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
3971
				return;
3972
			}
3973
3974
			if(this.currentContainer === this.containers[innermostIndex]) {
3975
				if ( !this.currentContainer.containerCache.over ) {
3976
					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
3977
					this.currentContainer.containerCache.over = 1;
3978
				}
3979
				return;
3980
			}
3981
3982
			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
3983
			this._trigger("change", event, this._uiHash());
3984
			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
3985
			this.currentContainer = this.containers[innermostIndex];
3986
3987
			//Update the placeholder
3988
			this.options.placeholder.update(this.currentContainer, this.placeholder);
3989
3990
			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3991
			this.containers[innermostIndex].containerCache.over = 1;
3992
		}
3993
3994
3995
	},
3996
3997
	_createHelper: function(event) {
3998
3999
		var o = this.options,
4000
			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
4001
4002
		//Add the helper to the DOM if that didn't happen already
4003
		if(!helper.parents("body").length) {
4004
			$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
4005
		}
4006
4007
		if(helper[0] === this.currentItem[0]) {
4008
			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
4009
		}
4010
4011
		if(!helper[0].style.width || o.forceHelperSize) {
4012
			helper.width(this.currentItem.width());
4013
		}
4014
		if(!helper[0].style.height || o.forceHelperSize) {
4015
			helper.height(this.currentItem.height());
4016
		}
4017
4018
		return helper;
4019
4020
	},
4021
4022
	_adjustOffsetFromHelper: function(obj) {
4023
		if (typeof obj === "string") {
4024
			obj = obj.split(" ");
4025
		}
4026
		if ($.isArray(obj)) {
4027
			obj = {left: +obj[0], top: +obj[1] || 0};
4028
		}
4029
		if ("left" in obj) {
4030
			this.offset.click.left = obj.left + this.margins.left;
4031
		}
4032
		if ("right" in obj) {
4033
			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
4034
		}
4035
		if ("top" in obj) {
4036
			this.offset.click.top = obj.top + this.margins.top;
4037
		}
4038
		if ("bottom" in obj) {
4039
			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
4040
		}
4041
	},
4042
4043
	_getParentOffset: function() {
4044
4045
4046
		//Get the offsetParent and cache its position
4047
		this.offsetParent = this.helper.offsetParent();
4048
		var po = this.offsetParent.offset();
4049
4050
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
4051
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
4052
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
4053
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
4054
		if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
4055
			po.left += this.scrollParent.scrollLeft();
4056
			po.top += this.scrollParent.scrollTop();
4057
		}
4058
4059
		// This needs to be actually done for all browsers, since pageX/pageY includes this information
4060
		// with an ugly IE fix
4061
		if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
4062
			po = { top: 0, left: 0 };
4063
		}
4064
4065
		return {
4066
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
4067
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
4068
		};
4069
4070
	},
4071
4072
	_getRelativeOffset: function() {
4073
4074
		if(this.cssPosition === "relative") {
4075
			var p = this.currentItem.position();
4076
			return {
4077
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
4078
				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
4079
			};
4080
		} else {
4081
			return { top: 0, left: 0 };
4082
		}
4083
4084
	},
4085
4086
	_cacheMargins: function() {
4087
		this.margins = {
4088
			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
4089
			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
4090
		};
4091
	},
4092
4093
	_cacheHelperProportions: function() {
4094
		this.helperProportions = {
4095
			width: this.helper.outerWidth(),
4096
			height: this.helper.outerHeight()
4097
		};
4098
	},
4099
4100
	_setContainment: function() {
4101
4102
		var ce, co, over,
4103
			o = this.options;
4104
		if(o.containment === "parent") {
4105
			o.containment = this.helper[0].parentNode;
4106
		}
4107
		if(o.containment === "document" || o.containment === "window") {
4108
			this.containment = [
4109
				0 - this.offset.relative.left - this.offset.parent.left,
4110
				0 - this.offset.relative.top - this.offset.parent.top,
4111
				o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
4112
				(o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
4113
			];
4114
		}
4115
4116
		if(!(/^(document|window|parent)$/).test(o.containment)) {
4117
			ce = $(o.containment)[0];
4118
			co = $(o.containment).offset();
4119
			over = ($(ce).css("overflow") !== "hidden");
4120
4121
			this.containment = [
4122
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
4123
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
4124
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
4125
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
4126
			];
4127
		}
4128
4129
	},
4130
4131
	_convertPositionTo: function(d, pos) {
4132
4133
		if(!pos) {
4134
			pos = this.position;
4135
		}
4136
		var mod = d === "absolute" ? 1 : -1,
4137
			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
4138
			scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4139
4140
		return {
4141
			top: (
4142
				pos.top	+																// The absolute mouse position
4143
				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
4144
				this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
4145
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
4146
			),
4147
			left: (
4148
				pos.left +																// The absolute mouse position
4149
				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
4150
				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
4151
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
4152
			)
4153
		};
4154
4155
	},
4156
4157
	_generatePosition: function(event) {
4158
4159
		var top, left,
4160
			o = this.options,
4161
			pageX = event.pageX,
4162
			pageY = event.pageY,
4163
			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4164
4165
		// This is another very weird special case that only happens for relative elements:
4166
		// 1. If the css position is relative
4167
		// 2. and the scroll parent is the document or similar to the offset parent
4168
		// we have to refresh the relative offset during the scroll so there are no jumps
4169
		if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
4170
			this.offset.relative = this._getRelativeOffset();
4171
		}
4172
4173
		/*
4174
		 * - Position constraining -
4175
		 * Constrain the position to a mix of grid, containment.
4176
		 */
4177
4178
		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
4179
4180
			if(this.containment) {
4181
				if(event.pageX - this.offset.click.left < this.containment[0]) {
4182
					pageX = this.containment[0] + this.offset.click.left;
4183
				}
4184
				if(event.pageY - this.offset.click.top < this.containment[1]) {
4185
					pageY = this.containment[1] + this.offset.click.top;
4186
				}
4187
				if(event.pageX - this.offset.click.left > this.containment[2]) {
4188
					pageX = this.containment[2] + this.offset.click.left;
4189
				}
4190
				if(event.pageY - this.offset.click.top > this.containment[3]) {
4191
					pageY = this.containment[3] + this.offset.click.top;
4192
				}
4193
			}
4194
4195
			if(o.grid) {
4196
				top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
4197
				pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
4198
4199
				left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
4200
				pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
4201
			}
4202
4203
		}
4204
4205
		return {
4206
			top: (
4207
				pageY -																// The absolute mouse position
4208
				this.offset.click.top -													// Click offset (relative to the element)
4209
				this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
4210
				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
4211
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
4212
			),
4213
			left: (
4214
				pageX -																// The absolute mouse position
4215
				this.offset.click.left -												// Click offset (relative to the element)
4216
				this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
4217
				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
4218
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
4219
			)
4220
		};
4221
4222
	},
4223
4224
	_rearrange: function(event, i, a, hardRefresh) {
4225
4226
		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
4227
4228
		//Various things done here to improve the performance:
4229
		// 1. we create a setTimeout, that calls refreshPositions
4230
		// 2. on the instance, we have a counter variable, that get's higher after every append
4231
		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
4232
		// 4. this lets only the last addition to the timeout stack through
4233
		this.counter = this.counter ? ++this.counter : 1;
4234
		var counter = this.counter;
4235
4236
		this._delay(function() {
4237
			if(counter === this.counter) {
4238
				this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
4239
			}
4240
		});
4241
4242
	},
4243
4244
	_clear: function(event, noPropagation) {
4245
4246
		this.reverting = false;
4247
		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
4248
		// everything else normalized again
4249
		var i,
4250
			delayedTriggers = [];
4251
4252
		// We first have to update the dom position of the actual currentItem
4253
		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
4254
		if(!this._noFinalSort && this.currentItem.parent().length) {
4255
			this.placeholder.before(this.currentItem);
4256
		}
4257
		this._noFinalSort = null;
4258
4259
		if(this.helper[0] === this.currentItem[0]) {
4260
			for(i in this._storedCSS) {
4261
				if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
4262
					this._storedCSS[i] = "";
4263
				}
4264
			}
4265
			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
4266
		} else {
4267
			this.currentItem.show();
4268
		}
4269
4270
		if(this.fromOutside && !noPropagation) {
4271
			delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
4272
		}
4273
		if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
4274
			delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
4275
		}
4276
4277
		// Check if the items Container has Changed and trigger appropriate
4278
		// events.
4279
		if (this !== this.currentContainer) {
4280
			if(!noPropagation) {
4281
				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
4282
				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
4283
				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
4284
			}
4285
		}
4286
4287
4288
		//Post events to containers
4289
		function delayEvent( type, instance, container ) {
4290
			return function( event ) {
4291
				container._trigger( type, event, instance._uiHash( instance ) );
4292
			};
4293
		}
4294
		for (i = this.containers.length - 1; i >= 0; i--){
4295
			if (!noPropagation) {
4296
				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
4297
			}
4298
			if(this.containers[i].containerCache.over) {
4299
				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
4300
				this.containers[i].containerCache.over = 0;
4301
			}
4302
		}
4303
4304
		//Do what was originally in plugins
4305
		if ( this.storedCursor ) {
4306
			this.document.find( "body" ).css( "cursor", this.storedCursor );
4307
			this.storedStylesheet.remove();
4308
		}
4309
		if(this._storedOpacity) {
4310
			this.helper.css("opacity", this._storedOpacity);
4311
		}
4312
		if(this._storedZIndex) {
4313
			this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
4314
		}
4315
4316
		this.dragging = false;
4317
4318
		if(!noPropagation) {
4319
			this._trigger("beforeStop", event, this._uiHash());
4320
		}
4321
4322
		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
4323
		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
4324
4325
		if ( !this.cancelHelperRemoval ) {
4326
			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
4327
				this.helper.remove();
4328
			}
4329
			this.helper = null;
4330
		}
4331
4332
		if(!noPropagation) {
4333
			for (i=0; i < delayedTriggers.length; i++) {
4334
				delayedTriggers[i].call(this, event);
4335
			} //Trigger all delayed events
4336
			this._trigger("stop", event, this._uiHash());
4337
		}
4338
4339
		this.fromOutside = false;
4340
		return !this.cancelHelperRemoval;
4341
4342
	},
4343
4344
	_trigger: function() {
4345
		if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
4346
			this.cancel();
4347
		}
4348
	},
4349
4350
	_uiHash: function(_inst) {
4351
		var inst = _inst || this;
4352
		return {
4353
			helper: inst.helper,
4354
			placeholder: inst.placeholder || $([]),
4355
			position: inst.position,
4356
			originalPosition: inst.originalPosition,
4357
			offset: inst.positionAbs,
4358
			item: inst.currentItem,
4359
			sender: _inst ? _inst.element : null
4360
		};
4361
	}
4362
4363
});
4364
4365
4366
/*!
4367
 * jQuery UI Accordion 1.11.4
4368
 * http://jqueryui.com
4369
 *
4370
 * Copyright jQuery Foundation and other contributors
4371
 * Released under the MIT license.
4372
 * http://jquery.org/license
4373
 *
4374
 * http://api.jqueryui.com/accordion/
4375
 */
4376
4377
4378
var accordion = $.widget( "ui.accordion", {
4379
	version: "1.11.4",
4380
	options: {
4381
		active: 0,
4382
		animate: {},
4383
		collapsible: false,
4384
		event: "click",
4385
		header: "> li > :first-child,> :not(li):even",
4386
		heightStyle: "auto",
4387
		icons: {
4388
			activeHeader: "ui-icon-triangle-1-s",
4389
			header: "ui-icon-triangle-1-e"
4390
		},
4391
4392
		// callbacks
4393
		activate: null,
4394
		beforeActivate: null
4395
	},
4396
4397
	hideProps: {
4398
		borderTopWidth: "hide",
4399
		borderBottomWidth: "hide",
4400
		paddingTop: "hide",
4401
		paddingBottom: "hide",
4402
		height: "hide"
4403
	},
4404
4405
	showProps: {
4406
		borderTopWidth: "show",
4407
		borderBottomWidth: "show",
4408
		paddingTop: "show",
4409
		paddingBottom: "show",
4410
		height: "show"
4411
	},
4412
4413
	_create: function() {
4414
		var options = this.options;
4415
		this.prevShow = this.prevHide = $();
4416
		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
4417
			// ARIA
4418
			.attr( "role", "tablist" );
4419
4420
		// don't allow collapsible: false and active: false / null
4421
		if ( !options.collapsible && (options.active === false || options.active == null) ) {
4422
			options.active = 0;
4423
		}
4424
4425
		this._processPanels();
4426
		// handle negative values
4427
		if ( options.active < 0 ) {
4428
			options.active += this.headers.length;
4429
		}
4430
		this._refresh();
4431
	},
4432
4433
	_getCreateEventData: function() {
4434
		return {
4435
			header: this.active,
4436
			panel: !this.active.length ? $() : this.active.next()
4437
		};
4438
	},
4439
4440
	_createIcons: function() {
4441
		var icons = this.options.icons;
4442
		if ( icons ) {
4443
			$( "<span>" )
4444
				.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
4445
				.prependTo( this.headers );
4446
			this.active.children( ".ui-accordion-header-icon" )
4447
				.removeClass( icons.header )
4448
				.addClass( icons.activeHeader );
4449
			this.headers.addClass( "ui-accordion-icons" );
4450
		}
4451
	},
4452
4453
	_destroyIcons: function() {
4454
		this.headers
4455
			.removeClass( "ui-accordion-icons" )
4456
			.children( ".ui-accordion-header-icon" )
4457
				.remove();
4458
	},
4459
4460
	_destroy: function() {
4461
		var contents;
4462
4463
		// clean up main element
4464
		this.element
4465
			.removeClass( "ui-accordion ui-widget ui-helper-reset" )
4466
			.removeAttr( "role" );
4467
4468
		// clean up headers
4469
		this.headers
4470
			.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
4471
				"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
4472
			.removeAttr( "role" )
4473
			.removeAttr( "aria-expanded" )
4474
			.removeAttr( "aria-selected" )
4475
			.removeAttr( "aria-controls" )
4476
			.removeAttr( "tabIndex" )
4477
			.removeUniqueId();
4478
4479
		this._destroyIcons();
4480
4481
		// clean up content panels
4482
		contents = this.headers.next()
4483
			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
4484
				"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
4485
			.css( "display", "" )
4486
			.removeAttr( "role" )
4487
			.removeAttr( "aria-hidden" )
4488
			.removeAttr( "aria-labelledby" )
4489
			.removeUniqueId();
4490
4491
		if ( this.options.heightStyle !== "content" ) {
4492
			contents.css( "height", "" );
4493
		}
4494
	},
4495
4496
	_setOption: function( key, value ) {
4497
		if ( key === "active" ) {
4498
			// _activate() will handle invalid values and update this.options
4499
			this._activate( value );
4500
			return;
4501
		}
4502
4503
		if ( key === "event" ) {
4504
			if ( this.options.event ) {
4505
				this._off( this.headers, this.options.event );
4506
			}
4507
			this._setupEvents( value );
4508
		}
4509
4510
		this._super( key, value );
4511
4512
		// setting collapsible: false while collapsed; open first panel
4513
		if ( key === "collapsible" && !value && this.options.active === false ) {
4514
			this._activate( 0 );
4515
		}
4516
4517
		if ( key === "icons" ) {
4518
			this._destroyIcons();
4519
			if ( value ) {
4520
				this._createIcons();
4521
			}
4522
		}
4523
4524
		// #5332 - opacity doesn't cascade to positioned elements in IE
4525
		// so we need to add the disabled class to the headers and panels
4526
		if ( key === "disabled" ) {
4527
			this.element
4528
				.toggleClass( "ui-state-disabled", !!value )
4529
				.attr( "aria-disabled", value );
4530
			this.headers.add( this.headers.next() )
4531
				.toggleClass( "ui-state-disabled", !!value );
4532
		}
4533
	},
4534
4535
	_keydown: function( event ) {
4536
		if ( event.altKey || event.ctrlKey ) {
4537
			return;
4538
		}
4539
4540
		var keyCode = $.ui.keyCode,
4541
			length = this.headers.length,
4542
			currentIndex = this.headers.index( event.target ),
4543
			toFocus = false;
4544
4545
		switch ( event.keyCode ) {
4546
			case keyCode.RIGHT:
4547
			case keyCode.DOWN:
4548
				toFocus = this.headers[ ( currentIndex + 1 ) % length ];
4549
				break;
4550
			case keyCode.LEFT:
4551
			case keyCode.UP:
4552
				toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
4553
				break;
4554
			case keyCode.SPACE:
4555
			case keyCode.ENTER:
4556
				this._eventHandler( event );
4557
				break;
4558
			case keyCode.HOME:
4559
				toFocus = this.headers[ 0 ];
4560
				break;
4561
			case keyCode.END:
4562
				toFocus = this.headers[ length - 1 ];
4563
				break;
4564
		}
4565
4566
		if ( toFocus ) {
4567
			$( event.target ).attr( "tabIndex", -1 );
4568
			$( toFocus ).attr( "tabIndex", 0 );
4569
			toFocus.focus();
4570
			event.preventDefault();
4571
		}
4572
	},
4573
4574
	_panelKeyDown: function( event ) {
4575
		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
4576
			$( event.currentTarget ).prev().focus();
4577
		}
4578
	},
4579
4580
	refresh: function() {
4581
		var options = this.options;
4582
		this._processPanels();
4583
4584
		// was collapsed or no panel
4585
		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
4586
			options.active = false;
4587
			this.active = $();
4588
		// active false only when collapsible is true
4589
		} else if ( options.active === false ) {
4590
			this._activate( 0 );
4591
		// was active, but active panel is gone
4592
		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
4593
			// all remaining panel are disabled
4594
			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
4595
				options.active = false;
4596
				this.active = $();
4597
			// activate previous panel
4598
			} else {
4599
				this._activate( Math.max( 0, options.active - 1 ) );
4600
			}
4601
		// was active, active panel still exists
4602
		} else {
4603
			// make sure active index is correct
4604
			options.active = this.headers.index( this.active );
4605
		}
4606
4607
		this._destroyIcons();
4608
4609
		this._refresh();
4610
	},
4611
4612
	_processPanels: function() {
4613
		var prevHeaders = this.headers,
4614
			prevPanels = this.panels;
4615
4616
		this.headers = this.element.find( this.options.header )
4617
			.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
4618
4619
		this.panels = this.headers.next()
4620
			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
4621
			.filter( ":not(.ui-accordion-content-active)" )
4622
			.hide();
4623
4624
		// Avoid memory leaks (#10056)
4625
		if ( prevPanels ) {
4626
			this._off( prevHeaders.not( this.headers ) );
4627
			this._off( prevPanels.not( this.panels ) );
4628
		}
4629
	},
4630
4631
	_refresh: function() {
4632
		var maxHeight,
4633
			options = this.options,
4634
			heightStyle = options.heightStyle,
4635
			parent = this.element.parent();
4636
4637
		this.active = this._findActive( options.active )
4638
			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
4639
			.removeClass( "ui-corner-all" );
4640
		this.active.next()
4641
			.addClass( "ui-accordion-content-active" )
4642
			.show();
4643
4644
		this.headers
4645
			.attr( "role", "tab" )
4646
			.each(function() {
4647
				var header = $( this ),
4648
					headerId = header.uniqueId().attr( "id" ),
4649
					panel = header.next(),
4650
					panelId = panel.uniqueId().attr( "id" );
4651
				header.attr( "aria-controls", panelId );
4652
				panel.attr( "aria-labelledby", headerId );
4653
			})
4654
			.next()
4655
				.attr( "role", "tabpanel" );
4656
4657
		this.headers
4658
			.not( this.active )
4659
			.attr({
4660
				"aria-selected": "false",
4661
				"aria-expanded": "false",
4662
				tabIndex: -1
4663
			})
4664
			.next()
4665
				.attr({
4666
					"aria-hidden": "true"
4667
				})
4668
				.hide();
4669
4670
		// make sure at least one header is in the tab order
4671
		if ( !this.active.length ) {
4672
			this.headers.eq( 0 ).attr( "tabIndex", 0 );
4673
		} else {
4674
			this.active.attr({
4675
				"aria-selected": "true",
4676
				"aria-expanded": "true",
4677
				tabIndex: 0
4678
			})
4679
			.next()
4680
				.attr({
4681
					"aria-hidden": "false"
4682
				});
4683
		}
4684
4685
		this._createIcons();
4686
4687
		this._setupEvents( options.event );
4688
4689
		if ( heightStyle === "fill" ) {
4690
			maxHeight = parent.height();
4691
			this.element.siblings( ":visible" ).each(function() {
4692
				var elem = $( this ),
4693
					position = elem.css( "position" );
4694
4695
				if ( position === "absolute" || position === "fixed" ) {
4696
					return;
4697
				}
4698
				maxHeight -= elem.outerHeight( true );
4699
			});
4700
4701
			this.headers.each(function() {
4702
				maxHeight -= $( this ).outerHeight( true );
4703
			});
4704
4705
			this.headers.next()
4706
				.each(function() {
4707
					$( this ).height( Math.max( 0, maxHeight -
4708
						$( this ).innerHeight() + $( this ).height() ) );
4709
				})
4710
				.css( "overflow", "auto" );
4711
		} else if ( heightStyle === "auto" ) {
4712
			maxHeight = 0;
4713
			this.headers.next()
4714
				.each(function() {
4715
					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
4716
				})
4717
				.height( maxHeight );
4718
		}
4719
	},
4720
4721
	_activate: function( index ) {
4722
		var active = this._findActive( index )[ 0 ];
4723
4724
		// trying to activate the already active panel
4725
		if ( active === this.active[ 0 ] ) {
4726
			return;
4727
		}
4728
4729
		// trying to collapse, simulate a click on the currently active header
4730
		active = active || this.active[ 0 ];
4731
4732
		this._eventHandler({
4733
			target: active,
4734
			currentTarget: active,
4735
			preventDefault: $.noop
4736
		});
4737
	},
4738
4739
	_findActive: function( selector ) {
4740
		return typeof selector === "number" ? this.headers.eq( selector ) : $();
4741
	},
4742
4743
	_setupEvents: function( event ) {
4744
		var events = {
4745
			keydown: "_keydown"
4746
		};
4747
		if ( event ) {
4748
			$.each( event.split( " " ), function( index, eventName ) {
4749
				events[ eventName ] = "_eventHandler";
4750
			});
4751
		}
4752
4753
		this._off( this.headers.add( this.headers.next() ) );
4754
		this._on( this.headers, events );
4755
		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
4756
		this._hoverable( this.headers );
4757
		this._focusable( this.headers );
4758
	},
4759
4760
	_eventHandler: function( event ) {
4761
		var options = this.options,
4762
			active = this.active,
4763
			clicked = $( event.currentTarget ),
4764
			clickedIsActive = clicked[ 0 ] === active[ 0 ],
4765
			collapsing = clickedIsActive && options.collapsible,
4766
			toShow = collapsing ? $() : clicked.next(),
4767
			toHide = active.next(),
4768
			eventData = {
4769
				oldHeader: active,
4770
				oldPanel: toHide,
4771
				newHeader: collapsing ? $() : clicked,
4772
				newPanel: toShow
4773
			};
4774
4775
		event.preventDefault();
4776
4777
		if (
4778
				// click on active header, but not collapsible
4779
				( clickedIsActive && !options.collapsible ) ||
4780
				// allow canceling activation
4781
				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
4782
			return;
4783
		}
4784
4785
		options.active = collapsing ? false : this.headers.index( clicked );
4786
4787
		// when the call to ._toggle() comes after the class changes
4788
		// it causes a very odd bug in IE 8 (see #6720)
4789
		this.active = clickedIsActive ? $() : clicked;
4790
		this._toggle( eventData );
4791
4792
		// switch classes
4793
		// corner classes on the previously active header stay after the animation
4794
		active.removeClass( "ui-accordion-header-active ui-state-active" );
4795
		if ( options.icons ) {
4796
			active.children( ".ui-accordion-header-icon" )
4797
				.removeClass( options.icons.activeHeader )
4798
				.addClass( options.icons.header );
4799
		}
4800
4801
		if ( !clickedIsActive ) {
4802
			clicked
4803
				.removeClass( "ui-corner-all" )
4804
				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
4805
			if ( options.icons ) {
4806
				clicked.children( ".ui-accordion-header-icon" )
4807
					.removeClass( options.icons.header )
4808
					.addClass( options.icons.activeHeader );
4809
			}
4810
4811
			clicked
4812
				.next()
4813
				.addClass( "ui-accordion-content-active" );
4814
		}
4815
	},
4816
4817
	_toggle: function( data ) {
4818
		var toShow = data.newPanel,
4819
			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
4820
4821
		// handle activating a panel during the animation for another activation
4822
		this.prevShow.add( this.prevHide ).stop( true, true );
4823
		this.prevShow = toShow;
4824
		this.prevHide = toHide;
4825
4826
		if ( this.options.animate ) {
4827
			this._animate( toShow, toHide, data );
4828
		} else {
4829
			toHide.hide();
4830
			toShow.show();
4831
			this._toggleComplete( data );
4832
		}
4833
4834
		toHide.attr({
4835
			"aria-hidden": "true"
4836
		});
4837
		toHide.prev().attr({
4838
			"aria-selected": "false",
4839
			"aria-expanded": "false"
4840
		});
4841
		// if we're switching panels, remove the old header from the tab order
4842
		// if we're opening from collapsed state, remove the previous header from the tab order
4843
		// if we're collapsing, then keep the collapsing header in the tab order
4844
		if ( toShow.length && toHide.length ) {
4845
			toHide.prev().attr({
4846
				"tabIndex": -1,
4847
				"aria-expanded": "false"
4848
			});
4849
		} else if ( toShow.length ) {
4850
			this.headers.filter(function() {
4851
				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
4852
			})
4853
			.attr( "tabIndex", -1 );
4854
		}
4855
4856
		toShow
4857
			.attr( "aria-hidden", "false" )
4858
			.prev()
4859
				.attr({
4860
					"aria-selected": "true",
4861
					"aria-expanded": "true",
4862
					tabIndex: 0
4863
				});
4864
	},
4865
4866
	_animate: function( toShow, toHide, data ) {
4867
		var total, easing, duration,
4868
			that = this,
4869
			adjust = 0,
4870
			boxSizing = toShow.css( "box-sizing" ),
4871
			down = toShow.length &&
4872
				( !toHide.length || ( toShow.index() < toHide.index() ) ),
4873
			animate = this.options.animate || {},
4874
			options = down && animate.down || animate,
4875
			complete = function() {
4876
				that._toggleComplete( data );
4877
			};
4878
4879
		if ( typeof options === "number" ) {
4880
			duration = options;
4881
		}
4882
		if ( typeof options === "string" ) {
4883
			easing = options;
4884
		}
4885
		// fall back from options to animation in case of partial down settings
4886
		easing = easing || options.easing || animate.easing;
4887
		duration = duration || options.duration || animate.duration;
4888
4889
		if ( !toHide.length ) {
4890
			return toShow.animate( this.showProps, duration, easing, complete );
4891
		}
4892
		if ( !toShow.length ) {
4893
			return toHide.animate( this.hideProps, duration, easing, complete );
4894
		}
4895
4896
		total = toShow.show().outerHeight();
4897
		toHide.animate( this.hideProps, {
4898
			duration: duration,
4899
			easing: easing,
4900
			step: function( now, fx ) {
4901
				fx.now = Math.round( now );
4902
			}
4903
		});
4904
		toShow
4905
			.hide()
4906
			.animate( this.showProps, {
4907
				duration: duration,
4908
				easing: easing,
4909
				complete: complete,
4910
				step: function( now, fx ) {
4911
					fx.now = Math.round( now );
4912
					if ( fx.prop !== "height" ) {
4913
						if ( boxSizing === "content-box" ) {
4914
							adjust += fx.now;
4915
						}
4916
					} else if ( that.options.heightStyle !== "content" ) {
4917
						fx.now = Math.round( total - toHide.outerHeight() - adjust );
4918
						adjust = 0;
4919
					}
4920
				}
4921
			});
4922
	},
4923
4924
	_toggleComplete: function( data ) {
4925
		var toHide = data.oldPanel;
4926
4927
		toHide
4928
			.removeClass( "ui-accordion-content-active" )
4929
			.prev()
4930
				.removeClass( "ui-corner-top" )
4931
				.addClass( "ui-corner-all" );
4932
4933
		// Work around for rendering bug in IE (#5421)
4934
		if ( toHide.length ) {
4935
			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
4936
		}
4937
		this._trigger( "activate", null, data );
4938
	}
4939
});
4940
4941
4942
/*!
4943
 * jQuery UI Menu 1.11.4
4944
 * http://jqueryui.com
4945
 *
4946
 * Copyright jQuery Foundation and other contributors
4947
 * Released under the MIT license.
4948
 * http://jquery.org/license
4949
 *
4950
 * http://api.jqueryui.com/menu/
4951
 */
4952
4953
4954
var menu = $.widget( "ui.menu", {
4955
	version: "1.11.4",
4956
	defaultElement: "<ul>",
4957
	delay: 300,
4958
	options: {
4959
		icons: {
4960
			submenu: "ui-icon-carat-1-e"
4961
		},
4962
		items: "> *",
4963
		menus: "ul",
4964
		position: {
4965
			my: "left-1 top",
4966
			at: "right top"
4967
		},
4968
		role: "menu",
4969
4970
		// callbacks
4971
		blur: null,
4972
		focus: null,
4973
		select: null
4974
	},
4975
4976
	_create: function() {
4977
		this.activeMenu = this.element;
4978
4979
		// Flag used to prevent firing of the click handler
4980
		// as the event bubbles up through nested menus
4981
		this.mouseHandled = false;
4982
		this.element
4983
			.uniqueId()
4984
			.addClass( "ui-menu ui-widget ui-widget-content" )
4985
			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
4986
			.attr({
4987
				role: this.options.role,
4988
				tabIndex: 0
4989
			});
4990
4991
		if ( this.options.disabled ) {
4992
			this.element
4993
				.addClass( "ui-state-disabled" )
4994
				.attr( "aria-disabled", "true" );
4995
		}
4996
4997
		this._on({
4998
			// Prevent focus from sticking to links inside menu after clicking
4999
			// them (focus should always stay on UL during navigation).
5000
			"mousedown .ui-menu-item": function( event ) {
5001
				event.preventDefault();
5002
			},
5003
			"click .ui-menu-item": function( event ) {
5004
				var target = $( event.target );
5005
				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
5006
					this.select( event );
5007
5008
					// Only set the mouseHandled flag if the event will bubble, see #9469.
5009
					if ( !event.isPropagationStopped() ) {
5010
						this.mouseHandled = true;
5011
					}
5012
5013
					// Open submenu on click
5014
					if ( target.has( ".ui-menu" ).length ) {
5015
						this.expand( event );
5016
					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
5017
5018
						// Redirect focus to the menu
5019
						this.element.trigger( "focus", [ true ] );
5020
5021
						// If the active item is on the top level, let it stay active.
5022
						// Otherwise, blur the active item since it is no longer visible.
5023
						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
5024
							clearTimeout( this.timer );
5025
						}
5026
					}
5027
				}
5028
			},
5029
			"mouseenter .ui-menu-item": function( event ) {
5030
				// Ignore mouse events while typeahead is active, see #10458.
5031
				// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
5032
				// is over an item in the menu
5033
				if ( this.previousFilter ) {
5034
					return;
5035
				}
5036
				var target = $( event.currentTarget );
5037
				// Remove ui-state-active class from siblings of the newly focused menu item
5038
				// to avoid a jump caused by adjacent elements both having a class with a border
5039
				target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
5040
				this.focus( event, target );
5041
			},
5042
			mouseleave: "collapseAll",
5043
			"mouseleave .ui-menu": "collapseAll",
5044
			focus: function( event, keepActiveItem ) {
5045
				// If there's already an active item, keep it active
5046
				// If not, activate the first item
5047
				var item = this.active || this.element.find( this.options.items ).eq( 0 );
5048
5049
				if ( !keepActiveItem ) {
5050
					this.focus( event, item );
5051
				}
5052
			},
5053
			blur: function( event ) {
5054
				this._delay(function() {
5055
					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
5056
						this.collapseAll( event );
5057
					}
5058
				});
5059
			},
5060
			keydown: "_keydown"
5061
		});
5062
5063
		this.refresh();
5064
5065
		// Clicks outside of a menu collapse any open menus
5066
		this._on( this.document, {
5067
			click: function( event ) {
5068
				if ( this._closeOnDocumentClick( event ) ) {
5069
					this.collapseAll( event );
5070
				}
5071
5072
				// Reset the mouseHandled flag
5073
				this.mouseHandled = false;
5074
			}
5075
		});
5076
	},
5077
5078
	_destroy: function() {
5079
		// Destroy (sub)menus
5080
		this.element
5081
			.removeAttr( "aria-activedescendant" )
5082
			.find( ".ui-menu" ).addBack()
5083
				.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
5084
				.removeAttr( "role" )
5085
				.removeAttr( "tabIndex" )
5086
				.removeAttr( "aria-labelledby" )
5087
				.removeAttr( "aria-expanded" )
5088
				.removeAttr( "aria-hidden" )
5089
				.removeAttr( "aria-disabled" )
5090
				.removeUniqueId()
5091
				.show();
5092
5093
		// Destroy menu items
5094
		this.element.find( ".ui-menu-item" )
5095
			.removeClass( "ui-menu-item" )
5096
			.removeAttr( "role" )
5097
			.removeAttr( "aria-disabled" )
5098
			.removeUniqueId()
5099
			.removeClass( "ui-state-hover" )
5100
			.removeAttr( "tabIndex" )
5101
			.removeAttr( "role" )
5102
			.removeAttr( "aria-haspopup" )
5103
			.children().each( function() {
5104
				var elem = $( this );
5105
				if ( elem.data( "ui-menu-submenu-carat" ) ) {
5106
					elem.remove();
5107
				}
5108
			});
5109
5110
		// Destroy menu dividers
5111
		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
5112
	},
5113
5114
	_keydown: function( event ) {
5115
		var match, prev, character, skip,
5116
			preventDefault = true;
5117
5118
		switch ( event.keyCode ) {
5119
		case $.ui.keyCode.PAGE_UP:
5120
			this.previousPage( event );
5121
			break;
5122
		case $.ui.keyCode.PAGE_DOWN:
5123
			this.nextPage( event );
5124
			break;
5125
		case $.ui.keyCode.HOME:
5126
			this._move( "first", "first", event );
5127
			break;
5128
		case $.ui.keyCode.END:
5129
			this._move( "last", "last", event );
5130
			break;
5131
		case $.ui.keyCode.UP:
5132
			this.previous( event );
5133
			break;
5134
		case $.ui.keyCode.DOWN:
5135
			this.next( event );
5136
			break;
5137
		case $.ui.keyCode.LEFT:
5138
			this.collapse( event );
5139
			break;
5140
		case $.ui.keyCode.RIGHT:
5141
			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5142
				this.expand( event );
5143
			}
5144
			break;
5145
		case $.ui.keyCode.ENTER:
5146
		case $.ui.keyCode.SPACE:
5147
			this._activate( event );
5148
			break;
5149
		case $.ui.keyCode.ESCAPE:
5150
			this.collapse( event );
5151
			break;
5152
		default:
5153
			preventDefault = false;
5154
			prev = this.previousFilter || "";
5155
			character = String.fromCharCode( event.keyCode );
5156
			skip = false;
5157
5158
			clearTimeout( this.filterTimer );
5159
5160
			if ( character === prev ) {
5161
				skip = true;
5162
			} else {
5163
				character = prev + character;
5164
			}
5165
5166
			match = this._filterMenuItems( character );
5167
			match = skip && match.index( this.active.next() ) !== -1 ?
5168
				this.active.nextAll( ".ui-menu-item" ) :
5169
				match;
5170
5171
			// If no matches on the current filter, reset to the last character pressed
5172
			// to move down the menu to the first item that starts with that character
5173
			if ( !match.length ) {
5174
				character = String.fromCharCode( event.keyCode );
5175
				match = this._filterMenuItems( character );
5176
			}
5177
5178
			if ( match.length ) {
5179
				this.focus( event, match );
5180
				this.previousFilter = character;
5181
				this.filterTimer = this._delay(function() {
5182
					delete this.previousFilter;
5183
				}, 1000 );
5184
			} else {
5185
				delete this.previousFilter;
5186
			}
5187
		}
5188
5189
		if ( preventDefault ) {
5190
			event.preventDefault();
5191
		}
5192
	},
5193
5194
	_activate: function( event ) {
5195
		if ( !this.active.is( ".ui-state-disabled" ) ) {
5196
			if ( this.active.is( "[aria-haspopup='true']" ) ) {
5197
				this.expand( event );
5198
			} else {
5199
				this.select( event );
5200
			}
5201
		}
5202
	},
5203
5204
	refresh: function() {
5205
		var menus, items,
5206
			that = this,
5207
			icon = this.options.icons.submenu,
5208
			submenus = this.element.find( this.options.menus );
5209
5210
		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
5211
5212
		// Initialize nested menus
5213
		submenus.filter( ":not(.ui-menu)" )
5214
			.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
5215
			.hide()
5216
			.attr({
5217
				role: this.options.role,
5218
				"aria-hidden": "true",
5219
				"aria-expanded": "false"
5220
			})
5221
			.each(function() {
5222
				var menu = $( this ),
5223
					item = menu.parent(),
5224
					submenuCarat = $( "<span>" )
5225
						.addClass( "ui-menu-icon ui-icon " + icon )
5226
						.data( "ui-menu-submenu-carat", true );
5227
5228
				item
5229
					.attr( "aria-haspopup", "true" )
5230
					.prepend( submenuCarat );
5231
				menu.attr( "aria-labelledby", item.attr( "id" ) );
5232
			});
5233
5234
		menus = submenus.add( this.element );
5235
		items = menus.find( this.options.items );
5236
5237
		// Initialize menu-items containing spaces and/or dashes only as dividers
5238
		items.not( ".ui-menu-item" ).each(function() {
5239
			var item = $( this );
5240
			if ( that._isDivider( item ) ) {
5241
				item.addClass( "ui-widget-content ui-menu-divider" );
5242
			}
5243
		});
5244
5245
		// Don't refresh list items that are already adapted
5246
		items.not( ".ui-menu-item, .ui-menu-divider" )
5247
			.addClass( "ui-menu-item" )
5248
			.uniqueId()
5249
			.attr({
5250
				tabIndex: -1,
5251
				role: this._itemRole()
5252
			});
5253
5254
		// Add aria-disabled attribute to any disabled menu item
5255
		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
5256
5257
		// If the active item has been removed, blur the menu
5258
		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
5259
			this.blur();
5260
		}
5261
	},
5262
5263
	_itemRole: function() {
5264
		return {
5265
			menu: "menuitem",
5266
			listbox: "option"
5267
		}[ this.options.role ];
5268
	},
5269
5270
	_setOption: function( key, value ) {
5271
		if ( key === "icons" ) {
5272
			this.element.find( ".ui-menu-icon" )
5273
				.removeClass( this.options.icons.submenu )
5274
				.addClass( value.submenu );
5275
		}
5276
		if ( key === "disabled" ) {
5277
			this.element
5278
				.toggleClass( "ui-state-disabled", !!value )
5279
				.attr( "aria-disabled", value );
5280
		}
5281
		this._super( key, value );
5282
	},
5283
5284
	focus: function( event, item ) {
5285
		var nested, focused;
5286
		this.blur( event, event && event.type === "focus" );
5287
5288
		this._scrollIntoView( item );
5289
5290
		this.active = item.first();
5291
		focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
5292
		// Only update aria-activedescendant if there's a role
5293
		// otherwise we assume focus is managed elsewhere
5294
		if ( this.options.role ) {
5295
			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
5296
		}
5297
5298
		// Highlight active parent menu item, if any
5299
		this.active
5300
			.parent()
5301
			.closest( ".ui-menu-item" )
5302
			.addClass( "ui-state-active" );
5303
5304
		if ( event && event.type === "keydown" ) {
5305
			this._close();
5306
		} else {
5307
			this.timer = this._delay(function() {
5308
				this._close();
5309
			}, this.delay );
5310
		}
5311
5312
		nested = item.children( ".ui-menu" );
5313
		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
5314
			this._startOpening(nested);
5315
		}
5316
		this.activeMenu = item.parent();
5317
5318
		this._trigger( "focus", event, { item: item } );
5319
	},
5320
5321
	_scrollIntoView: function( item ) {
5322
		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
5323
		if ( this._hasScroll() ) {
5324
			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
5325
			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
5326
			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
5327
			scroll = this.activeMenu.scrollTop();
5328
			elementHeight = this.activeMenu.height();
5329
			itemHeight = item.outerHeight();
5330
5331
			if ( offset < 0 ) {
5332
				this.activeMenu.scrollTop( scroll + offset );
5333
			} else if ( offset + itemHeight > elementHeight ) {
5334
				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
5335
			}
5336
		}
5337
	},
5338
5339
	blur: function( event, fromFocus ) {
5340
		if ( !fromFocus ) {
5341
			clearTimeout( this.timer );
5342
		}
5343
5344
		if ( !this.active ) {
5345
			return;
5346
		}
5347
5348
		this.active.removeClass( "ui-state-focus" );
5349
		this.active = null;
5350
5351
		this._trigger( "blur", event, { item: this.active } );
5352
	},
5353
5354
	_startOpening: function( submenu ) {
5355
		clearTimeout( this.timer );
5356
5357
		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
5358
		// shift in the submenu position when mousing over the carat icon
5359
		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
5360
			return;
5361
		}
5362
5363
		this.timer = this._delay(function() {
5364
			this._close();
5365
			this._open( submenu );
5366
		}, this.delay );
5367
	},
5368
5369
	_open: function( submenu ) {
5370
		var position = $.extend({
5371
			of: this.active
5372
		}, this.options.position );
5373
5374
		clearTimeout( this.timer );
5375
		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
5376
			.hide()
5377
			.attr( "aria-hidden", "true" );
5378
5379
		submenu
5380
			.show()
5381
			.removeAttr( "aria-hidden" )
5382
			.attr( "aria-expanded", "true" )
5383
			.position( position );
5384
	},
5385
5386
	collapseAll: function( event, all ) {
5387
		clearTimeout( this.timer );
5388
		this.timer = this._delay(function() {
5389
			// If we were passed an event, look for the submenu that contains the event
5390
			var currentMenu = all ? this.element :
5391
				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
5392
5393
			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
5394
			if ( !currentMenu.length ) {
5395
				currentMenu = this.element;
5396
			}
5397
5398
			this._close( currentMenu );
5399
5400
			this.blur( event );
5401
			this.activeMenu = currentMenu;
5402
		}, this.delay );
5403
	},
5404
5405
	// With no arguments, closes the currently active menu - if nothing is active
5406
	// it closes all menus.  If passed an argument, it will search for menus BELOW
5407
	_close: function( startMenu ) {
5408
		if ( !startMenu ) {
5409
			startMenu = this.active ? this.active.parent() : this.element;
5410
		}
5411
5412
		startMenu
5413
			.find( ".ui-menu" )
5414
				.hide()
5415
				.attr( "aria-hidden", "true" )
5416
				.attr( "aria-expanded", "false" )
5417
			.end()
5418
			.find( ".ui-state-active" ).not( ".ui-state-focus" )
5419
				.removeClass( "ui-state-active" );
5420
	},
5421
5422
	_closeOnDocumentClick: function( event ) {
5423
		return !$( event.target ).closest( ".ui-menu" ).length;
5424
	},
5425
5426
	_isDivider: function( item ) {
5427
5428
		// Match hyphen, em dash, en dash
5429
		return !/[^\-\u2014\u2013\s]/.test( item.text() );
5430
	},
5431
5432
	collapse: function( event ) {
5433
		var newItem = this.active &&
5434
			this.active.parent().closest( ".ui-menu-item", this.element );
5435
		if ( newItem && newItem.length ) {
5436
			this._close();
5437
			this.focus( event, newItem );
5438
		}
5439
	},
5440
5441
	expand: function( event ) {
5442
		var newItem = this.active &&
5443
			this.active
5444
				.children( ".ui-menu " )
5445
				.find( this.options.items )
5446
				.first();
5447
5448
		if ( newItem && newItem.length ) {
5449
			this._open( newItem.parent() );
5450
5451
			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
5452
			this._delay(function() {
5453
				this.focus( event, newItem );
5454
			});
5455
		}
5456
	},
5457
5458
	next: function( event ) {
5459
		this._move( "next", "first", event );
5460
	},
5461
5462
	previous: function( event ) {
5463
		this._move( "prev", "last", event );
5464
	},
5465
5466
	isFirstItem: function() {
5467
		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
5468
	},
5469
5470
	isLastItem: function() {
5471
		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
5472
	},
5473
5474
	_move: function( direction, filter, event ) {
5475
		var next;
5476
		if ( this.active ) {
5477
			if ( direction === "first" || direction === "last" ) {
5478
				next = this.active
5479
					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
5480
					.eq( -1 );
5481
			} else {
5482
				next = this.active
5483
					[ direction + "All" ]( ".ui-menu-item" )
5484
					.eq( 0 );
5485
			}
5486
		}
5487
		if ( !next || !next.length || !this.active ) {
5488
			next = this.activeMenu.find( this.options.items )[ filter ]();
5489
		}
5490
5491
		this.focus( event, next );
5492
	},
5493
5494
	nextPage: function( event ) {
5495
		var item, base, height;
5496
5497
		if ( !this.active ) {
5498
			this.next( event );
5499
			return;
5500
		}
5501
		if ( this.isLastItem() ) {
5502
			return;
5503
		}
5504
		if ( this._hasScroll() ) {
5505
			base = this.active.offset().top;
5506
			height = this.element.height();
5507
			this.active.nextAll( ".ui-menu-item" ).each(function() {
5508
				item = $( this );
5509
				return item.offset().top - base - height < 0;
5510
			});
5511
5512
			this.focus( event, item );
5513
		} else {
5514
			this.focus( event, this.activeMenu.find( this.options.items )
5515
				[ !this.active ? "first" : "last" ]() );
5516
		}
5517
	},
5518
5519
	previousPage: function( event ) {
5520
		var item, base, height;
5521
		if ( !this.active ) {
5522
			this.next( event );
5523
			return;
5524
		}
5525
		if ( this.isFirstItem() ) {
5526
			return;
5527
		}
5528
		if ( this._hasScroll() ) {
5529
			base = this.active.offset().top;
5530
			height = this.element.height();
5531
			this.active.prevAll( ".ui-menu-item" ).each(function() {
5532
				item = $( this );
5533
				return item.offset().top - base + height > 0;
5534
			});
5535
5536
			this.focus( event, item );
5537
		} else {
5538
			this.focus( event, this.activeMenu.find( this.options.items ).first() );
5539
		}
5540
	},
5541
5542
	_hasScroll: function() {
5543
		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
5544
	},
5545
5546
	select: function( event ) {
5547
		// TODO: It should never be possible to not have an active item at this
5548
		// point, but the tests don't trigger mouseenter before click.
5549
		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
5550
		var ui = { item: this.active };
5551
		if ( !this.active.has( ".ui-menu" ).length ) {
5552
			this.collapseAll( event, true );
5553
		}
5554
		this._trigger( "select", event, ui );
5555
	},
5556
5557
	_filterMenuItems: function(character) {
5558
		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
5559
			regex = new RegExp( "^" + escapedCharacter, "i" );
5560
5561
		return this.activeMenu
5562
			.find( this.options.items )
5563
5564
			// Only match on items, not dividers or other content (#10571)
5565
			.filter( ".ui-menu-item" )
5566
			.filter(function() {
5567
				return regex.test( $.trim( $( this ).text() ) );
5568
			});
5569
	}
5570
});
5571
5572
5573
/*!
5574
 * jQuery UI Autocomplete 1.11.4
5575
 * http://jqueryui.com
5576
 *
5577
 * Copyright jQuery Foundation and other contributors
5578
 * Released under the MIT license.
5579
 * http://jquery.org/license
5580
 *
5581
 * http://api.jqueryui.com/autocomplete/
5582
 */
5583
5584
5585
$.widget( "ui.autocomplete", {
5586
	version: "1.11.4",
5587
	defaultElement: "<input>",
5588
	options: {
5589
		appendTo: null,
5590
		autoFocus: false,
5591
		delay: 300,
5592
		minLength: 1,
5593
		position: {
5594
			my: "left top",
5595
			at: "left bottom",
5596
			collision: "none"
5597
		},
5598
		source: null,
5599
5600
		// callbacks
5601
		change: null,
5602
		close: null,
5603
		focus: null,
5604
		open: null,
5605
		response: null,
5606
		search: null,
5607
		select: null
5608
	},
5609
5610
	requestIndex: 0,
5611
	pending: 0,
5612
5613
	_create: function() {
5614
		// Some browsers only repeat keydown events, not keypress events,
5615
		// so we use the suppressKeyPress flag to determine if we've already
5616
		// handled the keydown event. #7269
5617
		// Unfortunately the code for & in keypress is the same as the up arrow,
5618
		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
5619
		// events when we know the keydown event was used to modify the
5620
		// search term. #7799
5621
		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
5622
			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
5623
			isTextarea = nodeName === "textarea",
5624
			isInput = nodeName === "input";
5625
5626
		this.isMultiLine =
5627
			// Textareas are always multi-line
5628
			isTextarea ? true :
5629
			// Inputs are always single-line, even if inside a contentEditable element
5630
			// IE also treats inputs as contentEditable
5631
			isInput ? false :
5632
			// All other element types are determined by whether or not they're contentEditable
5633
			this.element.prop( "isContentEditable" );
5634
5635
		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
5636
		this.isNewMenu = true;
5637
5638
		this.element
5639
			.addClass( "ui-autocomplete-input" )
5640
			.attr( "autocomplete", "off" );
5641
5642
		this._on( this.element, {
5643
			keydown: function( event ) {
5644
				if ( this.element.prop( "readOnly" ) ) {
5645
					suppressKeyPress = true;
5646
					suppressInput = true;
5647
					suppressKeyPressRepeat = true;
5648
					return;
5649
				}
5650
5651
				suppressKeyPress = false;
5652
				suppressInput = false;
5653
				suppressKeyPressRepeat = false;
5654
				var keyCode = $.ui.keyCode;
5655
				switch ( event.keyCode ) {
5656
				case keyCode.PAGE_UP:
5657
					suppressKeyPress = true;
5658
					this._move( "previousPage", event );
5659
					break;
5660
				case keyCode.PAGE_DOWN:
5661
					suppressKeyPress = true;
5662
					this._move( "nextPage", event );
5663
					break;
5664
				case keyCode.UP:
5665
					suppressKeyPress = true;
5666
					this._keyEvent( "previous", event );
5667
					break;
5668
				case keyCode.DOWN:
5669
					suppressKeyPress = true;
5670
					this._keyEvent( "next", event );
5671
					break;
5672
				case keyCode.ENTER:
5673
					// when menu is open and has focus
5674
					if ( this.menu.active ) {
5675
						// #6055 - Opera still allows the keypress to occur
5676
						// which causes forms to submit
5677
						suppressKeyPress = true;
5678
						event.preventDefault();
5679
						this.menu.select( event );
5680
					}
5681
					break;
5682
				case keyCode.TAB:
5683
					if ( this.menu.active ) {
5684
						this.menu.select( event );
5685
					}
5686
					break;
5687
				case keyCode.ESCAPE:
5688
					if ( this.menu.element.is( ":visible" ) ) {
5689
						if ( !this.isMultiLine ) {
5690
							this._value( this.term );
5691
						}
5692
						this.close( event );
5693
						// Different browsers have different default behavior for escape
5694
						// Single press can mean undo or clear
5695
						// Double press in IE means clear the whole form
5696
						event.preventDefault();
5697
					}
5698
					break;
5699
				default:
5700
					suppressKeyPressRepeat = true;
5701
					// search timeout should be triggered before the input value is changed
5702
					this._searchTimeout( event );
5703
					break;
5704
				}
5705
			},
5706
			keypress: function( event ) {
5707
				if ( suppressKeyPress ) {
5708
					suppressKeyPress = false;
5709
					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
5710
						event.preventDefault();
5711
					}
5712
					return;
5713
				}
5714
				if ( suppressKeyPressRepeat ) {
5715
					return;
5716
				}
5717
5718
				// replicate some key handlers to allow them to repeat in Firefox and Opera
5719
				var keyCode = $.ui.keyCode;
5720
				switch ( event.keyCode ) {
5721
				case keyCode.PAGE_UP:
5722
					this._move( "previousPage", event );
5723
					break;
5724
				case keyCode.PAGE_DOWN:
5725
					this._move( "nextPage", event );
5726
					break;
5727
				case keyCode.UP:
5728
					this._keyEvent( "previous", event );
5729
					break;
5730
				case keyCode.DOWN:
5731
					this._keyEvent( "next", event );
5732
					break;
5733
				}
5734
			},
5735
			input: function( event ) {
5736
				if ( suppressInput ) {
5737
					suppressInput = false;
5738
					event.preventDefault();
5739
					return;
5740
				}
5741
				this._searchTimeout( event );
5742
			},
5743
			focus: function() {
5744
				this.selectedItem = null;
5745
				this.previous = this._value();
5746
			},
5747
			blur: function( event ) {
5748
				if ( this.cancelBlur ) {
5749
					delete this.cancelBlur;
5750
					return;
5751
				}
5752
5753
				clearTimeout( this.searching );
5754
				this.close( event );
5755
				this._change( event );
5756
			}
5757
		});
5758
5759
		this._initSource();
5760
		this.menu = $( "<ul>" )
5761
			.addClass( "ui-autocomplete ui-front" )
5762
			.appendTo( this._appendTo() )
5763
			.menu({
5764
				// disable ARIA support, the live region takes care of that
5765
				role: null
5766
			})
5767
			.hide()
5768
			.menu( "instance" );
5769
5770
		this._on( this.menu.element, {
5771
			mousedown: function( event ) {
5772
				// prevent moving focus out of the text field
5773
				event.preventDefault();
5774
5775
				// IE doesn't prevent moving focus even with event.preventDefault()
5776
				// so we set a flag to know when we should ignore the blur event
5777
				this.cancelBlur = true;
5778
				this._delay(function() {
5779
					delete this.cancelBlur;
5780
				});
5781
5782
				// clicking on the scrollbar causes focus to shift to the body
5783
				// but we can't detect a mouseup or a click immediately afterward
5784
				// so we have to track the next mousedown and close the menu if
5785
				// the user clicks somewhere outside of the autocomplete
5786
				var menuElement = this.menu.element[ 0 ];
5787
				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
5788
					this._delay(function() {
5789
						var that = this;
5790
						this.document.one( "mousedown", function( event ) {
5791
							if ( event.target !== that.element[ 0 ] &&
5792
									event.target !== menuElement &&
5793
									!$.contains( menuElement, event.target ) ) {
5794
								that.close();
5795
							}
5796
						});
5797
					});
5798
				}
5799
			},
5800
			menufocus: function( event, ui ) {
5801
				var label, item;
5802
				// support: Firefox
5803
				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
5804
				if ( this.isNewMenu ) {
5805
					this.isNewMenu = false;
5806
					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
5807
						this.menu.blur();
5808
5809
						this.document.one( "mousemove", function() {
5810
							$( event.target ).trigger( event.originalEvent );
5811
						});
5812
5813
						return;
5814
					}
5815
				}
5816
5817
				item = ui.item.data( "ui-autocomplete-item" );
5818
				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
5819
					// use value to match what will end up in the input, if it was a key event
5820
					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
5821
						this._value( item.value );
5822
					}
5823
				}
5824
5825
				// Announce the value in the liveRegion
5826
				label = ui.item.attr( "aria-label" ) || item.value;
5827
				if ( label && $.trim( label ).length ) {
5828
					this.liveRegion.children().hide();
5829
					$( "<div>" ).text( label ).appendTo( this.liveRegion );
5830
				}
5831
			},
5832
			menuselect: function( event, ui ) {
5833
				var item = ui.item.data( "ui-autocomplete-item" ),
5834
					previous = this.previous;
5835
5836
				// only trigger when focus was lost (click on menu)
5837
				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
5838
					this.element.focus();
5839
					this.previous = previous;
5840
					// #6109 - IE triggers two focus events and the second
5841
					// is asynchronous, so we need to reset the previous
5842
					// term synchronously and asynchronously :-(
5843
					this._delay(function() {
5844
						this.previous = previous;
5845
						this.selectedItem = item;
5846
					});
5847
				}
5848
5849
				if ( false !== this._trigger( "select", event, { item: item } ) ) {
5850
					this._value( item.value );
5851
				}
5852
				// reset the term after the select event
5853
				// this allows custom select handling to work properly
5854
				this.term = this._value();
5855
5856
				this.close( event );
5857
				this.selectedItem = item;
5858
			}
5859
		});
5860
5861
		this.liveRegion = $( "<span>", {
5862
				role: "status",
5863
				"aria-live": "assertive",
5864
				"aria-relevant": "additions"
5865
			})
5866
			.addClass( "ui-helper-hidden-accessible" )
5867
			.appendTo( this.document[ 0 ].body );
5868
5869
		// turning off autocomplete prevents the browser from remembering the
5870
		// value when navigating through history, so we re-enable autocomplete
5871
		// if the page is unloaded before the widget is destroyed. #7790
5872
		this._on( this.window, {
5873
			beforeunload: function() {
5874
				this.element.removeAttr( "autocomplete" );
5875
			}
5876
		});
5877
	},
5878
5879
	_destroy: function() {
5880
		clearTimeout( this.searching );
5881
		this.element
5882
			.removeClass( "ui-autocomplete-input" )
5883
			.removeAttr( "autocomplete" );
5884
		this.menu.element.remove();
5885
		this.liveRegion.remove();
5886
	},
5887
5888
	_setOption: function( key, value ) {
5889
		this._super( key, value );
5890
		if ( key === "source" ) {
5891
			this._initSource();
5892
		}
5893
		if ( key === "appendTo" ) {
5894
			this.menu.element.appendTo( this._appendTo() );
5895
		}
5896
		if ( key === "disabled" && value && this.xhr ) {
5897
			this.xhr.abort();
5898
		}
5899
	},
5900
5901
	_appendTo: function() {
5902
		var element = this.options.appendTo;
5903
5904
		if ( element ) {
5905
			element = element.jquery || element.nodeType ?
5906
				$( element ) :
5907
				this.document.find( element ).eq( 0 );
5908
		}
5909
5910
		if ( !element || !element[ 0 ] ) {
5911
			element = this.element.closest( ".ui-front" );
5912
		}
5913
5914
		if ( !element.length ) {
5915
			element = this.document[ 0 ].body;
5916
		}
5917
5918
		return element;
5919
	},
5920
5921
	_initSource: function() {
5922
		var array, url,
5923
			that = this;
5924
		if ( $.isArray( this.options.source ) ) {
5925
			array = this.options.source;
5926
			this.source = function( request, response ) {
5927
				response( $.ui.autocomplete.filter( array, request.term ) );
5928
			};
5929
		} else if ( typeof this.options.source === "string" ) {
5930
			url = this.options.source;
5931
			this.source = function( request, response ) {
5932
				if ( that.xhr ) {
5933
					that.xhr.abort();
5934
				}
5935
				that.xhr = $.ajax({
5936
					url: url,
5937
					data: request,
5938
					dataType: "json",
5939
					success: function( data ) {
5940
						response( data );
5941
					},
5942
					error: function() {
5943
						response([]);
5944
					}
5945
				});
5946
			};
5947
		} else {
5948
			this.source = this.options.source;
5949
		}
5950
	},
5951
5952
	_searchTimeout: function( event ) {
5953
		clearTimeout( this.searching );
5954
		this.searching = this._delay(function() {
5955
5956
			// Search if the value has changed, or if the user retypes the same value (see #7434)
5957
			var equalValues = this.term === this._value(),
5958
				menuVisible = this.menu.element.is( ":visible" ),
5959
				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
5960
5961
			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
5962
				this.selectedItem = null;
5963
				this.search( null, event );
5964
			}
5965
		}, this.options.delay );
5966
	},
5967
5968
	search: function( value, event ) {
5969
		value = value != null ? value : this._value();
5970
5971
		// always save the actual value, not the one passed as an argument
5972
		this.term = this._value();
5973
5974
		if ( value.length < this.options.minLength ) {
5975
			return this.close( event );
5976
		}
5977
5978
		if ( this._trigger( "search", event ) === false ) {
5979
			return;
5980
		}
5981
5982
		return this._search( value );
5983
	},
5984
5985
	_search: function( value ) {
5986
		this.pending++;
5987
		this.element.addClass( "ui-autocomplete-loading" );
5988
		this.cancelSearch = false;
5989
5990
		this.source( { term: value }, this._response() );
5991
	},
5992
5993
	_response: function() {
5994
		var index = ++this.requestIndex;
5995
5996
		return $.proxy(function( content ) {
5997
			if ( index === this.requestIndex ) {
5998
				this.__response( content );
5999
			}
6000
6001
			this.pending--;
6002
			if ( !this.pending ) {
6003
				this.element.removeClass( "ui-autocomplete-loading" );
6004
			}
6005
		}, this );
6006
	},
6007
6008
	__response: function( content ) {
6009
		if ( content ) {
6010
			content = this._normalize( content );
6011
		}
6012
		this._trigger( "response", null, { content: content } );
6013
		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
6014
			this._suggest( content );
6015
			this._trigger( "open" );
6016
		} else {
6017
			// use ._close() instead of .close() so we don't cancel future searches
6018
			this._close();
6019
		}
6020
	},
6021
6022
	close: function( event ) {
6023
		this.cancelSearch = true;
6024
		this._close( event );
6025
	},
6026
6027
	_close: function( event ) {
6028
		if ( this.menu.element.is( ":visible" ) ) {
6029
			this.menu.element.hide();
6030
			this.menu.blur();
6031
			this.isNewMenu = true;
6032
			this._trigger( "close", event );
6033
		}
6034
	},
6035
6036
	_change: function( event ) {
6037
		if ( this.previous !== this._value() ) {
6038
			this._trigger( "change", event, { item: this.selectedItem } );
6039
		}
6040
	},
6041
6042
	_normalize: function( items ) {
6043
		// assume all items have the right format when the first item is complete
6044
		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
6045
			return items;
6046
		}
6047
		return $.map( items, function( item ) {
6048
			if ( typeof item === "string" ) {
6049
				return {
6050
					label: item,
6051
					value: item
6052
				};
6053
			}
6054
			return $.extend( {}, item, {
6055
				label: item.label || item.value,
6056
				value: item.value || item.label
6057
			});
6058
		});
6059
	},
6060
6061
	_suggest: function( items ) {
6062
		var ul = this.menu.element.empty();
6063
		this._renderMenu( ul, items );
6064
		this.isNewMenu = true;
6065
		this.menu.refresh();
6066
6067
		// size and position menu
6068
		ul.show();
6069
		this._resizeMenu();
6070
		ul.position( $.extend({
6071
			of: this.element
6072
		}, this.options.position ) );
6073
6074
		if ( this.options.autoFocus ) {
6075
			this.menu.next();
6076
		}
6077
	},
6078
6079
	_resizeMenu: function() {
6080
		var ul = this.menu.element;
6081
		ul.outerWidth( Math.max(
6082
			// Firefox wraps long text (possibly a rounding bug)
6083
			// so we add 1px to avoid the wrapping (#7513)
6084
			ul.width( "" ).outerWidth() + 1,
6085
			this.element.outerWidth()
6086
		) );
6087
	},
6088
6089
	_renderMenu: function( ul, items ) {
6090
		var that = this;
6091
		$.each( items, function( index, item ) {
6092
			that._renderItemData( ul, item );
6093
		});
6094
	},
6095
6096
	_renderItemData: function( ul, item ) {
6097
		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
6098
	},
6099
6100
	_renderItem: function( ul, item ) {
6101
		return $( "<li>" ).text( item.label ).appendTo( ul );
6102
	},
6103
6104
	_move: function( direction, event ) {
6105
		if ( !this.menu.element.is( ":visible" ) ) {
6106
			this.search( null, event );
6107
			return;
6108
		}
6109
		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
6110
				this.menu.isLastItem() && /^next/.test( direction ) ) {
6111
6112
			if ( !this.isMultiLine ) {
6113
				this._value( this.term );
6114
			}
6115
6116
			this.menu.blur();
6117
			return;
6118
		}
6119
		this.menu[ direction ]( event );
6120
	},
6121
6122
	widget: function() {
6123
		return this.menu.element;
6124
	},
6125
6126
	_value: function() {
6127
		return this.valueMethod.apply( this.element, arguments );
6128
	},
6129
6130
	_keyEvent: function( keyEvent, event ) {
6131
		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
6132
			this._move( keyEvent, event );
6133
6134
			// prevents moving cursor to beginning/end of the text field in some browsers
6135
			event.preventDefault();
6136
		}
6137
	}
6138
});
6139
6140
$.extend( $.ui.autocomplete, {
6141
	escapeRegex: function( value ) {
6142
		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
6143
	},
6144
	filter: function( array, term ) {
6145
		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
6146
		return $.grep( array, function( value ) {
6147
			return matcher.test( value.label || value.value || value );
6148
		});
6149
	}
6150
});
6151
6152
// live region extension, adding a `messages` option
6153
// NOTE: This is an experimental API. We are still investigating
6154
// a full solution for string manipulation and internationalization.
6155
$.widget( "ui.autocomplete", $.ui.autocomplete, {
6156
	options: {
6157
		messages: {
6158
			noResults: "No search results.",
6159
			results: function( amount ) {
6160
				return amount + ( amount > 1 ? " results are" : " result is" ) +
6161
					" available, use up and down arrow keys to navigate.";
6162
			}
6163
		}
6164
	},
6165
6166
	__response: function( content ) {
6167
		var message;
6168
		this._superApply( arguments );
6169
		if ( this.options.disabled || this.cancelSearch ) {
6170
			return;
6171
		}
6172
		if ( content && content.length ) {
6173
			message = this.options.messages.results( content.length );
6174
		} else {
6175
			message = this.options.messages.noResults;
6176
		}
6177
		this.liveRegion.children().hide();
6178
		$( "<div>" ).text( message ).appendTo( this.liveRegion );
6179
	}
6180
});
6181
6182
var autocomplete = $.ui.autocomplete;
6183
6184
6185
/*!
6186
 * jQuery UI Button 1.11.4
6187
 * http://jqueryui.com
6188
 *
6189
 * Copyright jQuery Foundation and other contributors
6190
 * Released under the MIT license.
6191
 * http://jquery.org/license
6192
 *
6193
 * http://api.jqueryui.com/button/
6194
 */
6195
6196
6197
var lastActive,
6198
	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
6199
	typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
6200
	formResetHandler = function() {
6201
		var form = $( this );
6202
		setTimeout(function() {
6203
			form.find( ":ui-button" ).button( "refresh" );
6204
		}, 1 );
6205
	},
6206
	radioGroup = function( radio ) {
6207
		var name = radio.name,
6208
			form = radio.form,
6209
			radios = $( [] );
6210
		if ( name ) {
6211
			name = name.replace( /'/g, "\\'" );
6212
			if ( form ) {
6213
				radios = $( form ).find( "[name='" + name + "'][type=radio]" );
6214
			} else {
6215
				radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
6216
					.filter(function() {
6217
						return !this.form;
6218
					});
6219
			}
6220
		}
6221
		return radios;
6222
	};
6223
6224
$.widget( "ui.button", {
6225
	version: "1.11.4",
6226
	defaultElement: "<button>",
6227
	options: {
6228
		disabled: null,
6229
		text: true,
6230
		label: null,
6231
		icons: {
6232
			primary: null,
6233
			secondary: null
6234
		}
6235
	},
6236
	_create: function() {
6237
		this.element.closest( "form" )
6238
			.unbind( "reset" + this.eventNamespace )
6239
			.bind( "reset" + this.eventNamespace, formResetHandler );
6240
6241
		if ( typeof this.options.disabled !== "boolean" ) {
6242
			this.options.disabled = !!this.element.prop( "disabled" );
6243
		} else {
6244
			this.element.prop( "disabled", this.options.disabled );
6245
		}
6246
6247
		this._determineButtonType();
6248
		this.hasTitle = !!this.buttonElement.attr( "title" );
6249
6250
		var that = this,
6251
			options = this.options,
6252
			toggleButton = this.type === "checkbox" || this.type === "radio",
6253
			activeClass = !toggleButton ? "ui-state-active" : "";
6254
6255
		if ( options.label === null ) {
6256
			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
6257
		}
6258
6259
		this._hoverable( this.buttonElement );
6260
6261
		this.buttonElement
6262
			.addClass( baseClasses )
6263
			.attr( "role", "button" )
6264
			.bind( "mouseenter" + this.eventNamespace, function() {
6265
				if ( options.disabled ) {
6266
					return;
6267
				}
6268
				if ( this === lastActive ) {
6269
					$( this ).addClass( "ui-state-active" );
6270
				}
6271
			})
6272
			.bind( "mouseleave" + this.eventNamespace, function() {
6273
				if ( options.disabled ) {
6274
					return;
6275
				}
6276
				$( this ).removeClass( activeClass );
6277
			})
6278
			.bind( "click" + this.eventNamespace, function( event ) {
6279
				if ( options.disabled ) {
6280
					event.preventDefault();
6281
					event.stopImmediatePropagation();
6282
				}
6283
			});
6284
6285
		// Can't use _focusable() because the element that receives focus
6286
		// and the element that gets the ui-state-focus class are different
6287
		this._on({
6288
			focus: function() {
6289
				this.buttonElement.addClass( "ui-state-focus" );
6290
			},
6291
			blur: function() {
6292
				this.buttonElement.removeClass( "ui-state-focus" );
6293
			}
6294
		});
6295
6296
		if ( toggleButton ) {
6297
			this.element.bind( "change" + this.eventNamespace, function() {
6298
				that.refresh();
6299
			});
6300
		}
6301
6302
		if ( this.type === "checkbox" ) {
6303
			this.buttonElement.bind( "click" + this.eventNamespace, function() {
6304
				if ( options.disabled ) {
6305
					return false;
6306
				}
6307
			});
6308
		} else if ( this.type === "radio" ) {
6309
			this.buttonElement.bind( "click" + this.eventNamespace, function() {
6310
				if ( options.disabled ) {
6311
					return false;
6312
				}
6313
				$( this ).addClass( "ui-state-active" );
6314
				that.buttonElement.attr( "aria-pressed", "true" );
6315
6316
				var radio = that.element[ 0 ];
6317
				radioGroup( radio )
6318
					.not( radio )
6319
					.map(function() {
6320
						return $( this ).button( "widget" )[ 0 ];
6321
					})
6322
					.removeClass( "ui-state-active" )
6323
					.attr( "aria-pressed", "false" );
6324
			});
6325
		} else {
6326
			this.buttonElement
6327
				.bind( "mousedown" + this.eventNamespace, function() {
6328
					if ( options.disabled ) {
6329
						return false;
6330
					}
6331
					$( this ).addClass( "ui-state-active" );
6332
					lastActive = this;
6333
					that.document.one( "mouseup", function() {
6334
						lastActive = null;
6335
					});
6336
				})
6337
				.bind( "mouseup" + this.eventNamespace, function() {
6338
					if ( options.disabled ) {
6339
						return false;
6340
					}
6341
					$( this ).removeClass( "ui-state-active" );
6342
				})
6343
				.bind( "keydown" + this.eventNamespace, function(event) {
6344
					if ( options.disabled ) {
6345
						return false;
6346
					}
6347
					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
6348
						$( this ).addClass( "ui-state-active" );
6349
					}
6350
				})
6351
				// see #8559, we bind to blur here in case the button element loses
6352
				// focus between keydown and keyup, it would be left in an "active" state
6353
				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
6354
					$( this ).removeClass( "ui-state-active" );
6355
				});
6356
6357
			if ( this.buttonElement.is("a") ) {
6358
				this.buttonElement.keyup(function(event) {
6359
					if ( event.keyCode === $.ui.keyCode.SPACE ) {
6360
						// TODO pass through original event correctly (just as 2nd argument doesn't work)
6361
						$( this ).click();
6362
					}
6363
				});
6364
			}
6365
		}
6366
6367
		this._setOption( "disabled", options.disabled );
6368
		this._resetButton();
6369
	},
6370
6371
	_determineButtonType: function() {
6372
		var ancestor, labelSelector, checked;
6373
6374
		if ( this.element.is("[type=checkbox]") ) {
6375
			this.type = "checkbox";
6376
		} else if ( this.element.is("[type=radio]") ) {
6377
			this.type = "radio";
6378
		} else if ( this.element.is("input") ) {
6379
			this.type = "input";
6380
		} else {
6381
			this.type = "button";
6382
		}
6383
6384
		if ( this.type === "checkbox" || this.type === "radio" ) {
6385
			// we don't search against the document in case the element
6386
			// is disconnected from the DOM
6387
			ancestor = this.element.parents().last();
6388
			labelSelector = "label[for='" + this.element.attr("id") + "']";
6389
			this.buttonElement = ancestor.find( labelSelector );
6390
			if ( !this.buttonElement.length ) {
6391
				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
6392
				this.buttonElement = ancestor.filter( labelSelector );
6393
				if ( !this.buttonElement.length ) {
6394
					this.buttonElement = ancestor.find( labelSelector );
6395
				}
6396
			}
6397
			this.element.addClass( "ui-helper-hidden-accessible" );
6398
6399
			checked = this.element.is( ":checked" );
6400
			if ( checked ) {
6401
				this.buttonElement.addClass( "ui-state-active" );
6402
			}
6403
			this.buttonElement.prop( "aria-pressed", checked );
6404
		} else {
6405
			this.buttonElement = this.element;
6406
		}
6407
	},
6408
6409
	widget: function() {
6410
		return this.buttonElement;
6411
	},
6412
6413
	_destroy: function() {
6414
		this.element
6415
			.removeClass( "ui-helper-hidden-accessible" );
6416
		this.buttonElement
6417
			.removeClass( baseClasses + " ui-state-active " + typeClasses )
6418
			.removeAttr( "role" )
6419
			.removeAttr( "aria-pressed" )
6420
			.html( this.buttonElement.find(".ui-button-text").html() );
6421
6422
		if ( !this.hasTitle ) {
6423
			this.buttonElement.removeAttr( "title" );
6424
		}
6425
	},
6426
6427
	_setOption: function( key, value ) {
6428
		this._super( key, value );
6429
		if ( key === "disabled" ) {
6430
			this.widget().toggleClass( "ui-state-disabled", !!value );
6431
			this.element.prop( "disabled", !!value );
6432
			if ( value ) {
6433
				if ( this.type === "checkbox" || this.type === "radio" ) {
6434
					this.buttonElement.removeClass( "ui-state-focus" );
6435
				} else {
6436
					this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
6437
				}
6438
			}
6439
			return;
6440
		}
6441
		this._resetButton();
6442
	},
6443
6444
	refresh: function() {
6445
		//See #8237 & #8828
6446
		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
6447
6448
		if ( isDisabled !== this.options.disabled ) {
6449
			this._setOption( "disabled", isDisabled );
6450
		}
6451
		if ( this.type === "radio" ) {
6452
			radioGroup( this.element[0] ).each(function() {
6453
				if ( $( this ).is( ":checked" ) ) {
6454
					$( this ).button( "widget" )
6455
						.addClass( "ui-state-active" )
6456
						.attr( "aria-pressed", "true" );
6457
				} else {
6458
					$( this ).button( "widget" )
6459
						.removeClass( "ui-state-active" )
6460
						.attr( "aria-pressed", "false" );
6461
				}
6462
			});
6463
		} else if ( this.type === "checkbox" ) {
6464
			if ( this.element.is( ":checked" ) ) {
6465
				this.buttonElement
6466
					.addClass( "ui-state-active" )
6467
					.attr( "aria-pressed", "true" );
6468
			} else {
6469
				this.buttonElement
6470
					.removeClass( "ui-state-active" )
6471
					.attr( "aria-pressed", "false" );
6472
			}
6473
		}
6474
	},
6475
6476
	_resetButton: function() {
6477
		if ( this.type === "input" ) {
6478
			if ( this.options.label ) {
6479
				this.element.val( this.options.label );
6480
			}
6481
			return;
6482
		}
6483
		var buttonElement = this.buttonElement.removeClass( typeClasses ),
6484
			buttonText = $( "<span></span>", this.document[0] )
6485
				.addClass( "ui-button-text" )
6486
				.html( this.options.label )
6487
				.appendTo( buttonElement.empty() )
6488
				.text(),
6489
			icons = this.options.icons,
6490
			multipleIcons = icons.primary && icons.secondary,
6491
			buttonClasses = [];
6492
6493
		if ( icons.primary || icons.secondary ) {
6494
			if ( this.options.text ) {
6495
				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
6496
			}
6497
6498
			if ( icons.primary ) {
6499
				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
6500
			}
6501
6502
			if ( icons.secondary ) {
6503
				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
6504
			}
6505
6506
			if ( !this.options.text ) {
6507
				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
6508
6509
				if ( !this.hasTitle ) {
6510
					buttonElement.attr( "title", $.trim( buttonText ) );
6511
				}
6512
			}
6513
		} else {
6514
			buttonClasses.push( "ui-button-text-only" );
6515
		}
6516
		buttonElement.addClass( buttonClasses.join( " " ) );
6517
	}
6518
});
6519
6520
$.widget( "ui.buttonset", {
6521
	version: "1.11.4",
6522
	options: {
6523
		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
6524
	},
6525
6526
	_create: function() {
6527
		this.element.addClass( "ui-buttonset" );
6528
	},
6529
6530
	_init: function() {
6531
		this.refresh();
6532
	},
6533
6534
	_setOption: function( key, value ) {
6535
		if ( key === "disabled" ) {
6536
			this.buttons.button( "option", key, value );
6537
		}
6538
6539
		this._super( key, value );
6540
	},
6541
6542
	refresh: function() {
6543
		var rtl = this.element.css( "direction" ) === "rtl",
6544
			allButtons = this.element.find( this.options.items ),
6545
			existingButtons = allButtons.filter( ":ui-button" );
6546
6547
		// Initialize new buttons
6548
		allButtons.not( ":ui-button" ).button();
6549
6550
		// Refresh existing buttons
6551
		existingButtons.button( "refresh" );
6552
6553
		this.buttons = allButtons
6554
			.map(function() {
6555
				return $( this ).button( "widget" )[ 0 ];
6556
			})
6557
				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
6558
				.filter( ":first" )
6559
					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
6560
				.end()
6561
				.filter( ":last" )
6562
					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
6563
				.end()
6564
			.end();
6565
	},
6566
6567
	_destroy: function() {
6568
		this.element.removeClass( "ui-buttonset" );
6569
		this.buttons
6570
			.map(function() {
6571
				return $( this ).button( "widget" )[ 0 ];
6572
			})
6573
				.removeClass( "ui-corner-left ui-corner-right" )
6574
			.end()
6575
			.button( "destroy" );
6576
	}
6577
});
6578
6579
var button = $.ui.button;
6580
6581
6582
/*!
6583
 * jQuery UI Datepicker 1.11.4
6584
 * http://jqueryui.com
6585
 *
6586
 * Copyright jQuery Foundation and other contributors
6587
 * Released under the MIT license.
6588
 * http://jquery.org/license
6589
 *
6590
 * http://api.jqueryui.com/datepicker/
6591
 */
6592
6593
6594
$.extend($.ui, { datepicker: { version: "1.11.4" } });
6595
6596
var datepicker_instActive;
6597
6598
function datepicker_getZindex( elem ) {
6599
	var position, value;
6600
	while ( elem.length && elem[ 0 ] !== document ) {
6601
		// Ignore z-index if position is set to a value where z-index is ignored by the browser
6602
		// This makes behavior of this function consistent across browsers
6603
		// WebKit always returns auto if the element is positioned
6604
		position = elem.css( "position" );
6605
		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
6606
			// IE returns 0 when zIndex is not specified
6607
			// other browsers return a string
6608
			// we ignore the case of nested elements with an explicit value of 0
6609
			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
6610
			value = parseInt( elem.css( "zIndex" ), 10 );
6611
			if ( !isNaN( value ) && value !== 0 ) {
6612
				return value;
6613
			}
6614
		}
6615
		elem = elem.parent();
6616
	}
6617
6618
	return 0;
6619
}
6620
/* Date picker manager.
6621
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
6622
   Settings for (groups of) date pickers are maintained in an instance object,
6623
   allowing multiple different settings on the same page. */
6624
6625
function Datepicker() {
6626
	this._curInst = null; // The current instance in use
6627
	this._keyEvent = false; // If the last event was a key event
6628
	this._disabledInputs = []; // List of date picker inputs that have been disabled
6629
	this._datepickerShowing = false; // True if the popup picker is showing , false if not
6630
	this._inDialog = false; // True if showing within a "dialog", false if not
6631
	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
6632
	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
6633
	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
6634
	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
6635
	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
6636
	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
6637
	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
6638
	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
6639
	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
6640
	this.regional = []; // Available regional settings, indexed by language code
6641
	this.regional[""] = { // Default regional settings
6642
		closeText: "Done", // Display text for close link
6643
		prevText: "Prev", // Display text for previous month link
6644
		nextText: "Next", // Display text for next month link
6645
		currentText: "Today", // Display text for current month link
6646
		monthNames: ["January","February","March","April","May","June",
6647
			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
6648
		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
6649
		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
6650
		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
6651
		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
6652
		weekHeader: "Wk", // Column header for week of the year
6653
		dateFormat: "mm/dd/yy", // See format options on parseDate
6654
		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
6655
		isRTL: false, // True if right-to-left language, false if left-to-right
6656
		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
6657
		yearSuffix: "" // Additional text to append to the year in the month headers
6658
	};
6659
	this._defaults = { // Global defaults for all the date picker instances
6660
		showOn: "focus", // "focus" for popup on focus,
6661
			// "button" for trigger button, or "both" for either
6662
		showAnim: "fadeIn", // Name of jQuery animation for popup
6663
		showOptions: {}, // Options for enhanced animations
6664
		defaultDate: null, // Used when field is blank: actual date,
6665
			// +/-number for offset from today, null for today
6666
		appendText: "", // Display text following the input box, e.g. showing the format
6667
		buttonText: "...", // Text for trigger button
6668
		buttonImage: "", // URL for trigger button image
6669
		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
6670
		hideIfNoPrevNext: false, // True to hide next/previous month links
6671
			// if not applicable, false to just disable them
6672
		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
6673
		gotoCurrent: false, // True if today link goes back to current selection instead
6674
		changeMonth: false, // True if month can be selected directly, false if only prev/next
6675
		changeYear: false, // True if year can be selected directly, false if only prev/next
6676
		yearRange: "c-10:c+10", // Range of years to display in drop-down,
6677
			// either relative to today's year (-nn:+nn), relative to currently displayed year
6678
			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
6679
		showOtherMonths: false, // True to show dates in other months, false to leave blank
6680
		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
6681
		showWeek: false, // True to show week of the year, false to not show it
6682
		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
6683
			// takes a Date and returns the number of the week for it
6684
		shortYearCutoff: "+10", // Short year values < this are in the current century,
6685
			// > this are in the previous century,
6686
			// string value starting with "+" for current year + value
6687
		minDate: null, // The earliest selectable date, or null for no limit
6688
		maxDate: null, // The latest selectable date, or null for no limit
6689
		duration: "fast", // Duration of display/closure
6690
		beforeShowDay: null, // Function that takes a date and returns an array with
6691
			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
6692
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
6693
		beforeShow: null, // Function that takes an input field and
6694
			// returns a set of custom settings for the date picker
6695
		onSelect: null, // Define a callback function when a date is selected
6696
		onChangeMonthYear: null, // Define a callback function when the month or year is changed
6697
		onClose: null, // Define a callback function when the datepicker is closed
6698
		numberOfMonths: 1, // Number of months to show at a time
6699
		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
6700
		stepMonths: 1, // Number of months to step back/forward
6701
		stepBigMonths: 12, // Number of months to step back/forward for the big links
6702
		altField: "", // Selector for an alternate field to store selected dates into
6703
		altFormat: "", // The date format to use for the alternate field
6704
		constrainInput: true, // The input is constrained by the current date format
6705
		showButtonPanel: false, // True to show button panel, false to not show it
6706
		autoSize: false, // True to size the input for the date format, false to leave as is
6707
		disabled: false // The initial disabled state
6708
	};
6709
	$.extend(this._defaults, this.regional[""]);
6710
	this.regional.en = $.extend( true, {}, this.regional[ "" ]);
6711
	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
6712
	this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
6713
}
6714
6715
$.extend(Datepicker.prototype, {
6716
	/* Class name added to elements to indicate already configured with a date picker. */
6717
	markerClassName: "hasDatepicker",
6718
6719
	//Keep track of the maximum number of rows displayed (see #7043)
6720
	maxRows: 4,
6721
6722
	// TODO rename to "widget" when switching to widget factory
6723
	_widgetDatepicker: function() {
6724
		return this.dpDiv;
6725
	},
6726
6727
	/* Override the default settings for all instances of the date picker.
6728
	 * @param  settings  object - the new settings to use as defaults (anonymous object)
6729
	 * @return the manager object
6730
	 */
6731
	setDefaults: function(settings) {
6732
		datepicker_extendRemove(this._defaults, settings || {});
6733
		return this;
6734
	},
6735
6736
	/* Attach the date picker to a jQuery selection.
6737
	 * @param  target	element - the target input field or division or span
6738
	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
6739
	 */
6740
	_attachDatepicker: function(target, settings) {
6741
		var nodeName, inline, inst;
6742
		nodeName = target.nodeName.toLowerCase();
6743
		inline = (nodeName === "div" || nodeName === "span");
6744
		if (!target.id) {
6745
			this.uuid += 1;
6746
			target.id = "dp" + this.uuid;
6747
		}
6748
		inst = this._newInst($(target), inline);
6749
		inst.settings = $.extend({}, settings || {});
6750
		if (nodeName === "input") {
6751
			this._connectDatepicker(target, inst);
6752
		} else if (inline) {
6753
			this._inlineDatepicker(target, inst);
6754
		}
6755
	},
6756
6757
	/* Create a new instance object. */
6758
	_newInst: function(target, inline) {
6759
		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
6760
		return {id: id, input: target, // associated target
6761
			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
6762
			drawMonth: 0, drawYear: 0, // month being drawn
6763
			inline: inline, // is datepicker inline or not
6764
			dpDiv: (!inline ? this.dpDiv : // presentation div
6765
			datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
6766
	},
6767
6768
	/* Attach the date picker to an input field. */
6769
	_connectDatepicker: function(target, inst) {
6770
		var input = $(target);
6771
		inst.append = $([]);
6772
		inst.trigger = $([]);
6773
		if (input.hasClass(this.markerClassName)) {
6774
			return;
6775
		}
6776
		this._attachments(input, inst);
6777
		input.addClass(this.markerClassName).keydown(this._doKeyDown).
6778
			keypress(this._doKeyPress).keyup(this._doKeyUp);
6779
		this._autoSize(inst);
6780
		$.data(target, "datepicker", inst);
6781
		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
6782
		if( inst.settings.disabled ) {
6783
			this._disableDatepicker( target );
6784
		}
6785
	},
6786
6787
	/* Make attachments based on settings. */
6788
	_attachments: function(input, inst) {
6789
		var showOn, buttonText, buttonImage,
6790
			appendText = this._get(inst, "appendText"),
6791
			isRTL = this._get(inst, "isRTL");
6792
6793
		if (inst.append) {
6794
			inst.append.remove();
6795
		}
6796
		if (appendText) {
6797
			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
6798
			input[isRTL ? "before" : "after"](inst.append);
6799
		}
6800
6801
		input.unbind("focus", this._showDatepicker);
6802
6803
		if (inst.trigger) {
6804
			inst.trigger.remove();
6805
		}
6806
6807
		showOn = this._get(inst, "showOn");
6808
		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
6809
			input.focus(this._showDatepicker);
6810
		}
6811
		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
6812
			buttonText = this._get(inst, "buttonText");
6813
			buttonImage = this._get(inst, "buttonImage");
6814
			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
6815
				$("<img/>").addClass(this._triggerClass).
6816
					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
6817
				$("<button type='button'></button>").addClass(this._triggerClass).
6818
					html(!buttonImage ? buttonText : $("<img/>").attr(
6819
					{ src:buttonImage, alt:buttonText, title:buttonText })));
6820
			input[isRTL ? "before" : "after"](inst.trigger);
6821
			inst.trigger.click(function() {
6822
				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
6823
					$.datepicker._hideDatepicker();
6824
				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
6825
					$.datepicker._hideDatepicker();
6826
					$.datepicker._showDatepicker(input[0]);
6827
				} else {
6828
					$.datepicker._showDatepicker(input[0]);
6829
				}
6830
				return false;
6831
			});
6832
		}
6833
	},
6834
6835
	/* Apply the maximum length for the date format. */
6836
	_autoSize: function(inst) {
6837
		if (this._get(inst, "autoSize") && !inst.inline) {
6838
			var findMax, max, maxI, i,
6839
				date = new Date(2009, 12 - 1, 20), // Ensure double digits
6840
				dateFormat = this._get(inst, "dateFormat");
6841
6842
			if (dateFormat.match(/[DM]/)) {
6843
				findMax = function(names) {
6844
					max = 0;
6845
					maxI = 0;
6846
					for (i = 0; i < names.length; i++) {
6847
						if (names[i].length > max) {
6848
							max = names[i].length;
6849
							maxI = i;
6850
						}
6851
					}
6852
					return maxI;
6853
				};
6854
				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
6855
					"monthNames" : "monthNamesShort"))));
6856
				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
6857
					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
6858
			}
6859
			inst.input.attr("size", this._formatDate(inst, date).length);
6860
		}
6861
	},
6862
6863
	/* Attach an inline date picker to a div. */
6864
	_inlineDatepicker: function(target, inst) {
6865
		var divSpan = $(target);
6866
		if (divSpan.hasClass(this.markerClassName)) {
6867
			return;
6868
		}
6869
		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
6870
		$.data(target, "datepicker", inst);
6871
		this._setDate(inst, this._getDefaultDate(inst), true);
6872
		this._updateDatepicker(inst);
6873
		this._updateAlternate(inst);
6874
		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
6875
		if( inst.settings.disabled ) {
6876
			this._disableDatepicker( target );
6877
		}
6878
		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
6879
		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
6880
		inst.dpDiv.css( "display", "block" );
6881
	},
6882
6883
	/* Pop-up the date picker in a "dialog" box.
6884
	 * @param  input element - ignored
6885
	 * @param  date	string or Date - the initial date to display
6886
	 * @param  onSelect  function - the function to call when a date is selected
6887
	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
6888
	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
6889
	 *					event - with x/y coordinates or
6890
	 *					leave empty for default (screen centre)
6891
	 * @return the manager object
6892
	 */
6893
	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
6894
		var id, browserWidth, browserHeight, scrollX, scrollY,
6895
			inst = this._dialogInst; // internal instance
6896
6897
		if (!inst) {
6898
			this.uuid += 1;
6899
			id = "dp" + this.uuid;
6900
			this._dialogInput = $("<input type='text' id='" + id +
6901
				"' style='position: absolute; top: -100px; width: 0px;'/>");
6902
			this._dialogInput.keydown(this._doKeyDown);
6903
			$("body").append(this._dialogInput);
6904
			inst = this._dialogInst = this._newInst(this._dialogInput, false);
6905
			inst.settings = {};
6906
			$.data(this._dialogInput[0], "datepicker", inst);
6907
		}
6908
		datepicker_extendRemove(inst.settings, settings || {});
6909
		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
6910
		this._dialogInput.val(date);
6911
6912
		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
6913
		if (!this._pos) {
6914
			browserWidth = document.documentElement.clientWidth;
6915
			browserHeight = document.documentElement.clientHeight;
6916
			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
6917
			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
6918
			this._pos = // should use actual width/height below
6919
				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
6920
		}
6921
6922
		// move input on screen for focus, but hidden behind dialog
6923
		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
6924
		inst.settings.onSelect = onSelect;
6925
		this._inDialog = true;
6926
		this.dpDiv.addClass(this._dialogClass);
6927
		this._showDatepicker(this._dialogInput[0]);
6928
		if ($.blockUI) {
6929
			$.blockUI(this.dpDiv);
6930
		}
6931
		$.data(this._dialogInput[0], "datepicker", inst);
6932
		return this;
6933
	},
6934
6935
	/* Detach a datepicker from its control.
6936
	 * @param  target	element - the target input field or division or span
6937
	 */
6938
	_destroyDatepicker: function(target) {
6939
		var nodeName,
6940
			$target = $(target),
6941
			inst = $.data(target, "datepicker");
6942
6943
		if (!$target.hasClass(this.markerClassName)) {
6944
			return;
6945
		}
6946
6947
		nodeName = target.nodeName.toLowerCase();
6948
		$.removeData(target, "datepicker");
6949
		if (nodeName === "input") {
6950
			inst.append.remove();
6951
			inst.trigger.remove();
6952
			$target.removeClass(this.markerClassName).
6953
				unbind("focus", this._showDatepicker).
6954
				unbind("keydown", this._doKeyDown).
6955
				unbind("keypress", this._doKeyPress).
6956
				unbind("keyup", this._doKeyUp);
6957
		} else if (nodeName === "div" || nodeName === "span") {
6958
			$target.removeClass(this.markerClassName).empty();
6959
		}
6960
6961
		if ( datepicker_instActive === inst ) {
6962
			datepicker_instActive = null;
6963
		}
6964
	},
6965
6966
	/* Enable the date picker to a jQuery selection.
6967
	 * @param  target	element - the target input field or division or span
6968
	 */
6969
	_enableDatepicker: function(target) {
6970
		var nodeName, inline,
6971
			$target = $(target),
6972
			inst = $.data(target, "datepicker");
6973
6974
		if (!$target.hasClass(this.markerClassName)) {
6975
			return;
6976
		}
6977
6978
		nodeName = target.nodeName.toLowerCase();
6979
		if (nodeName === "input") {
6980
			target.disabled = false;
6981
			inst.trigger.filter("button").
6982
				each(function() { this.disabled = false; }).end().
6983
				filter("img").css({opacity: "1.0", cursor: ""});
6984
		} else if (nodeName === "div" || nodeName === "span") {
6985
			inline = $target.children("." + this._inlineClass);
6986
			inline.children().removeClass("ui-state-disabled");
6987
			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
6988
				prop("disabled", false);
6989
		}
6990
		this._disabledInputs = $.map(this._disabledInputs,
6991
			function(value) { return (value === target ? null : value); }); // delete entry
6992
	},
6993
6994
	/* Disable the date picker to a jQuery selection.
6995
	 * @param  target	element - the target input field or division or span
6996
	 */
6997
	_disableDatepicker: function(target) {
6998
		var nodeName, inline,
6999
			$target = $(target),
7000
			inst = $.data(target, "datepicker");
7001
7002
		if (!$target.hasClass(this.markerClassName)) {
7003
			return;
7004
		}
7005
7006
		nodeName = target.nodeName.toLowerCase();
7007
		if (nodeName === "input") {
7008
			target.disabled = true;
7009
			inst.trigger.filter("button").
7010
				each(function() { this.disabled = true; }).end().
7011
				filter("img").css({opacity: "0.5", cursor: "default"});
7012
		} else if (nodeName === "div" || nodeName === "span") {
7013
			inline = $target.children("." + this._inlineClass);
7014
			inline.children().addClass("ui-state-disabled");
7015
			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
7016
				prop("disabled", true);
7017
		}
7018
		this._disabledInputs = $.map(this._disabledInputs,
7019
			function(value) { return (value === target ? null : value); }); // delete entry
7020
		this._disabledInputs[this._disabledInputs.length] = target;
7021
	},
7022
7023
	/* Is the first field in a jQuery collection disabled as a datepicker?
7024
	 * @param  target	element - the target input field or division or span
7025
	 * @return boolean - true if disabled, false if enabled
7026
	 */
7027
	_isDisabledDatepicker: function(target) {
7028
		if (!target) {
7029
			return false;
7030
		}
7031
		for (var i = 0; i < this._disabledInputs.length; i++) {
7032
			if (this._disabledInputs[i] === target) {
7033
				return true;
7034
			}
7035
		}
7036
		return false;
7037
	},
7038
7039
	/* Retrieve the instance data for the target control.
7040
	 * @param  target  element - the target input field or division or span
7041
	 * @return  object - the associated instance data
7042
	 * @throws  error if a jQuery problem getting data
7043
	 */
7044
	_getInst: function(target) {
7045
		try {
7046
			return $.data(target, "datepicker");
7047
		}
7048
		catch (err) {
7049
			throw "Missing instance data for this datepicker";
7050
		}
7051
	},
7052
7053
	/* Update or retrieve the settings for a date picker attached to an input field or division.
7054
	 * @param  target  element - the target input field or division or span
7055
	 * @param  name	object - the new settings to update or
7056
	 *				string - the name of the setting to change or retrieve,
7057
	 *				when retrieving also "all" for all instance settings or
7058
	 *				"defaults" for all global defaults
7059
	 * @param  value   any - the new value for the setting
7060
	 *				(omit if above is an object or to retrieve a value)
7061
	 */
7062
	_optionDatepicker: function(target, name, value) {
7063
		var settings, date, minDate, maxDate,
7064
			inst = this._getInst(target);
7065
7066
		if (arguments.length === 2 && typeof name === "string") {
7067
			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
7068
				(inst ? (name === "all" ? $.extend({}, inst.settings) :
7069
				this._get(inst, name)) : null));
7070
		}
7071
7072
		settings = name || {};
7073
		if (typeof name === "string") {
7074
			settings = {};
7075
			settings[name] = value;
7076
		}
7077
7078
		if (inst) {
7079
			if (this._curInst === inst) {
7080
				this._hideDatepicker();
7081
			}
7082
7083
			date = this._getDateDatepicker(target, true);
7084
			minDate = this._getMinMaxDate(inst, "min");
7085
			maxDate = this._getMinMaxDate(inst, "max");
7086
			datepicker_extendRemove(inst.settings, settings);
7087
			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
7088
			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
7089
				inst.settings.minDate = this._formatDate(inst, minDate);
7090
			}
7091
			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
7092
				inst.settings.maxDate = this._formatDate(inst, maxDate);
7093
			}
7094
			if ( "disabled" in settings ) {
7095
				if ( settings.disabled ) {
7096
					this._disableDatepicker(target);
7097
				} else {
7098
					this._enableDatepicker(target);
7099
				}
7100
			}
7101
			this._attachments($(target), inst);
7102
			this._autoSize(inst);
7103
			this._setDate(inst, date);
7104
			this._updateAlternate(inst);
7105
			this._updateDatepicker(inst);
7106
		}
7107
	},
7108
7109
	// change method deprecated
7110
	_changeDatepicker: function(target, name, value) {
7111
		this._optionDatepicker(target, name, value);
7112
	},
7113
7114
	/* Redraw the date picker attached to an input field or division.
7115
	 * @param  target  element - the target input field or division or span
7116
	 */
7117
	_refreshDatepicker: function(target) {
7118
		var inst = this._getInst(target);
7119
		if (inst) {
7120
			this._updateDatepicker(inst);
7121
		}
7122
	},
7123
7124
	/* Set the dates for a jQuery selection.
7125
	 * @param  target element - the target input field or division or span
7126
	 * @param  date	Date - the new date
7127
	 */
7128
	_setDateDatepicker: function(target, date) {
7129
		var inst = this._getInst(target);
7130
		if (inst) {
7131
			this._setDate(inst, date);
7132
			this._updateDatepicker(inst);
7133
			this._updateAlternate(inst);
7134
		}
7135
	},
7136
7137
	/* Get the date(s) for the first entry in a jQuery selection.
7138
	 * @param  target element - the target input field or division or span
7139
	 * @param  noDefault boolean - true if no default date is to be used
7140
	 * @return Date - the current date
7141
	 */
7142
	_getDateDatepicker: function(target, noDefault) {
7143
		var inst = this._getInst(target);
7144
		if (inst && !inst.inline) {
7145
			this._setDateFromField(inst, noDefault);
7146
		}
7147
		return (inst ? this._getDate(inst) : null);
7148
	},
7149
7150
	/* Handle keystrokes. */
7151
	_doKeyDown: function(event) {
7152
		var onSelect, dateStr, sel,
7153
			inst = $.datepicker._getInst(event.target),
7154
			handled = true,
7155
			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
7156
7157
		inst._keyEvent = true;
7158
		if ($.datepicker._datepickerShowing) {
7159
			switch (event.keyCode) {
7160
				case 9: $.datepicker._hideDatepicker();
7161
						handled = false;
7162
						break; // hide on tab out
7163
				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
7164
									$.datepicker._currentClass + ")", inst.dpDiv);
7165
						if (sel[0]) {
7166
							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
7167
						}
7168
7169
						onSelect = $.datepicker._get(inst, "onSelect");
7170
						if (onSelect) {
7171
							dateStr = $.datepicker._formatDate(inst);
7172
7173
							// trigger custom callback
7174
							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
7175
						} else {
7176
							$.datepicker._hideDatepicker();
7177
						}
7178
7179
						return false; // don't submit the form
7180
				case 27: $.datepicker._hideDatepicker();
7181
						break; // hide on escape
7182
				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7183
							-$.datepicker._get(inst, "stepBigMonths") :
7184
							-$.datepicker._get(inst, "stepMonths")), "M");
7185
						break; // previous month/year on page up/+ ctrl
7186
				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7187
							+$.datepicker._get(inst, "stepBigMonths") :
7188
							+$.datepicker._get(inst, "stepMonths")), "M");
7189
						break; // next month/year on page down/+ ctrl
7190
				case 35: if (event.ctrlKey || event.metaKey) {
7191
							$.datepicker._clearDate(event.target);
7192
						}
7193
						handled = event.ctrlKey || event.metaKey;
7194
						break; // clear on ctrl or command +end
7195
				case 36: if (event.ctrlKey || event.metaKey) {
7196
							$.datepicker._gotoToday(event.target);
7197
						}
7198
						handled = event.ctrlKey || event.metaKey;
7199
						break; // current on ctrl or command +home
7200
				case 37: if (event.ctrlKey || event.metaKey) {
7201
							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
7202
						}
7203
						handled = event.ctrlKey || event.metaKey;
7204
						// -1 day on ctrl or command +left
7205
						if (event.originalEvent.altKey) {
7206
							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
7207
								-$.datepicker._get(inst, "stepBigMonths") :
7208
								-$.datepicker._get(inst, "stepMonths")), "M");
7209
						}
7210
						// next month/year on alt +left on Mac
7211
						break;
7212
				case 38: if (event.ctrlKey || event.metaKey) {
7213
							$.datepicker._adjustDate(event.target, -7, "D");
7214
						}
7215
						handled = event.ctrlKey || event.metaKey;
7216
						break; // -1 week on ctrl or command +up
7217
				case 39: if (event.ctrlKey || event.metaKey) {
7218
							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
7219
						}
7220
						handled = event.ctrlKey || event.metaKey;
7221
						// +1 day on ctrl or command +right
7222
						if (event.originalEvent.altKey) {
7223
							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
7224
								+$.datepicker._get(inst, "stepBigMonths") :
7225
								+$.datepicker._get(inst, "stepMonths")), "M");
7226
						}
7227
						// next month/year on alt +right
7228
						break;
7229
				case 40: if (event.ctrlKey || event.metaKey) {
7230
							$.datepicker._adjustDate(event.target, +7, "D");
7231
						}
7232
						handled = event.ctrlKey || event.metaKey;
7233
						break; // +1 week on ctrl or command +down
7234
				default: handled = false;
7235
			}
7236
		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
7237
			$.datepicker._showDatepicker(this);
7238
		} else {
7239
			handled = false;
7240
		}
7241
7242
		if (handled) {
7243
			event.preventDefault();
7244
			event.stopPropagation();
7245
		}
7246
	},
7247
7248
	/* Filter entered characters - based on date format. */
7249
	_doKeyPress: function(event) {
7250
		var chars, chr,
7251
			inst = $.datepicker._getInst(event.target);
7252
7253
		if ($.datepicker._get(inst, "constrainInput")) {
7254
			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
7255
			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
7256
			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
7257
		}
7258
	},
7259
7260
	/* Synchronise manual entry and field/alternate field. */
7261
	_doKeyUp: function(event) {
7262
		var date,
7263
			inst = $.datepicker._getInst(event.target);
7264
7265
		if (inst.input.val() !== inst.lastVal) {
7266
			try {
7267
				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
7268
					(inst.input ? inst.input.val() : null),
7269
					$.datepicker._getFormatConfig(inst));
7270
7271
				if (date) { // only if valid
7272
					$.datepicker._setDateFromField(inst);
7273
					$.datepicker._updateAlternate(inst);
7274
					$.datepicker._updateDatepicker(inst);
7275
				}
7276
			}
7277
			catch (err) {
7278
			}
7279
		}
7280
		return true;
7281
	},
7282
7283
	/* Pop-up the date picker for a given input field.
7284
	 * If false returned from beforeShow event handler do not show.
7285
	 * @param  input  element - the input field attached to the date picker or
7286
	 *					event - if triggered by focus
7287
	 */
7288
	_showDatepicker: function(input) {
7289
		input = input.target || input;
7290
		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
7291
			input = $("input", input.parentNode)[0];
7292
		}
7293
7294
		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
7295
			return;
7296
		}
7297
7298
		var inst, beforeShow, beforeShowSettings, isFixed,
7299
			offset, showAnim, duration;
7300
7301
		inst = $.datepicker._getInst(input);
7302
		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
7303
			$.datepicker._curInst.dpDiv.stop(true, true);
7304
			if ( inst && $.datepicker._datepickerShowing ) {
7305
				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
7306
			}
7307
		}
7308
7309
		beforeShow = $.datepicker._get(inst, "beforeShow");
7310
		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
7311
		if(beforeShowSettings === false){
7312
			return;
7313
		}
7314
		datepicker_extendRemove(inst.settings, beforeShowSettings);
7315
7316
		inst.lastVal = null;
7317
		$.datepicker._lastInput = input;
7318
		$.datepicker._setDateFromField(inst);
7319
7320
		if ($.datepicker._inDialog) { // hide cursor
7321
			input.value = "";
7322
		}
7323
		if (!$.datepicker._pos) { // position below input
7324
			$.datepicker._pos = $.datepicker._findPos(input);
7325
			$.datepicker._pos[1] += input.offsetHeight; // add the height
7326
		}
7327
7328
		isFixed = false;
7329
		$(input).parents().each(function() {
7330
			isFixed |= $(this).css("position") === "fixed";
7331
			return !isFixed;
7332
		});
7333
7334
		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
7335
		$.datepicker._pos = null;
7336
		//to avoid flashes on Firefox
7337
		inst.dpDiv.empty();
7338
		// determine sizing offscreen
7339
		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
7340
		$.datepicker._updateDatepicker(inst);
7341
		// fix width for dynamic number of date pickers
7342
		// and adjust position before showing
7343
		offset = $.datepicker._checkOffset(inst, offset, isFixed);
7344
		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
7345
			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
7346
			left: offset.left + "px", top: offset.top + "px"});
7347
7348
		if (!inst.inline) {
7349
			showAnim = $.datepicker._get(inst, "showAnim");
7350
			duration = $.datepicker._get(inst, "duration");
7351
			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
7352
			$.datepicker._datepickerShowing = true;
7353
7354
			if ( $.effects && $.effects.effect[ showAnim ] ) {
7355
				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
7356
			} else {
7357
				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
7358
			}
7359
7360
			if ( $.datepicker._shouldFocusInput( inst ) ) {
7361
				inst.input.focus();
7362
			}
7363
7364
			$.datepicker._curInst = inst;
7365
		}
7366
	},
7367
7368
	/* Generate the date picker content. */
7369
	_updateDatepicker: function(inst) {
7370
		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
7371
		datepicker_instActive = inst; // for delegate hover events
7372
		inst.dpDiv.empty().append(this._generateHTML(inst));
7373
		this._attachHandlers(inst);
7374
7375
		var origyearshtml,
7376
			numMonths = this._getNumberOfMonths(inst),
7377
			cols = numMonths[1],
7378
			width = 17,
7379
			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
7380
7381
		if ( activeCell.length > 0 ) {
7382
			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
7383
		}
7384
7385
		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
7386
		if (cols > 1) {
7387
			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
7388
		}
7389
		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
7390
			"Class"]("ui-datepicker-multi");
7391
		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
7392
			"Class"]("ui-datepicker-rtl");
7393
7394
		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
7395
			inst.input.focus();
7396
		}
7397
7398
		// deffered render of the years select (to avoid flashes on Firefox)
7399
		if( inst.yearshtml ){
7400
			origyearshtml = inst.yearshtml;
7401
			setTimeout(function(){
7402
				//assure that inst.yearshtml didn't change.
7403
				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
7404
					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
7405
				}
7406
				origyearshtml = inst.yearshtml = null;
7407
			}, 0);
7408
		}
7409
	},
7410
7411
	// #6694 - don't focus the input if it's already focused
7412
	// this breaks the change event in IE
7413
	// Support: IE and jQuery <1.9
7414
	_shouldFocusInput: function( inst ) {
7415
		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
7416
	},
7417
7418
	/* Check positioning to remain on screen. */
7419
	_checkOffset: function(inst, offset, isFixed) {
7420
		var dpWidth = inst.dpDiv.outerWidth(),
7421
			dpHeight = inst.dpDiv.outerHeight(),
7422
			inputWidth = inst.input ? inst.input.outerWidth() : 0,
7423
			inputHeight = inst.input ? inst.input.outerHeight() : 0,
7424
			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
7425
			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
7426
7427
		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
7428
		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
7429
		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
7430
7431
		// now check if datepicker is showing outside window viewport - move to a better place if so.
7432
		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
7433
			Math.abs(offset.left + dpWidth - viewWidth) : 0);
7434
		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
7435
			Math.abs(dpHeight + inputHeight) : 0);
7436
7437
		return offset;
7438
	},
7439
7440
	/* Find an object's position on the screen. */
7441
	_findPos: function(obj) {
7442
		var position,
7443
			inst = this._getInst(obj),
7444
			isRTL = this._get(inst, "isRTL");
7445
7446
		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
7447
			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
7448
		}
7449
7450
		position = $(obj).offset();
7451
		return [position.left, position.top];
7452
	},
7453
7454
	/* Hide the date picker from view.
7455
	 * @param  input  element - the input field attached to the date picker
7456
	 */
7457
	_hideDatepicker: function(input) {
7458
		var showAnim, duration, postProcess, onClose,
7459
			inst = this._curInst;
7460
7461
		if (!inst || (input && inst !== $.data(input, "datepicker"))) {
7462
			return;
7463
		}
7464
7465
		if (this._datepickerShowing) {
7466
			showAnim = this._get(inst, "showAnim");
7467
			duration = this._get(inst, "duration");
7468
			postProcess = function() {
7469
				$.datepicker._tidyDialog(inst);
7470
			};
7471
7472
			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
7473
			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
7474
				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
7475
			} else {
7476
				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
7477
					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
7478
			}
7479
7480
			if (!showAnim) {
7481
				postProcess();
7482
			}
7483
			this._datepickerShowing = false;
7484
7485
			onClose = this._get(inst, "onClose");
7486
			if (onClose) {
7487
				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
7488
			}
7489
7490
			this._lastInput = null;
7491
			if (this._inDialog) {
7492
				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
7493
				if ($.blockUI) {
7494
					$.unblockUI();
7495
					$("body").append(this.dpDiv);
7496
				}
7497
			}
7498
			this._inDialog = false;
7499
		}
7500
	},
7501
7502
	/* Tidy up after a dialog display. */
7503
	_tidyDialog: function(inst) {
7504
		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
7505
	},
7506
7507
	/* Close date picker if clicked elsewhere. */
7508
	_checkExternalClick: function(event) {
7509
		if (!$.datepicker._curInst) {
7510
			return;
7511
		}
7512
7513
		var $target = $(event.target),
7514
			inst = $.datepicker._getInst($target[0]);
7515
7516
		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
7517
				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
7518
				!$target.hasClass($.datepicker.markerClassName) &&
7519
				!$target.closest("." + $.datepicker._triggerClass).length &&
7520
				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
7521
			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
7522
				$.datepicker._hideDatepicker();
7523
		}
7524
	},
7525
7526
	/* Adjust one of the date sub-fields. */
7527
	_adjustDate: function(id, offset, period) {
7528
		var target = $(id),
7529
			inst = this._getInst(target[0]);
7530
7531
		if (this._isDisabledDatepicker(target[0])) {
7532
			return;
7533
		}
7534
		this._adjustInstDate(inst, offset +
7535
			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
7536
			period);
7537
		this._updateDatepicker(inst);
7538
	},
7539
7540
	/* Action for current link. */
7541
	_gotoToday: function(id) {
7542
		var date,
7543
			target = $(id),
7544
			inst = this._getInst(target[0]);
7545
7546
		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
7547
			inst.selectedDay = inst.currentDay;
7548
			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
7549
			inst.drawYear = inst.selectedYear = inst.currentYear;
7550
		} else {
7551
			date = new Date();
7552
			inst.selectedDay = date.getDate();
7553
			inst.drawMonth = inst.selectedMonth = date.getMonth();
7554
			inst.drawYear = inst.selectedYear = date.getFullYear();
7555
		}
7556
		this._notifyChange(inst);
7557
		this._adjustDate(target);
7558
	},
7559
7560
	/* Action for selecting a new month/year. */
7561
	_selectMonthYear: function(id, select, period) {
7562
		var target = $(id),
7563
			inst = this._getInst(target[0]);
7564
7565
		inst["selected" + (period === "M" ? "Month" : "Year")] =
7566
		inst["draw" + (period === "M" ? "Month" : "Year")] =
7567
			parseInt(select.options[select.selectedIndex].value,10);
7568
7569
		this._notifyChange(inst);
7570
		this._adjustDate(target);
7571
	},
7572
7573
	/* Action for selecting a day. */
7574
	_selectDay: function(id, month, year, td) {
7575
		var inst,
7576
			target = $(id);
7577
7578
		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
7579
			return;
7580
		}
7581
7582
		inst = this._getInst(target[0]);
7583
		inst.selectedDay = inst.currentDay = $("a", td).html();
7584
		inst.selectedMonth = inst.currentMonth = month;
7585
		inst.selectedYear = inst.currentYear = year;
7586
		this._selectDate(id, this._formatDate(inst,
7587
			inst.currentDay, inst.currentMonth, inst.currentYear));
7588
	},
7589
7590
	/* Erase the input field and hide the date picker. */
7591
	_clearDate: function(id) {
7592
		var target = $(id);
7593
		this._selectDate(target, "");
7594
	},
7595
7596
	/* Update the input field with the selected date. */
7597
	_selectDate: function(id, dateStr) {
7598
		var onSelect,
7599
			target = $(id),
7600
			inst = this._getInst(target[0]);
7601
7602
		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
7603
		if (inst.input) {
7604
			inst.input.val(dateStr);
7605
		}
7606
		this._updateAlternate(inst);
7607
7608
		onSelect = this._get(inst, "onSelect");
7609
		if (onSelect) {
7610
			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
7611
		} else if (inst.input) {
7612
			inst.input.trigger("change"); // fire the change event
7613
		}
7614
7615
		if (inst.inline){
7616
			this._updateDatepicker(inst);
7617
		} else {
7618
			this._hideDatepicker();
7619
			this._lastInput = inst.input[0];
7620
			if (typeof(inst.input[0]) !== "object") {
7621
				inst.input.focus(); // restore focus
7622
			}
7623
			this._lastInput = null;
7624
		}
7625
	},
7626
7627
	/* Update any alternate field to synchronise with the main field. */
7628
	_updateAlternate: function(inst) {
7629
		var altFormat, date, dateStr,
7630
			altField = this._get(inst, "altField");
7631
7632
		if (altField) { // update alternate field too
7633
			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
7634
			date = this._getDate(inst);
7635
			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
7636
			$(altField).each(function() { $(this).val(dateStr); });
7637
		}
7638
	},
7639
7640
	/* Set as beforeShowDay function to prevent selection of weekends.
7641
	 * @param  date  Date - the date to customise
7642
	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
7643
	 */
7644
	noWeekends: function(date) {
7645
		var day = date.getDay();
7646
		return [(day > 0 && day < 6), ""];
7647
	},
7648
7649
	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
7650
	 * @param  date  Date - the date to get the week for
7651
	 * @return  number - the number of the week within the year that contains this date
7652
	 */
7653
	iso8601Week: function(date) {
7654
		var time,
7655
			checkDate = new Date(date.getTime());
7656
7657
		// Find Thursday of this week starting on Monday
7658
		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
7659
7660
		time = checkDate.getTime();
7661
		checkDate.setMonth(0); // Compare with Jan 1
7662
		checkDate.setDate(1);
7663
		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
7664
	},
7665
7666
	/* Parse a string value into a date object.
7667
	 * See formatDate below for the possible formats.
7668
	 *
7669
	 * @param  format string - the expected format of the date
7670
	 * @param  value string - the date in the above format
7671
	 * @param  settings Object - attributes include:
7672
	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
7673
	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
7674
	 *					dayNames		string[7] - names of the days from Sunday (optional)
7675
	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
7676
	 *					monthNames		string[12] - names of the months (optional)
7677
	 * @return  Date - the extracted date value or null if value is blank
7678
	 */
7679
	parseDate: function (format, value, settings) {
7680
		if (format == null || value == null) {
7681
			throw "Invalid arguments";
7682
		}
7683
7684
		value = (typeof value === "object" ? value.toString() : value + "");
7685
		if (value === "") {
7686
			return null;
7687
		}
7688
7689
		var iFormat, dim, extra,
7690
			iValue = 0,
7691
			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
7692
			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
7693
				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
7694
			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
7695
			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
7696
			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
7697
			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
7698
			year = -1,
7699
			month = -1,
7700
			day = -1,
7701
			doy = -1,
7702
			literal = false,
7703
			date,
7704
			// Check whether a format character is doubled
7705
			lookAhead = function(match) {
7706
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7707
				if (matches) {
7708
					iFormat++;
7709
				}
7710
				return matches;
7711
			},
7712
			// Extract a number from the string value
7713
			getNumber = function(match) {
7714
				var isDoubled = lookAhead(match),
7715
					size = (match === "@" ? 14 : (match === "!" ? 20 :
7716
					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
7717
					minSize = (match === "y" ? size : 1),
7718
					digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
7719
					num = value.substring(iValue).match(digits);
7720
				if (!num) {
7721
					throw "Missing number at position " + iValue;
7722
				}
7723
				iValue += num[0].length;
7724
				return parseInt(num[0], 10);
7725
			},
7726
			// Extract a name from the string value and convert to an index
7727
			getName = function(match, shortNames, longNames) {
7728
				var index = -1,
7729
					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
7730
						return [ [k, v] ];
7731
					}).sort(function (a, b) {
7732
						return -(a[1].length - b[1].length);
7733
					});
7734
7735
				$.each(names, function (i, pair) {
7736
					var name = pair[1];
7737
					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
7738
						index = pair[0];
7739
						iValue += name.length;
7740
						return false;
7741
					}
7742
				});
7743
				if (index !== -1) {
7744
					return index + 1;
7745
				} else {
7746
					throw "Unknown name at position " + iValue;
7747
				}
7748
			},
7749
			// Confirm that a literal character matches the string value
7750
			checkLiteral = function() {
7751
				if (value.charAt(iValue) !== format.charAt(iFormat)) {
7752
					throw "Unexpected literal at position " + iValue;
7753
				}
7754
				iValue++;
7755
			};
7756
7757
		for (iFormat = 0; iFormat < format.length; iFormat++) {
7758
			if (literal) {
7759
				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7760
					literal = false;
7761
				} else {
7762
					checkLiteral();
7763
				}
7764
			} else {
7765
				switch (format.charAt(iFormat)) {
7766
					case "d":
7767
						day = getNumber("d");
7768
						break;
7769
					case "D":
7770
						getName("D", dayNamesShort, dayNames);
7771
						break;
7772
					case "o":
7773
						doy = getNumber("o");
7774
						break;
7775
					case "m":
7776
						month = getNumber("m");
7777
						break;
7778
					case "M":
7779
						month = getName("M", monthNamesShort, monthNames);
7780
						break;
7781
					case "y":
7782
						year = getNumber("y");
7783
						break;
7784
					case "@":
7785
						date = new Date(getNumber("@"));
7786
						year = date.getFullYear();
7787
						month = date.getMonth() + 1;
7788
						day = date.getDate();
7789
						break;
7790
					case "!":
7791
						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
7792
						year = date.getFullYear();
7793
						month = date.getMonth() + 1;
7794
						day = date.getDate();
7795
						break;
7796
					case "'":
7797
						if (lookAhead("'")){
7798
							checkLiteral();
7799
						} else {
7800
							literal = true;
7801
						}
7802
						break;
7803
					default:
7804
						checkLiteral();
7805
				}
7806
			}
7807
		}
7808
7809
		if (iValue < value.length){
7810
			extra = value.substr(iValue);
7811
			if (!/^\s+/.test(extra)) {
7812
				throw "Extra/unparsed characters found in date: " + extra;
7813
			}
7814
		}
7815
7816
		if (year === -1) {
7817
			year = new Date().getFullYear();
7818
		} else if (year < 100) {
7819
			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
7820
				(year <= shortYearCutoff ? 0 : -100);
7821
		}
7822
7823
		if (doy > -1) {
7824
			month = 1;
7825
			day = doy;
7826
			do {
7827
				dim = this._getDaysInMonth(year, month - 1);
7828
				if (day <= dim) {
7829
					break;
7830
				}
7831
				month++;
7832
				day -= dim;
7833
			} while (true);
7834
		}
7835
7836
		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
7837
		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
7838
			throw "Invalid date"; // E.g. 31/02/00
7839
		}
7840
		return date;
7841
	},
7842
7843
	/* Standard date formats. */
7844
	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
7845
	COOKIE: "D, dd M yy",
7846
	ISO_8601: "yy-mm-dd",
7847
	RFC_822: "D, d M y",
7848
	RFC_850: "DD, dd-M-y",
7849
	RFC_1036: "D, d M y",
7850
	RFC_1123: "D, d M yy",
7851
	RFC_2822: "D, d M yy",
7852
	RSS: "D, d M y", // RFC 822
7853
	TICKS: "!",
7854
	TIMESTAMP: "@",
7855
	W3C: "yy-mm-dd", // ISO 8601
7856
7857
	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
7858
		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
7859
7860
	/* Format a date object into a string value.
7861
	 * The format can be combinations of the following:
7862
	 * d  - day of month (no leading zero)
7863
	 * dd - day of month (two digit)
7864
	 * o  - day of year (no leading zeros)
7865
	 * oo - day of year (three digit)
7866
	 * D  - day name short
7867
	 * DD - day name long
7868
	 * m  - month of year (no leading zero)
7869
	 * mm - month of year (two digit)
7870
	 * M  - month name short
7871
	 * MM - month name long
7872
	 * y  - year (two digit)
7873
	 * yy - year (four digit)
7874
	 * @ - Unix timestamp (ms since 01/01/1970)
7875
	 * ! - Windows ticks (100ns since 01/01/0001)
7876
	 * "..." - literal text
7877
	 * '' - single quote
7878
	 *
7879
	 * @param  format string - the desired format of the date
7880
	 * @param  date Date - the date value to format
7881
	 * @param  settings Object - attributes include:
7882
	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
7883
	 *					dayNames		string[7] - names of the days from Sunday (optional)
7884
	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
7885
	 *					monthNames		string[12] - names of the months (optional)
7886
	 * @return  string - the date in the above format
7887
	 */
7888
	formatDate: function (format, date, settings) {
7889
		if (!date) {
7890
			return "";
7891
		}
7892
7893
		var iFormat,
7894
			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
7895
			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
7896
			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
7897
			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
7898
			// Check whether a format character is doubled
7899
			lookAhead = function(match) {
7900
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7901
				if (matches) {
7902
					iFormat++;
7903
				}
7904
				return matches;
7905
			},
7906
			// Format a number, with leading zero if necessary
7907
			formatNumber = function(match, value, len) {
7908
				var num = "" + value;
7909
				if (lookAhead(match)) {
7910
					while (num.length < len) {
7911
						num = "0" + num;
7912
					}
7913
				}
7914
				return num;
7915
			},
7916
			// Format a name, short or long as requested
7917
			formatName = function(match, value, shortNames, longNames) {
7918
				return (lookAhead(match) ? longNames[value] : shortNames[value]);
7919
			},
7920
			output = "",
7921
			literal = false;
7922
7923
		if (date) {
7924
			for (iFormat = 0; iFormat < format.length; iFormat++) {
7925
				if (literal) {
7926
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7927
						literal = false;
7928
					} else {
7929
						output += format.charAt(iFormat);
7930
					}
7931
				} else {
7932
					switch (format.charAt(iFormat)) {
7933
						case "d":
7934
							output += formatNumber("d", date.getDate(), 2);
7935
							break;
7936
						case "D":
7937
							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
7938
							break;
7939
						case "o":
7940
							output += formatNumber("o",
7941
								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
7942
							break;
7943
						case "m":
7944
							output += formatNumber("m", date.getMonth() + 1, 2);
7945
							break;
7946
						case "M":
7947
							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
7948
							break;
7949
						case "y":
7950
							output += (lookAhead("y") ? date.getFullYear() :
7951
								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
7952
							break;
7953
						case "@":
7954
							output += date.getTime();
7955
							break;
7956
						case "!":
7957
							output += date.getTime() * 10000 + this._ticksTo1970;
7958
							break;
7959
						case "'":
7960
							if (lookAhead("'")) {
7961
								output += "'";
7962
							} else {
7963
								literal = true;
7964
							}
7965
							break;
7966
						default:
7967
							output += format.charAt(iFormat);
7968
					}
7969
				}
7970
			}
7971
		}
7972
		return output;
7973
	},
7974
7975
	/* Extract all possible characters from the date format. */
7976
	_possibleChars: function (format) {
7977
		var iFormat,
7978
			chars = "",
7979
			literal = false,
7980
			// Check whether a format character is doubled
7981
			lookAhead = function(match) {
7982
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7983
				if (matches) {
7984
					iFormat++;
7985
				}
7986
				return matches;
7987
			};
7988
7989
		for (iFormat = 0; iFormat < format.length; iFormat++) {
7990
			if (literal) {
7991
				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7992
					literal = false;
7993
				} else {
7994
					chars += format.charAt(iFormat);
7995
				}
7996
			} else {
7997
				switch (format.charAt(iFormat)) {
7998
					case "d": case "m": case "y": case "@":
7999
						chars += "0123456789";
8000
						break;
8001
					case "D": case "M":
8002
						return null; // Accept anything
8003
					case "'":
8004
						if (lookAhead("'")) {
8005
							chars += "'";
8006
						} else {
8007
							literal = true;
8008
						}
8009
						break;
8010
					default:
8011
						chars += format.charAt(iFormat);
8012
				}
8013
			}
8014
		}
8015
		return chars;
8016
	},
8017
8018
	/* Get a setting value, defaulting if necessary. */
8019
	_get: function(inst, name) {
8020
		return inst.settings[name] !== undefined ?
8021
			inst.settings[name] : this._defaults[name];
8022
	},
8023
8024
	/* Parse existing date and initialise date picker. */
8025
	_setDateFromField: function(inst, noDefault) {
8026
		if (inst.input.val() === inst.lastVal) {
8027
			return;
8028
		}
8029
8030
		var dateFormat = this._get(inst, "dateFormat"),
8031
			dates = inst.lastVal = inst.input ? inst.input.val() : null,
8032
			defaultDate = this._getDefaultDate(inst),
8033
			date = defaultDate,
8034
			settings = this._getFormatConfig(inst);
8035
8036
		try {
8037
			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
8038
		} catch (event) {
8039
			dates = (noDefault ? "" : dates);
8040
		}
8041
		inst.selectedDay = date.getDate();
8042
		inst.drawMonth = inst.selectedMonth = date.getMonth();
8043
		inst.drawYear = inst.selectedYear = date.getFullYear();
8044
		inst.currentDay = (dates ? date.getDate() : 0);
8045
		inst.currentMonth = (dates ? date.getMonth() : 0);
8046
		inst.currentYear = (dates ? date.getFullYear() : 0);
8047
		this._adjustInstDate(inst);
8048
	},
8049
8050
	/* Retrieve the default date shown on opening. */
8051
	_getDefaultDate: function(inst) {
8052
		return this._restrictMinMax(inst,
8053
			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
8054
	},
8055
8056
	/* A date may be specified as an exact value or a relative one. */
8057
	_determineDate: function(inst, date, defaultDate) {
8058
		var offsetNumeric = function(offset) {
8059
				var date = new Date();
8060
				date.setDate(date.getDate() + offset);
8061
				return date;
8062
			},
8063
			offsetString = function(offset) {
8064
				try {
8065
					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
8066
						offset, $.datepicker._getFormatConfig(inst));
8067
				}
8068
				catch (e) {
8069
					// Ignore
8070
				}
8071
8072
				var date = (offset.toLowerCase().match(/^c/) ?
8073
					$.datepicker._getDate(inst) : null) || new Date(),
8074
					year = date.getFullYear(),
8075
					month = date.getMonth(),
8076
					day = date.getDate(),
8077
					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
8078
					matches = pattern.exec(offset);
8079
8080
				while (matches) {
8081
					switch (matches[2] || "d") {
8082
						case "d" : case "D" :
8083
							day += parseInt(matches[1],10); break;
8084
						case "w" : case "W" :
8085
							day += parseInt(matches[1],10) * 7; break;
8086
						case "m" : case "M" :
8087
							month += parseInt(matches[1],10);
8088
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8089
							break;
8090
						case "y": case "Y" :
8091
							year += parseInt(matches[1],10);
8092
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8093
							break;
8094
					}
8095
					matches = pattern.exec(offset);
8096
				}
8097
				return new Date(year, month, day);
8098
			},
8099
			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
8100
				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
8101
8102
		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
8103
		if (newDate) {
8104
			newDate.setHours(0);
8105
			newDate.setMinutes(0);
8106
			newDate.setSeconds(0);
8107
			newDate.setMilliseconds(0);
8108
		}
8109
		return this._daylightSavingAdjust(newDate);
8110
	},
8111
8112
	/* Handle switch to/from daylight saving.
8113
	 * Hours may be non-zero on daylight saving cut-over:
8114
	 * > 12 when midnight changeover, but then cannot generate
8115
	 * midnight datetime, so jump to 1AM, otherwise reset.
8116
	 * @param  date  (Date) the date to check
8117
	 * @return  (Date) the corrected date
8118
	 */
8119
	_daylightSavingAdjust: function(date) {
8120
		if (!date) {
8121
			return null;
8122
		}
8123
		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
8124
		return date;
8125
	},
8126
8127
	/* Set the date(s) directly. */
8128
	_setDate: function(inst, date, noChange) {
8129
		var clear = !date,
8130
			origMonth = inst.selectedMonth,
8131
			origYear = inst.selectedYear,
8132
			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
8133
8134
		inst.selectedDay = inst.currentDay = newDate.getDate();
8135
		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
8136
		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
8137
		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
8138
			this._notifyChange(inst);
8139
		}
8140
		this._adjustInstDate(inst);
8141
		if (inst.input) {
8142
			inst.input.val(clear ? "" : this._formatDate(inst));
8143
		}
8144
	},
8145
8146
	/* Retrieve the date(s) directly. */
8147
	_getDate: function(inst) {
8148
		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
8149
			this._daylightSavingAdjust(new Date(
8150
			inst.currentYear, inst.currentMonth, inst.currentDay)));
8151
			return startDate;
8152
	},
8153
8154
	/* Attach the onxxx handlers.  These are declared statically so
8155
	 * they work with static code transformers like Caja.
8156
	 */
8157
	_attachHandlers: function(inst) {
8158
		var stepMonths = this._get(inst, "stepMonths"),
8159
			id = "#" + inst.id.replace( /\\\\/g, "\\" );
8160
		inst.dpDiv.find("[data-handler]").map(function () {
8161
			var handler = {
8162
				prev: function () {
8163
					$.datepicker._adjustDate(id, -stepMonths, "M");
8164
				},
8165
				next: function () {
8166
					$.datepicker._adjustDate(id, +stepMonths, "M");
8167
				},
8168
				hide: function () {
8169
					$.datepicker._hideDatepicker();
8170
				},
8171
				today: function () {
8172
					$.datepicker._gotoToday(id);
8173
				},
8174
				selectDay: function () {
8175
					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
8176
					return false;
8177
				},
8178
				selectMonth: function () {
8179
					$.datepicker._selectMonthYear(id, this, "M");
8180
					return false;
8181
				},
8182
				selectYear: function () {
8183
					$.datepicker._selectMonthYear(id, this, "Y");
8184
					return false;
8185
				}
8186
			};
8187
			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
8188
		});
8189
	},
8190
8191
	/* Generate the HTML for the current state of the date picker. */
8192
	_generateHTML: function(inst) {
8193
		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
8194
			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
8195
			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
8196
			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
8197
			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
8198
			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
8199
			tempDate = new Date(),
8200
			today = this._daylightSavingAdjust(
8201
				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
8202
			isRTL = this._get(inst, "isRTL"),
8203
			showButtonPanel = this._get(inst, "showButtonPanel"),
8204
			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
8205
			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
8206
			numMonths = this._getNumberOfMonths(inst),
8207
			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
8208
			stepMonths = this._get(inst, "stepMonths"),
8209
			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
8210
			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
8211
				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
8212
			minDate = this._getMinMaxDate(inst, "min"),
8213
			maxDate = this._getMinMaxDate(inst, "max"),
8214
			drawMonth = inst.drawMonth - showCurrentAtPos,
8215
			drawYear = inst.drawYear;
8216
8217
		if (drawMonth < 0) {
8218
			drawMonth += 12;
8219
			drawYear--;
8220
		}
8221
		if (maxDate) {
8222
			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
8223
				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
8224
			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
8225
			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
8226
				drawMonth--;
8227
				if (drawMonth < 0) {
8228
					drawMonth = 11;
8229
					drawYear--;
8230
				}
8231
			}
8232
		}
8233
		inst.drawMonth = drawMonth;
8234
		inst.drawYear = drawYear;
8235
8236
		prevText = this._get(inst, "prevText");
8237
		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
8238
			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
8239
			this._getFormatConfig(inst)));
8240
8241
		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
8242
			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
8243
			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
8244
			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
8245
8246
		nextText = this._get(inst, "nextText");
8247
		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
8248
			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
8249
			this._getFormatConfig(inst)));
8250
8251
		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
8252
			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
8253
			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
8254
			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
8255
8256
		currentText = this._get(inst, "currentText");
8257
		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
8258
		currentText = (!navigationAsDateFormat ? currentText :
8259
			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
8260
8261
		controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
8262
			this._get(inst, "closeText") + "</button>" : "");
8263
8264
		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
8265
			(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
8266
			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
8267
8268
		firstDay = parseInt(this._get(inst, "firstDay"),10);
8269
		firstDay = (isNaN(firstDay) ? 0 : firstDay);
8270
8271
		showWeek = this._get(inst, "showWeek");
8272
		dayNames = this._get(inst, "dayNames");
8273
		dayNamesMin = this._get(inst, "dayNamesMin");
8274
		monthNames = this._get(inst, "monthNames");
8275
		monthNamesShort = this._get(inst, "monthNamesShort");
8276
		beforeShowDay = this._get(inst, "beforeShowDay");
8277
		showOtherMonths = this._get(inst, "showOtherMonths");
8278
		selectOtherMonths = this._get(inst, "selectOtherMonths");
8279
		defaultDate = this._getDefaultDate(inst);
8280
		html = "";
8281
		dow;
8282
		for (row = 0; row < numMonths[0]; row++) {
8283
			group = "";
8284
			this.maxRows = 4;
8285
			for (col = 0; col < numMonths[1]; col++) {
8286
				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
8287
				cornerClass = " ui-corner-all";
8288
				calender = "";
8289
				if (isMultiMonth) {
8290
					calender += "<div class='ui-datepicker-group";
8291
					if (numMonths[1] > 1) {
8292
						switch (col) {
8293
							case 0: calender += " ui-datepicker-group-first";
8294
								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
8295
							case numMonths[1]-1: calender += " ui-datepicker-group-last";
8296
								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
8297
							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
8298
						}
8299
					}
8300
					calender += "'>";
8301
				}
8302
				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
8303
					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
8304
					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
8305
					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
8306
					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
8307
					"</div><table class='ui-datepicker-calendar'><thead>" +
8308
					"<tr>";
8309
				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
8310
				for (dow = 0; dow < 7; dow++) { // days of the week
8311
					day = (dow + firstDay) % 7;
8312
					thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
8313
						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
8314
				}
8315
				calender += thead + "</tr></thead><tbody>";
8316
				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
8317
				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
8318
					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
8319
				}
8320
				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
8321
				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
8322
				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
8323
				this.maxRows = numRows;
8324
				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
8325
				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
8326
					calender += "<tr>";
8327
					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
8328
						this._get(inst, "calculateWeek")(printDate) + "</td>");
8329
					for (dow = 0; dow < 7; dow++) { // create date picker days
8330
						daySettings = (beforeShowDay ?
8331
							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
8332
						otherMonth = (printDate.getMonth() !== drawMonth);
8333
						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
8334
							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
8335
						tbody += "<td class='" +
8336
							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
8337
							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
8338
							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
8339
							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
8340
							// or defaultDate is current printedDate and defaultDate is selectedDate
8341
							" " + this._dayOverClass : "") + // highlight selected day
8342
							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
8343
							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
8344
							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
8345
							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
8346
							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
8347
							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
8348
							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
8349
							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
8350
							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
8351
							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
8352
							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
8353
							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
8354
						printDate.setDate(printDate.getDate() + 1);
8355
						printDate = this._daylightSavingAdjust(printDate);
8356
					}
8357
					calender += tbody + "</tr>";
8358
				}
8359
				drawMonth++;
8360
				if (drawMonth > 11) {
8361
					drawMonth = 0;
8362
					drawYear++;
8363
				}
8364
				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
8365
							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
8366
				group += calender;
8367
			}
8368
			html += group;
8369
		}
8370
		html += buttonPanel;
8371
		inst._keyEvent = false;
8372
		return html;
8373
	},
8374
8375
	/* Generate the month and year header. */
8376
	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
8377
			secondary, monthNames, monthNamesShort) {
8378
8379
		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
8380
			changeMonth = this._get(inst, "changeMonth"),
8381
			changeYear = this._get(inst, "changeYear"),
8382
			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
8383
			html = "<div class='ui-datepicker-title'>",
8384
			monthHtml = "";
8385
8386
		// month selection
8387
		if (secondary || !changeMonth) {
8388
			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
8389
		} else {
8390
			inMinYear = (minDate && minDate.getFullYear() === drawYear);
8391
			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
8392
			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
8393
			for ( month = 0; month < 12; month++) {
8394
				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
8395
					monthHtml += "<option value='" + month + "'" +
8396
						(month === drawMonth ? " selected='selected'" : "") +
8397
						">" + monthNamesShort[month] + "</option>";
8398
				}
8399
			}
8400
			monthHtml += "</select>";
8401
		}
8402
8403
		if (!showMonthAfterYear) {
8404
			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
8405
		}
8406
8407
		// year selection
8408
		if ( !inst.yearshtml ) {
8409
			inst.yearshtml = "";
8410
			if (secondary || !changeYear) {
8411
				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
8412
			} else {
8413
				// determine range of years to display
8414
				years = this._get(inst, "yearRange").split(":");
8415
				thisYear = new Date().getFullYear();
8416
				determineYear = function(value) {
8417
					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
8418
						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
8419
						parseInt(value, 10)));
8420
					return (isNaN(year) ? thisYear : year);
8421
				};
8422
				year = determineYear(years[0]);
8423
				endYear = Math.max(year, determineYear(years[1] || ""));
8424
				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
8425
				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
8426
				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
8427
				for (; year <= endYear; year++) {
8428
					inst.yearshtml += "<option value='" + year + "'" +
8429
						(year === drawYear ? " selected='selected'" : "") +
8430
						">" + year + "</option>";
8431
				}
8432
				inst.yearshtml += "</select>";
8433
8434
				html += inst.yearshtml;
8435
				inst.yearshtml = null;
8436
			}
8437
		}
8438
8439
		html += this._get(inst, "yearSuffix");
8440
		if (showMonthAfterYear) {
8441
			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
8442
		}
8443
		html += "</div>"; // Close datepicker_header
8444
		return html;
8445
	},
8446
8447
	/* Adjust one of the date sub-fields. */
8448
	_adjustInstDate: function(inst, offset, period) {
8449
		var year = inst.drawYear + (period === "Y" ? offset : 0),
8450
			month = inst.drawMonth + (period === "M" ? offset : 0),
8451
			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
8452
			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
8453
8454
		inst.selectedDay = date.getDate();
8455
		inst.drawMonth = inst.selectedMonth = date.getMonth();
8456
		inst.drawYear = inst.selectedYear = date.getFullYear();
8457
		if (period === "M" || period === "Y") {
8458
			this._notifyChange(inst);
8459
		}
8460
	},
8461
8462
	/* Ensure a date is within any min/max bounds. */
8463
	_restrictMinMax: function(inst, date) {
8464
		var minDate = this._getMinMaxDate(inst, "min"),
8465
			maxDate = this._getMinMaxDate(inst, "max"),
8466
			newDate = (minDate && date < minDate ? minDate : date);
8467
		return (maxDate && newDate > maxDate ? maxDate : newDate);
8468
	},
8469
8470
	/* Notify change of month/year. */
8471
	_notifyChange: function(inst) {
8472
		var onChange = this._get(inst, "onChangeMonthYear");
8473
		if (onChange) {
8474
			onChange.apply((inst.input ? inst.input[0] : null),
8475
				[inst.selectedYear, inst.selectedMonth + 1, inst]);
8476
		}
8477
	},
8478
8479
	/* Determine the number of months to show. */
8480
	_getNumberOfMonths: function(inst) {
8481
		var numMonths = this._get(inst, "numberOfMonths");
8482
		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
8483
	},
8484
8485
	/* Determine the current maximum date - ensure no time components are set. */
8486
	_getMinMaxDate: function(inst, minMax) {
8487
		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
8488
	},
8489
8490
	/* Find the number of days in a given month. */
8491
	_getDaysInMonth: function(year, month) {
8492
		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
8493
	},
8494
8495
	/* Find the day of the week of the first of a month. */
8496
	_getFirstDayOfMonth: function(year, month) {
8497
		return new Date(year, month, 1).getDay();
8498
	},
8499
8500
	/* Determines if we should allow a "next/prev" month display change. */
8501
	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
8502
		var numMonths = this._getNumberOfMonths(inst),
8503
			date = this._daylightSavingAdjust(new Date(curYear,
8504
			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
8505
8506
		if (offset < 0) {
8507
			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
8508
		}
8509
		return this._isInRange(inst, date);
8510
	},
8511
8512
	/* Is the given date in the accepted range? */
8513
	_isInRange: function(inst, date) {
8514
		var yearSplit, currentYear,
8515
			minDate = this._getMinMaxDate(inst, "min"),
8516
			maxDate = this._getMinMaxDate(inst, "max"),
8517
			minYear = null,
8518
			maxYear = null,
8519
			years = this._get(inst, "yearRange");
8520
			if (years){
8521
				yearSplit = years.split(":");
8522
				currentYear = new Date().getFullYear();
8523
				minYear = parseInt(yearSplit[0], 10);
8524
				maxYear = parseInt(yearSplit[1], 10);
8525
				if ( yearSplit[0].match(/[+\-].*/) ) {
8526
					minYear += currentYear;
8527
				}
8528
				if ( yearSplit[1].match(/[+\-].*/) ) {
8529
					maxYear += currentYear;
8530
				}
8531
			}
8532
8533
		return ((!minDate || date.getTime() >= minDate.getTime()) &&
8534
			(!maxDate || date.getTime() <= maxDate.getTime()) &&
8535
			(!minYear || date.getFullYear() >= minYear) &&
8536
			(!maxYear || date.getFullYear() <= maxYear));
8537
	},
8538
8539
	/* Provide the configuration settings for formatting/parsing. */
8540
	_getFormatConfig: function(inst) {
8541
		var shortYearCutoff = this._get(inst, "shortYearCutoff");
8542
		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
8543
			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
8544
		return {shortYearCutoff: shortYearCutoff,
8545
			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
8546
			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
8547
	},
8548
8549
	/* Format the given date for display. */
8550
	_formatDate: function(inst, day, month, year) {
8551
		if (!day) {
8552
			inst.currentDay = inst.selectedDay;
8553
			inst.currentMonth = inst.selectedMonth;
8554
			inst.currentYear = inst.selectedYear;
8555
		}
8556
		var date = (day ? (typeof day === "object" ? day :
8557
			this._daylightSavingAdjust(new Date(year, month, day))) :
8558
			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
8559
		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
8560
	}
8561
});
8562
8563
/*
8564
 * Bind hover events for datepicker elements.
8565
 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
8566
 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
8567
 */
8568
function datepicker_bindHover(dpDiv) {
8569
	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
8570
	return dpDiv.delegate(selector, "mouseout", function() {
8571
			$(this).removeClass("ui-state-hover");
8572
			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
8573
				$(this).removeClass("ui-datepicker-prev-hover");
8574
			}
8575
			if (this.className.indexOf("ui-datepicker-next") !== -1) {
8576
				$(this).removeClass("ui-datepicker-next-hover");
8577
			}
8578
		})
8579
		.delegate( selector, "mouseover", datepicker_handleMouseover );
8580
}
8581
8582
function datepicker_handleMouseover() {
8583
	if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
8584
		$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
8585
		$(this).addClass("ui-state-hover");
8586
		if (this.className.indexOf("ui-datepicker-prev") !== -1) {
8587
			$(this).addClass("ui-datepicker-prev-hover");
8588
		}
8589
		if (this.className.indexOf("ui-datepicker-next") !== -1) {
8590
			$(this).addClass("ui-datepicker-next-hover");
8591
		}
8592
	}
8593
}
8594
8595
/* jQuery extend now ignores nulls! */
8596
function datepicker_extendRemove(target, props) {
8597
	$.extend(target, props);
8598
	for (var name in props) {
8599
		if (props[name] == null) {
8600
			target[name] = props[name];
8601
		}
8602
	}
8603
	return target;
8604
}
8605
8606
/* Invoke the datepicker functionality.
8607
   @param  options  string - a command, optionally followed by additional parameters or
8608
					Object - settings for attaching new datepicker functionality
8609
   @return  jQuery object */
8610
$.fn.datepicker = function(options){
8611
8612
	/* Verify an empty collection wasn't passed - Fixes #6976 */
8613
	if ( !this.length ) {
8614
		return this;
8615
	}
8616
8617
	/* Initialise the date picker. */
8618
	if (!$.datepicker.initialized) {
8619
		$(document).mousedown($.datepicker._checkExternalClick);
8620
		$.datepicker.initialized = true;
8621
	}
8622
8623
	/* Append datepicker main container to body if not exist. */
8624
	if ($("#"+$.datepicker._mainDivId).length === 0) {
8625
		$("body").append($.datepicker.dpDiv);
8626
	}
8627
8628
	var otherArgs = Array.prototype.slice.call(arguments, 1);
8629
	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
8630
		return $.datepicker["_" + options + "Datepicker"].
8631
			apply($.datepicker, [this[0]].concat(otherArgs));
8632
	}
8633
	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
8634
		return $.datepicker["_" + options + "Datepicker"].
8635
			apply($.datepicker, [this[0]].concat(otherArgs));
8636
	}
8637
	return this.each(function() {
8638
		typeof options === "string" ?
8639
			$.datepicker["_" + options + "Datepicker"].
8640
				apply($.datepicker, [this].concat(otherArgs)) :
8641
			$.datepicker._attachDatepicker(this, options);
8642
	});
8643
};
8644
8645
$.datepicker = new Datepicker(); // singleton instance
8646
$.datepicker.initialized = false;
8647
$.datepicker.uuid = new Date().getTime();
8648
$.datepicker.version = "1.11.4";
8649
8650
var datepicker = $.datepicker;
8651
8652
8653
/*!
8654
 * jQuery UI Progressbar 1.11.4
8655
 * http://jqueryui.com
8656
 *
8657
 * Copyright jQuery Foundation and other contributors
8658
 * Released under the MIT license.
8659
 * http://jquery.org/license
8660
 *
8661
 * http://api.jqueryui.com/progressbar/
8662
 */
8663
8664
8665
var progressbar = $.widget( "ui.progressbar", {
8666
	version: "1.11.4",
8667
	options: {
8668
		max: 100,
8669
		value: 0,
8670
8671
		change: null,
8672
		complete: null
8673
	},
8674
8675
	min: 0,
8676
8677
	_create: function() {
8678
		// Constrain initial value
8679
		this.oldValue = this.options.value = this._constrainedValue();
8680
8681
		this.element
8682
			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
8683
			.attr({
8684
				// Only set static values, aria-valuenow and aria-valuemax are
8685
				// set inside _refreshValue()
8686
				role: "progressbar",
8687
				"aria-valuemin": this.min
8688
			});
8689
8690
		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
8691
			.appendTo( this.element );
8692
8693
		this._refreshValue();
8694
	},
8695
8696
	_destroy: function() {
8697
		this.element
8698
			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
8699
			.removeAttr( "role" )
8700
			.removeAttr( "aria-valuemin" )
8701
			.removeAttr( "aria-valuemax" )
8702
			.removeAttr( "aria-valuenow" );
8703
8704
		this.valueDiv.remove();
8705
	},
8706
8707
	value: function( newValue ) {
8708
		if ( newValue === undefined ) {
8709
			return this.options.value;
8710
		}
8711
8712
		this.options.value = this._constrainedValue( newValue );
8713
		this._refreshValue();
8714
	},
8715
8716
	_constrainedValue: function( newValue ) {
8717
		if ( newValue === undefined ) {
8718
			newValue = this.options.value;
8719
		}
8720
8721
		this.indeterminate = newValue === false;
8722
8723
		// sanitize value
8724
		if ( typeof newValue !== "number" ) {
8725
			newValue = 0;
8726
		}
8727
8728
		return this.indeterminate ? false :
8729
			Math.min( this.options.max, Math.max( this.min, newValue ) );
8730
	},
8731
8732
	_setOptions: function( options ) {
8733
		// Ensure "value" option is set after other values (like max)
8734
		var value = options.value;
8735
		delete options.value;
8736
8737
		this._super( options );
8738
8739
		this.options.value = this._constrainedValue( value );
8740
		this._refreshValue();
8741
	},
8742
8743
	_setOption: function( key, value ) {
8744
		if ( key === "max" ) {
8745
			// Don't allow a max less than min
8746
			value = Math.max( this.min, value );
8747
		}
8748
		if ( key === "disabled" ) {
8749
			this.element
8750
				.toggleClass( "ui-state-disabled", !!value )
8751
				.attr( "aria-disabled", value );
8752
		}
8753
		this._super( key, value );
8754
	},
8755
8756
	_percentage: function() {
8757
		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
8758
	},
8759
8760
	_refreshValue: function() {
8761
		var value = this.options.value,
8762
			percentage = this._percentage();
8763
8764
		this.valueDiv
8765
			.toggle( this.indeterminate || value > this.min )
8766
			.toggleClass( "ui-corner-right", value === this.options.max )
8767
			.width( percentage.toFixed(0) + "%" );
8768
8769
		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
8770
8771
		if ( this.indeterminate ) {
8772
			this.element.removeAttr( "aria-valuenow" );
8773
			if ( !this.overlayDiv ) {
8774
				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
8775
			}
8776
		} else {
8777
			this.element.attr({
8778
				"aria-valuemax": this.options.max,
8779
				"aria-valuenow": value
8780
			});
8781
			if ( this.overlayDiv ) {
8782
				this.overlayDiv.remove();
8783
				this.overlayDiv = null;
8784
			}
8785
		}
8786
8787
		if ( this.oldValue !== value ) {
8788
			this.oldValue = value;
8789
			this._trigger( "change" );
8790
		}
8791
		if ( value === this.options.max ) {
8792
			this._trigger( "complete" );
8793
		}
8794
	}
8795
});
8796
8797
8798
/*!
8799
 * jQuery UI Slider 1.11.4
8800
 * http://jqueryui.com
8801
 *
8802
 * Copyright jQuery Foundation and other contributors
8803
 * Released under the MIT license.
8804
 * http://jquery.org/license
8805
 *
8806
 * http://api.jqueryui.com/slider/
8807
 */
8808
8809
8810
var slider = $.widget( "ui.slider", $.ui.mouse, {
8811
	version: "1.11.4",
8812
	widgetEventPrefix: "slide",
8813
8814
	options: {
8815
		animate: false,
8816
		distance: 0,
8817
		max: 100,
8818
		min: 0,
8819
		orientation: "horizontal",
8820
		range: false,
8821
		step: 1,
8822
		value: 0,
8823
		values: null,
8824
8825
		// callbacks
8826
		change: null,
8827
		slide: null,
8828
		start: null,
8829
		stop: null
8830
	},
8831
8832
	// number of pages in a slider
8833
	// (how many times can you page up/down to go through the whole range)
8834
	numPages: 5,
8835
8836
	_create: function() {
8837
		this._keySliding = false;
8838
		this._mouseSliding = false;
8839
		this._animateOff = true;
8840
		this._handleIndex = null;
8841
		this._detectOrientation();
8842
		this._mouseInit();
8843
		this._calculateNewMax();
8844
8845
		this.element
8846
			.addClass( "ui-slider" +
8847
				" ui-slider-" + this.orientation +
8848
				" ui-widget" +
8849
				" ui-widget-content" +
8850
				" ui-corner-all");
8851
8852
		this._refresh();
8853
		this._setOption( "disabled", this.options.disabled );
8854
8855
		this._animateOff = false;
8856
	},
8857
8858
	_refresh: function() {
8859
		this._createRange();
8860
		this._createHandles();
8861
		this._setupEvents();
8862
		this._refreshValue();
8863
	},
8864
8865
	_createHandles: function() {
8866
		var i, handleCount,
8867
			options = this.options,
8868
			existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
8869
			handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
8870
			handles = [];
8871
8872
		handleCount = ( options.values && options.values.length ) || 1;
8873
8874
		if ( existingHandles.length > handleCount ) {
8875
			existingHandles.slice( handleCount ).remove();
8876
			existingHandles = existingHandles.slice( 0, handleCount );
8877
		}
8878
8879
		for ( i = existingHandles.length; i < handleCount; i++ ) {
8880
			handles.push( handle );
8881
		}
8882
8883
		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
8884
8885
		this.handle = this.handles.eq( 0 );
8886
8887
		this.handles.each(function( i ) {
8888
			$( this ).data( "ui-slider-handle-index", i );
8889
		});
8890
	},
8891
8892
	_createRange: function() {
8893
		var options = this.options,
8894
			classes = "";
8895
8896
		if ( options.range ) {
8897
			if ( options.range === true ) {
8898
				if ( !options.values ) {
8899
					options.values = [ this._valueMin(), this._valueMin() ];
8900
				} else if ( options.values.length && options.values.length !== 2 ) {
8901
					options.values = [ options.values[0], options.values[0] ];
8902
				} else if ( $.isArray( options.values ) ) {
8903
					options.values = options.values.slice(0);
8904
				}
8905
			}
8906
8907
			if ( !this.range || !this.range.length ) {
8908
				this.range = $( "<div></div>" )
8909
					.appendTo( this.element );
8910
8911
				classes = "ui-slider-range" +
8912
				// note: this isn't the most fittingly semantic framework class for this element,
8913
				// but worked best visually with a variety of themes
8914
				" ui-widget-header ui-corner-all";
8915
			} else {
8916
				this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
8917
					// Handle range switching from true to min/max
8918
					.css({
8919
						"left": "",
8920
						"bottom": ""
8921
					});
8922
			}
8923
8924
			this.range.addClass( classes +
8925
				( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
8926
		} else {
8927
			if ( this.range ) {
8928
				this.range.remove();
8929
			}
8930
			this.range = null;
8931
		}
8932
	},
8933
8934
	_setupEvents: function() {
8935
		this._off( this.handles );
8936
		this._on( this.handles, this._handleEvents );
8937
		this._hoverable( this.handles );
8938
		this._focusable( this.handles );
8939
	},
8940
8941
	_destroy: function() {
8942
		this.handles.remove();
8943
		if ( this.range ) {
8944
			this.range.remove();
8945
		}
8946
8947
		this.element
8948
			.removeClass( "ui-slider" +
8949
				" ui-slider-horizontal" +
8950
				" ui-slider-vertical" +
8951
				" ui-widget" +
8952
				" ui-widget-content" +
8953
				" ui-corner-all" );
8954
8955
		this._mouseDestroy();
8956
	},
8957
8958
	_mouseCapture: function( event ) {
8959
		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
8960
			that = this,
8961
			o = this.options;
8962
8963
		if ( o.disabled ) {
8964
			return false;
8965
		}
8966
8967
		this.elementSize = {
8968
			width: this.element.outerWidth(),
8969
			height: this.element.outerHeight()
8970
		};
8971
		this.elementOffset = this.element.offset();
8972
8973
		position = { x: event.pageX, y: event.pageY };
8974
		normValue = this._normValueFromMouse( position );
8975
		distance = this._valueMax() - this._valueMin() + 1;
8976
		this.handles.each(function( i ) {
8977
			var thisDistance = Math.abs( normValue - that.values(i) );
8978
			if (( distance > thisDistance ) ||
8979
				( distance === thisDistance &&
8980
					(i === that._lastChangedValue || that.values(i) === o.min ))) {
8981
				distance = thisDistance;
8982
				closestHandle = $( this );
8983
				index = i;
8984
			}
8985
		});
8986
8987
		allowed = this._start( event, index );
8988
		if ( allowed === false ) {
8989
			return false;
8990
		}
8991
		this._mouseSliding = true;
8992
8993
		this._handleIndex = index;
8994
8995
		closestHandle
8996
			.addClass( "ui-state-active" )
8997
			.focus();
8998
8999
		offset = closestHandle.offset();
9000
		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
9001
		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
9002
			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
9003
			top: event.pageY - offset.top -
9004
				( closestHandle.height() / 2 ) -
9005
				( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
9006
				( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
9007
				( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
9008
		};
9009
9010
		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
9011
			this._slide( event, index, normValue );
9012
		}
9013
		this._animateOff = true;
9014
		return true;
9015
	},
9016
9017
	_mouseStart: function() {
9018
		return true;
9019
	},
9020
9021
	_mouseDrag: function( event ) {
9022
		var position = { x: event.pageX, y: event.pageY },
9023
			normValue = this._normValueFromMouse( position );
9024
9025
		this._slide( event, this._handleIndex, normValue );
9026
9027
		return false;
9028
	},
9029
9030
	_mouseStop: function( event ) {
9031
		this.handles.removeClass( "ui-state-active" );
9032
		this._mouseSliding = false;
9033
9034
		this._stop( event, this._handleIndex );
9035
		this._change( event, this._handleIndex );
9036
9037
		this._handleIndex = null;
9038
		this._clickOffset = null;
9039
		this._animateOff = false;
9040
9041
		return false;
9042
	},
9043
9044
	_detectOrientation: function() {
9045
		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
9046
	},
9047
9048
	_normValueFromMouse: function( position ) {
9049
		var pixelTotal,
9050
			pixelMouse,
9051
			percentMouse,
9052
			valueTotal,
9053
			valueMouse;
9054
9055
		if ( this.orientation === "horizontal" ) {
9056
			pixelTotal = this.elementSize.width;
9057
			pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
9058
		} else {
9059
			pixelTotal = this.elementSize.height;
9060
			pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
9061
		}
9062
9063
		percentMouse = ( pixelMouse / pixelTotal );
9064
		if ( percentMouse > 1 ) {
9065
			percentMouse = 1;
9066
		}
9067
		if ( percentMouse < 0 ) {
9068
			percentMouse = 0;
9069
		}
9070
		if ( this.orientation === "vertical" ) {
9071
			percentMouse = 1 - percentMouse;
9072
		}
9073
9074
		valueTotal = this._valueMax() - this._valueMin();
9075
		valueMouse = this._valueMin() + percentMouse * valueTotal;
9076
9077
		return this._trimAlignValue( valueMouse );
9078
	},
9079
9080
	_start: function( event, index ) {
9081
		var uiHash = {
9082
			handle: this.handles[ index ],
9083
			value: this.value()
9084
		};
9085
		if ( this.options.values && this.options.values.length ) {
9086
			uiHash.value = this.values( index );
9087
			uiHash.values = this.values();
9088
		}
9089
		return this._trigger( "start", event, uiHash );
9090
	},
9091
9092
	_slide: function( event, index, newVal ) {
9093
		var otherVal,
9094
			newValues,
9095
			allowed;
9096
9097
		if ( this.options.values && this.options.values.length ) {
9098
			otherVal = this.values( index ? 0 : 1 );
9099
9100
			if ( ( this.options.values.length === 2 && this.options.range === true ) &&
9101
					( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
9102
				) {
9103
				newVal = otherVal;
9104
			}
9105
9106
			if ( newVal !== this.values( index ) ) {
9107
				newValues = this.values();
9108
				newValues[ index ] = newVal;
9109
				// A slide can be canceled by returning false from the slide callback
9110
				allowed = this._trigger( "slide", event, {
9111
					handle: this.handles[ index ],
9112
					value: newVal,
9113
					values: newValues
9114
				} );
9115
				otherVal = this.values( index ? 0 : 1 );
9116
				if ( allowed !== false ) {
9117
					this.values( index, newVal );
9118
				}
9119
			}
9120
		} else {
9121
			if ( newVal !== this.value() ) {
9122
				// A slide can be canceled by returning false from the slide callback
9123
				allowed = this._trigger( "slide", event, {
9124
					handle: this.handles[ index ],
9125
					value: newVal
9126
				} );
9127
				if ( allowed !== false ) {
9128
					this.value( newVal );
9129
				}
9130
			}
9131
		}
9132
	},
9133
9134
	_stop: function( event, index ) {
9135
		var uiHash = {
9136
			handle: this.handles[ index ],
9137
			value: this.value()
9138
		};
9139
		if ( this.options.values && this.options.values.length ) {
9140
			uiHash.value = this.values( index );
9141
			uiHash.values = this.values();
9142
		}
9143
9144
		this._trigger( "stop", event, uiHash );
9145
	},
9146
9147
	_change: function( event, index ) {
9148
		if ( !this._keySliding && !this._mouseSliding ) {
9149
			var uiHash = {
9150
				handle: this.handles[ index ],
9151
				value: this.value()
9152
			};
9153
			if ( this.options.values && this.options.values.length ) {
9154
				uiHash.value = this.values( index );
9155
				uiHash.values = this.values();
9156
			}
9157
9158
			//store the last changed value index for reference when handles overlap
9159
			this._lastChangedValue = index;
9160
9161
			this._trigger( "change", event, uiHash );
9162
		}
9163
	},
9164
9165
	value: function( newValue ) {
9166
		if ( arguments.length ) {
9167
			this.options.value = this._trimAlignValue( newValue );
9168
			this._refreshValue();
9169
			this._change( null, 0 );
9170
			return;
9171
		}
9172
9173
		return this._value();
9174
	},
9175
9176
	values: function( index, newValue ) {
9177
		var vals,
9178
			newValues,
9179
			i;
9180
9181
		if ( arguments.length > 1 ) {
9182
			this.options.values[ index ] = this._trimAlignValue( newValue );
9183
			this._refreshValue();
9184
			this._change( null, index );
9185
			return;
9186
		}
9187
9188
		if ( arguments.length ) {
9189
			if ( $.isArray( arguments[ 0 ] ) ) {
9190
				vals = this.options.values;
9191
				newValues = arguments[ 0 ];
9192
				for ( i = 0; i < vals.length; i += 1 ) {
9193
					vals[ i ] = this._trimAlignValue( newValues[ i ] );
9194
					this._change( null, i );
9195
				}
9196
				this._refreshValue();
9197
			} else {
9198
				if ( this.options.values && this.options.values.length ) {
9199
					return this._values( index );
9200
				} else {
9201
					return this.value();
9202
				}
9203
			}
9204
		} else {
9205
			return this._values();
9206
		}
9207
	},
9208
9209
	_setOption: function( key, value ) {
9210
		var i,
9211
			valsLength = 0;
9212
9213
		if ( key === "range" && this.options.range === true ) {
9214
			if ( value === "min" ) {
9215
				this.options.value = this._values( 0 );
9216
				this.options.values = null;
9217
			} else if ( value === "max" ) {
9218
				this.options.value = this._values( this.options.values.length - 1 );
9219
				this.options.values = null;
9220
			}
9221
		}
9222
9223
		if ( $.isArray( this.options.values ) ) {
9224
			valsLength = this.options.values.length;
9225
		}
9226
9227
		if ( key === "disabled" ) {
9228
			this.element.toggleClass( "ui-state-disabled", !!value );
9229
		}
9230
9231
		this._super( key, value );
9232
9233
		switch ( key ) {
9234
			case "orientation":
9235
				this._detectOrientation();
9236
				this.element
9237
					.removeClass( "ui-slider-horizontal ui-slider-vertical" )
9238
					.addClass( "ui-slider-" + this.orientation );
9239
				this._refreshValue();
9240
9241
				// Reset positioning from previous orientation
9242
				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
9243
				break;
9244
			case "value":
9245
				this._animateOff = true;
9246
				this._refreshValue();
9247
				this._change( null, 0 );
9248
				this._animateOff = false;
9249
				break;
9250
			case "values":
9251
				this._animateOff = true;
9252
				this._refreshValue();
9253
				for ( i = 0; i < valsLength; i += 1 ) {
9254
					this._change( null, i );
9255
				}
9256
				this._animateOff = false;
9257
				break;
9258
			case "step":
9259
			case "min":
9260
			case "max":
9261
				this._animateOff = true;
9262
				this._calculateNewMax();
9263
				this._refreshValue();
9264
				this._animateOff = false;
9265
				break;
9266
			case "range":
9267
				this._animateOff = true;
9268
				this._refresh();
9269
				this._animateOff = false;
9270
				break;
9271
		}
9272
	},
9273
9274
	//internal value getter
9275
	// _value() returns value trimmed by min and max, aligned by step
9276
	_value: function() {
9277
		var val = this.options.value;
9278
		val = this._trimAlignValue( val );
9279
9280
		return val;
9281
	},
9282
9283
	//internal values getter
9284
	// _values() returns array of values trimmed by min and max, aligned by step
9285
	// _values( index ) returns single value trimmed by min and max, aligned by step
9286
	_values: function( index ) {
9287
		var val,
9288
			vals,
9289
			i;
9290
9291
		if ( arguments.length ) {
9292
			val = this.options.values[ index ];
9293
			val = this._trimAlignValue( val );
9294
9295
			return val;
9296
		} else if ( this.options.values && this.options.values.length ) {
9297
			// .slice() creates a copy of the array
9298
			// this copy gets trimmed by min and max and then returned
9299
			vals = this.options.values.slice();
9300
			for ( i = 0; i < vals.length; i += 1) {
9301
				vals[ i ] = this._trimAlignValue( vals[ i ] );
9302
			}
9303
9304
			return vals;
9305
		} else {
9306
			return [];
9307
		}
9308
	},
9309
9310
	// returns the step-aligned value that val is closest to, between (inclusive) min and max
9311
	_trimAlignValue: function( val ) {
9312
		if ( val <= this._valueMin() ) {
9313
			return this._valueMin();
9314
		}
9315
		if ( val >= this._valueMax() ) {
9316
			return this._valueMax();
9317
		}
9318
		var step = ( this.options.step > 0 ) ? this.options.step : 1,
9319
			valModStep = (val - this._valueMin()) % step,
9320
			alignValue = val - valModStep;
9321
9322
		if ( Math.abs(valModStep) * 2 >= step ) {
9323
			alignValue += ( valModStep > 0 ) ? step : ( -step );
9324
		}
9325
9326
		// Since JavaScript has problems with large floats, round
9327
		// the final value to 5 digits after the decimal point (see #4124)
9328
		return parseFloat( alignValue.toFixed(5) );
9329
	},
9330
9331
	_calculateNewMax: function() {
9332
		var max = this.options.max,
9333
			min = this._valueMin(),
9334
			step = this.options.step,
9335
			aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
9336
		max = aboveMin + min;
9337
		this.max = parseFloat( max.toFixed( this._precision() ) );
9338
	},
9339
9340
	_precision: function() {
9341
		var precision = this._precisionOf( this.options.step );
9342
		if ( this.options.min !== null ) {
9343
			precision = Math.max( precision, this._precisionOf( this.options.min ) );
9344
		}
9345
		return precision;
9346
	},
9347
9348
	_precisionOf: function( num ) {
9349
		var str = num.toString(),
9350
			decimal = str.indexOf( "." );
9351
		return decimal === -1 ? 0 : str.length - decimal - 1;
9352
	},
9353
9354
	_valueMin: function() {
9355
		return this.options.min;
9356
	},
9357
9358
	_valueMax: function() {
9359
		return this.max;
9360
	},
9361
9362
	_refreshValue: function() {
9363
		var lastValPercent, valPercent, value, valueMin, valueMax,
9364
			oRange = this.options.range,
9365
			o = this.options,
9366
			that = this,
9367
			animate = ( !this._animateOff ) ? o.animate : false,
9368
			_set = {};
9369
9370
		if ( this.options.values && this.options.values.length ) {
9371
			this.handles.each(function( i ) {
9372
				valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
9373
				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
9374
				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
9375
				if ( that.options.range === true ) {
9376
					if ( that.orientation === "horizontal" ) {
9377
						if ( i === 0 ) {
9378
							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
9379
						}
9380
						if ( i === 1 ) {
9381
							that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
9382
						}
9383
					} else {
9384
						if ( i === 0 ) {
9385
							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
9386
						}
9387
						if ( i === 1 ) {
9388
							that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
9389
						}
9390
					}
9391
				}
9392
				lastValPercent = valPercent;
9393
			});
9394
		} else {
9395
			value = this.value();
9396
			valueMin = this._valueMin();
9397
			valueMax = this._valueMax();
9398
			valPercent = ( valueMax !== valueMin ) ?
9399
					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
9400
					0;
9401
			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
9402
			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
9403
9404
			if ( oRange === "min" && this.orientation === "horizontal" ) {
9405
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
9406
			}
9407
			if ( oRange === "max" && this.orientation === "horizontal" ) {
9408
				this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
9409
			}
9410
			if ( oRange === "min" && this.orientation === "vertical" ) {
9411
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
9412
			}
9413
			if ( oRange === "max" && this.orientation === "vertical" ) {
9414
				this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
9415
			}
9416
		}
9417
	},
9418
9419
	_handleEvents: {
9420
		keydown: function( event ) {
9421
			var allowed, curVal, newVal, step,
9422
				index = $( event.target ).data( "ui-slider-handle-index" );
9423
9424
			switch ( event.keyCode ) {
9425
				case $.ui.keyCode.HOME:
9426
				case $.ui.keyCode.END:
9427
				case $.ui.keyCode.PAGE_UP:
9428
				case $.ui.keyCode.PAGE_DOWN:
9429
				case $.ui.keyCode.UP:
9430
				case $.ui.keyCode.RIGHT:
9431
				case $.ui.keyCode.DOWN:
9432
				case $.ui.keyCode.LEFT:
9433
					event.preventDefault();
9434
					if ( !this._keySliding ) {
9435
						this._keySliding = true;
9436
						$( event.target ).addClass( "ui-state-active" );
9437
						allowed = this._start( event, index );
9438
						if ( allowed === false ) {
9439
							return;
9440
						}
9441
					}
9442
					break;
9443
			}
9444
9445
			step = this.options.step;
9446
			if ( this.options.values && this.options.values.length ) {
9447
				curVal = newVal = this.values( index );
9448
			} else {
9449
				curVal = newVal = this.value();
9450
			}
9451
9452
			switch ( event.keyCode ) {
9453
				case $.ui.keyCode.HOME:
9454
					newVal = this._valueMin();
9455
					break;
9456
				case $.ui.keyCode.END:
9457
					newVal = this._valueMax();
9458
					break;
9459
				case $.ui.keyCode.PAGE_UP:
9460
					newVal = this._trimAlignValue(
9461
						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
9462
					);
9463
					break;
9464
				case $.ui.keyCode.PAGE_DOWN:
9465
					newVal = this._trimAlignValue(
9466
						curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
9467
					break;
9468
				case $.ui.keyCode.UP:
9469
				case $.ui.keyCode.RIGHT:
9470
					if ( curVal === this._valueMax() ) {
9471
						return;
9472
					}
9473
					newVal = this._trimAlignValue( curVal + step );
9474
					break;
9475
				case $.ui.keyCode.DOWN:
9476
				case $.ui.keyCode.LEFT:
9477
					if ( curVal === this._valueMin() ) {
9478
						return;
9479
					}
9480
					newVal = this._trimAlignValue( curVal - step );
9481
					break;
9482
			}
9483
9484
			this._slide( event, index, newVal );
9485
		},
9486
		keyup: function( event ) {
9487
			var index = $( event.target ).data( "ui-slider-handle-index" );
9488
9489
			if ( this._keySliding ) {
9490
				this._keySliding = false;
9491
				this._stop( event, index );
9492
				this._change( event, index );
9493
				$( event.target ).removeClass( "ui-state-active" );
9494
			}
9495
		}
9496
	}
9497
});
9498
9499
9500
/*!
9501
 * jQuery UI Tabs 1.11.4
9502
 * http://jqueryui.com
9503
 *
9504
 * Copyright jQuery Foundation and other contributors
9505
 * Released under the MIT license.
9506
 * http://jquery.org/license
9507
 *
9508
 * http://api.jqueryui.com/tabs/
9509
 */
9510
9511
9512
var tabs = $.widget( "ui.tabs", {
9513
	version: "1.11.4",
9514
	delay: 300,
9515
	options: {
9516
		active: null,
9517
		collapsible: false,
9518
		event: "click",
9519
		heightStyle: "content",
9520
		hide: null,
9521
		show: null,
9522
9523
		// callbacks
9524
		activate: null,
9525
		beforeActivate: null,
9526
		beforeLoad: null,
9527
		load: null
9528
	},
9529
9530
	_isLocal: (function() {
9531
		var rhash = /#.*$/;
9532
9533
		return function( anchor ) {
9534
			var anchorUrl, locationUrl;
9535
9536
			// support: IE7
9537
			// IE7 doesn't normalize the href property when set via script (#9317)
9538
			anchor = anchor.cloneNode( false );
9539
9540
			anchorUrl = anchor.href.replace( rhash, "" );
9541
			locationUrl = location.href.replace( rhash, "" );
9542
9543
			// decoding may throw an error if the URL isn't UTF-8 (#9518)
9544
			try {
9545
				anchorUrl = decodeURIComponent( anchorUrl );
9546
			} catch ( error ) {}
9547
			try {
9548
				locationUrl = decodeURIComponent( locationUrl );
9549
			} catch ( error ) {}
9550
9551
			return anchor.hash.length > 1 && anchorUrl === locationUrl;
9552
		};
9553
	})(),
9554
9555
	_create: function() {
9556
		var that = this,
9557
			options = this.options;
9558
9559
		this.running = false;
9560
9561
		this.element
9562
			.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
9563
			.toggleClass( "ui-tabs-collapsible", options.collapsible );
9564
9565
		this._processTabs();
9566
		options.active = this._initialActive();
9567
9568
		// Take disabling tabs via class attribute from HTML
9569
		// into account and update option properly.
9570
		if ( $.isArray( options.disabled ) ) {
9571
			options.disabled = $.unique( options.disabled.concat(
9572
				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
9573
					return that.tabs.index( li );
9574
				})
9575
			) ).sort();
9576
		}
9577
9578
		// check for length avoids error when initializing empty list
9579
		if ( this.options.active !== false && this.anchors.length ) {
9580
			this.active = this._findActive( options.active );
9581
		} else {
9582
			this.active = $();
9583
		}
9584
9585
		this._refresh();
9586
9587
		if ( this.active.length ) {
9588
			this.load( options.active );
9589
		}
9590
	},
9591
9592
	_initialActive: function() {
9593
		var active = this.options.active,
9594
			collapsible = this.options.collapsible,
9595
			locationHash = location.hash.substring( 1 );
9596
9597
		if ( active === null ) {
9598
			// check the fragment identifier in the URL
9599
			if ( locationHash ) {
9600
				this.tabs.each(function( i, tab ) {
9601
					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
9602
						active = i;
9603
						return false;
9604
					}
9605
				});
9606
			}
9607
9608
			// check for a tab marked active via a class
9609
			if ( active === null ) {
9610
				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
9611
			}
9612
9613
			// no active tab, set to false
9614
			if ( active === null || active === -1 ) {
9615
				active = this.tabs.length ? 0 : false;
9616
			}
9617
		}
9618
9619
		// handle numbers: negative, out of range
9620
		if ( active !== false ) {
9621
			active = this.tabs.index( this.tabs.eq( active ) );
9622
			if ( active === -1 ) {
9623
				active = collapsible ? false : 0;
9624
			}
9625
		}
9626
9627
		// don't allow collapsible: false and active: false
9628
		if ( !collapsible && active === false && this.anchors.length ) {
9629
			active = 0;
9630
		}
9631
9632
		return active;
9633
	},
9634
9635
	_getCreateEventData: function() {
9636
		return {
9637
			tab: this.active,
9638
			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
9639
		};
9640
	},
9641
9642
	_tabKeydown: function( event ) {
9643
		var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
9644
			selectedIndex = this.tabs.index( focusedTab ),
9645
			goingForward = true;
9646
9647
		if ( this._handlePageNav( event ) ) {
9648
			return;
9649
		}
9650
9651
		switch ( event.keyCode ) {
9652
			case $.ui.keyCode.RIGHT:
9653
			case $.ui.keyCode.DOWN:
9654
				selectedIndex++;
9655
				break;
9656
			case $.ui.keyCode.UP:
9657
			case $.ui.keyCode.LEFT:
9658
				goingForward = false;
9659
				selectedIndex--;
9660
				break;
9661
			case $.ui.keyCode.END:
9662
				selectedIndex = this.anchors.length - 1;
9663
				break;
9664
			case $.ui.keyCode.HOME:
9665
				selectedIndex = 0;
9666
				break;
9667
			case $.ui.keyCode.SPACE:
9668
				// Activate only, no collapsing
9669
				event.preventDefault();
9670
				clearTimeout( this.activating );
9671
				this._activate( selectedIndex );
9672
				return;
9673
			case $.ui.keyCode.ENTER:
9674
				// Toggle (cancel delayed activation, allow collapsing)
9675
				event.preventDefault();
9676
				clearTimeout( this.activating );
9677
				// Determine if we should collapse or activate
9678
				this._activate( selectedIndex === this.options.active ? false : selectedIndex );
9679
				return;
9680
			default:
9681
				return;
9682
		}
9683
9684
		// Focus the appropriate tab, based on which key was pressed
9685
		event.preventDefault();
9686
		clearTimeout( this.activating );
9687
		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
9688
9689
		// Navigating with control/command key will prevent automatic activation
9690
		if ( !event.ctrlKey && !event.metaKey ) {
9691
9692
			// Update aria-selected immediately so that AT think the tab is already selected.
9693
			// Otherwise AT may confuse the user by stating that they need to activate the tab,
9694
			// but the tab will already be activated by the time the announcement finishes.
9695
			focusedTab.attr( "aria-selected", "false" );
9696
			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
9697
9698
			this.activating = this._delay(function() {
9699
				this.option( "active", selectedIndex );
9700
			}, this.delay );
9701
		}
9702
	},
9703
9704
	_panelKeydown: function( event ) {
9705
		if ( this._handlePageNav( event ) ) {
9706
			return;
9707
		}
9708
9709
		// Ctrl+up moves focus to the current tab
9710
		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
9711
			event.preventDefault();
9712
			this.active.focus();
9713
		}
9714
	},
9715
9716
	// Alt+page up/down moves focus to the previous/next tab (and activates)
9717
	_handlePageNav: function( event ) {
9718
		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
9719
			this._activate( this._focusNextTab( this.options.active - 1, false ) );
9720
			return true;
9721
		}
9722
		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
9723
			this._activate( this._focusNextTab( this.options.active + 1, true ) );
9724
			return true;
9725
		}
9726
	},
9727
9728
	_findNextTab: function( index, goingForward ) {
9729
		var lastTabIndex = this.tabs.length - 1;
9730
9731
		function constrain() {
9732
			if ( index > lastTabIndex ) {
9733
				index = 0;
9734
			}
9735
			if ( index < 0 ) {
9736
				index = lastTabIndex;
9737
			}
9738
			return index;
9739
		}
9740
9741
		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
9742
			index = goingForward ? index + 1 : index - 1;
9743
		}
9744
9745
		return index;
9746
	},
9747
9748
	_focusNextTab: function( index, goingForward ) {
9749
		index = this._findNextTab( index, goingForward );
9750
		this.tabs.eq( index ).focus();
9751
		return index;
9752
	},
9753
9754
	_setOption: function( key, value ) {
9755
		if ( key === "active" ) {
9756
			// _activate() will handle invalid values and update this.options
9757
			this._activate( value );
9758
			return;
9759
		}
9760
9761
		if ( key === "disabled" ) {
9762
			// don't use the widget factory's disabled handling
9763
			this._setupDisabled( value );
9764
			return;
9765
		}
9766
9767
		this._super( key, value);
9768
9769
		if ( key === "collapsible" ) {
9770
			this.element.toggleClass( "ui-tabs-collapsible", value );
9771
			// Setting collapsible: false while collapsed; open first panel
9772
			if ( !value && this.options.active === false ) {
9773
				this._activate( 0 );
9774
			}
9775
		}
9776
9777
		if ( key === "event" ) {
9778
			this._setupEvents( value );
9779
		}
9780
9781
		if ( key === "heightStyle" ) {
9782
			this._setupHeightStyle( value );
9783
		}
9784
	},
9785
9786
	_sanitizeSelector: function( hash ) {
9787
		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
9788
	},
9789
9790
	refresh: function() {
9791
		var options = this.options,
9792
			lis = this.tablist.children( ":has(a[href])" );
9793
9794
		// get disabled tabs from class attribute from HTML
9795
		// this will get converted to a boolean if needed in _refresh()
9796
		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
9797
			return lis.index( tab );
9798
		});
9799
9800
		this._processTabs();
9801
9802
		// was collapsed or no tabs
9803
		if ( options.active === false || !this.anchors.length ) {
9804
			options.active = false;
9805
			this.active = $();
9806
		// was active, but active tab is gone
9807
		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
9808
			// all remaining tabs are disabled
9809
			if ( this.tabs.length === options.disabled.length ) {
9810
				options.active = false;
9811
				this.active = $();
9812
			// activate previous tab
9813
			} else {
9814
				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
9815
			}
9816
		// was active, active tab still exists
9817
		} else {
9818
			// make sure active index is correct
9819
			options.active = this.tabs.index( this.active );
9820
		}
9821
9822
		this._refresh();
9823
	},
9824
9825
	_refresh: function() {
9826
		this._setupDisabled( this.options.disabled );
9827
		this._setupEvents( this.options.event );
9828
		this._setupHeightStyle( this.options.heightStyle );
9829
9830
		this.tabs.not( this.active ).attr({
9831
			"aria-selected": "false",
9832
			"aria-expanded": "false",
9833
			tabIndex: -1
9834
		});
9835
		this.panels.not( this._getPanelForTab( this.active ) )
9836
			.hide()
9837
			.attr({
9838
				"aria-hidden": "true"
9839
			});
9840
9841
		// Make sure one tab is in the tab order
9842
		if ( !this.active.length ) {
9843
			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
9844
		} else {
9845
			this.active
9846
				.addClass( "ui-tabs-active ui-state-active" )
9847
				.attr({
9848
					"aria-selected": "true",
9849
					"aria-expanded": "true",
9850
					tabIndex: 0
9851
				});
9852
			this._getPanelForTab( this.active )
9853
				.show()
9854
				.attr({
9855
					"aria-hidden": "false"
9856
				});
9857
		}
9858
	},
9859
9860
	_processTabs: function() {
9861
		var that = this,
9862
			prevTabs = this.tabs,
9863
			prevAnchors = this.anchors,
9864
			prevPanels = this.panels;
9865
9866
		this.tablist = this._getList()
9867
			.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
9868
			.attr( "role", "tablist" )
9869
9870
			// Prevent users from focusing disabled tabs via click
9871
			.delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
9872
				if ( $( this ).is( ".ui-state-disabled" ) ) {
9873
					event.preventDefault();
9874
				}
9875
			})
9876
9877
			// support: IE <9
9878
			// Preventing the default action in mousedown doesn't prevent IE
9879
			// from focusing the element, so if the anchor gets focused, blur.
9880
			// We don't have to worry about focusing the previously focused
9881
			// element since clicking on a non-focusable element should focus
9882
			// the body anyway.
9883
			.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
9884
				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
9885
					this.blur();
9886
				}
9887
			});
9888
9889
		this.tabs = this.tablist.find( "> li:has(a[href])" )
9890
			.addClass( "ui-state-default ui-corner-top" )
9891
			.attr({
9892
				role: "tab",
9893
				tabIndex: -1
9894
			});
9895
9896
		this.anchors = this.tabs.map(function() {
9897
				return $( "a", this )[ 0 ];
9898
			})
9899
			.addClass( "ui-tabs-anchor" )
9900
			.attr({
9901
				role: "presentation",
9902
				tabIndex: -1
9903
			});
9904
9905
		this.panels = $();
9906
9907
		this.anchors.each(function( i, anchor ) {
9908
			var selector, panel, panelId,
9909
				anchorId = $( anchor ).uniqueId().attr( "id" ),
9910
				tab = $( anchor ).closest( "li" ),
9911
				originalAriaControls = tab.attr( "aria-controls" );
9912
9913
			// inline tab
9914
			if ( that._isLocal( anchor ) ) {
9915
				selector = anchor.hash;
9916
				panelId = selector.substring( 1 );
9917
				panel = that.element.find( that._sanitizeSelector( selector ) );
9918
			// remote tab
9919
			} else {
9920
				// If the tab doesn't already have aria-controls,
9921
				// generate an id by using a throw-away element
9922
				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
9923
				selector = "#" + panelId;
9924
				panel = that.element.find( selector );
9925
				if ( !panel.length ) {
9926
					panel = that._createPanel( panelId );
9927
					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
9928
				}
9929
				panel.attr( "aria-live", "polite" );
9930
			}
9931
9932
			if ( panel.length) {
9933
				that.panels = that.panels.add( panel );
9934
			}
9935
			if ( originalAriaControls ) {
9936
				tab.data( "ui-tabs-aria-controls", originalAriaControls );
9937
			}
9938
			tab.attr({
9939
				"aria-controls": panelId,
9940
				"aria-labelledby": anchorId
9941
			});
9942
			panel.attr( "aria-labelledby", anchorId );
9943
		});
9944
9945
		this.panels
9946
			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
9947
			.attr( "role", "tabpanel" );
9948
9949
		// Avoid memory leaks (#10056)
9950
		if ( prevTabs ) {
9951
			this._off( prevTabs.not( this.tabs ) );
9952
			this._off( prevAnchors.not( this.anchors ) );
9953
			this._off( prevPanels.not( this.panels ) );
9954
		}
9955
	},
9956
9957
	// allow overriding how to find the list for rare usage scenarios (#7715)
9958
	_getList: function() {
9959
		return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
9960
	},
9961
9962
	_createPanel: function( id ) {
9963
		return $( "<div>" )
9964
			.attr( "id", id )
9965
			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
9966
			.data( "ui-tabs-destroy", true );
9967
	},
9968
9969
	_setupDisabled: function( disabled ) {
9970
		if ( $.isArray( disabled ) ) {
9971
			if ( !disabled.length ) {
9972
				disabled = false;
9973
			} else if ( disabled.length === this.anchors.length ) {
9974
				disabled = true;
9975
			}
9976
		}
9977
9978
		// disable tabs
9979
		for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
9980
			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
9981
				$( li )
9982
					.addClass( "ui-state-disabled" )
9983
					.attr( "aria-disabled", "true" );
9984
			} else {
9985
				$( li )
9986
					.removeClass( "ui-state-disabled" )
9987
					.removeAttr( "aria-disabled" );
9988
			}
9989
		}
9990
9991
		this.options.disabled = disabled;
9992
	},
9993
9994
	_setupEvents: function( event ) {
9995
		var events = {};
9996
		if ( event ) {
9997
			$.each( event.split(" "), function( index, eventName ) {
9998
				events[ eventName ] = "_eventHandler";
9999
			});
10000
		}
10001
10002
		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
10003
		// Always prevent the default action, even when disabled
10004
		this._on( true, this.anchors, {
10005
			click: function( event ) {
10006
				event.preventDefault();
10007
			}
10008
		});
10009
		this._on( this.anchors, events );
10010
		this._on( this.tabs, { keydown: "_tabKeydown" } );
10011
		this._on( this.panels, { keydown: "_panelKeydown" } );
10012
10013
		this._focusable( this.tabs );
10014
		this._hoverable( this.tabs );
10015
	},
10016
10017
	_setupHeightStyle: function( heightStyle ) {
10018
		var maxHeight,
10019
			parent = this.element.parent();
10020
10021
		if ( heightStyle === "fill" ) {
10022
			maxHeight = parent.height();
10023
			maxHeight -= this.element.outerHeight() - this.element.height();
10024
10025
			this.element.siblings( ":visible" ).each(function() {
10026
				var elem = $( this ),
10027
					position = elem.css( "position" );
10028
10029
				if ( position === "absolute" || position === "fixed" ) {
10030
					return;
10031
				}
10032
				maxHeight -= elem.outerHeight( true );
10033
			});
10034
10035
			this.element.children().not( this.panels ).each(function() {
10036
				maxHeight -= $( this ).outerHeight( true );
10037
			});
10038
10039
			this.panels.each(function() {
10040
				$( this ).height( Math.max( 0, maxHeight -
10041
					$( this ).innerHeight() + $( this ).height() ) );
10042
			})
10043
			.css( "overflow", "auto" );
10044
		} else if ( heightStyle === "auto" ) {
10045
			maxHeight = 0;
10046
			this.panels.each(function() {
10047
				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
10048
			}).height( maxHeight );
10049
		}
10050
	},
10051
10052
	_eventHandler: function( event ) {
10053
		var options = this.options,
10054
			active = this.active,
10055
			anchor = $( event.currentTarget ),
10056
			tab = anchor.closest( "li" ),
10057
			clickedIsActive = tab[ 0 ] === active[ 0 ],
10058
			collapsing = clickedIsActive && options.collapsible,
10059
			toShow = collapsing ? $() : this._getPanelForTab( tab ),
10060
			toHide = !active.length ? $() : this._getPanelForTab( active ),
10061
			eventData = {
10062
				oldTab: active,
10063
				oldPanel: toHide,
10064
				newTab: collapsing ? $() : tab,
10065
				newPanel: toShow
10066
			};
10067
10068
		event.preventDefault();
10069
10070
		if ( tab.hasClass( "ui-state-disabled" ) ||
10071
				// tab is already loading
10072
				tab.hasClass( "ui-tabs-loading" ) ||
10073
				// can't switch durning an animation
10074
				this.running ||
10075
				// click on active header, but not collapsible
10076
				( clickedIsActive && !options.collapsible ) ||
10077
				// allow canceling activation
10078
				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
10079
			return;
10080
		}
10081
10082
		options.active = collapsing ? false : this.tabs.index( tab );
10083
10084
		this.active = clickedIsActive ? $() : tab;
10085
		if ( this.xhr ) {
10086
			this.xhr.abort();
10087
		}
10088
10089
		if ( !toHide.length && !toShow.length ) {
10090
			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
10091
		}
10092
10093
		if ( toShow.length ) {
10094
			this.load( this.tabs.index( tab ), event );
10095
		}
10096
		this._toggle( event, eventData );
10097
	},
10098
10099
	// handles show/hide for selecting tabs
10100
	_toggle: function( event, eventData ) {
10101
		var that = this,
10102
			toShow = eventData.newPanel,
10103
			toHide = eventData.oldPanel;
10104
10105
		this.running = true;
10106
10107
		function complete() {
10108
			that.running = false;
10109
			that._trigger( "activate", event, eventData );
10110
		}
10111
10112
		function show() {
10113
			eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
10114
10115
			if ( toShow.length && that.options.show ) {
10116
				that._show( toShow, that.options.show, complete );
10117
			} else {
10118
				toShow.show();
10119
				complete();
10120
			}
10121
		}
10122
10123
		// start out by hiding, then showing, then completing
10124
		if ( toHide.length && this.options.hide ) {
10125
			this._hide( toHide, this.options.hide, function() {
10126
				eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
10127
				show();
10128
			});
10129
		} else {
10130
			eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
10131
			toHide.hide();
10132
			show();
10133
		}
10134
10135
		toHide.attr( "aria-hidden", "true" );
10136
		eventData.oldTab.attr({
10137
			"aria-selected": "false",
10138
			"aria-expanded": "false"
10139
		});
10140
		// If we're switching tabs, remove the old tab from the tab order.
10141
		// If we're opening from collapsed state, remove the previous tab from the tab order.
10142
		// If we're collapsing, then keep the collapsing tab in the tab order.
10143
		if ( toShow.length && toHide.length ) {
10144
			eventData.oldTab.attr( "tabIndex", -1 );
10145
		} else if ( toShow.length ) {
10146
			this.tabs.filter(function() {
10147
				return $( this ).attr( "tabIndex" ) === 0;
10148
			})
10149
			.attr( "tabIndex", -1 );
10150
		}
10151
10152
		toShow.attr( "aria-hidden", "false" );
10153
		eventData.newTab.attr({
10154
			"aria-selected": "true",
10155
			"aria-expanded": "true",
10156
			tabIndex: 0
10157
		});
10158
	},
10159
10160
	_activate: function( index ) {
10161
		var anchor,
10162
			active = this._findActive( index );
10163
10164
		// trying to activate the already active panel
10165
		if ( active[ 0 ] === this.active[ 0 ] ) {
10166
			return;
10167
		}
10168
10169
		// trying to collapse, simulate a click on the current active header
10170
		if ( !active.length ) {
10171
			active = this.active;
10172
		}
10173
10174
		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
10175
		this._eventHandler({
10176
			target: anchor,
10177
			currentTarget: anchor,
10178
			preventDefault: $.noop
10179
		});
10180
	},
10181
10182
	_findActive: function( index ) {
10183
		return index === false ? $() : this.tabs.eq( index );
10184
	},
10185
10186
	_getIndex: function( index ) {
10187
		// meta-function to give users option to provide a href string instead of a numerical index.
10188
		if ( typeof index === "string" ) {
10189
			index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
10190
		}
10191
10192
		return index;
10193
	},
10194
10195
	_destroy: function() {
10196
		if ( this.xhr ) {
10197
			this.xhr.abort();
10198
		}
10199
10200
		this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
10201
10202
		this.tablist
10203
			.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
10204
			.removeAttr( "role" );
10205
10206
		this.anchors
10207
			.removeClass( "ui-tabs-anchor" )
10208
			.removeAttr( "role" )
10209
			.removeAttr( "tabIndex" )
10210
			.removeUniqueId();
10211
10212
		this.tablist.unbind( this.eventNamespace );
10213
10214
		this.tabs.add( this.panels ).each(function() {
10215
			if ( $.data( this, "ui-tabs-destroy" ) ) {
10216
				$( this ).remove();
10217
			} else {
10218
				$( this )
10219
					.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
10220
						"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
10221
					.removeAttr( "tabIndex" )
10222
					.removeAttr( "aria-live" )
10223
					.removeAttr( "aria-busy" )
10224
					.removeAttr( "aria-selected" )
10225
					.removeAttr( "aria-labelledby" )
10226
					.removeAttr( "aria-hidden" )
10227
					.removeAttr( "aria-expanded" )
10228
					.removeAttr( "role" );
10229
			}
10230
		});
10231
10232
		this.tabs.each(function() {
10233
			var li = $( this ),
10234
				prev = li.data( "ui-tabs-aria-controls" );
10235
			if ( prev ) {
10236
				li
10237
					.attr( "aria-controls", prev )
10238
					.removeData( "ui-tabs-aria-controls" );
10239
			} else {
10240
				li.removeAttr( "aria-controls" );
10241
			}
10242
		});
10243
10244
		this.panels.show();
10245
10246
		if ( this.options.heightStyle !== "content" ) {
10247
			this.panels.css( "height", "" );
10248
		}
10249
	},
10250
10251
	enable: function( index ) {
10252
		var disabled = this.options.disabled;
10253
		if ( disabled === false ) {
10254
			return;
10255
		}
10256
10257
		if ( index === undefined ) {
10258
			disabled = false;
10259
		} else {
10260
			index = this._getIndex( index );
10261
			if ( $.isArray( disabled ) ) {
10262
				disabled = $.map( disabled, function( num ) {
10263
					return num !== index ? num : null;
10264
				});
10265
			} else {
10266
				disabled = $.map( this.tabs, function( li, num ) {
10267
					return num !== index ? num : null;
10268
				});
10269
			}
10270
		}
10271
		this._setupDisabled( disabled );
10272
	},
10273
10274
	disable: function( index ) {
10275
		var disabled = this.options.disabled;
10276
		if ( disabled === true ) {
10277
			return;
10278
		}
10279
10280
		if ( index === undefined ) {
10281
			disabled = true;
10282
		} else {
10283
			index = this._getIndex( index );
10284
			if ( $.inArray( index, disabled ) !== -1 ) {
10285
				return;
10286
			}
10287
			if ( $.isArray( disabled ) ) {
10288
				disabled = $.merge( [ index ], disabled ).sort();
10289
			} else {
10290
				disabled = [ index ];
10291
			}
10292
		}
10293
		this._setupDisabled( disabled );
10294
	},
10295
10296
	load: function( index, event ) {
10297
		index = this._getIndex( index );
10298
		var that = this,
10299
			tab = this.tabs.eq( index ),
10300
			anchor = tab.find( ".ui-tabs-anchor" ),
10301
			panel = this._getPanelForTab( tab ),
10302
			eventData = {
10303
				tab: tab,
10304
				panel: panel
10305
			},
10306
			complete = function( jqXHR, status ) {
10307
				if ( status === "abort" ) {
10308
					that.panels.stop( false, true );
10309
				}
10310
10311
				tab.removeClass( "ui-tabs-loading" );
10312
				panel.removeAttr( "aria-busy" );
10313
10314
				if ( jqXHR === that.xhr ) {
10315
					delete that.xhr;
10316
				}
10317
			};
10318
10319
		// not remote
10320
		if ( this._isLocal( anchor[ 0 ] ) ) {
10321
			return;
10322
		}
10323
10324
		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
10325
10326
		// support: jQuery <1.8
10327
		// jQuery <1.8 returns false if the request is canceled in beforeSend,
10328
		// but as of 1.8, $.ajax() always returns a jqXHR object.
10329
		if ( this.xhr && this.xhr.statusText !== "canceled" ) {
10330
			tab.addClass( "ui-tabs-loading" );
10331
			panel.attr( "aria-busy", "true" );
10332
10333
			this.xhr
10334
				.done(function( response, status, jqXHR ) {
10335
					// support: jQuery <1.8
10336
					// http://bugs.jquery.com/ticket/11778
10337
					setTimeout(function() {
10338
						panel.html( response );
10339
						that._trigger( "load", event, eventData );
10340
10341
						complete( jqXHR, status );
10342
					}, 1 );
10343
				})
10344
				.fail(function( jqXHR, status ) {
10345
					// support: jQuery <1.8
10346
					// http://bugs.jquery.com/ticket/11778
10347
					setTimeout(function() {
10348
						complete( jqXHR, status );
10349
					}, 1 );
10350
				});
10351
		}
10352
	},
10353
10354
	_ajaxSettings: function( anchor, event, eventData ) {
10355
		var that = this;
10356
		return {
10357
			url: anchor.attr( "href" ),
10358
			beforeSend: function( jqXHR, settings ) {
10359
				return that._trigger( "beforeLoad", event,
10360
					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
10361
			}
10362
		};
10363
	},
10364
10365
	_getPanelForTab: function( tab ) {
10366
		var id = $( tab ).attr( "aria-controls" );
10367
		return this.element.find( this._sanitizeSelector( "#" + id ) );
10368
	}
10369
});
10370
10371
10372
/*!
10373
 * jQuery UI Effects 1.11.4
10374
 * http://jqueryui.com
10375
 *
10376
 * Copyright jQuery Foundation and other contributors
10377
 * Released under the MIT license.
10378
 * http://jquery.org/license
10379
 *
10380
 * http://api.jqueryui.com/category/effects-core/
10381
 */
10382
10383
10384
var dataSpace = "ui-effects-",
10385
10386
	// Create a local jQuery because jQuery Color relies on it and the
10387
	// global may not exist with AMD and a custom build (#10199)
10388
	jQuery = $;
10389
10390
$.effects = {
10391
	effect: {}
10392
};
10393
10394
/*!
10395
 * jQuery Color Animations v2.1.2
10396
 * https://github.com/jquery/jquery-color
10397
 *
10398
 * Copyright 2014 jQuery Foundation and other contributors
10399
 * Released under the MIT license.
10400
 * http://jquery.org/license
10401
 *
10402
 * Date: Wed Jan 16 08:47:09 2013 -0600
10403
 */
10404
(function( jQuery, undefined ) {
10405
10406
	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
10407
10408
	// plusequals test for += 100 -= 100
10409
	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
10410
	// a set of RE's that can match strings and generate color tuples.
10411
	stringParsers = [ {
10412
			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10413
			parse: function( execResult ) {
10414
				return [
10415
					execResult[ 1 ],
10416
					execResult[ 2 ],
10417
					execResult[ 3 ],
10418
					execResult[ 4 ]
10419
				];
10420
			}
10421
		}, {
10422
			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10423
			parse: function( execResult ) {
10424
				return [
10425
					execResult[ 1 ] * 2.55,
10426
					execResult[ 2 ] * 2.55,
10427
					execResult[ 3 ] * 2.55,
10428
					execResult[ 4 ]
10429
				];
10430
			}
10431
		}, {
10432
			// this regex ignores A-F because it's compared against an already lowercased string
10433
			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
10434
			parse: function( execResult ) {
10435
				return [
10436
					parseInt( execResult[ 1 ], 16 ),
10437
					parseInt( execResult[ 2 ], 16 ),
10438
					parseInt( execResult[ 3 ], 16 )
10439
				];
10440
			}
10441
		}, {
10442
			// this regex ignores A-F because it's compared against an already lowercased string
10443
			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
10444
			parse: function( execResult ) {
10445
				return [
10446
					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
10447
					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
10448
					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
10449
				];
10450
			}
10451
		}, {
10452
			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10453
			space: "hsla",
10454
			parse: function( execResult ) {
10455
				return [
10456
					execResult[ 1 ],
10457
					execResult[ 2 ] / 100,
10458
					execResult[ 3 ] / 100,
10459
					execResult[ 4 ]
10460
				];
10461
			}
10462
		} ],
10463
10464
	// jQuery.Color( )
10465
	color = jQuery.Color = function( color, green, blue, alpha ) {
10466
		return new jQuery.Color.fn.parse( color, green, blue, alpha );
10467
	},
10468
	spaces = {
10469
		rgba: {
10470
			props: {
10471
				red: {
10472
					idx: 0,
10473
					type: "byte"
10474
				},
10475
				green: {
10476
					idx: 1,
10477
					type: "byte"
10478
				},
10479
				blue: {
10480
					idx: 2,
10481
					type: "byte"
10482
				}
10483
			}
10484
		},
10485
10486
		hsla: {
10487
			props: {
10488
				hue: {
10489
					idx: 0,
10490
					type: "degrees"
10491
				},
10492
				saturation: {
10493
					idx: 1,
10494
					type: "percent"
10495
				},
10496
				lightness: {
10497
					idx: 2,
10498
					type: "percent"
10499
				}
10500
			}
10501
		}
10502
	},
10503
	propTypes = {
10504
		"byte": {
10505
			floor: true,
10506
			max: 255
10507
		},
10508
		"percent": {
10509
			max: 1
10510
		},
10511
		"degrees": {
10512
			mod: 360,
10513
			floor: true
10514
		}
10515
	},
10516
	support = color.support = {},
10517
10518
	// element for support tests
10519
	supportElem = jQuery( "<p>" )[ 0 ],
10520
10521
	// colors = jQuery.Color.names
10522
	colors,
10523
10524
	// local aliases of functions called often
10525
	each = jQuery.each;
10526
10527
// determine rgba support immediately
10528
supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
10529
support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
10530
10531
// define cache name and alpha properties
10532
// for rgba and hsla spaces
10533
each( spaces, function( spaceName, space ) {
10534
	space.cache = "_" + spaceName;
10535
	space.props.alpha = {
10536
		idx: 3,
10537
		type: "percent",
10538
		def: 1
10539
	};
10540
});
10541
10542
function clamp( value, prop, allowEmpty ) {
10543
	var type = propTypes[ prop.type ] || {};
10544
10545
	if ( value == null ) {
10546
		return (allowEmpty || !prop.def) ? null : prop.def;
10547
	}
10548
10549
	// ~~ is an short way of doing floor for positive numbers
10550
	value = type.floor ? ~~value : parseFloat( value );
10551
10552
	// IE will pass in empty strings as value for alpha,
10553
	// which will hit this case
10554
	if ( isNaN( value ) ) {
10555
		return prop.def;
10556
	}
10557
10558
	if ( type.mod ) {
10559
		// we add mod before modding to make sure that negatives values
10560
		// get converted properly: -10 -> 350
10561
		return (value + type.mod) % type.mod;
10562
	}
10563
10564
	// for now all property types without mod have min and max
10565
	return 0 > value ? 0 : type.max < value ? type.max : value;
10566
}
10567
10568
function stringParse( string ) {
10569
	var inst = color(),
10570
		rgba = inst._rgba = [];
10571
10572
	string = string.toLowerCase();
10573
10574
	each( stringParsers, function( i, parser ) {
10575
		var parsed,
10576
			match = parser.re.exec( string ),
10577
			values = match && parser.parse( match ),
10578
			spaceName = parser.space || "rgba";
10579
10580
		if ( values ) {
10581
			parsed = inst[ spaceName ]( values );
10582
10583
			// if this was an rgba parse the assignment might happen twice
10584
			// oh well....
10585
			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
10586
			rgba = inst._rgba = parsed._rgba;
10587
10588
			// exit each( stringParsers ) here because we matched
10589
			return false;
10590
		}
10591
	});
10592
10593
	// Found a stringParser that handled it
10594
	if ( rgba.length ) {
10595
10596
		// if this came from a parsed string, force "transparent" when alpha is 0
10597
		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
10598
		if ( rgba.join() === "0,0,0,0" ) {
10599
			jQuery.extend( rgba, colors.transparent );
10600
		}
10601
		return inst;
10602
	}
10603
10604
	// named colors
10605
	return colors[ string ];
10606
}
10607
10608
color.fn = jQuery.extend( color.prototype, {
10609
	parse: function( red, green, blue, alpha ) {
10610
		if ( red === undefined ) {
10611
			this._rgba = [ null, null, null, null ];
10612
			return this;
10613
		}
10614
		if ( red.jquery || red.nodeType ) {
10615
			red = jQuery( red ).css( green );
10616
			green = undefined;
10617
		}
10618
10619
		var inst = this,
10620
			type = jQuery.type( red ),
10621
			rgba = this._rgba = [];
10622
10623
		// more than 1 argument specified - assume ( red, green, blue, alpha )
10624
		if ( green !== undefined ) {
10625
			red = [ red, green, blue, alpha ];
10626
			type = "array";
10627
		}
10628
10629
		if ( type === "string" ) {
10630
			return this.parse( stringParse( red ) || colors._default );
10631
		}
10632
10633
		if ( type === "array" ) {
10634
			each( spaces.rgba.props, function( key, prop ) {
10635
				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
10636
			});
10637
			return this;
10638
		}
10639
10640
		if ( type === "object" ) {
10641
			if ( red instanceof color ) {
10642
				each( spaces, function( spaceName, space ) {
10643
					if ( red[ space.cache ] ) {
10644
						inst[ space.cache ] = red[ space.cache ].slice();
10645
					}
10646
				});
10647
			} else {
10648
				each( spaces, function( spaceName, space ) {
10649
					var cache = space.cache;
10650
					each( space.props, function( key, prop ) {
10651
10652
						// if the cache doesn't exist, and we know how to convert
10653
						if ( !inst[ cache ] && space.to ) {
10654
10655
							// if the value was null, we don't need to copy it
10656
							// if the key was alpha, we don't need to copy it either
10657
							if ( key === "alpha" || red[ key ] == null ) {
10658
								return;
10659
							}
10660
							inst[ cache ] = space.to( inst._rgba );
10661
						}
10662
10663
						// this is the only case where we allow nulls for ALL properties.
10664
						// call clamp with alwaysAllowEmpty
10665
						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
10666
					});
10667
10668
					// everything defined but alpha?
10669
					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
10670
						// use the default of 1
10671
						inst[ cache ][ 3 ] = 1;
10672
						if ( space.from ) {
10673
							inst._rgba = space.from( inst[ cache ] );
10674
						}
10675
					}
10676
				});
10677
			}
10678
			return this;
10679
		}
10680
	},
10681
	is: function( compare ) {
10682
		var is = color( compare ),
10683
			same = true,
10684
			inst = this;
10685
10686
		each( spaces, function( _, space ) {
10687
			var localCache,
10688
				isCache = is[ space.cache ];
10689
			if (isCache) {
10690
				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
10691
				each( space.props, function( _, prop ) {
10692
					if ( isCache[ prop.idx ] != null ) {
10693
						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
10694
						return same;
10695
					}
10696
				});
10697
			}
10698
			return same;
10699
		});
10700
		return same;
10701
	},
10702
	_space: function() {
10703
		var used = [],
10704
			inst = this;
10705
		each( spaces, function( spaceName, space ) {
10706
			if ( inst[ space.cache ] ) {
10707
				used.push( spaceName );
10708
			}
10709
		});
10710
		return used.pop();
10711
	},
10712
	transition: function( other, distance ) {
10713
		var end = color( other ),
10714
			spaceName = end._space(),
10715
			space = spaces[ spaceName ],
10716
			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
10717
			start = startColor[ space.cache ] || space.to( startColor._rgba ),
10718
			result = start.slice();
10719
10720
		end = end[ space.cache ];
10721
		each( space.props, function( key, prop ) {
10722
			var index = prop.idx,
10723
				startValue = start[ index ],
10724
				endValue = end[ index ],
10725
				type = propTypes[ prop.type ] || {};
10726
10727
			// if null, don't override start value
10728
			if ( endValue === null ) {
10729
				return;
10730
			}
10731
			// if null - use end
10732
			if ( startValue === null ) {
10733
				result[ index ] = endValue;
10734
			} else {
10735
				if ( type.mod ) {
10736
					if ( endValue - startValue > type.mod / 2 ) {
10737
						startValue += type.mod;
10738
					} else if ( startValue - endValue > type.mod / 2 ) {
10739
						startValue -= type.mod;
10740
					}
10741
				}
10742
				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
10743
			}
10744
		});
10745
		return this[ spaceName ]( result );
10746
	},
10747
	blend: function( opaque ) {
10748
		// if we are already opaque - return ourself
10749
		if ( this._rgba[ 3 ] === 1 ) {
10750
			return this;
10751
		}
10752
10753
		var rgb = this._rgba.slice(),
10754
			a = rgb.pop(),
10755
			blend = color( opaque )._rgba;
10756
10757
		return color( jQuery.map( rgb, function( v, i ) {
10758
			return ( 1 - a ) * blend[ i ] + a * v;
10759
		}));
10760
	},
10761
	toRgbaString: function() {
10762
		var prefix = "rgba(",
10763
			rgba = jQuery.map( this._rgba, function( v, i ) {
10764
				return v == null ? ( i > 2 ? 1 : 0 ) : v;
10765
			});
10766
10767
		if ( rgba[ 3 ] === 1 ) {
10768
			rgba.pop();
10769
			prefix = "rgb(";
10770
		}
10771
10772
		return prefix + rgba.join() + ")";
10773
	},
10774
	toHslaString: function() {
10775
		var prefix = "hsla(",
10776
			hsla = jQuery.map( this.hsla(), function( v, i ) {
10777
				if ( v == null ) {
10778
					v = i > 2 ? 1 : 0;
10779
				}
10780
10781
				// catch 1 and 2
10782
				if ( i && i < 3 ) {
10783
					v = Math.round( v * 100 ) + "%";
10784
				}
10785
				return v;
10786
			});
10787
10788
		if ( hsla[ 3 ] === 1 ) {
10789
			hsla.pop();
10790
			prefix = "hsl(";
10791
		}
10792
		return prefix + hsla.join() + ")";
10793
	},
10794
	toHexString: function( includeAlpha ) {
10795
		var rgba = this._rgba.slice(),
10796
			alpha = rgba.pop();
10797
10798
		if ( includeAlpha ) {
10799
			rgba.push( ~~( alpha * 255 ) );
10800
		}
10801
10802
		return "#" + jQuery.map( rgba, function( v ) {
10803
10804
			// default to 0 when nulls exist
10805
			v = ( v || 0 ).toString( 16 );
10806
			return v.length === 1 ? "0" + v : v;
10807
		}).join("");
10808
	},
10809
	toString: function() {
10810
		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
10811
	}
10812
});
10813
color.fn.parse.prototype = color.fn;
10814
10815
// hsla conversions adapted from:
10816
// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
10817
10818
function hue2rgb( p, q, h ) {
10819
	h = ( h + 1 ) % 1;
10820
	if ( h * 6 < 1 ) {
10821
		return p + ( q - p ) * h * 6;
10822
	}
10823
	if ( h * 2 < 1) {
10824
		return q;
10825
	}
10826
	if ( h * 3 < 2 ) {
10827
		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
10828
	}
10829
	return p;
10830
}
10831
10832
spaces.hsla.to = function( rgba ) {
10833
	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
10834
		return [ null, null, null, rgba[ 3 ] ];
10835
	}
10836
	var r = rgba[ 0 ] / 255,
10837
		g = rgba[ 1 ] / 255,
10838
		b = rgba[ 2 ] / 255,
10839
		a = rgba[ 3 ],
10840
		max = Math.max( r, g, b ),
10841
		min = Math.min( r, g, b ),
10842
		diff = max - min,
10843
		add = max + min,
10844
		l = add * 0.5,
10845
		h, s;
10846
10847
	if ( min === max ) {
10848
		h = 0;
10849
	} else if ( r === max ) {
10850
		h = ( 60 * ( g - b ) / diff ) + 360;
10851
	} else if ( g === max ) {
10852
		h = ( 60 * ( b - r ) / diff ) + 120;
10853
	} else {
10854
		h = ( 60 * ( r - g ) / diff ) + 240;
10855
	}
10856
10857
	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
10858
	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
10859
	if ( diff === 0 ) {
10860
		s = 0;
10861
	} else if ( l <= 0.5 ) {
10862
		s = diff / add;
10863
	} else {
10864
		s = diff / ( 2 - add );
10865
	}
10866
	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
10867
};
10868
10869
spaces.hsla.from = function( hsla ) {
10870
	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
10871
		return [ null, null, null, hsla[ 3 ] ];
10872
	}
10873
	var h = hsla[ 0 ] / 360,
10874
		s = hsla[ 1 ],
10875
		l = hsla[ 2 ],
10876
		a = hsla[ 3 ],
10877
		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
10878
		p = 2 * l - q;
10879
10880
	return [
10881
		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
10882
		Math.round( hue2rgb( p, q, h ) * 255 ),
10883
		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
10884
		a
10885
	];
10886
};
10887
10888
each( spaces, function( spaceName, space ) {
10889
	var props = space.props,
10890
		cache = space.cache,
10891
		to = space.to,
10892
		from = space.from;
10893
10894
	// makes rgba() and hsla()
10895
	color.fn[ spaceName ] = function( value ) {
10896
10897
		// generate a cache for this space if it doesn't exist
10898
		if ( to && !this[ cache ] ) {
10899
			this[ cache ] = to( this._rgba );
10900
		}
10901
		if ( value === undefined ) {
10902
			return this[ cache ].slice();
10903
		}
10904
10905
		var ret,
10906
			type = jQuery.type( value ),
10907
			arr = ( type === "array" || type === "object" ) ? value : arguments,
10908
			local = this[ cache ].slice();
10909
10910
		each( props, function( key, prop ) {
10911
			var val = arr[ type === "object" ? key : prop.idx ];
10912
			if ( val == null ) {
10913
				val = local[ prop.idx ];
10914
			}
10915
			local[ prop.idx ] = clamp( val, prop );
10916
		});
10917
10918
		if ( from ) {
10919
			ret = color( from( local ) );
10920
			ret[ cache ] = local;
10921
			return ret;
10922
		} else {
10923
			return color( local );
10924
		}
10925
	};
10926
10927
	// makes red() green() blue() alpha() hue() saturation() lightness()
10928
	each( props, function( key, prop ) {
10929
		// alpha is included in more than one space
10930
		if ( color.fn[ key ] ) {
10931
			return;
10932
		}
10933
		color.fn[ key ] = function( value ) {
10934
			var vtype = jQuery.type( value ),
10935
				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
10936
				local = this[ fn ](),
10937
				cur = local[ prop.idx ],
10938
				match;
10939
10940
			if ( vtype === "undefined" ) {
10941
				return cur;
10942
			}
10943
10944
			if ( vtype === "function" ) {
10945
				value = value.call( this, cur );
10946
				vtype = jQuery.type( value );
10947
			}
10948
			if ( value == null && prop.empty ) {
10949
				return this;
10950
			}
10951
			if ( vtype === "string" ) {
10952
				match = rplusequals.exec( value );
10953
				if ( match ) {
10954
					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
10955
				}
10956
			}
10957
			local[ prop.idx ] = value;
10958
			return this[ fn ]( local );
10959
		};
10960
	});
10961
});
10962
10963
// add cssHook and .fx.step function for each named hook.
10964
// accept a space separated string of properties
10965
color.hook = function( hook ) {
10966
	var hooks = hook.split( " " );
10967
	each( hooks, function( i, hook ) {
10968
		jQuery.cssHooks[ hook ] = {
10969
			set: function( elem, value ) {
10970
				var parsed, curElem,
10971
					backgroundColor = "";
10972
10973
				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
10974
					value = color( parsed || value );
10975
					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
10976
						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
10977
						while (
10978
							(backgroundColor === "" || backgroundColor === "transparent") &&
10979
							curElem && curElem.style
10980
						) {
10981
							try {
10982
								backgroundColor = jQuery.css( curElem, "backgroundColor" );
10983
								curElem = curElem.parentNode;
10984
							} catch ( e ) {
10985
							}
10986
						}
10987
10988
						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
10989
							backgroundColor :
10990
							"_default" );
10991
					}
10992
10993
					value = value.toRgbaString();
10994
				}
10995
				try {
10996
					elem.style[ hook ] = value;
10997
				} catch ( e ) {
10998
					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
10999
				}
11000
			}
11001
		};
11002
		jQuery.fx.step[ hook ] = function( fx ) {
11003
			if ( !fx.colorInit ) {
11004
				fx.start = color( fx.elem, hook );
11005
				fx.end = color( fx.end );
11006
				fx.colorInit = true;
11007
			}
11008
			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
11009
		};
11010
	});
11011
11012
};
11013
11014
color.hook( stepHooks );
11015
11016
jQuery.cssHooks.borderColor = {
11017
	expand: function( value ) {
11018
		var expanded = {};
11019
11020
		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
11021
			expanded[ "border" + part + "Color" ] = value;
11022
		});
11023
		return expanded;
11024
	}
11025
};
11026
11027
// Basic color names only.
11028
// Usage of any of the other color names requires adding yourself or including
11029
// jquery.color.svg-names.js.
11030
colors = jQuery.Color.names = {
11031
	// 4.1. Basic color keywords
11032
	aqua: "#00ffff",
11033
	black: "#000000",
11034
	blue: "#0000ff",
11035
	fuchsia: "#ff00ff",
11036
	gray: "#808080",
11037
	green: "#008000",
11038
	lime: "#00ff00",
11039
	maroon: "#800000",
11040
	navy: "#000080",
11041
	olive: "#808000",
11042
	purple: "#800080",
11043
	red: "#ff0000",
11044
	silver: "#c0c0c0",
11045
	teal: "#008080",
11046
	white: "#ffffff",
11047
	yellow: "#ffff00",
11048
11049
	// 4.2.3. "transparent" color keyword
11050
	transparent: [ null, null, null, 0 ],
11051
11052
	_default: "#ffffff"
11053
};
11054
11055
})( jQuery );
11056
11057
/******************************************************************************/
11058
/****************************** CLASS ANIMATIONS ******************************/
11059
/******************************************************************************/
11060
(function() {
11061
11062
var classAnimationActions = [ "add", "remove", "toggle" ],
11063
	shorthandStyles = {
11064
		border: 1,
11065
		borderBottom: 1,
11066
		borderColor: 1,
11067
		borderLeft: 1,
11068
		borderRight: 1,
11069
		borderTop: 1,
11070
		borderWidth: 1,
11071
		margin: 1,
11072
		padding: 1
11073
	};
11074
11075
$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
11076
	$.fx.step[ prop ] = function( fx ) {
11077
		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
11078
			jQuery.style( fx.elem, prop, fx.end );
11079
			fx.setAttr = true;
11080
		}
11081
	};
11082
});
11083
11084
function getElementStyles( elem ) {
11085
	var key, len,
11086
		style = elem.ownerDocument.defaultView ?
11087
			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
11088
			elem.currentStyle,
11089
		styles = {};
11090
11091
	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
11092
		len = style.length;
11093
		while ( len-- ) {
11094
			key = style[ len ];
11095
			if ( typeof style[ key ] === "string" ) {
11096
				styles[ $.camelCase( key ) ] = style[ key ];
11097
			}
11098
		}
11099
	// support: Opera, IE <9
11100
	} else {
11101
		for ( key in style ) {
11102
			if ( typeof style[ key ] === "string" ) {
11103
				styles[ key ] = style[ key ];
11104
			}
11105
		}
11106
	}
11107
11108
	return styles;
11109
}
11110
11111
function styleDifference( oldStyle, newStyle ) {
11112
	var diff = {},
11113
		name, value;
11114
11115
	for ( name in newStyle ) {
11116
		value = newStyle[ name ];
11117
		if ( oldStyle[ name ] !== value ) {
11118
			if ( !shorthandStyles[ name ] ) {
11119
				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
11120
					diff[ name ] = value;
11121
				}
11122
			}
11123
		}
11124
	}
11125
11126
	return diff;
11127
}
11128
11129
// support: jQuery <1.8
11130
if ( !$.fn.addBack ) {
11131
	$.fn.addBack = function( selector ) {
11132
		return this.add( selector == null ?
11133
			this.prevObject : this.prevObject.filter( selector )
11134
		);
11135
	};
11136
}
11137
11138
$.effects.animateClass = function( value, duration, easing, callback ) {
11139
	var o = $.speed( duration, easing, callback );
11140
11141
	return this.queue( function() {
11142
		var animated = $( this ),
11143
			baseClass = animated.attr( "class" ) || "",
11144
			applyClassChange,
11145
			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
11146
11147
		// map the animated objects to store the original styles.
11148
		allAnimations = allAnimations.map(function() {
11149
			var el = $( this );
11150
			return {
11151
				el: el,
11152
				start: getElementStyles( this )
11153
			};
11154
		});
11155
11156
		// apply class change
11157
		applyClassChange = function() {
11158
			$.each( classAnimationActions, function(i, action) {
11159
				if ( value[ action ] ) {
11160
					animated[ action + "Class" ]( value[ action ] );
11161
				}
11162
			});
11163
		};
11164
		applyClassChange();
11165
11166
		// map all animated objects again - calculate new styles and diff
11167
		allAnimations = allAnimations.map(function() {
11168
			this.end = getElementStyles( this.el[ 0 ] );
11169
			this.diff = styleDifference( this.start, this.end );
11170
			return this;
11171
		});
11172
11173
		// apply original class
11174
		animated.attr( "class", baseClass );
11175
11176
		// map all animated objects again - this time collecting a promise
11177
		allAnimations = allAnimations.map(function() {
11178
			var styleInfo = this,
11179
				dfd = $.Deferred(),
11180
				opts = $.extend({}, o, {
11181
					queue: false,
11182
					complete: function() {
11183
						dfd.resolve( styleInfo );
11184
					}
11185
				});
11186
11187
			this.el.animate( this.diff, opts );
11188
			return dfd.promise();
11189
		});
11190
11191
		// once all animations have completed:
11192
		$.when.apply( $, allAnimations.get() ).done(function() {
11193
11194
			// set the final class
11195
			applyClassChange();
11196
11197
			// for each animated element,
11198
			// clear all css properties that were animated
11199
			$.each( arguments, function() {
11200
				var el = this.el;
11201
				$.each( this.diff, function(key) {
11202
					el.css( key, "" );
11203
				});
11204
			});
11205
11206
			// this is guarnteed to be there if you use jQuery.speed()
11207
			// it also handles dequeuing the next anim...
11208
			o.complete.call( animated[ 0 ] );
11209
		});
11210
	});
11211
};
11212
11213
$.fn.extend({
11214
	addClass: (function( orig ) {
11215
		return function( classNames, speed, easing, callback ) {
11216
			return speed ?
11217
				$.effects.animateClass.call( this,
11218
					{ add: classNames }, speed, easing, callback ) :
11219
				orig.apply( this, arguments );
11220
		};
11221
	})( $.fn.addClass ),
11222
11223
	removeClass: (function( orig ) {
11224
		return function( classNames, speed, easing, callback ) {
11225
			return arguments.length > 1 ?
11226
				$.effects.animateClass.call( this,
11227
					{ remove: classNames }, speed, easing, callback ) :
11228
				orig.apply( this, arguments );
11229
		};
11230
	})( $.fn.removeClass ),
11231
11232
	toggleClass: (function( orig ) {
11233
		return function( classNames, force, speed, easing, callback ) {
11234
			if ( typeof force === "boolean" || force === undefined ) {
11235
				if ( !speed ) {
11236
					// without speed parameter
11237
					return orig.apply( this, arguments );
11238
				} else {
11239
					return $.effects.animateClass.call( this,
11240
						(force ? { add: classNames } : { remove: classNames }),
11241
						speed, easing, callback );
11242
				}
11243
			} else {
11244
				// without force parameter
11245
				return $.effects.animateClass.call( this,
11246
					{ toggle: classNames }, force, speed, easing );
11247
			}
11248
		};
11249
	})( $.fn.toggleClass ),
11250
11251
	switchClass: function( remove, add, speed, easing, callback) {
11252
		return $.effects.animateClass.call( this, {
11253
			add: add,
11254
			remove: remove
11255
		}, speed, easing, callback );
11256
	}
11257
});
11258
11259
})();
11260
11261
/******************************************************************************/
11262
/*********************************** EFFECTS **********************************/
11263
/******************************************************************************/
11264
11265
(function() {
11266
11267
$.extend( $.effects, {
11268
	version: "1.11.4",
11269
11270
	// Saves a set of properties in a data storage
11271
	save: function( element, set ) {
11272
		for ( var i = 0; i < set.length; i++ ) {
11273
			if ( set[ i ] !== null ) {
11274
				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
11275
			}
11276
		}
11277
	},
11278
11279
	// Restores a set of previously saved properties from a data storage
11280
	restore: function( element, set ) {
11281
		var val, i;
11282
		for ( i = 0; i < set.length; i++ ) {
11283
			if ( set[ i ] !== null ) {
11284
				val = element.data( dataSpace + set[ i ] );
11285
				// support: jQuery 1.6.2
11286
				// http://bugs.jquery.com/ticket/9917
11287
				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
11288
				// We can't differentiate between "" and 0 here, so we just assume
11289
				// empty string since it's likely to be a more common value...
11290
				if ( val === undefined ) {
11291
					val = "";
11292
				}
11293
				element.css( set[ i ], val );
11294
			}
11295
		}
11296
	},
11297
11298
	setMode: function( el, mode ) {
11299
		if (mode === "toggle") {
11300
			mode = el.is( ":hidden" ) ? "show" : "hide";
11301
		}
11302
		return mode;
11303
	},
11304
11305
	// Translates a [top,left] array into a baseline value
11306
	// this should be a little more flexible in the future to handle a string & hash
11307
	getBaseline: function( origin, original ) {
11308
		var y, x;
11309
		switch ( origin[ 0 ] ) {
11310
			case "top": y = 0; break;
11311
			case "middle": y = 0.5; break;
11312
			case "bottom": y = 1; break;
11313
			default: y = origin[ 0 ] / original.height;
11314
		}
11315
		switch ( origin[ 1 ] ) {
11316
			case "left": x = 0; break;
11317
			case "center": x = 0.5; break;
11318
			case "right": x = 1; break;
11319
			default: x = origin[ 1 ] / original.width;
11320
		}
11321
		return {
11322
			x: x,
11323
			y: y
11324
		};
11325
	},
11326
11327
	// Wraps the element around a wrapper that copies position properties
11328
	createWrapper: function( element ) {
11329
11330
		// if the element is already wrapped, return it
11331
		if ( element.parent().is( ".ui-effects-wrapper" )) {
11332
			return element.parent();
11333
		}
11334
11335
		// wrap the element
11336
		var props = {
11337
				width: element.outerWidth(true),
11338
				height: element.outerHeight(true),
11339
				"float": element.css( "float" )
11340
			},
11341
			wrapper = $( "<div></div>" )
11342
				.addClass( "ui-effects-wrapper" )
11343
				.css({
11344
					fontSize: "100%",
11345
					background: "transparent",
11346
					border: "none",
11347
					margin: 0,
11348
					padding: 0
11349
				}),
11350
			// Store the size in case width/height are defined in % - Fixes #5245
11351
			size = {
11352
				width: element.width(),
11353
				height: element.height()
11354
			},
11355
			active = document.activeElement;
11356
11357
		// support: Firefox
11358
		// Firefox incorrectly exposes anonymous content
11359
		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
11360
		try {
11361
			active.id;
11362
		} catch ( e ) {
11363
			active = document.body;
11364
		}
11365
11366
		element.wrap( wrapper );
11367
11368
		// Fixes #7595 - Elements lose focus when wrapped.
11369
		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11370
			$( active ).focus();
11371
		}
11372
11373
		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
11374
11375
		// transfer positioning properties to the wrapper
11376
		if ( element.css( "position" ) === "static" ) {
11377
			wrapper.css({ position: "relative" });
11378
			element.css({ position: "relative" });
11379
		} else {
11380
			$.extend( props, {
11381
				position: element.css( "position" ),
11382
				zIndex: element.css( "z-index" )
11383
			});
11384
			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
11385
				props[ pos ] = element.css( pos );
11386
				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
11387
					props[ pos ] = "auto";
11388
				}
11389
			});
11390
			element.css({
11391
				position: "relative",
11392
				top: 0,
11393
				left: 0,
11394
				right: "auto",
11395
				bottom: "auto"
11396
			});
11397
		}
11398
		element.css(size);
11399
11400
		return wrapper.css( props ).show();
11401
	},
11402
11403
	removeWrapper: function( element ) {
11404
		var active = document.activeElement;
11405
11406
		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
11407
			element.parent().replaceWith( element );
11408
11409
			// Fixes #7595 - Elements lose focus when wrapped.
11410
			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11411
				$( active ).focus();
11412
			}
11413
		}
11414
11415
		return element;
11416
	},
11417
11418
	setTransition: function( element, list, factor, value ) {
11419
		value = value || {};
11420
		$.each( list, function( i, x ) {
11421
			var unit = element.cssUnit( x );
11422
			if ( unit[ 0 ] > 0 ) {
11423
				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
11424
			}
11425
		});
11426
		return value;
11427
	}
11428
});
11429
11430
// return an effect options object for the given parameters:
11431
function _normalizeArguments( effect, options, speed, callback ) {
11432
11433
	// allow passing all options as the first parameter
11434
	if ( $.isPlainObject( effect ) ) {
11435
		options = effect;
11436
		effect = effect.effect;
11437
	}
11438
11439
	// convert to an object
11440
	effect = { effect: effect };
11441
11442
	// catch (effect, null, ...)
11443
	if ( options == null ) {
11444
		options = {};
11445
	}
11446
11447
	// catch (effect, callback)
11448
	if ( $.isFunction( options ) ) {
11449
		callback = options;
11450
		speed = null;
11451
		options = {};
11452
	}
11453
11454
	// catch (effect, speed, ?)
11455
	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
11456
		callback = speed;
11457
		speed = options;
11458
		options = {};
11459
	}
11460
11461
	// catch (effect, options, callback)
11462
	if ( $.isFunction( speed ) ) {
11463
		callback = speed;
11464
		speed = null;
11465
	}
11466
11467
	// add options to effect
11468
	if ( options ) {
11469
		$.extend( effect, options );
11470
	}
11471
11472
	speed = speed || options.duration;
11473
	effect.duration = $.fx.off ? 0 :
11474
		typeof speed === "number" ? speed :
11475
		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
11476
		$.fx.speeds._default;
11477
11478
	effect.complete = callback || options.complete;
11479
11480
	return effect;
11481
}
11482
11483
function standardAnimationOption( option ) {
11484
	// Valid standard speeds (nothing, number, named speed)
11485
	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
11486
		return true;
11487
	}
11488
11489
	// Invalid strings - treat as "normal" speed
11490
	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
11491
		return true;
11492
	}
11493
11494
	// Complete callback
11495
	if ( $.isFunction( option ) ) {
11496
		return true;
11497
	}
11498
11499
	// Options hash (but not naming an effect)
11500
	if ( typeof option === "object" && !option.effect ) {
11501
		return true;
11502
	}
11503
11504
	// Didn't match any standard API
11505
	return false;
11506
}
11507
11508
$.fn.extend({
11509
	effect: function( /* effect, options, speed, callback */ ) {
11510
		var args = _normalizeArguments.apply( this, arguments ),
11511
			mode = args.mode,
11512
			queue = args.queue,
11513
			effectMethod = $.effects.effect[ args.effect ];
11514
11515
		if ( $.fx.off || !effectMethod ) {
11516
			// delegate to the original method (e.g., .show()) if possible
11517
			if ( mode ) {
11518
				return this[ mode ]( args.duration, args.complete );
11519
			} else {
11520
				return this.each( function() {
11521
					if ( args.complete ) {
11522
						args.complete.call( this );
11523
					}
11524
				});
11525
			}
11526
		}
11527
11528
		function run( next ) {
11529
			var elem = $( this ),
11530
				complete = args.complete,
11531
				mode = args.mode;
11532
11533
			function done() {
11534
				if ( $.isFunction( complete ) ) {
11535
					complete.call( elem[0] );
11536
				}
11537
				if ( $.isFunction( next ) ) {
11538
					next();
11539
				}
11540
			}
11541
11542
			// If the element already has the correct final state, delegate to
11543
			// the core methods so the internal tracking of "olddisplay" works.
11544
			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
11545
				elem[ mode ]();
11546
				done();
11547
			} else {
11548
				effectMethod.call( elem[0], args, done );
11549
			}
11550
		}
11551
11552
		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
11553
	},
11554
11555
	show: (function( orig ) {
11556
		return function( option ) {
11557
			if ( standardAnimationOption( option ) ) {
11558
				return orig.apply( this, arguments );
11559
			} else {
11560
				var args = _normalizeArguments.apply( this, arguments );
11561
				args.mode = "show";
11562
				return this.effect.call( this, args );
11563
			}
11564
		};
11565
	})( $.fn.show ),
11566
11567
	hide: (function( orig ) {
11568
		return function( option ) {
11569
			if ( standardAnimationOption( option ) ) {
11570
				return orig.apply( this, arguments );
11571
			} else {
11572
				var args = _normalizeArguments.apply( this, arguments );
11573
				args.mode = "hide";
11574
				return this.effect.call( this, args );
11575
			}
11576
		};
11577
	})( $.fn.hide ),
11578
11579
	toggle: (function( orig ) {
11580
		return function( option ) {
11581
			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
11582
				return orig.apply( this, arguments );
11583
			} else {
11584
				var args = _normalizeArguments.apply( this, arguments );
11585
				args.mode = "toggle";
11586
				return this.effect.call( this, args );
11587
			}
11588
		};
11589
	})( $.fn.toggle ),
11590
11591
	// helper functions
11592
	cssUnit: function(key) {
11593
		var style = this.css( key ),
11594
			val = [];
11595
11596
		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
11597
			if ( style.indexOf( unit ) > 0 ) {
11598
				val = [ parseFloat( style ), unit ];
11599
			}
11600
		});
11601
		return val;
11602
	}
11603
});
11604
11605
})();
11606
11607
/******************************************************************************/
11608
/*********************************** EASING ***********************************/
11609
/******************************************************************************/
11610
11611
(function() {
11612
11613
// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
11614
11615
var baseEasings = {};
11616
11617
$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
11618
	baseEasings[ name ] = function( p ) {
11619
		return Math.pow( p, i + 2 );
11620
	};
11621
});
11622
11623
$.extend( baseEasings, {
11624
	Sine: function( p ) {
11625
		return 1 - Math.cos( p * Math.PI / 2 );
11626
	},
11627
	Circ: function( p ) {
11628
		return 1 - Math.sqrt( 1 - p * p );
11629
	},
11630
	Elastic: function( p ) {
11631
		return p === 0 || p === 1 ? p :
11632
			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
11633
	},
11634
	Back: function( p ) {
11635
		return p * p * ( 3 * p - 2 );
11636
	},
11637
	Bounce: function( p ) {
11638
		var pow2,
11639
			bounce = 4;
11640
11641
		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
11642
		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
11643
	}
11644
});
11645
11646
$.each( baseEasings, function( name, easeIn ) {
11647
	$.easing[ "easeIn" + name ] = easeIn;
11648
	$.easing[ "easeOut" + name ] = function( p ) {
11649
		return 1 - easeIn( 1 - p );
11650
	};
11651
	$.easing[ "easeInOut" + name ] = function( p ) {
11652
		return p < 0.5 ?
11653
			easeIn( p * 2 ) / 2 :
11654
			1 - easeIn( p * -2 + 2 ) / 2;
11655
	};
11656
});
11657
11658
})();
11659
11660
var effect = $.effects;
11661
11662
11663
/*!
11664
 * jQuery UI Effects Highlight 1.11.4
11665
 * http://jqueryui.com
11666
 *
11667
 * Copyright jQuery Foundation and other contributors
11668
 * Released under the MIT license.
11669
 * http://jquery.org/license
11670
 *
11671
 * http://api.jqueryui.com/highlight-effect/
11672
 */
11673
11674
11675
var effectHighlight = $.effects.effect.highlight = function( o, done ) {
11676
	var elem = $( this ),
11677
		props = [ "backgroundImage", "backgroundColor", "opacity" ],
11678
		mode = $.effects.setMode( elem, o.mode || "show" ),
11679
		animation = {
11680
			backgroundColor: elem.css( "backgroundColor" )
11681
		};
11682
11683
	if (mode === "hide") {
11684
		animation.opacity = 0;
11685
	}
11686
11687
	$.effects.save( elem, props );
11688
11689
	elem
11690
		.show()
11691
		.css({
11692
			backgroundImage: "none",
11693
			backgroundColor: o.color || "#ffff99"
11694
		})
11695
		.animate( animation, {
11696
			queue: false,
11697
			duration: o.duration,
11698
			easing: o.easing,
11699
			complete: function() {
11700
				if ( mode === "hide" ) {
11701
					elem.hide();
11702
				}
11703
				$.effects.restore( elem, props );
11704
				done();
11705
			}
11706
		});
11707
};
11708
11709
11710
11711
}));
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.min.css (+7 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.css, draggable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, menu.css, progressbar.css, slider.css, tabs.css, theme.css
4
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
* Copyright jQuery Foundation and other contributors; Licensed MIT */
6
7
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.min.js (+11 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, menu.js, progressbar.js, slider.js, tabs.js, effect.js, effect-highlight.js
4
* Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,_,b,y=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),D={};return b=s(y),y[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,_=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=c.exec(i[0]),t=c.exec(i[1]),D[this]=[e?e[0]:0,t?t[0]:0],n[this]=[d.exec(i[0])[0],d.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?_.left+=m:"center"===n.at[0]&&(_.left+=m/2),"bottom"===n.at[1]?_.top+=g:"center"===n.at[1]&&(_.top+=g/2),p=t(D.at,m,g),_.left+=p[0],_.top+=p[1],this.each(function(){var s,l,u=e(this),c=u.outerWidth(),d=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),T=c+f+i(this,"marginRight")+w.width,S=d+b+i(this,"marginBottom")+w.height,M=e.extend({},_),N=t(D.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=c:"center"===n.my[0]&&(M.left-=c/2),"bottom"===n.my[1]?M.top-=d:"center"===n.my[1]&&(M.top-=d/2),M.left+=N[0],M.top+=N[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:c,elemHeight:d,collisionPosition:s,collisionWidth:T,collisionHeight:S,offset:[p[0]+N[0],p[1]+N[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-c,s=v.top-M.top,a=s+g-d,h={target:{element:y,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:c,height:d},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};c>m&&m>r(t+i)&&(h.horizontal="center"),d>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-o-h,d="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>r(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-o-h,d="top"===t.my[1],p=d?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||c>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}
7
},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,c,d,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,_=i.offset.top,b=_+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,u=s.snapElements[d].top-s.margins.top,c=u+s.snapElements[d].height,h-m>v||g>l+m||u-m>b||_>c+m||!e.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(c-_),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-_),a=m>=Math.abs(c-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,c=l+i.proportions().width,d=u+i.proportions().height;switch(s){case"fit":return a>=l&&c>=r&&o>=u&&d>=h;case"intersect":return a+t.helperProportions.width/2>l&&c>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&d>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&d>=o||h>=u&&d>=h||u>o&&h>d)&&(a>=l&&c>=a||r>=l&&c>=r||l>a&&r>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,c="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||t+u>a&&o>t+u,p=c&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=e(d[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(c.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=c.length-1;i>=0;i--)for(o=c[i][1],r=c[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,c,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&e.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=d.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",c=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[c]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[c]-h)&&(n=Math.abs(t[c]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;
8
"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},c=l&&u.down||u,d=function(){o._toggleComplete(i)};return"number"==typeof c&&(a=c),"string"==typeof c&&(n=c),n=n||c.easing||u.easing,a=a||c.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,d="ui-button ui-widget ui-state-default ui-corner-all",p="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},m=function(t){var i=t.name,s=t.form,n=e([]);
9
return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(d).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];m(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(d+" ui-state-active "+p).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?m(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(p),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var g;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,c,d=this._dialogInst;return d||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},e.data(this._dialogInput[0],"datepicker",d)),r(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),g===n&&(g=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,g=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),c=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,_=-1,b=!1,y=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=y(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(y(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||y("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",c,d);break;case"o":_=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":y("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),_>-1)for(g=1,v=_;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},c="",d=!1;if(t)for(s=0;e.length>s;s++)if(d)"'"!==e.charAt(s)||h("'")?c+=e.charAt(s):d=!1;else switch(e.charAt(s)){case"d":c+=l("d",t.getDate(),2);break;case"D":c+=u("D",t.getDay(),n,a);break;case"o":c+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=l("m",t.getMonth()+1,2);break;case"M":c+=u("M",t.getMonth(),o,r);break;case"y":c+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?c+="'":d=!0;break;default:c+=e.charAt(s)}return c},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,c,d,p,f,m,g,v,_,b,y,x,w,k,D,T,S,M,N,C,P,A,I,H,z,F,E,W,O,L,R=new Date,j=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),U=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),q=this._get(e,"stepMonths"),G=1!==U[0]||1!==U[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),Q=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),Q)for(t=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+q,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:j,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,c=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),_=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),y="",w=0;U[0]>w;w++){for(k="",this.maxRows=4,D=0;U[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",G){if(M+="<div class='ui-datepicker-group",U[1]>1)switch(D){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");
10
break;case U[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,$,Q,w>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,N+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[C]+"'>"+p[C]+"</span></th>";for(M+=N+"</tr></thead><tbody>",P=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,P)),A=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((A+P)/7),H=G?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-A)),F=0;H>F;F++){for(M+="<tr>",E=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!_||!W[0]||$&&$>z||Q&&z>Q,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===T.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===j.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(G?"</div>"+(U[0]>0&&D===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}y+=k}return y+=l,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,c,d,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),_=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(y+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);return isNaN(t)?d:t},f=p(c[0]),m=Math.max(f,p(c[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}});var v="ui-effects-",_=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=c[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]
11
}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var c=this,d=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===d?(n instanceof l?f(u,function(e,t){n[t.cache]&&(c[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!c[a]&&s.to){if("alpha"===e||null==n[e])return;c[a]=s.to(c._rgba)}c[a][t.idx]=i(n[e],t,!0)}),c[a]&&0>e.inArray(null,c[a].slice(0,3))&&(c[a][3]=1,s.from&&(c._rgba=s.from(c[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=c[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,c=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=c?l/u:l/(2-u),[Math.round(t)%360,i,c,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),c="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(e,t){var s=c["object"===r?e:t.idx];null==s&&(s=d[t.idx]),d[t.idx]=i(s,t)}),u?(n=l(u(d)),n[o]=d,n):l(d)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(_),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(_.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(v+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(v+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})}});
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close-jquery-1.12.0.inc (+90 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE AudioAlerts %]
3
[% USE String %]
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
6
7
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" />
10
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
11
[% INCLUDE intranetstylesheet.inc %]
12
[% IF ( bidi )            %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />[% END %]
13
14
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-1.12.0.min.js"></script>
15
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.js"></script>
16
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
17
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
18
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
19
<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script>
20
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script>
21
22
[% IF ( login ) %]
23
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/login.css" />
24
[% END %]
25
[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
26
27
<!-- koha core js -->
28
<script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
29
30
[% INCLUDE 'validator-strings.inc' %]
31
[% IF ( IntranetUserJS ) %]
32
    <script type="text/javascript">
33
    //<![CDATA[
34
    [% IntranetUserJS %]
35
    //]]>
36
    </script>
37
[% END %]
38
39
[% IF ( virtualshelves || intranetbookbag ) %]
40
<script type="text/javascript">
41
    //<![CDATA[
42
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
43
        var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
44
        var MSG_RECORD_ADDED = _("This item has been added to your cart");
45
        var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart");
46
        var MSG_NRECORDS_IN_BASKET = _("%s already in your cart");
47
        var MSG_NO_RECORD_SELECTED = _("No item was selected");
48
        var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart)!");
49
        var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
50
        var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
51
        var MSG_IN_YOUR_CART = _("Items in your cart: %s");
52
        var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved.");
53
    //]]>
54
    </script>
55
56
    <script type="text/javascript" src="[% themelang %]/js/basket.js"></script>
57
[% END %]
58
59
[% IF LocalCoverImages %]
60
    <script type="text/javascript" src="[% themelang %]/js/localcovers.js"></script>
61
    <script type="text/javascript">
62
        //<![CDATA[
63
            var NO_LOCAL_JACKET = _("No cover image available");
64
        //]]>
65
    </script>
66
[% END %]
67
68
[% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
69
    <script type="text/javascript">
70
        //<![CDATA[
71
            var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/';
72
            var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) %]' );
73
        //]]>
74
75
        $( document ).ready(function() {
76
            if ( AUDIO_ALERTS ) {
77
                for ( var k in AUDIO_ALERTS ) {
78
                    var alert = AUDIO_ALERTS[k];
79
                    if ( $( alert.selector ).length ) {
80
                        playSound( alert.sound );
81
                        break;
82
                    }
83
                }
84
            }
85
        });
86
    </script>
87
[% END %]
88
89
<!-- For keeping the text when navigating the search tabs -->
90
[% INCLUDE 'searchbox-keep-text.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-4 / +2 lines)
Lines 2-11 Link Here
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha staff client</title>
3
<title>Koha staff client</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/mainpage.css" />
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/mainpage.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close-jquery-1.12.0.inc' %]
6
<style type="text/css"> </style>
7
8
</head>
6
</head>
7
9
<body id="main_intranet-main" class="main">
8
<body id="main_intranet-main" class="main">
10
[% INCLUDE 'header.inc' %]
9
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'home-search.inc' %]
10
[% INCLUDE 'home-search.inc' %]
12
- 

Return to bug 15883