2
* jQuery JavaScript Library v1.5.2
5
* Copyright 2011, John Resig
6
* Dual licensed under the MIT or GPL Version 2 licenses.
7
* http://jquery.org/license
10
* http://sizzlejs.com/
11
* Copyright 2011, The Dojo Foundation
12
* Released under the MIT, BSD, and GPL Licenses.
14
* Date: Thu Mar 31 15:28:23 2011 -0400
16
(function( window, undefined ) {
18
// Use the correct document accordingly with window argument (sandbox)
19
var document = window.document;
20
var jQuery = (function() {
22
// Define a local copy of jQuery
23
var jQuery = function( selector, context ) {
24
// The jQuery object is actually just the init constructor 'enhanced'
25
return new jQuery.fn.init( selector, context, rootjQuery );
28
// Map over jQuery in case of overwrite
29
_jQuery = window.jQuery,
31
// Map over the $ in case of overwrite
34
// A central reference to the root jQuery(document)
37
// A simple way to check for HTML strings or ID strings
38
// (both of which we optimize for)
39
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
41
// Check if a string has a non-whitespace character in it
44
// Used for trimming whitespace
51
// Match a standalone tag
52
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
55
rvalidchars = /^[\],:{}\s]*$/,
56
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
57
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
58
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
61
rwebkit = /(webkit)[ \/]([\w.]+)/,
62
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
63
rmsie = /(msie) ([\w.]+)/,
64
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
66
// Keep a UserAgent string for use with jQuery.browser
67
userAgent = navigator.userAgent,
69
// For matching the engine and version of the browser
72
// The deferred used on DOM ready
75
// The ready event handler
78
// Save a reference to some core methods
79
toString = Object.prototype.toString,
80
hasOwn = Object.prototype.hasOwnProperty,
81
push = Array.prototype.push,
82
slice = Array.prototype.slice,
83
trim = String.prototype.trim,
84
indexOf = Array.prototype.indexOf,
86
// [[Class]] -> type pairs
89
jQuery.fn = jQuery.prototype = {
91
init: function( selector, context, rootjQuery ) {
92
var match, elem, ret, doc;
94
// Handle $(""), $(null), or $(undefined)
99
// Handle $(DOMElement)
100
if ( selector.nodeType ) {
101
this.context = this[0] = selector;
106
// The body element only exists once, optimize finding it
107
if ( selector === "body" && !context && document.body ) {
108
this.context = document;
109
this[0] = document.body;
110
this.selector = "body";
115
// Handle HTML strings
116
if ( typeof selector === "string" ) {
117
// Are we dealing with HTML string or an ID?
118
match = quickExpr.exec( selector );
120
// Verify a match, and that no context was specified for #id
121
if ( match && (match[1] || !context) ) {
123
// HANDLE: $(html) -> $(array)
125
context = context instanceof jQuery ? context[0] : context;
126
doc = (context ? context.ownerDocument || context : document);
128
// If a single string is passed in and it's a single tag
129
// just do a createElement and skip the rest
130
ret = rsingleTag.exec( selector );
133
if ( jQuery.isPlainObject( context ) ) {
134
selector = [ document.createElement( ret[1] ) ];
135
jQuery.fn.attr.call( selector, context, true );
138
selector = [ doc.createElement( ret[1] ) ];
142
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
143
selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
146
return jQuery.merge( this, selector );
150
elem = document.getElementById( match[2] );
152
// Check parentNode to catch when Blackberry 4.6 returns
153
// nodes that are no longer in the document #6963
154
if ( elem && elem.parentNode ) {
155
// Handle the case where IE and Opera return items
156
// by name instead of ID
157
if ( elem.id !== match[2] ) {
158
return rootjQuery.find( selector );
161
// Otherwise, we inject the element directly into the jQuery object
166
this.context = document;
167
this.selector = selector;
171
// HANDLE: $(expr, $(...))
172
} else if ( !context || context.jquery ) {
173
return (context || rootjQuery).find( selector );
175
// HANDLE: $(expr, context)
176
// (which is just equivalent to: $(context).find(expr)
178
return this.constructor( context ).find( selector );
181
// HANDLE: $(function)
182
// Shortcut for document ready
183
} else if ( jQuery.isFunction( selector ) ) {
184
return rootjQuery.ready( selector );
187
if (selector.selector !== undefined) {
188
this.selector = selector.selector;
189
this.context = selector.context;
192
return jQuery.makeArray( selector, this );
195
// Start with an empty selector
198
// The current version of jQuery being used
201
// The default length of a jQuery object is 0
204
// The number of elements contained in the matched element set
209
toArray: function() {
210
return slice.call( this, 0 );
213
// Get the Nth element in the matched element set OR
214
// Get the whole matched element set as a clean array
215
get: function( num ) {
218
// Return a 'clean' array
221
// Return just the object
222
( num < 0 ? this[ this.length + num ] : this[ num ] );
225
// Take an array of elements and push it onto the stack
226
// (returning the new matched element set)
227
pushStack: function( elems, name, selector ) {
228
// Build a new jQuery matched element set
229
var ret = this.constructor();
231
if ( jQuery.isArray( elems ) ) {
232
push.apply( ret, elems );
235
jQuery.merge( ret, elems );
238
// Add the old object onto the stack (as a reference)
239
ret.prevObject = this;
241
ret.context = this.context;
243
if ( name === "find" ) {
244
ret.selector = this.selector + (this.selector ? " " : "") + selector;
246
ret.selector = this.selector + "." + name + "(" + selector + ")";
249
// Return the newly-formed element set
253
// Execute a callback for every element in the matched set.
254
// (You can seed the arguments with an array of args, but this is
255
// only used internally.)
256
each: function( callback, args ) {
257
return jQuery.each( this, callback, args );
260
ready: function( fn ) {
261
// Attach the listeners
265
readyList.done( fn );
273
this.slice( i, +i + 1 );
281
return this.eq( -1 );
285
return this.pushStack( slice.apply( this, arguments ),
286
"slice", slice.call(arguments).join(",") );
289
map: function( callback ) {
290
return this.pushStack( jQuery.map(this, function( elem, i ) {
291
return callback.call( elem, i, elem );
296
return this.prevObject || this.constructor(null);
299
// For internal use only.
300
// Behaves like an Array's method, not like a jQuery method.
306
// Give the init function the jQuery prototype for later instantiation
307
jQuery.fn.init.prototype = jQuery.fn;
309
jQuery.extend = jQuery.fn.extend = function() {
310
var options, name, src, copy, copyIsArray, clone,
311
target = arguments[0] || {},
313
length = arguments.length,
316
// Handle a deep copy situation
317
if ( typeof target === "boolean" ) {
319
target = arguments[1] || {};
320
// skip the boolean and the target
324
// Handle case when target is a string or something (possible in deep copy)
325
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
329
// extend jQuery itself if only one argument is passed
330
if ( length === i ) {
335
for ( ; i < length; i++ ) {
336
// Only deal with non-null/undefined values
337
if ( (options = arguments[ i ]) != null ) {
338
// Extend the base object
339
for ( name in options ) {
340
src = target[ name ];
341
copy = options[ name ];
343
// Prevent never-ending loop
344
if ( target === copy ) {
348
// Recurse if we're merging plain objects or arrays
349
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
352
clone = src && jQuery.isArray(src) ? src : [];
355
clone = src && jQuery.isPlainObject(src) ? src : {};
358
// Never move original objects, clone them
359
target[ name ] = jQuery.extend( deep, clone, copy );
361
// Don't bring in undefined values
362
} else if ( copy !== undefined ) {
363
target[ name ] = copy;
369
// Return the modified object
374
noConflict: function( deep ) {
378
window.jQuery = _jQuery;
384
// Is the DOM ready to be used? Set to true once it occurs.
387
// A counter to track how many items to wait for before
388
// the ready event fires. See #6781
391
// Handle when the DOM is ready
392
ready: function( wait ) {
393
// A third-party is pushing the ready event forwards
394
if ( wait === true ) {
398
// Make sure that the DOM is not already loaded
399
if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
400
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
401
if ( !document.body ) {
402
return setTimeout( jQuery.ready, 1 );
405
// Remember that the DOM is ready
406
jQuery.isReady = true;
408
// If a normal DOM Ready event fired, decrement, and wait if need be
409
if ( wait !== true && --jQuery.readyWait > 0 ) {
413
// If there are functions bound, to execute
414
readyList.resolveWith( document, [ jQuery ] );
416
// Trigger any bound ready events
417
if ( jQuery.fn.trigger ) {
418
jQuery( document ).trigger( "ready" ).unbind( "ready" );
423
bindReady: function() {
428
readyList = jQuery._Deferred();
430
// Catch cases where $(document).ready() is called after the
431
// browser event has already occurred.
432
if ( document.readyState === "complete" ) {
433
// Handle it asynchronously to allow scripts the opportunity to delay ready
434
return setTimeout( jQuery.ready, 1 );
437
// Mozilla, Opera and webkit nightlies currently support this event
438
if ( document.addEventListener ) {
439
// Use the handy event callback
440
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
442
// A fallback to window.onload, that will always work
443
window.addEventListener( "load", jQuery.ready, false );
445
// If IE event model is used
446
} else if ( document.attachEvent ) {
447
// ensure firing before onload,
448
// maybe late but safe also for iframes
449
document.attachEvent("onreadystatechange", DOMContentLoaded);
451
// A fallback to window.onload, that will always work
452
window.attachEvent( "onload", jQuery.ready );
454
// If IE and not a frame
455
// continually check to see if the document is ready
456
var toplevel = false;
459
toplevel = window.frameElement == null;
462
if ( document.documentElement.doScroll && toplevel ) {
468
// See test/unit/core.js for details concerning isFunction.
469
// Since version 1.3, DOM methods and functions like alert
470
// aren't supported. They return false on IE (#2968).
471
isFunction: function( obj ) {
472
return jQuery.type(obj) === "function";
475
isArray: Array.isArray || function( obj ) {
476
return jQuery.type(obj) === "array";
479
// A crude way of determining if an object is a window
480
isWindow: function( obj ) {
481
return obj && typeof obj === "object" && "setInterval" in obj;
484
isNaN: function( obj ) {
485
return obj == null || !rdigit.test( obj ) || isNaN( obj );
488
type: function( obj ) {
491
class2type[ toString.call(obj) ] || "object";
494
isPlainObject: function( obj ) {
495
// Must be an Object.
496
// Because of IE, we also have to check the presence of the constructor property.
497
// Make sure that DOM nodes and window objects don't pass through, as well
498
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
502
// Not own constructor property must be Object
503
if ( obj.constructor &&
504
!hasOwn.call(obj, "constructor") &&
505
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
509
// Own properties are enumerated firstly, so to speed up,
510
// if last one is own, then all properties are own.
513
for ( key in obj ) {}
515
return key === undefined || hasOwn.call( obj, key );
518
isEmptyObject: function( obj ) {
519
for ( var name in obj ) {
525
error: function( msg ) {
529
parseJSON: function( data ) {
530
if ( typeof data !== "string" || !data ) {
534
// Make sure leading/trailing whitespace is removed (IE can't handle it)
535
data = jQuery.trim( data );
537
// Make sure the incoming data is actual JSON
538
// Logic borrowed from http://json.org/json2.js
539
if ( rvalidchars.test(data.replace(rvalidescape, "@")
540
.replace(rvalidtokens, "]")
541
.replace(rvalidbraces, "")) ) {
543
// Try to use the native JSON parser first
544
return window.JSON && window.JSON.parse ?
545
window.JSON.parse( data ) :
546
(new Function("return " + data))();
549
jQuery.error( "Invalid JSON: " + data );
553
// Cross-browser xml parsing
554
// (xml & tmp used internally)
555
parseXML: function( data , xml , tmp ) {
557
if ( window.DOMParser ) { // Standard
558
tmp = new DOMParser();
559
xml = tmp.parseFromString( data , "text/xml" );
561
xml = new ActiveXObject( "Microsoft.XMLDOM" );
566
tmp = xml.documentElement;
568
if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
569
jQuery.error( "Invalid XML: " + data );
577
// Evalulates a script in a global context
578
globalEval: function( data ) {
579
if ( data && rnotwhite.test(data) ) {
580
// Inspired by code by Andrea Giammarchi
581
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
582
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
583
script = document.createElement( "script" );
585
if ( jQuery.support.scriptEval() ) {
586
script.appendChild( document.createTextNode( data ) );
591
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
592
// This arises when a base node is used (#2709).
593
head.insertBefore( script, head.firstChild );
594
head.removeChild( script );
598
nodeName: function( elem, name ) {
599
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
602
// args is for internal usage only
603
each: function( object, callback, args ) {
605
length = object.length,
606
isObj = length === undefined || jQuery.isFunction(object);
610
for ( name in object ) {
611
if ( callback.apply( object[ name ], args ) === false ) {
616
for ( ; i < length; ) {
617
if ( callback.apply( object[ i++ ], args ) === false ) {
623
// A special, fast, case for the most common use of each
626
for ( name in object ) {
627
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
632
for ( var value = object[0];
633
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
640
// Use native String.trim function wherever possible
643
return text == null ?
648
// Otherwise use our own trimming functionality
650
return text == null ?
652
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
655
// results is for internal usage only
656
makeArray: function( array, results ) {
657
var ret = results || [];
659
if ( array != null ) {
660
// The window, strings (and functions) also have 'length'
661
// The extra typeof function check is to prevent crashes
662
// in Safari 2 (See: #3039)
663
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
664
var type = jQuery.type(array);
666
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
667
push.call( ret, array );
669
jQuery.merge( ret, array );
676
inArray: function( elem, array ) {
677
if ( array.indexOf ) {
678
return array.indexOf( elem );
681
for ( var i = 0, length = array.length; i < length; i++ ) {
682
if ( array[ i ] === elem ) {
690
merge: function( first, second ) {
691
var i = first.length,
694
if ( typeof second.length === "number" ) {
695
for ( var l = second.length; j < l; j++ ) {
696
first[ i++ ] = second[ j ];
700
while ( second[j] !== undefined ) {
701
first[ i++ ] = second[ j++ ];
710
grep: function( elems, callback, inv ) {
711
var ret = [], retVal;
714
// Go through the array, only saving the items
715
// that pass the validator function
716
for ( var i = 0, length = elems.length; i < length; i++ ) {
717
retVal = !!callback( elems[ i ], i );
718
if ( inv !== retVal ) {
719
ret.push( elems[ i ] );
726
// arg is for internal usage only
727
map: function( elems, callback, arg ) {
730
// Go through the array, translating each of the items to their
731
// new value (or values).
732
for ( var i = 0, length = elems.length; i < length; i++ ) {
733
value = callback( elems[ i ], i, arg );
735
if ( value != null ) {
736
ret[ ret.length ] = value;
740
// Flatten any nested arrays
741
return ret.concat.apply( [], ret );
744
// A global GUID counter for objects
747
proxy: function( fn, proxy, thisObject ) {
748
if ( arguments.length === 2 ) {
749
if ( typeof proxy === "string" ) {
751
fn = thisObject[ proxy ];
754
} else if ( proxy && !jQuery.isFunction( proxy ) ) {
760
if ( !proxy && fn ) {
762
return fn.apply( thisObject || this, arguments );
766
// Set the guid of unique handler to the same of original handler, so it can be removed
768
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
771
// So proxy can be declared as an argument
775
// Mutifunctional method to get and set values to a collection
776
// The value/s can be optionally by executed if its a function
777
access: function( elems, key, value, exec, fn, pass ) {
778
var length = elems.length;
780
// Setting many attributes
781
if ( typeof key === "object" ) {
782
for ( var k in key ) {
783
jQuery.access( elems, k, key[k], exec, fn, value );
788
// Setting one attribute
789
if ( value !== undefined ) {
790
// Optionally, function values get executed if exec is true
791
exec = !pass && exec && jQuery.isFunction(value);
793
for ( var i = 0; i < length; i++ ) {
794
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
800
// Getting an attribute
801
return length ? fn( elems[0], key ) : undefined;
805
return (new Date()).getTime();
808
// Use of jQuery.browser is frowned upon.
809
// More details: http://docs.jquery.com/Utilities/jQuery.browser
810
uaMatch: function( ua ) {
811
ua = ua.toLowerCase();
813
var match = rwebkit.exec( ua ) ||
816
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
819
return { browser: match[1] || "", version: match[2] || "0" };
823
function jQuerySubclass( selector, context ) {
824
return new jQuerySubclass.fn.init( selector, context );
826
jQuery.extend( true, jQuerySubclass, this );
827
jQuerySubclass.superclass = this;
828
jQuerySubclass.fn = jQuerySubclass.prototype = this();
829
jQuerySubclass.fn.constructor = jQuerySubclass;
830
jQuerySubclass.subclass = this.subclass;
831
jQuerySubclass.fn.init = function init( selector, context ) {
832
if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
833
context = jQuerySubclass(context);
836
return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
838
jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
839
var rootjQuerySubclass = jQuerySubclass(document);
840
return jQuerySubclass;
846
// Populate the class2type map
847
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
848
class2type[ "[object " + name + "]" ] = name.toLowerCase();
851
browserMatch = jQuery.uaMatch( userAgent );
852
if ( browserMatch.browser ) {
853
jQuery.browser[ browserMatch.browser ] = true;
854
jQuery.browser.version = browserMatch.version;
857
// Deprecated, use jQuery.browser.webkit instead
858
if ( jQuery.browser.webkit ) {
859
jQuery.browser.safari = true;
863
jQuery.inArray = function( elem, array ) {
864
return indexOf.call( array, elem );
868
// IE doesn't match non-breaking spaces with \s
869
if ( rnotwhite.test( "\xA0" ) ) {
870
trimLeft = /^[\s\xA0]+/;
871
trimRight = /[\s\xA0]+$/;
874
// All jQuery objects should point back to these
875
rootjQuery = jQuery(document);
877
// Cleanup functions for the document ready method
878
if ( document.addEventListener ) {
879
DOMContentLoaded = function() {
880
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
884
} else if ( document.attachEvent ) {
885
DOMContentLoaded = function() {
886
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
887
if ( document.readyState === "complete" ) {
888
document.detachEvent( "onreadystatechange", DOMContentLoaded );
894
// The DOM ready check for Internet Explorer
895
function doScrollCheck() {
896
if ( jQuery.isReady ) {
901
// If IE is used, use the trick by Diego Perini
902
// http://javascript.nwbox.com/IEContentLoaded/
903
document.documentElement.doScroll("left");
905
setTimeout( doScrollCheck, 1 );
909
// and execute any waiting functions
913
// Expose jQuery to the global object
919
var // Promise methods
920
promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
921
// Static reference to slice
922
sliceDeferred = [].slice;
925
// Create a simple deferred (one callbacks list)
926
_Deferred: function() {
927
var // callbacks list
929
// stored [ context , args ]
931
// to avoid firing when already doing so
933
// flag to know if the deferred has been cancelled
935
// the deferred itself
938
// done( f1, f2, ...)
941
var args = arguments,
951
for ( i = 0, length = args.length; i < length; i++ ) {
953
type = jQuery.type( elem );
954
if ( type === "array" ) {
955
deferred.done.apply( deferred, elem );
956
} else if ( type === "function" ) {
957
callbacks.push( elem );
961
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
967
// resolve with given context and args
968
resolveWith: function( context, args ) {
969
if ( !cancelled && !fired && !firing ) {
970
// make sure args are available (#8421)
974
while( callbacks[ 0 ] ) {
975
callbacks.shift().apply( context, args );
979
fired = [ context, args ];
986
// resolve with this as context and given arguments
987
resolve: function() {
988
deferred.resolveWith( this, arguments );
992
// Has this deferred been resolved?
993
isResolved: function() {
994
return !!( firing || fired );
1008
// Full fledged deferred (two callbacks list)
1009
Deferred: function( func ) {
1010
var deferred = jQuery._Deferred(),
1011
failDeferred = jQuery._Deferred(),
1013
// Add errorDeferred methods, then and promise
1014
jQuery.extend( deferred, {
1015
then: function( doneCallbacks, failCallbacks ) {
1016
deferred.done( doneCallbacks ).fail( failCallbacks );
1019
fail: failDeferred.done,
1020
rejectWith: failDeferred.resolveWith,
1021
reject: failDeferred.resolve,
1022
isRejected: failDeferred.isResolved,
1023
// Get a promise for this deferred
1024
// If obj is provided, the promise aspect is added to the object
1025
promise: function( obj ) {
1026
if ( obj == null ) {
1032
var i = promiseMethods.length;
1034
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
1039
// Make sure only one callback list will be used
1040
deferred.done( failDeferred.cancel ).fail( deferred.cancel );
1042
delete deferred.cancel;
1043
// Call given func if any
1045
func.call( deferred, deferred );
1051
when: function( firstParam ) {
1052
var args = arguments,
1054
length = args.length,
1056
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1059
function resolveFunc( i ) {
1060
return function( value ) {
1061
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1062
if ( !( --count ) ) {
1063
// Strange bug in FF4:
1064
// Values changed onto the arguments object sometimes end up as undefined values
1065
// outside the $.when method. Cloning the object into a fresh array solves the issue
1066
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
1071
for( ; i < length; i++ ) {
1072
if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
1073
args[ i ].promise().then( resolveFunc(i), deferred.reject );
1079
deferred.resolveWith( deferred, args );
1081
} else if ( deferred !== firstParam ) {
1082
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1084
return deferred.promise();
1093
jQuery.support = {};
1095
var div = document.createElement("div");
1097
div.style.display = "none";
1098
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1100
var all = div.getElementsByTagName("*"),
1101
a = div.getElementsByTagName("a")[0],
1102
select = document.createElement("select"),
1103
opt = select.appendChild( document.createElement("option") ),
1104
input = div.getElementsByTagName("input")[0];
1106
// Can't get basic test support
1107
if ( !all || !all.length || !a ) {
1112
// IE strips leading whitespace when .innerHTML is used
1113
leadingWhitespace: div.firstChild.nodeType === 3,
1115
// Make sure that tbody elements aren't automatically inserted
1116
// IE will insert them into empty tables
1117
tbody: !div.getElementsByTagName("tbody").length,
1119
// Make sure that link elements get serialized correctly by innerHTML
1120
// This requires a wrapper element in IE
1121
htmlSerialize: !!div.getElementsByTagName("link").length,
1123
// Get the style information from getAttribute
1124
// (IE uses .cssText insted)
1125
style: /red/.test( a.getAttribute("style") ),
1127
// Make sure that URLs aren't manipulated
1128
// (IE normalizes it by default)
1129
hrefNormalized: a.getAttribute("href") === "/a",
1131
// Make sure that element opacity exists
1132
// (IE uses filter instead)
1133
// Use a regex to work around a WebKit issue. See #5145
1134
opacity: /^0.55$/.test( a.style.opacity ),
1136
// Verify style float existence
1137
// (IE uses styleFloat instead of cssFloat)
1138
cssFloat: !!a.style.cssFloat,
1140
// Make sure that if no value is specified for a checkbox
1141
// that it defaults to "on".
1142
// (WebKit defaults to "" instead)
1143
checkOn: input.value === "on",
1145
// Make sure that a selected-by-default option has a working selected property.
1146
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1147
optSelected: opt.selected,
1149
// Will be defined later
1150
deleteExpando: true,
1154
noCloneChecked: true,
1156
inlineBlockNeedsLayout: false,
1157
shrinkWrapBlocks: false,
1158
reliableHiddenOffsets: true,
1159
reliableMarginRight: true
1162
input.checked = true;
1163
jQuery.support.noCloneChecked = input.cloneNode( true ).checked;
1165
// Make sure that the options inside disabled selects aren't marked as disabled
1166
// (WebKit marks them as diabled)
1167
select.disabled = true;
1168
jQuery.support.optDisabled = !opt.disabled;
1170
var _scriptEval = null;
1171
jQuery.support.scriptEval = function() {
1172
if ( _scriptEval === null ) {
1173
var root = document.documentElement,
1174
script = document.createElement("script"),
1175
id = "script" + jQuery.now();
1177
// Make sure that the execution of code works by injecting a script
1178
// tag with appendChild/createTextNode
1179
// (IE doesn't support this, fails, and uses .text instead)
1181
script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
1184
root.insertBefore( script, root.firstChild );
1186
if ( window[ id ] ) {
1188
delete window[ id ];
1190
_scriptEval = false;
1193
root.removeChild( script );
1199
// Test to see if it's possible to delete an expando from an element
1200
// Fails in Internet Explorer
1205
jQuery.support.deleteExpando = false;
1208
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1209
div.attachEvent("onclick", function click() {
1210
// Cloning a node shouldn't copy over any
1211
// bound event handlers (IE does this)
1212
jQuery.support.noCloneEvent = false;
1213
div.detachEvent("onclick", click);
1215
div.cloneNode(true).fireEvent("onclick");
1218
div = document.createElement("div");
1219
div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
1221
var fragment = document.createDocumentFragment();
1222
fragment.appendChild( div.firstChild );
1224
// WebKit doesn't clone checked state correctly in fragments
1225
jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
1227
// Figure out if the W3C box model works as expected
1228
// document.body must exist before we can do this
1230
var div = document.createElement("div"),
1231
body = document.getElementsByTagName("body")[0];
1233
// Frameset documents with no body should not run this code
1238
div.style.width = div.style.paddingLeft = "1px";
1239
body.appendChild( div );
1240
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
1242
if ( "zoom" in div.style ) {
1243
// Check if natively block-level elements act like inline-block
1244
// elements when setting their display to 'inline' and giving
1246
// (IE < 8 does this)
1247
div.style.display = "inline";
1249
jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
1251
// Check if elements with layout shrink-wrap their children
1253
div.style.display = "";
1254
div.innerHTML = "<div style='width:4px;'></div>";
1255
jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
1258
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
1259
var tds = div.getElementsByTagName("td");
1261
// Check if table cells still have offsetWidth/Height when they are set
1262
// to display:none and there are still other visible table cells in a
1263
// table row; if so, offsetWidth/Height are not reliable for use when
1264
// determining if an element has been hidden directly using
1265
// display:none (it is still safe to use offsets if a parent element is
1266
// hidden; don safety goggles and see bug #4512 for more information).
1267
// (only IE 8 fails this test)
1268
jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
1270
tds[0].style.display = "";
1271
tds[1].style.display = "none";
1273
// Check if empty table cells still have offsetWidth/Height
1274
// (IE < 8 fail this test)
1275
jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
1278
// Check if div with explicit width and no margin-right incorrectly
1279
// gets computed margin-right based on width of container. For more
1280
// info see bug #3333
1281
// Fails in WebKit before Feb 2011 nightlies
1282
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1283
if ( document.defaultView && document.defaultView.getComputedStyle ) {
1284
div.style.width = "1px";
1285
div.style.marginRight = "0";
1286
jQuery.support.reliableMarginRight = ( parseInt(document.defaultView.getComputedStyle(div, null).marginRight, 10) || 0 ) === 0;
1289
body.removeChild( div ).style.display = "none";
1293
// Technique from Juriy Zaytsev
1294
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
1295
var eventSupported = function( eventName ) {
1296
var el = document.createElement("div");
1297
eventName = "on" + eventName;
1299
// We only care about the case where non-standard event systems
1300
// are used, namely in IE. Short-circuiting here helps us to
1301
// avoid an eval call (in setAttribute) which can cause CSP
1302
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1303
if ( !el.attachEvent ) {
1307
var isSupported = (eventName in el);
1308
if ( !isSupported ) {
1309
el.setAttribute(eventName, "return;");
1310
isSupported = typeof el[eventName] === "function";
1315
jQuery.support.submitBubbles = eventSupported("submit");
1316
jQuery.support.changeBubbles = eventSupported("change");
1318
// release memory in IE
1319
div = all = a = null;
1324
var rbrace = /^(?:\{.*\}|\[.*\])$/;
1329
// Please use with caution
1332
// Unique for each copy of jQuery on the page
1333
// Non-digits removed to match rinlinejQuery
1334
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1336
// The following elements throw uncatchable exceptions if you
1337
// attempt to add expando properties to them.
1340
// Ban all objects except for Flash (which handle expandos)
1341
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1345
hasData: function( elem ) {
1346
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1348
return !!elem && !isEmptyDataObject( elem );
1351
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1352
if ( !jQuery.acceptData( elem ) ) {
1356
var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
1358
// We have to handle DOM nodes and JS objects differently because IE6-7
1359
// can't GC object references properly across the DOM-JS boundary
1360
isNode = elem.nodeType,
1362
// Only DOM nodes need the global jQuery cache; JS object data is
1363
// attached directly to the object so GC can occur automatically
1364
cache = isNode ? jQuery.cache : elem,
1366
// Only defining an ID for JS objects if its cache already exists allows
1367
// the code to shortcut on the same path as a DOM node with no cache
1368
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
1370
// Avoid doing any more work than we need to when trying to get data on an
1371
// object that has no data at all
1372
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
1377
// Only DOM nodes need a new unique ID for each element since their data
1378
// ends up in the global cache
1380
elem[ jQuery.expando ] = id = ++jQuery.uuid;
1382
id = jQuery.expando;
1386
if ( !cache[ id ] ) {
1389
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
1390
// metadata on plain JS objects when the object is serialized using
1393
cache[ id ].toJSON = jQuery.noop;
1397
// An object can be passed to jQuery.data instead of a key/value pair; this gets
1398
// shallow copied over onto the existing cache
1399
if ( typeof name === "object" || typeof name === "function" ) {
1401
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
1403
cache[ id ] = jQuery.extend(cache[ id ], name);
1407
thisCache = cache[ id ];
1409
// Internal jQuery data is stored in a separate object inside the object's data
1410
// cache in order to avoid key collisions between internal data and user-defined
1413
if ( !thisCache[ internalKey ] ) {
1414
thisCache[ internalKey ] = {};
1417
thisCache = thisCache[ internalKey ];
1420
if ( data !== undefined ) {
1421
thisCache[ name ] = data;
1424
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
1425
// not attempt to inspect the internal events object using jQuery.data, as this
1426
// internal data object is undocumented and subject to change.
1427
if ( name === "events" && !thisCache[name] ) {
1428
return thisCache[ internalKey ] && thisCache[ internalKey ].events;
1431
return getByName ? thisCache[ name ] : thisCache;
1434
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1435
if ( !jQuery.acceptData( elem ) ) {
1439
var internalKey = jQuery.expando, isNode = elem.nodeType,
1441
// See jQuery.data for more information
1442
cache = isNode ? jQuery.cache : elem,
1444
// See jQuery.data for more information
1445
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1447
// If there is already no cache entry for this object, there is no
1448
// purpose in continuing
1449
if ( !cache[ id ] ) {
1454
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
1457
delete thisCache[ name ];
1459
// If there is no data left in the cache, we want to continue
1460
// and let the cache object itself get destroyed
1461
if ( !isEmptyDataObject(thisCache) ) {
1467
// See jQuery.data for more information
1469
delete cache[ id ][ internalKey ];
1471
// Don't destroy the parent cache unless the internal data object
1472
// had been the only thing left in it
1473
if ( !isEmptyDataObject(cache[ id ]) ) {
1478
var internalCache = cache[ id ][ internalKey ];
1480
// Browsers that fail expando deletion also refuse to delete expandos on
1481
// the window, but it will allow it on all other JS objects; other browsers
1483
if ( jQuery.support.deleteExpando || cache != window ) {
1489
// We destroyed the entire user cache at once because it's faster than
1490
// iterating through each key, but we need to continue to persist internal
1491
// data if it existed
1492
if ( internalCache ) {
1494
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
1495
// metadata on plain JS objects when the object is serialized using
1498
cache[ id ].toJSON = jQuery.noop;
1501
cache[ id ][ internalKey ] = internalCache;
1503
// Otherwise, we need to eliminate the expando on the node to avoid
1504
// false lookups in the cache for entries that no longer exist
1505
} else if ( isNode ) {
1506
// IE does not allow us to delete expando properties from nodes,
1507
// nor does it have a removeAttribute function on Document nodes;
1508
// we must handle all of these cases
1509
if ( jQuery.support.deleteExpando ) {
1510
delete elem[ jQuery.expando ];
1511
} else if ( elem.removeAttribute ) {
1512
elem.removeAttribute( jQuery.expando );
1514
elem[ jQuery.expando ] = null;
1519
// For internal use only.
1520
_data: function( elem, name, data ) {
1521
return jQuery.data( elem, name, data, true );
1524
// A method for determining if a DOM node can handle the data expando
1525
acceptData: function( elem ) {
1526
if ( elem.nodeName ) {
1527
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1530
return !(match === true || elem.getAttribute("classid") !== match);
1539
data: function( key, value ) {
1542
if ( typeof key === "undefined" ) {
1543
if ( this.length ) {
1544
data = jQuery.data( this[0] );
1546
if ( this[0].nodeType === 1 ) {
1547
var attr = this[0].attributes, name;
1548
for ( var i = 0, l = attr.length; i < l; i++ ) {
1549
name = attr[i].name;
1551
if ( name.indexOf( "data-" ) === 0 ) {
1552
name = name.substr( 5 );
1553
dataAttr( this[0], name, data[ name ] );
1561
} else if ( typeof key === "object" ) {
1562
return this.each(function() {
1563
jQuery.data( this, key );
1567
var parts = key.split(".");
1568
parts[1] = parts[1] ? "." + parts[1] : "";
1570
if ( value === undefined ) {
1571
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1573
// Try to fetch any internally stored data first
1574
if ( data === undefined && this.length ) {
1575
data = jQuery.data( this[0], key );
1576
data = dataAttr( this[0], key, data );
1579
return data === undefined && parts[1] ?
1580
this.data( parts[0] ) :
1584
return this.each(function() {
1585
var $this = jQuery( this ),
1586
args = [ parts[0], value ];
1588
$this.triggerHandler( "setData" + parts[1] + "!", args );
1589
jQuery.data( this, key, value );
1590
$this.triggerHandler( "changeData" + parts[1] + "!", args );
1595
removeData: function( key ) {
1596
return this.each(function() {
1597
jQuery.removeData( this, key );
1602
function dataAttr( elem, key, data ) {
1603
// If nothing was found internally, try to fetch any
1604
// data from the HTML5 data-* attribute
1605
if ( data === undefined && elem.nodeType === 1 ) {
1606
data = elem.getAttribute( "data-" + key );
1608
if ( typeof data === "string" ) {
1610
data = data === "true" ? true :
1611
data === "false" ? false :
1612
data === "null" ? null :
1613
!jQuery.isNaN( data ) ? parseFloat( data ) :
1614
rbrace.test( data ) ? jQuery.parseJSON( data ) :
1618
// Make sure we set the data so it isn't changed later
1619
jQuery.data( elem, key, data );
1629
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
1630
// property to be considered empty objects; this property always exists in
1631
// order to make sure JSON.stringify does not expose internal metadata
1632
function isEmptyDataObject( obj ) {
1633
for ( var name in obj ) {
1634
if ( name !== "toJSON" ) {
1646
queue: function( elem, type, data ) {
1651
type = (type || "fx") + "queue";
1652
var q = jQuery._data( elem, type );
1654
// Speed up dequeue by getting out quickly if this is just a lookup
1659
if ( !q || jQuery.isArray(data) ) {
1660
q = jQuery._data( elem, type, jQuery.makeArray(data) );
1669
dequeue: function( elem, type ) {
1670
type = type || "fx";
1672
var queue = jQuery.queue( elem, type ),
1675
// If the fx queue is dequeued, always remove the progress sentinel
1676
if ( fn === "inprogress" ) {
1681
// Add a progress sentinel to prevent the fx queue from being
1682
// automatically dequeued
1683
if ( type === "fx" ) {
1684
queue.unshift("inprogress");
1687
fn.call(elem, function() {
1688
jQuery.dequeue(elem, type);
1692
if ( !queue.length ) {
1693
jQuery.removeData( elem, type + "queue", true );
1699
queue: function( type, data ) {
1700
if ( typeof type !== "string" ) {
1705
if ( data === undefined ) {
1706
return jQuery.queue( this[0], type );
1708
return this.each(function( i ) {
1709
var queue = jQuery.queue( this, type, data );
1711
if ( type === "fx" && queue[0] !== "inprogress" ) {
1712
jQuery.dequeue( this, type );
1716
dequeue: function( type ) {
1717
return this.each(function() {
1718
jQuery.dequeue( this, type );
1722
// Based off of the plugin by Clint Helfers, with permission.
1723
// http://blindsignals.com/index.php/2009/07/jquery-delay/
1724
delay: function( time, type ) {
1725
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1726
type = type || "fx";
1728
return this.queue( type, function() {
1730
setTimeout(function() {
1731
jQuery.dequeue( elem, type );
1736
clearQueue: function( type ) {
1737
return this.queue( type || "fx", [] );
1744
var rclass = /[\n\t\r]/g,
1747
rspecialurl = /^(?:href|src|style)$/,
1748
rtype = /^(?:button|input)$/i,
1749
rfocusable = /^(?:button|input|object|select|textarea)$/i,
1750
rclickable = /^a(?:rea)?$/i,
1751
rradiocheck = /^(?:radio|checkbox)$/i;
1755
"class": "className",
1756
readonly: "readOnly",
1757
maxlength: "maxLength",
1758
cellspacing: "cellSpacing",
1761
tabindex: "tabIndex",
1763
frameborder: "frameBorder"
1767
attr: function( name, value ) {
1768
return jQuery.access( this, name, value, true, jQuery.attr );
1771
removeAttr: function( name, fn ) {
1772
return this.each(function(){
1773
jQuery.attr( this, name, "" );
1774
if ( this.nodeType === 1 ) {
1775
this.removeAttribute( name );
1780
addClass: function( value ) {
1781
if ( jQuery.isFunction(value) ) {
1782
return this.each(function(i) {
1783
var self = jQuery(this);
1784
self.addClass( value.call(this, i, self.attr("class")) );
1788
if ( value && typeof value === "string" ) {
1789
var classNames = (value || "").split( rspaces );
1791
for ( var i = 0, l = this.length; i < l; i++ ) {
1794
if ( elem.nodeType === 1 ) {
1795
if ( !elem.className ) {
1796
elem.className = value;
1799
var className = " " + elem.className + " ",
1800
setClass = elem.className;
1802
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1803
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1804
setClass += " " + classNames[c];
1807
elem.className = jQuery.trim( setClass );
1816
removeClass: function( value ) {
1817
if ( jQuery.isFunction(value) ) {
1818
return this.each(function(i) {
1819
var self = jQuery(this);
1820
self.removeClass( value.call(this, i, self.attr("class")) );
1824
if ( (value && typeof value === "string") || value === undefined ) {
1825
var classNames = (value || "").split( rspaces );
1827
for ( var i = 0, l = this.length; i < l; i++ ) {
1830
if ( elem.nodeType === 1 && elem.className ) {
1832
var className = (" " + elem.className + " ").replace(rclass, " ");
1833
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1834
className = className.replace(" " + classNames[c] + " ", " ");
1836
elem.className = jQuery.trim( className );
1839
elem.className = "";
1848
toggleClass: function( value, stateVal ) {
1849
var type = typeof value,
1850
isBool = typeof stateVal === "boolean";
1852
if ( jQuery.isFunction( value ) ) {
1853
return this.each(function(i) {
1854
var self = jQuery(this);
1855
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1859
return this.each(function() {
1860
if ( type === "string" ) {
1861
// toggle individual class names
1864
self = jQuery( this ),
1866
classNames = value.split( rspaces );
1868
while ( (className = classNames[ i++ ]) ) {
1869
// check each className given, space seperated list
1870
state = isBool ? state : !self.hasClass( className );
1871
self[ state ? "addClass" : "removeClass" ]( className );
1874
} else if ( type === "undefined" || type === "boolean" ) {
1875
if ( this.className ) {
1876
// store className if set
1877
jQuery._data( this, "__className__", this.className );
1880
// toggle whole className
1881
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
1886
hasClass: function( selector ) {
1887
var className = " " + selector + " ";
1888
for ( var i = 0, l = this.length; i < l; i++ ) {
1889
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1897
val: function( value ) {
1898
if ( !arguments.length ) {
1902
if ( jQuery.nodeName( elem, "option" ) ) {
1903
// attributes.value is undefined in Blackberry 4.7 but
1904
// uses .value. See #6932
1905
var val = elem.attributes.value;
1906
return !val || val.specified ? elem.value : elem.text;
1909
// We need to handle select boxes special
1910
if ( jQuery.nodeName( elem, "select" ) ) {
1911
var index = elem.selectedIndex,
1913
options = elem.options,
1914
one = elem.type === "select-one";
1916
// Nothing was selected
1921
// Loop through all the selected options
1922
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1923
var option = options[ i ];
1925
// Don't return options that are disabled or in a disabled optgroup
1926
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
1927
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
1929
// Get the specific value for the option
1930
value = jQuery(option).val();
1932
// We don't need an array for one selects
1937
// Multi-Selects return an array
1938
values.push( value );
1942
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
1943
if ( one && !values.length && options.length ) {
1944
return jQuery( options[ index ] ).val();
1950
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1951
if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1952
return elem.getAttribute("value") === null ? "on" : elem.value;
1955
// Everything else, we just grab the value
1956
return (elem.value || "").replace(rreturn, "");
1963
var isFunction = jQuery.isFunction(value);
1965
return this.each(function(i) {
1966
var self = jQuery(this), val = value;
1968
if ( this.nodeType !== 1 ) {
1973
val = value.call(this, i, self.val());
1976
// Treat null/undefined as ""; convert numbers to string
1977
if ( val == null ) {
1979
} else if ( typeof val === "number" ) {
1981
} else if ( jQuery.isArray(val) ) {
1982
val = jQuery.map(val, function (value) {
1983
return value == null ? "" : value + "";
1987
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1988
this.checked = jQuery.inArray( self.val(), val ) >= 0;
1990
} else if ( jQuery.nodeName( this, "select" ) ) {
1991
var values = jQuery.makeArray(val);
1993
jQuery( "option", this ).each(function() {
1994
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1997
if ( !values.length ) {
1998
this.selectedIndex = -1;
2020
attr: function( elem, name, value, pass ) {
2021
// don't get/set attributes on text, comment and attribute nodes
2022
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) {
2026
if ( pass && name in jQuery.attrFn ) {
2027
return jQuery(elem)[name](value);
2030
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
2031
// Whether we are setting (or getting)
2032
set = value !== undefined;
2034
// Try to normalize/fix the name
2035
name = notxml && jQuery.props[ name ] || name;
2037
// Only do all the following if this is a node (faster for style)
2038
if ( elem.nodeType === 1 ) {
2039
// These attributes require special treatment
2040
var special = rspecialurl.test( name );
2042
// Safari mis-reports the default selected property of an option
2043
// Accessing the parent's selectedIndex property fixes it
2044
if ( name === "selected" && !jQuery.support.optSelected ) {
2045
var parent = elem.parentNode;
2047
parent.selectedIndex;
2049
// Make sure that it also works with optgroups, see #5701
2050
if ( parent.parentNode ) {
2051
parent.parentNode.selectedIndex;
2056
// If applicable, access the attribute via the DOM 0 way
2057
// 'in' checks fail in Blackberry 4.7 #6931
2058
if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
2060
// We can't allow the type property to be changed (since it causes problems in IE)
2061
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
2062
jQuery.error( "type property can't be changed" );
2065
if ( value === null ) {
2066
if ( elem.nodeType === 1 ) {
2067
elem.removeAttribute( name );
2071
elem[ name ] = value;
2075
// browsers index elements by id/name on forms, give priority to attributes.
2076
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
2077
return elem.getAttributeNode( name ).nodeValue;
2080
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2081
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2082
if ( name === "tabIndex" ) {
2083
var attributeNode = elem.getAttributeNode( "tabIndex" );
2085
return attributeNode && attributeNode.specified ?
2086
attributeNode.value :
2087
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2092
return elem[ name ];
2095
if ( !jQuery.support.style && notxml && name === "style" ) {
2097
elem.style.cssText = "" + value;
2100
return elem.style.cssText;
2104
// convert the value to a string (all browsers do this but IE) see #1070
2105
elem.setAttribute( name, "" + value );
2108
// Ensure that missing attributes return undefined
2109
// Blackberry 4.7 returns "" from getAttribute #6938
2110
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
2114
var attr = !jQuery.support.hrefNormalized && notxml && special ?
2115
// Some attributes require a special call on IE
2116
elem.getAttribute( name, 2 ) :
2117
elem.getAttribute( name );
2119
// Non-existent attributes return null, we normalize to undefined
2120
return attr === null ? undefined : attr;
2122
// Handle everything which isn't a DOM element node
2124
elem[ name ] = value;
2126
return elem[ name ];
2133
var rnamespaces = /\.(.*)$/,
2134
rformElems = /^(?:textarea|input|select)$/i,
2137
rescape = /[^\w\s.|`]/g,
2138
fcleanup = function( nm ) {
2139
return nm.replace(rescape, "\\$&");
2143
* A number of helper functions used for managing events.
2144
* Many of the ideas behind this code originated from
2145
* Dean Edwards' addEvent library.
2149
// Bind an event to an element
2150
// Original by Dean Edwards
2151
add: function( elem, types, handler, data ) {
2152
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2156
// TODO :: Use a try/catch until it's safe to pull this out (likely 1.6)
2157
// Minor release fix for bug #8018
2159
// For whatever reason, IE has trouble passing the window object
2160
// around, causing it to be cloned in the process
2161
if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
2167
if ( handler === false ) {
2168
handler = returnFalse;
2169
} else if ( !handler ) {
2170
// Fixes bug #7229. Fix recommended by jdalton
2174
var handleObjIn, handleObj;
2176
if ( handler.handler ) {
2177
handleObjIn = handler;
2178
handler = handleObjIn.handler;
2181
// Make sure that the function being executed has a unique ID
2182
if ( !handler.guid ) {
2183
handler.guid = jQuery.guid++;
2186
// Init the element's event structure
2187
var elemData = jQuery._data( elem );
2189
// If no elemData is found then we must be trying to bind to one of the
2190
// banned noData elements
2195
var events = elemData.events,
2196
eventHandle = elemData.handle;
2199
elemData.events = events = {};
2202
if ( !eventHandle ) {
2203
elemData.handle = eventHandle = function( e ) {
2204
// Handle the second event of a trigger and when
2205
// an event is called after a page has unloaded
2206
return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
2207
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
2212
// Add elem as a property of the handle function
2213
// This is to prevent a memory leak with non-native events in IE.
2214
eventHandle.elem = elem;
2216
// Handle multiple events separated by a space
2217
// jQuery(...).bind("mouseover mouseout", fn);
2218
types = types.split(" ");
2220
var type, i = 0, namespaces;
2222
while ( (type = types[ i++ ]) ) {
2223
handleObj = handleObjIn ?
2224
jQuery.extend({}, handleObjIn) :
2225
{ handler: handler, data: data };
2227
// Namespaced event handlers
2228
if ( type.indexOf(".") > -1 ) {
2229
namespaces = type.split(".");
2230
type = namespaces.shift();
2231
handleObj.namespace = namespaces.slice(0).sort().join(".");
2235
handleObj.namespace = "";
2238
handleObj.type = type;
2239
if ( !handleObj.guid ) {
2240
handleObj.guid = handler.guid;
2243
// Get the current list of functions bound to this event
2244
var handlers = events[ type ],
2245
special = jQuery.event.special[ type ] || {};
2247
// Init the event handler queue
2249
handlers = events[ type ] = [];
2251
// Check for a special event handler
2252
// Only use addEventListener/attachEvent if the special
2253
// events handler returns false
2254
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2255
// Bind the global event handler to the element
2256
if ( elem.addEventListener ) {
2257
elem.addEventListener( type, eventHandle, false );
2259
} else if ( elem.attachEvent ) {
2260
elem.attachEvent( "on" + type, eventHandle );
2265
if ( special.add ) {
2266
special.add.call( elem, handleObj );
2268
if ( !handleObj.handler.guid ) {
2269
handleObj.handler.guid = handler.guid;
2273
// Add the function to the element's handler list
2274
handlers.push( handleObj );
2276
// Keep track of which events have been used, for global triggering
2277
jQuery.event.global[ type ] = true;
2280
// Nullify elem to prevent memory leaks in IE
2286
// Detach an event or set of events from an element
2287
remove: function( elem, types, handler, pos ) {
2288
// don't do events on text and comment nodes
2289
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2293
if ( handler === false ) {
2294
handler = returnFalse;
2297
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
2298
elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
2299
events = elemData && elemData.events;
2301
if ( !elemData || !events ) {
2305
// types is actually an event object here
2306
if ( types && types.type ) {
2307
handler = types.handler;
2311
// Unbind all events for the element
2312
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
2313
types = types || "";
2315
for ( type in events ) {
2316
jQuery.event.remove( elem, type + types );
2322
// Handle multiple events separated by a space
2323
// jQuery(...).unbind("mouseover mouseout", fn);
2324
types = types.split(" ");
2326
while ( (type = types[ i++ ]) ) {
2329
all = type.indexOf(".") < 0;
2333
// Namespaced event handlers
2334
namespaces = type.split(".");
2335
type = namespaces.shift();
2337
namespace = new RegExp("(^|\\.)" +
2338
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
2341
eventType = events[ type ];
2348
for ( j = 0; j < eventType.length; j++ ) {
2349
handleObj = eventType[ j ];
2351
if ( all || namespace.test( handleObj.namespace ) ) {
2352
jQuery.event.remove( elem, origType, handleObj.handler, j );
2353
eventType.splice( j--, 1 );
2360
special = jQuery.event.special[ type ] || {};
2362
for ( j = pos || 0; j < eventType.length; j++ ) {
2363
handleObj = eventType[ j ];
2365
if ( handler.guid === handleObj.guid ) {
2366
// remove the given handler for the given type
2367
if ( all || namespace.test( handleObj.namespace ) ) {
2368
if ( pos == null ) {
2369
eventType.splice( j--, 1 );
2372
if ( special.remove ) {
2373
special.remove.call( elem, handleObj );
2377
if ( pos != null ) {
2383
// remove generic event handler if no more handlers exist
2384
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
2385
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
2386
jQuery.removeEvent( elem, type, elemData.handle );
2390
delete events[ type ];
2394
// Remove the expando if it's no longer used
2395
if ( jQuery.isEmptyObject( events ) ) {
2396
var handle = elemData.handle;
2401
delete elemData.events;
2402
delete elemData.handle;
2404
if ( jQuery.isEmptyObject( elemData ) ) {
2405
jQuery.removeData( elem, undefined, true );
2410
// bubbling is internal
2411
trigger: function( event, data, elem /*, bubbling */ ) {
2412
// Event object or event type
2413
var type = event.type || event,
2414
bubbling = arguments[3];
2417
event = typeof event === "object" ?
2418
// jQuery.Event object
2419
event[ jQuery.expando ] ? event :
2421
jQuery.extend( jQuery.Event(type), event ) :
2422
// Just the event type (string)
2425
if ( type.indexOf("!") >= 0 ) {
2426
event.type = type = type.slice(0, -1);
2427
event.exclusive = true;
2430
// Handle a global trigger
2432
// Don't bubble custom events when global (to avoid too much overhead)
2433
event.stopPropagation();
2435
// Only trigger if we've ever bound an event for it
2436
if ( jQuery.event.global[ type ] ) {
2437
// XXX This code smells terrible. event.js should not be directly
2438
// inspecting the data cache
2439
jQuery.each( jQuery.cache, function() {
2440
// internalKey variable is just used to make it easier to find
2441
// and potentially change this stuff later; currently it just
2442
// points to jQuery.expando
2443
var internalKey = jQuery.expando,
2444
internalCache = this[ internalKey ];
2445
if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
2446
jQuery.event.trigger( event, data, internalCache.handle.elem );
2452
// Handle triggering a single element
2454
// don't do events on text and comment nodes
2455
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
2459
// Clean up in case it is reused
2460
event.result = undefined;
2461
event.target = elem;
2463
// Clone the incoming data, if any
2464
data = jQuery.makeArray( data );
2465
data.unshift( event );
2468
event.currentTarget = elem;
2470
// Trigger the event, it is assumed that "handle" is a function
2471
var handle = jQuery._data( elem, "handle" );
2474
handle.apply( elem, data );
2477
var parent = elem.parentNode || elem.ownerDocument;
2479
// Trigger an inline bound script
2481
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
2482
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
2483
event.result = false;
2484
event.preventDefault();
2488
// prevent IE from throwing an error for some elements with some event types, see #3533
2489
} catch (inlineError) {}
2491
if ( !event.isPropagationStopped() && parent ) {
2492
jQuery.event.trigger( event, data, parent, true );
2494
} else if ( !event.isDefaultPrevented() ) {
2496
target = event.target,
2497
targetType = type.replace( rnamespaces, "" ),
2498
isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
2499
special = jQuery.event.special[ targetType ] || {};
2501
if ( (!special._default || special._default.call( elem, event ) === false) &&
2502
!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
2505
if ( target[ targetType ] ) {
2506
// Make sure that we don't accidentally re-trigger the onFOO events
2507
old = target[ "on" + targetType ];
2510
target[ "on" + targetType ] = null;
2513
jQuery.event.triggered = event.type;
2514
target[ targetType ]();
2517
// prevent IE from throwing an error for some elements with some event types, see #3533
2518
} catch (triggerError) {}
2521
target[ "on" + targetType ] = old;
2524
jQuery.event.triggered = undefined;
2529
handle: function( event ) {
2530
var all, handlers, namespaces, namespace_re, events,
2531
namespace_sort = [],
2532
args = jQuery.makeArray( arguments );
2534
event = args[0] = jQuery.event.fix( event || window.event );
2535
event.currentTarget = this;
2537
// Namespaced event handlers
2538
all = event.type.indexOf(".") < 0 && !event.exclusive;
2541
namespaces = event.type.split(".");
2542
event.type = namespaces.shift();
2543
namespace_sort = namespaces.slice(0).sort();
2544
namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
2547
event.namespace = event.namespace || namespace_sort.join(".");
2549
events = jQuery._data(this, "events");
2551
handlers = (events || {})[ event.type ];
2553
if ( events && handlers ) {
2554
// Clone the handlers to prevent manipulation
2555
handlers = handlers.slice(0);
2557
for ( var j = 0, l = handlers.length; j < l; j++ ) {
2558
var handleObj = handlers[ j ];
2560
// Filter the functions by class
2561
if ( all || namespace_re.test( handleObj.namespace ) ) {
2562
// Pass in a reference to the handler function itself
2563
// So that we can later remove it
2564
event.handler = handleObj.handler;
2565
event.data = handleObj.data;
2566
event.handleObj = handleObj;
2568
var ret = handleObj.handler.apply( this, args );
2570
if ( ret !== undefined ) {
2572
if ( ret === false ) {
2573
event.preventDefault();
2574
event.stopPropagation();
2578
if ( event.isImmediatePropagationStopped() ) {
2585
return event.result;
2588
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
2590
fix: function( event ) {
2591
if ( event[ jQuery.expando ] ) {
2595
// store a copy of the original event object
2596
// and "clone" to set read-only properties
2597
var originalEvent = event;
2598
event = jQuery.Event( originalEvent );
2600
for ( var i = this.props.length, prop; i; ) {
2601
prop = this.props[ --i ];
2602
event[ prop ] = originalEvent[ prop ];
2605
// Fix target property, if necessary
2606
if ( !event.target ) {
2607
// Fixes #1925 where srcElement might not be defined either
2608
event.target = event.srcElement || document;
2611
// check if target is a textnode (safari)
2612
if ( event.target.nodeType === 3 ) {
2613
event.target = event.target.parentNode;
2616
// Add relatedTarget, if necessary
2617
if ( !event.relatedTarget && event.fromElement ) {
2618
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
2621
// Calculate pageX/Y if missing and clientX/Y available
2622
if ( event.pageX == null && event.clientX != null ) {
2623
var doc = document.documentElement,
2624
body = document.body;
2626
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
2627
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
2630
// Add which for key events
2631
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
2632
event.which = event.charCode != null ? event.charCode : event.keyCode;
2635
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2636
if ( !event.metaKey && event.ctrlKey ) {
2637
event.metaKey = event.ctrlKey;
2640
// Add which for click: 1 === left; 2 === middle; 3 === right
2641
// Note: button is not normalized, so don't use it
2642
if ( !event.which && event.button !== undefined ) {
2643
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2649
// Deprecated, use jQuery.guid instead
2652
// Deprecated, use jQuery.proxy instead
2653
proxy: jQuery.proxy,
2657
// Make sure the ready event is setup
2658
setup: jQuery.bindReady,
2659
teardown: jQuery.noop
2663
add: function( handleObj ) {
2664
jQuery.event.add( this,
2665
liveConvert( handleObj.origType, handleObj.selector ),
2666
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
2669
remove: function( handleObj ) {
2670
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
2675
setup: function( data, namespaces, eventHandle ) {
2676
// We only want to do this special case on windows
2677
if ( jQuery.isWindow( this ) ) {
2678
this.onbeforeunload = eventHandle;
2682
teardown: function( namespaces, eventHandle ) {
2683
if ( this.onbeforeunload === eventHandle ) {
2684
this.onbeforeunload = null;
2691
jQuery.removeEvent = document.removeEventListener ?
2692
function( elem, type, handle ) {
2693
if ( elem.removeEventListener ) {
2694
elem.removeEventListener( type, handle, false );
2697
function( elem, type, handle ) {
2698
if ( elem.detachEvent ) {
2699
elem.detachEvent( "on" + type, handle );
2703
jQuery.Event = function( src ) {
2704
// Allow instantiation without the 'new' keyword
2705
if ( !this.preventDefault ) {
2706
return new jQuery.Event( src );
2710
if ( src && src.type ) {
2711
this.originalEvent = src;
2712
this.type = src.type;
2714
// Events bubbling up the document may have been marked as prevented
2715
// by a handler lower down the tree; reflect the correct value.
2716
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
2717
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
2724
// timeStamp is buggy for some events on Firefox(#3843)
2725
// So we won't rely on the native value
2726
this.timeStamp = jQuery.now();
2729
this[ jQuery.expando ] = true;
2732
function returnFalse() {
2735
function returnTrue() {
2739
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2740
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2741
jQuery.Event.prototype = {
2742
preventDefault: function() {
2743
this.isDefaultPrevented = returnTrue;
2745
var e = this.originalEvent;
2750
// if preventDefault exists run it on the original event
2751
if ( e.preventDefault ) {
2754
// otherwise set the returnValue property of the original event to false (IE)
2756
e.returnValue = false;
2759
stopPropagation: function() {
2760
this.isPropagationStopped = returnTrue;
2762
var e = this.originalEvent;
2766
// if stopPropagation exists run it on the original event
2767
if ( e.stopPropagation ) {
2768
e.stopPropagation();
2770
// otherwise set the cancelBubble property of the original event to true (IE)
2771
e.cancelBubble = true;
2773
stopImmediatePropagation: function() {
2774
this.isImmediatePropagationStopped = returnTrue;
2775
this.stopPropagation();
2777
isDefaultPrevented: returnFalse,
2778
isPropagationStopped: returnFalse,
2779
isImmediatePropagationStopped: returnFalse
2782
// Checks if an event happened on an element within another element
2783
// Used in jQuery.event.special.mouseenter and mouseleave handlers
2784
var withinElement = function( event ) {
2785
// Check if mouse(over|out) are still within the same parent element
2786
var parent = event.relatedTarget;
2788
// Firefox sometimes assigns relatedTarget a XUL element
2789
// which we cannot access the parentNode property of
2792
// Chrome does something similar, the parentNode property
2793
// can be accessed but is null.
2794
if ( parent && parent !== document && !parent.parentNode ) {
2797
// Traverse up the tree
2798
while ( parent && parent !== this ) {
2799
parent = parent.parentNode;
2802
if ( parent !== this ) {
2803
// set the correct event type
2804
event.type = event.data;
2806
// handle event if we actually just moused on to a non sub-element
2807
jQuery.event.handle.apply( this, arguments );
2810
// assuming we've left the element since we most likely mousedover a xul element
2814
// In case of event delegation, we only need to rename the event.type,
2815
// liveHandler will take care of the rest.
2816
delegate = function( event ) {
2817
event.type = event.data;
2818
jQuery.event.handle.apply( this, arguments );
2821
// Create mouseenter and mouseleave events
2823
mouseenter: "mouseover",
2824
mouseleave: "mouseout"
2825
}, function( orig, fix ) {
2826
jQuery.event.special[ orig ] = {
2827
setup: function( data ) {
2828
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
2830
teardown: function( data ) {
2831
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
2836
// submit delegation
2837
if ( !jQuery.support.submitBubbles ) {
2839
jQuery.event.special.submit = {
2840
setup: function( data, namespaces ) {
2841
if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {
2842
jQuery.event.add(this, "click.specialSubmit", function( e ) {
2843
var elem = e.target,
2846
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
2847
trigger( "submit", this, arguments );
2851
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
2852
var elem = e.target,
2855
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
2856
trigger( "submit", this, arguments );
2865
teardown: function( namespaces ) {
2866
jQuery.event.remove( this, ".specialSubmit" );
2872
// change delegation, happens here so we have bind.
2873
if ( !jQuery.support.changeBubbles ) {
2877
getVal = function( elem ) {
2878
var type = elem.type, val = elem.value;
2880
if ( type === "radio" || type === "checkbox" ) {
2883
} else if ( type === "select-multiple" ) {
2884
val = elem.selectedIndex > -1 ?
2885
jQuery.map( elem.options, function( elem ) {
2886
return elem.selected;
2890
} else if ( elem.nodeName.toLowerCase() === "select" ) {
2891
val = elem.selectedIndex;
2897
testChange = function testChange( e ) {
2898
var elem = e.target, data, val;
2900
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
2904
data = jQuery._data( elem, "_change_data" );
2907
// the current data will be also retrieved by beforeactivate
2908
if ( e.type !== "focusout" || elem.type !== "radio" ) {
2909
jQuery._data( elem, "_change_data", val );
2912
if ( data === undefined || val === data ) {
2916
if ( data != null || val ) {
2918
e.liveFired = undefined;
2919
jQuery.event.trigger( e, arguments[1], elem );
2923
jQuery.event.special.change = {
2925
focusout: testChange,
2927
beforedeactivate: testChange,
2929
click: function( e ) {
2930
var elem = e.target, type = elem.type;
2932
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
2933
testChange.call( this, e );
2937
// Change has to be called before submit
2938
// Keydown will be called before keypress, which is used in submit-event delegation
2939
keydown: function( e ) {
2940
var elem = e.target, type = elem.type;
2942
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
2943
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
2944
type === "select-multiple" ) {
2945
testChange.call( this, e );
2949
// Beforeactivate happens also before the previous element is blurred
2950
// with this event you can't trigger a change event, but you can store
2952
beforeactivate: function( e ) {
2953
var elem = e.target;
2954
jQuery._data( elem, "_change_data", getVal(elem) );
2958
setup: function( data, namespaces ) {
2959
if ( this.type === "file" ) {
2963
for ( var type in changeFilters ) {
2964
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
2967
return rformElems.test( this.nodeName );
2970
teardown: function( namespaces ) {
2971
jQuery.event.remove( this, ".specialChange" );
2973
return rformElems.test( this.nodeName );
2977
changeFilters = jQuery.event.special.change.filters;
2979
// Handle when the input is .focus()'d
2980
changeFilters.focus = changeFilters.beforeactivate;
2983
function trigger( type, elem, args ) {
2984
// Piggyback on a donor event to simulate a different one.
2985
// Fake originalEvent to avoid donor's stopPropagation, but if the
2986
// simulated event prevents default then we do the same on the donor.
2987
// Don't pass args or remember liveFired; they apply to the donor event.
2988
var event = jQuery.extend( {}, args[ 0 ] );
2990
event.originalEvent = {};
2991
event.liveFired = undefined;
2992
jQuery.event.handle.call( elem, event );
2993
if ( event.isDefaultPrevented() ) {
2994
args[ 0 ].preventDefault();
2998
// Create "bubbling" focus and blur events
2999
if ( document.addEventListener ) {
3000
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3002
// Attach a single capturing handler while someone wants focusin/focusout
3005
jQuery.event.special[ fix ] = {
3007
if ( attaches++ === 0 ) {
3008
document.addEventListener( orig, handler, true );
3011
teardown: function() {
3012
if ( --attaches === 0 ) {
3013
document.removeEventListener( orig, handler, true );
3018
function handler( donor ) {
3019
// Donor event is always a native one; fix it and switch its type.
3020
// Let focusin/out handler cancel the donor focus/blur event.
3021
var e = jQuery.event.fix( donor );
3023
e.originalEvent = {};
3024
jQuery.event.trigger( e, null, e.target );
3025
if ( e.isDefaultPrevented() ) {
3026
donor.preventDefault();
3032
jQuery.each(["bind", "one"], function( i, name ) {
3033
jQuery.fn[ name ] = function( type, data, fn ) {
3034
// Handle object literals
3035
if ( typeof type === "object" ) {
3036
for ( var key in type ) {
3037
this[ name ](key, data, type[key], fn);
3042
if ( jQuery.isFunction( data ) || data === false ) {
3047
var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
3048
jQuery( this ).unbind( event, handler );
3049
return fn.apply( this, arguments );
3052
if ( type === "unload" && name !== "one" ) {
3053
this.one( type, data, fn );
3056
for ( var i = 0, l = this.length; i < l; i++ ) {
3057
jQuery.event.add( this[i], type, handler, data );
3066
unbind: function( type, fn ) {
3067
// Handle object literals
3068
if ( typeof type === "object" && !type.preventDefault ) {
3069
for ( var key in type ) {
3070
this.unbind(key, type[key]);
3074
for ( var i = 0, l = this.length; i < l; i++ ) {
3075
jQuery.event.remove( this[i], type, fn );
3082
delegate: function( selector, types, data, fn ) {
3083
return this.live( types, data, fn, selector );
3086
undelegate: function( selector, types, fn ) {
3087
if ( arguments.length === 0 ) {
3088
return this.unbind( "live" );
3091
return this.die( types, null, fn, selector );
3095
trigger: function( type, data ) {
3096
return this.each(function() {
3097
jQuery.event.trigger( type, data, this );
3101
triggerHandler: function( type, data ) {
3103
var event = jQuery.Event( type );
3104
event.preventDefault();
3105
event.stopPropagation();
3106
jQuery.event.trigger( event, data, this[0] );
3107
return event.result;
3111
toggle: function( fn ) {
3112
// Save reference to arguments for access in closure
3113
var args = arguments,
3116
// link all the functions, so any of them can unbind this click handler
3117
while ( i < args.length ) {
3118
jQuery.proxy( fn, args[ i++ ] );
3121
return this.click( jQuery.proxy( fn, function( event ) {
3122
// Figure out which function to execute
3123
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
3124
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
3126
// Make sure that clicks stop
3127
event.preventDefault();
3129
// and execute the function
3130
return args[ lastToggle ].apply( this, arguments ) || false;
3134
hover: function( fnOver, fnOut ) {
3135
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
3142
mouseenter: "mouseover",
3143
mouseleave: "mouseout"
3146
jQuery.each(["live", "die"], function( i, name ) {
3147
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
3148
var type, i = 0, match, namespaces, preType,
3149
selector = origSelector || this.selector,
3150
context = origSelector ? this : jQuery( this.context );
3152
if ( typeof types === "object" && !types.preventDefault ) {
3153
for ( var key in types ) {
3154
context[ name ]( key, data, types[key], selector );
3160
if ( jQuery.isFunction( data ) ) {
3165
types = (types || "").split(" ");
3167
while ( (type = types[ i++ ]) != null ) {
3168
match = rnamespaces.exec( type );
3172
namespaces = match[0];
3173
type = type.replace( rnamespaces, "" );
3176
if ( type === "hover" ) {
3177
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
3183
if ( type === "focus" || type === "blur" ) {
3184
types.push( liveMap[ type ] + namespaces );
3185
type = type + namespaces;
3188
type = (liveMap[ type ] || type) + namespaces;
3191
if ( name === "live" ) {
3192
// bind live handler
3193
for ( var j = 0, l = context.length; j < l; j++ ) {
3194
jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
3195
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
3199
// unbind live handler
3200
context.unbind( "live." + liveConvert( type, selector ), fn );
3208
function liveHandler( event ) {
3209
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
3212
events = jQuery._data( this, "events" );
3214
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
3215
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
3219
if ( event.namespace ) {
3220
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
3223
event.liveFired = this;
3225
var live = events.live.slice(0);
3227
for ( j = 0; j < live.length; j++ ) {
3228
handleObj = live[j];
3230
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
3231
selectors.push( handleObj.selector );
3234
live.splice( j--, 1 );
3238
match = jQuery( event.target ).closest( selectors, event.currentTarget );
3240
for ( i = 0, l = match.length; i < l; i++ ) {
3243
for ( j = 0; j < live.length; j++ ) {
3244
handleObj = live[j];
3246
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
3250
// Those two events require additional checking
3251
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
3252
event.type = handleObj.preType;
3253
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
3256
if ( !related || related !== elem ) {
3257
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
3263
for ( i = 0, l = elems.length; i < l; i++ ) {
3266
if ( maxLevel && match.level > maxLevel ) {
3270
event.currentTarget = match.elem;
3271
event.data = match.handleObj.data;
3272
event.handleObj = match.handleObj;
3274
ret = match.handleObj.origHandler.apply( match.elem, arguments );
3276
if ( ret === false || event.isPropagationStopped() ) {
3277
maxLevel = match.level;
3279
if ( ret === false ) {
3282
if ( event.isImmediatePropagationStopped() ) {
3291
function liveConvert( type, selector ) {
3292
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
3295
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
3296
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
3297
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
3299
// Handle event binding
3300
jQuery.fn[ name ] = function( data, fn ) {
3306
return arguments.length > 0 ?
3307
this.bind( name, data, fn ) :
3308
this.trigger( name );
3311
if ( jQuery.attrFn ) {
3312
jQuery.attrFn[ name ] = true;
3318
* Sizzle CSS Selector Engine
3319
* Copyright 2011, The Dojo Foundation
3320
* Released under the MIT, BSD, and GPL Licenses.
3321
* More information: http://sizzlejs.com/
3325
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3327
toString = Object.prototype.toString,
3328
hasDuplicate = false,
3329
baseHasDuplicate = true,
3333
// Here we check if the JavaScript engine is using some sort of
3334
// optimization where it does not always call our comparision
3335
// function. If that is the case, discard the hasDuplicate value.
3336
// Thus far that includes Google Chrome.
3337
[0, 0].sort(function() {
3338
baseHasDuplicate = false;
3342
var Sizzle = function( selector, context, results, seed ) {
3343
results = results || [];
3344
context = context || document;
3346
var origContext = context;
3348
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3352
if ( !selector || typeof selector !== "string" ) {
3356
var m, set, checkSet, extra, ret, cur, pop, i,
3358
contextXML = Sizzle.isXML( context ),
3362
// Reset the position of the chunker regexp (start from head)
3365
m = chunker.exec( soFar );
3379
if ( parts.length > 1 && origPOS.exec( selector ) ) {
3381
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
3382
set = posProcess( parts[0] + parts[1], context );
3385
set = Expr.relative[ parts[0] ] ?
3387
Sizzle( parts.shift(), context );
3389
while ( parts.length ) {
3390
selector = parts.shift();
3392
if ( Expr.relative[ selector ] ) {
3393
selector += parts.shift();
3396
set = posProcess( selector, set );
3401
// Take a shortcut and set the context if the root selector is an ID
3402
// (but not if it'll be faster if the inner selector is an ID)
3403
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
3404
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
3406
ret = Sizzle.find( parts.shift(), context, contextXML );
3407
context = ret.expr ?
3408
Sizzle.filter( ret.expr, ret.set )[0] :
3414
{ expr: parts.pop(), set: makeArray(seed) } :
3415
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
3418
Sizzle.filter( ret.expr, ret.set ) :
3421
if ( parts.length > 0 ) {
3422
checkSet = makeArray( set );
3428
while ( parts.length ) {
3432
if ( !Expr.relative[ cur ] ) {
3438
if ( pop == null ) {
3442
Expr.relative[ cur ]( checkSet, pop, contextXML );
3446
checkSet = parts = [];
3455
Sizzle.error( cur || selector );
3458
if ( toString.call(checkSet) === "[object Array]" ) {
3460
results.push.apply( results, checkSet );
3462
} else if ( context && context.nodeType === 1 ) {
3463
for ( i = 0; checkSet[i] != null; i++ ) {
3464
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
3465
results.push( set[i] );
3470
for ( i = 0; checkSet[i] != null; i++ ) {
3471
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
3472
results.push( set[i] );
3478
makeArray( checkSet, results );
3482
Sizzle( extra, origContext, results, seed );
3483
Sizzle.uniqueSort( results );
3489
Sizzle.uniqueSort = function( results ) {
3491
hasDuplicate = baseHasDuplicate;
3492
results.sort( sortOrder );
3494
if ( hasDuplicate ) {
3495
for ( var i = 1; i < results.length; i++ ) {
3496
if ( results[i] === results[ i - 1 ] ) {
3497
results.splice( i--, 1 );
3506
Sizzle.matches = function( expr, set ) {
3507
return Sizzle( expr, null, null, set );
3510
Sizzle.matchesSelector = function( node, expr ) {
3511
return Sizzle( expr, null, null, [node] ).length > 0;
3514
Sizzle.find = function( expr, context, isXML ) {
3521
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
3523
type = Expr.order[i];
3525
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
3526
var left = match[1];
3527
match.splice( 1, 1 );
3529
if ( left.substr( left.length - 1 ) !== "\\" ) {
3530
match[1] = (match[1] || "").replace( rBackslash, "" );
3531
set = Expr.find[ type ]( match, context, isXML );
3533
if ( set != null ) {
3534
expr = expr.replace( Expr.match[ type ], "" );
3542
set = typeof context.getElementsByTagName !== "undefined" ?
3543
context.getElementsByTagName( "*" ) :
3547
return { set: set, expr: expr };
3550
Sizzle.filter = function( expr, set, inplace, not ) {
3551
var match, anyFound,
3555
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
3557
while ( expr && set.length ) {
3558
for ( var type in Expr.filter ) {
3559
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
3561
filter = Expr.filter[ type ],
3568
if ( left.substr( left.length - 1 ) === "\\" ) {
3572
if ( curLoop === result ) {
3576
if ( Expr.preFilter[ type ] ) {
3577
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
3580
anyFound = found = true;
3582
} else if ( match === true ) {
3588
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
3590
found = filter( item, match, i, curLoop );
3591
var pass = not ^ !!found;
3593
if ( inplace && found != null ) {
3601
} else if ( pass ) {
3602
result.push( item );
3609
if ( found !== undefined ) {
3614
expr = expr.replace( Expr.match[ type ], "" );
3625
// Improper expression
3626
if ( expr === old ) {
3627
if ( anyFound == null ) {
3628
Sizzle.error( expr );
3641
Sizzle.error = function( msg ) {
3642
throw "Syntax error, unrecognized expression: " + msg;
3645
var Expr = Sizzle.selectors = {
3646
order: [ "ID", "NAME", "TAG" ],
3649
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
3650
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
3651
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
3652
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
3653
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
3654
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
3655
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
3656
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
3662
"class": "className",
3667
href: function( elem ) {
3668
return elem.getAttribute( "href" );
3670
type: function( elem ) {
3671
return elem.getAttribute( "type" );
3676
"+": function(checkSet, part){
3677
var isPartStr = typeof part === "string",
3678
isTag = isPartStr && !rNonWord.test( part ),
3679
isPartStrNotTag = isPartStr && !isTag;
3682
part = part.toLowerCase();
3685
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
3686
if ( (elem = checkSet[i]) ) {
3687
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
3689
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
3695
if ( isPartStrNotTag ) {
3696
Sizzle.filter( part, checkSet, true );
3700
">": function( checkSet, part ) {
3702
isPartStr = typeof part === "string",
3704
l = checkSet.length;
3706
if ( isPartStr && !rNonWord.test( part ) ) {
3707
part = part.toLowerCase();
3709
for ( ; i < l; i++ ) {
3713
var parent = elem.parentNode;
3714
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
3719
for ( ; i < l; i++ ) {
3723
checkSet[i] = isPartStr ?
3725
elem.parentNode === part;
3730
Sizzle.filter( part, checkSet, true );
3735
"": function(checkSet, part, isXML){
3740
if ( typeof part === "string" && !rNonWord.test( part ) ) {
3741
part = part.toLowerCase();
3743
checkFn = dirNodeCheck;
3746
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
3749
"~": function( checkSet, part, isXML ) {
3754
if ( typeof part === "string" && !rNonWord.test( part ) ) {
3755
part = part.toLowerCase();
3757
checkFn = dirNodeCheck;
3760
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
3765
ID: function( match, context, isXML ) {
3766
if ( typeof context.getElementById !== "undefined" && !isXML ) {
3767
var m = context.getElementById(match[1]);
3768
// Check parentNode to catch when Blackberry 4.6 returns
3769
// nodes that are no longer in the document #6963
3770
return m && m.parentNode ? [m] : [];
3774
NAME: function( match, context ) {
3775
if ( typeof context.getElementsByName !== "undefined" ) {
3777
results = context.getElementsByName( match[1] );
3779
for ( var i = 0, l = results.length; i < l; i++ ) {
3780
if ( results[i].getAttribute("name") === match[1] ) {
3781
ret.push( results[i] );
3785
return ret.length === 0 ? null : ret;
3789
TAG: function( match, context ) {
3790
if ( typeof context.getElementsByTagName !== "undefined" ) {
3791
return context.getElementsByTagName( match[1] );
3796
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
3797
match = " " + match[1].replace( rBackslash, "" ) + " ";
3803
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
3805
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
3807
result.push( elem );
3810
} else if ( inplace ) {
3819
ID: function( match ) {
3820
return match[1].replace( rBackslash, "" );
3823
TAG: function( match, curLoop ) {
3824
return match[1].replace( rBackslash, "" ).toLowerCase();
3827
CHILD: function( match ) {
3828
if ( match[1] === "nth" ) {
3830
Sizzle.error( match[0] );
3833
match[2] = match[2].replace(/^\+|\s*/g, '');
3835
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
3836
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
3837
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
3838
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
3840
// calculate the numbers (first)n+(last) including if they are negative
3841
match[2] = (test[1] + (test[2] || 1)) - 0;
3842
match[3] = test[3] - 0;
3844
else if ( match[2] ) {
3845
Sizzle.error( match[0] );
3848
// TODO: Move to normal caching system
3854
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
3855
var name = match[1] = match[1].replace( rBackslash, "" );
3857
if ( !isXML && Expr.attrMap[name] ) {
3858
match[1] = Expr.attrMap[name];
3861
// Handle if an un-quoted value was used
3862
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
3864
if ( match[2] === "~=" ) {
3865
match[4] = " " + match[4] + " ";
3871
PSEUDO: function( match, curLoop, inplace, result, not ) {
3872
if ( match[1] === "not" ) {
3873
// If we're dealing with a complex expression, or a simple one
3874
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
3875
match[3] = Sizzle(match[3], null, null, curLoop);
3878
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
3881
result.push.apply( result, ret );
3887
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
3894
POS: function( match ) {
3895
match.unshift( true );
3902
enabled: function( elem ) {
3903
return elem.disabled === false && elem.type !== "hidden";
3906
disabled: function( elem ) {
3907
return elem.disabled === true;
3910
checked: function( elem ) {
3911
return elem.checked === true;
3914
selected: function( elem ) {
3915
// Accessing this property makes selected-by-default
3916
// options in Safari work properly
3917
if ( elem.parentNode ) {
3918
elem.parentNode.selectedIndex;
3921
return elem.selected === true;
3924
parent: function( elem ) {
3925
return !!elem.firstChild;
3928
empty: function( elem ) {
3929
return !elem.firstChild;
3932
has: function( elem, i, match ) {
3933
return !!Sizzle( match[3], elem ).length;
3936
header: function( elem ) {
3937
return (/h\d/i).test( elem.nodeName );
3940
text: function( elem ) {
3941
var attr = elem.getAttribute( "type" ), type = elem.type;
3942
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
3943
// use getAttribute instead to test this case
3944
return "text" === type && ( attr === type || attr === null );
3947
radio: function( elem ) {
3948
return "radio" === elem.type;
3951
checkbox: function( elem ) {
3952
return "checkbox" === elem.type;
3955
file: function( elem ) {
3956
return "file" === elem.type;
3958
password: function( elem ) {
3959
return "password" === elem.type;
3962
submit: function( elem ) {
3963
return "submit" === elem.type;
3966
image: function( elem ) {
3967
return "image" === elem.type;
3970
reset: function( elem ) {
3971
return "reset" === elem.type;
3974
button: function( elem ) {
3975
return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
3978
input: function( elem ) {
3979
return (/input|select|textarea|button/i).test( elem.nodeName );
3983
first: function( elem, i ) {
3987
last: function( elem, i, match, array ) {
3988
return i === array.length - 1;
3991
even: function( elem, i ) {
3995
odd: function( elem, i ) {
3999
lt: function( elem, i, match ) {
4000
return i < match[3] - 0;
4003
gt: function( elem, i, match ) {
4004
return i > match[3] - 0;
4007
nth: function( elem, i, match ) {
4008
return match[3] - 0 === i;
4011
eq: function( elem, i, match ) {
4012
return match[3] - 0 === i;
4016
PSEUDO: function( elem, match, i, array ) {
4017
var name = match[1],
4018
filter = Expr.filters[ name ];
4021
return filter( elem, i, match, array );
4023
} else if ( name === "contains" ) {
4024
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
4026
} else if ( name === "not" ) {
4029
for ( var j = 0, l = not.length; j < l; j++ ) {
4030
if ( not[j] === elem ) {
4038
Sizzle.error( name );
4042
CHILD: function( elem, match ) {
4043
var type = match[1],
4049
while ( (node = node.previousSibling) ) {
4050
if ( node.nodeType === 1 ) {
4055
if ( type === "first" ) {
4062
while ( (node = node.nextSibling) ) {
4063
if ( node.nodeType === 1 ) {
4071
var first = match[2],
4074
if ( first === 1 && last === 0 ) {
4078
var doneName = match[0],
4079
parent = elem.parentNode;
4081
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
4084
for ( node = parent.firstChild; node; node = node.nextSibling ) {
4085
if ( node.nodeType === 1 ) {
4086
node.nodeIndex = ++count;
4090
parent.sizcache = doneName;
4093
var diff = elem.nodeIndex - last;
4095
if ( first === 0 ) {
4099
return ( diff % first === 0 && diff / first >= 0 );
4104
ID: function( elem, match ) {
4105
return elem.nodeType === 1 && elem.getAttribute("id") === match;
4108
TAG: function( elem, match ) {
4109
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
4112
CLASS: function( elem, match ) {
4113
return (" " + (elem.className || elem.getAttribute("class")) + " ")
4114
.indexOf( match ) > -1;
4117
ATTR: function( elem, match ) {
4118
var name = match[1],
4119
result = Expr.attrHandle[ name ] ?
4120
Expr.attrHandle[ name ]( elem ) :
4121
elem[ name ] != null ?
4123
elem.getAttribute( name ),
4124
value = result + "",
4128
return result == null ?
4133
value.indexOf(check) >= 0 :
4135
(" " + value + " ").indexOf(check) >= 0 :
4137
value && result !== false :
4141
value.indexOf(check) === 0 :
4143
value.substr(value.length - check.length) === check :
4145
value === check || value.substr(0, check.length + 1) === check + "-" :
4149
POS: function( elem, match, i, array ) {
4150
var name = match[2],
4151
filter = Expr.setFilters[ name ];
4154
return filter( elem, i, match, array );
4160
var origPOS = Expr.match.POS,
4161
fescape = function(all, num){
4162
return "\\" + (num - 0 + 1);
4165
for ( var type in Expr.match ) {
4166
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
4167
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
4170
var makeArray = function( array, results ) {
4171
array = Array.prototype.slice.call( array, 0 );
4174
results.push.apply( results, array );
4181
// Perform a simple check to determine if the browser is capable of
4182
// converting a NodeList to an array using builtin methods.
4183
// Also verifies that the returned array holds DOM nodes
4184
// (which is not the case in the Blackberry browser)
4186
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
4188
// Provide a fallback method if it does not work
4190
makeArray = function( array, results ) {
4192
ret = results || [];
4194
if ( toString.call(array) === "[object Array]" ) {
4195
Array.prototype.push.apply( ret, array );
4198
if ( typeof array.length === "number" ) {
4199
for ( var l = array.length; i < l; i++ ) {
4200
ret.push( array[i] );
4204
for ( ; array[i]; i++ ) {
4205
ret.push( array[i] );
4214
var sortOrder, siblingCheck;
4216
if ( document.documentElement.compareDocumentPosition ) {
4217
sortOrder = function( a, b ) {
4219
hasDuplicate = true;
4223
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
4224
return a.compareDocumentPosition ? -1 : 1;
4227
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
4231
sortOrder = function( a, b ) {
4239
// The nodes are identical, we can exit early
4241
hasDuplicate = true;
4244
// If the nodes are siblings (or identical) we can do a quick check
4245
} else if ( aup === bup ) {
4246
return siblingCheck( a, b );
4248
// If no parents were found then the nodes are disconnected
4249
} else if ( !aup ) {
4252
} else if ( !bup ) {
4256
// Otherwise they're somewhere else in the tree so we need
4257
// to build up a full list of the parentNodes for comparison
4260
cur = cur.parentNode;
4267
cur = cur.parentNode;
4273
// Start walking down the tree looking for a discrepancy
4274
for ( var i = 0; i < al && i < bl; i++ ) {
4275
if ( ap[i] !== bp[i] ) {
4276
return siblingCheck( ap[i], bp[i] );
4280
// We ended someplace up the tree so do a sibling check
4282
siblingCheck( a, bp[i], -1 ) :
4283
siblingCheck( ap[i], b, 1 );
4286
siblingCheck = function( a, b, ret ) {
4291
var cur = a.nextSibling;
4298
cur = cur.nextSibling;
4305
// Utility function for retreiving the text value of an array of DOM nodes
4306
Sizzle.getText = function( elems ) {
4309
for ( var i = 0; elems[i]; i++ ) {
4312
// Get the text from text nodes and CDATA nodes
4313
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
4314
ret += elem.nodeValue;
4316
// Traverse everything else, except comment nodes
4317
} else if ( elem.nodeType !== 8 ) {
4318
ret += Sizzle.getText( elem.childNodes );
4325
// Check to see if the browser returns elements by name when
4326
// querying by getElementById (and provide a workaround)
4328
// We're going to inject a fake input element with a specified name
4329
var form = document.createElement("div"),
4330
id = "script" + (new Date()).getTime(),
4331
root = document.documentElement;
4333
form.innerHTML = "<a name='" + id + "'/>";
4335
// Inject it into the root element, check its status, and remove it quickly
4336
root.insertBefore( form, root.firstChild );
4338
// The workaround has to do additional checks after a getElementById
4339
// Which slows things down for other browsers (hence the branching)
4340
if ( document.getElementById( id ) ) {
4341
Expr.find.ID = function( match, context, isXML ) {
4342
if ( typeof context.getElementById !== "undefined" && !isXML ) {
4343
var m = context.getElementById(match[1]);
4346
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
4353
Expr.filter.ID = function( elem, match ) {
4354
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
4356
return elem.nodeType === 1 && node && node.nodeValue === match;
4360
root.removeChild( form );
4362
// release memory in IE
4367
// Check to see if the browser returns only elements
4368
// when doing getElementsByTagName("*")
4370
// Create a fake element
4371
var div = document.createElement("div");
4372
div.appendChild( document.createComment("") );
4374
// Make sure no comments are found
4375
if ( div.getElementsByTagName("*").length > 0 ) {
4376
Expr.find.TAG = function( match, context ) {
4377
var results = context.getElementsByTagName( match[1] );
4379
// Filter out possible comments
4380
if ( match[1] === "*" ) {
4383
for ( var i = 0; results[i]; i++ ) {
4384
if ( results[i].nodeType === 1 ) {
4385
tmp.push( results[i] );
4396
// Check to see if an attribute returns normalized href attributes
4397
div.innerHTML = "<a href='#'></a>";
4399
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
4400
div.firstChild.getAttribute("href") !== "#" ) {
4402
Expr.attrHandle.href = function( elem ) {
4403
return elem.getAttribute( "href", 2 );
4407
// release memory in IE
4411
if ( document.querySelectorAll ) {
4413
var oldSizzle = Sizzle,
4414
div = document.createElement("div"),
4417
div.innerHTML = "<p class='TEST'></p>";
4419
// Safari can't handle uppercase or unicode characters when
4421
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
4425
Sizzle = function( query, context, extra, seed ) {
4426
context = context || document;
4428
// Only use querySelectorAll on non-XML documents
4429
// (ID selectors don't work in non-HTML documents)
4430
if ( !seed && !Sizzle.isXML(context) ) {
4431
// See if we find a selector to speed up
4432
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
4434
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
4435
// Speed-up: Sizzle("TAG")
4437
return makeArray( context.getElementsByTagName( query ), extra );
4439
// Speed-up: Sizzle(".CLASS")
4440
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
4441
return makeArray( context.getElementsByClassName( match[2] ), extra );
4445
if ( context.nodeType === 9 ) {
4446
// Speed-up: Sizzle("body")
4447
// The body element only exists once, optimize finding it
4448
if ( query === "body" && context.body ) {
4449
return makeArray( [ context.body ], extra );
4451
// Speed-up: Sizzle("#ID")
4452
} else if ( match && match[3] ) {
4453
var elem = context.getElementById( match[3] );
4455
// Check parentNode to catch when Blackberry 4.6 returns
4456
// nodes that are no longer in the document #6963
4457
if ( elem && elem.parentNode ) {
4458
// Handle the case where IE and Opera return items
4459
// by name instead of ID
4460
if ( elem.id === match[3] ) {
4461
return makeArray( [ elem ], extra );
4465
return makeArray( [], extra );
4470
return makeArray( context.querySelectorAll(query), extra );
4471
} catch(qsaError) {}
4473
// qSA works strangely on Element-rooted queries
4474
// We can work around this by specifying an extra ID on the root
4475
// and working up from there (Thanks to Andrew Dupont for the technique)
4476
// IE 8 doesn't work on object elements
4477
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
4478
var oldContext = context,
4479
old = context.getAttribute( "id" ),
4481
hasParent = context.parentNode,
4482
relativeHierarchySelector = /^\s*[+~]/.test( query );
4485
context.setAttribute( "id", nid );
4487
nid = nid.replace( /'/g, "\\$&" );
4489
if ( relativeHierarchySelector && hasParent ) {
4490
context = context.parentNode;
4494
if ( !relativeHierarchySelector || hasParent ) {
4495
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
4498
} catch(pseudoError) {
4501
oldContext.removeAttribute( "id" );
4507
return oldSizzle(query, context, extra, seed);
4510
for ( var prop in oldSizzle ) {
4511
Sizzle[ prop ] = oldSizzle[ prop ];
4514
// release memory in IE
4520
var html = document.documentElement,
4521
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
4524
// Check to see if it's possible to do matchesSelector
4525
// on a disconnected node (IE 9 fails this)
4526
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
4527
pseudoWorks = false;
4530
// This should fail with an exception
4531
// Gecko does not error, returns false instead
4532
matches.call( document.documentElement, "[test!='']:sizzle" );
4534
} catch( pseudoError ) {
4538
Sizzle.matchesSelector = function( node, expr ) {
4539
// Make sure that attribute selectors are quoted
4540
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
4542
if ( !Sizzle.isXML( node ) ) {
4544
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
4545
var ret = matches.call( node, expr );
4547
// IE 9's matchesSelector returns false on disconnected nodes
4548
if ( ret || !disconnectedMatch ||
4549
// As well, disconnected nodes are said to be in a document
4550
// fragment in IE 9, so check for that
4551
node.document && node.document.nodeType !== 11 ) {
4558
return Sizzle(expr, null, null, [node]).length > 0;
4564
var div = document.createElement("div");
4566
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
4568
// Opera can't find a second classname (in 9.6)
4569
// Also, make sure that getElementsByClassName actually exists
4570
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
4574
// Safari caches class attributes, doesn't catch changes (in 3.2)
4575
div.lastChild.className = "e";
4577
if ( div.getElementsByClassName("e").length === 1 ) {
4581
Expr.order.splice(1, 0, "CLASS");
4582
Expr.find.CLASS = function( match, context, isXML ) {
4583
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
4584
return context.getElementsByClassName(match[1]);
4588
// release memory in IE
4592
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4593
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4594
var elem = checkSet[i];
4602
if ( elem.sizcache === doneName ) {
4603
match = checkSet[elem.sizset];
4607
if ( elem.nodeType === 1 && !isXML ){
4608
elem.sizcache = doneName;
4612
if ( elem.nodeName.toLowerCase() === cur ) {
4620
checkSet[i] = match;
4625
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
4626
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
4627
var elem = checkSet[i];
4635
if ( elem.sizcache === doneName ) {
4636
match = checkSet[elem.sizset];
4640
if ( elem.nodeType === 1 ) {
4642
elem.sizcache = doneName;
4646
if ( typeof cur !== "string" ) {
4647
if ( elem === cur ) {
4652
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
4661
checkSet[i] = match;
4666
if ( document.documentElement.contains ) {
4667
Sizzle.contains = function( a, b ) {
4668
return a !== b && (a.contains ? a.contains(b) : true);
4671
} else if ( document.documentElement.compareDocumentPosition ) {
4672
Sizzle.contains = function( a, b ) {
4673
return !!(a.compareDocumentPosition(b) & 16);
4677
Sizzle.contains = function() {
4682
Sizzle.isXML = function( elem ) {
4683
// documentElement is verified for cases where it doesn't yet exist
4684
// (such as loading iframes in IE - #4833)
4685
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
4687
return documentElement ? documentElement.nodeName !== "HTML" : false;
4690
var posProcess = function( selector, context ) {
4694
root = context.nodeType ? [context] : context;
4696
// Position selectors must be done after the filter
4697
// And so must :not(positional) so we move all PSEUDOs to the end
4698
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
4700
selector = selector.replace( Expr.match.PSEUDO, "" );
4703
selector = Expr.relative[selector] ? selector + "*" : selector;
4705
for ( var i = 0, l = root.length; i < l; i++ ) {
4706
Sizzle( selector, root[i], tmpSet );
4709
return Sizzle.filter( later, tmpSet );
4713
jQuery.find = Sizzle;
4714
jQuery.expr = Sizzle.selectors;
4715
jQuery.expr[":"] = jQuery.expr.filters;
4716
jQuery.unique = Sizzle.uniqueSort;
4717
jQuery.text = Sizzle.getText;
4718
jQuery.isXMLDoc = Sizzle.isXML;
4719
jQuery.contains = Sizzle.contains;
4725
var runtil = /Until$/,
4726
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
4727
// Note: This RegExp should be improved, or likely pulled from Sizzle
4728
rmultiselector = /,/,
4729
isSimple = /^.[^:#\[\.,]*$/,
4730
slice = Array.prototype.slice,
4731
POS = jQuery.expr.match.POS,
4732
// methods guaranteed to produce a unique set when starting from a unique set
4733
guaranteedUnique = {
4741
find: function( selector ) {
4742
var ret = this.pushStack( "", "find", selector ),
4745
for ( var i = 0, l = this.length; i < l; i++ ) {
4746
length = ret.length;
4747
jQuery.find( selector, this[i], ret );
4750
// Make sure that the results are unique
4751
for ( var n = length; n < ret.length; n++ ) {
4752
for ( var r = 0; r < length; r++ ) {
4753
if ( ret[r] === ret[n] ) {
4765
has: function( target ) {
4766
var targets = jQuery( target );
4767
return this.filter(function() {
4768
for ( var i = 0, l = targets.length; i < l; i++ ) {
4769
if ( jQuery.contains( this, targets[i] ) ) {
4776
not: function( selector ) {
4777
return this.pushStack( winnow(this, selector, false), "not", selector);
4780
filter: function( selector ) {
4781
return this.pushStack( winnow(this, selector, true), "filter", selector );
4784
is: function( selector ) {
4785
return !!selector && jQuery.filter( selector, this ).length > 0;
4788
closest: function( selectors, context ) {
4789
var ret = [], i, l, cur = this[0];
4791
if ( jQuery.isArray( selectors ) ) {
4792
var match, selector,
4796
if ( cur && selectors.length ) {
4797
for ( i = 0, l = selectors.length; i < l; i++ ) {
4798
selector = selectors[i];
4800
if ( !matches[selector] ) {
4801
matches[selector] = jQuery.expr.match.POS.test( selector ) ?
4802
jQuery( selector, context || this.context ) :
4807
while ( cur && cur.ownerDocument && cur !== context ) {
4808
for ( selector in matches ) {
4809
match = matches[selector];
4811
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
4812
ret.push({ selector: selector, elem: cur, level: level });
4816
cur = cur.parentNode;
4824
var pos = POS.test( selectors ) ?
4825
jQuery( selectors, context || this.context ) : null;
4827
for ( i = 0, l = this.length; i < l; i++ ) {
4831
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
4836
cur = cur.parentNode;
4837
if ( !cur || !cur.ownerDocument || cur === context ) {
4844
ret = ret.length > 1 ? jQuery.unique(ret) : ret;
4846
return this.pushStack( ret, "closest", selectors );
4849
// Determine the position of an element within
4850
// the matched set of elements
4851
index: function( elem ) {
4852
if ( !elem || typeof elem === "string" ) {
4853
return jQuery.inArray( this[0],
4854
// If it receives a string, the selector is used
4855
// If it receives nothing, the siblings are used
4856
elem ? jQuery( elem ) : this.parent().children() );
4858
// Locate the position of the desired element
4859
return jQuery.inArray(
4860
// If it receives a jQuery object, the first element is used
4861
elem.jquery ? elem[0] : elem, this );
4864
add: function( selector, context ) {
4865
var set = typeof selector === "string" ?
4866
jQuery( selector, context ) :
4867
jQuery.makeArray( selector ),
4868
all = jQuery.merge( this.get(), set );
4870
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
4872
jQuery.unique( all ) );
4875
andSelf: function() {
4876
return this.add( this.prevObject );
4880
// A painfully simple check to see if an element is disconnected
4881
// from a document (should be improved, where feasible).
4882
function isDisconnected( node ) {
4883
return !node || !node.parentNode || node.parentNode.nodeType === 11;
4887
parent: function( elem ) {
4888
var parent = elem.parentNode;
4889
return parent && parent.nodeType !== 11 ? parent : null;
4891
parents: function( elem ) {
4892
return jQuery.dir( elem, "parentNode" );
4894
parentsUntil: function( elem, i, until ) {
4895
return jQuery.dir( elem, "parentNode", until );
4897
next: function( elem ) {
4898
return jQuery.nth( elem, 2, "nextSibling" );
4900
prev: function( elem ) {
4901
return jQuery.nth( elem, 2, "previousSibling" );
4903
nextAll: function( elem ) {
4904
return jQuery.dir( elem, "nextSibling" );
4906
prevAll: function( elem ) {
4907
return jQuery.dir( elem, "previousSibling" );
4909
nextUntil: function( elem, i, until ) {
4910
return jQuery.dir( elem, "nextSibling", until );
4912
prevUntil: function( elem, i, until ) {
4913
return jQuery.dir( elem, "previousSibling", until );
4915
siblings: function( elem ) {
4916
return jQuery.sibling( elem.parentNode.firstChild, elem );
4918
children: function( elem ) {
4919
return jQuery.sibling( elem.firstChild );
4921
contents: function( elem ) {
4922
return jQuery.nodeName( elem, "iframe" ) ?
4923
elem.contentDocument || elem.contentWindow.document :
4924
jQuery.makeArray( elem.childNodes );
4926
}, function( name, fn ) {
4927
jQuery.fn[ name ] = function( until, selector ) {
4928
var ret = jQuery.map( this, fn, until ),
4929
// The variable 'args' was introduced in
4930
// https://github.com/jquery/jquery/commit/52a0238
4931
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
4932
// http://code.google.com/p/v8/issues/detail?id=1050
4933
args = slice.call(arguments);
4935
if ( !runtil.test( name ) ) {
4939
if ( selector && typeof selector === "string" ) {
4940
ret = jQuery.filter( selector, ret );
4943
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
4945
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
4946
ret = ret.reverse();
4949
return this.pushStack( ret, name, args.join(",") );
4954
filter: function( expr, elems, not ) {
4956
expr = ":not(" + expr + ")";
4959
return elems.length === 1 ?
4960
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
4961
jQuery.find.matches(expr, elems);
4964
dir: function( elem, dir, until ) {
4968
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
4969
if ( cur.nodeType === 1 ) {
4970
matched.push( cur );
4977
nth: function( cur, result, dir, elem ) {
4978
result = result || 1;
4981
for ( ; cur; cur = cur[dir] ) {
4982
if ( cur.nodeType === 1 && ++num === result ) {
4990
sibling: function( n, elem ) {
4993
for ( ; n; n = n.nextSibling ) {
4994
if ( n.nodeType === 1 && n !== elem ) {
5003
// Implement the identical functionality for filter and not
5004
function winnow( elements, qualifier, keep ) {
5005
if ( jQuery.isFunction( qualifier ) ) {
5006
return jQuery.grep(elements, function( elem, i ) {
5007
var retVal = !!qualifier.call( elem, i, elem );
5008
return retVal === keep;
5011
} else if ( qualifier.nodeType ) {
5012
return jQuery.grep(elements, function( elem, i ) {
5013
return (elem === qualifier) === keep;
5016
} else if ( typeof qualifier === "string" ) {
5017
var filtered = jQuery.grep(elements, function( elem ) {
5018
return elem.nodeType === 1;
5021
if ( isSimple.test( qualifier ) ) {
5022
return jQuery.filter(qualifier, filtered, !keep);
5024
qualifier = jQuery.filter( qualifier, filtered );
5028
return jQuery.grep(elements, function( elem, i ) {
5029
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
5036
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
5037
rleadingWhitespace = /^\s+/,
5038
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
5039
rtagName = /<([\w:]+)/,
5041
rhtml = /<|&#?\w+;/,
5042
rnocache = /<(?:script|object|embed|option|style)/i,
5043
// checked="checked" or checked
5044
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5046
option: [ 1, "<select multiple='multiple'>", "</select>" ],
5047
legend: [ 1, "<fieldset>", "</fieldset>" ],
5048
thead: [ 1, "<table>", "</table>" ],
5049
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5050
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5051
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5052
area: [ 1, "<map>", "</map>" ],
5053
_default: [ 0, "", "" ]
5056
wrapMap.optgroup = wrapMap.option;
5057
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5058
wrapMap.th = wrapMap.td;
5060
// IE can't serialize <link> and <script> tags normally
5061
if ( !jQuery.support.htmlSerialize ) {
5062
wrapMap._default = [ 1, "div<div>", "</div>" ];
5066
text: function( text ) {
5067
if ( jQuery.isFunction(text) ) {
5068
return this.each(function(i) {
5069
var self = jQuery( this );
5071
self.text( text.call(this, i, self.text()) );
5075
if ( typeof text !== "object" && text !== undefined ) {
5076
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
5079
return jQuery.text( this );
5082
wrapAll: function( html ) {
5083
if ( jQuery.isFunction( html ) ) {
5084
return this.each(function(i) {
5085
jQuery(this).wrapAll( html.call(this, i) );
5090
// The elements to wrap the target around
5091
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
5093
if ( this[0].parentNode ) {
5094
wrap.insertBefore( this[0] );
5097
wrap.map(function() {
5100
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
5101
elem = elem.firstChild;
5111
wrapInner: function( html ) {
5112
if ( jQuery.isFunction( html ) ) {
5113
return this.each(function(i) {
5114
jQuery(this).wrapInner( html.call(this, i) );
5118
return this.each(function() {
5119
var self = jQuery( this ),
5120
contents = self.contents();
5122
if ( contents.length ) {
5123
contents.wrapAll( html );
5126
self.append( html );
5131
wrap: function( html ) {
5132
return this.each(function() {
5133
jQuery( this ).wrapAll( html );
5137
unwrap: function() {
5138
return this.parent().each(function() {
5139
if ( !jQuery.nodeName( this, "body" ) ) {
5140
jQuery( this ).replaceWith( this.childNodes );
5145
append: function() {
5146
return this.domManip(arguments, true, function( elem ) {
5147
if ( this.nodeType === 1 ) {
5148
this.appendChild( elem );
5153
prepend: function() {
5154
return this.domManip(arguments, true, function( elem ) {
5155
if ( this.nodeType === 1 ) {
5156
this.insertBefore( elem, this.firstChild );
5161
before: function() {
5162
if ( this[0] && this[0].parentNode ) {
5163
return this.domManip(arguments, false, function( elem ) {
5164
this.parentNode.insertBefore( elem, this );
5166
} else if ( arguments.length ) {
5167
var set = jQuery(arguments[0]);
5168
set.push.apply( set, this.toArray() );
5169
return this.pushStack( set, "before", arguments );
5174
if ( this[0] && this[0].parentNode ) {
5175
return this.domManip(arguments, false, function( elem ) {
5176
this.parentNode.insertBefore( elem, this.nextSibling );
5178
} else if ( arguments.length ) {
5179
var set = this.pushStack( this, "after", arguments );
5180
set.push.apply( set, jQuery(arguments[0]).toArray() );
5185
// keepData is for internal use only--do not document
5186
remove: function( selector, keepData ) {
5187
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5188
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
5189
if ( !keepData && elem.nodeType === 1 ) {
5190
jQuery.cleanData( elem.getElementsByTagName("*") );
5191
jQuery.cleanData( [ elem ] );
5194
if ( elem.parentNode ) {
5195
elem.parentNode.removeChild( elem );
5204
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5205
// Remove element nodes and prevent memory leaks
5206
if ( elem.nodeType === 1 ) {
5207
jQuery.cleanData( elem.getElementsByTagName("*") );
5210
// Remove any remaining nodes
5211
while ( elem.firstChild ) {
5212
elem.removeChild( elem.firstChild );
5219
clone: function( dataAndEvents, deepDataAndEvents ) {
5220
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5221
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5223
return this.map( function () {
5224
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5228
html: function( value ) {
5229
if ( value === undefined ) {
5230
return this[0] && this[0].nodeType === 1 ?
5231
this[0].innerHTML.replace(rinlinejQuery, "") :
5234
// See if we can take a shortcut and just use innerHTML
5235
} else if ( typeof value === "string" && !rnocache.test( value ) &&
5236
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
5237
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
5239
value = value.replace(rxhtmlTag, "<$1></$2>");
5242
for ( var i = 0, l = this.length; i < l; i++ ) {
5243
// Remove element nodes and prevent memory leaks
5244
if ( this[i].nodeType === 1 ) {
5245
jQuery.cleanData( this[i].getElementsByTagName("*") );
5246
this[i].innerHTML = value;
5250
// If using innerHTML throws an exception, use the fallback method
5252
this.empty().append( value );
5255
} else if ( jQuery.isFunction( value ) ) {
5256
this.each(function(i){
5257
var self = jQuery( this );
5259
self.html( value.call(this, i, self.html()) );
5263
this.empty().append( value );
5269
replaceWith: function( value ) {
5270
if ( this[0] && this[0].parentNode ) {
5271
// Make sure that the elements are removed from the DOM before they are inserted
5272
// this can help fix replacing a parent with child elements
5273
if ( jQuery.isFunction( value ) ) {
5274
return this.each(function(i) {
5275
var self = jQuery(this), old = self.html();
5276
self.replaceWith( value.call( this, i, old ) );
5280
if ( typeof value !== "string" ) {
5281
value = jQuery( value ).detach();
5284
return this.each(function() {
5285
var next = this.nextSibling,
5286
parent = this.parentNode;
5288
jQuery( this ).remove();
5291
jQuery(next).before( value );
5293
jQuery(parent).append( value );
5297
return this.length ?
5298
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
5303
detach: function( selector ) {
5304
return this.remove( selector, true );
5307
domManip: function( args, table, callback ) {
5308
var results, first, fragment, parent,
5312
// We can't cloneNode fragments that contain checked, in WebKit
5313
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
5314
return this.each(function() {
5315
jQuery(this).domManip( args, table, callback, true );
5319
if ( jQuery.isFunction(value) ) {
5320
return this.each(function(i) {
5321
var self = jQuery(this);
5322
args[0] = value.call(this, i, table ? self.html() : undefined);
5323
self.domManip( args, table, callback );
5328
parent = value && value.parentNode;
5330
// If we're in a fragment, just use that instead of building a new one
5331
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
5332
results = { fragment: parent };
5335
results = jQuery.buildFragment( args, this, scripts );
5338
fragment = results.fragment;
5340
if ( fragment.childNodes.length === 1 ) {
5341
first = fragment = fragment.firstChild;
5343
first = fragment.firstChild;
5347
table = table && jQuery.nodeName( first, "tr" );
5349
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
5352
root(this[i], first) :
5354
// Make sure that we do not leak memory by inadvertently discarding
5355
// the original fragment (which might have attached data) instead of
5356
// using it; in addition, use the original fragment object for the last
5357
// item instead of first because it can end up being emptied incorrectly
5358
// in certain situations (Bug #8070).
5359
// Fragments from the fragment cache must always be cloned and never used
5361
results.cacheable || (l > 1 && i < lastIndex) ?
5362
jQuery.clone( fragment, true, true ) :
5368
if ( scripts.length ) {
5369
jQuery.each( scripts, evalScript );
5377
function root( elem, cur ) {
5378
return jQuery.nodeName(elem, "table") ?
5379
(elem.getElementsByTagName("tbody")[0] ||
5380
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
5384
function cloneCopyEvent( src, dest ) {
5386
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5390
var internalKey = jQuery.expando,
5391
oldData = jQuery.data( src ),
5392
curData = jQuery.data( dest, oldData );
5394
// Switch to use the internal data object, if it exists, for the next
5395
// stage of data copying
5396
if ( (oldData = oldData[ internalKey ]) ) {
5397
var events = oldData.events;
5398
curData = curData[ internalKey ] = jQuery.extend({}, oldData);
5401
delete curData.handle;
5402
curData.events = {};
5404
for ( var type in events ) {
5405
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
5406
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
5413
function cloneFixAttributes(src, dest) {
5414
// We do not need to do anything for non-Elements
5415
if ( dest.nodeType !== 1 ) {
5419
var nodeName = dest.nodeName.toLowerCase();
5421
// clearAttributes removes the attributes, which we don't want,
5422
// but also removes the attachEvent events, which we *do* want
5423
dest.clearAttributes();
5425
// mergeAttributes, in contrast, only merges back on the
5426
// original attributes, not the events
5427
dest.mergeAttributes(src);
5429
// IE6-8 fail to clone children inside object elements that use
5430
// the proprietary classid attribute value (rather than the type
5431
// attribute) to identify the type of content to display
5432
if ( nodeName === "object" ) {
5433
dest.outerHTML = src.outerHTML;
5435
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
5436
// IE6-8 fails to persist the checked state of a cloned checkbox
5437
// or radio button. Worse, IE6-7 fail to give the cloned element
5438
// a checked appearance if the defaultChecked value isn't also set
5439
if ( src.checked ) {
5440
dest.defaultChecked = dest.checked = src.checked;
5443
// IE6-7 get confused and end up setting the value of a cloned
5444
// checkbox/radio button to an empty string instead of "on"
5445
if ( dest.value !== src.value ) {
5446
dest.value = src.value;
5449
// IE6-8 fails to return the selected option to the default selected
5450
// state when cloning options
5451
} else if ( nodeName === "option" ) {
5452
dest.selected = src.defaultSelected;
5454
// IE6-8 fails to set the defaultValue to the correct value when
5455
// cloning other types of input fields
5456
} else if ( nodeName === "input" || nodeName === "textarea" ) {
5457
dest.defaultValue = src.defaultValue;
5460
// Event data gets referenced instead of copied if the expando
5462
dest.removeAttribute( jQuery.expando );
5465
jQuery.buildFragment = function( args, nodes, scripts ) {
5466
var fragment, cacheable, cacheresults,
5467
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
5469
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
5470
// Cloning options loses the selected state, so don't cache them
5471
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
5472
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
5473
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
5474
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
5477
cacheresults = jQuery.fragments[ args[0] ];
5478
if ( cacheresults ) {
5479
if ( cacheresults !== 1 ) {
5480
fragment = cacheresults;
5486
fragment = doc.createDocumentFragment();
5487
jQuery.clean( args, doc, fragment, scripts );
5491
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
5494
return { fragment: fragment, cacheable: cacheable };
5497
jQuery.fragments = {};
5501
prependTo: "prepend",
5502
insertBefore: "before",
5503
insertAfter: "after",
5504
replaceAll: "replaceWith"
5505
}, function( name, original ) {
5506
jQuery.fn[ name ] = function( selector ) {
5508
insert = jQuery( selector ),
5509
parent = this.length === 1 && this[0].parentNode;
5511
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
5512
insert[ original ]( this[0] );
5516
for ( var i = 0, l = insert.length; i < l; i++ ) {
5517
var elems = (i > 0 ? this.clone(true) : this).get();
5518
jQuery( insert[i] )[ original ]( elems );
5519
ret = ret.concat( elems );
5522
return this.pushStack( ret, name, insert.selector );
5527
function getAll( elem ) {
5528
if ( "getElementsByTagName" in elem ) {
5529
return elem.getElementsByTagName( "*" );
5531
} else if ( "querySelectorAll" in elem ) {
5532
return elem.querySelectorAll( "*" );
5540
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5541
var clone = elem.cloneNode(true),
5546
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
5547
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5548
// IE copies events bound via attachEvent when using cloneNode.
5549
// Calling detachEvent on the clone will also remove the events
5550
// from the original. In order to get around this, we use some
5551
// proprietary methods to clear the events. Thanks to MooTools
5552
// guys for this hotness.
5554
cloneFixAttributes( elem, clone );
5556
// Using Sizzle here is crazy slow, so we use getElementsByTagName
5558
srcElements = getAll( elem );
5559
destElements = getAll( clone );
5561
// Weird iteration because IE will replace the length property
5562
// with an element if you are cloning the body and one of the
5563
// elements on the page has a name or id of "length"
5564
for ( i = 0; srcElements[i]; ++i ) {
5565
cloneFixAttributes( srcElements[i], destElements[i] );
5569
// Copy the events from the original to the clone
5570
if ( dataAndEvents ) {
5571
cloneCopyEvent( elem, clone );
5573
if ( deepDataAndEvents ) {
5574
srcElements = getAll( elem );
5575
destElements = getAll( clone );
5577
for ( i = 0; srcElements[i]; ++i ) {
5578
cloneCopyEvent( srcElements[i], destElements[i] );
5583
// Return the cloned set
5586
clean: function( elems, context, fragment, scripts ) {
5587
context = context || document;
5589
// !context.createElement fails in IE with an error but returns typeof 'object'
5590
if ( typeof context.createElement === "undefined" ) {
5591
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
5596
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
5597
if ( typeof elem === "number" ) {
5605
// Convert html string into DOM nodes
5606
if ( typeof elem === "string" && !rhtml.test( elem ) ) {
5607
elem = context.createTextNode( elem );
5609
} else if ( typeof elem === "string" ) {
5610
// Fix "XHTML"-style tags in all browsers
5611
elem = elem.replace(rxhtmlTag, "<$1></$2>");
5613
// Trim whitespace, otherwise indexOf won't work as expected
5614
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
5615
wrap = wrapMap[ tag ] || wrapMap._default,
5617
div = context.createElement("div");
5619
// Go to html and back, then peel off extra wrappers
5620
div.innerHTML = wrap[1] + elem + wrap[2];
5622
// Move to the right depth
5624
div = div.lastChild;
5627
// Remove IE's autoinserted <tbody> from table fragments
5628
if ( !jQuery.support.tbody ) {
5630
// String was a <table>, *may* have spurious <tbody>
5631
var hasBody = rtbody.test(elem),
5632
tbody = tag === "table" && !hasBody ?
5633
div.firstChild && div.firstChild.childNodes :
5635
// String was a bare <thead> or <tfoot>
5636
wrap[1] === "<table>" && !hasBody ?
5640
for ( var j = tbody.length - 1; j >= 0 ; --j ) {
5641
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
5642
tbody[ j ].parentNode.removeChild( tbody[ j ] );
5648
// IE completely kills leading whitespace when innerHTML is used
5649
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5650
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
5653
elem = div.childNodes;
5656
if ( elem.nodeType ) {
5659
ret = jQuery.merge( ret, elem );
5664
for ( i = 0; ret[i]; i++ ) {
5665
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
5666
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
5669
if ( ret[i].nodeType === 1 ) {
5670
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
5672
fragment.appendChild( ret[i] );
5680
cleanData: function( elems ) {
5681
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
5682
deleteExpando = jQuery.support.deleteExpando;
5684
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
5685
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
5689
id = elem[ jQuery.expando ];
5692
data = cache[ id ] && cache[ id ][ internalKey ];
5694
if ( data && data.events ) {
5695
for ( var type in data.events ) {
5696
if ( special[ type ] ) {
5697
jQuery.event.remove( elem, type );
5699
// This is a shortcut to avoid jQuery.event.remove's overhead
5701
jQuery.removeEvent( elem, type, data.handle );
5705
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
5706
if ( data.handle ) {
5707
data.handle.elem = null;
5711
if ( deleteExpando ) {
5712
delete elem[ jQuery.expando ];
5714
} else if ( elem.removeAttribute ) {
5715
elem.removeAttribute( jQuery.expando );
5724
function evalScript( i, elem ) {
5732
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
5735
if ( elem.parentNode ) {
5736
elem.parentNode.removeChild( elem );
5743
var ralpha = /alpha\([^)]*\)/i,
5744
ropacity = /opacity=([^)]*)/,
5745
rdashAlpha = /-([a-z])/ig,
5746
// fixed for IE9, see #8346
5747
rupper = /([A-Z]|^ms)/g,
5748
rnumpx = /^-?\d+(?:px)?$/i,
5751
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
5752
cssWidth = [ "Left", "Right" ],
5753
cssHeight = [ "Top", "Bottom" ],
5759
fcamelCase = function( all, letter ) {
5760
return letter.toUpperCase();
5763
jQuery.fn.css = function( name, value ) {
5764
// Setting 'undefined' is a no-op
5765
if ( arguments.length === 2 && value === undefined ) {
5769
return jQuery.access( this, name, value, true, function( elem, name, value ) {
5770
return value !== undefined ?
5771
jQuery.style( elem, name, value ) :
5772
jQuery.css( elem, name );
5777
// Add in style property hooks for overriding the default
5778
// behavior of getting and setting a style property
5781
get: function( elem, computed ) {
5783
// We should always get a number back from opacity
5784
var ret = curCSS( elem, "opacity", "opacity" );
5785
return ret === "" ? "1" : ret;
5788
return elem.style.opacity;
5794
// Exclude the following css properties to add px
5803
// Add in properties whose names you wish to fix before
5804
// setting or getting the value
5806
// normalize float css property
5807
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
5810
// Get and set the style property on a DOM Node
5811
style: function( elem, name, value, extra ) {
5812
// Don't set styles on text and comment nodes
5813
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
5817
// Make sure that we're working with the right name
5818
var ret, origName = jQuery.camelCase( name ),
5819
style = elem.style, hooks = jQuery.cssHooks[ origName ];
5821
name = jQuery.cssProps[ origName ] || origName;
5823
// Check if we're setting a value
5824
if ( value !== undefined ) {
5825
// Make sure that NaN and null values aren't set. See: #7116
5826
if ( typeof value === "number" && isNaN( value ) || value == null ) {
5830
// If a number was passed in, add 'px' to the (except for certain CSS properties)
5831
if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
5835
// If a hook was provided, use that value, otherwise just set the specified value
5836
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
5837
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
5840
style[ name ] = value;
5845
// If a hook was provided get the non-computed value from there
5846
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
5850
// Otherwise just get the value from the style object
5851
return style[ name ];
5855
css: function( elem, name, extra ) {
5856
// Make sure that we're working with the right name
5857
var ret, origName = jQuery.camelCase( name ),
5858
hooks = jQuery.cssHooks[ origName ];
5860
name = jQuery.cssProps[ origName ] || origName;
5862
// If a hook was provided get the computed value from there
5863
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
5866
// Otherwise, if a way to get the computed value exists, use that
5867
} else if ( curCSS ) {
5868
return curCSS( elem, name, origName );
5872
// A method for quickly swapping in/out CSS properties to get correct calculations
5873
swap: function( elem, options, callback ) {
5876
// Remember the old values, and insert the new ones
5877
for ( var name in options ) {
5878
old[ name ] = elem.style[ name ];
5879
elem.style[ name ] = options[ name ];
5882
callback.call( elem );
5884
// Revert the old values
5885
for ( name in options ) {
5886
elem.style[ name ] = old[ name ];
5890
camelCase: function( string ) {
5891
return string.replace( rdashAlpha, fcamelCase );
5895
// DEPRECATED, Use jQuery.css() instead
5896
jQuery.curCSS = jQuery.css;
5898
jQuery.each(["height", "width"], function( i, name ) {
5899
jQuery.cssHooks[ name ] = {
5900
get: function( elem, computed, extra ) {
5904
if ( elem.offsetWidth !== 0 ) {
5905
val = getWH( elem, name, extra );
5908
jQuery.swap( elem, cssShow, function() {
5909
val = getWH( elem, name, extra );
5914
val = curCSS( elem, name, name );
5916
if ( val === "0px" && currentStyle ) {
5917
val = currentStyle( elem, name, name );
5920
if ( val != null ) {
5921
// Should return "auto" instead of 0, use 0 for
5922
// temporary backwards-compat
5923
return val === "" || val === "auto" ? "0px" : val;
5927
if ( val < 0 || val == null ) {
5928
val = elem.style[ name ];
5930
// Should return "auto" instead of 0, use 0 for
5931
// temporary backwards-compat
5932
return val === "" || val === "auto" ? "0px" : val;
5935
return typeof val === "string" ? val : val + "px";
5939
set: function( elem, value ) {
5940
if ( rnumpx.test( value ) ) {
5941
// ignore negative width and height values #1599
5942
value = parseFloat(value);
5945
return value + "px";
5955
if ( !jQuery.support.opacity ) {
5956
jQuery.cssHooks.opacity = {
5957
get: function( elem, computed ) {
5958
// IE uses filters for opacity
5959
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
5960
(parseFloat(RegExp.$1) / 100) + "" :
5961
computed ? "1" : "";
5964
set: function( elem, value ) {
5965
var style = elem.style;
5967
// IE has trouble with opacity if it does not have layout
5968
// Force it by setting the zoom level
5971
// Set the alpha filter to set the opacity
5972
var opacity = jQuery.isNaN(value) ?
5974
"alpha(opacity=" + value * 100 + ")",
5975
filter = style.filter || "";
5977
style.filter = ralpha.test(filter) ?
5978
filter.replace(ralpha, opacity) :
5979
style.filter + ' ' + opacity;
5985
// This hook cannot be added until DOM ready because the support test
5986
// for it is not run until after DOM ready
5987
if ( !jQuery.support.reliableMarginRight ) {
5988
jQuery.cssHooks.marginRight = {
5989
get: function( elem, computed ) {
5990
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
5991
// Work around by temporarily setting element display to inline-block
5993
jQuery.swap( elem, { "display": "inline-block" }, function() {
5995
ret = curCSS( elem, "margin-right", "marginRight" );
5997
ret = elem.style.marginRight;
6006
if ( document.defaultView && document.defaultView.getComputedStyle ) {
6007
getComputedStyle = function( elem, newName, name ) {
6008
var ret, defaultView, computedStyle;
6010
name = name.replace( rupper, "-$1" ).toLowerCase();
6012
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
6016
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
6017
ret = computedStyle.getPropertyValue( name );
6018
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
6019
ret = jQuery.style( elem, name );
6027
if ( document.documentElement.currentStyle ) {
6028
currentStyle = function( elem, name ) {
6030
ret = elem.currentStyle && elem.currentStyle[ name ],
6031
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
6034
// From the awesome hack by Dean Edwards
6035
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6037
// If we're not dealing with a regular pixel number
6038
// but a number that has a weird ending, we need to convert it to pixels
6039
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
6040
// Remember the original values
6043
// Put in the new values to get a computed value out
6045
elem.runtimeStyle.left = elem.currentStyle.left;
6047
style.left = name === "fontSize" ? "1em" : (ret || 0);
6048
ret = style.pixelLeft + "px";
6050
// Revert the changed values
6053
elem.runtimeStyle.left = rsLeft;
6057
return ret === "" ? "auto" : ret;
6061
curCSS = getComputedStyle || currentStyle;
6063
function getWH( elem, name, extra ) {
6064
var which = name === "width" ? cssWidth : cssHeight,
6065
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
6067
if ( extra === "border" ) {
6071
jQuery.each( which, function() {
6073
val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
6076
if ( extra === "margin" ) {
6077
val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
6080
val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
6087
if ( jQuery.expr && jQuery.expr.filters ) {
6088
jQuery.expr.filters.hidden = function( elem ) {
6089
var width = elem.offsetWidth,
6090
height = elem.offsetHeight;
6092
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
6095
jQuery.expr.filters.visible = function( elem ) {
6096
return !jQuery.expr.filters.hidden( elem );
6107
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6108
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6109
// #7653, #8125, #8152: local protocol detection
6110
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
6111
rnoContent = /^(?:GET|HEAD)$/,
6112
rprotocol = /^\/\//,
6114
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
6115
rselectTextarea = /^(?:select|textarea)/i,
6116
rspacesAjax = /\s+/,
6117
rts = /([?&])_=[^&]*/,
6118
rucHeaders = /(^|\-)([a-z])/g,
6119
rucHeadersFunc = function( _, $1, $2 ) {
6120
return $1 + $2.toUpperCase();
6122
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
6124
// Keep a copy of the old load method
6125
_load = jQuery.fn.load,
6128
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
6129
* 2) These are called:
6130
* - BEFORE asking for a transport
6131
* - AFTER param serialization (s.data is a string if s.processData is true)
6132
* 3) key is the dataType
6133
* 4) the catchall symbol "*" can be used
6134
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
6138
/* Transports bindings
6139
* 1) key is the dataType
6140
* 2) the catchall symbol "*" can be used
6141
* 3) selection will start with transport dataType and THEN go to "*" if needed
6145
// Document location
6148
// Document location segments
6151
// #8138, IE may throw an exception when accessing
6152
// a field from document.location if document.domain has been set
6154
ajaxLocation = document.location.href;
6156
// Use the href attribute of an A element
6157
// since IE will modify it given document.location
6158
ajaxLocation = document.createElement( "a" );
6159
ajaxLocation.href = "";
6160
ajaxLocation = ajaxLocation.href;
6163
// Segment location into parts
6164
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
6166
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
6167
function addToPrefiltersOrTransports( structure ) {
6169
// dataTypeExpression is optional and defaults to "*"
6170
return function( dataTypeExpression, func ) {
6172
if ( typeof dataTypeExpression !== "string" ) {
6173
func = dataTypeExpression;
6174
dataTypeExpression = "*";
6177
if ( jQuery.isFunction( func ) ) {
6178
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
6180
length = dataTypes.length,
6185
// For each dataType in the dataTypeExpression
6186
for(; i < length; i++ ) {
6187
dataType = dataTypes[ i ];
6188
// We control if we're asked to add before
6189
// any existing element
6190
placeBefore = /^\+/.test( dataType );
6191
if ( placeBefore ) {
6192
dataType = dataType.substr( 1 ) || "*";
6194
list = structure[ dataType ] = structure[ dataType ] || [];
6195
// then we add to the structure accordingly
6196
list[ placeBefore ? "unshift" : "push" ]( func );
6202
//Base inspection function for prefilters and transports
6203
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
6204
dataType /* internal */, inspected /* internal */ ) {
6206
dataType = dataType || options.dataTypes[ 0 ];
6207
inspected = inspected || {};
6209
inspected[ dataType ] = true;
6211
var list = structure[ dataType ],
6213
length = list ? list.length : 0,
6214
executeOnly = ( structure === prefilters ),
6217
for(; i < length && ( executeOnly || !selection ); i++ ) {
6218
selection = list[ i ]( options, originalOptions, jqXHR );
6219
// If we got redirected to another dataType
6220
// we try there if executing only and not done already
6221
if ( typeof selection === "string" ) {
6222
if ( !executeOnly || inspected[ selection ] ) {
6223
selection = undefined;
6225
options.dataTypes.unshift( selection );
6226
selection = inspectPrefiltersOrTransports(
6227
structure, options, originalOptions, jqXHR, selection, inspected );
6231
// If we're only executing or nothing was selected
6232
// we try the catchall dataType if not done already
6233
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
6234
selection = inspectPrefiltersOrTransports(
6235
structure, options, originalOptions, jqXHR, "*", inspected );
6237
// unnecessary when only executing (prefilters)
6238
// but it'll be ignored by the caller in that case
6243
load: function( url, params, callback ) {
6244
if ( typeof url !== "string" && _load ) {
6245
return _load.apply( this, arguments );
6247
// Don't do a request if no elements are being requested
6248
} else if ( !this.length ) {
6252
var off = url.indexOf( " " );
6254
var selector = url.slice( off, url.length );
6255
url = url.slice( 0, off );
6258
// Default to a GET request
6261
// If the second parameter was provided
6263
// If it's a function
6264
if ( jQuery.isFunction( params ) ) {
6265
// We assume that it's the callback
6269
// Otherwise, build a param string
6270
} else if ( typeof params === "object" ) {
6271
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
6278
// Request the remote document
6284
// Complete callback (responseText is used internally)
6285
complete: function( jqXHR, status, responseText ) {
6286
// Store the response as specified by the jqXHR object
6287
responseText = jqXHR.responseText;
6288
// If successful, inject the HTML into all the matched elements
6289
if ( jqXHR.isResolved() ) {
6290
// #4825: Get the actual response in case
6291
// a dataFilter is present in ajaxSettings
6292
jqXHR.done(function( r ) {
6295
// See if a selector was specified
6296
self.html( selector ?
6297
// Create a dummy div to hold the results
6299
// inject the contents of the document in, removing the scripts
6300
// to avoid any 'Permission Denied' errors in IE
6301
.append(responseText.replace(rscript, ""))
6303
// Locate the specified elements
6306
// If not, just inject the full result
6311
self.each( callback, [ responseText, status, jqXHR ] );
6319
serialize: function() {
6320
return jQuery.param( this.serializeArray() );
6323
serializeArray: function() {
6324
return this.map(function(){
6325
return this.elements ? jQuery.makeArray( this.elements ) : this;
6328
return this.name && !this.disabled &&
6329
( this.checked || rselectTextarea.test( this.nodeName ) ||
6330
rinput.test( this.type ) );
6332
.map(function( i, elem ){
6333
var val = jQuery( this ).val();
6335
return val == null ?
6337
jQuery.isArray( val ) ?
6338
jQuery.map( val, function( val, i ){
6339
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
6341
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
6346
// Attach a bunch of functions for handling common AJAX events
6347
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
6348
jQuery.fn[ o ] = function( f ){
6349
return this.bind( o, f );
6353
jQuery.each( [ "get", "post" ], function( i, method ) {
6354
jQuery[ method ] = function( url, data, callback, type ) {
6355
// shift arguments if data argument was omitted
6356
if ( jQuery.isFunction( data ) ) {
6357
type = type || callback;
6362
return jQuery.ajax({
6374
getScript: function( url, callback ) {
6375
return jQuery.get( url, undefined, callback, "script" );
6378
getJSON: function( url, data, callback ) {
6379
return jQuery.get( url, data, callback, "json" );
6382
// Creates a full fledged settings object into target
6383
// with both ajaxSettings and settings fields.
6384
// If target is omitted, writes into ajaxSettings.
6385
ajaxSetup: function ( target, settings ) {
6387
// Only one parameter, we extend ajaxSettings
6389
target = jQuery.extend( true, jQuery.ajaxSettings, settings );
6391
// target was provided, we extend into it
6392
jQuery.extend( true, target, jQuery.ajaxSettings, settings );
6394
// Flatten fields we don't want deep extended
6395
for( var field in { context: 1, url: 1 } ) {
6396
if ( field in settings ) {
6397
target[ field ] = settings[ field ];
6398
} else if( field in jQuery.ajaxSettings ) {
6399
target[ field ] = jQuery.ajaxSettings[ field ];
6407
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
6410
contentType: "application/x-www-form-urlencoded",
6425
xml: "application/xml, text/xml",
6428
json: "application/json, text/javascript",
6440
text: "responseText"
6443
// List of data converters
6444
// 1) key format is "source_type destination_type" (a single space in-between)
6445
// 2) the catchall symbol "*" can be used for source_type
6448
// Convert anything to text
6449
"* text": window.String,
6451
// Text to html (true = no transformation)
6454
// Evaluate text as a json expression
6455
"text json": jQuery.parseJSON,
6457
// Parse text as xml
6458
"text xml": jQuery.parseXML
6462
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
6463
ajaxTransport: addToPrefiltersOrTransports( transports ),
6466
ajax: function( url, options ) {
6468
// If url is an object, simulate pre-1.5 signature
6469
if ( typeof url === "object" ) {
6474
// Force options to be an object
6475
options = options || {};
6477
var // Create the final options object
6478
s = jQuery.ajaxSetup( {}, options ),
6479
// Callbacks context
6480
callbackContext = s.context || s,
6481
// Context for global events
6482
// It's the callbackContext if one was provided in the options
6483
// and if it's a DOM node or a jQuery collection
6484
globalEventContext = callbackContext !== s &&
6485
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
6486
jQuery( callbackContext ) : jQuery.event,
6488
deferred = jQuery.Deferred(),
6489
completeDeferred = jQuery._Deferred(),
6490
// Status-dependent callbacks
6491
statusCode = s.statusCode || {},
6494
// Headers (they are sent all at once)
6495
requestHeaders = {},
6497
responseHeadersString,
6503
// Cross-domain detection vars
6507
// To know if global events are to be dispatched
6516
// Caches the header
6517
setRequestHeader: function( name, value ) {
6519
requestHeaders[ name.toLowerCase().replace( rucHeaders, rucHeadersFunc ) ] = value;
6525
getAllResponseHeaders: function() {
6526
return state === 2 ? responseHeadersString : null;
6529
// Builds headers hashtable if needed
6530
getResponseHeader: function( key ) {
6532
if ( state === 2 ) {
6533
if ( !responseHeaders ) {
6534
responseHeaders = {};
6535
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
6536
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
6539
match = responseHeaders[ key.toLowerCase() ];
6541
return match === undefined ? null : match;
6544
// Overrides response content-type header
6545
overrideMimeType: function( type ) {
6552
// Cancel the request
6553
abort: function( statusText ) {
6554
statusText = statusText || "abort";
6556
transport.abort( statusText );
6558
done( 0, statusText );
6563
// Callback for when everything is done
6564
// It is defined here because jslint complains if it is declared
6565
// at the end of the function (which would be more logical and readable)
6566
function done( status, statusText, responses, headers ) {
6569
if ( state === 2 ) {
6573
// State is "done" now
6576
// Clear timeout if it exists
6577
if ( timeoutTimer ) {
6578
clearTimeout( timeoutTimer );
6581
// Dereference transport for early garbage collection
6582
// (no matter how long the jqXHR object will be used)
6583
transport = undefined;
6585
// Cache response headers
6586
responseHeadersString = headers || "";
6589
jqXHR.readyState = status ? 4 : 0;
6594
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
6598
// If successful, handle type chaining
6599
if ( status >= 200 && status < 300 || status === 304 ) {
6601
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
6602
if ( s.ifModified ) {
6604
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
6605
jQuery.lastModified[ ifModifiedKey ] = lastModified;
6607
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
6608
jQuery.etag[ ifModifiedKey ] = etag;
6613
if ( status === 304 ) {
6615
statusText = "notmodified";
6622
success = ajaxConvert( s, response );
6623
statusText = "success";
6626
// We have a parsererror
6627
statusText = "parsererror";
6632
// We extract error from statusText
6633
// then normalize statusText and status for non-aborts
6635
if( !statusText || status ) {
6636
statusText = "error";
6643
// Set data for the fake xhr object
6644
jqXHR.status = status;
6645
jqXHR.statusText = statusText;
6649
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
6651
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
6654
// Status-dependent callbacks
6655
jqXHR.statusCode( statusCode );
6656
statusCode = undefined;
6658
if ( fireGlobals ) {
6659
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
6660
[ jqXHR, s, isSuccess ? success : error ] );
6664
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
6666
if ( fireGlobals ) {
6667
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
6668
// Handle the global AJAX counter
6669
if ( !( --jQuery.active ) ) {
6670
jQuery.event.trigger( "ajaxStop" );
6676
deferred.promise( jqXHR );
6677
jqXHR.success = jqXHR.done;
6678
jqXHR.error = jqXHR.fail;
6679
jqXHR.complete = completeDeferred.done;
6681
// Status-dependent callbacks
6682
jqXHR.statusCode = function( map ) {
6687
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
6690
tmp = map[ jqXHR.status ];
6691
jqXHR.then( tmp, tmp );
6697
// Remove hash character (#7531: and string promotion)
6698
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
6699
// We also use the url parameter if available
6700
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
6702
// Extract dataTypes list
6703
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
6705
// Determine if a cross-domain request is in order
6706
if ( s.crossDomain == null ) {
6707
parts = rurl.exec( s.url.toLowerCase() );
6708
s.crossDomain = !!( parts &&
6709
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
6710
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
6711
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
6715
// Convert data if not already a string
6716
if ( s.data && s.processData && typeof s.data !== "string" ) {
6717
s.data = jQuery.param( s.data, s.traditional );
6721
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
6723
// If request was aborted inside a prefiler, stop there
6724
if ( state === 2 ) {
6728
// We can fire global events as of now if asked to
6729
fireGlobals = s.global;
6731
// Uppercase the type
6732
s.type = s.type.toUpperCase();
6734
// Determine if request has content
6735
s.hasContent = !rnoContent.test( s.type );
6737
// Watch for a new set of requests
6738
if ( fireGlobals && jQuery.active++ === 0 ) {
6739
jQuery.event.trigger( "ajaxStart" );
6742
// More options handling for requests with no content
6743
if ( !s.hasContent ) {
6745
// If data is available, append data to url
6747
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
6750
// Get ifModifiedKey before adding the anti-cache parameter
6751
ifModifiedKey = s.url;
6753
// Add anti-cache in url if needed
6754
if ( s.cache === false ) {
6756
var ts = jQuery.now(),
6757
// try replacing _= if it is there
6758
ret = s.url.replace( rts, "$1_=" + ts );
6760
// if nothing was replaced, add timestamp to the end
6761
s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
6765
// Set the correct header, if data is being sent
6766
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
6767
requestHeaders[ "Content-Type" ] = s.contentType;
6770
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
6771
if ( s.ifModified ) {
6772
ifModifiedKey = ifModifiedKey || s.url;
6773
if ( jQuery.lastModified[ ifModifiedKey ] ) {
6774
requestHeaders[ "If-Modified-Since" ] = jQuery.lastModified[ ifModifiedKey ];
6776
if ( jQuery.etag[ ifModifiedKey ] ) {
6777
requestHeaders[ "If-None-Match" ] = jQuery.etag[ ifModifiedKey ];
6781
// Set the Accepts header for the server, depending on the dataType
6782
requestHeaders.Accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
6783
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
6786
// Check for headers option
6787
for ( i in s.headers ) {
6788
jqXHR.setRequestHeader( i, s.headers[ i ] );
6791
// Allow custom headers/mimetypes and early abort
6792
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
6793
// Abort if not done already
6799
// Install callbacks on deferreds
6800
for ( i in { success: 1, error: 1, complete: 1 } ) {
6801
jqXHR[ i ]( s[ i ] );
6805
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
6807
// If no transport, we auto-abort
6809
done( -1, "No Transport" );
6811
jqXHR.readyState = 1;
6812
// Send global event
6813
if ( fireGlobals ) {
6814
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
6817
if ( s.async && s.timeout > 0 ) {
6818
timeoutTimer = setTimeout( function(){
6819
jqXHR.abort( "timeout" );
6825
transport.send( requestHeaders, done );
6827
// Propagate exception as error if not done
6830
// Simply rethrow otherwise
6840
// Serialize an array of form elements or a set of
6841
// key/values into a query string
6842
param: function( a, traditional ) {
6844
add = function( key, value ) {
6845
// If value is a function, invoke it and return its value
6846
value = jQuery.isFunction( value ) ? value() : value;
6847
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
6850
// Set traditional to true for jQuery <= 1.3.2 behavior.
6851
if ( traditional === undefined ) {
6852
traditional = jQuery.ajaxSettings.traditional;
6855
// If an array was passed in, assume that it is an array of form elements.
6856
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
6857
// Serialize the form elements
6858
jQuery.each( a, function() {
6859
add( this.name, this.value );
6863
// If traditional, encode the "old" way (the way 1.3.2 or older
6864
// did it), otherwise encode params recursively.
6865
for ( var prefix in a ) {
6866
buildParams( prefix, a[ prefix ], traditional, add );
6870
// Return the resulting serialization
6871
return s.join( "&" ).replace( r20, "+" );
6875
function buildParams( prefix, obj, traditional, add ) {
6876
if ( jQuery.isArray( obj ) && obj.length ) {
6877
// Serialize array item.
6878
jQuery.each( obj, function( i, v ) {
6879
if ( traditional || rbracket.test( prefix ) ) {
6880
// Treat each array item as a scalar.
6884
// If array item is non-scalar (array or object), encode its
6885
// numeric index to resolve deserialization ambiguity issues.
6886
// Note that rack (as of 1.0.0) can't currently deserialize
6887
// nested arrays properly, and attempting to do so may cause
6888
// a server error. Possible fixes are to modify rack's
6889
// deserialization algorithm or to provide an option or flag
6890
// to force array serialization to be shallow.
6891
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
6895
} else if ( !traditional && obj != null && typeof obj === "object" ) {
6896
// If we see an array here, it is empty and should be treated as an empty
6898
if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {
6901
// Serialize object item.
6903
for ( var name in obj ) {
6904
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
6909
// Serialize scalar item.
6914
// This is still on the jQuery object... for now
6915
// Want to move this to jQuery.ajax some day
6918
// Counter for holding the number of active queries
6921
// Last-Modified header cache for next request
6927
/* Handles responses to an ajax request:
6928
* - sets all responseXXX fields accordingly
6929
* - finds the right dataType (mediates between content-type and expected dataType)
6930
* - returns the corresponding response
6932
function ajaxHandleResponses( s, jqXHR, responses ) {
6934
var contents = s.contents,
6935
dataTypes = s.dataTypes,
6936
responseFields = s.responseFields,
6942
// Fill responseXXX fields
6943
for( type in responseFields ) {
6944
if ( type in responses ) {
6945
jqXHR[ responseFields[type] ] = responses[ type ];
6949
// Remove auto dataType and get content-type in the process
6950
while( dataTypes[ 0 ] === "*" ) {
6952
if ( ct === undefined ) {
6953
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
6957
// Check if we're dealing with a known content-type
6959
for ( type in contents ) {
6960
if ( contents[ type ] && contents[ type ].test( ct ) ) {
6961
dataTypes.unshift( type );
6967
// Check to see if we have a response for the expected dataType
6968
if ( dataTypes[ 0 ] in responses ) {
6969
finalDataType = dataTypes[ 0 ];
6971
// Try convertible dataTypes
6972
for ( type in responses ) {
6973
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
6974
finalDataType = type;
6977
if ( !firstDataType ) {
6978
firstDataType = type;
6981
// Or just use first one
6982
finalDataType = finalDataType || firstDataType;
6985
// If we found a dataType
6986
// We add the dataType to the list if needed
6987
// and return the corresponding response
6988
if ( finalDataType ) {
6989
if ( finalDataType !== dataTypes[ 0 ] ) {
6990
dataTypes.unshift( finalDataType );
6992
return responses[ finalDataType ];
6996
// Chain conversions given the request and the original response
6997
function ajaxConvert( s, response ) {
6999
// Apply the dataFilter if provided
7000
if ( s.dataFilter ) {
7001
response = s.dataFilter( response, s.dataType );
7004
var dataTypes = s.dataTypes,
7008
length = dataTypes.length,
7010
// Current and previous dataTypes
7011
current = dataTypes[ 0 ],
7013
// Conversion expression
7015
// Conversion function
7017
// Conversion functions (transitive conversion)
7021
// For each dataType in the chain
7022
for( i = 1; i < length; i++ ) {
7024
// Create converters map
7025
// with lowercased keys
7027
for( key in s.converters ) {
7028
if( typeof key === "string" ) {
7029
converters[ key.toLowerCase() ] = s.converters[ key ];
7034
// Get the dataTypes
7036
current = dataTypes[ i ];
7038
// If current is auto dataType, update it to prev
7039
if( current === "*" ) {
7041
// If no auto and dataTypes are actually different
7042
} else if ( prev !== "*" && prev !== current ) {
7044
// Get the converter
7045
conversion = prev + " " + current;
7046
conv = converters[ conversion ] || converters[ "* " + current ];
7048
// If there is no direct converter, search transitively
7051
for( conv1 in converters ) {
7052
tmp = conv1.split( " " );
7053
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
7054
conv2 = converters[ tmp[1] + " " + current ];
7056
conv1 = converters[ conv1 ];
7057
if ( conv1 === true ) {
7059
} else if ( conv2 === true ) {
7067
// If we found no converter, dispatch an error
7068
if ( !( conv || conv2 ) ) {
7069
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
7071
// If found converter is not an equivalence
7072
if ( conv !== true ) {
7073
// Convert with 1 or 2 converters accordingly
7074
response = conv ? conv( response ) : conv2( conv1(response) );
7084
var jsc = jQuery.now(),
7085
jsre = /(\=)\?(&|$)|\?\?/i;
7087
// Default jsonp settings
7090
jsonpCallback: function() {
7091
return jQuery.expando + "_" + ( jsc++ );
7095
// Detect, normalize options and install callbacks for jsonp requests
7096
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
7098
var dataIsString = ( typeof s.data === "string" );
7100
if ( s.dataTypes[ 0 ] === "jsonp" ||
7101
originalSettings.jsonpCallback ||
7102
originalSettings.jsonp != null ||
7103
s.jsonp !== false && ( jsre.test( s.url ) ||
7104
dataIsString && jsre.test( s.data ) ) ) {
7106
var responseContainer,
7107
jsonpCallback = s.jsonpCallback =
7108
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
7109
previous = window[ jsonpCallback ],
7112
replace = "$1" + jsonpCallback + "$2",
7113
cleanUp = function() {
7114
// Set callback back to previous value
7115
window[ jsonpCallback ] = previous;
7116
// Call if it was a function and we have a response
7117
if ( responseContainer && jQuery.isFunction( previous ) ) {
7118
window[ jsonpCallback ]( responseContainer[ 0 ] );
7122
if ( s.jsonp !== false ) {
7123
url = url.replace( jsre, replace );
7124
if ( s.url === url ) {
7125
if ( dataIsString ) {
7126
data = data.replace( jsre, replace );
7128
if ( s.data === data ) {
7129
// Add callback manually
7130
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
7139
window[ jsonpCallback ] = function( response ) {
7140
responseContainer = [ response ];
7143
// Install cleanUp function
7144
jqXHR.then( cleanUp, cleanUp );
7146
// Use data converter to retrieve json after script execution
7147
s.converters["script json"] = function() {
7148
if ( !responseContainer ) {
7149
jQuery.error( jsonpCallback + " was not called" );
7151
return responseContainer[ 0 ];
7154
// force json dataType
7155
s.dataTypes[ 0 ] = "json";
7157
// Delegate to script
7165
// Install script dataType
7168
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
7171
script: /javascript|ecmascript/
7174
"text script": function( text ) {
7175
jQuery.globalEval( text );
7181
// Handle cache's special case and global
7182
jQuery.ajaxPrefilter( "script", function( s ) {
7183
if ( s.cache === undefined ) {
7186
if ( s.crossDomain ) {
7192
// Bind script tag hack transport
7193
jQuery.ajaxTransport( "script", function(s) {
7195
// This transport only deals with cross domain requests
7196
if ( s.crossDomain ) {
7199
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
7203
send: function( _, callback ) {
7205
script = document.createElement( "script" );
7207
script.async = "async";
7209
if ( s.scriptCharset ) {
7210
script.charset = s.scriptCharset;
7215
// Attach handlers for all browsers
7216
script.onload = script.onreadystatechange = function( _, isAbort ) {
7218
if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) {
7220
// Handle memory leak in IE
7221
script.onload = script.onreadystatechange = null;
7223
// Remove the script
7224
if ( head && script.parentNode ) {
7225
head.removeChild( script );
7228
// Dereference the script
7231
// Callback if not abort
7233
callback( 200, "success" );
7237
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
7238
// This arises when a base node is used (#2709 and #4378).
7239
head.insertBefore( script, head.firstChild );
7244
script.onload( 0, 1 );
7254
var // #5280: next active xhr id and list of active xhrs' callbacks
7255
xhrId = jQuery.now(),
7258
// XHR used to determine supports properties
7261
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
7262
function xhrOnUnloadAbort() {
7263
jQuery( window ).unload(function() {
7264
// Abort all pending requests
7265
for ( var key in xhrCallbacks ) {
7266
xhrCallbacks[ key ]( 0, 1 );
7271
// Functions to create xhrs
7272
function createStandardXHR() {
7274
return new window.XMLHttpRequest();
7278
function createActiveXHR() {
7280
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
7284
// Create the request object
7285
// (This is still attached to ajaxSettings for backward compatibility)
7286
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
7287
/* Microsoft failed to properly
7288
* implement the XMLHttpRequest in IE7 (can't request local files),
7289
* so we use the ActiveXObject when it is available
7290
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
7291
* we need a fallback.
7294
return !this.isLocal && createStandardXHR() || createActiveXHR();
7296
// For all other browsers, use the standard XMLHttpRequest object
7299
// Test if we can create an xhr object
7300
testXHR = jQuery.ajaxSettings.xhr();
7301
jQuery.support.ajax = !!testXHR;
7303
// Does this browser support crossDomain XHR requests
7304
jQuery.support.cors = testXHR && ( "withCredentials" in testXHR );
7306
// No need for the temporary xhr anymore
7307
testXHR = undefined;
7309
// Create transport if the browser can provide an xhr
7310
if ( jQuery.support.ajax ) {
7312
jQuery.ajaxTransport(function( s ) {
7313
// Cross domain only allowed if supported through XMLHttpRequest
7314
if ( !s.crossDomain || jQuery.support.cors ) {
7319
send: function( headers, complete ) {
7327
// Passing null username, generates a login popup on Opera (#2865)
7329
xhr.open( s.type, s.url, s.async, s.username, s.password );
7331
xhr.open( s.type, s.url, s.async );
7334
// Apply custom fields if provided
7335
if ( s.xhrFields ) {
7336
for ( i in s.xhrFields ) {
7337
xhr[ i ] = s.xhrFields[ i ];
7341
// Override mime type if needed
7342
if ( s.mimeType && xhr.overrideMimeType ) {
7343
xhr.overrideMimeType( s.mimeType );
7346
// X-Requested-With header
7347
// For cross-domain requests, seeing as conditions for a preflight are
7348
// akin to a jigsaw puzzle, we simply never set it to be sure.
7349
// (it can always be set on a per-request basis or even using ajaxSetup)
7350
// For same-domain requests, won't change header if already provided.
7351
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
7352
headers[ "X-Requested-With" ] = "XMLHttpRequest";
7355
// Need an extra try/catch for cross domain requests in Firefox 3
7357
for ( i in headers ) {
7358
xhr.setRequestHeader( i, headers[ i ] );
7362
// Do send the request
7363
// This may raise an exception which is actually
7364
// handled in jQuery.ajax (so no try/catch here)
7365
xhr.send( ( s.hasContent && s.data ) || null );
7368
callback = function( _, isAbort ) {
7376
// Firefox throws exceptions when accessing properties
7377
// of an xhr when a network error occured
7378
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
7381
// Was never called and is aborted or complete
7382
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
7385
callback = undefined;
7387
// Do not keep as active anymore
7389
xhr.onreadystatechange = jQuery.noop;
7390
delete xhrCallbacks[ handle ];
7395
// Abort it manually if needed
7396
if ( xhr.readyState !== 4 ) {
7400
status = xhr.status;
7401
responseHeaders = xhr.getAllResponseHeaders();
7403
xml = xhr.responseXML;
7405
// Construct response list
7406
if ( xml && xml.documentElement /* #4958 */ ) {
7407
responses.xml = xml;
7409
responses.text = xhr.responseText;
7411
// Firefox throws an exception when accessing
7412
// statusText for faulty cross-domain requests
7414
statusText = xhr.statusText;
7416
// We normalize with Webkit giving an empty statusText
7420
// Filter status for non standard behaviors
7422
// If the request is local and we have data: assume a success
7423
// (success with no data won't get notified, that's the best we
7424
// can do given current implementations)
7425
if ( !status && s.isLocal && !s.crossDomain ) {
7426
status = responses.text ? 200 : 404;
7427
// IE - #1450: sometimes returns 1223 when it should be 204
7428
} else if ( status === 1223 ) {
7433
} catch( firefoxAccessException ) {
7435
complete( -1, firefoxAccessException );
7439
// Call complete if needed
7441
complete( status, statusText, responses, responseHeaders );
7445
// if we're in sync mode or it's in cache
7446
// and has been retrieved directly (IE6 & IE7)
7447
// we need to manually fire the callback
7448
if ( !s.async || xhr.readyState === 4 ) {
7451
// Create the active xhrs callbacks list if needed
7452
// and attach the unload handler
7453
if ( !xhrCallbacks ) {
7457
// Add to list of active xhrs callbacks
7459
xhr.onreadystatechange = xhrCallbacks[ handle ] = callback;
7476
var elemdisplay = {},
7477
rfxtypes = /^(?:toggle|show|hide)$/,
7478
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
7481
// height animations
7482
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
7484
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
7485
// opacity animations
7490
show: function( speed, easing, callback ) {
7493
if ( speed || speed === 0 ) {
7494
return this.animate( genFx("show", 3), speed, easing, callback);
7497
for ( var i = 0, j = this.length; i < j; i++ ) {
7499
display = elem.style.display;
7501
// Reset the inline display of this element to learn if it is
7502
// being hidden by cascaded rules or not
7503
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
7504
display = elem.style.display = "";
7507
// Set elements which have been overridden with display: none
7508
// in a stylesheet to whatever the default browser style is
7509
// for such an element
7510
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
7511
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
7515
// Set the display of most of the elements in a second loop
7516
// to avoid the constant reflow
7517
for ( i = 0; i < j; i++ ) {
7519
display = elem.style.display;
7521
if ( display === "" || display === "none" ) {
7522
elem.style.display = jQuery._data(elem, "olddisplay") || "";
7530
hide: function( speed, easing, callback ) {
7531
if ( speed || speed === 0 ) {
7532
return this.animate( genFx("hide", 3), speed, easing, callback);
7535
for ( var i = 0, j = this.length; i < j; i++ ) {
7536
var display = jQuery.css( this[i], "display" );
7538
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
7539
jQuery._data( this[i], "olddisplay", display );
7543
// Set the display of the elements in a second loop
7544
// to avoid the constant reflow
7545
for ( i = 0; i < j; i++ ) {
7546
this[i].style.display = "none";
7553
// Save the old toggle function
7554
_toggle: jQuery.fn.toggle,
7556
toggle: function( fn, fn2, callback ) {
7557
var bool = typeof fn === "boolean";
7559
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
7560
this._toggle.apply( this, arguments );
7562
} else if ( fn == null || bool ) {
7563
this.each(function() {
7564
var state = bool ? fn : jQuery(this).is(":hidden");
7565
jQuery(this)[ state ? "show" : "hide" ]();
7569
this.animate(genFx("toggle", 3), fn, fn2, callback);
7575
fadeTo: function( speed, to, easing, callback ) {
7576
return this.filter(":hidden").css("opacity", 0).show().end()
7577
.animate({opacity: to}, speed, easing, callback);
7580
animate: function( prop, speed, easing, callback ) {
7581
var optall = jQuery.speed(speed, easing, callback);
7583
if ( jQuery.isEmptyObject( prop ) ) {
7584
return this.each( optall.complete );
7587
return this[ optall.queue === false ? "each" : "queue" ](function() {
7588
// XXX 'this' does not always have a nodeName when running the
7591
var opt = jQuery.extend({}, optall), p,
7592
isElement = this.nodeType === 1,
7593
hidden = isElement && jQuery(this).is(":hidden"),
7597
var name = jQuery.camelCase( p );
7600
prop[ name ] = prop[ p ];
7605
if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
7606
return opt.complete.call(this);
7609
if ( isElement && ( p === "height" || p === "width" ) ) {
7610
// Make sure that nothing sneaks out
7611
// Record all 3 overflow attributes because IE does not
7612
// change the overflow attribute when overflowX and
7613
// overflowY are set to the same value
7614
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
7616
// Set display property to inline-block for height/width
7617
// animations on inline elements that are having width/height
7619
if ( jQuery.css( this, "display" ) === "inline" &&
7620
jQuery.css( this, "float" ) === "none" ) {
7621
if ( !jQuery.support.inlineBlockNeedsLayout ) {
7622
this.style.display = "inline-block";
7625
var display = defaultDisplay(this.nodeName);
7627
// inline-level elements accept inline-block;
7628
// block-level elements need to be inline with layout
7629
if ( display === "inline" ) {
7630
this.style.display = "inline-block";
7633
this.style.display = "inline";
7634
this.style.zoom = 1;
7640
if ( jQuery.isArray( prop[p] ) ) {
7641
// Create (if needed) and add to specialEasing
7642
(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
7643
prop[p] = prop[p][0];
7647
if ( opt.overflow != null ) {
7648
this.style.overflow = "hidden";
7651
opt.curAnim = jQuery.extend({}, prop);
7653
jQuery.each( prop, function( name, val ) {
7654
var e = new jQuery.fx( self, opt, name );
7656
if ( rfxtypes.test(val) ) {
7657
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
7660
var parts = rfxnum.exec(val),
7664
var end = parseFloat( parts[2] ),
7665
unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" );
7667
// We need to compute starting value
7668
if ( unit !== "px" ) {
7669
jQuery.style( self, name, (end || 1) + unit);
7670
start = ((end || 1) / e.cur()) * start;
7671
jQuery.style( self, name, start + unit);
7674
// If a +=/-= token was provided, we're doing a relative animation
7676
end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
7679
e.custom( start, end, unit );
7682
e.custom( start, val, "" );
7687
// For JS strict compliance
7692
stop: function( clearQueue, gotoEnd ) {
7693
var timers = jQuery.timers;
7699
this.each(function() {
7700
// go in reverse order so anything added to the queue during the loop is ignored
7701
for ( var i = timers.length - 1; i >= 0; i-- ) {
7702
if ( timers[i].elem === this ) {
7704
// force the next step to be the last
7708
timers.splice(i, 1);
7713
// start the next in the queue if the last step wasn't forced
7723
function genFx( type, num ) {
7726
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
7733
// Generate shortcuts for custom animations
7735
slideDown: genFx("show", 1),
7736
slideUp: genFx("hide", 1),
7737
slideToggle: genFx("toggle", 1),
7738
fadeIn: { opacity: "show" },
7739
fadeOut: { opacity: "hide" },
7740
fadeToggle: { opacity: "toggle" }
7741
}, function( name, props ) {
7742
jQuery.fn[ name ] = function( speed, easing, callback ) {
7743
return this.animate( props, speed, easing, callback );
7748
speed: function( speed, easing, fn ) {
7749
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
7750
complete: fn || !fn && easing ||
7751
jQuery.isFunction( speed ) && speed,
7753
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
7756
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7757
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
7760
opt.old = opt.complete;
7761
opt.complete = function() {
7762
if ( opt.queue !== false ) {
7763
jQuery(this).dequeue();
7765
if ( jQuery.isFunction( opt.old ) ) {
7766
opt.old.call( this );
7774
linear: function( p, n, firstNum, diff ) {
7775
return firstNum + diff * p;
7777
swing: function( p, n, firstNum, diff ) {
7778
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
7784
fx: function( elem, options, prop ) {
7785
this.options = options;
7789
if ( !options.orig ) {
7796
jQuery.fx.prototype = {
7797
// Simple function for setting a style value
7798
update: function() {
7799
if ( this.options.step ) {
7800
this.options.step.call( this.elem, this.now, this );
7803
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
7806
// Get the current size
7808
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
7809
return this.elem[ this.prop ];
7813
r = jQuery.css( this.elem, this.prop );
7814
// Empty strings, null, undefined and "auto" are converted to 0,
7815
// complex values such as "rotate(1rad)" are returned as is,
7816
// simple values such as "10px" are parsed to Float.
7817
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
7820
// Start an animation from one number to another
7821
custom: function( from, to, unit ) {
7825
this.startTime = jQuery.now();
7828
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
7829
this.now = this.start;
7830
this.pos = this.state = 0;
7832
function t( gotoEnd ) {
7833
return self.step(gotoEnd);
7838
if ( t() && jQuery.timers.push(t) && !timerId ) {
7839
timerId = setInterval(fx.tick, fx.interval);
7843
// Simple 'show' function
7845
// Remember where we started, so that we can go back to it later
7846
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
7847
this.options.show = true;
7849
// Begin the animation
7850
// Make sure that we start at a small width/height to avoid any
7852
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
7854
// Start by showing the element
7855
jQuery( this.elem ).show();
7858
// Simple 'hide' function
7860
// Remember where we started, so that we can go back to it later
7861
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
7862
this.options.hide = true;
7864
// Begin the animation
7865
this.custom(this.cur(), 0);
7868
// Each step of an animation
7869
step: function( gotoEnd ) {
7870
var t = jQuery.now(), done = true;
7872
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
7873
this.now = this.end;
7874
this.pos = this.state = 1;
7877
this.options.curAnim[ this.prop ] = true;
7879
for ( var i in this.options.curAnim ) {
7880
if ( this.options.curAnim[i] !== true ) {
7886
// Reset the overflow
7887
if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
7888
var elem = this.elem,
7889
options = this.options;
7891
jQuery.each( [ "", "X", "Y" ], function (index, value) {
7892
elem.style[ "overflow" + value ] = options.overflow[index];
7896
// Hide the element if the "hide" operation was done
7897
if ( this.options.hide ) {
7898
jQuery(this.elem).hide();
7901
// Reset the properties, if the item has been hidden or shown
7902
if ( this.options.hide || this.options.show ) {
7903
for ( var p in this.options.curAnim ) {
7904
jQuery.style( this.elem, p, this.options.orig[p] );
7908
// Execute the complete function
7909
this.options.complete.call( this.elem );
7915
var n = t - this.startTime;
7916
this.state = n / this.options.duration;
7918
// Perform the easing function, defaults to swing
7919
var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
7920
var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
7921
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
7922
this.now = this.start + ((this.end - this.start) * this.pos);
7924
// Perform the next step of the animation
7932
jQuery.extend( jQuery.fx, {
7934
var timers = jQuery.timers;
7936
for ( var i = 0; i < timers.length; i++ ) {
7937
if ( !timers[i]() ) {
7938
timers.splice(i--, 1);
7942
if ( !timers.length ) {
7950
clearInterval( timerId );
7962
opacity: function( fx ) {
7963
jQuery.style( fx.elem, "opacity", fx.now );
7966
_default: function( fx ) {
7967
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
7968
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
7970
fx.elem[ fx.prop ] = fx.now;
7976
if ( jQuery.expr && jQuery.expr.filters ) {
7977
jQuery.expr.filters.animated = function( elem ) {
7978
return jQuery.grep(jQuery.timers, function( fn ) {
7979
return elem === fn.elem;
7984
function defaultDisplay( nodeName ) {
7985
if ( !elemdisplay[ nodeName ] ) {
7986
var elem = jQuery("<" + nodeName + ">").appendTo("body"),
7987
display = elem.css("display");
7991
if ( display === "none" || display === "" ) {
7995
elemdisplay[ nodeName ] = display;
7998
return elemdisplay[ nodeName ];
8004
var rtable = /^t(?:able|d|h)$/i,
8005
rroot = /^(?:body|html)$/i;
8007
if ( "getBoundingClientRect" in document.documentElement ) {
8008
jQuery.fn.offset = function( options ) {
8009
var elem = this[0], box;
8012
return this.each(function( i ) {
8013
jQuery.offset.setOffset( this, options, i );
8017
if ( !elem || !elem.ownerDocument ) {
8021
if ( elem === elem.ownerDocument.body ) {
8022
return jQuery.offset.bodyOffset( elem );
8026
box = elem.getBoundingClientRect();
8029
var doc = elem.ownerDocument,
8030
docElem = doc.documentElement;
8032
// Make sure we're not dealing with a disconnected DOM node
8033
if ( !box || !jQuery.contains( docElem, elem ) ) {
8034
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
8037
var body = doc.body,
8038
win = getWindow(doc),
8039
clientTop = docElem.clientTop || body.clientTop || 0,
8040
clientLeft = docElem.clientLeft || body.clientLeft || 0,
8041
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
8042
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
8043
top = box.top + scrollTop - clientTop,
8044
left = box.left + scrollLeft - clientLeft;
8046
return { top: top, left: left };
8050
jQuery.fn.offset = function( options ) {
8054
return this.each(function( i ) {
8055
jQuery.offset.setOffset( this, options, i );
8059
if ( !elem || !elem.ownerDocument ) {
8063
if ( elem === elem.ownerDocument.body ) {
8064
return jQuery.offset.bodyOffset( elem );
8067
jQuery.offset.initialize();
8070
offsetParent = elem.offsetParent,
8071
prevOffsetParent = elem,
8072
doc = elem.ownerDocument,
8073
docElem = doc.documentElement,
8075
defaultView = doc.defaultView,
8076
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
8077
top = elem.offsetTop,
8078
left = elem.offsetLeft;
8080
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
8081
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
8085
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
8086
top -= elem.scrollTop;
8087
left -= elem.scrollLeft;
8089
if ( elem === offsetParent ) {
8090
top += elem.offsetTop;
8091
left += elem.offsetLeft;
8093
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
8094
top += parseFloat( computedStyle.borderTopWidth ) || 0;
8095
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
8098
prevOffsetParent = offsetParent;
8099
offsetParent = elem.offsetParent;
8102
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
8103
top += parseFloat( computedStyle.borderTopWidth ) || 0;
8104
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
8107
prevComputedStyle = computedStyle;
8110
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
8111
top += body.offsetTop;
8112
left += body.offsetLeft;
8115
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
8116
top += Math.max( docElem.scrollTop, body.scrollTop );
8117
left += Math.max( docElem.scrollLeft, body.scrollLeft );
8120
return { top: top, left: left };
8125
initialize: function() {
8126
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
8127
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
8129
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
8131
container.innerHTML = html;
8132
body.insertBefore( container, body.firstChild );
8133
innerDiv = container.firstChild;
8134
checkDiv = innerDiv.firstChild;
8135
td = innerDiv.nextSibling.firstChild.firstChild;
8137
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
8138
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
8140
checkDiv.style.position = "fixed";
8141
checkDiv.style.top = "20px";
8143
// safari subtracts parent border width here which is 5px
8144
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
8145
checkDiv.style.position = checkDiv.style.top = "";
8147
innerDiv.style.overflow = "hidden";
8148
innerDiv.style.position = "relative";
8150
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
8152
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
8154
body.removeChild( container );
8155
jQuery.offset.initialize = jQuery.noop;
8158
bodyOffset: function( body ) {
8159
var top = body.offsetTop,
8160
left = body.offsetLeft;
8162
jQuery.offset.initialize();
8164
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
8165
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
8166
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
8169
return { top: top, left: left };
8172
setOffset: function( elem, options, i ) {
8173
var position = jQuery.css( elem, "position" );
8175
// set position first, in-case top/left are set even on static elem
8176
if ( position === "static" ) {
8177
elem.style.position = "relative";
8180
var curElem = jQuery( elem ),
8181
curOffset = curElem.offset(),
8182
curCSSTop = jQuery.css( elem, "top" ),
8183
curCSSLeft = jQuery.css( elem, "left" ),
8184
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1,
8185
props = {}, curPosition = {}, curTop, curLeft;
8187
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
8188
if ( calculatePosition ) {
8189
curPosition = curElem.position();
8192
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
8193
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
8195
if ( jQuery.isFunction( options ) ) {
8196
options = options.call( elem, i, curOffset );
8199
if (options.top != null) {
8200
props.top = (options.top - curOffset.top) + curTop;
8202
if (options.left != null) {
8203
props.left = (options.left - curOffset.left) + curLeft;
8206
if ( "using" in options ) {
8207
options.using.call( elem, props );
8209
curElem.css( props );
8216
position: function() {
8223
// Get *real* offsetParent
8224
offsetParent = this.offsetParent(),
8226
// Get correct offsets
8227
offset = this.offset(),
8228
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
8230
// Subtract element margins
8231
// note: when an element has margin: auto the offsetLeft and marginLeft
8232
// are the same in Safari causing offset.left to incorrectly be 0
8233
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
8234
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
8236
// Add offsetParent borders
8237
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
8238
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
8240
// Subtract the two offsets
8242
top: offset.top - parentOffset.top,
8243
left: offset.left - parentOffset.left
8247
offsetParent: function() {
8248
return this.map(function() {
8249
var offsetParent = this.offsetParent || document.body;
8250
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
8251
offsetParent = offsetParent.offsetParent;
8253
return offsetParent;
8259
// Create scrollLeft and scrollTop methods
8260
jQuery.each( ["Left", "Top"], function( i, name ) {
8261
var method = "scroll" + name;
8263
jQuery.fn[ method ] = function(val) {
8264
var elem = this[0], win;
8270
if ( val !== undefined ) {
8271
// Set the scroll offset
8272
return this.each(function() {
8273
win = getWindow( this );
8277
!i ? val : jQuery(win).scrollLeft(),
8278
i ? val : jQuery(win).scrollTop()
8282
this[ method ] = val;
8286
win = getWindow( elem );
8288
// Return the scroll offset
8289
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
8290
jQuery.support.boxModel && win.document.documentElement[ method ] ||
8291
win.document.body[ method ] :
8297
function getWindow( elem ) {
8298
return jQuery.isWindow( elem ) ?
8300
elem.nodeType === 9 ?
8301
elem.defaultView || elem.parentWindow :
8308
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
8309
jQuery.each([ "Height", "Width" ], function( i, name ) {
8311
var type = name.toLowerCase();
8313
// innerHeight and innerWidth
8314
jQuery.fn["inner" + name] = function() {
8316
parseFloat( jQuery.css( this[0], type, "padding" ) ) :
8320
// outerHeight and outerWidth
8321
jQuery.fn["outer" + name] = function( margin ) {
8323
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
8327
jQuery.fn[ type ] = function( size ) {
8328
// Get window width or height
8331
return size == null ? null : this;
8334
if ( jQuery.isFunction( size ) ) {
8335
return this.each(function( i ) {
8336
var self = jQuery( this );
8337
self[ type ]( size.call( this, i, self[ type ]() ) );
8341
if ( jQuery.isWindow( elem ) ) {
8342
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
8343
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
8344
var docElemProp = elem.document.documentElement[ "client" + name ];
8345
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
8346
elem.document.body[ "client" + name ] || docElemProp;
8348
// Get document width or height
8349
} else if ( elem.nodeType === 9 ) {
8350
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
8352
elem.documentElement["client" + name],
8353
elem.body["scroll" + name], elem.documentElement["scroll" + name],
8354
elem.body["offset" + name], elem.documentElement["offset" + name]
8357
// Get or set width or height on the element
8358
} else if ( size === undefined ) {
8359
var orig = jQuery.css( elem, type ),
8360
ret = parseFloat( orig );
8362
return jQuery.isNaN( ret ) ? orig : ret;
8364
// Set the width or height on the element (default to pixels if value is unitless)
8366
return this.css( type, typeof size === "string" ? size : size + "px" );
8373
window.jQuery = window.$ = jQuery;
1
/*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3
a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4
.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
b'\\ No newline at end of file'