2
* jQuery JavaScript Library v1.7.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: Wed Jul 30 14:06:55 UTC 2014
16
(function( window, undefined ) {
18
// Use the correct document accordingly with window argument (sandbox)
19
var document = window.document,
20
navigator = window.navigator,
21
location = window.location;
22
var jQuery = (function() {
24
// Define a local copy of jQuery
25
var jQuery = function( selector, context ) {
26
// The jQuery object is actually just the init constructor 'enhanced'
27
return new jQuery.fn.init( selector, context, rootjQuery );
30
// Map over jQuery in case of overwrite
31
_jQuery = window.jQuery,
33
// Map over the $ in case of overwrite
36
// A central reference to the root jQuery(document)
39
// A simple way to check for HTML strings or ID strings
40
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
41
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
43
// Check if a string has a non-whitespace character in it
46
// Used for trimming whitespace
50
// Match a standalone tag
51
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
54
rvalidchars = /^[\],:{}\s]*$/,
55
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
56
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
57
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
60
rwebkit = /(webkit)[ \/]([\w.]+)/,
61
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
62
rmsie = /(msie) ([\w.]+)/,
63
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
65
// Matches dashed string for camelizing
66
rdashAlpha = /-([a-z]|[0-9])/ig,
69
// Used by jQuery.camelCase as callback to replace()
70
fcamelCase = function( all, letter ) {
71
return ( letter + "" ).toUpperCase();
74
// Keep a UserAgent string for use with jQuery.browser
75
userAgent = navigator.userAgent,
77
// For matching the engine and version of the browser
80
// The deferred used on DOM ready
83
// The ready event handler
86
// Save a reference to some core methods
87
toString = Object.prototype.toString,
88
hasOwn = Object.prototype.hasOwnProperty,
89
push = Array.prototype.push,
90
slice = Array.prototype.slice,
91
trim = String.prototype.trim,
92
indexOf = Array.prototype.indexOf,
94
// [[Class]] -> type pairs
97
jQuery.fn = jQuery.prototype = {
99
init: function( selector, context, rootjQuery ) {
100
var match, elem, ret, doc;
102
// Handle $(""), $(null), or $(undefined)
107
// Handle $(DOMElement)
108
if ( selector.nodeType ) {
109
this.context = this[0] = selector;
114
// The body element only exists once, optimize finding it
115
if ( selector === "body" && !context && document.body ) {
116
this.context = document;
117
this[0] = document.body;
118
this.selector = selector;
123
// Handle HTML strings
124
if ( typeof selector === "string" ) {
125
// Are we dealing with HTML string or an ID?
126
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
127
// Assume that strings that start and end with <> are HTML and skip the regex check
128
match = [ null, selector, null ];
131
match = quickExpr.exec( selector );
134
// Verify a match, and that no context was specified for #id
135
if ( match && (match[1] || !context) ) {
137
// HANDLE: $(html) -> $(array)
139
context = context instanceof jQuery ? context[0] : context;
140
doc = ( context ? context.ownerDocument || context : document );
142
// If a single string is passed in and it's a single tag
143
// just do a createElement and skip the rest
144
ret = rsingleTag.exec( selector );
147
if ( jQuery.isPlainObject( context ) ) {
148
selector = [ document.createElement( ret[1] ) ];
149
jQuery.fn.attr.call( selector, context, true );
152
selector = [ doc.createElement( ret[1] ) ];
156
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
157
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
160
return jQuery.merge( this, selector );
164
elem = document.getElementById( match[2] );
166
// Check parentNode to catch when Blackberry 4.6 returns
167
// nodes that are no longer in the document #6963
168
if ( elem && elem.parentNode ) {
169
// Handle the case where IE and Opera return items
170
// by name instead of ID
171
if ( elem.id !== match[2] ) {
172
return rootjQuery.find( selector );
175
// Otherwise, we inject the element directly into the jQuery object
180
this.context = document;
181
this.selector = selector;
185
// HANDLE: $(expr, $(...))
186
} else if ( !context || context.jquery ) {
187
return ( context || rootjQuery ).find( selector );
189
// HANDLE: $(expr, context)
190
// (which is just equivalent to: $(context).find(expr)
192
return this.constructor( context ).find( selector );
195
// HANDLE: $(function)
196
// Shortcut for document ready
197
} else if ( jQuery.isFunction( selector ) ) {
198
return rootjQuery.ready( selector );
201
if ( selector.selector !== undefined ) {
202
this.selector = selector.selector;
203
this.context = selector.context;
206
return jQuery.makeArray( selector, this );
209
// Start with an empty selector
212
// The current version of jQuery being used
215
// The default length of a jQuery object is 0
218
// The number of elements contained in the matched element set
223
toArray: function() {
224
return slice.call( this, 0 );
227
// Get the Nth element in the matched element set OR
228
// Get the whole matched element set as a clean array
229
get: function( num ) {
232
// Return a 'clean' array
235
// Return just the object
236
( num < 0 ? this[ this.length + num ] : this[ num ] );
239
// Take an array of elements and push it onto the stack
240
// (returning the new matched element set)
241
pushStack: function( elems, name, selector ) {
242
// Build a new jQuery matched element set
243
var ret = this.constructor();
245
if ( jQuery.isArray( elems ) ) {
246
push.apply( ret, elems );
249
jQuery.merge( ret, elems );
252
// Add the old object onto the stack (as a reference)
253
ret.prevObject = this;
255
ret.context = this.context;
257
if ( name === "find" ) {
258
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
260
ret.selector = this.selector + "." + name + "(" + selector + ")";
263
// Return the newly-formed element set
267
// Execute a callback for every element in the matched set.
268
// (You can seed the arguments with an array of args, but this is
269
// only used internally.)
270
each: function( callback, args ) {
271
return jQuery.each( this, callback, args );
274
ready: function( fn ) {
275
// Attach the listeners
288
this.slice( i, i + 1 );
296
return this.eq( -1 );
300
return this.pushStack( slice.apply( this, arguments ),
301
"slice", slice.call(arguments).join(",") );
304
map: function( callback ) {
305
return this.pushStack( jQuery.map(this, function( elem, i ) {
306
return callback.call( elem, i, elem );
311
return this.prevObject || this.constructor(null);
314
// For internal use only.
315
// Behaves like an Array's method, not like a jQuery method.
321
// Give the init function the jQuery prototype for later instantiation
322
jQuery.fn.init.prototype = jQuery.fn;
324
jQuery.extend = jQuery.fn.extend = function() {
325
var options, name, src, copy, copyIsArray, clone,
326
target = arguments[0] || {},
328
length = arguments.length,
331
// Handle a deep copy situation
332
if ( typeof target === "boolean" ) {
334
target = arguments[1] || {};
335
// skip the boolean and the target
339
// Handle case when target is a string or something (possible in deep copy)
340
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
344
// extend jQuery itself if only one argument is passed
345
if ( length === i ) {
350
for ( ; i < length; i++ ) {
351
// Only deal with non-null/undefined values
352
if ( (options = arguments[ i ]) != null ) {
353
// Extend the base object
354
for ( name in options ) {
355
src = target[ name ];
356
copy = options[ name ];
358
// Prevent never-ending loop
359
if ( target === copy ) {
363
// Recurse if we're merging plain objects or arrays
364
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
367
clone = src && jQuery.isArray(src) ? src : [];
370
clone = src && jQuery.isPlainObject(src) ? src : {};
373
// Never move original objects, clone them
374
target[ name ] = jQuery.extend( deep, clone, copy );
376
// Don't bring in undefined values
377
} else if ( copy !== undefined ) {
378
target[ name ] = copy;
384
// Return the modified object
389
noConflict: function( deep ) {
390
if ( window.$ === jQuery ) {
394
if ( deep && window.jQuery === jQuery ) {
395
window.jQuery = _jQuery;
401
// Is the DOM ready to be used? Set to true once it occurs.
404
// A counter to track how many items to wait for before
405
// the ready event fires. See #6781
408
// Hold (or release) the ready event
409
holdReady: function( hold ) {
413
jQuery.ready( true );
417
// Handle when the DOM is ready
418
ready: function( wait ) {
419
// Either a released hold or an DOMready/load event and not yet ready
420
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
421
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
422
if ( !document.body ) {
423
return setTimeout( jQuery.ready, 1 );
426
// Remember that the DOM is ready
427
jQuery.isReady = true;
429
// If a normal DOM Ready event fired, decrement, and wait if need be
430
if ( wait !== true && --jQuery.readyWait > 0 ) {
434
// If there are functions bound, to execute
435
readyList.fireWith( document, [ jQuery ] );
437
// Trigger any bound ready events
438
if ( jQuery.fn.trigger ) {
439
jQuery( document ).trigger( "ready" ).off( "ready" );
444
bindReady: function() {
449
readyList = jQuery.Callbacks( "once memory" );
451
// Catch cases where $(document).ready() is called after the
452
// browser event has already occurred.
453
if ( document.readyState === "complete" ) {
454
// Handle it asynchronously to allow scripts the opportunity to delay ready
455
return setTimeout( jQuery.ready, 1 );
458
// Mozilla, Opera and webkit nightlies currently support this event
459
if ( document.addEventListener ) {
460
// Use the handy event callback
461
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
463
// A fallback to window.onload, that will always work
464
window.addEventListener( "load", jQuery.ready, false );
466
// If IE event model is used
467
} else if ( document.attachEvent ) {
468
// ensure firing before onload,
469
// maybe late but safe also for iframes
470
document.attachEvent( "onreadystatechange", DOMContentLoaded );
472
// A fallback to window.onload, that will always work
473
window.attachEvent( "onload", jQuery.ready );
475
// If IE and not a frame
476
// continually check to see if the document is ready
477
var toplevel = false;
480
toplevel = window.frameElement == null;
483
if ( document.documentElement.doScroll && toplevel ) {
489
// See test/unit/core.js for details concerning isFunction.
490
// Since version 1.3, DOM methods and functions like alert
491
// aren't supported. They return false on IE (#2968).
492
isFunction: function( obj ) {
493
return jQuery.type(obj) === "function";
496
isArray: Array.isArray || function( obj ) {
497
return jQuery.type(obj) === "array";
500
isWindow: function( obj ) {
501
return obj != null && obj == obj.window;
504
isNumeric: function( obj ) {
505
return !isNaN( parseFloat(obj) ) && isFinite( obj );
508
type: function( obj ) {
511
class2type[ toString.call(obj) ] || "object";
514
isPlainObject: function( obj ) {
515
// Must be an Object.
516
// Because of IE, we also have to check the presence of the constructor property.
517
// Make sure that DOM nodes and window objects don't pass through, as well
518
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
523
// Not own constructor property must be Object
524
if ( obj.constructor &&
525
!hasOwn.call(obj, "constructor") &&
526
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
530
// IE8,9 Will throw exceptions on certain host objects #9897
534
// Own properties are enumerated firstly, so to speed up,
535
// if last one is own, then all properties are own.
538
for ( key in obj ) {}
540
return key === undefined || hasOwn.call( obj, key );
543
isEmptyObject: function( obj ) {
544
for ( var name in obj ) {
550
error: function( msg ) {
551
throw new Error( msg );
554
parseJSON: function( data ) {
555
if ( typeof data !== "string" || !data ) {
559
// Make sure leading/trailing whitespace is removed (IE can't handle it)
560
data = jQuery.trim( data );
562
// Attempt to parse using the native JSON parser first
563
if ( window.JSON && window.JSON.parse ) {
564
return window.JSON.parse( data );
567
// Make sure the incoming data is actual JSON
568
// Logic borrowed from http://json.org/json2.js
569
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
570
.replace( rvalidtokens, "]" )
571
.replace( rvalidbraces, "")) ) {
573
return ( new Function( "return " + data ) )();
576
jQuery.error( "Invalid JSON: " + data );
579
// Cross-browser xml parsing
580
parseXML: function( data ) {
581
if ( typeof data !== "string" || !data ) {
586
if ( window.DOMParser ) { // Standard
587
tmp = new DOMParser();
588
xml = tmp.parseFromString( data , "text/xml" );
590
xml = new ActiveXObject( "Microsoft.XMLDOM" );
597
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
598
jQuery.error( "Invalid XML: " + data );
605
// Evaluates a script in a global context
606
// Workarounds based on findings by Jim Driscoll
607
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
608
globalEval: function( data ) {
609
if ( data && rnotwhite.test( data ) ) {
610
// We use execScript on Internet Explorer
611
// We use an anonymous function so that context is window
612
// rather than jQuery in Firefox
613
( window.execScript || function( data ) {
614
window[ "eval" ].call( window, data );
619
// Convert dashed to camelCase; used by the css and data modules
620
// Microsoft forgot to hump their vendor prefix (#9572)
621
camelCase: function( string ) {
622
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
625
nodeName: function( elem, name ) {
626
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
629
// args is for internal usage only
630
each: function( object, callback, args ) {
632
length = object.length,
633
isObj = length === undefined || jQuery.isFunction( object );
637
for ( name in object ) {
638
if ( callback.apply( object[ name ], args ) === false ) {
643
for ( ; i < length; ) {
644
if ( callback.apply( object[ i++ ], args ) === false ) {
650
// A special, fast, case for the most common use of each
653
for ( name in object ) {
654
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
659
for ( ; i < length; ) {
660
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
670
// Use native String.trim function wherever possible
673
return text == null ?
678
// Otherwise use our own trimming functionality
680
return text == null ?
682
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
685
// results is for internal usage only
686
makeArray: function( array, results ) {
687
var ret = results || [];
689
if ( array != null ) {
690
// The window, strings (and functions) also have 'length'
691
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
692
var type = jQuery.type( array );
694
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
695
push.call( ret, array );
697
jQuery.merge( ret, array );
704
inArray: function( elem, array, i ) {
709
return indexOf.call( array, elem, i );
713
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
715
for ( ; i < len; i++ ) {
716
// Skip accessing in sparse arrays
717
if ( i in array && array[ i ] === elem ) {
726
merge: function( first, second ) {
727
var i = first.length,
730
if ( typeof second.length === "number" ) {
731
for ( var l = second.length; j < l; j++ ) {
732
first[ i++ ] = second[ j ];
736
while ( second[j] !== undefined ) {
737
first[ i++ ] = second[ j++ ];
746
grep: function( elems, callback, inv ) {
747
var ret = [], retVal;
750
// Go through the array, only saving the items
751
// that pass the validator function
752
for ( var i = 0, length = elems.length; i < length; i++ ) {
753
retVal = !!callback( elems[ i ], i );
754
if ( inv !== retVal ) {
755
ret.push( elems[ i ] );
762
// arg is for internal usage only
763
map: function( elems, callback, arg ) {
764
var value, key, ret = [],
766
length = elems.length,
767
// jquery objects are treated as arrays
768
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
770
// Go through the array, translating each of the items to their
772
for ( ; i < length; i++ ) {
773
value = callback( elems[ i ], i, arg );
775
if ( value != null ) {
776
ret[ ret.length ] = value;
780
// Go through every key on the object,
782
for ( key in elems ) {
783
value = callback( elems[ key ], key, arg );
785
if ( value != null ) {
786
ret[ ret.length ] = value;
791
// Flatten any nested arrays
792
return ret.concat.apply( [], ret );
795
// A global GUID counter for objects
798
// Bind a function to a context, optionally partially applying any
800
proxy: function( fn, context ) {
801
if ( typeof context === "string" ) {
802
var tmp = fn[ context ];
807
// Quick check to determine if target is callable, in the spec
808
// this throws a TypeError, but we will just return undefined.
809
if ( !jQuery.isFunction( fn ) ) {
814
var args = slice.call( arguments, 2 ),
816
return fn.apply( context, args.concat( slice.call( arguments ) ) );
819
// Set the guid of unique handler to the same of original handler, so it can be removed
820
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
825
// Mutifunctional method to get and set values to a collection
826
// The value/s can optionally be executed if it's a function
827
access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
831
length = elems.length;
834
if ( key && typeof key === "object" ) {
836
jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
841
} else if ( value !== undefined ) {
842
// Optionally, function values get executed if exec is true
843
exec = pass === undefined && jQuery.isFunction( value );
846
// Bulk operations only iterate when executing function values
849
fn = function( elem, key, value ) {
850
return exec.call( jQuery( elem ), value );
853
// Otherwise they run against the entire set
855
fn.call( elems, value );
861
for (; i < length; i++ ) {
862
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
875
length ? fn( elems[0], key ) : emptyGet;
879
return ( new Date() ).getTime();
882
// Use of jQuery.browser is frowned upon.
883
// More details: http://docs.jquery.com/Utilities/jQuery.browser
884
uaMatch: function( ua ) {
885
ua = ua.toLowerCase();
887
var match = rwebkit.exec( ua ) ||
890
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
893
return { browser: match[1] || "", version: match[2] || "0" };
897
function jQuerySub( selector, context ) {
898
return new jQuerySub.fn.init( selector, context );
900
jQuery.extend( true, jQuerySub, this );
901
jQuerySub.superclass = this;
902
jQuerySub.fn = jQuerySub.prototype = this();
903
jQuerySub.fn.constructor = jQuerySub;
904
jQuerySub.sub = this.sub;
905
jQuerySub.fn.init = function init( selector, context ) {
906
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
907
context = jQuerySub( context );
910
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
912
jQuerySub.fn.init.prototype = jQuerySub.fn;
913
var rootjQuerySub = jQuerySub(document);
920
// Populate the class2type map
921
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
922
class2type[ "[object " + name + "]" ] = name.toLowerCase();
925
browserMatch = jQuery.uaMatch( userAgent );
926
if ( browserMatch.browser ) {
927
jQuery.browser[ browserMatch.browser ] = true;
928
jQuery.browser.version = browserMatch.version;
931
// Deprecated, use jQuery.browser.webkit instead
932
if ( jQuery.browser.webkit ) {
933
jQuery.browser.safari = true;
936
// IE doesn't match non-breaking spaces with \s
937
if ( rnotwhite.test( "\xA0" ) ) {
938
trimLeft = /^[\s\xA0]+/;
939
trimRight = /[\s\xA0]+$/;
942
// All jQuery objects should point back to these
943
rootjQuery = jQuery(document);
945
// Cleanup functions for the document ready method
946
if ( document.addEventListener ) {
947
DOMContentLoaded = function() {
948
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
952
} else if ( document.attachEvent ) {
953
DOMContentLoaded = function() {
954
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
955
if ( document.readyState === "complete" ) {
956
document.detachEvent( "onreadystatechange", DOMContentLoaded );
962
// The DOM ready check for Internet Explorer
963
function doScrollCheck() {
964
if ( jQuery.isReady ) {
969
// If IE is used, use the trick by Diego Perini
970
// http://javascript.nwbox.com/IEContentLoaded/
971
document.documentElement.doScroll("left");
973
setTimeout( doScrollCheck, 1 );
977
// and execute any waiting functions
986
// String to Object flags format cache
989
// Convert String-formatted flags into Object-formatted ones and store in cache
990
function createFlags( flags ) {
991
var object = flagsCache[ flags ] = {},
993
flags = flags.split( /\s+/ );
994
for ( i = 0, length = flags.length; i < length; i++ ) {
995
object[ flags[i] ] = true;
1001
* Create a callback list using the following parameters:
1003
* flags: an optional list of space-separated flags that will change how
1004
* the callback list behaves
1006
* By default a callback list will act like an event callback list and can be
1007
* "fired" multiple times.
1011
* once: will ensure the callback list can only be fired once (like a Deferred)
1013
* memory: will keep track of previous values and will call any callback added
1014
* after the list has been fired right away with the latest "memorized"
1015
* values (like a Deferred)
1017
* unique: will ensure a callback can only be added once (no duplicate in the list)
1019
* stopOnFalse: interrupt callings when a callback returns false
1022
jQuery.Callbacks = function( flags ) {
1024
// Convert flags from String-formatted to Object-formatted
1025
// (we check in cache first)
1026
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
1028
var // Actual callback list
1030
// Stack of fire calls for repeatable lists
1032
// Last fire value (for non-forgettable lists)
1034
// Flag to know if list was already fired
1036
// Flag to know if list is currently firing
1038
// First callback to fire (used internally by add and fireWith)
1040
// End of the loop when firing
1042
// Index of currently firing callback (modified by remove if needed)
1044
// Add one or several callbacks to the list
1045
add = function( args ) {
1051
for ( i = 0, length = args.length; i < length; i++ ) {
1053
type = jQuery.type( elem );
1054
if ( type === "array" ) {
1055
// Inspect recursively
1057
} else if ( type === "function" ) {
1058
// Add if not in unique mode and callback is not in
1059
if ( !flags.unique || !self.has( elem ) ) {
1066
fire = function( context, args ) {
1068
memory = !flags.memory || [ context, args ];
1071
firingIndex = firingStart || 0;
1073
firingLength = list.length;
1074
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1075
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
1076
memory = true; // Mark as halted
1082
if ( !flags.once ) {
1083
if ( stack && stack.length ) {
1084
memory = stack.shift();
1085
self.fireWith( memory[ 0 ], memory[ 1 ] );
1087
} else if ( memory === true ) {
1094
// Actual Callbacks object
1096
// Add a callback or a collection of callbacks to the list
1099
var length = list.length;
1101
// Do we need to add the callbacks to the
1102
// current firing batch?
1104
firingLength = list.length;
1105
// With memory, if we're not firing then
1106
// we should call right away, unless previous
1107
// firing was halted (stopOnFalse)
1108
} else if ( memory && memory !== true ) {
1109
firingStart = length;
1110
fire( memory[ 0 ], memory[ 1 ] );
1115
// Remove a callback from the list
1116
remove: function() {
1118
var args = arguments,
1120
argLength = args.length;
1121
for ( ; argIndex < argLength ; argIndex++ ) {
1122
for ( var i = 0; i < list.length; i++ ) {
1123
if ( args[ argIndex ] === list[ i ] ) {
1124
// Handle firingIndex and firingLength
1126
if ( i <= firingLength ) {
1128
if ( i <= firingIndex ) {
1133
// Remove the element
1134
list.splice( i--, 1 );
1135
// If we have some unicity property then
1136
// we only need to do this once
1137
if ( flags.unique ) {
1146
// Control if a given callback is in the list
1147
has: function( fn ) {
1150
length = list.length;
1151
for ( ; i < length; i++ ) {
1152
if ( fn === list[ i ] ) {
1159
// Remove all callbacks from the list
1164
// Have the list do nothing anymore
1165
disable: function() {
1166
list = stack = memory = undefined;
1170
disabled: function() {
1173
// Lock the list in its current state
1176
if ( !memory || memory === true ) {
1182
locked: function() {
1185
// Call all callbacks with the given context and arguments
1186
fireWith: function( context, args ) {
1189
if ( !flags.once ) {
1190
stack.push( [ context, args ] );
1192
} else if ( !( flags.once && memory ) ) {
1193
fire( context, args );
1198
// Call all the callbacks with the given arguments
1200
self.fireWith( this, arguments );
1203
// To know if the callbacks have already been called at least once
1215
var // Static reference to slice
1216
sliceDeferred = [].slice;
1220
Deferred: function( func ) {
1221
var doneList = jQuery.Callbacks( "once memory" ),
1222
failList = jQuery.Callbacks( "once memory" ),
1223
progressList = jQuery.Callbacks( "memory" ),
1228
notify: progressList
1233
progress: progressList.add,
1240
isResolved: doneList.fired,
1241
isRejected: failList.fired,
1243
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
1244
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
1247
always: function() {
1248
deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
1251
pipe: function( fnDone, fnFail, fnProgress ) {
1252
return jQuery.Deferred(function( newDefer ) {
1254
done: [ fnDone, "resolve" ],
1255
fail: [ fnFail, "reject" ],
1256
progress: [ fnProgress, "notify" ]
1257
}, function( handler, data ) {
1261
if ( jQuery.isFunction( fn ) ) {
1262
deferred[ handler ](function() {
1263
returned = fn.apply( this, arguments );
1264
if ( returned && jQuery.isFunction( returned.promise ) ) {
1265
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
1267
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
1271
deferred[ handler ]( newDefer[ action ] );
1276
// Get a promise for this deferred
1277
// If obj is provided, the promise aspect is added to the object
1278
promise: function( obj ) {
1279
if ( obj == null ) {
1282
for ( var key in promise ) {
1283
obj[ key ] = promise[ key ];
1289
deferred = promise.promise({}),
1292
for ( key in lists ) {
1293
deferred[ key ] = lists[ key ].fire;
1294
deferred[ key + "With" ] = lists[ key ].fireWith;
1298
deferred.done( function() {
1300
}, failList.disable, progressList.lock ).fail( function() {
1302
}, doneList.disable, progressList.lock );
1304
// Call given func if any
1306
func.call( deferred, deferred );
1314
when: function( firstParam ) {
1315
var args = sliceDeferred.call( arguments, 0 ),
1317
length = args.length,
1318
pValues = new Array( length ),
1321
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
1324
promise = deferred.promise();
1325
function resolveFunc( i ) {
1326
return function( value ) {
1327
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1328
if ( !( --count ) ) {
1329
deferred.resolveWith( deferred, args );
1333
function progressFunc( i ) {
1334
return function( value ) {
1335
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
1336
deferred.notifyWith( promise, pValues );
1340
for ( ; i < length; i++ ) {
1341
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
1342
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
1348
deferred.resolveWith( deferred, args );
1350
} else if ( deferred !== firstParam ) {
1351
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1360
jQuery.support = (function() {
1374
div = document.createElement( "div" ),
1375
documentElement = document.documentElement;
1377
// Preliminary tests
1378
div.setAttribute("className", "t");
1379
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1381
all = div.getElementsByTagName( "*" );
1382
a = div.getElementsByTagName( "a" )[ 0 ];
1384
// Can't get basic test support
1385
if ( !all || !all.length || !a ) {
1389
// First batch of supports tests
1390
select = document.createElement( "select" );
1391
opt = select.appendChild( document.createElement("option") );
1392
input = div.getElementsByTagName( "input" )[ 0 ];
1395
// IE strips leading whitespace when .innerHTML is used
1396
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
1398
// Make sure that tbody elements aren't automatically inserted
1399
// IE will insert them into empty tables
1400
tbody: !div.getElementsByTagName("tbody").length,
1402
// Make sure that link elements get serialized correctly by innerHTML
1403
// This requires a wrapper element in IE
1404
htmlSerialize: !!div.getElementsByTagName("link").length,
1406
// Get the style information from getAttribute
1407
// (IE uses .cssText instead)
1408
style: /top/.test( a.getAttribute("style") ),
1410
// Make sure that URLs aren't manipulated
1411
// (IE normalizes it by default)
1412
hrefNormalized: ( a.getAttribute("href") === "/a" ),
1414
// Make sure that element opacity exists
1415
// (IE uses filter instead)
1416
// Use a regex to work around a WebKit issue. See #5145
1417
opacity: /^0.55/.test( a.style.opacity ),
1419
// Verify style float existence
1420
// (IE uses styleFloat instead of cssFloat)
1421
cssFloat: !!a.style.cssFloat,
1423
// Make sure that if no value is specified for a checkbox
1424
// that it defaults to "on".
1425
// (WebKit defaults to "" instead)
1426
checkOn: ( input.value === "on" ),
1428
// Make sure that a selected-by-default option has a working selected property.
1429
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1430
optSelected: opt.selected,
1432
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1433
getSetAttribute: div.className !== "t",
1435
// Tests for enctype support on a form(#6743)
1436
enctype: !!document.createElement("form").enctype,
1438
// Makes sure cloning an html5 element does not cause problems
1439
// Where outerHTML is undefined, this still works
1440
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1442
// Will be defined later
1443
submitBubbles: true,
1444
changeBubbles: true,
1445
focusinBubbles: false,
1446
deleteExpando: true,
1448
inlineBlockNeedsLayout: false,
1449
shrinkWrapBlocks: false,
1450
reliableMarginRight: true,
1454
// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
1455
jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
1457
// Make sure checked status is properly cloned
1458
input.checked = true;
1459
support.noCloneChecked = input.cloneNode( true ).checked;
1461
// Make sure that the options inside disabled selects aren't marked as disabled
1462
// (WebKit marks them as disabled)
1463
select.disabled = true;
1464
support.optDisabled = !opt.disabled;
1466
// Test to see if it's possible to delete an expando from an element
1467
// Fails in Internet Explorer
1471
support.deleteExpando = false;
1474
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
1475
div.attachEvent( "onclick", function() {
1476
// Cloning a node shouldn't copy over any
1477
// bound event handlers (IE does this)
1478
support.noCloneEvent = false;
1480
div.cloneNode( true ).fireEvent( "onclick" );
1483
// Check if a radio maintains its value
1484
// after being appended to the DOM
1485
input = document.createElement("input");
1487
input.setAttribute("type", "radio");
1488
support.radioValue = input.value === "t";
1490
input.setAttribute("checked", "checked");
1492
// #11217 - WebKit loses check when the name is after the checked attribute
1493
input.setAttribute( "name", "t" );
1495
div.appendChild( input );
1496
fragment = document.createDocumentFragment();
1497
fragment.appendChild( div.lastChild );
1499
// WebKit doesn't clone checked state correctly in fragments
1500
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1502
// Check if a disconnected checkbox will retain its checked
1503
// value of true after appended to the DOM (IE6/7)
1504
support.appendChecked = input.checked;
1506
fragment.removeChild( input );
1507
fragment.appendChild( div );
1509
// Technique from Juriy Zaytsev
1510
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
1511
// We only care about the case where non-standard event systems
1512
// are used, namely in IE. Short-circuiting here helps us to
1513
// avoid an eval call (in setAttribute) which can cause CSP
1514
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
1515
if ( div.attachEvent ) {
1521
eventName = "on" + i;
1522
isSupported = ( eventName in div );
1523
if ( !isSupported ) {
1524
div.setAttribute( eventName, "return;" );
1525
isSupported = ( typeof div[ eventName ] === "function" );
1527
support[ i + "Bubbles" ] = isSupported;
1531
fragment.removeChild( div );
1533
// Null elements to avoid leaks in IE
1534
fragment = select = opt = div = input = null;
1536
// Run tests that need a body at doc ready
1538
var container, outer, inner, table, td, offsetSupport,
1539
marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
1540
paddingMarginBorderVisibility, paddingMarginBorder,
1541
body = document.getElementsByTagName("body")[0];
1544
// Return for frameset docs that don't have a body
1549
paddingMarginBorder = "padding:0;margin:0;border:";
1550
positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
1551
paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
1552
style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
1553
html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
1554
"<table " + style + "' cellpadding='0' cellspacing='0'>" +
1555
"<tr><td></td></tr></table>";
1557
container = document.createElement("div");
1558
container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
1559
body.insertBefore( container, body.firstChild );
1561
// Construct the test element
1562
div = document.createElement("div");
1563
container.appendChild( div );
1565
// Check if table cells still have offsetWidth/Height when they are set
1566
// to display:none and there are still other visible table cells in a
1567
// table row; if so, offsetWidth/Height are not reliable for use when
1568
// determining if an element has been hidden directly using
1569
// display:none (it is still safe to use offsets if a parent element is
1570
// hidden; don safety goggles and see bug #4512 for more information).
1571
// (only IE 8 fails this test)
1572
div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
1573
tds = div.getElementsByTagName( "td" );
1574
isSupported = ( tds[ 0 ].offsetHeight === 0 );
1576
tds[ 0 ].style.display = "";
1577
tds[ 1 ].style.display = "none";
1579
// Check if empty table cells still have offsetWidth/Height
1580
// (IE <= 8 fail this test)
1581
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1583
// Check if div with explicit width and no margin-right incorrectly
1584
// gets computed margin-right based on width of container. For more
1585
// info see bug #3333
1586
// Fails in WebKit before Feb 2011 nightlies
1587
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1588
if ( window.getComputedStyle ) {
1590
marginDiv = document.createElement( "div" );
1591
marginDiv.style.width = "0";
1592
marginDiv.style.marginRight = "0";
1593
div.style.width = "2px";
1594
div.appendChild( marginDiv );
1595
support.reliableMarginRight =
1596
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
1599
if ( typeof div.style.zoom !== "undefined" ) {
1600
// Check if natively block-level elements act like inline-block
1601
// elements when setting their display to 'inline' and giving
1603
// (IE < 8 does this)
1605
div.style.width = div.style.padding = "1px";
1606
div.style.border = 0;
1607
div.style.overflow = "hidden";
1608
div.style.display = "inline";
1610
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1612
// Check if elements with layout shrink-wrap their children
1614
div.style.display = "block";
1615
div.style.overflow = "visible";
1616
div.innerHTML = "<div style='width:5px;'></div>";
1617
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1620
div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
1621
div.innerHTML = html;
1623
outer = div.firstChild;
1624
inner = outer.firstChild;
1625
td = outer.nextSibling.firstChild.firstChild;
1628
doesNotAddBorder: ( inner.offsetTop !== 5 ),
1629
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
1632
inner.style.position = "fixed";
1633
inner.style.top = "20px";
1635
// safari subtracts parent border width here which is 5px
1636
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
1637
inner.style.position = inner.style.top = "";
1639
outer.style.overflow = "hidden";
1640
outer.style.position = "relative";
1642
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
1643
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
1645
if ( window.getComputedStyle ) {
1646
div.style.marginTop = "1%";
1647
support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
1650
if ( typeof container.style.zoom !== "undefined" ) {
1651
container.style.zoom = 1;
1654
body.removeChild( container );
1655
marginDiv = div = container = null;
1657
jQuery.extend( support, offsetSupport );
1666
var rbrace = /^(?:\{.*\}|\[.*\])$/,
1667
rmultiDash = /([A-Z])/g;
1672
// Please use with caution
1675
// Unique for each copy of jQuery on the page
1676
// Non-digits removed to match rinlinejQuery
1677
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
1679
// The following elements throw uncatchable exceptions if you
1680
// attempt to add expando properties to them.
1683
// Ban all objects except for Flash (which handle expandos)
1684
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1688
hasData: function( elem ) {
1689
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1690
return !!elem && !isEmptyDataObject( elem );
1693
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
1694
if ( !jQuery.acceptData( elem ) ) {
1698
var privateCache, thisCache, ret,
1699
internalKey = jQuery.expando,
1700
getByName = typeof name === "string",
1702
// We have to handle DOM nodes and JS objects differently because IE6-7
1703
// can't GC object references properly across the DOM-JS boundary
1704
isNode = elem.nodeType,
1706
// Only DOM nodes need the global jQuery cache; JS object data is
1707
// attached directly to the object so GC can occur automatically
1708
cache = isNode ? jQuery.cache : elem,
1710
// Only defining an ID for JS objects if its cache already exists allows
1711
// the code to shortcut on the same path as a DOM node with no cache
1712
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
1713
isEvents = name === "events";
1715
// Avoid doing any more work than we need to when trying to get data on an
1716
// object that has no data at all
1717
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
1722
// Only DOM nodes need a new unique ID for each element since their data
1723
// ends up in the global cache
1725
elem[ internalKey ] = id = ++jQuery.uuid;
1731
if ( !cache[ id ] ) {
1734
// Avoids exposing jQuery metadata on plain JS objects when the object
1735
// is serialized using JSON.stringify
1737
cache[ id ].toJSON = jQuery.noop;
1741
// An object can be passed to jQuery.data instead of a key/value pair; this gets
1742
// shallow copied over onto the existing cache
1743
if ( typeof name === "object" || typeof name === "function" ) {
1745
cache[ id ] = jQuery.extend( cache[ id ], name );
1747
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1751
privateCache = thisCache = cache[ id ];
1753
// jQuery data() is stored in a separate object inside the object's internal data
1754
// cache in order to avoid key collisions between internal data and user-defined
1757
if ( !thisCache.data ) {
1758
thisCache.data = {};
1761
thisCache = thisCache.data;
1764
if ( data !== undefined ) {
1765
thisCache[ jQuery.camelCase( name ) ] = data;
1768
// Users should not attempt to inspect the internal events object using jQuery.data,
1769
// it is undocumented and subject to change. But does anyone listen? No.
1770
if ( isEvents && !thisCache[ name ] ) {
1771
return privateCache.events;
1774
// Check for both converted-to-camel and non-converted data property names
1775
// If a data property was specified
1778
// First Try to find as-is property data
1779
ret = thisCache[ name ];
1781
// Test for null|undefined property data
1782
if ( ret == null ) {
1784
// Try to find the camelCased property
1785
ret = thisCache[ jQuery.camelCase( name ) ];
1794
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
1795
if ( !jQuery.acceptData( elem ) ) {
1799
var thisCache, i, l,
1801
// Reference to internal data cache key
1802
internalKey = jQuery.expando,
1804
isNode = elem.nodeType,
1806
// See jQuery.data for more information
1807
cache = isNode ? jQuery.cache : elem,
1809
// See jQuery.data for more information
1810
id = isNode ? elem[ internalKey ] : internalKey;
1812
// If there is already no cache entry for this object, there is no
1813
// purpose in continuing
1814
if ( !cache[ id ] ) {
1820
thisCache = pvt ? cache[ id ] : cache[ id ].data;
1824
// Support array or space separated string names for data keys
1825
if ( !jQuery.isArray( name ) ) {
1827
// try the string as a key before any manipulation
1828
if ( name in thisCache ) {
1832
// split the camel cased version by spaces unless a key with the spaces exists
1833
name = jQuery.camelCase( name );
1834
if ( name in thisCache ) {
1837
name = name.split( " " );
1842
for ( i = 0, l = name.length; i < l; i++ ) {
1843
delete thisCache[ name[i] ];
1846
// If there is no data left in the cache, we want to continue
1847
// and let the cache object itself get destroyed
1848
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1854
// See jQuery.data for more information
1856
delete cache[ id ].data;
1858
// Don't destroy the parent cache unless the internal data object
1859
// had been the only thing left in it
1860
if ( !isEmptyDataObject(cache[ id ]) ) {
1865
// Browsers that fail expando deletion also refuse to delete expandos on
1866
// the window, but it will allow it on all other JS objects; other browsers
1868
// Ensure that `cache` is not a window object #10080
1869
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
1875
// We destroyed the cache and need to eliminate the expando on the node to avoid
1876
// false lookups in the cache for entries that no longer exist
1878
// IE does not allow us to delete expando properties from nodes,
1879
// nor does it have a removeAttribute function on Document nodes;
1880
// we must handle all of these cases
1881
if ( jQuery.support.deleteExpando ) {
1882
delete elem[ internalKey ];
1883
} else if ( elem.removeAttribute ) {
1884
elem.removeAttribute( internalKey );
1886
elem[ internalKey ] = null;
1891
// For internal use only.
1892
_data: function( elem, name, data ) {
1893
return jQuery.data( elem, name, data, true );
1896
// A method for determining if a DOM node can handle the data expando
1897
acceptData: function( elem ) {
1898
if ( elem.nodeName ) {
1899
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
1902
return !(match === true || elem.getAttribute("classid") !== match);
1911
data: function( key, value ) {
1912
var parts, part, attr, name, l,
1918
if ( key === undefined ) {
1919
if ( this.length ) {
1920
data = jQuery.data( elem );
1922
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1923
attr = elem.attributes;
1924
for ( l = attr.length; i < l; i++ ) {
1925
name = attr[i].name;
1927
if ( name.indexOf( "data-" ) === 0 ) {
1928
name = jQuery.camelCase( name.substring(5) );
1930
dataAttr( elem, name, data[ name ] );
1933
jQuery._data( elem, "parsedAttrs", true );
1940
// Sets multiple values
1941
if ( typeof key === "object" ) {
1942
return this.each(function() {
1943
jQuery.data( this, key );
1947
parts = key.split( ".", 2 );
1948
parts[1] = parts[1] ? "." + parts[1] : "";
1949
part = parts[1] + "!";
1951
return jQuery.access( this, function( value ) {
1953
if ( value === undefined ) {
1954
data = this.triggerHandler( "getData" + part, [ parts[0] ] );
1956
// Try to fetch any internally stored data first
1957
if ( data === undefined && elem ) {
1958
data = jQuery.data( elem, key );
1959
data = dataAttr( elem, key, data );
1962
return data === undefined && parts[1] ?
1963
this.data( parts[0] ) :
1968
this.each(function() {
1969
var self = jQuery( this );
1971
self.triggerHandler( "setData" + part, parts );
1972
jQuery.data( this, key, value );
1973
self.triggerHandler( "changeData" + part, parts );
1975
}, null, value, arguments.length > 1, null, false );
1978
removeData: function( key ) {
1979
return this.each(function() {
1980
jQuery.removeData( this, key );
1985
function dataAttr( elem, key, data ) {
1986
// If nothing was found internally, try to fetch any
1987
// data from the HTML5 data-* attribute
1988
if ( data === undefined && elem.nodeType === 1 ) {
1990
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1992
data = elem.getAttribute( name );
1994
if ( typeof data === "string" ) {
1996
data = data === "true" ? true :
1997
data === "false" ? false :
1998
data === "null" ? null :
1999
jQuery.isNumeric( data ) ? +data :
2000
rbrace.test( data ) ? jQuery.parseJSON( data ) :
2004
// Make sure we set the data so it isn't changed later
2005
jQuery.data( elem, key, data );
2015
// checks a cache object for emptiness
2016
function isEmptyDataObject( obj ) {
2017
for ( var name in obj ) {
2019
// if the public data object is empty, the private is still empty
2020
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
2023
if ( name !== "toJSON" ) {
2034
function handleQueueMarkDefer( elem, type, src ) {
2035
var deferDataKey = type + "defer",
2036
queueDataKey = type + "queue",
2037
markDataKey = type + "mark",
2038
defer = jQuery._data( elem, deferDataKey );
2040
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
2041
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
2042
// Give room for hard-coded callbacks to fire first
2043
// and eventually mark/queue something else on the element
2044
setTimeout( function() {
2045
if ( !jQuery._data( elem, queueDataKey ) &&
2046
!jQuery._data( elem, markDataKey ) ) {
2047
jQuery.removeData( elem, deferDataKey, true );
2056
_mark: function( elem, type ) {
2058
type = ( type || "fx" ) + "mark";
2059
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
2063
_unmark: function( force, elem, type ) {
2064
if ( force !== true ) {
2070
type = type || "fx";
2071
var key = type + "mark",
2072
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
2074
jQuery._data( elem, key, count );
2076
jQuery.removeData( elem, key, true );
2077
handleQueueMarkDefer( elem, type, "mark" );
2082
queue: function( elem, type, data ) {
2085
type = ( type || "fx" ) + "queue";
2086
q = jQuery._data( elem, type );
2088
// Speed up dequeue by getting out quickly if this is just a lookup
2090
if ( !q || jQuery.isArray(data) ) {
2091
q = jQuery._data( elem, type, jQuery.makeArray(data) );
2100
dequeue: function( elem, type ) {
2101
type = type || "fx";
2103
var queue = jQuery.queue( elem, type ),
2107
// If the fx queue is dequeued, always remove the progress sentinel
2108
if ( fn === "inprogress" ) {
2113
// Add a progress sentinel to prevent the fx queue from being
2114
// automatically dequeued
2115
if ( type === "fx" ) {
2116
queue.unshift( "inprogress" );
2119
jQuery._data( elem, type + ".run", hooks );
2120
fn.call( elem, function() {
2121
jQuery.dequeue( elem, type );
2125
if ( !queue.length ) {
2126
jQuery.removeData( elem, type + "queue " + type + ".run", true );
2127
handleQueueMarkDefer( elem, type, "queue" );
2133
queue: function( type, data ) {
2136
if ( typeof type !== "string" ) {
2142
if ( arguments.length < setter ) {
2143
return jQuery.queue( this[0], type );
2146
return data === undefined ?
2148
this.each(function() {
2149
var queue = jQuery.queue( this, type, data );
2151
if ( type === "fx" && queue[0] !== "inprogress" ) {
2152
jQuery.dequeue( this, type );
2156
dequeue: function( type ) {
2157
return this.each(function() {
2158
jQuery.dequeue( this, type );
2161
// Based off of the plugin by Clint Helfers, with permission.
2162
// http://blindsignals.com/index.php/2009/07/jquery-delay/
2163
delay: function( time, type ) {
2164
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
2165
type = type || "fx";
2167
return this.queue( type, function( next, hooks ) {
2168
var timeout = setTimeout( next, time );
2169
hooks.stop = function() {
2170
clearTimeout( timeout );
2174
clearQueue: function( type ) {
2175
return this.queue( type || "fx", [] );
2177
// Get a promise resolved when queues of a certain type
2178
// are emptied (fx is the type by default)
2179
promise: function( type, object ) {
2180
if ( typeof type !== "string" ) {
2184
type = type || "fx";
2185
var defer = jQuery.Deferred(),
2187
i = elements.length,
2189
deferDataKey = type + "defer",
2190
queueDataKey = type + "queue",
2191
markDataKey = type + "mark",
2193
function resolve() {
2194
if ( !( --count ) ) {
2195
defer.resolveWith( elements, [ elements ] );
2199
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
2200
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
2201
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
2202
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
2208
return defer.promise( object );
2215
var rclass = /[\n\t\r]/g,
2218
rtype = /^(?:button|input)$/i,
2219
rfocusable = /^(?:button|input|object|select|textarea)$/i,
2220
rclickable = /^a(?:rea)?$/i,
2221
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
2222
getSetAttribute = jQuery.support.getSetAttribute,
2223
nodeHook, boolHook, fixSpecified;
2226
attr: function( name, value ) {
2227
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
2230
removeAttr: function( name ) {
2231
return this.each(function() {
2232
jQuery.removeAttr( this, name );
2236
prop: function( name, value ) {
2237
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
2240
removeProp: function( name ) {
2241
name = jQuery.propFix[ name ] || name;
2242
return this.each(function() {
2243
// try/catch handles cases where IE balks (such as removing a property on window)
2245
this[ name ] = undefined;
2246
delete this[ name ];
2251
addClass: function( value ) {
2252
var classNames, i, l, elem,
2255
if ( jQuery.isFunction( value ) ) {
2256
return this.each(function( j ) {
2257
jQuery( this ).addClass( value.call(this, j, this.className) );
2261
if ( value && typeof value === "string" ) {
2262
classNames = value.split( rspace );
2264
for ( i = 0, l = this.length; i < l; i++ ) {
2267
if ( elem.nodeType === 1 ) {
2268
if ( !elem.className && classNames.length === 1 ) {
2269
elem.className = value;
2272
setClass = " " + elem.className + " ";
2274
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2275
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
2276
setClass += classNames[ c ] + " ";
2279
elem.className = jQuery.trim( setClass );
2288
removeClass: function( value ) {
2289
var classNames, i, l, elem, className, c, cl;
2291
if ( jQuery.isFunction( value ) ) {
2292
return this.each(function( j ) {
2293
jQuery( this ).removeClass( value.call(this, j, this.className) );
2297
if ( (value && typeof value === "string") || value === undefined ) {
2298
classNames = ( value || "" ).split( rspace );
2300
for ( i = 0, l = this.length; i < l; i++ ) {
2303
if ( elem.nodeType === 1 && elem.className ) {
2305
className = (" " + elem.className + " ").replace( rclass, " " );
2306
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
2307
className = className.replace(" " + classNames[ c ] + " ", " ");
2309
elem.className = jQuery.trim( className );
2312
elem.className = "";
2321
toggleClass: function( value, stateVal ) {
2322
var type = typeof value,
2323
isBool = typeof stateVal === "boolean";
2325
if ( jQuery.isFunction( value ) ) {
2326
return this.each(function( i ) {
2327
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
2331
return this.each(function() {
2332
if ( type === "string" ) {
2333
// toggle individual class names
2336
self = jQuery( this ),
2338
classNames = value.split( rspace );
2340
while ( (className = classNames[ i++ ]) ) {
2341
// check each className given, space seperated list
2342
state = isBool ? state : !self.hasClass( className );
2343
self[ state ? "addClass" : "removeClass" ]( className );
2346
} else if ( type === "undefined" || type === "boolean" ) {
2347
if ( this.className ) {
2348
// store className if set
2349
jQuery._data( this, "__className__", this.className );
2352
// toggle whole className
2353
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
2358
hasClass: function( selector ) {
2359
var className = " " + selector + " ",
2362
for ( ; i < l; i++ ) {
2363
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
2371
val: function( value ) {
2372
var hooks, ret, isFunction,
2375
if ( !arguments.length ) {
2377
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
2379
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
2385
return typeof ret === "string" ?
2386
// handle most common string cases
2387
ret.replace(rreturn, "") :
2388
// handle cases where value is null/undef or number
2389
ret == null ? "" : ret;
2395
isFunction = jQuery.isFunction( value );
2397
return this.each(function( i ) {
2398
var self = jQuery(this), val;
2400
if ( this.nodeType !== 1 ) {
2405
val = value.call( this, i, self.val() );
2410
// Treat null/undefined as ""; convert numbers to string
2411
if ( val == null ) {
2413
} else if ( typeof val === "number" ) {
2415
} else if ( jQuery.isArray( val ) ) {
2416
val = jQuery.map(val, function ( value ) {
2417
return value == null ? "" : value + "";
2421
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
2423
// If set returns undefined, fall back to normal setting
2424
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2434
get: function( elem ) {
2435
// attributes.value is undefined in Blackberry 4.7 but
2436
// uses .value. See #6932
2437
var val = elem.attributes.value;
2438
return !val || val.specified ? elem.value : elem.text;
2442
get: function( elem ) {
2443
var value, i, max, option,
2444
index = elem.selectedIndex,
2446
options = elem.options,
2447
one = elem.type === "select-one";
2449
// Nothing was selected
2454
// Loop through all the selected options
2455
i = one ? index : 0;
2456
max = one ? index + 1 : options.length;
2457
for ( ; i < max; i++ ) {
2458
option = options[ i ];
2460
// Don't return options that are disabled or in a disabled optgroup
2461
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
2462
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
2464
// Get the specific value for the option
2465
value = jQuery( option ).val();
2467
// We don't need an array for one selects
2472
// Multi-Selects return an array
2473
values.push( value );
2477
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
2478
if ( one && !values.length && options.length ) {
2479
return jQuery( options[ index ] ).val();
2485
set: function( elem, value ) {
2486
var values = jQuery.makeArray( value );
2488
jQuery(elem).find("option").each(function() {
2489
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
2492
if ( !values.length ) {
2493
elem.selectedIndex = -1;
2511
attr: function( elem, name, value, pass ) {
2512
var ret, hooks, notxml,
2513
nType = elem.nodeType;
2515
// don't get/set attributes on text, comment and attribute nodes
2516
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2520
if ( pass && name in jQuery.attrFn ) {
2521
return jQuery( elem )[ name ]( value );
2524
// Fallback to prop when attributes are not supported
2525
if ( typeof elem.getAttribute === "undefined" ) {
2526
return jQuery.prop( elem, name, value );
2529
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2531
// All attributes are lowercase
2532
// Grab necessary hook if one is defined
2534
name = name.toLowerCase();
2535
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
2538
if ( value !== undefined ) {
2540
if ( value === null ) {
2541
jQuery.removeAttr( elem, name );
2544
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
2548
elem.setAttribute( name, "" + value );
2552
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
2557
ret = elem.getAttribute( name );
2559
// Non-existent attributes return null, we normalize to undefined
2560
return ret === null ?
2566
removeAttr: function( elem, value ) {
2567
var propName, attrNames, name, l, isBool,
2570
if ( value && elem.nodeType === 1 ) {
2571
attrNames = value.toLowerCase().split( rspace );
2572
l = attrNames.length;
2574
for ( ; i < l; i++ ) {
2575
name = attrNames[ i ];
2578
propName = jQuery.propFix[ name ] || name;
2579
isBool = rboolean.test( name );
2581
// See #9699 for explanation of this approach (setting first, then removal)
2582
// Do not do this for boolean attributes (see #10870)
2584
jQuery.attr( elem, name, "" );
2586
elem.removeAttribute( getSetAttribute ? name : propName );
2588
// Set corresponding property to false for boolean attributes
2589
if ( isBool && propName in elem ) {
2590
elem[ propName ] = false;
2599
set: function( elem, value ) {
2600
// We can't allow the type property to be changed (since it causes problems in IE)
2601
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
2602
jQuery.error( "type property can't be changed" );
2603
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2604
// Setting the type on a radio button after the value resets the value in IE6-9
2605
// Reset value to it's default in case type is set after value
2606
// This is for element creation
2607
var val = elem.value;
2608
elem.setAttribute( "type", value );
2616
// Use the value property for back compat
2617
// Use the nodeHook for button elements in IE6/7 (#1954)
2619
get: function( elem, name ) {
2620
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2621
return nodeHook.get( elem, name );
2623
return name in elem ?
2627
set: function( elem, value, name ) {
2628
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2629
return nodeHook.set( elem, value, name );
2631
// Does not return so that setAttribute is also used
2638
tabindex: "tabIndex",
2639
readonly: "readOnly",
2641
"class": "className",
2642
maxlength: "maxLength",
2643
cellspacing: "cellSpacing",
2644
cellpadding: "cellPadding",
2648
frameborder: "frameBorder",
2649
contenteditable: "contentEditable"
2652
prop: function( elem, name, value ) {
2653
var ret, hooks, notxml,
2654
nType = elem.nodeType;
2656
// don't get/set properties on text, comment and attribute nodes
2657
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2661
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2664
// Fix name and attach hooks
2665
name = jQuery.propFix[ name ] || name;
2666
hooks = jQuery.propHooks[ name ];
2669
if ( value !== undefined ) {
2670
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2674
return ( elem[ name ] = value );
2678
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2682
return elem[ name ];
2689
get: function( elem ) {
2690
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2691
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2692
var attributeNode = elem.getAttributeNode("tabindex");
2694
return attributeNode && attributeNode.specified ?
2695
parseInt( attributeNode.value, 10 ) :
2696
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2704
// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
2705
jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
2707
// Hook for boolean attributes
2709
get: function( elem, name ) {
2710
// Align boolean attributes with corresponding properties
2711
// Fall back to attribute presence where some booleans are not supported
2713
property = jQuery.prop( elem, name );
2714
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
2715
name.toLowerCase() :
2718
set: function( elem, value, name ) {
2720
if ( value === false ) {
2721
// Remove boolean attributes when set to false
2722
jQuery.removeAttr( elem, name );
2724
// value is true since we know at this point it's type boolean and not false
2725
// Set boolean attributes to the same name and set the DOM property
2726
propName = jQuery.propFix[ name ] || name;
2727
if ( propName in elem ) {
2728
// Only set the IDL specifically if it already exists on the element
2729
elem[ propName ] = true;
2732
elem.setAttribute( name, name.toLowerCase() );
2738
// IE6/7 do not support getting/setting some attributes with get/setAttribute
2739
if ( !getSetAttribute ) {
2747
// Use this for any attribute in IE6/7
2748
// This fixes almost every IE6/7 issue
2749
nodeHook = jQuery.valHooks.button = {
2750
get: function( elem, name ) {
2752
ret = elem.getAttributeNode( name );
2753
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
2757
set: function( elem, value, name ) {
2758
// Set the existing or create a new attribute node
2759
var ret = elem.getAttributeNode( name );
2761
ret = document.createAttribute( name );
2762
elem.setAttributeNode( ret );
2764
return ( ret.nodeValue = value + "" );
2768
// Apply the nodeHook to tabindex
2769
jQuery.attrHooks.tabindex.set = nodeHook.set;
2771
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
2772
// This is for removals
2773
jQuery.each([ "width", "height" ], function( i, name ) {
2774
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2775
set: function( elem, value ) {
2776
if ( value === "" ) {
2777
elem.setAttribute( name, "auto" );
2784
// Set contenteditable to false on removals(#10429)
2785
// Setting to empty string throws an error as an invalid value
2786
jQuery.attrHooks.contenteditable = {
2788
set: function( elem, value, name ) {
2789
if ( value === "" ) {
2792
nodeHook.set( elem, value, name );
2798
// Some attributes require a special call on IE
2799
if ( !jQuery.support.hrefNormalized ) {
2800
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2801
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2802
get: function( elem ) {
2803
var ret = elem.getAttribute( name, 2 );
2804
return ret === null ? undefined : ret;
2810
if ( !jQuery.support.style ) {
2811
jQuery.attrHooks.style = {
2812
get: function( elem ) {
2813
// Return undefined in the case of empty string
2814
// Normalize to lowercase since IE uppercases css property names
2815
return elem.style.cssText.toLowerCase() || undefined;
2817
set: function( elem, value ) {
2818
return ( elem.style.cssText = "" + value );
2823
// Safari mis-reports the default selected property of an option
2824
// Accessing the parent's selectedIndex property fixes it
2825
if ( !jQuery.support.optSelected ) {
2826
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2827
get: function( elem ) {
2828
var parent = elem.parentNode;
2831
parent.selectedIndex;
2833
// Make sure that it also works with optgroups, see #5701
2834
if ( parent.parentNode ) {
2835
parent.parentNode.selectedIndex;
2843
// IE6/7 call enctype encoding
2844
if ( !jQuery.support.enctype ) {
2845
jQuery.propFix.enctype = "encoding";
2848
// Radios and checkboxes getter/setter
2849
if ( !jQuery.support.checkOn ) {
2850
jQuery.each([ "radio", "checkbox" ], function() {
2851
jQuery.valHooks[ this ] = {
2852
get: function( elem ) {
2853
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2854
return elem.getAttribute("value") === null ? "on" : elem.value;
2859
jQuery.each([ "radio", "checkbox" ], function() {
2860
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2861
set: function( elem, value ) {
2862
if ( jQuery.isArray( value ) ) {
2863
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2872
var rformElems = /^(?:textarea|input|select)$/i,
2873
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
2874
rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
2876
rmouseEvent = /^(?:mouse|contextmenu)|click/,
2877
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2878
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
2879
quickParse = function( selector ) {
2880
var quick = rquickIs.exec( selector );
2883
// [ _, tag, id, class ]
2884
quick[1] = ( quick[1] || "" ).toLowerCase();
2885
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
2889
quickIs = function( elem, m ) {
2890
var attrs = elem.attributes || {};
2892
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
2893
(!m[2] || (attrs.id || {}).value === m[2]) &&
2894
(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
2897
hoverHack = function( events ) {
2898
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
2902
* Helper functions for managing events -- not part of the public interface.
2903
* Props to Dean Edwards' addEvent library for many of the ideas.
2907
add: function( elem, types, handler, data, selector ) {
2909
var elemData, eventHandle, events,
2910
t, tns, type, namespaces, handleObj,
2911
handleObjIn, quick, handlers, special;
2913
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
2914
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
2918
// Caller can pass in an object of custom data in lieu of the handler
2919
if ( handler.handler ) {
2920
handleObjIn = handler;
2921
handler = handleObjIn.handler;
2922
selector = handleObjIn.selector;
2925
// Make sure that the handler has a unique ID, used to find/remove it later
2926
if ( !handler.guid ) {
2927
handler.guid = jQuery.guid++;
2930
// Init the element's event structure and main handler, if this is the first
2931
events = elemData.events;
2933
elemData.events = events = {};
2935
eventHandle = elemData.handle;
2936
if ( !eventHandle ) {
2937
elemData.handle = eventHandle = function( e ) {
2938
// Discard the second event of a jQuery.event.trigger() and
2939
// when an event is called after a page has unloaded
2940
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
2941
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2944
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2945
eventHandle.elem = elem;
2948
// Handle multiple events separated by a space
2949
// jQuery(...).bind("mouseover mouseout", fn);
2950
types = jQuery.trim( hoverHack(types) ).split( " " );
2951
for ( t = 0; t < types.length; t++ ) {
2953
tns = rtypenamespace.exec( types[t] ) || [];
2955
namespaces = ( tns[2] || "" ).split( "." ).sort();
2957
// If event changes its type, use the special event handlers for the changed type
2958
special = jQuery.event.special[ type ] || {};
2960
// If selector defined, determine special event api type, otherwise given type
2961
type = ( selector ? special.delegateType : special.bindType ) || type;
2963
// Update special based on newly reset type
2964
special = jQuery.event.special[ type ] || {};
2966
// handleObj is passed to all event handlers
2967
handleObj = jQuery.extend({
2974
quick: selector && quickParse( selector ),
2975
namespace: namespaces.join(".")
2978
// Init the event handler queue if we're the first
2979
handlers = events[ type ];
2981
handlers = events[ type ] = [];
2982
handlers.delegateCount = 0;
2984
// Only use addEventListener/attachEvent if the special events handler returns false
2985
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2986
// Bind the global event handler to the element
2987
if ( elem.addEventListener ) {
2988
elem.addEventListener( type, eventHandle, false );
2990
} else if ( elem.attachEvent ) {
2991
elem.attachEvent( "on" + type, eventHandle );
2996
if ( special.add ) {
2997
special.add.call( elem, handleObj );
2999
if ( !handleObj.handler.guid ) {
3000
handleObj.handler.guid = handler.guid;
3004
// Add to the element's handler list, delegates in front
3006
handlers.splice( handlers.delegateCount++, 0, handleObj );
3008
handlers.push( handleObj );
3011
// Keep track of which events have ever been used, for event optimization
3012
jQuery.event.global[ type ] = true;
3015
// Nullify elem to prevent memory leaks in IE
3021
// Detach an event or set of events from an element
3022
remove: function( elem, types, handler, selector, mappedTypes ) {
3024
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
3025
t, tns, type, origType, namespaces, origCount,
3026
j, events, special, handle, eventType, handleObj;
3028
if ( !elemData || !(events = elemData.events) ) {
3032
// Once for each type.namespace in types; type may be omitted
3033
types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
3034
for ( t = 0; t < types.length; t++ ) {
3035
tns = rtypenamespace.exec( types[t] ) || [];
3036
type = origType = tns[1];
3037
namespaces = tns[2];
3039
// Unbind all events (on this namespace, if provided) for the element
3041
for ( type in events ) {
3042
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
3047
special = jQuery.event.special[ type ] || {};
3048
type = ( selector? special.delegateType : special.bindType ) || type;
3049
eventType = events[ type ] || [];
3050
origCount = eventType.length;
3051
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3053
// Remove matching events
3054
for ( j = 0; j < eventType.length; j++ ) {
3055
handleObj = eventType[ j ];
3057
if ( ( mappedTypes || origType === handleObj.origType ) &&
3058
( !handler || handler.guid === handleObj.guid ) &&
3059
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
3060
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
3061
eventType.splice( j--, 1 );
3063
if ( handleObj.selector ) {
3064
eventType.delegateCount--;
3066
if ( special.remove ) {
3067
special.remove.call( elem, handleObj );
3072
// Remove generic event handler if we removed something and no more handlers exist
3073
// (avoids potential for endless recursion during removal of special event handlers)
3074
if ( eventType.length === 0 && origCount !== eventType.length ) {
3075
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
3076
jQuery.removeEvent( elem, type, elemData.handle );
3079
delete events[ type ];
3083
// Remove the expando if it's no longer used
3084
if ( jQuery.isEmptyObject( events ) ) {
3085
handle = elemData.handle;
3090
// removeData also checks for emptiness and clears the expando if empty
3091
// so use it instead of delete
3092
jQuery.removeData( elem, [ "events", "handle" ], true );
3096
// Events that are safe to short-circuit if no handlers are attached.
3097
// Native DOM events should not be added, they may have inline handlers.
3104
trigger: function( event, data, elem, onlyHandlers ) {
3105
// Don't do events on text and comment nodes
3106
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
3110
// Event object or event type
3111
var type = event.type || event,
3113
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
3115
// focus/blur morphs to focusin/out; ensure we're not firing them right now
3116
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
3120
if ( type.indexOf( "!" ) >= 0 ) {
3121
// Exclusive events trigger only for the exact event (no namespaces)
3122
type = type.slice(0, -1);
3126
if ( type.indexOf( "." ) >= 0 ) {
3127
// Namespaced trigger; create a regexp to match event type in handle()
3128
namespaces = type.split(".");
3129
type = namespaces.shift();
3133
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
3134
// No jQuery handlers for this event type, and it can't have inline handlers
3138
// Caller can pass in an Event, Object, or just an event type string
3139
event = typeof event === "object" ?
3140
// jQuery.Event object
3141
event[ jQuery.expando ] ? event :
3143
new jQuery.Event( type, event ) :
3144
// Just the event type (string)
3145
new jQuery.Event( type );
3148
event.isTrigger = true;
3149
event.exclusive = exclusive;
3150
event.namespace = namespaces.join( "." );
3151
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
3152
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
3154
// Handle a global trigger
3157
// TODO: Stop taunting the data cache; remove global events and always attach to document
3158
cache = jQuery.cache;
3159
for ( i in cache ) {
3160
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
3161
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
3167
// Clean up the event in case it is being reused
3168
event.result = undefined;
3169
if ( !event.target ) {
3170
event.target = elem;
3173
// Clone any incoming data and prepend the event, creating the handler arg list
3174
data = data != null ? jQuery.makeArray( data ) : [];
3175
data.unshift( event );
3177
// Allow special events to draw outside the lines
3178
special = jQuery.event.special[ type ] || {};
3179
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
3183
// Determine event propagation path in advance, per W3C events spec (#9951)
3184
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
3185
eventPath = [[ elem, special.bindType || type ]];
3186
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
3188
bubbleType = special.delegateType || type;
3189
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
3191
for ( ; cur; cur = cur.parentNode ) {
3192
eventPath.push([ cur, bubbleType ]);
3196
// Only add window if we got to document (e.g., not plain obj or detached DOM)
3197
if ( old && old === elem.ownerDocument ) {
3198
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
3202
// Fire handlers on the event path
3203
for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
3205
cur = eventPath[i][0];
3206
event.type = eventPath[i][1];
3208
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
3210
handle.apply( cur, data );
3212
// Note that this is a bare JS function and not a jQuery handler
3213
handle = ontype && cur[ ontype ];
3214
if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
3215
event.preventDefault();
3220
// If nobody prevented the default action, do it now
3221
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
3223
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
3224
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
3226
// Call a native DOM method on the target with the same name name as the event.
3227
// Can't use an .isFunction() check here because IE6/7 fails that test.
3228
// Don't do default actions on window, that's where global variables be (#6170)
3229
// IE<9 dies on focus/blur to hidden element (#1486)
3230
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
3232
// Don't re-trigger an onFOO event when we call its FOO() method
3233
old = elem[ ontype ];
3236
elem[ ontype ] = null;
3239
// Prevent re-triggering of the same event, since we already bubbled it above
3240
jQuery.event.triggered = type;
3242
jQuery.event.triggered = undefined;
3245
elem[ ontype ] = old;
3251
return event.result;
3254
dispatch: function( event ) {
3256
// Make a writable jQuery.Event from the native event object
3257
event = jQuery.event.fix( event || window.event );
3259
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
3260
delegateCount = handlers.delegateCount,
3261
args = [].slice.call( arguments, 0 ),
3262
run_all = !event.exclusive && !event.namespace,
3263
special = jQuery.event.special[ event.type ] || {},
3265
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
3267
// Use the fix-ed jQuery.Event rather than the (read-only) native event
3269
event.delegateTarget = this;
3271
// Call the preDispatch hook for the mapped type, and let it bail if desired
3272
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
3276
// Determine handlers that should run if there are delegated events
3277
// Avoid non-left-click bubbling in Firefox (#3861)
3278
if ( delegateCount && !(event.button && event.type === "click") ) {
3280
// Pregenerate a single jQuery object for reuse with .is()
3281
jqcur = jQuery(this);
3282
jqcur.context = this.ownerDocument || this;
3284
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
3286
// Don't process events on disabled elements (#6911, #8165)
3287
if ( cur.disabled !== true ) {
3291
for ( i = 0; i < delegateCount; i++ ) {
3292
handleObj = handlers[ i ];
3293
sel = handleObj.selector;
3295
if ( selMatch[ sel ] === undefined ) {
3297
handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
3300
if ( selMatch[ sel ] ) {
3301
matches.push( handleObj );
3304
if ( matches.length ) {
3305
handlerQueue.push({ elem: cur, matches: matches });
3311
// Add the remaining (directly-bound) handlers
3312
if ( handlers.length > delegateCount ) {
3313
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
3316
// Run delegates first; they may want to stop propagation beneath us
3317
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
3318
matched = handlerQueue[ i ];
3319
event.currentTarget = matched.elem;
3321
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
3322
handleObj = matched.matches[ j ];
3324
// Triggered event must either 1) be non-exclusive and have no namespace, or
3325
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
3326
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
3328
event.data = handleObj.data;
3329
event.handleObj = handleObj;
3331
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
3332
.apply( matched.elem, args );
3334
if ( ret !== undefined ) {
3336
if ( ret === false ) {
3337
event.preventDefault();
3338
event.stopPropagation();
3345
// Call the postDispatch hook for the mapped type
3346
if ( special.postDispatch ) {
3347
special.postDispatch.call( this, event );
3350
return event.result;
3353
// Includes some event props shared by KeyEvent and MouseEvent
3354
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
3355
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
3360
props: "char charCode key keyCode".split(" "),
3361
filter: function( event, original ) {
3363
// Add which for key events
3364
if ( event.which == null ) {
3365
event.which = original.charCode != null ? original.charCode : original.keyCode;
3373
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
3374
filter: function( event, original ) {
3375
var eventDoc, doc, body,
3376
button = original.button,
3377
fromElement = original.fromElement;
3379
// Calculate pageX/Y if missing and clientX/Y available
3380
if ( event.pageX == null && original.clientX != null ) {
3381
eventDoc = event.target.ownerDocument || document;
3382
doc = eventDoc.documentElement;
3383
body = eventDoc.body;
3385
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
3386
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
3389
// Add relatedTarget, if necessary
3390
if ( !event.relatedTarget && fromElement ) {
3391
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
3394
// Add which for click: 1 === left; 2 === middle; 3 === right
3395
// Note: button is not normalized, so don't use it
3396
if ( !event.which && button !== undefined ) {
3397
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
3404
fix: function( event ) {
3405
if ( event[ jQuery.expando ] ) {
3409
// Create a writable copy of the event object and normalize some properties
3411
originalEvent = event,
3412
fixHook = jQuery.event.fixHooks[ event.type ] || {},
3413
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
3415
event = jQuery.Event( originalEvent );
3417
for ( i = copy.length; i; ) {
3419
event[ prop ] = originalEvent[ prop ];
3422
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
3423
if ( !event.target ) {
3424
event.target = originalEvent.srcElement || document;
3427
// Target should not be a text node (#504, Safari)
3428
if ( event.target.nodeType === 3 ) {
3429
event.target = event.target.parentNode;
3432
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
3433
if ( event.metaKey === undefined ) {
3434
event.metaKey = event.ctrlKey;
3437
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
3442
// Make sure the ready event is setup
3443
setup: jQuery.bindReady
3447
// Prevent triggered image.load events from bubbling to window.load
3452
delegateType: "focusin"
3455
delegateType: "focusout"
3459
setup: function( data, namespaces, eventHandle ) {
3460
// We only want to do this special case on windows
3461
if ( jQuery.isWindow( this ) ) {
3462
this.onbeforeunload = eventHandle;
3466
teardown: function( namespaces, eventHandle ) {
3467
if ( this.onbeforeunload === eventHandle ) {
3468
this.onbeforeunload = null;
3474
simulate: function( type, elem, event, bubble ) {
3475
// Piggyback on a donor event to simulate a different one.
3476
// Fake originalEvent to avoid donor's stopPropagation, but if the
3477
// simulated event prevents default then we do the same on the donor.
3478
var e = jQuery.extend(
3487
jQuery.event.trigger( e, null, elem );
3489
jQuery.event.dispatch.call( elem, e );
3491
if ( e.isDefaultPrevented() ) {
3492
event.preventDefault();
3497
// Some plugins are using, but it's undocumented/deprecated and will be removed.
3498
// The 1.7 special event interface should provide all the hooks needed now.
3499
jQuery.event.handle = jQuery.event.dispatch;
3501
jQuery.removeEvent = document.removeEventListener ?
3502
function( elem, type, handle ) {
3503
if ( elem.removeEventListener ) {
3504
elem.removeEventListener( type, handle, false );
3507
function( elem, type, handle ) {
3508
if ( elem.detachEvent ) {
3509
elem.detachEvent( "on" + type, handle );
3513
jQuery.Event = function( src, props ) {
3514
// Allow instantiation without the 'new' keyword
3515
if ( !(this instanceof jQuery.Event) ) {
3516
return new jQuery.Event( src, props );
3520
if ( src && src.type ) {
3521
this.originalEvent = src;
3522
this.type = src.type;
3524
// Events bubbling up the document may have been marked as prevented
3525
// by a handler lower down the tree; reflect the correct value.
3526
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
3527
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
3534
// Put explicitly provided properties onto the event object
3536
jQuery.extend( this, props );
3539
// Create a timestamp if incoming event doesn't have one
3540
this.timeStamp = src && src.timeStamp || jQuery.now();
3543
this[ jQuery.expando ] = true;
3546
function returnFalse() {
3549
function returnTrue() {
3553
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
3554
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
3555
jQuery.Event.prototype = {
3556
preventDefault: function() {
3557
this.isDefaultPrevented = returnTrue;
3559
var e = this.originalEvent;
3564
// if preventDefault exists run it on the original event
3565
if ( e.preventDefault ) {
3568
// otherwise set the returnValue property of the original event to false (IE)
3570
e.returnValue = false;
3573
stopPropagation: function() {
3574
this.isPropagationStopped = returnTrue;
3576
var e = this.originalEvent;
3580
// if stopPropagation exists run it on the original event
3581
if ( e.stopPropagation ) {
3582
e.stopPropagation();
3584
// otherwise set the cancelBubble property of the original event to true (IE)
3585
e.cancelBubble = true;
3587
stopImmediatePropagation: function() {
3588
this.isImmediatePropagationStopped = returnTrue;
3589
this.stopPropagation();
3591
isDefaultPrevented: returnFalse,
3592
isPropagationStopped: returnFalse,
3593
isImmediatePropagationStopped: returnFalse
3596
// Create mouseenter/leave events using mouseover/out and event-time checks
3598
mouseenter: "mouseover",
3599
mouseleave: "mouseout"
3600
}, function( orig, fix ) {
3601
jQuery.event.special[ orig ] = {
3605
handle: function( event ) {
3607
related = event.relatedTarget,
3608
handleObj = event.handleObj,
3609
selector = handleObj.selector,
3612
// For mousenter/leave call the handler if related is outside the target.
3613
// NB: No relatedTarget if the mouse left/entered the browser window
3614
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
3615
event.type = handleObj.origType;
3616
ret = handleObj.handler.apply( this, arguments );
3624
// IE submit delegation
3625
if ( !jQuery.support.submitBubbles ) {
3627
jQuery.event.special.submit = {
3629
// Only need this for delegated form submit events
3630
if ( jQuery.nodeName( this, "form" ) ) {
3634
// Lazy-add a submit handler when a descendant form may potentially be submitted
3635
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
3636
// Node name check avoids a VML-related crash in IE (#9807)
3637
var elem = e.target,
3638
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
3639
if ( form && !form._submit_attached ) {
3640
jQuery.event.add( form, "submit._submit", function( event ) {
3641
event._submit_bubble = true;
3643
form._submit_attached = true;
3646
// return undefined since we don't need an event listener
3649
postDispatch: function( event ) {
3650
// If form was submitted by the user, bubble the event up the tree
3651
if ( event._submit_bubble ) {
3652
delete event._submit_bubble;
3653
if ( this.parentNode && !event.isTrigger ) {
3654
jQuery.event.simulate( "submit", this.parentNode, event, true );
3659
teardown: function() {
3660
// Only need this for delegated form submit events
3661
if ( jQuery.nodeName( this, "form" ) ) {
3665
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
3666
jQuery.event.remove( this, "._submit" );
3671
// IE change delegation and checkbox/radio fix
3672
if ( !jQuery.support.changeBubbles ) {
3674
jQuery.event.special.change = {
3678
if ( rformElems.test( this.nodeName ) ) {
3679
// IE doesn't fire change on a check/radio until blur; trigger it on click
3680
// after a propertychange. Eat the blur-change in special.change.handle.
3681
// This still fires onchange a second time for check/radio after blur.
3682
if ( this.type === "checkbox" || this.type === "radio" ) {
3683
jQuery.event.add( this, "propertychange._change", function( event ) {
3684
if ( event.originalEvent.propertyName === "checked" ) {
3685
this._just_changed = true;
3688
jQuery.event.add( this, "click._change", function( event ) {
3689
if ( this._just_changed && !event.isTrigger ) {
3690
this._just_changed = false;
3691
jQuery.event.simulate( "change", this, event, true );
3697
// Delegated event; lazy-add a change handler on descendant inputs
3698
jQuery.event.add( this, "beforeactivate._change", function( e ) {
3699
var elem = e.target;
3701
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
3702
jQuery.event.add( elem, "change._change", function( event ) {
3703
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
3704
jQuery.event.simulate( "change", this.parentNode, event, true );
3707
elem._change_attached = true;
3712
handle: function( event ) {
3713
var elem = event.target;
3715
// Swallow native change events from checkbox/radio, we already triggered them above
3716
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
3717
return event.handleObj.handler.apply( this, arguments );
3721
teardown: function() {
3722
jQuery.event.remove( this, "._change" );
3724
return rformElems.test( this.nodeName );
3729
// Create "bubbling" focus and blur events
3730
if ( !jQuery.support.focusinBubbles ) {
3731
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3733
// Attach a single capturing handler while someone wants focusin/focusout
3735
handler = function( event ) {
3736
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
3739
jQuery.event.special[ fix ] = {
3741
if ( attaches++ === 0 ) {
3742
document.addEventListener( orig, handler, true );
3745
teardown: function() {
3746
if ( --attaches === 0 ) {
3747
document.removeEventListener( orig, handler, true );
3756
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
3759
// Types can be a map of types/handlers
3760
if ( typeof types === "object" ) {
3761
// ( types-Object, selector, data )
3762
if ( typeof selector !== "string" ) { // && selector != null
3763
// ( types-Object, data )
3764
data = data || selector;
3765
selector = undefined;
3767
for ( type in types ) {
3768
this.on( type, selector, data, types[ type ], one );
3773
if ( data == null && fn == null ) {
3776
data = selector = undefined;
3777
} else if ( fn == null ) {
3778
if ( typeof selector === "string" ) {
3779
// ( types, selector, fn )
3783
// ( types, data, fn )
3786
selector = undefined;
3789
if ( fn === false ) {
3797
fn = function( event ) {
3798
// Can use an empty set, since event contains the info
3799
jQuery().off( event );
3800
return origFn.apply( this, arguments );
3802
// Use same guid so caller can remove using origFn
3803
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3805
return this.each( function() {
3806
jQuery.event.add( this, types, fn, data, selector );
3809
one: function( types, selector, data, fn ) {
3810
return this.on( types, selector, data, fn, 1 );
3812
off: function( types, selector, fn ) {
3813
if ( types && types.preventDefault && types.handleObj ) {
3814
// ( event ) dispatched jQuery.Event
3815
var handleObj = types.handleObj;
3816
jQuery( types.delegateTarget ).off(
3817
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3823
if ( typeof types === "object" ) {
3824
// ( types-object [, selector] )
3825
for ( var type in types ) {
3826
this.off( type, selector, types[ type ] );
3830
if ( selector === false || typeof selector === "function" ) {
3833
selector = undefined;
3835
if ( fn === false ) {
3838
return this.each(function() {
3839
jQuery.event.remove( this, types, fn, selector );
3843
bind: function( types, data, fn ) {
3844
return this.on( types, null, data, fn );
3846
unbind: function( types, fn ) {
3847
return this.off( types, null, fn );
3850
live: function( types, data, fn ) {
3851
jQuery( this.context ).on( types, this.selector, data, fn );
3854
die: function( types, fn ) {
3855
jQuery( this.context ).off( types, this.selector || "**", fn );
3859
delegate: function( selector, types, data, fn ) {
3860
return this.on( types, selector, data, fn );
3862
undelegate: function( selector, types, fn ) {
3863
// ( namespace ) or ( selector, types [, fn] )
3864
return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
3867
trigger: function( type, data ) {
3868
return this.each(function() {
3869
jQuery.event.trigger( type, data, this );
3872
triggerHandler: function( type, data ) {
3874
return jQuery.event.trigger( type, data, this[0], true );
3878
toggle: function( fn ) {
3879
// Save reference to arguments for access in closure
3880
var args = arguments,
3881
guid = fn.guid || jQuery.guid++,
3883
toggler = function( event ) {
3884
// Figure out which function to execute
3885
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
3886
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
3888
// Make sure that clicks stop
3889
event.preventDefault();
3891
// and execute the function
3892
return args[ lastToggle ].apply( this, arguments ) || false;
3895
// link all the functions, so any of them can unbind this click handler
3896
toggler.guid = guid;
3897
while ( i < args.length ) {
3898
args[ i++ ].guid = guid;
3901
return this.click( toggler );
3904
hover: function( fnOver, fnOut ) {
3905
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
3909
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
3910
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
3911
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
3913
// Handle event binding
3914
jQuery.fn[ name ] = function( data, fn ) {
3920
return arguments.length > 0 ?
3921
this.on( name, null, data, fn ) :
3922
this.trigger( name );
3925
if ( jQuery.attrFn ) {
3926
jQuery.attrFn[ name ] = true;
3929
if ( rkeyEvent.test( name ) ) {
3930
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
3933
if ( rmouseEvent.test( name ) ) {
3934
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
3941
* Sizzle CSS Selector Engine
3942
* Copyright 2011, The Dojo Foundation
3943
* Released under the MIT, BSD, and GPL Licenses.
3944
* More information: http://sizzlejs.com/
3948
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
3949
expando = "sizcache" + (Math.random() + '').replace('.', ''),
3951
toString = Object.prototype.toString,
3952
hasDuplicate = false,
3953
baseHasDuplicate = true,
3958
// Here we check if the JavaScript engine is using some sort of
3959
// optimization where it does not always call our comparision
3960
// function. If that is the case, discard the hasDuplicate value.
3961
// Thus far that includes Google Chrome.
3962
[0, 0].sort(function() {
3963
baseHasDuplicate = false;
3967
var Sizzle = function( selector, context, results, seed ) {
3968
results = results || [];
3969
context = context || document;
3971
var origContext = context;
3973
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
3977
if ( !selector || typeof selector !== "string" ) {
3981
var m, set, checkSet, extra, ret, cur, pop, i,
3983
contextXML = Sizzle.isXML( context ),
3987
// Reset the position of the chunker regexp (start from head)
3990
m = chunker.exec( soFar );
4004
if ( parts.length > 1 && origPOS.exec( selector ) ) {
4006
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
4007
set = posProcess( parts[0] + parts[1], context, seed );
4010
set = Expr.relative[ parts[0] ] ?
4012
Sizzle( parts.shift(), context );
4014
while ( parts.length ) {
4015
selector = parts.shift();
4017
if ( Expr.relative[ selector ] ) {
4018
selector += parts.shift();
4021
set = posProcess( selector, set, seed );
4026
// Take a shortcut and set the context if the root selector is an ID
4027
// (but not if it'll be faster if the inner selector is an ID)
4028
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
4029
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
4031
ret = Sizzle.find( parts.shift(), context, contextXML );
4032
context = ret.expr ?
4033
Sizzle.filter( ret.expr, ret.set )[0] :
4039
{ expr: parts.pop(), set: makeArray(seed) } :
4040
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
4043
Sizzle.filter( ret.expr, ret.set ) :
4046
if ( parts.length > 0 ) {
4047
checkSet = makeArray( set );
4053
while ( parts.length ) {
4057
if ( !Expr.relative[ cur ] ) {
4063
if ( pop == null ) {
4067
Expr.relative[ cur ]( checkSet, pop, contextXML );
4071
checkSet = parts = [];
4080
Sizzle.error( cur || selector );
4083
if ( toString.call(checkSet) === "[object Array]" ) {
4085
results.push.apply( results, checkSet );
4087
} else if ( context && context.nodeType === 1 ) {
4088
for ( i = 0; checkSet[i] != null; i++ ) {
4089
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
4090
results.push( set[i] );
4095
for ( i = 0; checkSet[i] != null; i++ ) {
4096
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
4097
results.push( set[i] );
4103
makeArray( checkSet, results );
4107
Sizzle( extra, origContext, results, seed );
4108
Sizzle.uniqueSort( results );
4114
Sizzle.uniqueSort = function( results ) {
4116
hasDuplicate = baseHasDuplicate;
4117
results.sort( sortOrder );
4119
if ( hasDuplicate ) {
4120
for ( var i = 1; i < results.length; i++ ) {
4121
if ( results[i] === results[ i - 1 ] ) {
4122
results.splice( i--, 1 );
4131
Sizzle.matches = function( expr, set ) {
4132
return Sizzle( expr, null, null, set );
4135
Sizzle.matchesSelector = function( node, expr ) {
4136
return Sizzle( expr, null, null, [node] ).length > 0;
4139
Sizzle.find = function( expr, context, isXML ) {
4140
var set, i, len, match, type, left;
4146
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
4147
type = Expr.order[i];
4149
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
4151
match.splice( 1, 1 );
4153
if ( left.substr( left.length - 1 ) !== "\\" ) {
4154
match[1] = (match[1] || "").replace( rBackslash, "" );
4155
set = Expr.find[ type ]( match, context, isXML );
4157
if ( set != null ) {
4158
expr = expr.replace( Expr.match[ type ], "" );
4166
set = typeof context.getElementsByTagName !== "undefined" ?
4167
context.getElementsByTagName( "*" ) :
4171
return { set: set, expr: expr };
4174
Sizzle.filter = function( expr, set, inplace, not ) {
4175
var match, anyFound,
4176
type, found, item, filter, left,
4181
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
4183
while ( expr && set.length ) {
4184
for ( type in Expr.filter ) {
4185
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
4186
filter = Expr.filter[ type ];
4193
if ( left.substr( left.length - 1 ) === "\\" ) {
4197
if ( curLoop === result ) {
4201
if ( Expr.preFilter[ type ] ) {
4202
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
4205
anyFound = found = true;
4207
} else if ( match === true ) {
4213
for ( i = 0; (item = curLoop[i]) != null; i++ ) {
4215
found = filter( item, match, i, curLoop );
4218
if ( inplace && found != null ) {
4226
} else if ( pass ) {
4227
result.push( item );
4234
if ( found !== undefined ) {
4239
expr = expr.replace( Expr.match[ type ], "" );
4250
// Improper expression
4251
if ( expr === old ) {
4252
if ( anyFound == null ) {
4253
Sizzle.error( expr );
4266
Sizzle.error = function( msg ) {
4267
throw new Error( "Syntax error, unrecognized expression: " + msg );
4271
* Utility function for retreiving the text value of an array of DOM nodes
4272
* @param {Array|Element} elem
4274
var getText = Sizzle.getText = function( elem ) {
4276
nodeType = elem.nodeType,
4280
if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4281
// Use textContent || innerText for elements
4282
if ( typeof elem.textContent === 'string' ) {
4283
return elem.textContent;
4284
} else if ( typeof elem.innerText === 'string' ) {
4285
// Replace IE's carriage returns
4286
return elem.innerText.replace( rReturn, '' );
4288
// Traverse it's children
4289
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
4290
ret += getText( elem );
4293
} else if ( nodeType === 3 || nodeType === 4 ) {
4294
return elem.nodeValue;
4298
// If no nodeType, this is expected to be an array
4299
for ( i = 0; (node = elem[i]); i++ ) {
4300
// Do not traverse comment nodes
4301
if ( node.nodeType !== 8 ) {
4302
ret += getText( node );
4309
var Expr = Sizzle.selectors = {
4310
order: [ "ID", "NAME", "TAG" ],
4313
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4314
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
4315
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
4316
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
4317
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
4318
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
4319
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
4320
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
4326
"class": "className",
4331
href: function( elem ) {
4332
return elem.getAttribute( "href" );
4334
type: function( elem ) {
4335
return elem.getAttribute( "type" );
4340
"+": function(checkSet, part){
4341
var isPartStr = typeof part === "string",
4342
isTag = isPartStr && !rNonWord.test( part ),
4343
isPartStrNotTag = isPartStr && !isTag;
4346
part = part.toLowerCase();
4349
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
4350
if ( (elem = checkSet[i]) ) {
4351
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
4353
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
4359
if ( isPartStrNotTag ) {
4360
Sizzle.filter( part, checkSet, true );
4364
">": function( checkSet, part ) {
4366
isPartStr = typeof part === "string",
4368
l = checkSet.length;
4370
if ( isPartStr && !rNonWord.test( part ) ) {
4371
part = part.toLowerCase();
4373
for ( ; i < l; i++ ) {
4377
var parent = elem.parentNode;
4378
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
4383
for ( ; i < l; i++ ) {
4387
checkSet[i] = isPartStr ?
4389
elem.parentNode === part;
4394
Sizzle.filter( part, checkSet, true );
4399
"": function(checkSet, part, isXML){
4404
if ( typeof part === "string" && !rNonWord.test( part ) ) {
4405
part = part.toLowerCase();
4407
checkFn = dirNodeCheck;
4410
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
4413
"~": function( checkSet, part, isXML ) {
4418
if ( typeof part === "string" && !rNonWord.test( part ) ) {
4419
part = part.toLowerCase();
4421
checkFn = dirNodeCheck;
4424
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
4429
ID: function( match, context, isXML ) {
4430
if ( typeof context.getElementById !== "undefined" && !isXML ) {
4431
var m = context.getElementById(match[1]);
4432
// Check parentNode to catch when Blackberry 4.6 returns
4433
// nodes that are no longer in the document #6963
4434
return m && m.parentNode ? [m] : [];
4438
NAME: function( match, context ) {
4439
if ( typeof context.getElementsByName !== "undefined" ) {
4441
results = context.getElementsByName( match[1] );
4443
for ( var i = 0, l = results.length; i < l; i++ ) {
4444
if ( results[i].getAttribute("name") === match[1] ) {
4445
ret.push( results[i] );
4449
return ret.length === 0 ? null : ret;
4453
TAG: function( match, context ) {
4454
if ( typeof context.getElementsByTagName !== "undefined" ) {
4455
return context.getElementsByTagName( match[1] );
4460
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
4461
match = " " + match[1].replace( rBackslash, "" ) + " ";
4467
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
4469
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
4471
result.push( elem );
4474
} else if ( inplace ) {
4483
ID: function( match ) {
4484
return match[1].replace( rBackslash, "" );
4487
TAG: function( match, curLoop ) {
4488
return match[1].replace( rBackslash, "" ).toLowerCase();
4491
CHILD: function( match ) {
4492
if ( match[1] === "nth" ) {
4494
Sizzle.error( match[0] );
4497
match[2] = match[2].replace(/^\+|\s*/g, '');
4499
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
4500
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
4501
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
4502
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
4504
// calculate the numbers (first)n+(last) including if they are negative
4505
match[2] = (test[1] + (test[2] || 1)) - 0;
4506
match[3] = test[3] - 0;
4508
else if ( match[2] ) {
4509
Sizzle.error( match[0] );
4512
// TODO: Move to normal caching system
4518
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
4519
var name = match[1] = match[1].replace( rBackslash, "" );
4521
if ( !isXML && Expr.attrMap[name] ) {
4522
match[1] = Expr.attrMap[name];
4525
// Handle if an un-quoted value was used
4526
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
4528
if ( match[2] === "~=" ) {
4529
match[4] = " " + match[4] + " ";
4535
PSEUDO: function( match, curLoop, inplace, result, not ) {
4536
if ( match[1] === "not" ) {
4537
// If we're dealing with a complex expression, or a simple one
4538
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
4539
match[3] = Sizzle(match[3], null, null, curLoop);
4542
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
4545
result.push.apply( result, ret );
4551
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
4558
POS: function( match ) {
4559
match.unshift( true );
4566
enabled: function( elem ) {
4567
return elem.disabled === false && elem.type !== "hidden";
4570
disabled: function( elem ) {
4571
return elem.disabled === true;
4574
checked: function( elem ) {
4575
return elem.checked === true;
4578
selected: function( elem ) {
4579
// Accessing this property makes selected-by-default
4580
// options in Safari work properly
4581
if ( elem.parentNode ) {
4582
elem.parentNode.selectedIndex;
4585
return elem.selected === true;
4588
parent: function( elem ) {
4589
return !!elem.firstChild;
4592
empty: function( elem ) {
4593
return !elem.firstChild;
4596
has: function( elem, i, match ) {
4597
return !!Sizzle( match[3], elem ).length;
4600
header: function( elem ) {
4601
return (/h\d/i).test( elem.nodeName );
4604
text: function( elem ) {
4605
var attr = elem.getAttribute( "type" ), type = elem.type;
4606
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4607
// use getAttribute instead to test this case
4608
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
4611
radio: function( elem ) {
4612
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
4615
checkbox: function( elem ) {
4616
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
4619
file: function( elem ) {
4620
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
4623
password: function( elem ) {
4624
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
4627
submit: function( elem ) {
4628
var name = elem.nodeName.toLowerCase();
4629
return (name === "input" || name === "button") && "submit" === elem.type;
4632
image: function( elem ) {
4633
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
4636
reset: function( elem ) {
4637
var name = elem.nodeName.toLowerCase();
4638
return (name === "input" || name === "button") && "reset" === elem.type;
4641
button: function( elem ) {
4642
var name = elem.nodeName.toLowerCase();
4643
return name === "input" && "button" === elem.type || name === "button";
4646
input: function( elem ) {
4647
return (/input|select|textarea|button/i).test( elem.nodeName );
4650
focus: function( elem ) {
4651
return elem === elem.ownerDocument.activeElement;
4655
first: function( elem, i ) {
4659
last: function( elem, i, match, array ) {
4660
return i === array.length - 1;
4663
even: function( elem, i ) {
4667
odd: function( elem, i ) {
4671
lt: function( elem, i, match ) {
4672
return i < match[3] - 0;
4675
gt: function( elem, i, match ) {
4676
return i > match[3] - 0;
4679
nth: function( elem, i, match ) {
4680
return match[3] - 0 === i;
4683
eq: function( elem, i, match ) {
4684
return match[3] - 0 === i;
4688
PSEUDO: function( elem, match, i, array ) {
4689
var name = match[1],
4690
filter = Expr.filters[ name ];
4693
return filter( elem, i, match, array );
4695
} else if ( name === "contains" ) {
4696
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
4698
} else if ( name === "not" ) {
4701
for ( var j = 0, l = not.length; j < l; j++ ) {
4702
if ( not[j] === elem ) {
4710
Sizzle.error( name );
4714
CHILD: function( elem, match ) {
4716
doneName, parent, cache,
4724
while ( (node = node.previousSibling) ) {
4725
if ( node.nodeType === 1 ) {
4730
if ( type === "first" ) {
4738
while ( (node = node.nextSibling) ) {
4739
if ( node.nodeType === 1 ) {
4750
if ( first === 1 && last === 0 ) {
4754
doneName = match[0];
4755
parent = elem.parentNode;
4757
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
4760
for ( node = parent.firstChild; node; node = node.nextSibling ) {
4761
if ( node.nodeType === 1 ) {
4762
node.nodeIndex = ++count;
4766
parent[ expando ] = doneName;
4769
diff = elem.nodeIndex - last;
4771
if ( first === 0 ) {
4775
return ( diff % first === 0 && diff / first >= 0 );
4780
ID: function( elem, match ) {
4781
return elem.nodeType === 1 && elem.getAttribute("id") === match;
4784
TAG: function( elem, match ) {
4785
return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
4788
CLASS: function( elem, match ) {
4789
return (" " + (elem.className || elem.getAttribute("class")) + " ")
4790
.indexOf( match ) > -1;
4793
ATTR: function( elem, match ) {
4794
var name = match[1],
4795
result = Sizzle.attr ?
4796
Sizzle.attr( elem, name ) :
4797
Expr.attrHandle[ name ] ?
4798
Expr.attrHandle[ name ]( elem ) :
4799
elem[ name ] != null ?
4801
elem.getAttribute( name ),
4802
value = result + "",
4806
return result == null ?
4808
!type && Sizzle.attr ?
4813
value.indexOf(check) >= 0 :
4815
(" " + value + " ").indexOf(check) >= 0 :
4817
value && result !== false :
4821
value.indexOf(check) === 0 :
4823
value.substr(value.length - check.length) === check :
4825
value === check || value.substr(0, check.length + 1) === check + "-" :
4829
POS: function( elem, match, i, array ) {
4830
var name = match[2],
4831
filter = Expr.setFilters[ name ];
4834
return filter( elem, i, match, array );
4840
var origPOS = Expr.match.POS,
4841
fescape = function(all, num){
4842
return "\\" + (num - 0 + 1);
4845
for ( var type in Expr.match ) {
4846
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
4847
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
4850
// "global" as in regardless of relation to brackets/parens
4851
Expr.match.globalPOS = origPOS;
4853
var makeArray = function( array, results ) {
4854
array = Array.prototype.slice.call( array, 0 );
4857
results.push.apply( results, array );
4864
// Perform a simple check to determine if the browser is capable of
4865
// converting a NodeList to an array using builtin methods.
4866
// Also verifies that the returned array holds DOM nodes
4867
// (which is not the case in the Blackberry browser)
4869
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
4871
// Provide a fallback method if it does not work
4873
makeArray = function( array, results ) {
4875
ret = results || [];
4877
if ( toString.call(array) === "[object Array]" ) {
4878
Array.prototype.push.apply( ret, array );
4881
if ( typeof array.length === "number" ) {
4882
for ( var l = array.length; i < l; i++ ) {
4883
ret.push( array[i] );
4887
for ( ; array[i]; i++ ) {
4888
ret.push( array[i] );
4897
var sortOrder, siblingCheck;
4899
if ( document.documentElement.compareDocumentPosition ) {
4900
sortOrder = function( a, b ) {
4902
hasDuplicate = true;
4906
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
4907
return a.compareDocumentPosition ? -1 : 1;
4910
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
4914
sortOrder = function( a, b ) {
4915
// The nodes are identical, we can exit early
4917
hasDuplicate = true;
4920
// Fallback to using sourceIndex (in IE) if it's available on both nodes
4921
} else if ( a.sourceIndex && b.sourceIndex ) {
4922
return a.sourceIndex - b.sourceIndex;
4932
// If the nodes are siblings (or identical) we can do a quick check
4933
if ( aup === bup ) {
4934
return siblingCheck( a, b );
4936
// If no parents were found then the nodes are disconnected
4937
} else if ( !aup ) {
4940
} else if ( !bup ) {
4944
// Otherwise they're somewhere else in the tree so we need
4945
// to build up a full list of the parentNodes for comparison
4948
cur = cur.parentNode;
4955
cur = cur.parentNode;
4961
// Start walking down the tree looking for a discrepancy
4962
for ( var i = 0; i < al && i < bl; i++ ) {
4963
if ( ap[i] !== bp[i] ) {
4964
return siblingCheck( ap[i], bp[i] );
4968
// We ended someplace up the tree so do a sibling check
4970
siblingCheck( a, bp[i], -1 ) :
4971
siblingCheck( ap[i], b, 1 );
4974
siblingCheck = function( a, b, ret ) {
4979
var cur = a.nextSibling;
4986
cur = cur.nextSibling;
4993
// Check to see if the browser returns elements by name when
4994
// querying by getElementById (and provide a workaround)
4996
// We're going to inject a fake input element with a specified name
4997
var form = document.createElement("div"),
4998
id = "script" + (new Date()).getTime(),
4999
root = document.documentElement;
5001
form.innerHTML = "<a name='" + id + "'/>";
5003
// Inject it into the root element, check its status, and remove it quickly
5004
root.insertBefore( form, root.firstChild );
5006
// The workaround has to do additional checks after a getElementById
5007
// Which slows things down for other browsers (hence the branching)
5008
if ( document.getElementById( id ) ) {
5009
Expr.find.ID = function( match, context, isXML ) {
5010
if ( typeof context.getElementById !== "undefined" && !isXML ) {
5011
var m = context.getElementById(match[1]);
5014
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
5021
Expr.filter.ID = function( elem, match ) {
5022
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
5024
return elem.nodeType === 1 && node && node.nodeValue === match;
5028
root.removeChild( form );
5030
// release memory in IE
5035
// Check to see if the browser returns only elements
5036
// when doing getElementsByTagName("*")
5038
// Create a fake element
5039
var div = document.createElement("div");
5040
div.appendChild( document.createComment("") );
5042
// Make sure no comments are found
5043
if ( div.getElementsByTagName("*").length > 0 ) {
5044
Expr.find.TAG = function( match, context ) {
5045
var results = context.getElementsByTagName( match[1] );
5047
// Filter out possible comments
5048
if ( match[1] === "*" ) {
5051
for ( var i = 0; results[i]; i++ ) {
5052
if ( results[i].nodeType === 1 ) {
5053
tmp.push( results[i] );
5064
// Check to see if an attribute returns normalized href attributes
5065
div.innerHTML = "<a href='#'></a>";
5067
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
5068
div.firstChild.getAttribute("href") !== "#" ) {
5070
Expr.attrHandle.href = function( elem ) {
5071
return elem.getAttribute( "href", 2 );
5075
// release memory in IE
5079
if ( document.querySelectorAll ) {
5081
var oldSizzle = Sizzle,
5082
div = document.createElement("div"),
5085
div.innerHTML = "<p class='TEST'></p>";
5087
// Safari can't handle uppercase or unicode characters when
5089
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
5093
Sizzle = function( query, context, extra, seed ) {
5094
context = context || document;
5096
// Only use querySelectorAll on non-XML documents
5097
// (ID selectors don't work in non-HTML documents)
5098
if ( !seed && !Sizzle.isXML(context) ) {
5099
// See if we find a selector to speed up
5100
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
5102
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
5103
// Speed-up: Sizzle("TAG")
5105
return makeArray( context.getElementsByTagName( query ), extra );
5107
// Speed-up: Sizzle(".CLASS")
5108
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
5109
return makeArray( context.getElementsByClassName( match[2] ), extra );
5113
if ( context.nodeType === 9 ) {
5114
// Speed-up: Sizzle("body")
5115
// The body element only exists once, optimize finding it
5116
if ( query === "body" && context.body ) {
5117
return makeArray( [ context.body ], extra );
5119
// Speed-up: Sizzle("#ID")
5120
} else if ( match && match[3] ) {
5121
var elem = context.getElementById( match[3] );
5123
// Check parentNode to catch when Blackberry 4.6 returns
5124
// nodes that are no longer in the document #6963
5125
if ( elem && elem.parentNode ) {
5126
// Handle the case where IE and Opera return items
5127
// by name instead of ID
5128
if ( elem.id === match[3] ) {
5129
return makeArray( [ elem ], extra );
5133
return makeArray( [], extra );
5138
return makeArray( context.querySelectorAll(query), extra );
5139
} catch(qsaError) {}
5141
// qSA works strangely on Element-rooted queries
5142
// We can work around this by specifying an extra ID on the root
5143
// and working up from there (Thanks to Andrew Dupont for the technique)
5144
// IE 8 doesn't work on object elements
5145
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
5146
var oldContext = context,
5147
old = context.getAttribute( "id" ),
5149
hasParent = context.parentNode,
5150
relativeHierarchySelector = /^\s*[+~]/.test( query );
5153
context.setAttribute( "id", nid );
5155
nid = nid.replace( /'/g, "\\$&" );
5157
if ( relativeHierarchySelector && hasParent ) {
5158
context = context.parentNode;
5162
if ( !relativeHierarchySelector || hasParent ) {
5163
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
5166
} catch(pseudoError) {
5169
oldContext.removeAttribute( "id" );
5175
return oldSizzle(query, context, extra, seed);
5178
for ( var prop in oldSizzle ) {
5179
Sizzle[ prop ] = oldSizzle[ prop ];
5182
// release memory in IE
5188
var html = document.documentElement,
5189
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
5192
// Check to see if it's possible to do matchesSelector
5193
// on a disconnected node (IE 9 fails this)
5194
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
5195
pseudoWorks = false;
5198
// This should fail with an exception
5199
// Gecko does not error, returns false instead
5200
matches.call( document.documentElement, "[test!='']:sizzle" );
5202
} catch( pseudoError ) {
5206
Sizzle.matchesSelector = function( node, expr ) {
5207
// Make sure that attribute selectors are quoted
5208
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
5210
if ( !Sizzle.isXML( node ) ) {
5212
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
5213
var ret = matches.call( node, expr );
5215
// IE 9's matchesSelector returns false on disconnected nodes
5216
if ( ret || !disconnectedMatch ||
5217
// As well, disconnected nodes are said to be in a document
5218
// fragment in IE 9, so check for that
5219
node.document && node.document.nodeType !== 11 ) {
5226
return Sizzle(expr, null, null, [node]).length > 0;
5232
var div = document.createElement("div");
5234
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
5236
// Opera can't find a second classname (in 9.6)
5237
// Also, make sure that getElementsByClassName actually exists
5238
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
5242
// Safari caches class attributes, doesn't catch changes (in 3.2)
5243
div.lastChild.className = "e";
5245
if ( div.getElementsByClassName("e").length === 1 ) {
5249
Expr.order.splice(1, 0, "CLASS");
5250
Expr.find.CLASS = function( match, context, isXML ) {
5251
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
5252
return context.getElementsByClassName(match[1]);
5256
// release memory in IE
5260
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
5261
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
5262
var elem = checkSet[i];
5270
if ( elem[ expando ] === doneName ) {
5271
match = checkSet[elem.sizset];
5275
if ( elem.nodeType === 1 && !isXML ){
5276
elem[ expando ] = doneName;
5280
if ( elem.nodeName.toLowerCase() === cur ) {
5288
checkSet[i] = match;
5293
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
5294
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
5295
var elem = checkSet[i];
5303
if ( elem[ expando ] === doneName ) {
5304
match = checkSet[elem.sizset];
5308
if ( elem.nodeType === 1 ) {
5310
elem[ expando ] = doneName;
5314
if ( typeof cur !== "string" ) {
5315
if ( elem === cur ) {
5320
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
5329
checkSet[i] = match;
5334
if ( document.documentElement.contains ) {
5335
Sizzle.contains = function( a, b ) {
5336
return a !== b && (a.contains ? a.contains(b) : true);
5339
} else if ( document.documentElement.compareDocumentPosition ) {
5340
Sizzle.contains = function( a, b ) {
5341
return !!(a.compareDocumentPosition(b) & 16);
5345
Sizzle.contains = function() {
5350
Sizzle.isXML = function( elem ) {
5351
// documentElement is verified for cases where it doesn't yet exist
5352
// (such as loading iframes in IE - #4833)
5353
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
5355
return documentElement ? documentElement.nodeName !== "HTML" : false;
5358
var posProcess = function( selector, context, seed ) {
5362
root = context.nodeType ? [context] : context;
5364
// Position selectors must be done after the filter
5365
// And so must :not(positional) so we move all PSEUDOs to the end
5366
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
5368
selector = selector.replace( Expr.match.PSEUDO, "" );
5371
selector = Expr.relative[selector] ? selector + "*" : selector;
5373
for ( var i = 0, l = root.length; i < l; i++ ) {
5374
Sizzle( selector, root[i], tmpSet, seed );
5377
return Sizzle.filter( later, tmpSet );
5381
// Override sizzle attribute retrieval
5382
Sizzle.attr = jQuery.attr;
5383
Sizzle.selectors.attrMap = {};
5384
jQuery.find = Sizzle;
5385
jQuery.expr = Sizzle.selectors;
5386
jQuery.expr[":"] = jQuery.expr.filters;
5387
jQuery.unique = Sizzle.uniqueSort;
5388
jQuery.text = Sizzle.getText;
5389
jQuery.isXMLDoc = Sizzle.isXML;
5390
jQuery.contains = Sizzle.contains;
5396
var runtil = /Until$/,
5397
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
5398
// Note: This RegExp should be improved, or likely pulled from Sizzle
5399
rmultiselector = /,/,
5400
isSimple = /^.[^:#\[\.,]*$/,
5401
slice = Array.prototype.slice,
5402
POS = jQuery.expr.match.globalPOS,
5403
// methods guaranteed to produce a unique set when starting from a unique set
5404
guaranteedUnique = {
5412
find: function( selector ) {
5416
if ( typeof selector !== "string" ) {
5417
return jQuery( selector ).filter(function() {
5418
for ( i = 0, l = self.length; i < l; i++ ) {
5419
if ( jQuery.contains( self[ i ], this ) ) {
5426
var ret = this.pushStack( "", "find", selector ),
5429
for ( i = 0, l = this.length; i < l; i++ ) {
5430
length = ret.length;
5431
jQuery.find( selector, this[i], ret );
5434
// Make sure that the results are unique
5435
for ( n = length; n < ret.length; n++ ) {
5436
for ( r = 0; r < length; r++ ) {
5437
if ( ret[r] === ret[n] ) {
5449
has: function( target ) {
5450
var targets = jQuery( target );
5451
return this.filter(function() {
5452
for ( var i = 0, l = targets.length; i < l; i++ ) {
5453
if ( jQuery.contains( this, targets[i] ) ) {
5460
not: function( selector ) {
5461
return this.pushStack( winnow(this, selector, false), "not", selector);
5464
filter: function( selector ) {
5465
return this.pushStack( winnow(this, selector, true), "filter", selector );
5468
is: function( selector ) {
5469
return !!selector && (
5470
typeof selector === "string" ?
5471
// If this is a positional selector, check membership in the returned set
5472
// so $("p:first").is("p:last") won't return true for a doc with two "p".
5473
POS.test( selector ) ?
5474
jQuery( selector, this.context ).index( this[0] ) >= 0 :
5475
jQuery.filter( selector, this ).length > 0 :
5476
this.filter( selector ).length > 0 );
5479
closest: function( selectors, context ) {
5480
var ret = [], i, l, cur = this[0];
5482
// Array (deprecated as of jQuery 1.7)
5483
if ( jQuery.isArray( selectors ) ) {
5486
while ( cur && cur.ownerDocument && cur !== context ) {
5487
for ( i = 0; i < selectors.length; i++ ) {
5489
if ( jQuery( cur ).is( selectors[ i ] ) ) {
5490
ret.push({ selector: selectors[ i ], elem: cur, level: level });
5494
cur = cur.parentNode;
5502
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
5503
jQuery( selectors, context || this.context ) :
5506
for ( i = 0, l = this.length; i < l; i++ ) {
5510
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
5515
cur = cur.parentNode;
5516
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
5523
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
5525
return this.pushStack( ret, "closest", selectors );
5528
// Determine the position of an element within
5529
// the matched set of elements
5530
index: function( elem ) {
5532
// No argument, return index in parent
5534
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
5537
// index in selector
5538
if ( typeof elem === "string" ) {
5539
return jQuery.inArray( this[0], jQuery( elem ) );
5542
// Locate the position of the desired element
5543
return jQuery.inArray(
5544
// If it receives a jQuery object, the first element is used
5545
elem.jquery ? elem[0] : elem, this );
5548
add: function( selector, context ) {
5549
var set = typeof selector === "string" ?
5550
jQuery( selector, context ) :
5551
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5552
all = jQuery.merge( this.get(), set );
5554
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
5556
jQuery.unique( all ) );
5559
andSelf: function() {
5560
return this.add( this.prevObject );
5564
// A painfully simple check to see if an element is disconnected
5565
// from a document (should be improved, where feasible).
5566
function isDisconnected( node ) {
5567
return !node || !node.parentNode || node.parentNode.nodeType === 11;
5571
parent: function( elem ) {
5572
var parent = elem.parentNode;
5573
return parent && parent.nodeType !== 11 ? parent : null;
5575
parents: function( elem ) {
5576
return jQuery.dir( elem, "parentNode" );
5578
parentsUntil: function( elem, i, until ) {
5579
return jQuery.dir( elem, "parentNode", until );
5581
next: function( elem ) {
5582
return jQuery.nth( elem, 2, "nextSibling" );
5584
prev: function( elem ) {
5585
return jQuery.nth( elem, 2, "previousSibling" );
5587
nextAll: function( elem ) {
5588
return jQuery.dir( elem, "nextSibling" );
5590
prevAll: function( elem ) {
5591
return jQuery.dir( elem, "previousSibling" );
5593
nextUntil: function( elem, i, until ) {
5594
return jQuery.dir( elem, "nextSibling", until );
5596
prevUntil: function( elem, i, until ) {
5597
return jQuery.dir( elem, "previousSibling", until );
5599
siblings: function( elem ) {
5600
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5602
children: function( elem ) {
5603
return jQuery.sibling( elem.firstChild );
5605
contents: function( elem ) {
5606
return jQuery.nodeName( elem, "iframe" ) ?
5607
elem.contentDocument || elem.contentWindow.document :
5608
jQuery.makeArray( elem.childNodes );
5610
}, function( name, fn ) {
5611
jQuery.fn[ name ] = function( until, selector ) {
5612
var ret = jQuery.map( this, fn, until );
5614
if ( !runtil.test( name ) ) {
5618
if ( selector && typeof selector === "string" ) {
5619
ret = jQuery.filter( selector, ret );
5622
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
5624
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
5625
ret = ret.reverse();
5628
return this.pushStack( ret, name, slice.call( arguments ).join(",") );
5633
filter: function( expr, elems, not ) {
5635
expr = ":not(" + expr + ")";
5638
return elems.length === 1 ?
5639
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
5640
jQuery.find.matches(expr, elems);
5643
dir: function( elem, dir, until ) {
5647
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5648
if ( cur.nodeType === 1 ) {
5649
matched.push( cur );
5656
nth: function( cur, result, dir, elem ) {
5657
result = result || 1;
5660
for ( ; cur; cur = cur[dir] ) {
5661
if ( cur.nodeType === 1 && ++num === result ) {
5669
sibling: function( n, elem ) {
5672
for ( ; n; n = n.nextSibling ) {
5673
if ( n.nodeType === 1 && n !== elem ) {
5682
// Implement the identical functionality for filter and not
5683
function winnow( elements, qualifier, keep ) {
5685
// Can't pass null or undefined to indexOf in Firefox 4
5686
// Set to 0 to skip string check
5687
qualifier = qualifier || 0;
5689
if ( jQuery.isFunction( qualifier ) ) {
5690
return jQuery.grep(elements, function( elem, i ) {
5691
var retVal = !!qualifier.call( elem, i, elem );
5692
return retVal === keep;
5695
} else if ( qualifier.nodeType ) {
5696
return jQuery.grep(elements, function( elem, i ) {
5697
return ( elem === qualifier ) === keep;
5700
} else if ( typeof qualifier === "string" ) {
5701
var filtered = jQuery.grep(elements, function( elem ) {
5702
return elem.nodeType === 1;
5705
if ( isSimple.test( qualifier ) ) {
5706
return jQuery.filter(qualifier, filtered, !keep);
5708
qualifier = jQuery.filter( qualifier, filtered );
5712
return jQuery.grep(elements, function( elem, i ) {
5713
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
5720
function createSafeFragment( document ) {
5721
var list = nodeNames.split( "|" ),
5722
safeFrag = document.createDocumentFragment();
5724
if ( safeFrag.createElement ) {
5725
while ( list.length ) {
5726
safeFrag.createElement(
5734
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5735
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5736
rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
5737
rleadingWhitespace = /^\s+/,
5738
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
5739
rtagName = /<([\w:]+)/,
5741
rhtml = /<|&#?\w+;/,
5742
rnoInnerhtml = /<(?:script|style)/i,
5743
rnocache = /<(?:script|object|embed|option|style)/i,
5744
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5745
// checked="checked" or checked
5746
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5747
rscriptType = /\/(java|ecma)script/i,
5748
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
5750
option: [ 1, "<select multiple='multiple'>", "</select>" ],
5751
legend: [ 1, "<fieldset>", "</fieldset>" ],
5752
thead: [ 1, "<table>", "</table>" ],
5753
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5754
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5755
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5756
area: [ 1, "<map>", "</map>" ],
5757
_default: [ 0, "", "" ]
5759
safeFragment = createSafeFragment( document );
5761
wrapMap.optgroup = wrapMap.option;
5762
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5763
wrapMap.th = wrapMap.td;
5765
// IE can't serialize <link> and <script> tags normally
5766
if ( !jQuery.support.htmlSerialize ) {
5767
wrapMap._default = [ 1, "div<div>", "</div>" ];
5771
text: function( value ) {
5772
return jQuery.access( this, function( value ) {
5773
return value === undefined ?
5774
jQuery.text( this ) :
5775
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5776
}, null, value, arguments.length );
5779
wrapAll: function( html ) {
5780
if ( jQuery.isFunction( html ) ) {
5781
return this.each(function(i) {
5782
jQuery(this).wrapAll( html.call(this, i) );
5787
// The elements to wrap the target around
5788
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
5790
if ( this[0].parentNode ) {
5791
wrap.insertBefore( this[0] );
5794
wrap.map(function() {
5797
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
5798
elem = elem.firstChild;
5808
wrapInner: function( html ) {
5809
if ( jQuery.isFunction( html ) ) {
5810
return this.each(function(i) {
5811
jQuery(this).wrapInner( html.call(this, i) );
5815
return this.each(function() {
5816
var self = jQuery( this ),
5817
contents = self.contents();
5819
if ( contents.length ) {
5820
contents.wrapAll( html );
5823
self.append( html );
5828
wrap: function( html ) {
5829
var isFunction = jQuery.isFunction( html );
5831
return this.each(function(i) {
5832
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
5836
unwrap: function() {
5837
return this.parent().each(function() {
5838
if ( !jQuery.nodeName( this, "body" ) ) {
5839
jQuery( this ).replaceWith( this.childNodes );
5844
append: function() {
5845
return this.domManip(arguments, true, function( elem ) {
5846
if ( this.nodeType === 1 ) {
5847
this.appendChild( elem );
5852
prepend: function() {
5853
return this.domManip(arguments, true, function( elem ) {
5854
if ( this.nodeType === 1 ) {
5855
this.insertBefore( elem, this.firstChild );
5860
before: function() {
5861
if ( this[0] && this[0].parentNode ) {
5862
return this.domManip(arguments, false, function( elem ) {
5863
this.parentNode.insertBefore( elem, this );
5865
} else if ( arguments.length ) {
5866
var set = jQuery.clean( arguments );
5867
set.push.apply( set, this.toArray() );
5868
return this.pushStack( set, "before", arguments );
5873
if ( this[0] && this[0].parentNode ) {
5874
return this.domManip(arguments, false, function( elem ) {
5875
this.parentNode.insertBefore( elem, this.nextSibling );
5877
} else if ( arguments.length ) {
5878
var set = this.pushStack( this, "after", arguments );
5879
set.push.apply( set, jQuery.clean(arguments) );
5884
// keepData is for internal use only--do not document
5885
remove: function( selector, keepData ) {
5886
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5887
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
5888
if ( !keepData && elem.nodeType === 1 ) {
5889
jQuery.cleanData( elem.getElementsByTagName("*") );
5890
jQuery.cleanData( [ elem ] );
5893
if ( elem.parentNode ) {
5894
elem.parentNode.removeChild( elem );
5903
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
5904
// Remove element nodes and prevent memory leaks
5905
if ( elem.nodeType === 1 ) {
5906
jQuery.cleanData( elem.getElementsByTagName("*") );
5909
// Remove any remaining nodes
5910
while ( elem.firstChild ) {
5911
elem.removeChild( elem.firstChild );
5918
clone: function( dataAndEvents, deepDataAndEvents ) {
5919
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5920
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5922
return this.map( function () {
5923
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5927
html: function( value ) {
5928
return jQuery.access( this, function( value ) {
5929
var elem = this[0] || {},
5933
if ( value === undefined ) {
5934
return elem.nodeType === 1 ?
5935
elem.innerHTML.replace( rinlinejQuery, "" ) :
5940
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5941
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5942
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
5944
value = value.replace( rxhtmlTag, "<$1></$2>" );
5947
for (; i < l; i++ ) {
5948
// Remove element nodes and prevent memory leaks
5949
elem = this[i] || {};
5950
if ( elem.nodeType === 1 ) {
5951
jQuery.cleanData( elem.getElementsByTagName( "*" ) );
5952
elem.innerHTML = value;
5958
// If using innerHTML throws an exception, use the fallback method
5963
this.empty().append( value );
5965
}, null, value, arguments.length );
5968
replaceWith: function( value ) {
5969
if ( this[0] && this[0].parentNode ) {
5970
// Make sure that the elements are removed from the DOM before they are inserted
5971
// this can help fix replacing a parent with child elements
5972
if ( jQuery.isFunction( value ) ) {
5973
return this.each(function(i) {
5974
var self = jQuery(this), old = self.html();
5975
self.replaceWith( value.call( this, i, old ) );
5979
if ( typeof value !== "string" ) {
5980
value = jQuery( value ).detach();
5983
return this.each(function() {
5984
var next = this.nextSibling,
5985
parent = this.parentNode;
5987
jQuery( this ).remove();
5990
jQuery(next).before( value );
5992
jQuery(parent).append( value );
5996
return this.length ?
5997
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
6002
detach: function( selector ) {
6003
return this.remove( selector, true );
6006
domManip: function( args, table, callback ) {
6007
var results, first, fragment, parent,
6011
// We can't cloneNode fragments that contain checked, in WebKit
6012
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
6013
return this.each(function() {
6014
jQuery(this).domManip( args, table, callback, true );
6018
if ( jQuery.isFunction(value) ) {
6019
return this.each(function(i) {
6020
var self = jQuery(this);
6021
args[0] = value.call(this, i, table ? self.html() : undefined);
6022
self.domManip( args, table, callback );
6027
parent = value && value.parentNode;
6029
// If we're in a fragment, just use that instead of building a new one
6030
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
6031
results = { fragment: parent };
6034
results = jQuery.buildFragment( args, this, scripts );
6037
fragment = results.fragment;
6039
if ( fragment.childNodes.length === 1 ) {
6040
first = fragment = fragment.firstChild;
6042
first = fragment.firstChild;
6046
table = table && jQuery.nodeName( first, "tr" );
6048
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
6051
root(this[i], first) :
6053
// Make sure that we do not leak memory by inadvertently discarding
6054
// the original fragment (which might have attached data) instead of
6055
// using it; in addition, use the original fragment object for the last
6056
// item instead of first because it can end up being emptied incorrectly
6057
// in certain situations (Bug #8070).
6058
// Fragments from the fragment cache must always be cloned and never used
6060
results.cacheable || ( l > 1 && i < lastIndex ) ?
6061
jQuery.clone( fragment, true, true ) :
6067
if ( scripts.length ) {
6068
jQuery.each( scripts, function( i, elem ) {
6078
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
6081
if ( elem.parentNode ) {
6082
elem.parentNode.removeChild( elem );
6092
function root( elem, cur ) {
6093
return jQuery.nodeName(elem, "table") ?
6094
(elem.getElementsByTagName("tbody")[0] ||
6095
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
6099
function cloneCopyEvent( src, dest ) {
6101
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6106
oldData = jQuery._data( src ),
6107
curData = jQuery._data( dest, oldData ),
6108
events = oldData.events;
6111
delete curData.handle;
6112
curData.events = {};
6114
for ( type in events ) {
6115
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6116
jQuery.event.add( dest, type, events[ type ][ i ] );
6121
// make the cloned public data object a copy from the original
6122
if ( curData.data ) {
6123
curData.data = jQuery.extend( {}, curData.data );
6127
function cloneFixAttributes( src, dest ) {
6130
// We do not need to do anything for non-Elements
6131
if ( dest.nodeType !== 1 ) {
6135
// clearAttributes removes the attributes, which we don't want,
6136
// but also removes the attachEvent events, which we *do* want
6137
if ( dest.clearAttributes ) {
6138
dest.clearAttributes();
6141
// mergeAttributes, in contrast, only merges back on the
6142
// original attributes, not the events
6143
if ( dest.mergeAttributes ) {
6144
dest.mergeAttributes( src );
6147
nodeName = dest.nodeName.toLowerCase();
6149
// IE6-8 fail to clone children inside object elements that use
6150
// the proprietary classid attribute value (rather than the type
6151
// attribute) to identify the type of content to display
6152
if ( nodeName === "object" ) {
6153
dest.outerHTML = src.outerHTML;
6155
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
6156
// IE6-8 fails to persist the checked state of a cloned checkbox
6157
// or radio button. Worse, IE6-7 fail to give the cloned element
6158
// a checked appearance if the defaultChecked value isn't also set
6159
if ( src.checked ) {
6160
dest.defaultChecked = dest.checked = src.checked;
6163
// IE6-7 get confused and end up setting the value of a cloned
6164
// checkbox/radio button to an empty string instead of "on"
6165
if ( dest.value !== src.value ) {
6166
dest.value = src.value;
6169
// IE6-8 fails to return the selected option to the default selected
6170
// state when cloning options
6171
} else if ( nodeName === "option" ) {
6172
dest.selected = src.defaultSelected;
6174
// IE6-8 fails to set the defaultValue to the correct value when
6175
// cloning other types of input fields
6176
} else if ( nodeName === "input" || nodeName === "textarea" ) {
6177
dest.defaultValue = src.defaultValue;
6179
// IE blanks contents when cloning scripts
6180
} else if ( nodeName === "script" && dest.text !== src.text ) {
6181
dest.text = src.text;
6184
// Event data gets referenced instead of copied if the expando
6186
dest.removeAttribute( jQuery.expando );
6188
// Clear flags for bubbling special change/submit events, they must
6189
// be reattached when the newly cloned events are first activated
6190
dest.removeAttribute( "_submit_attached" );
6191
dest.removeAttribute( "_change_attached" );
6194
jQuery.buildFragment = function( args, nodes, scripts ) {
6195
var fragment, cacheable, cacheresults, doc,
6198
// nodes may contain either an explicit document object,
6199
// a jQuery collection or context object.
6200
// If nodes[0] contains a valid object to assign to doc
6201
if ( nodes && nodes[0] ) {
6202
doc = nodes[0].ownerDocument || nodes[0];
6205
// Ensure that an attr object doesn't incorrectly stand in as a document object
6206
// Chrome and Firefox seem to allow this to occur and will throw exception
6208
if ( !doc.createDocumentFragment ) {
6212
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
6213
// Cloning options loses the selected state, so don't cache them
6214
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
6215
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
6216
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
6217
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
6218
first.charAt(0) === "<" && !rnocache.test( first ) &&
6219
(jQuery.support.checkClone || !rchecked.test( first )) &&
6220
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
6224
cacheresults = jQuery.fragments[ first ];
6225
if ( cacheresults && cacheresults !== 1 ) {
6226
fragment = cacheresults;
6231
fragment = doc.createDocumentFragment();
6232
jQuery.clean( args, doc, fragment, scripts );
6236
jQuery.fragments[ first ] = cacheresults ? fragment : 1;
6239
return { fragment: fragment, cacheable: cacheable };
6242
jQuery.fragments = {};
6246
prependTo: "prepend",
6247
insertBefore: "before",
6248
insertAfter: "after",
6249
replaceAll: "replaceWith"
6250
}, function( name, original ) {
6251
jQuery.fn[ name ] = function( selector ) {
6253
insert = jQuery( selector ),
6254
parent = this.length === 1 && this[0].parentNode;
6256
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
6257
insert[ original ]( this[0] );
6261
for ( var i = 0, l = insert.length; i < l; i++ ) {
6262
var elems = ( i > 0 ? this.clone(true) : this ).get();
6263
jQuery( insert[i] )[ original ]( elems );
6264
ret = ret.concat( elems );
6267
return this.pushStack( ret, name, insert.selector );
6272
function getAll( elem ) {
6273
if ( typeof elem.getElementsByTagName !== "undefined" ) {
6274
return elem.getElementsByTagName( "*" );
6276
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
6277
return elem.querySelectorAll( "*" );
6284
// Used in clean, fixes the defaultChecked property
6285
function fixDefaultChecked( elem ) {
6286
if ( elem.type === "checkbox" || elem.type === "radio" ) {
6287
elem.defaultChecked = elem.checked;
6290
// Finds all inputs and passes them to fixDefaultChecked
6291
function findInputs( elem ) {
6292
var nodeName = ( elem.nodeName || "" ).toLowerCase();
6293
if ( nodeName === "input" ) {
6294
fixDefaultChecked( elem );
6295
// Skip scripts, get other children
6296
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
6297
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
6301
// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
6302
function shimCloneNode( elem ) {
6303
var div = document.createElement( "div" );
6304
safeFragment.appendChild( div );
6306
div.innerHTML = elem.outerHTML;
6307
return div.firstChild;
6311
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6315
// IE<=8 does not properly clone detached, unknown element nodes
6316
clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
6317
elem.cloneNode( true ) :
6318
shimCloneNode( elem );
6320
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6321
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6322
// IE copies events bound via attachEvent when using cloneNode.
6323
// Calling detachEvent on the clone will also remove the events
6324
// from the original. In order to get around this, we use some
6325
// proprietary methods to clear the events. Thanks to MooTools
6326
// guys for this hotness.
6328
cloneFixAttributes( elem, clone );
6330
// Using Sizzle here is crazy slow, so we use getElementsByTagName instead
6331
srcElements = getAll( elem );
6332
destElements = getAll( clone );
6334
// Weird iteration because IE will replace the length property
6335
// with an element if you are cloning the body and one of the
6336
// elements on the page has a name or id of "length"
6337
for ( i = 0; srcElements[i]; ++i ) {
6338
// Ensure that the destination node is not null; Fixes #9587
6339
if ( destElements[i] ) {
6340
cloneFixAttributes( srcElements[i], destElements[i] );
6345
// Copy the events from the original to the clone
6346
if ( dataAndEvents ) {
6347
cloneCopyEvent( elem, clone );
6349
if ( deepDataAndEvents ) {
6350
srcElements = getAll( elem );
6351
destElements = getAll( clone );
6353
for ( i = 0; srcElements[i]; ++i ) {
6354
cloneCopyEvent( srcElements[i], destElements[i] );
6359
srcElements = destElements = null;
6361
// Return the cloned set
6365
clean: function( elems, context, fragment, scripts ) {
6366
var checkScriptType, script, j,
6369
context = context || document;
6371
// !context.createElement fails in IE with an error but returns typeof 'object'
6372
if ( typeof context.createElement === "undefined" ) {
6373
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
6376
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
6377
if ( typeof elem === "number" ) {
6385
// Convert html string into DOM nodes
6386
if ( typeof elem === "string" ) {
6387
if ( !rhtml.test( elem ) ) {
6388
elem = context.createTextNode( elem );
6390
// Fix "XHTML"-style tags in all browsers
6391
elem = elem.replace(rxhtmlTag, "<$1></$2>");
6393
// Trim whitespace, otherwise indexOf won't work as expected
6394
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
6395
wrap = wrapMap[ tag ] || wrapMap._default,
6397
div = context.createElement("div"),
6398
safeChildNodes = safeFragment.childNodes,
6401
// Append wrapper element to unknown element safe doc fragment
6402
if ( context === document ) {
6403
// Use the fragment we've already created for this document
6404
safeFragment.appendChild( div );
6406
// Use a fragment created with the owner document
6407
createSafeFragment( context ).appendChild( div );
6410
// Go to html and back, then peel off extra wrappers
6411
div.innerHTML = wrap[1] + elem + wrap[2];
6413
// Move to the right depth
6415
div = div.lastChild;
6418
// Remove IE's autoinserted <tbody> from table fragments
6419
if ( !jQuery.support.tbody ) {
6421
// String was a <table>, *may* have spurious <tbody>
6422
var hasBody = rtbody.test(elem),
6423
tbody = tag === "table" && !hasBody ?
6424
div.firstChild && div.firstChild.childNodes :
6426
// String was a bare <thead> or <tfoot>
6427
wrap[1] === "<table>" && !hasBody ?
6431
for ( j = tbody.length - 1; j >= 0 ; --j ) {
6432
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
6433
tbody[ j ].parentNode.removeChild( tbody[ j ] );
6438
// IE completely kills leading whitespace when innerHTML is used
6439
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6440
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
6443
elem = div.childNodes;
6445
// Clear elements from DocumentFragment (safeFragment or otherwise)
6446
// to avoid hoarding elements. Fixes #11356
6448
div.parentNode.removeChild( div );
6450
// Guard against -1 index exceptions in FF3.6
6451
if ( safeChildNodes.length > 0 ) {
6452
remove = safeChildNodes[ safeChildNodes.length - 1 ];
6454
if ( remove && remove.parentNode ) {
6455
remove.parentNode.removeChild( remove );
6462
// Resets defaultChecked for any radios and checkboxes
6463
// about to be appended to the DOM in IE 6/7 (#8060)
6465
if ( !jQuery.support.appendChecked ) {
6466
if ( elem[0] && typeof (len = elem.length) === "number" ) {
6467
for ( j = 0; j < len; j++ ) {
6468
findInputs( elem[j] );
6475
if ( elem.nodeType ) {
6478
ret = jQuery.merge( ret, elem );
6483
checkScriptType = function( elem ) {
6484
return !elem.type || rscriptType.test( elem.type );
6486
for ( i = 0; ret[i]; i++ ) {
6488
if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
6489
scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
6492
if ( script.nodeType === 1 ) {
6493
var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
6495
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
6497
fragment.appendChild( script );
6505
cleanData: function( elems ) {
6507
cache = jQuery.cache,
6508
special = jQuery.event.special,
6509
deleteExpando = jQuery.support.deleteExpando;
6511
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
6512
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
6516
id = elem[ jQuery.expando ];
6521
if ( data && data.events ) {
6522
for ( var type in data.events ) {
6523
if ( special[ type ] ) {
6524
jQuery.event.remove( elem, type );
6526
// This is a shortcut to avoid jQuery.event.remove's overhead
6528
jQuery.removeEvent( elem, type, data.handle );
6532
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
6533
if ( data.handle ) {
6534
data.handle.elem = null;
6538
if ( deleteExpando ) {
6539
delete elem[ jQuery.expando ];
6541
} else if ( elem.removeAttribute ) {
6542
elem.removeAttribute( jQuery.expando );
6554
var ralpha = /alpha\([^)]*\)/i,
6555
ropacity = /opacity=([^)]*)/,
6556
// fixed for IE9, see #8346
6557
rupper = /([A-Z]|^ms)/g,
6558
rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
6559
rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
6560
rrelNum = /^([\-+])=([\-+.\de]+)/,
6561
rmargin = /^margin/,
6563
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6565
// order is important!
6566
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6573
jQuery.fn.css = function( name, value ) {
6574
return jQuery.access( this, function( elem, name, value ) {
6575
return value !== undefined ?
6576
jQuery.style( elem, name, value ) :
6577
jQuery.css( elem, name );
6578
}, name, value, arguments.length > 1 );
6582
// Add in style property hooks for overriding the default
6583
// behavior of getting and setting a style property
6586
get: function( elem, computed ) {
6588
// We should always get a number back from opacity
6589
var ret = curCSS( elem, "opacity" );
6590
return ret === "" ? "1" : ret;
6593
return elem.style.opacity;
6599
// Exclude the following css properties to add px
6601
"fillOpacity": true,
6611
// Add in properties whose names you wish to fix before
6612
// setting or getting the value
6614
// normalize float css property
6615
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6618
// Get and set the style property on a DOM Node
6619
style: function( elem, name, value, extra ) {
6620
// Don't set styles on text and comment nodes
6621
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6625
// Make sure that we're working with the right name
6626
var ret, type, origName = jQuery.camelCase( name ),
6627
style = elem.style, hooks = jQuery.cssHooks[ origName ];
6629
name = jQuery.cssProps[ origName ] || origName;
6631
// Check if we're setting a value
6632
if ( value !== undefined ) {
6633
type = typeof value;
6635
// convert relative number strings (+= or -=) to relative numbers. #7345
6636
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6637
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
6642
// Make sure that NaN and null values aren't set. See: #7116
6643
if ( value == null || type === "number" && isNaN( value ) ) {
6647
// If a number was passed in, add 'px' to the (except for certain CSS properties)
6648
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6652
// If a hook was provided, use that value, otherwise just set the specified value
6653
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
6654
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
6657
style[ name ] = value;
6662
// If a hook was provided get the non-computed value from there
6663
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6667
// Otherwise just get the value from the style object
6668
return style[ name ];
6672
css: function( elem, name, extra ) {
6675
// Make sure that we're working with the right name
6676
name = jQuery.camelCase( name );
6677
hooks = jQuery.cssHooks[ name ];
6678
name = jQuery.cssProps[ name ] || name;
6680
// cssFloat needs a special treatment
6681
if ( name === "cssFloat" ) {
6685
// If a hook was provided get the computed value from there
6686
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
6689
// Otherwise, if a way to get the computed value exists, use that
6690
} else if ( curCSS ) {
6691
return curCSS( elem, name );
6695
// A method for quickly swapping in/out CSS properties to get correct calculations
6696
swap: function( elem, options, callback ) {
6700
// Remember the old values, and insert the new ones
6701
for ( name in options ) {
6702
old[ name ] = elem.style[ name ];
6703
elem.style[ name ] = options[ name ];
6706
ret = callback.call( elem );
6708
// Revert the old values
6709
for ( name in options ) {
6710
elem.style[ name ] = old[ name ];
6717
// DEPRECATED in 1.3, Use jQuery.css() instead
6718
jQuery.curCSS = jQuery.css;
6720
if ( document.defaultView && document.defaultView.getComputedStyle ) {
6721
getComputedStyle = function( elem, name ) {
6722
var ret, defaultView, computedStyle, width,
6725
name = name.replace( rupper, "-$1" ).toLowerCase();
6727
if ( (defaultView = elem.ownerDocument.defaultView) &&
6728
(computedStyle = defaultView.getComputedStyle( elem, null )) ) {
6730
ret = computedStyle.getPropertyValue( name );
6731
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
6732
ret = jQuery.style( elem, name );
6736
// A tribute to the "awesome hack by Dean Edwards"
6737
// WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
6738
// which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6739
if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
6740
width = style.width;
6742
ret = computedStyle.width;
6743
style.width = width;
6750
if ( document.documentElement.currentStyle ) {
6751
currentStyle = function( elem, name ) {
6752
var left, rsLeft, uncomputed,
6753
ret = elem.currentStyle && elem.currentStyle[ name ],
6756
// Avoid setting ret to empty string here
6757
// so we don't default to auto
6758
if ( ret == null && style && (uncomputed = style[ name ]) ) {
6762
// From the awesome hack by Dean Edwards
6763
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6765
// If we're not dealing with a regular pixel number
6766
// but a number that has a weird ending, we need to convert it to pixels
6767
if ( rnumnonpx.test( ret ) ) {
6769
// Remember the original values
6771
rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
6773
// Put in the new values to get a computed value out
6775
elem.runtimeStyle.left = elem.currentStyle.left;
6777
style.left = name === "fontSize" ? "1em" : ret;
6778
ret = style.pixelLeft + "px";
6780
// Revert the changed values
6783
elem.runtimeStyle.left = rsLeft;
6787
return ret === "" ? "auto" : ret;
6791
curCSS = getComputedStyle || currentStyle;
6793
function getWidthOrHeight( elem, name, extra ) {
6795
// Start with offset property
6796
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6797
i = name === "width" ? 1 : 0,
6801
if ( extra !== "border" ) {
6802
for ( ; i < len; i += 2 ) {
6804
val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
6806
if ( extra === "margin" ) {
6807
val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
6809
val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
6817
// Fall back to computed then uncomputed css if necessary
6818
val = curCSS( elem, name );
6819
if ( val < 0 || val == null ) {
6820
val = elem.style[ name ];
6823
// Computed unit is not pixels. Stop here and return.
6824
if ( rnumnonpx.test(val) ) {
6828
// Normalize "", auto, and prepare for extra
6829
val = parseFloat( val ) || 0;
6831
// Add padding, border, margin
6833
for ( ; i < len; i += 2 ) {
6834
val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
6835
if ( extra !== "padding" ) {
6836
val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
6838
if ( extra === "margin" ) {
6839
val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
6847
jQuery.each([ "height", "width" ], function( i, name ) {
6848
jQuery.cssHooks[ name ] = {
6849
get: function( elem, computed, extra ) {
6851
if ( elem.offsetWidth !== 0 ) {
6852
return getWidthOrHeight( elem, name, extra );
6854
return jQuery.swap( elem, cssShow, function() {
6855
return getWidthOrHeight( elem, name, extra );
6861
set: function( elem, value ) {
6862
return rnum.test( value ) ?
6869
if ( !jQuery.support.opacity ) {
6870
jQuery.cssHooks.opacity = {
6871
get: function( elem, computed ) {
6872
// IE uses filters for opacity
6873
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6874
( parseFloat( RegExp.$1 ) / 100 ) + "" :
6875
computed ? "1" : "";
6878
set: function( elem, value ) {
6879
var style = elem.style,
6880
currentStyle = elem.currentStyle,
6881
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6882
filter = currentStyle && currentStyle.filter || style.filter || "";
6884
// IE has trouble with opacity if it does not have layout
6885
// Force it by setting the zoom level
6888
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6889
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
6891
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6892
// if "filter:" is present at all, clearType is disabled, we want to avoid this
6893
// style.removeAttribute is IE Only, but so apparently is this code path...
6894
style.removeAttribute( "filter" );
6896
// if there there is no filter style applied in a css rule, we are done
6897
if ( currentStyle && !currentStyle.filter ) {
6902
// otherwise, set new filter values
6903
style.filter = ralpha.test( filter ) ?
6904
filter.replace( ralpha, opacity ) :
6905
filter + " " + opacity;
6911
// This hook cannot be added until DOM ready because the support test
6912
// for it is not run until after DOM ready
6913
if ( !jQuery.support.reliableMarginRight ) {
6914
jQuery.cssHooks.marginRight = {
6915
get: function( elem, computed ) {
6916
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6917
// Work around by temporarily setting element display to inline-block
6918
return jQuery.swap( elem, { "display": "inline-block" }, function() {
6920
return curCSS( elem, "margin-right" );
6922
return elem.style.marginRight;
6930
if ( jQuery.expr && jQuery.expr.filters ) {
6931
jQuery.expr.filters.hidden = function( elem ) {
6932
var width = elem.offsetWidth,
6933
height = elem.offsetHeight;
6935
return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
6938
jQuery.expr.filters.visible = function( elem ) {
6939
return !jQuery.expr.filters.hidden( elem );
6943
// These hooks are used by animate to expand properties
6948
}, function( prefix, suffix ) {
6950
jQuery.cssHooks[ prefix + suffix ] = {
6951
expand: function( value ) {
6954
// assumes a single number if not a string
6955
parts = typeof value === "string" ? value.split(" ") : [ value ],
6958
for ( i = 0; i < 4; i++ ) {
6959
expanded[ prefix + cssExpand[ i ] + suffix ] =
6960
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6975
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6976
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6977
// #7653, #8125, #8152: local protocol detection
6978
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
6979
rnoContent = /^(?:GET|HEAD)$/,
6980
rprotocol = /^\/\//,
6982
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
6983
rselectTextarea = /^(?:select|textarea)/i,
6984
rspacesAjax = /\s+/,
6985
rts = /([?&])_=[^&]*/,
6986
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
6988
// Keep a copy of the old load method
6989
_load = jQuery.fn.load,
6992
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
6993
* 2) These are called:
6994
* - BEFORE asking for a transport
6995
* - AFTER param serialization (s.data is a string if s.processData is true)
6996
* 3) key is the dataType
6997
* 4) the catchall symbol "*" can be used
6998
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
7002
/* Transports bindings
7003
* 1) key is the dataType
7004
* 2) the catchall symbol "*" can be used
7005
* 3) selection will start with transport dataType and THEN go to "*" if needed
7009
// Document location
7012
// Document location segments
7015
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7016
allTypes = ["*/"] + ["*"];
7018
// #8138, IE may throw an exception when accessing
7019
// a field from window.location if document.domain has been set
7021
ajaxLocation = location.href;
7023
// Use the href attribute of an A element
7024
// since IE will modify it given document.location
7025
ajaxLocation = document.createElement( "a" );
7026
ajaxLocation.href = "";
7027
ajaxLocation = ajaxLocation.href;
7030
// Segment location into parts
7031
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7033
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7034
function addToPrefiltersOrTransports( structure ) {
7036
// dataTypeExpression is optional and defaults to "*"
7037
return function( dataTypeExpression, func ) {
7039
if ( typeof dataTypeExpression !== "string" ) {
7040
func = dataTypeExpression;
7041
dataTypeExpression = "*";
7044
if ( jQuery.isFunction( func ) ) {
7045
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
7047
length = dataTypes.length,
7052
// For each dataType in the dataTypeExpression
7053
for ( ; i < length; i++ ) {
7054
dataType = dataTypes[ i ];
7055
// We control if we're asked to add before
7056
// any existing element
7057
placeBefore = /^\+/.test( dataType );
7058
if ( placeBefore ) {
7059
dataType = dataType.substr( 1 ) || "*";
7061
list = structure[ dataType ] = structure[ dataType ] || [];
7062
// then we add to the structure accordingly
7063
list[ placeBefore ? "unshift" : "push" ]( func );
7069
// Base inspection function for prefilters and transports
7070
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
7071
dataType /* internal */, inspected /* internal */ ) {
7073
dataType = dataType || options.dataTypes[ 0 ];
7074
inspected = inspected || {};
7076
inspected[ dataType ] = true;
7078
var list = structure[ dataType ],
7080
length = list ? list.length : 0,
7081
executeOnly = ( structure === prefilters ),
7084
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
7085
selection = list[ i ]( options, originalOptions, jqXHR );
7086
// If we got redirected to another dataType
7087
// we try there if executing only and not done already
7088
if ( typeof selection === "string" ) {
7089
if ( !executeOnly || inspected[ selection ] ) {
7090
selection = undefined;
7092
options.dataTypes.unshift( selection );
7093
selection = inspectPrefiltersOrTransports(
7094
structure, options, originalOptions, jqXHR, selection, inspected );
7098
// If we're only executing or nothing was selected
7099
// we try the catchall dataType if not done already
7100
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
7101
selection = inspectPrefiltersOrTransports(
7102
structure, options, originalOptions, jqXHR, "*", inspected );
7104
// unnecessary when only executing (prefilters)
7105
// but it'll be ignored by the caller in that case
7109
// A special extend for ajax options
7110
// that takes "flat" options (not to be deep extended)
7112
function ajaxExtend( target, src ) {
7114
flatOptions = jQuery.ajaxSettings.flatOptions || {};
7115
for ( key in src ) {
7116
if ( src[ key ] !== undefined ) {
7117
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
7121
jQuery.extend( true, target, deep );
7126
load: function( url, params, callback ) {
7127
if ( typeof url !== "string" && _load ) {
7128
return _load.apply( this, arguments );
7130
// Don't do a request if no elements are being requested
7131
} else if ( !this.length ) {
7135
var off = url.indexOf( " " );
7137
var selector = url.slice( off, url.length );
7138
url = url.slice( 0, off );
7141
// Default to a GET request
7144
// If the second parameter was provided
7146
// If it's a function
7147
if ( jQuery.isFunction( params ) ) {
7148
// We assume that it's the callback
7152
// Otherwise, build a param string
7153
} else if ( typeof params === "object" ) {
7154
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
7161
// Request the remote document
7167
// Complete callback (responseText is used internally)
7168
complete: function( jqXHR, status, responseText ) {
7169
// Store the response as specified by the jqXHR object
7170
responseText = jqXHR.responseText;
7171
// If successful, inject the HTML into all the matched elements
7172
if ( jqXHR.isResolved() ) {
7173
// #4825: Get the actual response in case
7174
// a dataFilter is present in ajaxSettings
7175
jqXHR.done(function( r ) {
7178
// See if a selector was specified
7179
self.html( selector ?
7180
// Create a dummy div to hold the results
7182
// inject the contents of the document in, removing the scripts
7183
// to avoid any 'Permission Denied' errors in IE
7184
.append(responseText.replace(rscript, ""))
7186
// Locate the specified elements
7189
// If not, just inject the full result
7194
self.each( callback, [ responseText, status, jqXHR ] );
7202
serialize: function() {
7203
return jQuery.param( this.serializeArray() );
7206
serializeArray: function() {
7207
return this.map(function(){
7208
return this.elements ? jQuery.makeArray( this.elements ) : this;
7211
return this.name && !this.disabled &&
7212
( this.checked || rselectTextarea.test( this.nodeName ) ||
7213
rinput.test( this.type ) );
7215
.map(function( i, elem ){
7216
var val = jQuery( this ).val();
7218
return val == null ?
7220
jQuery.isArray( val ) ?
7221
jQuery.map( val, function( val, i ){
7222
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7224
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7229
// Attach a bunch of functions for handling common AJAX events
7230
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
7231
jQuery.fn[ o ] = function( f ){
7232
return this.on( o, f );
7236
jQuery.each( [ "get", "post" ], function( i, method ) {
7237
jQuery[ method ] = function( url, data, callback, type ) {
7238
// shift arguments if data argument was omitted
7239
if ( jQuery.isFunction( data ) ) {
7240
type = type || callback;
7245
return jQuery.ajax({
7257
getScript: function( url, callback ) {
7258
return jQuery.get( url, undefined, callback, "script" );
7261
getJSON: function( url, data, callback ) {
7262
return jQuery.get( url, data, callback, "json" );
7265
// Creates a full fledged settings object into target
7266
// with both ajaxSettings and settings fields.
7267
// If target is omitted, writes into ajaxSettings.
7268
ajaxSetup: function( target, settings ) {
7270
// Building a settings object
7271
ajaxExtend( target, jQuery.ajaxSettings );
7273
// Extending ajaxSettings
7275
target = jQuery.ajaxSettings;
7277
ajaxExtend( target, settings );
7283
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7286
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7301
xml: "application/xml, text/xml",
7304
json: "application/json, text/javascript",
7316
text: "responseText"
7319
// List of data converters
7320
// 1) key format is "source_type destination_type" (a single space in-between)
7321
// 2) the catchall symbol "*" can be used for source_type
7324
// Convert anything to text
7325
"* text": window.String,
7327
// Text to html (true = no transformation)
7330
// Evaluate text as a json expression
7331
"text json": jQuery.parseJSON,
7333
// Parse text as xml
7334
"text xml": jQuery.parseXML
7337
// For options that shouldn't be deep extended:
7338
// you can add your own custom options here if
7339
// and when you create one that shouldn't be
7340
// deep extended (see ajaxExtend)
7347
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7348
ajaxTransport: addToPrefiltersOrTransports( transports ),
7351
ajax: function( url, options ) {
7353
// If url is an object, simulate pre-1.5 signature
7354
if ( typeof url === "object" ) {
7359
// Force options to be an object
7360
options = options || {};
7362
var // Create the final options object
7363
s = jQuery.ajaxSetup( {}, options ),
7364
// Callbacks context
7365
callbackContext = s.context || s,
7366
// Context for global events
7367
// It's the callbackContext if one was provided in the options
7368
// and if it's a DOM node or a jQuery collection
7369
globalEventContext = callbackContext !== s &&
7370
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
7371
jQuery( callbackContext ) : jQuery.event,
7373
deferred = jQuery.Deferred(),
7374
completeDeferred = jQuery.Callbacks( "once memory" ),
7375
// Status-dependent callbacks
7376
statusCode = s.statusCode || {},
7379
// Headers (they are sent all at once)
7380
requestHeaders = {},
7381
requestHeadersNames = {},
7383
responseHeadersString,
7389
// Cross-domain detection vars
7393
// To know if global events are to be dispatched
7402
// Caches the header
7403
setRequestHeader: function( name, value ) {
7405
var lname = name.toLowerCase();
7406
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7407
requestHeaders[ name ] = value;
7413
getAllResponseHeaders: function() {
7414
return state === 2 ? responseHeadersString : null;
7417
// Builds headers hashtable if needed
7418
getResponseHeader: function( key ) {
7420
if ( state === 2 ) {
7421
if ( !responseHeaders ) {
7422
responseHeaders = {};
7423
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
7424
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7427
match = responseHeaders[ key.toLowerCase() ];
7429
return match === undefined ? null : match;
7432
// Overrides response content-type header
7433
overrideMimeType: function( type ) {
7440
// Cancel the request
7441
abort: function( statusText ) {
7442
statusText = statusText || "abort";
7444
transport.abort( statusText );
7446
done( 0, statusText );
7451
// Callback for when everything is done
7452
// It is defined here because jslint complains if it is declared
7453
// at the end of the function (which would be more logical and readable)
7454
function done( status, nativeStatusText, responses, headers ) {
7457
if ( state === 2 ) {
7461
// State is "done" now
7464
// Clear timeout if it exists
7465
if ( timeoutTimer ) {
7466
clearTimeout( timeoutTimer );
7469
// Dereference transport for early garbage collection
7470
// (no matter how long the jqXHR object will be used)
7471
transport = undefined;
7473
// Cache response headers
7474
responseHeadersString = headers || "";
7477
jqXHR.readyState = status > 0 ? 4 : 0;
7482
statusText = nativeStatusText,
7483
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
7487
// If successful, handle type chaining
7488
if ( status >= 200 && status < 300 || status === 304 ) {
7490
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7491
if ( s.ifModified ) {
7493
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
7494
jQuery.lastModified[ ifModifiedKey ] = lastModified;
7496
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
7497
jQuery.etag[ ifModifiedKey ] = etag;
7502
if ( status === 304 ) {
7504
statusText = "notmodified";
7511
success = ajaxConvert( s, response );
7512
statusText = "success";
7515
// We have a parsererror
7516
statusText = "parsererror";
7521
// We extract error from statusText
7522
// then normalize statusText and status for non-aborts
7524
if ( !statusText || status ) {
7525
statusText = "error";
7532
// Set data for the fake xhr object
7533
jqXHR.status = status;
7534
jqXHR.statusText = "" + ( nativeStatusText || statusText );
7538
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
7540
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
7543
// Status-dependent callbacks
7544
jqXHR.statusCode( statusCode );
7545
statusCode = undefined;
7547
if ( fireGlobals ) {
7548
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
7549
[ jqXHR, s, isSuccess ? success : error ] );
7553
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
7555
if ( fireGlobals ) {
7556
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
7557
// Handle the global AJAX counter
7558
if ( !( --jQuery.active ) ) {
7559
jQuery.event.trigger( "ajaxStop" );
7565
deferred.promise( jqXHR );
7566
jqXHR.success = jqXHR.done;
7567
jqXHR.error = jqXHR.fail;
7568
jqXHR.complete = completeDeferred.add;
7570
// Status-dependent callbacks
7571
jqXHR.statusCode = function( map ) {
7575
for ( tmp in map ) {
7576
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
7579
tmp = map[ jqXHR.status ];
7580
jqXHR.then( tmp, tmp );
7586
// Remove hash character (#7531: and string promotion)
7587
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7588
// We also use the url parameter if available
7589
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
7591
// Extract dataTypes list
7592
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
7594
// Determine if a cross-domain request is in order
7595
if ( s.crossDomain == null ) {
7596
parts = rurl.exec( s.url.toLowerCase() );
7597
s.crossDomain = !!( parts &&
7598
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
7599
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
7600
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
7604
// Convert data if not already a string
7605
if ( s.data && s.processData && typeof s.data !== "string" ) {
7606
s.data = jQuery.param( s.data, s.traditional );
7610
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
7612
// If request was aborted inside a prefilter, stop there
7613
if ( state === 2 ) {
7617
// We can fire global events as of now if asked to
7618
fireGlobals = s.global;
7620
// Uppercase the type
7621
s.type = s.type.toUpperCase();
7623
// Determine if request has content
7624
s.hasContent = !rnoContent.test( s.type );
7626
// Watch for a new set of requests
7627
if ( fireGlobals && jQuery.active++ === 0 ) {
7628
jQuery.event.trigger( "ajaxStart" );
7631
// More options handling for requests with no content
7632
if ( !s.hasContent ) {
7634
// If data is available, append data to url
7636
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
7637
// #9682: remove data so that it's not used in an eventual retry
7641
// Get ifModifiedKey before adding the anti-cache parameter
7642
ifModifiedKey = s.url;
7644
// Add anti-cache in url if needed
7645
if ( s.cache === false ) {
7647
var ts = jQuery.now(),
7648
// try replacing _= if it is there
7649
ret = s.url.replace( rts, "$1_=" + ts );
7651
// if nothing was replaced, add timestamp to the end
7652
s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
7656
// Set the correct header, if data is being sent
7657
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
7658
jqXHR.setRequestHeader( "Content-Type", s.contentType );
7661
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7662
if ( s.ifModified ) {
7663
ifModifiedKey = ifModifiedKey || s.url;
7664
if ( jQuery.lastModified[ ifModifiedKey ] ) {
7665
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
7667
if ( jQuery.etag[ ifModifiedKey ] ) {
7668
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
7672
// Set the Accepts header for the server, depending on the dataType
7673
jqXHR.setRequestHeader(
7675
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7676
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
7680
// Check for headers option
7681
for ( i in s.headers ) {
7682
jqXHR.setRequestHeader( i, s.headers[ i ] );
7685
// Allow custom headers/mimetypes and early abort
7686
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
7687
// Abort if not done already
7693
// Install callbacks on deferreds
7694
for ( i in { success: 1, error: 1, complete: 1 } ) {
7695
jqXHR[ i ]( s[ i ] );
7699
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
7701
// If no transport, we auto-abort
7703
done( -1, "No Transport" );
7705
jqXHR.readyState = 1;
7706
// Send global event
7707
if ( fireGlobals ) {
7708
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
7711
if ( s.async && s.timeout > 0 ) {
7712
timeoutTimer = setTimeout( function(){
7713
jqXHR.abort( "timeout" );
7719
transport.send( requestHeaders, done );
7721
// Propagate exception as error if not done
7724
// Simply rethrow otherwise
7734
// Serialize an array of form elements or a set of
7735
// key/values into a query string
7736
param: function( a, traditional ) {
7738
add = function( key, value ) {
7739
// If value is a function, invoke it and return its value
7740
value = jQuery.isFunction( value ) ? value() : value;
7741
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7744
// Set traditional to true for jQuery <= 1.3.2 behavior.
7745
if ( traditional === undefined ) {
7746
traditional = jQuery.ajaxSettings.traditional;
7749
// If an array was passed in, assume that it is an array of form elements.
7750
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7751
// Serialize the form elements
7752
jQuery.each( a, function() {
7753
add( this.name, this.value );
7757
// If traditional, encode the "old" way (the way 1.3.2 or older
7758
// did it), otherwise encode params recursively.
7759
for ( var prefix in a ) {
7760
buildParams( prefix, a[ prefix ], traditional, add );
7764
// Return the resulting serialization
7765
return s.join( "&" ).replace( r20, "+" );
7769
function buildParams( prefix, obj, traditional, add ) {
7770
if ( jQuery.isArray( obj ) ) {
7771
// Serialize array item.
7772
jQuery.each( obj, function( i, v ) {
7773
if ( traditional || rbracket.test( prefix ) ) {
7774
// Treat each array item as a scalar.
7778
// If array item is non-scalar (array or object), encode its
7779
// numeric index to resolve deserialization ambiguity issues.
7780
// Note that rack (as of 1.0.0) can't currently deserialize
7781
// nested arrays properly, and attempting to do so may cause
7782
// a server error. Possible fixes are to modify rack's
7783
// deserialization algorithm or to provide an option or flag
7784
// to force array serialization to be shallow.
7785
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7789
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
7790
// Serialize object item.
7791
for ( var name in obj ) {
7792
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7796
// Serialize scalar item.
7801
// This is still on the jQuery object... for now
7802
// Want to move this to jQuery.ajax some day
7805
// Counter for holding the number of active queries
7808
// Last-Modified header cache for next request
7814
/* Handles responses to an ajax request:
7815
* - sets all responseXXX fields accordingly
7816
* - finds the right dataType (mediates between content-type and expected dataType)
7817
* - returns the corresponding response
7819
function ajaxHandleResponses( s, jqXHR, responses ) {
7821
var contents = s.contents,
7822
dataTypes = s.dataTypes,
7823
responseFields = s.responseFields,
7829
// Fill responseXXX fields
7830
for ( type in responseFields ) {
7831
if ( type in responses ) {
7832
jqXHR[ responseFields[type] ] = responses[ type ];
7836
// Remove auto dataType and get content-type in the process
7837
while( dataTypes[ 0 ] === "*" ) {
7839
if ( ct === undefined ) {
7840
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
7844
// Check if we're dealing with a known content-type
7846
for ( type in contents ) {
7847
if ( contents[ type ] && contents[ type ].test( ct ) ) {
7848
dataTypes.unshift( type );
7854
// Check to see if we have a response for the expected dataType
7855
if ( dataTypes[ 0 ] in responses ) {
7856
finalDataType = dataTypes[ 0 ];
7858
// Try convertible dataTypes
7859
for ( type in responses ) {
7860
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
7861
finalDataType = type;
7864
if ( !firstDataType ) {
7865
firstDataType = type;
7868
// Or just use first one
7869
finalDataType = finalDataType || firstDataType;
7872
// If we found a dataType
7873
// We add the dataType to the list if needed
7874
// and return the corresponding response
7875
if ( finalDataType ) {
7876
if ( finalDataType !== dataTypes[ 0 ] ) {
7877
dataTypes.unshift( finalDataType );
7879
return responses[ finalDataType ];
7883
// Chain conversions given the request and the original response
7884
function ajaxConvert( s, response ) {
7886
// Apply the dataFilter if provided
7887
if ( s.dataFilter ) {
7888
response = s.dataFilter( response, s.dataType );
7891
var dataTypes = s.dataTypes,
7895
length = dataTypes.length,
7897
// Current and previous dataTypes
7898
current = dataTypes[ 0 ],
7900
// Conversion expression
7902
// Conversion function
7904
// Conversion functions (transitive conversion)
7908
// For each dataType in the chain
7909
for ( i = 1; i < length; i++ ) {
7911
// Create converters map
7912
// with lowercased keys
7914
for ( key in s.converters ) {
7915
if ( typeof key === "string" ) {
7916
converters[ key.toLowerCase() ] = s.converters[ key ];
7921
// Get the dataTypes
7923
current = dataTypes[ i ];
7925
// If current is auto dataType, update it to prev
7926
if ( current === "*" ) {
7928
// If no auto and dataTypes are actually different
7929
} else if ( prev !== "*" && prev !== current ) {
7931
// Get the converter
7932
conversion = prev + " " + current;
7933
conv = converters[ conversion ] || converters[ "* " + current ];
7935
// If there is no direct converter, search transitively
7938
for ( conv1 in converters ) {
7939
tmp = conv1.split( " " );
7940
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
7941
conv2 = converters[ tmp[1] + " " + current ];
7943
conv1 = converters[ conv1 ];
7944
if ( conv1 === true ) {
7946
} else if ( conv2 === true ) {
7954
// If we found no converter, dispatch an error
7955
if ( !( conv || conv2 ) ) {
7956
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
7958
// If found converter is not an equivalence
7959
if ( conv !== true ) {
7960
// Convert with 1 or 2 converters accordingly
7961
response = conv ? conv( response ) : conv2( conv1(response) );
7971
var jsc = jQuery.now(),
7972
jsre = /(\=)\?(&|$)|\?\?/i;
7974
// Default jsonp settings
7977
jsonpCallback: function() {
7978
return jQuery.expando + "_" + ( jsc++ );
7982
// Detect, normalize options and install callbacks for jsonp requests
7983
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
7985
var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
7987
if ( s.dataTypes[ 0 ] === "jsonp" ||
7988
s.jsonp !== false && ( jsre.test( s.url ) ||
7989
inspectData && jsre.test( s.data ) ) ) {
7991
var responseContainer,
7992
jsonpCallback = s.jsonpCallback =
7993
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
7994
previous = window[ jsonpCallback ],
7997
replace = "$1" + jsonpCallback + "$2";
7999
if ( s.jsonp !== false ) {
8000
url = url.replace( jsre, replace );
8001
if ( s.url === url ) {
8002
if ( inspectData ) {
8003
data = data.replace( jsre, replace );
8005
if ( s.data === data ) {
8006
// Add callback manually
8007
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
8016
window[ jsonpCallback ] = function( response ) {
8017
responseContainer = [ response ];
8020
// Clean-up function
8021
jqXHR.always(function() {
8022
// Set callback back to previous value
8023
window[ jsonpCallback ] = previous;
8024
// Call if it was a function and we have a response
8025
if ( responseContainer && jQuery.isFunction( previous ) ) {
8026
window[ jsonpCallback ]( responseContainer[ 0 ] );
8030
// Use data converter to retrieve json after script execution
8031
s.converters["script json"] = function() {
8032
if ( !responseContainer ) {
8033
jQuery.error( jsonpCallback + " was not called" );
8035
return responseContainer[ 0 ];
8038
// force json dataType
8039
s.dataTypes[ 0 ] = "json";
8041
// Delegate to script
8049
// Install script dataType
8052
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8055
script: /javascript|ecmascript/
8058
"text script": function( text ) {
8059
jQuery.globalEval( text );
8065
// Handle cache's special case and global
8066
jQuery.ajaxPrefilter( "script", function( s ) {
8067
if ( s.cache === undefined ) {
8070
if ( s.crossDomain ) {
8076
// Bind script tag hack transport
8077
jQuery.ajaxTransport( "script", function(s) {
8079
// This transport only deals with cross domain requests
8080
if ( s.crossDomain ) {
8083
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
8087
send: function( _, callback ) {
8089
script = document.createElement( "script" );
8091
script.async = "async";
8093
if ( s.scriptCharset ) {
8094
script.charset = s.scriptCharset;
8099
// Attach handlers for all browsers
8100
script.onload = script.onreadystatechange = function( _, isAbort ) {
8102
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8104
// Handle memory leak in IE
8105
script.onload = script.onreadystatechange = null;
8107
// Remove the script
8108
if ( head && script.parentNode ) {
8109
head.removeChild( script );
8112
// Dereference the script
8115
// Callback if not abort
8117
callback( 200, "success" );
8121
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
8122
// This arises when a base node is used (#2709 and #4378).
8123
head.insertBefore( script, head.firstChild );
8128
script.onload( 0, 1 );
8138
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8139
xhrOnUnloadAbort = window.ActiveXObject ? function() {
8140
// Abort all pending requests
8141
for ( var key in xhrCallbacks ) {
8142
xhrCallbacks[ key ]( 0, 1 );
8148
// Functions to create xhrs
8149
function createStandardXHR() {
8151
return new window.XMLHttpRequest();
8155
function createActiveXHR() {
8157
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
8161
// Create the request object
8162
// (This is still attached to ajaxSettings for backward compatibility)
8163
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8164
/* Microsoft failed to properly
8165
* implement the XMLHttpRequest in IE7 (can't request local files),
8166
* so we use the ActiveXObject when it is available
8167
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8168
* we need a fallback.
8171
return !this.isLocal && createStandardXHR() || createActiveXHR();
8173
// For all other browsers, use the standard XMLHttpRequest object
8176
// Determine support properties
8178
jQuery.extend( jQuery.support, {
8180
cors: !!xhr && ( "withCredentials" in xhr )
8182
})( jQuery.ajaxSettings.xhr() );
8184
// Create transport if the browser can provide an xhr
8185
if ( jQuery.support.ajax ) {
8187
jQuery.ajaxTransport(function( s ) {
8188
// Cross domain only allowed if supported through XMLHttpRequest
8189
if ( !s.crossDomain || jQuery.support.cors ) {
8194
send: function( headers, complete ) {
8202
// Passing null username, generates a login popup on Opera (#2865)
8204
xhr.open( s.type, s.url, s.async, s.username, s.password );
8206
xhr.open( s.type, s.url, s.async );
8209
// Apply custom fields if provided
8210
if ( s.xhrFields ) {
8211
for ( i in s.xhrFields ) {
8212
xhr[ i ] = s.xhrFields[ i ];
8216
// Override mime type if needed
8217
if ( s.mimeType && xhr.overrideMimeType ) {
8218
xhr.overrideMimeType( s.mimeType );
8221
// X-Requested-With header
8222
// For cross-domain requests, seeing as conditions for a preflight are
8223
// akin to a jigsaw puzzle, we simply never set it to be sure.
8224
// (it can always be set on a per-request basis or even using ajaxSetup)
8225
// For same-domain requests, won't change header if already provided.
8226
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8227
headers[ "X-Requested-With" ] = "XMLHttpRequest";
8230
// Need an extra try/catch for cross domain requests in Firefox 3
8232
for ( i in headers ) {
8233
xhr.setRequestHeader( i, headers[ i ] );
8237
// Do send the request
8238
// This may raise an exception which is actually
8239
// handled in jQuery.ajax (so no try/catch here)
8240
xhr.send( ( s.hasContent && s.data ) || null );
8243
callback = function( _, isAbort ) {
8251
// Firefox throws exceptions when accessing properties
8252
// of an xhr when a network error occured
8253
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8256
// Was never called and is aborted or complete
8257
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8260
callback = undefined;
8262
// Do not keep as active anymore
8264
xhr.onreadystatechange = jQuery.noop;
8265
if ( xhrOnUnloadAbort ) {
8266
delete xhrCallbacks[ handle ];
8272
// Abort it manually if needed
8273
if ( xhr.readyState !== 4 ) {
8277
status = xhr.status;
8278
responseHeaders = xhr.getAllResponseHeaders();
8280
xml = xhr.responseXML;
8282
// Construct response list
8283
if ( xml && xml.documentElement /* #4958 */ ) {
8284
responses.xml = xml;
8287
// When requesting binary data, IE6-9 will throw an exception
8288
// on any attempt to access responseText (#11426)
8290
responses.text = xhr.responseText;
8294
// Firefox throws an exception when accessing
8295
// statusText for faulty cross-domain requests
8297
statusText = xhr.statusText;
8299
// We normalize with Webkit giving an empty statusText
8303
// Filter status for non standard behaviors
8305
// If the request is local and we have data: assume a success
8306
// (success with no data won't get notified, that's the best we
8307
// can do given current implementations)
8308
if ( !status && s.isLocal && !s.crossDomain ) {
8309
status = responses.text ? 200 : 404;
8310
// IE - #1450: sometimes returns 1223 when it should be 204
8311
} else if ( status === 1223 ) {
8316
} catch( firefoxAccessException ) {
8318
complete( -1, firefoxAccessException );
8322
// Call complete if needed
8324
complete( status, statusText, responses, responseHeaders );
8328
// if we're in sync mode or it's in cache
8329
// and has been retrieved directly (IE6 & IE7)
8330
// we need to manually fire the callback
8331
if ( !s.async || xhr.readyState === 4 ) {
8335
if ( xhrOnUnloadAbort ) {
8336
// Create the active xhrs callbacks list if needed
8337
// and attach the unload handler
8338
if ( !xhrCallbacks ) {
8340
jQuery( window ).unload( xhrOnUnloadAbort );
8342
// Add to list of active xhrs callbacks
8343
xhrCallbacks[ handle ] = callback;
8345
xhr.onreadystatechange = callback;
8362
var elemdisplay = {},
8364
rfxtypes = /^(?:toggle|show|hide)$/,
8365
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
8368
// height animations
8369
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
8371
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
8372
// opacity animations
8378
show: function( speed, easing, callback ) {
8381
if ( speed || speed === 0 ) {
8382
return this.animate( genFx("show", 3), speed, easing, callback );
8385
for ( var i = 0, j = this.length; i < j; i++ ) {
8389
display = elem.style.display;
8391
// Reset the inline display of this element to learn if it is
8392
// being hidden by cascaded rules or not
8393
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
8394
display = elem.style.display = "";
8397
// Set elements which have been overridden with display: none
8398
// in a stylesheet to whatever the default browser style is
8399
// for such an element
8400
if ( (display === "" && jQuery.css(elem, "display") === "none") ||
8401
!jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
8402
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
8407
// Set the display of most of the elements in a second loop
8408
// to avoid the constant reflow
8409
for ( i = 0; i < j; i++ ) {
8413
display = elem.style.display;
8415
if ( display === "" || display === "none" ) {
8416
elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
8425
hide: function( speed, easing, callback ) {
8426
if ( speed || speed === 0 ) {
8427
return this.animate( genFx("hide", 3), speed, easing, callback);
8434
for ( ; i < j; i++ ) {
8437
display = jQuery.css( elem, "display" );
8439
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
8440
jQuery._data( elem, "olddisplay", display );
8445
// Set the display of the elements in a second loop
8446
// to avoid the constant reflow
8447
for ( i = 0; i < j; i++ ) {
8448
if ( this[i].style ) {
8449
this[i].style.display = "none";
8457
// Save the old toggle function
8458
_toggle: jQuery.fn.toggle,
8460
toggle: function( fn, fn2, callback ) {
8461
var bool = typeof fn === "boolean";
8463
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
8464
this._toggle.apply( this, arguments );
8466
} else if ( fn == null || bool ) {
8467
this.each(function() {
8468
var state = bool ? fn : jQuery(this).is(":hidden");
8469
jQuery(this)[ state ? "show" : "hide" ]();
8473
this.animate(genFx("toggle", 3), fn, fn2, callback);
8479
fadeTo: function( speed, to, easing, callback ) {
8480
return this.filter(":hidden").css("opacity", 0).show().end()
8481
.animate({opacity: to}, speed, easing, callback);
8484
animate: function( prop, speed, easing, callback ) {
8485
var optall = jQuery.speed( speed, easing, callback );
8487
if ( jQuery.isEmptyObject( prop ) ) {
8488
return this.each( optall.complete, [ false ] );
8491
// Do not change referenced properties as per-property easing will be lost
8492
prop = jQuery.extend( {}, prop );
8494
function doAnimation() {
8495
// XXX 'this' does not always have a nodeName when running the
8498
if ( optall.queue === false ) {
8499
jQuery._mark( this );
8502
var opt = jQuery.extend( {}, optall ),
8503
isElement = this.nodeType === 1,
8504
hidden = isElement && jQuery(this).is(":hidden"),
8505
name, val, p, e, hooks, replace,
8506
parts, start, end, unit,
8509
// will store per property easing and be used to determine when an animation is complete
8510
opt.animatedProperties = {};
8512
// first pass over propertys to expand / normalize
8514
name = jQuery.camelCase( p );
8516
prop[ name ] = prop[ p ];
8520
if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
8521
replace = hooks.expand( prop[ name ] );
8522
delete prop[ name ];
8524
// not quite $.extend, this wont overwrite keys already present.
8525
// also - reusing 'p' from above because we have the correct "name"
8526
for ( p in replace ) {
8527
if ( ! ( p in prop ) ) {
8528
prop[ p ] = replace[ p ];
8534
for ( name in prop ) {
8536
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
8537
if ( jQuery.isArray( val ) ) {
8538
opt.animatedProperties[ name ] = val[ 1 ];
8539
val = prop[ name ] = val[ 0 ];
8541
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
8544
if ( val === "hide" && hidden || val === "show" && !hidden ) {
8545
return opt.complete.call( this );
8548
if ( isElement && ( name === "height" || name === "width" ) ) {
8549
// Make sure that nothing sneaks out
8550
// Record all 3 overflow attributes because IE does not
8551
// change the overflow attribute when overflowX and
8552
// overflowY are set to the same value
8553
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
8555
// Set display property to inline-block for height/width
8556
// animations on inline elements that are having width/height animated
8557
if ( jQuery.css( this, "display" ) === "inline" &&
8558
jQuery.css( this, "float" ) === "none" ) {
8560
// inline-level elements accept inline-block;
8561
// block-level elements need to be inline with layout
8562
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
8563
this.style.display = "inline-block";
8566
this.style.zoom = 1;
8572
if ( opt.overflow != null ) {
8573
this.style.overflow = "hidden";
8577
e = new jQuery.fx( this, opt, p );
8580
if ( rfxtypes.test( val ) ) {
8582
// Tracks whether to show or hide based on private
8583
// data attached to the element
8584
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
8586
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
8593
parts = rfxnum.exec( val );
8597
end = parseFloat( parts[2] );
8598
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
8600
// We need to compute starting value
8601
if ( unit !== "px" ) {
8602
jQuery.style( this, p, (end || 1) + unit);
8603
start = ( (end || 1) / e.cur() ) * start;
8604
jQuery.style( this, p, start + unit);
8607
// If a +=/-= token was provided, we're doing a relative animation
8609
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
8612
e.custom( start, end, unit );
8615
e.custom( start, val, "" );
8620
// For JS strict compliance
8624
return optall.queue === false ?
8625
this.each( doAnimation ) :
8626
this.queue( optall.queue, doAnimation );
8629
stop: function( type, clearQueue, gotoEnd ) {
8630
if ( typeof type !== "string" ) {
8631
gotoEnd = clearQueue;
8635
if ( clearQueue && type !== false ) {
8636
this.queue( type || "fx", [] );
8639
return this.each(function() {
8642
timers = jQuery.timers,
8643
data = jQuery._data( this );
8645
// clear marker counters if we know they won't be
8647
jQuery._unmark( true, this );
8650
function stopQueue( elem, data, index ) {
8651
var hooks = data[ index ];
8652
jQuery.removeData( elem, index, true );
8653
hooks.stop( gotoEnd );
8656
if ( type == null ) {
8657
for ( index in data ) {
8658
if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
8659
stopQueue( this, data, index );
8662
} else if ( data[ index = type + ".run" ] && data[ index ].stop ){
8663
stopQueue( this, data, index );
8666
for ( index = timers.length; index--; ) {
8667
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
8670
// force the next step to be the last
8671
timers[ index ]( true );
8673
timers[ index ].saveState();
8676
timers.splice( index, 1 );
8680
// start the next in the queue if the last step wasn't forced
8681
// timers currently will call their complete callbacks, which will dequeue
8682
// but only if they were gotoEnd
8683
if ( !( gotoEnd && hadTimers ) ) {
8684
jQuery.dequeue( this, type );
8691
// Animations created synchronously will run synchronously
8692
function createFxNow() {
8693
setTimeout( clearFxNow, 0 );
8694
return ( fxNow = jQuery.now() );
8697
function clearFxNow() {
8701
// Generate parameters to create a standard animation
8702
function genFx( type, num ) {
8705
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
8712
// Generate shortcuts for custom animations
8714
slideDown: genFx( "show", 1 ),
8715
slideUp: genFx( "hide", 1 ),
8716
slideToggle: genFx( "toggle", 1 ),
8717
fadeIn: { opacity: "show" },
8718
fadeOut: { opacity: "hide" },
8719
fadeToggle: { opacity: "toggle" }
8720
}, function( name, props ) {
8721
jQuery.fn[ name ] = function( speed, easing, callback ) {
8722
return this.animate( props, speed, easing, callback );
8727
speed: function( speed, easing, fn ) {
8728
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
8729
complete: fn || !fn && easing ||
8730
jQuery.isFunction( speed ) && speed,
8732
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
8735
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
8736
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
8738
// normalize opt.queue - true/undefined/null -> "fx"
8739
if ( opt.queue == null || opt.queue === true ) {
8744
opt.old = opt.complete;
8746
opt.complete = function( noUnmark ) {
8747
if ( jQuery.isFunction( opt.old ) ) {
8748
opt.old.call( this );
8752
jQuery.dequeue( this, opt.queue );
8753
} else if ( noUnmark !== false ) {
8754
jQuery._unmark( this );
8762
linear: function( p ) {
8765
swing: function( p ) {
8766
return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
8772
fx: function( elem, options, prop ) {
8773
this.options = options;
8777
options.orig = options.orig || {};
8782
jQuery.fx.prototype = {
8783
// Simple function for setting a style value
8784
update: function() {
8785
if ( this.options.step ) {
8786
this.options.step.call( this.elem, this.now, this );
8789
( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
8792
// Get the current size
8794
if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
8795
return this.elem[ this.prop ];
8799
r = jQuery.css( this.elem, this.prop );
8800
// Empty strings, null, undefined and "auto" are converted to 0,
8801
// complex values such as "rotate(1rad)" are returned as is,
8802
// simple values such as "10px" are parsed to Float.
8803
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
8806
// Start an animation from one number to another
8807
custom: function( from, to, unit ) {
8811
this.startTime = fxNow || createFxNow();
8813
this.now = this.start = from;
8814
this.pos = this.state = 0;
8815
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
8817
function t( gotoEnd ) {
8818
return self.step( gotoEnd );
8821
t.queue = this.options.queue;
8823
t.saveState = function() {
8824
if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
8825
if ( self.options.hide ) {
8826
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
8827
} else if ( self.options.show ) {
8828
jQuery._data( self.elem, "fxshow" + self.prop, self.end );
8833
if ( t() && jQuery.timers.push(t) && !timerId ) {
8834
timerId = setInterval( fx.tick, fx.interval );
8838
// Simple 'show' function
8840
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
8842
// Remember where we started, so that we can go back to it later
8843
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
8844
this.options.show = true;
8846
// Begin the animation
8847
// Make sure that we start at a small width/height to avoid any flash of content
8848
if ( dataShow !== undefined ) {
8849
// This show is picking up where a previous hide or show left off
8850
this.custom( this.cur(), dataShow );
8852
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
8855
// Start by showing the element
8856
jQuery( this.elem ).show();
8859
// Simple 'hide' function
8861
// Remember where we started, so that we can go back to it later
8862
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
8863
this.options.hide = true;
8865
// Begin the animation
8866
this.custom( this.cur(), 0 );
8869
// Each step of an animation
8870
step: function( gotoEnd ) {
8872
t = fxNow || createFxNow(),
8875
options = this.options;
8877
if ( gotoEnd || t >= options.duration + this.startTime ) {
8878
this.now = this.end;
8879
this.pos = this.state = 1;
8882
options.animatedProperties[ this.prop ] = true;
8884
for ( p in options.animatedProperties ) {
8885
if ( options.animatedProperties[ p ] !== true ) {
8891
// Reset the overflow
8892
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
8894
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
8895
elem.style[ "overflow" + value ] = options.overflow[ index ];
8899
// Hide the element if the "hide" operation was done
8900
if ( options.hide ) {
8901
jQuery( elem ).hide();
8904
// Reset the properties, if the item has been hidden or shown
8905
if ( options.hide || options.show ) {
8906
for ( p in options.animatedProperties ) {
8907
jQuery.style( elem, p, options.orig[ p ] );
8908
jQuery.removeData( elem, "fxshow" + p, true );
8909
// Toggle data is no longer needed
8910
jQuery.removeData( elem, "toggle" + p, true );
8914
// Execute the complete function
8915
// in the event that the complete function throws an exception
8916
// we must ensure it won't be called twice. #5684
8918
complete = options.complete;
8921
options.complete = false;
8922
complete.call( elem );
8929
// classical easing cannot be used with an Infinity duration
8930
if ( options.duration == Infinity ) {
8933
n = t - this.startTime;
8934
this.state = n / options.duration;
8936
// Perform the easing function, defaults to swing
8937
this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
8938
this.now = this.start + ( (this.end - this.start) * this.pos );
8940
// Perform the next step of the animation
8948
jQuery.extend( jQuery.fx, {
8951
timers = jQuery.timers,
8954
for ( ; i < timers.length; i++ ) {
8955
timer = timers[ i ];
8956
// Checks the timer has not already been removed
8957
if ( !timer() && timers[ i ] === timer ) {
8958
timers.splice( i--, 1 );
8962
if ( !timers.length ) {
8970
clearInterval( timerId );
8982
opacity: function( fx ) {
8983
jQuery.style( fx.elem, "opacity", fx.now );
8986
_default: function( fx ) {
8987
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
8988
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
8990
fx.elem[ fx.prop ] = fx.now;
8996
// Ensure props that can't be negative don't go there on undershoot easing
8997
jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
8998
// exclude marginTop, marginLeft, marginBottom and marginRight from this list
8999
if ( prop.indexOf( "margin" ) ) {
9000
jQuery.fx.step[ prop ] = function( fx ) {
9001
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
9006
if ( jQuery.expr && jQuery.expr.filters ) {
9007
jQuery.expr.filters.animated = function( elem ) {
9008
return jQuery.grep(jQuery.timers, function( fn ) {
9009
return elem === fn.elem;
9014
// Try to restore the default display value of an element
9015
function defaultDisplay( nodeName ) {
9017
if ( !elemdisplay[ nodeName ] ) {
9019
var body = document.body,
9020
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
9021
display = elem.css( "display" );
9024
// If the simple way fails,
9025
// get element's real default display by attaching it to a temp iframe
9026
if ( display === "none" || display === "" ) {
9027
// No iframe to use yet, so create it
9029
iframe = document.createElement( "iframe" );
9030
iframe.frameBorder = iframe.width = iframe.height = 0;
9033
body.appendChild( iframe );
9035
// Create a cacheable copy of the iframe document on first call.
9036
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
9037
// document to it; WebKit & Firefox won't allow reusing the iframe document.
9038
if ( !iframeDoc || !iframe.createElement ) {
9039
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
9040
iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
9044
elem = iframeDoc.createElement( nodeName );
9046
iframeDoc.body.appendChild( elem );
9048
display = jQuery.css( elem, "display" );
9049
body.removeChild( iframe );
9052
// Store the correct default display
9053
elemdisplay[ nodeName ] = display;
9056
return elemdisplay[ nodeName ];
9063
rtable = /^t(?:able|d|h)$/i,
9064
rroot = /^(?:body|html)$/i;
9066
if ( "getBoundingClientRect" in document.documentElement ) {
9067
getOffset = function( elem, doc, docElem, box ) {
9069
box = elem.getBoundingClientRect();
9072
// Make sure we're not dealing with a disconnected DOM node
9073
if ( !box || !jQuery.contains( docElem, elem ) ) {
9074
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
9077
var body = doc.body,
9078
win = getWindow( doc ),
9079
clientTop = docElem.clientTop || body.clientTop || 0,
9080
clientLeft = docElem.clientLeft || body.clientLeft || 0,
9081
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
9082
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
9083
top = box.top + scrollTop - clientTop,
9084
left = box.left + scrollLeft - clientLeft;
9086
return { top: top, left: left };
9090
getOffset = function( elem, doc, docElem ) {
9092
offsetParent = elem.offsetParent,
9093
prevOffsetParent = elem,
9095
defaultView = doc.defaultView,
9096
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
9097
top = elem.offsetTop,
9098
left = elem.offsetLeft;
9100
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
9101
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
9105
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
9106
top -= elem.scrollTop;
9107
left -= elem.scrollLeft;
9109
if ( elem === offsetParent ) {
9110
top += elem.offsetTop;
9111
left += elem.offsetLeft;
9113
if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
9114
top += parseFloat( computedStyle.borderTopWidth ) || 0;
9115
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
9118
prevOffsetParent = offsetParent;
9119
offsetParent = elem.offsetParent;
9122
if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
9123
top += parseFloat( computedStyle.borderTopWidth ) || 0;
9124
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
9127
prevComputedStyle = computedStyle;
9130
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
9131
top += body.offsetTop;
9132
left += body.offsetLeft;
9135
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
9136
top += Math.max( docElem.scrollTop, body.scrollTop );
9137
left += Math.max( docElem.scrollLeft, body.scrollLeft );
9140
return { top: top, left: left };
9144
jQuery.fn.offset = function( options ) {
9145
if ( arguments.length ) {
9146
return options === undefined ?
9148
this.each(function( i ) {
9149
jQuery.offset.setOffset( this, options, i );
9154
doc = elem && elem.ownerDocument;
9160
if ( elem === doc.body ) {
9161
return jQuery.offset.bodyOffset( elem );
9164
return getOffset( elem, doc, doc.documentElement );
9169
bodyOffset: function( body ) {
9170
var top = body.offsetTop,
9171
left = body.offsetLeft;
9173
if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
9174
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
9175
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
9178
return { top: top, left: left };
9181
setOffset: function( elem, options, i ) {
9182
var position = jQuery.css( elem, "position" );
9184
// set position first, in-case top/left are set even on static elem
9185
if ( position === "static" ) {
9186
elem.style.position = "relative";
9189
var curElem = jQuery( elem ),
9190
curOffset = curElem.offset(),
9191
curCSSTop = jQuery.css( elem, "top" ),
9192
curCSSLeft = jQuery.css( elem, "left" ),
9193
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9194
props = {}, curPosition = {}, curTop, curLeft;
9196
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9197
if ( calculatePosition ) {
9198
curPosition = curElem.position();
9199
curTop = curPosition.top;
9200
curLeft = curPosition.left;
9202
curTop = parseFloat( curCSSTop ) || 0;
9203
curLeft = parseFloat( curCSSLeft ) || 0;
9206
if ( jQuery.isFunction( options ) ) {
9207
options = options.call( elem, i, curOffset );
9210
if ( options.top != null ) {
9211
props.top = ( options.top - curOffset.top ) + curTop;
9213
if ( options.left != null ) {
9214
props.left = ( options.left - curOffset.left ) + curLeft;
9217
if ( "using" in options ) {
9218
options.using.call( elem, props );
9220
curElem.css( props );
9228
position: function() {
9235
// Get *real* offsetParent
9236
offsetParent = this.offsetParent(),
9238
// Get correct offsets
9239
offset = this.offset(),
9240
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
9242
// Subtract element margins
9243
// note: when an element has margin: auto the offsetLeft and marginLeft
9244
// are the same in Safari causing offset.left to incorrectly be 0
9245
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
9246
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
9248
// Add offsetParent borders
9249
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
9250
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
9252
// Subtract the two offsets
9254
top: offset.top - parentOffset.top,
9255
left: offset.left - parentOffset.left
9259
offsetParent: function() {
9260
return this.map(function() {
9261
var offsetParent = this.offsetParent || document.body;
9262
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
9263
offsetParent = offsetParent.offsetParent;
9265
return offsetParent;
9271
// Create scrollLeft and scrollTop methods
9272
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9273
var top = /Y/.test( prop );
9275
jQuery.fn[ method ] = function( val ) {
9276
return jQuery.access( this, function( elem, method, val ) {
9277
var win = getWindow( elem );
9279
if ( val === undefined ) {
9280
return win ? (prop in win) ? win[ prop ] :
9281
jQuery.support.boxModel && win.document.documentElement[ method ] ||
9282
win.document.body[ method ] :
9288
!top ? val : jQuery( win ).scrollLeft(),
9289
top ? val : jQuery( win ).scrollTop()
9293
elem[ method ] = val;
9295
}, method, val, arguments.length, null );
9299
function getWindow( elem ) {
9300
return jQuery.isWindow( elem ) ?
9302
elem.nodeType === 9 ?
9303
elem.defaultView || elem.parentWindow :
9310
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
9311
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9312
var clientProp = "client" + name,
9313
scrollProp = "scroll" + name,
9314
offsetProp = "offset" + name;
9316
// innerHeight and innerWidth
9317
jQuery.fn[ "inner" + name ] = function() {
9321
parseFloat( jQuery.css( elem, type, "padding" ) ) :
9326
// outerHeight and outerWidth
9327
jQuery.fn[ "outer" + name ] = function( margin ) {
9331
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
9336
jQuery.fn[ type ] = function( value ) {
9337
return jQuery.access( this, function( elem, type, value ) {
9338
var doc, docElemProp, orig, ret;
9340
if ( jQuery.isWindow( elem ) ) {
9341
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
9342
doc = elem.document;
9343
docElemProp = doc.documentElement[ clientProp ];
9344
return jQuery.support.boxModel && docElemProp ||
9345
doc.body && doc.body[ clientProp ] || docElemProp;
9348
// Get document width or height
9349
if ( elem.nodeType === 9 ) {
9350
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
9351
doc = elem.documentElement;
9353
// when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
9354
// so we can't use max, as it'll choose the incorrect offset[Width/Height]
9355
// instead we use the correct client[Width/Height]
9357
if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
9358
return doc[ clientProp ];
9362
elem.body[ scrollProp ], doc[ scrollProp ],
9363
elem.body[ offsetProp ], doc[ offsetProp ]
9367
// Get width or height on the element
9368
if ( value === undefined ) {
9369
orig = jQuery.css( elem, type );
9370
ret = parseFloat( orig );
9371
return jQuery.isNumeric( ret ) ? ret : orig;
9374
// Set the width or height on the element
9375
jQuery( elem ).css( type, value );
9376
}, type, value, arguments.length, null );
9383
// Expose jQuery to the global object
9384
window.jQuery = window.$ = jQuery;
9386
// Expose jQuery as an AMD module, but only for AMD loaders that
9387
// understand the issues with loading multiple versions of jQuery
9388
// in a page that all might call define(). The loader will indicate
9389
// they have special allowances for multiple jQuery versions by
9390
// specifying define.amd.jQuery = true. Register as a named module,
9391
// since jQuery can be concatenated with other files that may use define,
9392
// but not use a proper concatenation script that understands anonymous
9393
// AMD modules. A named AMD is safest and most robust way to register.
9394
// Lowercase jquery is used because AMD module names are derived from
9395
// file names, and jQuery is normally delivered in a lowercase file name.
9396
// Do this after creating the global so that if an AMD module wants to call
9397
// noConflict to hide this version of jQuery, it will work.
9398
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9399
define( "jquery", [], function () { return 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);