/[svn]/doc/tmpl/js/jquery-1.11.2.js
ViewVC logotype

Annotation of /doc/tmpl/js/jquery-1.11.2.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3276 - (hide annotations) (download) (as text)
Mon Jun 5 15:19:14 2017 UTC (6 years, 10 months ago) by schoenebeck
File MIME type: application/javascript
File size: 284450 byte(s)
- Fix of previous fix.

1 schoenebeck 2732 /*!
2     * jQuery JavaScript Library v1.11.2
3     * http://jquery.com/
4     *
5     * Includes Sizzle.js
6     * http://sizzlejs.com/
7     *
8     * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
9     * Released under the MIT license
10     * http://jquery.org/license
11     *
12     * Date: 2014-12-17T15:27Z
13     */
14    
15     (function( global, factory ) {
16    
17     if ( typeof module === "object" && typeof module.exports === "object" ) {
18     // For CommonJS and CommonJS-like environments where a proper window is present,
19     // execute the factory and get jQuery
20     // For environments that do not inherently posses a window with a document
21     // (such as Node.js), expose a jQuery-making factory as module.exports
22     // This accentuates the need for the creation of a real window
23     // e.g. var jQuery = require("jquery")(window);
24     // See ticket #14549 for more info
25     module.exports = global.document ?
26     factory( global, true ) :
27     function( w ) {
28     if ( !w.document ) {
29     throw new Error( "jQuery requires a window with a document" );
30     }
31     return factory( w );
32     };
33     } else {
34     factory( global );
35     }
36    
37     // Pass this if window is not defined yet
38     }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
39    
40     // Can't do this because several apps including ASP.NET trace
41     // the stack via arguments.caller.callee and Firefox dies if
42     // you try to trace through "use strict" call chains. (#13335)
43     // Support: Firefox 18+
44     //
45    
46     var deletedIds = [];
47    
48     var slice = deletedIds.slice;
49    
50     var concat = deletedIds.concat;
51    
52     var push = deletedIds.push;
53    
54     var indexOf = deletedIds.indexOf;
55    
56     var class2type = {};
57    
58     var toString = class2type.toString;
59    
60     var hasOwn = class2type.hasOwnProperty;
61    
62     var support = {};
63    
64    
65    
66     var
67     version = "1.11.2",
68    
69     // Define a local copy of jQuery
70     jQuery = function( selector, context ) {
71     // The jQuery object is actually just the init constructor 'enhanced'
72     // Need init if jQuery is called (just allow error to be thrown if not included)
73     return new jQuery.fn.init( selector, context );
74     },
75    
76     // Support: Android<4.1, IE<9
77     // Make sure we trim BOM and NBSP
78     rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
79    
80     // Matches dashed string for camelizing
81     rmsPrefix = /^-ms-/,
82     rdashAlpha = /-([\da-z])/gi,
83    
84     // Used by jQuery.camelCase as callback to replace()
85     fcamelCase = function( all, letter ) {
86     return letter.toUpperCase();
87     };
88    
89     jQuery.fn = jQuery.prototype = {
90     // The current version of jQuery being used
91     jquery: version,
92    
93     constructor: jQuery,
94    
95     // Start with an empty selector
96     selector: "",
97    
98     // The default length of a jQuery object is 0
99     length: 0,
100    
101     toArray: function() {
102     return slice.call( this );
103     },
104    
105     // Get the Nth element in the matched element set OR
106     // Get the whole matched element set as a clean array
107     get: function( num ) {
108     return num != null ?
109    
110     // Return just the one element from the set
111     ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
112    
113     // Return all the elements in a clean array
114     slice.call( this );
115     },
116    
117     // Take an array of elements and push it onto the stack
118     // (returning the new matched element set)
119     pushStack: function( elems ) {
120    
121     // Build a new jQuery matched element set
122     var ret = jQuery.merge( this.constructor(), elems );
123    
124     // Add the old object onto the stack (as a reference)
125     ret.prevObject = this;
126     ret.context = this.context;
127    
128     // Return the newly-formed element set
129     return ret;
130     },
131    
132     // Execute a callback for every element in the matched set.
133     // (You can seed the arguments with an array of args, but this is
134     // only used internally.)
135     each: function( callback, args ) {
136     return jQuery.each( this, callback, args );
137     },
138    
139     map: function( callback ) {
140     return this.pushStack( jQuery.map(this, function( elem, i ) {
141     return callback.call( elem, i, elem );
142     }));
143     },
144    
145     slice: function() {
146     return this.pushStack( slice.apply( this, arguments ) );
147     },
148    
149     first: function() {
150     return this.eq( 0 );
151     },
152    
153     last: function() {
154     return this.eq( -1 );
155     },
156    
157     eq: function( i ) {
158     var len = this.length,
159     j = +i + ( i < 0 ? len : 0 );
160     return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
161     },
162    
163     end: function() {
164     return this.prevObject || this.constructor(null);
165     },
166    
167     // For internal use only.
168     // Behaves like an Array's method, not like a jQuery method.
169     push: push,
170     sort: deletedIds.sort,
171     splice: deletedIds.splice
172     };
173    
174     jQuery.extend = jQuery.fn.extend = function() {
175     var src, copyIsArray, copy, name, options, clone,
176     target = arguments[0] || {},
177     i = 1,
178     length = arguments.length,
179     deep = false;
180    
181     // Handle a deep copy situation
182     if ( typeof target === "boolean" ) {
183     deep = target;
184    
185     // skip the boolean and the target
186     target = arguments[ i ] || {};
187     i++;
188     }
189    
190     // Handle case when target is a string or something (possible in deep copy)
191     if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
192     target = {};
193     }
194    
195     // extend jQuery itself if only one argument is passed
196     if ( i === length ) {
197     target = this;
198     i--;
199     }
200    
201     for ( ; i < length; i++ ) {
202     // Only deal with non-null/undefined values
203     if ( (options = arguments[ i ]) != null ) {
204     // Extend the base object
205     for ( name in options ) {
206     src = target[ name ];
207     copy = options[ name ];
208    
209     // Prevent never-ending loop
210     if ( target === copy ) {
211     continue;
212     }
213    
214     // Recurse if we're merging plain objects or arrays
215     if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
216     if ( copyIsArray ) {
217     copyIsArray = false;
218     clone = src && jQuery.isArray(src) ? src : [];
219    
220     } else {
221     clone = src && jQuery.isPlainObject(src) ? src : {};
222     }
223    
224     // Never move original objects, clone them
225     target[ name ] = jQuery.extend( deep, clone, copy );
226    
227     // Don't bring in undefined values
228     } else if ( copy !== undefined ) {
229     target[ name ] = copy;
230     }
231     }
232     }
233     }
234    
235     // Return the modified object
236     return target;
237     };
238    
239     jQuery.extend({
240     // Unique for each copy of jQuery on the page
241     expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
242    
243     // Assume jQuery is ready without the ready module
244     isReady: true,
245    
246     error: function( msg ) {
247     throw new Error( msg );
248     },
249    
250     noop: function() {},
251    
252     // See test/unit/core.js for details concerning isFunction.
253     // Since version 1.3, DOM methods and functions like alert
254     // aren't supported. They return false on IE (#2968).
255     isFunction: function( obj ) {
256     return jQuery.type(obj) === "function";
257     },
258    
259     isArray: Array.isArray || function( obj ) {
260     return jQuery.type(obj) === "array";
261     },
262    
263     isWindow: function( obj ) {
264     /* jshint eqeqeq: false */
265     return obj != null && obj == obj.window;
266     },
267    
268     isNumeric: function( obj ) {
269     // parseFloat NaNs numeric-cast false positives (null|true|false|"")
270     // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
271     // subtraction forces infinities to NaN
272     // adding 1 corrects loss of precision from parseFloat (#15100)
273     return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
274     },
275    
276     isEmptyObject: function( obj ) {
277     var name;
278     for ( name in obj ) {
279     return false;
280     }
281     return true;
282     },
283    
284     isPlainObject: function( obj ) {
285     var key;
286    
287     // Must be an Object.
288     // Because of IE, we also have to check the presence of the constructor property.
289     // Make sure that DOM nodes and window objects don't pass through, as well
290     if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
291     return false;
292     }
293    
294     try {
295     // Not own constructor property must be Object
296     if ( obj.constructor &&
297     !hasOwn.call(obj, "constructor") &&
298     !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
299     return false;
300     }
301     } catch ( e ) {
302     // IE8,9 Will throw exceptions on certain host objects #9897
303     return false;
304     }
305    
306     // Support: IE<9
307     // Handle iteration over inherited properties before own properties.
308     if ( support.ownLast ) {
309     for ( key in obj ) {
310     return hasOwn.call( obj, key );
311     }
312     }
313    
314     // Own properties are enumerated firstly, so to speed up,
315     // if last one is own, then all properties are own.
316     for ( key in obj ) {}
317    
318     return key === undefined || hasOwn.call( obj, key );
319     },
320    
321     type: function( obj ) {
322     if ( obj == null ) {
323     return obj + "";
324     }
325     return typeof obj === "object" || typeof obj === "function" ?
326     class2type[ toString.call(obj) ] || "object" :
327     typeof obj;
328     },
329    
330     // Evaluates a script in a global context
331     // Workarounds based on findings by Jim Driscoll
332     // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
333     globalEval: function( data ) {
334     if ( data && jQuery.trim( data ) ) {
335     // We use execScript on Internet Explorer
336     // We use an anonymous function so that context is window
337     // rather than jQuery in Firefox
338     ( window.execScript || function( data ) {
339     window[ "eval" ].call( window, data );
340     } )( data );
341     }
342     },
343    
344     // Convert dashed to camelCase; used by the css and data modules
345     // Microsoft forgot to hump their vendor prefix (#9572)
346     camelCase: function( string ) {
347     return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
348     },
349    
350     nodeName: function( elem, name ) {
351     return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
352     },
353    
354     // args is for internal usage only
355     each: function( obj, callback, args ) {
356     var value,
357     i = 0,
358     length = obj.length,
359     isArray = isArraylike( obj );
360    
361     if ( args ) {
362     if ( isArray ) {
363     for ( ; i < length; i++ ) {
364     value = callback.apply( obj[ i ], args );
365    
366     if ( value === false ) {
367     break;
368     }
369     }
370     } else {
371     for ( i in obj ) {
372     value = callback.apply( obj[ i ], args );
373    
374     if ( value === false ) {
375     break;
376     }
377     }
378     }
379    
380     // A special, fast, case for the most common use of each
381     } else {
382     if ( isArray ) {
383     for ( ; i < length; i++ ) {
384     value = callback.call( obj[ i ], i, obj[ i ] );
385    
386     if ( value === false ) {
387     break;
388     }
389     }
390     } else {
391     for ( i in obj ) {
392     value = callback.call( obj[ i ], i, obj[ i ] );
393    
394     if ( value === false ) {
395     break;
396     }
397     }
398     }
399     }
400    
401     return obj;
402     },
403    
404     // Support: Android<4.1, IE<9
405     trim: function( text ) {
406     return text == null ?
407     "" :
408     ( text + "" ).replace( rtrim, "" );
409     },
410    
411     // results is for internal usage only
412     makeArray: function( arr, results ) {
413     var ret = results || [];
414    
415     if ( arr != null ) {
416     if ( isArraylike( Object(arr) ) ) {
417     jQuery.merge( ret,
418     typeof arr === "string" ?
419     [ arr ] : arr
420     );
421     } else {
422     push.call( ret, arr );
423     }
424     }
425    
426     return ret;
427     },
428    
429     inArray: function( elem, arr, i ) {
430     var len;
431    
432     if ( arr ) {
433     if ( indexOf ) {
434     return indexOf.call( arr, elem, i );
435     }
436    
437     len = arr.length;
438     i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
439    
440     for ( ; i < len; i++ ) {
441     // Skip accessing in sparse arrays
442     if ( i in arr && arr[ i ] === elem ) {
443     return i;
444     }
445     }
446     }
447    
448     return -1;
449     },
450    
451     merge: function( first, second ) {
452     var len = +second.length,
453     j = 0,
454     i = first.length;
455    
456     while ( j < len ) {
457     first[ i++ ] = second[ j++ ];
458     }
459    
460     // Support: IE<9
461     // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
462     if ( len !== len ) {
463     while ( second[j] !== undefined ) {
464     first[ i++ ] = second[ j++ ];
465     }
466     }
467    
468     first.length = i;
469    
470     return first;
471     },
472    
473     grep: function( elems, callback, invert ) {
474     var callbackInverse,
475     matches = [],
476     i = 0,
477     length = elems.length,
478     callbackExpect = !invert;
479    
480     // Go through the array, only saving the items
481     // that pass the validator function
482     for ( ; i < length; i++ ) {
483     callbackInverse = !callback( elems[ i ], i );
484     if ( callbackInverse !== callbackExpect ) {
485     matches.push( elems[ i ] );
486     }
487     }
488    
489     return matches;
490     },
491    
492     // arg is for internal usage only
493     map: function( elems, callback, arg ) {
494     var value,
495     i = 0,
496     length = elems.length,
497     isArray = isArraylike( elems ),
498     ret = [];
499    
500     // Go through the array, translating each of the items to their new values
501     if ( isArray ) {
502     for ( ; i < length; i++ ) {
503     value = callback( elems[ i ], i, arg );
504    
505     if ( value != null ) {
506     ret.push( value );
507     }
508     }
509    
510     // Go through every key on the object,
511     } else {
512     for ( i in elems ) {
513     value = callback( elems[ i ], i, arg );
514    
515     if ( value != null ) {
516     ret.push( value );
517     }
518     }
519     }
520    
521     // Flatten any nested arrays
522     return concat.apply( [], ret );
523     },
524    
525     // A global GUID counter for objects
526     guid: 1,
527    
528     // Bind a function to a context, optionally partially applying any
529     // arguments.
530     proxy: function( fn, context ) {
531     var args, proxy, tmp;
532    
533     if ( typeof context === "string" ) {
534     tmp = fn[ context ];
535     context = fn;
536     fn = tmp;
537     }
538    
539     // Quick check to determine if target is callable, in the spec
540     // this throws a TypeError, but we will just return undefined.
541     if ( !jQuery.isFunction( fn ) ) {
542     return undefined;
543     }
544    
545     // Simulated bind
546     args = slice.call( arguments, 2 );
547     proxy = function() {
548     return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
549     };
550    
551     // Set the guid of unique handler to the same of original handler, so it can be removed
552     proxy.guid = fn.guid = fn.guid || jQuery.guid++;
553    
554     return proxy;
555     },
556    
557     now: function() {
558     return +( new Date() );
559     },
560    
561     // jQuery.support is not used in Core but other projects attach their
562     // properties to it so it needs to exist.
563     support: support
564     });
565    
566     // Populate the class2type map
567     jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
568     class2type[ "[object " + name + "]" ] = name.toLowerCase();
569     });
570    
571     function isArraylike( obj ) {
572     var length = obj.length,
573     type = jQuery.type( obj );
574    
575     if ( type === "function" || jQuery.isWindow( obj ) ) {
576     return false;
577     }
578    
579     if ( obj.nodeType === 1 && length ) {
580     return true;
581     }
582    
583     return type === "array" || length === 0 ||
584     typeof length === "number" && length > 0 && ( length - 1 ) in obj;
585     }
586     var Sizzle =
587     /*!
588     * Sizzle CSS Selector Engine v2.2.0-pre
589     * http://sizzlejs.com/
590     *
591     * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
592     * Released under the MIT license
593     * http://jquery.org/license
594     *
595     * Date: 2014-12-16
596     */
597     (function( window ) {
598    
599     var i,
600     support,
601     Expr,
602     getText,
603     isXML,
604     tokenize,
605     compile,
606     select,
607     outermostContext,
608     sortInput,
609     hasDuplicate,
610    
611     // Local document vars
612     setDocument,
613     document,
614     docElem,
615     documentIsHTML,
616     rbuggyQSA,
617     rbuggyMatches,
618     matches,
619     contains,
620    
621     // Instance-specific data
622     expando = "sizzle" + 1 * new Date(),
623     preferredDoc = window.document,
624     dirruns = 0,
625     done = 0,
626     classCache = createCache(),
627     tokenCache = createCache(),
628     compilerCache = createCache(),
629     sortOrder = function( a, b ) {
630     if ( a === b ) {
631     hasDuplicate = true;
632     }
633     return 0;
634     },
635    
636     // General-purpose constants
637     MAX_NEGATIVE = 1 << 31,
638    
639     // Instance methods
640     hasOwn = ({}).hasOwnProperty,
641     arr = [],
642     pop = arr.pop,
643     push_native = arr.push,
644     push = arr.push,
645     slice = arr.slice,
646     // Use a stripped-down indexOf as it's faster than native
647     // http://jsperf.com/thor-indexof-vs-for/5
648     indexOf = function( list, elem ) {
649     var i = 0,
650     len = list.length;
651     for ( ; i < len; i++ ) {
652     if ( list[i] === elem ) {
653     return i;
654     }
655     }
656     return -1;
657     },
658    
659     booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
660    
661     // Regular expressions
662    
663     // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
664     whitespace = "[\\x20\\t\\r\\n\\f]",
665     // http://www.w3.org/TR/css3-syntax/#characters
666     characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
667    
668     // Loosely modeled on CSS identifier characters
669     // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
670     // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
671     identifier = characterEncoding.replace( "w", "w#" ),
672    
673     // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
674     attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
675     // Operator (capture 2)
676     "*([*^$|!~]?=)" + whitespace +
677     // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
678     "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
679     "*\\]",
680    
681     pseudos = ":(" + characterEncoding + ")(?:\\((" +
682     // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
683     // 1. quoted (capture 3; capture 4 or capture 5)
684     "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
685     // 2. simple (capture 6)
686     "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
687     // 3. anything else (capture 2)
688     ".*" +
689     ")\\)|)",
690    
691     // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
692     rwhitespace = new RegExp( whitespace + "+", "g" ),
693     rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
694    
695     rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
696     rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
697    
698     rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
699    
700     rpseudo = new RegExp( pseudos ),
701     ridentifier = new RegExp( "^" + identifier + "$" ),
702    
703     matchExpr = {
704     "ID": new RegExp( "^#(" + characterEncoding + ")" ),
705     "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
706     "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
707     "ATTR": new RegExp( "^" + attributes ),
708     "PSEUDO": new RegExp( "^" + pseudos ),
709     "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
710     "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
711     "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
712     "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
713     // For use in libraries implementing .is()
714     // We use this for POS matching in `select`
715     "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
716     whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
717     },
718    
719     rinputs = /^(?:input|select|textarea|button)$/i,
720     rheader = /^h\d$/i,
721    
722     rnative = /^[^{]+\{\s*\[native \w/,
723    
724     // Easily-parseable/retrievable ID or TAG or CLASS selectors
725     rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
726    
727     rsibling = /[+~]/,
728     rescape = /'|\\/g,
729    
730     // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
731     runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
732     funescape = function( _, escaped, escapedWhitespace ) {
733     var high = "0x" + escaped - 0x10000;
734     // NaN means non-codepoint
735     // Support: Firefox<24
736     // Workaround erroneous numeric interpretation of +"0x"
737     return high !== high || escapedWhitespace ?
738     escaped :
739     high < 0 ?
740     // BMP codepoint
741     String.fromCharCode( high + 0x10000 ) :
742     // Supplemental Plane codepoint (surrogate pair)
743     String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
744     },
745    
746     // Used for iframes
747     // See setDocument()
748     // Removing the function wrapper causes a "Permission Denied"
749     // error in IE
750     unloadHandler = function() {
751     setDocument();
752     };
753    
754     // Optimize for push.apply( _, NodeList )
755     try {
756     push.apply(
757     (arr = slice.call( preferredDoc.childNodes )),
758     preferredDoc.childNodes
759     );
760     // Support: Android<4.0
761     // Detect silently failing push.apply
762     arr[ preferredDoc.childNodes.length ].nodeType;
763     } catch ( e ) {
764     push = { apply: arr.length ?
765    
766     // Leverage slice if possible
767     function( target, els ) {
768     push_native.apply( target, slice.call(els) );
769     } :
770    
771     // Support: IE<9
772     // Otherwise append directly
773     function( target, els ) {
774     var j = target.length,
775     i = 0;
776     // Can't trust NodeList.length
777     while ( (target[j++] = els[i++]) ) {}
778     target.length = j - 1;
779     }
780     };
781     }
782    
783     function Sizzle( selector, context, results, seed ) {
784     var match, elem, m, nodeType,
785     // QSA vars
786     i, groups, old, nid, newContext, newSelector;
787    
788     if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
789     setDocument( context );
790     }
791    
792     context = context || document;
793     results = results || [];
794     nodeType = context.nodeType;
795    
796     if ( typeof selector !== "string" || !selector ||
797     nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
798    
799     return results;
800     }
801    
802     if ( !seed && documentIsHTML ) {
803    
804     // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
805     if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
806     // Speed-up: Sizzle("#ID")
807     if ( (m = match[1]) ) {
808     if ( nodeType === 9 ) {
809     elem = context.getElementById( m );
810     // Check parentNode to catch when Blackberry 4.6 returns
811     // nodes that are no longer in the document (jQuery #6963)
812     if ( elem && elem.parentNode ) {
813     // Handle the case where IE, Opera, and Webkit return items
814     // by name instead of ID
815     if ( elem.id === m ) {
816     results.push( elem );
817     return results;
818     }
819     } else {
820     return results;
821     }
822     } else {
823     // Context is not a document
824     if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
825     contains( context, elem ) && elem.id === m ) {
826     results.push( elem );
827     return results;
828     }
829     }
830    
831     // Speed-up: Sizzle("TAG")
832     } else if ( match[2] ) {
833     push.apply( results, context.getElementsByTagName( selector ) );
834     return results;
835    
836     // Speed-up: Sizzle(".CLASS")
837     } else if ( (m = match[3]) && support.getElementsByClassName ) {
838     push.apply( results, context.getElementsByClassName( m ) );
839     return results;
840     }
841     }
842    
843     // QSA path
844     if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
845     nid = old = expando;
846     newContext = context;
847     newSelector = nodeType !== 1 && selector;
848    
849     // qSA works strangely on Element-rooted queries
850     // We can work around this by specifying an extra ID on the root
851     // and working up from there (Thanks to Andrew Dupont for the technique)
852     // IE 8 doesn't work on object elements
853     if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
854     groups = tokenize( selector );
855    
856     if ( (old = context.getAttribute("id")) ) {
857     nid = old.replace( rescape, "\\$&" );
858     } else {
859     context.setAttribute( "id", nid );
860     }
861     nid = "[id='" + nid + "'] ";
862    
863     i = groups.length;
864     while ( i-- ) {
865     groups[i] = nid + toSelector( groups[i] );
866     }
867     newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
868     newSelector = groups.join(",");
869     }
870    
871     if ( newSelector ) {
872     try {
873     push.apply( results,
874     newContext.querySelectorAll( newSelector )
875     );
876     return results;
877     } catch(qsaError) {
878     } finally {
879     if ( !old ) {
880     context.removeAttribute("id");
881     }
882     }
883     }
884     }
885     }
886    
887     // All others
888     return select( selector.replace( rtrim, "$1" ), context, results, seed );
889     }
890    
891     /**
892     * Create key-value caches of limited size
893     * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
894     * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
895     * deleting the oldest entry
896     */
897     function createCache() {
898     var keys = [];
899    
900     function cache( key, value ) {
901     // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
902     if ( keys.push( key + " " ) > Expr.cacheLength ) {
903     // Only keep the most recent entries
904     delete cache[ keys.shift() ];
905     }
906     return (cache[ key + " " ] = value);
907     }
908     return cache;
909     }
910    
911     /**
912     * Mark a function for special use by Sizzle
913     * @param {Function} fn The function to mark
914     */
915     function markFunction( fn ) {
916     fn[ expando ] = true;
917     return fn;
918     }
919    
920     /**
921     * Support testing using an element
922     * @param {Function} fn Passed the created div and expects a boolean result
923     */
924     function assert( fn ) {
925     var div = document.createElement("div");
926    
927     try {
928     return !!fn( div );
929     } catch (e) {
930     return false;
931     } finally {
932     // Remove from its parent by default
933     if ( div.parentNode ) {
934     div.parentNode.removeChild( div );
935     }
936     // release memory in IE
937     div = null;
938     }
939     }
940    
941     /**
942     * Adds the same handler for all of the specified attrs
943     * @param {String} attrs Pipe-separated list of attributes
944     * @param {Function} handler The method that will be applied
945     */
946     function addHandle( attrs, handler ) {
947     var arr = attrs.split("|"),
948     i = attrs.length;
949    
950     while ( i-- ) {
951     Expr.attrHandle[ arr[i] ] = handler;
952     }
953     }
954    
955     /**
956     * Checks document order of two siblings
957     * @param {Element} a
958     * @param {Element} b
959     * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
960     */
961     function siblingCheck( a, b ) {
962     var cur = b && a,
963     diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
964     ( ~b.sourceIndex || MAX_NEGATIVE ) -
965     ( ~a.sourceIndex || MAX_NEGATIVE );
966    
967     // Use IE sourceIndex if available on both nodes
968     if ( diff ) {
969     return diff;
970     }
971    
972     // Check if b follows a
973     if ( cur ) {
974     while ( (cur = cur.nextSibling) ) {
975     if ( cur === b ) {
976     return -1;
977     }
978     }
979     }
980    
981     return a ? 1 : -1;
982     }
983    
984     /**
985     * Returns a function to use in pseudos for input types
986     * @param {String} type
987     */
988     function createInputPseudo( type ) {
989     return function( elem ) {
990     var name = elem.nodeName.toLowerCase();
991     return name === "input" && elem.type === type;
992     };
993     }
994    
995     /**
996     * Returns a function to use in pseudos for buttons
997     * @param {String} type
998     */
999     function createButtonPseudo( type ) {
1000     return function( elem ) {
1001     var name = elem.nodeName.toLowerCase();
1002     return (name === "input" || name === "button") && elem.type === type;
1003     };
1004     }
1005    
1006     /**
1007     * Returns a function to use in pseudos for positionals
1008     * @param {Function} fn
1009     */
1010     function createPositionalPseudo( fn ) {
1011     return markFunction(function( argument ) {
1012     argument = +argument;
1013     return markFunction(function( seed, matches ) {
1014     var j,
1015     matchIndexes = fn( [], seed.length, argument ),
1016     i = matchIndexes.length;
1017    
1018     // Match elements found at the specified indexes
1019     while ( i-- ) {
1020     if ( seed[ (j = matchIndexes[i]) ] ) {
1021     seed[j] = !(matches[j] = seed[j]);
1022     }
1023     }
1024     });
1025     });
1026     }
1027    
1028     /**
1029     * Checks a node for validity as a Sizzle context
1030     * @param {Element|Object=} context
1031     * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1032     */
1033     function testContext( context ) {
1034     return context && typeof context.getElementsByTagName !== "undefined" && context;
1035     }
1036    
1037     // Expose support vars for convenience
1038     support = Sizzle.support = {};
1039    
1040     /**
1041     * Detects XML nodes
1042     * @param {Element|Object} elem An element or a document
1043     * @returns {Boolean} True iff elem is a non-HTML XML node
1044     */
1045     isXML = Sizzle.isXML = function( elem ) {
1046     // documentElement is verified for cases where it doesn't yet exist
1047     // (such as loading iframes in IE - #4833)
1048     var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1049     return documentElement ? documentElement.nodeName !== "HTML" : false;
1050     };
1051    
1052     /**
1053     * Sets document-related variables once based on the current document
1054     * @param {Element|Object} [doc] An element or document object to use to set the document
1055     * @returns {Object} Returns the current document
1056     */
1057     setDocument = Sizzle.setDocument = function( node ) {
1058     var hasCompare, parent,
1059     doc = node ? node.ownerDocument || node : preferredDoc;
1060    
1061     // If no document and documentElement is available, return
1062     if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1063     return document;
1064     }
1065    
1066     // Set our document
1067     document = doc;
1068     docElem = doc.documentElement;
1069     parent = doc.defaultView;
1070    
1071     // Support: IE>8
1072     // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1073     // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1074     // IE6-8 do not support the defaultView property so parent will be undefined
1075     if ( parent && parent !== parent.top ) {
1076     // IE11 does not have attachEvent, so all must suffer
1077     if ( parent.addEventListener ) {
1078     parent.addEventListener( "unload", unloadHandler, false );
1079     } else if ( parent.attachEvent ) {
1080     parent.attachEvent( "onunload", unloadHandler );
1081     }
1082     }
1083    
1084     /* Support tests
1085     ---------------------------------------------------------------------- */
1086     documentIsHTML = !isXML( doc );
1087    
1088     /* Attributes
1089     ---------------------------------------------------------------------- */
1090    
1091     // Support: IE<8
1092     // Verify that getAttribute really returns attributes and not properties
1093     // (excepting IE8 booleans)
1094     support.attributes = assert(function( div ) {
1095     div.className = "i";
1096     return !div.getAttribute("className");
1097     });
1098    
1099     /* getElement(s)By*
1100     ---------------------------------------------------------------------- */
1101    
1102     // Check if getElementsByTagName("*") returns only elements
1103     support.getElementsByTagName = assert(function( div ) {
1104     div.appendChild( doc.createComment("") );
1105     return !div.getElementsByTagName("*").length;
1106     });
1107    
1108     // Support: IE<9
1109     support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
1110    
1111     // Support: IE<10
1112     // Check if getElementById returns elements by name
1113     // The broken getElementById methods don't pick up programatically-set names,
1114     // so use a roundabout getElementsByName test
1115     support.getById = assert(function( div ) {
1116     docElem.appendChild( div ).id = expando;
1117     return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1118     });
1119    
1120     // ID find and filter
1121     if ( support.getById ) {
1122     Expr.find["ID"] = function( id, context ) {
1123     if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1124     var m = context.getElementById( id );
1125     // Check parentNode to catch when Blackberry 4.6 returns
1126     // nodes that are no longer in the document #6963
1127     return m && m.parentNode ? [ m ] : [];
1128     }
1129     };
1130     Expr.filter["ID"] = function( id ) {
1131     var attrId = id.replace( runescape, funescape );
1132     return function( elem ) {
1133     return elem.getAttribute("id") === attrId;
1134     };
1135     };
1136     } else {
1137     // Support: IE6/7
1138     // getElementById is not reliable as a find shortcut
1139     delete Expr.find["ID"];
1140    
1141     Expr.filter["ID"] = function( id ) {
1142     var attrId = id.replace( runescape, funescape );
1143     return function( elem ) {
1144     var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1145     return node && node.value === attrId;
1146     };
1147     };
1148     }
1149    
1150     // Tag
1151     Expr.find["TAG"] = support.getElementsByTagName ?
1152     function( tag, context ) {
1153     if ( typeof context.getElementsByTagName !== "undefined" ) {
1154     return context.getElementsByTagName( tag );
1155    
1156     // DocumentFragment nodes don't have gEBTN
1157     } else if ( support.qsa ) {
1158     return context.querySelectorAll( tag );
1159     }
1160     } :
1161    
1162     function( tag, context ) {
1163     var elem,
1164     tmp = [],
1165     i = 0,
1166     // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1167     results = context.getElementsByTagName( tag );
1168    
1169     // Filter out possible comments
1170     if ( tag === "*" ) {
1171     while ( (elem = results[i++]) ) {
1172     if ( elem.nodeType === 1 ) {
1173     tmp.push( elem );
1174     }
1175     }
1176    
1177     return tmp;
1178     }
1179     return results;
1180     };
1181    
1182     // Class
1183     Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1184     if ( documentIsHTML ) {
1185     return context.getElementsByClassName( className );
1186     }
1187     };
1188    
1189     /* QSA/matchesSelector
1190     ---------------------------------------------------------------------- */
1191    
1192     // QSA and matchesSelector support
1193    
1194     // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1195     rbuggyMatches = [];
1196    
1197     // qSa(:focus) reports false when true (Chrome 21)
1198     // We allow this because of a bug in IE8/9 that throws an error
1199     // whenever `document.activeElement` is accessed on an iframe
1200     // So, we allow :focus to pass through QSA all the time to avoid the IE error
1201     // See http://bugs.jquery.com/ticket/13378
1202     rbuggyQSA = [];
1203    
1204     if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1205     // Build QSA regex
1206     // Regex strategy adopted from Diego Perini
1207     assert(function( div ) {
1208     // Select is set to empty string on purpose
1209     // This is to test IE's treatment of not explicitly
1210     // setting a boolean content attribute,
1211     // since its presence should be enough
1212     // http://bugs.jquery.com/ticket/12359
1213     docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
1214     "<select id='" + expando + "-\f]' msallowcapture=''>" +
1215     "<option selected=''></option></select>";
1216    
1217     // Support: IE8, Opera 11-12.16
1218     // Nothing should be selected when empty strings follow ^= or $= or *=
1219     // The test attribute must be unknown in Opera but "safe" for WinRT
1220     // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1221     if ( div.querySelectorAll("[msallowcapture^='']").length ) {
1222     rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1223     }
1224    
1225     // Support: IE8
1226     // Boolean attributes and "value" are not treated correctly
1227     if ( !div.querySelectorAll("[selected]").length ) {
1228     rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1229     }
1230    
1231     // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
1232     if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1233     rbuggyQSA.push("~=");
1234     }
1235    
1236     // Webkit/Opera - :checked should return selected option elements
1237     // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1238     // IE8 throws error here and will not see later tests
1239     if ( !div.querySelectorAll(":checked").length ) {
1240     rbuggyQSA.push(":checked");
1241     }
1242    
1243     // Support: Safari 8+, iOS 8+
1244     // https://bugs.webkit.org/show_bug.cgi?id=136851
1245     // In-page `selector#id sibing-combinator selector` fails
1246     if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
1247     rbuggyQSA.push(".#.+[+~]");
1248     }
1249     });
1250    
1251     assert(function( div ) {
1252     // Support: Windows 8 Native Apps
1253     // The type and name attributes are restricted during .innerHTML assignment
1254     var input = doc.createElement("input");
1255     input.setAttribute( "type", "hidden" );
1256     div.appendChild( input ).setAttribute( "name", "D" );
1257    
1258     // Support: IE8
1259     // Enforce case-sensitivity of name attribute
1260     if ( div.querySelectorAll("[name=d]").length ) {
1261     rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1262     }
1263    
1264     // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1265     // IE8 throws error here and will not see later tests
1266     if ( !div.querySelectorAll(":enabled").length ) {
1267     rbuggyQSA.push( ":enabled", ":disabled" );
1268     }
1269    
1270     // Opera 10-11 does not throw on post-comma invalid pseudos
1271     div.querySelectorAll("*,:x");
1272     rbuggyQSA.push(",.*:");
1273     });
1274     }
1275    
1276     if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1277     docElem.webkitMatchesSelector ||
1278     docElem.mozMatchesSelector ||
1279     docElem.oMatchesSelector ||
1280     docElem.msMatchesSelector) )) ) {
1281    
1282     assert(function( div ) {
1283     // Check to see if it's possible to do matchesSelector
1284     // on a disconnected node (IE 9)
1285     support.disconnectedMatch = matches.call( div, "div" );
1286    
1287     // This should fail with an exception
1288     // Gecko does not error, returns false instead
1289     matches.call( div, "[s!='']:x" );
1290     rbuggyMatches.push( "!=", pseudos );
1291     });
1292     }
1293    
1294     rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1295     rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1296    
1297     /* Contains
1298     ---------------------------------------------------------------------- */
1299     hasCompare = rnative.test( docElem.compareDocumentPosition );
1300    
1301     // Element contains another
1302     // Purposefully does not implement inclusive descendent
1303     // As in, an element does not contain itself
1304     contains = hasCompare || rnative.test( docElem.contains ) ?
1305     function( a, b ) {
1306     var adown = a.nodeType === 9 ? a.documentElement : a,
1307     bup = b && b.parentNode;
1308     return a === bup || !!( bup && bup.nodeType === 1 && (
1309     adown.contains ?
1310     adown.contains( bup ) :
1311     a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1312     ));
1313     } :
1314     function( a, b ) {
1315     if ( b ) {
1316     while ( (b = b.parentNode) ) {
1317     if ( b === a ) {
1318     return true;
1319     }
1320     }
1321     }
1322     return false;
1323     };
1324    
1325     /* Sorting
1326     ---------------------------------------------------------------------- */
1327    
1328     // Document order sorting
1329     sortOrder = hasCompare ?
1330     function( a, b ) {
1331    
1332     // Flag for duplicate removal
1333     if ( a === b ) {
1334     hasDuplicate = true;
1335     return 0;
1336     }
1337    
1338     // Sort on method existence if only one input has compareDocumentPosition
1339     var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1340     if ( compare ) {
1341     return compare;
1342     }
1343    
1344     // Calculate position if both inputs belong to the same document
1345     compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1346     a.compareDocumentPosition( b ) :
1347    
1348     // Otherwise we know they are disconnected
1349     1;
1350    
1351     // Disconnected nodes
1352     if ( compare & 1 ||
1353     (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1354    
1355     // Choose the first element that is related to our preferred document
1356     if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1357     return -1;
1358     }
1359     if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1360     return 1;
1361     }
1362    
1363     // Maintain original order
1364     return sortInput ?
1365     ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1366     0;
1367     }
1368    
1369     return compare & 4 ? -1 : 1;
1370     } :
1371     function( a, b ) {
1372     // Exit early if the nodes are identical
1373     if ( a === b ) {
1374     hasDuplicate = true;
1375     return 0;
1376     }
1377    
1378     var cur,
1379     i = 0,
1380     aup = a.parentNode,
1381     bup = b.parentNode,
1382     ap = [ a ],
1383     bp = [ b ];
1384    
1385     // Parentless nodes are either documents or disconnected
1386     if ( !aup || !bup ) {
1387     return a === doc ? -1 :
1388     b === doc ? 1 :
1389     aup ? -1 :
1390     bup ? 1 :
1391     sortInput ?
1392     ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1393     0;
1394    
1395     // If the nodes are siblings, we can do a quick check
1396     } else if ( aup === bup ) {
1397     return siblingCheck( a, b );
1398     }
1399    
1400     // Otherwise we need full lists of their ancestors for comparison
1401     cur = a;
1402     while ( (cur = cur.parentNode) ) {
1403     ap.unshift( cur );
1404     }
1405     cur = b;
1406     while ( (cur = cur.parentNode) ) {
1407     bp.unshift( cur );
1408     }
1409    
1410     // Walk down the tree looking for a discrepancy
1411     while ( ap[i] === bp[i] ) {
1412     i++;
1413     }
1414    
1415     return i ?
1416     // Do a sibling check if the nodes have a common ancestor
1417     siblingCheck( ap[i], bp[i] ) :
1418    
1419     // Otherwise nodes in our document sort first
1420     ap[i] === preferredDoc ? -1 :
1421     bp[i] === preferredDoc ? 1 :
1422     0;
1423     };
1424    
1425     return doc;
1426     };
1427    
1428     Sizzle.matches = function( expr, elements ) {
1429     return Sizzle( expr, null, null, elements );
1430     };
1431    
1432     Sizzle.matchesSelector = function( elem, expr ) {
1433     // Set document vars if needed
1434     if ( ( elem.ownerDocument || elem ) !== document ) {
1435     setDocument( elem );
1436     }
1437    
1438     // Make sure that attribute selectors are quoted
1439     expr = expr.replace( rattributeQuotes, "='$1']" );
1440    
1441     if ( support.matchesSelector && documentIsHTML &&
1442     ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1443     ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1444    
1445     try {
1446     var ret = matches.call( elem, expr );
1447    
1448     // IE 9's matchesSelector returns false on disconnected nodes
1449     if ( ret || support.disconnectedMatch ||
1450     // As well, disconnected nodes are said to be in a document
1451     // fragment in IE 9
1452     elem.document && elem.document.nodeType !== 11 ) {
1453     return ret;
1454     }
1455     } catch (e) {}
1456     }
1457    
1458     return Sizzle( expr, document, null, [ elem ] ).length > 0;
1459     };
1460    
1461     Sizzle.contains = function( context, elem ) {
1462     // Set document vars if needed
1463     if ( ( context.ownerDocument || context ) !== document ) {
1464     setDocument( context );
1465     }
1466     return contains( context, elem );
1467     };
1468    
1469     Sizzle.attr = function( elem, name ) {
1470     // Set document vars if needed
1471     if ( ( elem.ownerDocument || elem ) !== document ) {
1472     setDocument( elem );
1473     }
1474    
1475     var fn = Expr.attrHandle[ name.toLowerCase() ],
1476     // Don't get fooled by Object.prototype properties (jQuery #13807)
1477     val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1478     fn( elem, name, !documentIsHTML ) :
1479     undefined;
1480    
1481     return val !== undefined ?
1482     val :
1483     support.attributes || !documentIsHTML ?
1484     elem.getAttribute( name ) :
1485     (val = elem.getAttributeNode(name)) && val.specified ?
1486     val.value :
1487     null;
1488     };
1489    
1490     Sizzle.error = function( msg ) {
1491     throw new Error( "Syntax error, unrecognized expression: " + msg );
1492     };
1493    
1494     /**
1495     * Document sorting and removing duplicates
1496     * @param {ArrayLike} results
1497     */
1498     Sizzle.uniqueSort = function( results ) {
1499     var elem,
1500     duplicates = [],
1501     j = 0,
1502     i = 0;
1503    
1504     // Unless we *know* we can detect duplicates, assume their presence
1505     hasDuplicate = !support.detectDuplicates;
1506     sortInput = !support.sortStable && results.slice( 0 );
1507     results.sort( sortOrder );
1508    
1509     if ( hasDuplicate ) {
1510     while ( (elem = results[i++]) ) {
1511     if ( elem === results[ i ] ) {
1512     j = duplicates.push( i );
1513     }
1514     }
1515     while ( j-- ) {
1516     results.splice( duplicates[ j ], 1 );
1517     }
1518     }
1519    
1520     // Clear input after sorting to release objects
1521     // See https://github.com/jquery/sizzle/pull/225
1522     sortInput = null;
1523    
1524     return results;
1525     };
1526    
1527     /**
1528     * Utility function for retrieving the text value of an array of DOM nodes
1529     * @param {Array|Element} elem
1530     */
1531     getText = Sizzle.getText = function( elem ) {
1532     var node,
1533     ret = "",
1534     i = 0,
1535     nodeType = elem.nodeType;
1536    
1537     if ( !nodeType ) {
1538     // If no nodeType, this is expected to be an array
1539     while ( (node = elem[i++]) ) {
1540     // Do not traverse comment nodes
1541     ret += getText( node );
1542     }
1543     } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1544     // Use textContent for elements
1545     // innerText usage removed for consistency of new lines (jQuery #11153)
1546     if ( typeof elem.textContent === "string" ) {
1547     return elem.textContent;
1548     } else {
1549     // Traverse its children
1550     for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1551     ret += getText( elem );
1552     }
1553     }
1554     } else if ( nodeType === 3 || nodeType === 4 ) {
1555     return elem.nodeValue;
1556     }
1557     // Do not include comment or processing instruction nodes
1558    
1559     return ret;
1560     };
1561    
1562     Expr = Sizzle.selectors = {
1563    
1564     // Can be adjusted by the user
1565     cacheLength: 50,
1566    
1567     createPseudo: markFunction,
1568    
1569     match: matchExpr,
1570    
1571     attrHandle: {},
1572    
1573     find: {},
1574    
1575     relative: {
1576     ">": { dir: "parentNode", first: true },
1577     " ": { dir: "parentNode" },
1578     "+": { dir: "previousSibling", first: true },
1579     "~": { dir: "previousSibling" }
1580     },
1581    
1582     preFilter: {
1583     "ATTR": function( match ) {
1584     match[1] = match[1].replace( runescape, funescape );
1585    
1586     // Move the given value to match[3] whether quoted or unquoted
1587     match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1588    
1589     if ( match[2] === "~=" ) {
1590     match[3] = " " + match[3] + " ";
1591     }
1592    
1593     return match.slice( 0, 4 );
1594     },
1595    
1596     "CHILD": function( match ) {
1597     /* matches from matchExpr["CHILD"]
1598     1 type (only|nth|...)
1599     2 what (child|of-type)
1600     3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1601     4 xn-component of xn+y argument ([+-]?\d*n|)
1602     5 sign of xn-component
1603     6 x of xn-component
1604     7 sign of y-component
1605     8 y of y-component
1606     */
1607     match[1] = match[1].toLowerCase();
1608    
1609     if ( match[1].slice( 0, 3 ) === "nth" ) {
1610     // nth-* requires argument
1611     if ( !match[3] ) {
1612     Sizzle.error( match[0] );
1613     }
1614    
1615     // numeric x and y parameters for Expr.filter.CHILD
1616     // remember that false/true cast respectively to 0/1
1617     match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1618     match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1619    
1620     // other types prohibit arguments
1621     } else if ( match[3] ) {
1622     Sizzle.error( match[0] );
1623     }
1624    
1625     return match;
1626     },
1627    
1628     "PSEUDO": function( match ) {
1629     var excess,
1630     unquoted = !match[6] && match[2];
1631    
1632     if ( matchExpr["CHILD"].test( match[0] ) ) {
1633     return null;
1634     }
1635    
1636     // Accept quoted arguments as-is
1637     if ( match[3] ) {
1638     match[2] = match[4] || match[5] || "";
1639    
1640     // Strip excess characters from unquoted arguments
1641     } else if ( unquoted && rpseudo.test( unquoted ) &&
1642     // Get excess from tokenize (recursively)
1643     (excess = tokenize( unquoted, true )) &&
1644     // advance to the next closing parenthesis
1645     (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1646    
1647     // excess is a negative index
1648     match[0] = match[0].slice( 0, excess );
1649     match[2] = unquoted.slice( 0, excess );
1650     }
1651    
1652     // Return only captures needed by the pseudo filter method (type and argument)
1653     return match.slice( 0, 3 );
1654     }
1655     },
1656    
1657     filter: {
1658    
1659     "TAG": function( nodeNameSelector ) {
1660     var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1661     return nodeNameSelector === "*" ?
1662     function() { return true; } :
1663     function( elem ) {
1664     return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1665     };
1666     },
1667    
1668     "CLASS": function( className ) {
1669     var pattern = classCache[ className + " " ];
1670    
1671     return pattern ||
1672     (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1673     classCache( className, function( elem ) {
1674     return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1675     });
1676     },
1677    
1678     "ATTR": function( name, operator, check ) {
1679     return function( elem ) {
1680     var result = Sizzle.attr( elem, name );
1681    
1682     if ( result == null ) {
1683     return operator === "!=";
1684     }
1685     if ( !operator ) {
1686     return true;
1687     }
1688    
1689     result += "";
1690    
1691     return operator === "=" ? result === check :
1692     operator === "!=" ? result !== check :
1693     operator === "^=" ? check && result.indexOf( check ) === 0 :
1694     operator === "*=" ? check && result.indexOf( check ) > -1 :
1695     operator === "$=" ? check && result.slice( -check.length ) === check :
1696     operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1697     operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1698     false;
1699     };
1700     },
1701    
1702     "CHILD": function( type, what, argument, first, last ) {
1703     var simple = type.slice( 0, 3 ) !== "nth",
1704     forward = type.slice( -4 ) !== "last",
1705     ofType = what === "of-type";
1706    
1707     return first === 1 && last === 0 ?
1708    
1709     // Shortcut for :nth-*(n)
1710     function( elem ) {
1711     return !!elem.parentNode;
1712     } :
1713    
1714     function( elem, context, xml ) {
1715     var cache, outerCache, node, diff, nodeIndex, start,
1716     dir = simple !== forward ? "nextSibling" : "previousSibling",
1717     parent = elem.parentNode,
1718     name = ofType && elem.nodeName.toLowerCase(),
1719     useCache = !xml && !ofType;
1720    
1721     if ( parent ) {
1722    
1723     // :(first|last|only)-(child|of-type)
1724     if ( simple ) {
1725     while ( dir ) {
1726     node = elem;
1727     while ( (node = node[ dir ]) ) {
1728     if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1729     return false;
1730     }
1731     }
1732     // Reverse direction for :only-* (if we haven't yet done so)
1733     start = dir = type === "only" && !start && "nextSibling";
1734     }
1735     return true;
1736     }
1737    
1738     start = [ forward ? parent.firstChild : parent.lastChild ];
1739    
1740     // non-xml :nth-child(...) stores cache data on `parent`
1741     if ( forward && useCache ) {
1742     // Seek `elem` from a previously-cached index
1743     outerCache = parent[ expando ] || (parent[ expando ] = {});
1744     cache = outerCache[ type ] || [];
1745     nodeIndex = cache[0] === dirruns && cache[1];
1746     diff = cache[0] === dirruns && cache[2];
1747     node = nodeIndex && parent.childNodes[ nodeIndex ];
1748    
1749     while ( (node = ++nodeIndex && node && node[ dir ] ||
1750    
1751     // Fallback to seeking `elem` from the start
1752     (diff = nodeIndex = 0) || start.pop()) ) {
1753    
1754     // When found, cache indexes on `parent` and break
1755     if ( node.nodeType === 1 && ++diff && node === elem ) {
1756     outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1757     break;
1758     }
1759     }
1760    
1761     // Use previously-cached element index if available
1762     } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1763     diff = cache[1];
1764    
1765     // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1766     } else {
1767     // Use the same loop as above to seek `elem` from the start
1768     while ( (node = ++nodeIndex && node && node[ dir ] ||
1769     (diff = nodeIndex = 0) || start.pop()) ) {
1770    
1771     if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1772     // Cache the index of each encountered element
1773     if ( useCache ) {
1774     (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1775     }
1776    
1777     if ( node === elem ) {
1778     break;
1779     }
1780     }
1781     }
1782     }
1783    
1784     // Incorporate the offset, then check against cycle size
1785     diff -= last;
1786     return diff === first || ( diff % first === 0 && diff / first >= 0 );
1787     }
1788     };
1789     },
1790    
1791     "PSEUDO": function( pseudo, argument ) {
1792     // pseudo-class names are case-insensitive
1793     // http://www.w3.org/TR/selectors/#pseudo-classes
1794     // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1795     // Remember that setFilters inherits from pseudos
1796     var args,
1797     fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1798     Sizzle.error( "unsupported pseudo: " + pseudo );
1799    
1800     // The user may use createPseudo to indicate that
1801     // arguments are needed to create the filter function
1802     // just as Sizzle does
1803     if ( fn[ expando ] ) {
1804     return fn( argument );
1805     }
1806    
1807     // But maintain support for old signatures
1808     if ( fn.length > 1 ) {
1809     args = [ pseudo, pseudo, "", argument ];
1810     return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1811     markFunction(function( seed, matches ) {
1812     var idx,
1813     matched = fn( seed, argument ),
1814     i = matched.length;
1815     while ( i-- ) {
1816     idx = indexOf( seed, matched[i] );
1817     seed[ idx ] = !( matches[ idx ] = matched[i] );
1818     }
1819     }) :
1820     function( elem ) {
1821     return fn( elem, 0, args );
1822     };
1823     }
1824    
1825     return fn;
1826     }
1827     },
1828    
1829     pseudos: {
1830     // Potentially complex pseudos
1831     "not": markFunction(function( selector ) {
1832     // Trim the selector passed to compile
1833     // to avoid treating leading and trailing
1834     // spaces as combinators
1835     var input = [],
1836     results = [],
1837     matcher = compile( selector.replace( rtrim, "$1" ) );
1838    
1839     return matcher[ expando ] ?
1840     markFunction(function( seed, matches, context, xml ) {
1841     var elem,
1842     unmatched = matcher( seed, null, xml, [] ),
1843     i = seed.length;
1844    
1845     // Match elements unmatched by `matcher`
1846     while ( i-- ) {
1847     if ( (elem = unmatched[i]) ) {
1848     seed[i] = !(matches[i] = elem);
1849     }
1850     }
1851     }) :
1852     function( elem, context, xml ) {
1853     input[0] = elem;
1854     matcher( input, null, xml, results );
1855     // Don't keep the element (issue #299)
1856     input[0] = null;
1857     return !results.pop();
1858     };
1859     }),
1860    
1861     "has": markFunction(function( selector ) {
1862     return function( elem ) {
1863     return Sizzle( selector, elem ).length > 0;
1864     };
1865     }),
1866    
1867     "contains": markFunction(function( text ) {
1868     text = text.replace( runescape, funescape );
1869     return function( elem ) {
1870     return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1871     };
1872     }),
1873    
1874     // "Whether an element is represented by a :lang() selector
1875     // is based solely on the element's language value
1876     // being equal to the identifier C,
1877     // or beginning with the identifier C immediately followed by "-".
1878     // The matching of C against the element's language value is performed case-insensitively.
1879     // The identifier C does not have to be a valid language name."
1880     // http://www.w3.org/TR/selectors/#lang-pseudo
1881     "lang": markFunction( function( lang ) {
1882     // lang value must be a valid identifier
1883     if ( !ridentifier.test(lang || "") ) {
1884     Sizzle.error( "unsupported lang: " + lang );
1885     }
1886     lang = lang.replace( runescape, funescape ).toLowerCase();
1887     return function( elem ) {
1888     var elemLang;
1889     do {
1890     if ( (elemLang = documentIsHTML ?
1891     elem.lang :
1892     elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1893    
1894     elemLang = elemLang.toLowerCase();
1895     return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1896     }
1897     } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1898     return false;
1899     };
1900     }),
1901    
1902     // Miscellaneous
1903     "target": function( elem ) {
1904     var hash = window.location && window.location.hash;
1905     return hash && hash.slice( 1 ) === elem.id;
1906     },
1907    
1908     "root": function( elem ) {
1909     return elem === docElem;
1910     },
1911    
1912     "focus": function( elem ) {
1913     return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1914     },
1915    
1916     // Boolean properties
1917     "enabled": function( elem ) {
1918     return elem.disabled === false;
1919     },
1920    
1921     "disabled": function( elem ) {
1922     return elem.disabled === true;
1923     },
1924    
1925     "checked": function( elem ) {
1926     // In CSS3, :checked should return both checked and selected elements
1927     // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1928     var nodeName = elem.nodeName.toLowerCase();
1929     return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1930     },
1931    
1932     "selected": function( elem ) {
1933     // Accessing this property makes selected-by-default
1934     // options in Safari work properly
1935     if ( elem.parentNode ) {
1936     elem.parentNode.selectedIndex;
1937     }
1938    
1939     return elem.selected === true;
1940     },
1941    
1942     // Contents
1943     "empty": function( elem ) {
1944     // http://www.w3.org/TR/selectors/#empty-pseudo
1945     // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1946     // but not by others (comment: 8; processing instruction: 7; etc.)
1947     // nodeType < 6 works because attributes (2) do not appear as children
1948     for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1949     if ( elem.nodeType < 6 ) {
1950     return false;
1951     }
1952     }
1953     return true;
1954     },
1955    
1956     "parent": function( elem ) {
1957     return !Expr.pseudos["empty"]( elem );
1958     },
1959    
1960     // Element/input types
1961     "header": function( elem ) {
1962     return rheader.test( elem.nodeName );
1963     },
1964    
1965     "input": function( elem ) {
1966     return rinputs.test( elem.nodeName );
1967     },
1968    
1969     "button": function( elem ) {
1970     var name = elem.nodeName.toLowerCase();
1971     return name === "input" && elem.type === "button" || name === "button";
1972     },
1973    
1974     "text": function( elem ) {
1975     var attr;
1976     return elem.nodeName.toLowerCase() === "input" &&
1977     elem.type === "text" &&
1978    
1979     // Support: IE<8
1980     // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1981     ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1982     },
1983    
1984     // Position-in-collection
1985     "first": createPositionalPseudo(function() {
1986     return [ 0 ];
1987     }),
1988    
1989     "last": createPositionalPseudo(function( matchIndexes, length ) {
1990     return [ length - 1 ];
1991     }),
1992    
1993     "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1994     return [ argument < 0 ? argument + length : argument ];
1995     }),
1996    
1997     "even": createPositionalPseudo(function( matchIndexes, length ) {
1998     var i = 0;
1999     for ( ; i < length; i += 2 ) {
2000     matchIndexes.push( i );
2001     }
2002     return matchIndexes;
2003     }),
2004    
2005     "odd": createPositionalPseudo(function( matchIndexes, length ) {
2006     var i = 1;
2007     for ( ; i < length; i += 2 ) {
2008     matchIndexes.push( i );
2009     }
2010     return matchIndexes;
2011     }),
2012    
2013     "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2014     var i = argument < 0 ? argument + length : argument;
2015     for ( ; --i >= 0; ) {
2016     matchIndexes.push( i );
2017     }
2018     return matchIndexes;
2019     }),
2020    
2021     "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2022     var i = argument < 0 ? argument + length : argument;
2023     for ( ; ++i < length; ) {
2024     matchIndexes.push( i );
2025     }
2026     return matchIndexes;
2027     })
2028     }
2029     };
2030    
2031     Expr.pseudos["nth"] = Expr.pseudos["eq"];
2032    
2033     // Add button/input type pseudos
2034     for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2035     Expr.pseudos[ i ] = createInputPseudo( i );
2036     }
2037     for ( i in { submit: true, reset: true } ) {
2038     Expr.pseudos[ i ] = createButtonPseudo( i );
2039     }
2040    
2041     // Easy API for creating new setFilters
2042     function setFilters() {}
2043     setFilters.prototype = Expr.filters = Expr.pseudos;
2044     Expr.setFilters = new setFilters();
2045    
2046     tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2047     var matched, match, tokens, type,
2048     soFar, groups, preFilters,
2049     cached = tokenCache[ selector + " " ];
2050    
2051     if ( cached ) {
2052     return parseOnly ? 0 : cached.slice( 0 );
2053     }
2054    
2055     soFar = selector;
2056     groups = [];
2057     preFilters = Expr.preFilter;
2058    
2059     while ( soFar ) {
2060    
2061     // Comma and first run
2062     if ( !matched || (match = rcomma.exec( soFar )) ) {
2063     if ( match ) {
2064     // Don't consume trailing commas as valid
2065     soFar = soFar.slice( match[0].length ) || soFar;
2066     }
2067     groups.push( (tokens = []) );
2068     }
2069    
2070     matched = false;
2071    
2072     // Combinators
2073     if ( (match = rcombinators.exec( soFar )) ) {
2074     matched = match.shift();
2075     tokens.push({
2076     value: matched,
2077     // Cast descendant combinators to space
2078     type: match[0].replace( rtrim, " " )
2079     });
2080     soFar = soFar.slice( matched.length );
2081     }
2082    
2083     // Filters
2084     for ( type in Expr.filter ) {
2085     if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2086     (match = preFilters[ type ]( match ))) ) {
2087     matched = match.shift();
2088     tokens.push({
2089     value: matched,
2090     type: type,
2091     matches: match
2092     });
2093     soFar = soFar.slice( matched.length );
2094     }
2095     }
2096    
2097     if ( !matched ) {
2098     break;
2099     }
2100     }
2101    
2102     // Return the length of the invalid excess
2103     // if we're just parsing
2104     // Otherwise, throw an error or return tokens
2105     return parseOnly ?
2106     soFar.length :
2107     soFar ?
2108     Sizzle.error( selector ) :
2109     // Cache the tokens
2110     tokenCache( selector, groups ).slice( 0 );
2111     };
2112    
2113     function toSelector( tokens ) {
2114     var i = 0,
2115     len = tokens.length,
2116     selector = "";
2117     for ( ; i < len; i++ ) {
2118     selector += tokens[i].value;
2119     }
2120     return selector;
2121     }
2122    
2123     function addCombinator( matcher, combinator, base ) {
2124     var dir = combinator.dir,
2125     checkNonElements = base && dir === "parentNode",
2126     doneName = done++;
2127    
2128     return combinator.first ?
2129     // Check against closest ancestor/preceding element
2130     function( elem, context, xml ) {
2131     while ( (elem = elem[ dir ]) ) {
2132     if ( elem.nodeType === 1 || checkNonElements ) {
2133     return matcher( elem, context, xml );
2134     }
2135     }
2136     } :
2137    
2138     // Check against all ancestor/preceding elements
2139     function( elem, context, xml ) {
2140     var oldCache, outerCache,
2141     newCache = [ dirruns, doneName ];
2142    
2143     // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2144     if ( xml ) {
2145     while ( (elem = elem[ dir ]) ) {
2146     if ( elem.nodeType === 1 || checkNonElements ) {
2147     if ( matcher( elem, context, xml ) ) {
2148     return true;
2149     }
2150     }
2151     }
2152     } else {
2153     while ( (elem = elem[ dir ]) ) {
2154     if ( elem.nodeType === 1 || checkNonElements ) {
2155     outerCache = elem[ expando ] || (elem[ expando ] = {});
2156     if ( (oldCache = outerCache[ dir ]) &&
2157     oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2158    
2159     // Assign to newCache so results back-propagate to previous elements
2160     return (newCache[ 2 ] = oldCache[ 2 ]);
2161     } else {
2162     // Reuse newcache so results back-propagate to previous elements
2163     outerCache[ dir ] = newCache;
2164    
2165     // A match means we're done; a fail means we have to keep checking
2166     if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2167     return true;
2168     }
2169     }
2170     }
2171     }
2172     }
2173     };
2174     }
2175    
2176     function elementMatcher( matchers ) {
2177     return matchers.length > 1 ?
2178     function( elem, context, xml ) {
2179     var i = matchers.length;
2180     while ( i-- ) {
2181     if ( !matchers[i]( elem, context, xml ) ) {
2182     return false;
2183     }
2184     }
2185     return true;
2186     } :
2187     matchers[0];
2188     }
2189    
2190     function multipleContexts( selector, contexts, results ) {
2191     var i = 0,
2192     len = contexts.length;
2193     for ( ; i < len; i++ ) {
2194     Sizzle( selector, contexts[i], results );
2195     }
2196     return results;
2197     }
2198    
2199     function condense( unmatched, map, filter, context, xml ) {
2200     var elem,
2201     newUnmatched = [],
2202     i = 0,
2203     len = unmatched.length,
2204     mapped = map != null;
2205    
2206     for ( ; i < len; i++ ) {
2207     if ( (elem = unmatched[i]) ) {
2208     if ( !filter || filter( elem, context, xml ) ) {
2209     newUnmatched.push( elem );
2210     if ( mapped ) {
2211     map.push( i );
2212     }
2213     }
2214     }
2215     }
2216    
2217     return newUnmatched;
2218     }
2219    
2220     function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2221     if ( postFilter && !postFilter[ expando ] ) {
2222     postFilter = setMatcher( postFilter );
2223     }
2224     if ( postFinder && !postFinder[ expando ] ) {
2225     postFinder = setMatcher( postFinder, postSelector );
2226     }
2227     return markFunction(function( seed, results, context, xml ) {
2228     var temp, i, elem,
2229     preMap = [],
2230     postMap = [],
2231     preexisting = results.length,
2232    
2233     // Get initial elements from seed or context
2234     elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2235    
2236     // Prefilter to get matcher input, preserving a map for seed-results synchronization
2237     matcherIn = preFilter && ( seed || !selector ) ?
2238     condense( elems, preMap, preFilter, context, xml ) :
2239     elems,
2240    
2241     matcherOut = matcher ?
2242     // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2243     postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2244    
2245     // ...intermediate processing is necessary
2246     [] :
2247    
2248     // ...otherwise use results directly
2249     results :
2250     matcherIn;
2251    
2252     // Find primary matches
2253     if ( matcher ) {
2254     matcher( matcherIn, matcherOut, context, xml );
2255     }
2256    
2257     // Apply postFilter
2258     if ( postFilter ) {
2259     temp = condense( matcherOut, postMap );
2260     postFilter( temp, [], context, xml );
2261    
2262     // Un-match failing elements by moving them back to matcherIn
2263     i = temp.length;
2264     while ( i-- ) {
2265     if ( (elem = temp[i]) ) {
2266     matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2267     }
2268     }
2269     }
2270    
2271     if ( seed ) {
2272     if ( postFinder || preFilter ) {
2273     if ( postFinder ) {
2274     // Get the final matcherOut by condensing this intermediate into postFinder contexts
2275     temp = [];
2276     i = matcherOut.length;
2277     while ( i-- ) {
2278     if ( (elem = matcherOut[i]) ) {
2279     // Restore matcherIn since elem is not yet a final match
2280     temp.push( (matcherIn[i] = elem) );
2281     }
2282     }
2283     postFinder( null, (matcherOut = []), temp, xml );
2284     }
2285    
2286     // Move matched elements from seed to results to keep them synchronized
2287     i = matcherOut.length;
2288     while ( i-- ) {
2289     if ( (elem = matcherOut[i]) &&
2290     (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2291    
2292     seed[temp] = !(results[temp] = elem);
2293     }
2294     }
2295     }
2296    
2297     // Add elements to results, through postFinder if defined
2298     } else {
2299     matcherOut = condense(
2300     matcherOut === results ?
2301     matcherOut.splice( preexisting, matcherOut.length ) :
2302     matcherOut
2303     );
2304     if ( postFinder ) {
2305     postFinder( null, results, matcherOut, xml );
2306     } else {
2307     push.apply( results, matcherOut );
2308     }
2309     }
2310     });
2311     }
2312    
2313     function matcherFromTokens( tokens ) {
2314     var checkContext, matcher, j,
2315     len = tokens.length,
2316     leadingRelative = Expr.relative[ tokens[0].type ],
2317     implicitRelative = leadingRelative || Expr.relative[" "],
2318     i = leadingRelative ? 1 : 0,
2319    
2320     // The foundational matcher ensures that elements are reachable from top-level context(s)
2321     matchContext = addCombinator( function( elem ) {
2322     return elem === checkContext;
2323     }, implicitRelative, true ),
2324     matchAnyContext = addCombinator( function( elem ) {
2325     return indexOf( checkContext, elem ) > -1;
2326     }, implicitRelative, true ),
2327     matchers = [ function( elem, context, xml ) {
2328     var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2329     (checkContext = context).nodeType ?
2330     matchContext( elem, context, xml ) :
2331     matchAnyContext( elem, context, xml ) );
2332     // Avoid hanging onto element (issue #299)
2333     checkContext = null;
2334     return ret;
2335     } ];
2336    
2337     for ( ; i < len; i++ ) {
2338     if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2339     matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2340     } else {
2341     matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2342    
2343     // Return special upon seeing a positional matcher
2344     if ( matcher[ expando ] ) {
2345     // Find the next relative operator (if any) for proper handling
2346     j = ++i;
2347     for ( ; j < len; j++ ) {
2348     if ( Expr.relative[ tokens[j].type ] ) {
2349     break;
2350     }
2351     }
2352     return setMatcher(
2353     i > 1 && elementMatcher( matchers ),
2354     i > 1 && toSelector(
2355     // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2356     tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2357     ).replace( rtrim, "$1" ),
2358     matcher,
2359     i < j && matcherFromTokens( tokens.slice( i, j ) ),
2360     j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2361     j < len && toSelector( tokens )
2362     );
2363     }
2364     matchers.push( matcher );
2365     }
2366     }
2367    
2368     return elementMatcher( matchers );
2369     }
2370    
2371     function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2372     var bySet = setMatchers.length > 0,
2373     byElement = elementMatchers.length > 0,
2374     superMatcher = function( seed, context, xml, results, outermost ) {
2375     var elem, j, matcher,
2376     matchedCount = 0,
2377     i = "0",
2378     unmatched = seed && [],
2379     setMatched = [],
2380     contextBackup = outermostContext,
2381     // We must always have either seed elements or outermost context
2382     elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2383     // Use integer dirruns iff this is the outermost matcher
2384     dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2385     len = elems.length;
2386    
2387     if ( outermost ) {
2388     outermostContext = context !== document && context;
2389     }
2390    
2391     // Add elements passing elementMatchers directly to results
2392     // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2393     // Support: IE<9, Safari
2394     // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2395     for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2396     if ( byElement && elem ) {
2397     j = 0;
2398     while ( (matcher = elementMatchers[j++]) ) {
2399     if ( matcher( elem, context, xml ) ) {
2400     results.push( elem );
2401     break;
2402     }
2403     }
2404     if ( outermost ) {
2405     dirruns = dirrunsUnique;
2406     }
2407     }
2408    
2409     // Track unmatched elements for set filters
2410     if ( bySet ) {
2411     // They will have gone through all possible matchers
2412     if ( (elem = !matcher && elem) ) {
2413     matchedCount--;
2414     }
2415    
2416     // Lengthen the array for every element, matched or not
2417     if ( seed ) {
2418     unmatched.push( elem );
2419     }
2420     }
2421     }
2422    
2423     // Apply set filters to unmatched elements
2424     matchedCount += i;
2425     if ( bySet && i !== matchedCount ) {
2426     j = 0;
2427     while ( (matcher = setMatchers[j++]) ) {
2428     matcher( unmatched, setMatched, context, xml );
2429     }
2430    
2431     if ( seed ) {
2432     // Reintegrate element matches to eliminate the need for sorting
2433     if ( matchedCount > 0 ) {
2434     while ( i-- ) {
2435     if ( !(unmatched[i] || setMatched[i]) ) {
2436     setMatched[i] = pop.call( results );
2437     }
2438     }
2439     }
2440    
2441     // Discard index placeholder values to get only actual matches
2442     setMatched = condense( setMatched );
2443     }
2444    
2445     // Add matches to results
2446     push.apply( results, setMatched );
2447    
2448     // Seedless set matches succeeding multiple successful matchers stipulate sorting
2449     if ( outermost && !seed && setMatched.length > 0 &&
2450     ( matchedCount + setMatchers.length ) > 1 ) {
2451    
2452     Sizzle.uniqueSort( results );
2453     }
2454     }
2455    
2456     // Override manipulation of globals by nested matchers
2457     if ( outermost ) {
2458     dirruns = dirrunsUnique;
2459     outermostContext = contextBackup;
2460     }
2461    
2462     return unmatched;
2463     };
2464    
2465     return bySet ?
2466     markFunction( superMatcher ) :
2467     superMatcher;
2468     }
2469    
2470     compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2471     var i,
2472     setMatchers = [],
2473     elementMatchers = [],
2474     cached = compilerCache[ selector + " " ];
2475    
2476     if ( !cached ) {
2477     // Generate a function of recursive functions that can be used to check each element
2478     if ( !match ) {
2479     match = tokenize( selector );
2480     }
2481     i = match.length;
2482     while ( i-- ) {
2483     cached = matcherFromTokens( match[i] );
2484     if ( cached[ expando ] ) {
2485     setMatchers.push( cached );
2486     } else {
2487     elementMatchers.push( cached );
2488     }
2489     }
2490    
2491     // Cache the compiled function
2492     cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2493    
2494     // Save selector and tokenization
2495     cached.selector = selector;
2496     }
2497     return cached;
2498     };
2499    
2500     /**
2501     * A low-level selection function that works with Sizzle's compiled
2502     * selector functions
2503     * @param {String|Function} selector A selector or a pre-compiled
2504     * selector function built with Sizzle.compile
2505     * @param {Element} context
2506     * @param {Array} [results]
2507     * @param {Array} [seed] A set of elements to match against
2508     */
2509     select = Sizzle.select = function( selector, context, results, seed ) {
2510     var i, tokens, token, type, find,
2511     compiled = typeof selector === "function" && selector,
2512     match = !seed && tokenize( (selector = compiled.selector || selector) );
2513    
2514     results = results || [];
2515    
2516     // Try to minimize operations if there is no seed and only one group
2517     if ( match.length === 1 ) {
2518    
2519     // Take a shortcut and set the context if the root selector is an ID
2520     tokens = match[0] = match[0].slice( 0 );
2521     if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2522     support.getById && context.nodeType === 9 && documentIsHTML &&
2523     Expr.relative[ tokens[1].type ] ) {
2524    
2525     context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2526     if ( !context ) {
2527     return results;
2528    
2529     // Precompiled matchers will still verify ancestry, so step up a level
2530     } else if ( compiled ) {
2531     context = context.parentNode;
2532     }
2533    
2534     selector = selector.slice( tokens.shift().value.length );
2535     }
2536    
2537     // Fetch a seed set for right-to-left matching
2538     i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2539     while ( i-- ) {
2540     token = tokens[i];
2541    
2542     // Abort if we hit a combinator
2543     if ( Expr.relative[ (type = token.type) ] ) {
2544     break;
2545     }
2546     if ( (find = Expr.find[ type ]) ) {
2547     // Search, expanding context for leading sibling combinators
2548     if ( (seed = find(
2549     token.matches[0].replace( runescape, funescape ),
2550     rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2551     )) ) {
2552    
2553     // If seed is empty or no tokens remain, we can return early
2554     tokens.splice( i, 1 );
2555     selector = seed.length && toSelector( tokens );
2556     if ( !selector ) {
2557     push.apply( results, seed );
2558     return results;
2559     }
2560    
2561     break;
2562     }
2563     }
2564     }
2565     }
2566    
2567     // Compile and execute a filtering function if one is not provided
2568     // Provide `match` to avoid retokenization if we modified the selector above
2569     ( compiled || compile( selector, match ) )(
2570     seed,
2571     context,
2572     !documentIsHTML,
2573     results,
2574     rsibling.test( selector ) && testContext( context.parentNode ) || context
2575     );
2576     return results;
2577     };
2578    
2579     // One-time assignments
2580    
2581     // Sort stability
2582     support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2583    
2584     // Support: Chrome 14-35+
2585     // Always assume duplicates if they aren't passed to the comparison function
2586     support.detectDuplicates = !!hasDuplicate;
2587    
2588     // Initialize against the default document
2589     setDocument();
2590    
2591     // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2592     // Detached nodes confoundingly follow *each other*
2593     support.sortDetached = assert(function( div1 ) {
2594     // Should return 1, but returns 4 (following)
2595     return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2596     });
2597    
2598     // Support: IE<8
2599     // Prevent attribute/property "interpolation"
2600     // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2601     if ( !assert(function( div ) {
2602     div.innerHTML = "<a href='#'></a>";
2603     return div.firstChild.getAttribute("href") === "#" ;
2604     }) ) {
2605     addHandle( "type|href|height|width", function( elem, name, isXML ) {
2606     if ( !isXML ) {
2607     return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2608     }
2609     });
2610     }
2611    
2612     // Support: IE<9
2613     // Use defaultValue in place of getAttribute("value")
2614     if ( !support.attributes || !assert(function( div ) {
2615     div.innerHTML = "<input/>";
2616     div.firstChild.setAttribute( "value", "" );
2617     return div.firstChild.getAttribute( "value" ) === "";
2618     }) ) {
2619     addHandle( "value", function( elem, name, isXML ) {
2620     if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2621     return elem.defaultValue;
2622     }
2623     });
2624     }
2625    
2626     // Support: IE<9
2627     // Use getAttributeNode to fetch booleans when getAttribute lies
2628     if ( !assert(function( div ) {
2629     return div.getAttribute("disabled") == null;
2630     }) ) {
2631     addHandle( booleans, function( elem, name, isXML ) {
2632     var val;
2633     if ( !isXML ) {
2634     return elem[ name ] === true ? name.toLowerCase() :
2635     (val = elem.getAttributeNode( name )) && val.specified ?
2636     val.value :
2637     null;
2638     }
2639     });
2640     }
2641    
2642     return Sizzle;
2643    
2644     })( window );
2645    
2646    
2647    
2648     jQuery.find = Sizzle;
2649     jQuery.expr = Sizzle.selectors;
2650     jQuery.expr[":"] = jQuery.expr.pseudos;
2651     jQuery.unique = Sizzle.uniqueSort;
2652     jQuery.text = Sizzle.getText;
2653     jQuery.isXMLDoc = Sizzle.isXML;
2654     jQuery.contains = Sizzle.contains;
2655    
2656    
2657    
2658     var rneedsContext = jQuery.expr.match.needsContext;
2659    
2660     var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2661    
2662    
2663    
2664     var risSimple = /^.[^:#\[\.,]*$/;
2665    
2666     // Implement the identical functionality for filter and not
2667     function winnow( elements, qualifier, not ) {
2668     if ( jQuery.isFunction( qualifier ) ) {
2669     return jQuery.grep( elements, function( elem, i ) {
2670     /* jshint -W018 */
2671     return !!qualifier.call( elem, i, elem ) !== not;
2672     });
2673    
2674     }
2675    
2676     if ( qualifier.nodeType ) {
2677     return jQuery.grep( elements, function( elem ) {
2678     return ( elem === qualifier ) !== not;
2679     });
2680    
2681     }
2682    
2683     if ( typeof qualifier === "string" ) {
2684     if ( risSimple.test( qualifier ) ) {
2685     return jQuery.filter( qualifier, elements, not );
2686     }
2687    
2688     qualifier = jQuery.filter( qualifier, elements );
2689     }
2690    
2691     return jQuery.grep( elements, function( elem ) {
2692     return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
2693     });
2694     }
2695    
2696     jQuery.filter = function( expr, elems, not ) {
2697     var elem = elems[ 0 ];
2698    
2699     if ( not ) {
2700     expr = ":not(" + expr + ")";
2701     }
2702    
2703     return elems.length === 1 && elem.nodeType === 1 ?
2704     jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2705     jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2706     return elem.nodeType === 1;
2707     }));
2708     };
2709    
2710     jQuery.fn.extend({
2711     find: function( selector ) {
2712     var i,
2713     ret = [],
2714     self = this,
2715     len = self.length;
2716    
2717     if ( typeof selector !== "string" ) {
2718     return this.pushStack( jQuery( selector ).filter(function() {
2719     for ( i = 0; i < len; i++ ) {
2720     if ( jQuery.contains( self[ i ], this ) ) {
2721     return true;
2722     }
2723     }
2724     }) );
2725     }
2726    
2727     for ( i = 0; i < len; i++ ) {
2728     jQuery.find( selector, self[ i ], ret );
2729     }
2730    
2731     // Needed because $( selector, context ) becomes $( context ).find( selector )
2732     ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2733     ret.selector = this.selector ? this.selector + " " + selector : selector;
2734     return ret;
2735     },
2736     filter: function( selector ) {
2737     return this.pushStack( winnow(this, selector || [], false) );
2738     },
2739     not: function( selector ) {
2740     return this.pushStack( winnow(this, selector || [], true) );
2741     },
2742     is: function( selector ) {
2743     return !!winnow(
2744     this,
2745    
2746     // If this is a positional/relative selector, check membership in the returned set
2747     // so $("p:first").is("p:last") won't return true for a doc with two "p".
2748     typeof selector === "string" && rneedsContext.test( selector ) ?
2749     jQuery( selector ) :
2750     selector || [],
2751     false
2752     ).length;
2753     }
2754     });
2755    
2756    
2757     // Initialize a jQuery object
2758    
2759    
2760     // A central reference to the root jQuery(document)
2761     var rootjQuery,
2762    
2763     // Use the correct document accordingly with window argument (sandbox)
2764     document = window.document,
2765    
2766     // A simple way to check for HTML strings
2767     // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2768     // Strict HTML recognition (#11290: must start with <)
2769     rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2770    
2771     init = jQuery.fn.init = function( selector, context ) {
2772     var match, elem;
2773    
2774     // HANDLE: $(""), $(null), $(undefined), $(false)
2775     if ( !selector ) {
2776     return this;
2777     }
2778    
2779     // Handle HTML strings
2780     if ( typeof selector === "string" ) {
2781     if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
2782     // Assume that strings that start and end with <> are HTML and skip the regex check
2783     match = [ null, selector, null ];
2784    
2785     } else {
2786     match = rquickExpr.exec( selector );
2787     }
2788    
2789     // Match html or make sure no context is specified for #id
2790     if ( match && (match[1] || !context) ) {
2791    
2792     // HANDLE: $(html) -> $(array)
2793     if ( match[1] ) {
2794     context = context instanceof jQuery ? context[0] : context;
2795    
2796     // scripts is true for back-compat
2797     // Intentionally let the error be thrown if parseHTML is not present
2798     jQuery.merge( this, jQuery.parseHTML(
2799     match[1],
2800     context && context.nodeType ? context.ownerDocument || context : document,
2801     true
2802     ) );
2803    
2804     // HANDLE: $(html, props)
2805     if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2806     for ( match in context ) {
2807     // Properties of context are called as methods if possible
2808     if ( jQuery.isFunction( this[ match ] ) ) {
2809     this[ match ]( context[ match ] );
2810    
2811     // ...and otherwise set as attributes
2812     } else {
2813     this.attr( match, context[ match ] );
2814     }
2815     }
2816     }
2817    
2818     return this;
2819    
2820     // HANDLE: $(#id)
2821     } else {
2822     elem = document.getElementById( match[2] );
2823    
2824     // Check parentNode to catch when Blackberry 4.6 returns
2825     // nodes that are no longer in the document #6963
2826     if ( elem && elem.parentNode ) {
2827     // Handle the case where IE and Opera return items
2828     // by name instead of ID
2829     if ( elem.id !== match[2] ) {
2830     return rootjQuery.find( selector );
2831     }
2832    
2833     // Otherwise, we inject the element directly into the jQuery object
2834     this.length = 1;
2835     this[0] = elem;
2836     }
2837    
2838     this.context = document;
2839     this.selector = selector;
2840     return this;
2841     }
2842    
2843     // HANDLE: $(expr, $(...))
2844     } else if ( !context || context.jquery ) {
2845     return ( context || rootjQuery ).find( selector );
2846    
2847     // HANDLE: $(expr, context)
2848     // (which is just equivalent to: $(context).find(expr)
2849     } else {
2850     return this.constructor( context ).find( selector );
2851     }
2852    
2853     // HANDLE: $(DOMElement)
2854     } else if ( selector.nodeType ) {
2855     this.context = this[0] = selector;
2856     this.length = 1;
2857     return this;
2858    
2859     // HANDLE: $(function)
2860     // Shortcut for document ready
2861     } else if ( jQuery.isFunction( selector ) ) {
2862     return typeof rootjQuery.ready !== "undefined" ?
2863     rootjQuery.ready( selector ) :
2864     // Execute immediately if ready is not present
2865     selector( jQuery );
2866     }
2867    
2868     if ( selector.selector !== undefined ) {
2869     this.selector = selector.selector;
2870     this.context = selector.context;
2871     }
2872    
2873     return jQuery.makeArray( selector, this );
2874     };
2875    
2876     // Give the init function the jQuery prototype for later instantiation
2877     init.prototype = jQuery.fn;
2878    
2879     // Initialize central reference
2880     rootjQuery = jQuery( document );
2881    
2882    
2883     var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2884     // methods guaranteed to produce a unique set when starting from a unique set
2885     guaranteedUnique = {
2886     children: true,
2887     contents: true,
2888     next: true,
2889     prev: true
2890     };
2891    
2892     jQuery.extend({
2893     dir: function( elem, dir, until ) {
2894     var matched = [],
2895     cur = elem[ dir ];
2896    
2897     while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
2898     if ( cur.nodeType === 1 ) {
2899     matched.push( cur );
2900     }
2901     cur = cur[dir];
2902     }
2903     return matched;
2904     },
2905    
2906     sibling: function( n, elem ) {
2907     var r = [];
2908    
2909     for ( ; n; n = n.nextSibling ) {
2910     if ( n.nodeType === 1 && n !== elem ) {
2911     r.push( n );
2912     }
2913     }
2914    
2915     return r;
2916     }
2917     });
2918    
2919     jQuery.fn.extend({
2920     has: function( target ) {
2921     var i,
2922     targets = jQuery( target, this ),
2923     len = targets.length;
2924    
2925     return this.filter(function() {
2926     for ( i = 0; i < len; i++ ) {
2927     if ( jQuery.contains( this, targets[i] ) ) {
2928     return true;
2929     }
2930     }
2931     });
2932     },
2933    
2934     closest: function( selectors, context ) {
2935     var cur,
2936     i = 0,
2937     l = this.length,
2938     matched = [],
2939     pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2940     jQuery( selectors, context || this.context ) :
2941     0;
2942    
2943     for ( ; i < l; i++ ) {
2944     for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2945     // Always skip document fragments
2946     if ( cur.nodeType < 11 && (pos ?
2947     pos.index(cur) > -1 :
2948    
2949     // Don't pass non-elements to Sizzle
2950     cur.nodeType === 1 &&
2951     jQuery.find.matchesSelector(cur, selectors)) ) {
2952    
2953     matched.push( cur );
2954     break;
2955     }
2956     }
2957     }
2958    
2959     return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2960     },
2961    
2962     // Determine the position of an element within
2963     // the matched set of elements
2964     index: function( elem ) {
2965    
2966     // No argument, return index in parent
2967     if ( !elem ) {
2968     return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
2969     }
2970    
2971     // index in selector
2972     if ( typeof elem === "string" ) {
2973     return jQuery.inArray( this[0], jQuery( elem ) );
2974     }
2975    
2976     // Locate the position of the desired element
2977     return jQuery.inArray(
2978     // If it receives a jQuery object, the first element is used
2979     elem.jquery ? elem[0] : elem, this );
2980     },
2981    
2982     add: function( selector, context ) {
2983     return this.pushStack(
2984     jQuery.unique(
2985     jQuery.merge( this.get(), jQuery( selector, context ) )
2986     )
2987     );
2988     },
2989    
2990     addBack: function( selector ) {
2991     return this.add( selector == null ?
2992     this.prevObject : this.prevObject.filter(selector)
2993     );
2994     }
2995     });
2996    
2997     function sibling( cur, dir ) {
2998     do {
2999     cur = cur[ dir ];
3000     } while ( cur && cur.nodeType !== 1 );
3001    
3002     return cur;
3003     }
3004    
3005     jQuery.each({
3006     parent: function( elem ) {
3007     var parent = elem.parentNode;
3008     return parent && parent.nodeType !== 11 ? parent : null;
3009     },
3010     parents: function( elem ) {
3011     return jQuery.dir( elem, "parentNode" );
3012     },
3013     parentsUntil: function( elem, i, until ) {
3014     return jQuery.dir( elem, "parentNode", until );
3015     },
3016     next: function( elem ) {
3017     return sibling( elem, "nextSibling" );
3018     },
3019     prev: function( elem ) {
3020     return sibling( elem, "previousSibling" );
3021     },
3022     nextAll: function( elem ) {
3023     return jQuery.dir( elem, "nextSibling" );
3024     },
3025     prevAll: function( elem ) {
3026     return jQuery.dir( elem, "previousSibling" );
3027     },
3028     nextUntil: function( elem, i, until ) {
3029     return jQuery.dir( elem, "nextSibling", until );
3030     },
3031     prevUntil: function( elem, i, until ) {
3032     return jQuery.dir( elem, "previousSibling", until );
3033     },
3034     siblings: function( elem ) {
3035     return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
3036     },
3037     children: function( elem ) {
3038     return jQuery.sibling( elem.firstChild );
3039     },
3040     contents: function( elem ) {
3041     return jQuery.nodeName( elem, "iframe" ) ?
3042     elem.contentDocument || elem.contentWindow.document :
3043     jQuery.merge( [], elem.childNodes );
3044     }
3045     }, function( name, fn ) {
3046     jQuery.fn[ name ] = function( until, selector ) {
3047     var ret = jQuery.map( this, fn, until );
3048    
3049     if ( name.slice( -5 ) !== "Until" ) {
3050     selector = until;
3051     }
3052    
3053     if ( selector && typeof selector === "string" ) {
3054     ret = jQuery.filter( selector, ret );
3055     }
3056    
3057     if ( this.length > 1 ) {
3058     // Remove duplicates
3059     if ( !guaranteedUnique[ name ] ) {
3060     ret = jQuery.unique( ret );
3061     }
3062    
3063     // Reverse order for parents* and prev-derivatives
3064     if ( rparentsprev.test( name ) ) {
3065     ret = ret.reverse();
3066     }
3067     }
3068    
3069     return this.pushStack( ret );
3070     };
3071     });
3072     var rnotwhite = (/\S+/g);
3073    
3074    
3075    
3076     // String to Object options format cache
3077     var optionsCache = {};
3078    
3079     // Convert String-formatted options into Object-formatted ones and store in cache
3080     function createOptions( options ) {
3081     var object = optionsCache[ options ] = {};
3082     jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3083     object[ flag ] = true;
3084     });
3085     return object;
3086     }
3087    
3088     /*
3089     * Create a callback list using the following parameters:
3090     *
3091     * options: an optional list of space-separated options that will change how
3092     * the callback list behaves or a more traditional option object
3093     *
3094     * By default a callback list will act like an event callback list and can be
3095     * "fired" multiple times.
3096     *
3097     * Possible options:
3098     *
3099     * once: will ensure the callback list can only be fired once (like a Deferred)
3100     *
3101     * memory: will keep track of previous values and will call any callback added
3102     * after the list has been fired right away with the latest "memorized"
3103     * values (like a Deferred)
3104     *
3105     * unique: will ensure a callback can only be added once (no duplicate in the list)
3106     *
3107     * stopOnFalse: interrupt callings when a callback returns false
3108     *
3109     */
3110     jQuery.Callbacks = function( options ) {
3111    
3112     // Convert options from String-formatted to Object-formatted if needed
3113     // (we check in cache first)
3114     options = typeof options === "string" ?
3115     ( optionsCache[ options ] || createOptions( options ) ) :
3116     jQuery.extend( {}, options );
3117    
3118     var // Flag to know if list is currently firing
3119     firing,
3120     // Last fire value (for non-forgettable lists)
3121     memory,
3122     // Flag to know if list was already fired
3123     fired,
3124     // End of the loop when firing
3125     firingLength,
3126     // Index of currently firing callback (modified by remove if needed)
3127     firingIndex,
3128     // First callback to fire (used internally by add and fireWith)
3129     firingStart,
3130     // Actual callback list
3131     list = [],
3132     // Stack of fire calls for repeatable lists
3133     stack = !options.once && [],
3134     // Fire callbacks
3135     fire = function( data ) {
3136     memory = options.memory && data;
3137     fired = true;
3138     firingIndex = firingStart || 0;
3139     firingStart = 0;
3140     firingLength = list.length;
3141     firing = true;
3142     for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3143     if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3144     memory = false; // To prevent further calls using add
3145     break;
3146     }
3147     }
3148     firing = false;
3149     if ( list ) {
3150     if ( stack ) {
3151     if ( stack.length ) {
3152     fire( stack.shift() );
3153     }
3154     } else if ( memory ) {
3155     list = [];
3156     } else {
3157     self.disable();
3158     }
3159     }
3160     },
3161     // Actual Callbacks object
3162     self = {
3163     // Add a callback or a collection of callbacks to the list
3164     add: function() {
3165     if ( list ) {
3166     // First, we save the current length
3167     var start = list.length;
3168     (function add( args ) {
3169     jQuery.each( args, function( _, arg ) {
3170     var type = jQuery.type( arg );
3171     if ( type === "function" ) {
3172     if ( !options.unique || !self.has( arg ) ) {
3173     list.push( arg );
3174     }
3175     } else if ( arg && arg.length && type !== "string" ) {
3176     // Inspect recursively
3177     add( arg );
3178     }
3179     });
3180     })( arguments );
3181     // Do we need to add the callbacks to the
3182     // current firing batch?
3183     if ( firing ) {
3184     firingLength = list.length;
3185     // With memory, if we're not firing then
3186     // we should call right away
3187     } else if ( memory ) {
3188     firingStart = start;
3189     fire( memory );
3190     }
3191     }
3192     return this;
3193     },
3194     // Remove a callback from the list
3195     remove: function() {
3196     if ( list ) {
3197     jQuery.each( arguments, function( _, arg ) {
3198     var index;
3199     while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3200     list.splice( index, 1 );
3201     // Handle firing indexes
3202     if ( firing ) {
3203     if ( index <= firingLength ) {
3204     firingLength--;
3205     }
3206     if ( index <= firingIndex ) {
3207     firingIndex--;
3208     }
3209     }
3210     }
3211     });
3212     }
3213     return this;
3214     },
3215     // Check if a given callback is in the list.
3216     // If no argument is given, return whether or not list has callbacks attached.
3217     has: function( fn ) {
3218     return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3219     },
3220     // Remove all callbacks from the list
3221     empty: function() {
3222     list = [];
3223     firingLength = 0;
3224     return this;
3225     },
3226     // Have the list do nothing anymore
3227     disable: function() {
3228     list = stack = memory = undefined;
3229     return this;
3230     },
3231     // Is it disabled?
3232     disabled: function() {
3233     return !list;
3234     },
3235     // Lock the list in its current state
3236     lock: function() {
3237     stack = undefined;
3238     if ( !memory ) {
3239     self.disable();
3240     }
3241     return this;
3242     },
3243     // Is it locked?
3244     locked: function() {
3245     return !stack;
3246     },
3247     // Call all callbacks with the given context and arguments
3248     fireWith: function( context, args ) {
3249     if ( list && ( !fired || stack ) ) {
3250     args = args || [];
3251     args = [ context, args.slice ? args.slice() : args ];
3252     if ( firing ) {
3253     stack.push( args );
3254     } else {
3255     fire( args );
3256     }
3257     }
3258     return this;
3259     },
3260     // Call all the callbacks with the given arguments
3261     fire: function() {
3262     self.fireWith( this, arguments );
3263     return this;
3264     },
3265     // To know if the callbacks have already been called at least once
3266     fired: function() {
3267     return !!fired;
3268     }
3269     };
3270    
3271     return self;
3272     };
3273    
3274    
3275     jQuery.extend({
3276    
3277     Deferred: function( func ) {
3278     var tuples = [
3279     // action, add listener, listener list, final state
3280     [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3281     [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3282     [ "notify", "progress", jQuery.Callbacks("memory") ]
3283     ],
3284     state = "pending",
3285     promise = {
3286     state: function() {
3287     return state;
3288     },
3289     always: function() {
3290     deferred.done( arguments ).fail( arguments );
3291     return this;
3292     },
3293     then: function( /* fnDone, fnFail, fnProgress */ ) {
3294     var fns = arguments;
3295     return jQuery.Deferred(function( newDefer ) {
3296     jQuery.each( tuples, function( i, tuple ) {
3297     var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3298     // deferred[ done | fail | progress ] for forwarding actions to newDefer
3299     deferred[ tuple[1] ](function() {
3300     var returned = fn && fn.apply( this, arguments );
3301     if ( returned && jQuery.isFunction( returned.promise ) ) {
3302     returned.promise()
3303     .done( newDefer.resolve )
3304     .fail( newDefer.reject )
3305     .progress( newDefer.notify );
3306     } else {
3307     newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3308     }
3309     });
3310     });
3311     fns = null;
3312     }).promise();
3313     },
3314     // Get a promise for this deferred
3315     // If obj is provided, the promise aspect is added to the object
3316     promise: function( obj ) {
3317     return obj != null ? jQuery.extend( obj, promise ) : promise;
3318     }
3319     },
3320     deferred = {};
3321    
3322     // Keep pipe for back-compat
3323     promise.pipe = promise.then;
3324    
3325     // Add list-specific methods
3326     jQuery.each( tuples, function( i, tuple ) {
3327     var list = tuple[ 2 ],
3328     stateString = tuple[ 3 ];
3329    
3330     // promise[ done | fail | progress ] = list.add
3331     promise[ tuple[1] ] = list.add;
3332    
3333     // Handle state
3334     if ( stateString ) {
3335     list.add(function() {
3336     // state = [ resolved | rejected ]
3337     state = stateString;
3338    
3339     // [ reject_list | resolve_list ].disable; progress_list.lock
3340     }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3341     }
3342    
3343     // deferred[ resolve | reject | notify ]
3344     deferred[ tuple[0] ] = function() {
3345     deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3346     return this;
3347     };
3348     deferred[ tuple[0] + "With" ] = list.fireWith;
3349     });
3350    
3351     // Make the deferred a promise
3352     promise.promise( deferred );
3353    
3354     // Call given func if any
3355     if ( func ) {
3356     func.call( deferred, deferred );
3357     }
3358    
3359     // All done!
3360     return deferred;
3361     },
3362    
3363     // Deferred helper
3364     when: function( subordinate /* , ..., subordinateN */ ) {
3365     var i = 0,
3366     resolveValues = slice.call( arguments ),
3367     length = resolveValues.length,
3368    
3369     // the count of uncompleted subordinates
3370     remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3371    
3372     // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3373     deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3374    
3375     // Update function for both resolve and progress values
3376     updateFunc = function( i, contexts, values ) {
3377     return function( value ) {
3378     contexts[ i ] = this;
3379     values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3380     if ( values === progressValues ) {
3381     deferred.notifyWith( contexts, values );
3382    
3383     } else if ( !(--remaining) ) {
3384     deferred.resolveWith( contexts, values );
3385     }
3386     };
3387     },
3388    
3389     progressValues, progressContexts, resolveContexts;
3390    
3391     // add listeners to Deferred subordinates; treat others as resolved
3392     if ( length > 1 ) {
3393     progressValues = new Array( length );
3394     progressContexts = new Array( length );
3395     resolveContexts = new Array( length );
3396     for ( ; i < length; i++ ) {
3397     if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3398     resolveValues[ i ].promise()
3399     .done( updateFunc( i, resolveContexts, resolveValues ) )
3400     .fail( deferred.reject )
3401     .progress( updateFunc( i, progressContexts, progressValues ) );
3402     } else {
3403     --remaining;
3404     }
3405     }
3406     }
3407    
3408     // if we're not waiting on anything, resolve the master
3409     if ( !remaining ) {
3410     deferred.resolveWith( resolveContexts, resolveValues );
3411     }
3412    
3413     return deferred.promise();
3414     }
3415     });
3416    
3417    
3418     // The deferred used on DOM ready
3419     var readyList;
3420    
3421     jQuery.fn.ready = function( fn ) {
3422     // Add the callback
3423     jQuery.ready.promise().done( fn );
3424    
3425     return this;
3426     };
3427    
3428     jQuery.extend({
3429     // Is the DOM ready to be used? Set to true once it occurs.
3430     isReady: false,
3431    
3432     // A counter to track how many items to wait for before
3433     // the ready event fires. See #6781
3434     readyWait: 1,
3435    
3436     // Hold (or release) the ready event
3437     holdReady: function( hold ) {
3438     if ( hold ) {
3439     jQuery.readyWait++;
3440     } else {
3441     jQuery.ready( true );
3442     }
3443     },
3444    
3445     // Handle when the DOM is ready
3446     ready: function( wait ) {
3447    
3448     // Abort if there are pending holds or we're already ready
3449     if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3450     return;
3451     }
3452    
3453     // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
3454     if ( !document.body ) {
3455     return setTimeout( jQuery.ready );
3456     }
3457    
3458     // Remember that the DOM is ready
3459     jQuery.isReady = true;
3460    
3461     // If a normal DOM Ready event fired, decrement, and wait if need be
3462     if ( wait !== true && --jQuery.readyWait > 0 ) {
3463     return;
3464     }
3465    
3466     // If there are functions bound, to execute
3467     readyList.resolveWith( document, [ jQuery ] );
3468    
3469     // Trigger any bound ready events
3470     if ( jQuery.fn.triggerHandler ) {
3471     jQuery( document ).triggerHandler( "ready" );
3472     jQuery( document ).off( "ready" );
3473     }
3474     }
3475     });
3476    
3477     /**
3478     * Clean-up method for dom ready events
3479     */
3480     function detach() {
3481     if ( document.addEventListener ) {
3482     document.removeEventListener( "DOMContentLoaded", completed, false );
3483     window.removeEventListener( "load", completed, false );
3484    
3485     } else {
3486     document.detachEvent( "onreadystatechange", completed );
3487     window.detachEvent( "onload", completed );
3488     }
3489     }
3490    
3491     /**
3492     * The ready event handler and self cleanup method
3493     */
3494     function completed() {
3495     // readyState === "complete" is good enough for us to call the dom ready in oldIE
3496     if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
3497     detach();
3498     jQuery.ready();
3499     }
3500     }
3501    
3502     jQuery.ready.promise = function( obj ) {
3503     if ( !readyList ) {
3504    
3505     readyList = jQuery.Deferred();
3506    
3507     // Catch cases where $(document).ready() is called after the browser event has already occurred.
3508     // we once tried to use readyState "interactive" here, but it caused issues like the one
3509     // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3510     if ( document.readyState === "complete" ) {
3511     // Handle it asynchronously to allow scripts the opportunity to delay ready
3512     setTimeout( jQuery.ready );
3513    
3514     // Standards-based browsers support DOMContentLoaded
3515     } else if ( document.addEventListener ) {
3516     // Use the handy event callback
3517     document.addEventListener( "DOMContentLoaded", completed, false );
3518    
3519     // A fallback to window.onload, that will always work
3520     window.addEventListener( "load", completed, false );
3521    
3522     // If IE event model is used
3523     } else {
3524     // Ensure firing before onload, maybe late but safe also for iframes
3525     document.attachEvent( "onreadystatechange", completed );
3526    
3527     // A fallback to window.onload, that will always work
3528     window.attachEvent( "onload", completed );
3529    
3530     // If IE and not a frame
3531     // continually check to see if the document is ready
3532     var top = false;
3533    
3534     try {
3535     top = window.frameElement == null && document.documentElement;
3536     } catch(e) {}
3537    
3538     if ( top && top.doScroll ) {
3539     (function doScrollCheck() {
3540     if ( !jQuery.isReady ) {
3541    
3542     try {
3543     // Use the trick by Diego Perini
3544     // http://javascript.nwbox.com/IEContentLoaded/
3545     top.doScroll("left");
3546     } catch(e) {
3547     return setTimeout( doScrollCheck, 50 );
3548     }
3549    
3550     // detach all dom ready events
3551     detach();
3552    
3553     // and execute any waiting functions
3554     jQuery.ready();
3555     }
3556     })();
3557     }
3558     }
3559     }
3560     return readyList.promise( obj );
3561     };
3562    
3563    
3564     var strundefined = typeof undefined;
3565    
3566    
3567    
3568     // Support: IE<9
3569     // Iteration over object's inherited properties before its own
3570     var i;
3571     for ( i in jQuery( support ) ) {
3572     break;
3573     }
3574     support.ownLast = i !== "0";
3575    
3576     // Note: most support tests are defined in their respective modules.
3577     // false until the test is run
3578     support.inlineBlockNeedsLayout = false;
3579    
3580     // Execute ASAP in case we need to set body.style.zoom
3581     jQuery(function() {
3582     // Minified: var a,b,c,d
3583     var val, div, body, container;
3584    
3585     body = document.getElementsByTagName( "body" )[ 0 ];
3586     if ( !body || !body.style ) {
3587     // Return for frameset docs that don't have a body
3588     return;
3589     }
3590    
3591     // Setup
3592     div = document.createElement( "div" );
3593     container = document.createElement( "div" );
3594     container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
3595     body.appendChild( container ).appendChild( div );
3596    
3597     if ( typeof div.style.zoom !== strundefined ) {
3598     // Support: IE<8
3599     // Check if natively block-level elements act like inline-block
3600     // elements when setting their display to 'inline' and giving
3601     // them layout
3602     div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
3603    
3604     support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
3605     if ( val ) {
3606     // Prevent IE 6 from affecting layout for positioned elements #11048
3607     // Prevent IE from shrinking the body in IE 7 mode #12869
3608     // Support: IE<8
3609     body.style.zoom = 1;
3610     }
3611     }
3612    
3613     body.removeChild( container );
3614     });
3615    
3616    
3617    
3618    
3619     (function() {
3620     var div = document.createElement( "div" );
3621    
3622     // Execute the test only if not already executed in another module.
3623     if (support.deleteExpando == null) {
3624     // Support: IE<9
3625     support.deleteExpando = true;
3626     try {
3627     delete div.test;
3628     } catch( e ) {
3629     support.deleteExpando = false;
3630     }
3631     }
3632    
3633     // Null elements to avoid leaks in IE.
3634     div = null;
3635     })();
3636    
3637    
3638     /**
3639     * Determines whether an object can have data
3640     */
3641     jQuery.acceptData = function( elem ) {
3642     var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
3643     nodeType = +elem.nodeType || 1;
3644    
3645     // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3646     return nodeType !== 1 && nodeType !== 9 ?
3647     false :
3648    
3649     // Nodes accept data unless otherwise specified; rejection can be conditional
3650     !noData || noData !== true && elem.getAttribute("classid") === noData;
3651     };
3652    
3653    
3654     var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3655     rmultiDash = /([A-Z])/g;
3656    
3657     function dataAttr( elem, key, data ) {
3658     // If nothing was found internally, try to fetch any
3659     // data from the HTML5 data-* attribute
3660     if ( data === undefined && elem.nodeType === 1 ) {
3661    
3662     var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3663    
3664     data = elem.getAttribute( name );
3665    
3666     if ( typeof data === "string" ) {
3667     try {
3668     data = data === "true" ? true :
3669     data === "false" ? false :
3670     data === "null" ? null :
3671     // Only convert to a number if it doesn't change the string
3672     +data + "" === data ? +data :
3673     rbrace.test( data ) ? jQuery.parseJSON( data ) :
3674     data;
3675     } catch( e ) {}
3676    
3677     // Make sure we set the data so it isn't changed later
3678     jQuery.data( elem, key, data );
3679    
3680     } else {
3681     data = undefined;
3682     }
3683     }
3684    
3685     return data;
3686     }
3687    
3688     // checks a cache object for emptiness
3689     function isEmptyDataObject( obj ) {
3690     var name;
3691     for ( name in obj ) {
3692    
3693     // if the public data object is empty, the private is still empty
3694     if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3695     continue;
3696     }
3697     if ( name !== "toJSON" ) {
3698     return false;
3699     }
3700     }
3701    
3702     return true;
3703     }
3704    
3705     function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3706     if ( !jQuery.acceptData( elem ) ) {
3707     return;
3708     }
3709    
3710     var ret, thisCache,
3711     internalKey = jQuery.expando,
3712    
3713     // We have to handle DOM nodes and JS objects differently because IE6-7
3714     // can't GC object references properly across the DOM-JS boundary
3715     isNode = elem.nodeType,
3716    
3717     // Only DOM nodes need the global jQuery cache; JS object data is
3718     // attached directly to the object so GC can occur automatically
3719     cache = isNode ? jQuery.cache : elem,
3720    
3721     // Only defining an ID for JS objects if its cache already exists allows
3722     // the code to shortcut on the same path as a DOM node with no cache
3723     id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3724    
3725     // Avoid doing any more work than we need to when trying to get data on an
3726     // object that has no data at all
3727     if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3728     return;
3729     }
3730    
3731     if ( !id ) {
3732     // Only DOM nodes need a new unique ID for each element since their data
3733     // ends up in the global cache
3734     if ( isNode ) {
3735     id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3736     } else {
3737     id = internalKey;
3738     }
3739     }
3740    
3741     if ( !cache[ id ] ) {
3742     // Avoid exposing jQuery metadata on plain JS objects when the object
3743     // is serialized using JSON.stringify
3744     cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3745     }
3746    
3747     // An object can be passed to jQuery.data instead of a key/value pair; this gets
3748     // shallow copied over onto the existing cache
3749     if ( typeof name === "object" || typeof name === "function" ) {
3750     if ( pvt ) {
3751     cache[ id ] = jQuery.extend( cache[ id ], name );
3752     } else {
3753     cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3754     }
3755     }
3756    
3757     thisCache = cache[ id ];
3758    
3759     // jQuery data() is stored in a separate object inside the object's internal data
3760     // cache in order to avoid key collisions between internal data and user-defined
3761     // data.
3762     if ( !pvt ) {
3763     if ( !thisCache.data ) {
3764     thisCache.data = {};
3765     }
3766    
3767     thisCache = thisCache.data;
3768     }
3769    
3770     if ( data !== undefined ) {
3771     thisCache[ jQuery.camelCase( name ) ] = data;
3772     }
3773    
3774     // Check for both converted-to-camel and non-converted data property names
3775     // If a data property was specified
3776     if ( typeof name === "string" ) {
3777    
3778     // First Try to find as-is property data
3779     ret = thisCache[ name ];
3780    
3781     // Test for null|undefined property data
3782     if ( ret == null ) {
3783    
3784     // Try to find the camelCased property
3785     ret = thisCache[ jQuery.camelCase( name ) ];
3786     }
3787     } else {
3788     ret = thisCache;
3789     }
3790    
3791     return ret;
3792     }
3793    
3794     function internalRemoveData( elem, name, pvt ) {
3795     if ( !jQuery.acceptData( elem ) ) {
3796     return;
3797     }
3798    
3799     var thisCache, i,
3800     isNode = elem.nodeType,
3801    
3802     // See jQuery.data for more information
3803     cache = isNode ? jQuery.cache : elem,
3804     id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3805    
3806     // If there is already no cache entry for this object, there is no
3807     // purpose in continuing
3808     if ( !cache[ id ] ) {
3809     return;
3810     }
3811    
3812     if ( name ) {
3813    
3814     thisCache = pvt ? cache[ id ] : cache[ id ].data;
3815    
3816     if ( thisCache ) {
3817    
3818     // Support array or space separated string names for data keys
3819     if ( !jQuery.isArray( name ) ) {
3820    
3821     // try the string as a key before any manipulation
3822     if ( name in thisCache ) {
3823     name = [ name ];
3824     } else {
3825    
3826     // split the camel cased version by spaces unless a key with the spaces exists
3827     name = jQuery.camelCase( name );
3828     if ( name in thisCache ) {
3829     name = [ name ];
3830     } else {
3831     name = name.split(" ");
3832     }
3833     }
3834     } else {
3835     // If "name" is an array of keys...
3836     // When data is initially created, via ("key", "val") signature,
3837     // keys will be converted to camelCase.
3838     // Since there is no way to tell _how_ a key was added, remove
3839     // both plain key and camelCase key. #12786
3840     // This will only penalize the array argument path.
3841     name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3842     }
3843    
3844     i = name.length;
3845     while ( i-- ) {
3846     delete thisCache[ name[i] ];
3847     }
3848    
3849     // If there is no data left in the cache, we want to continue
3850     // and let the cache object itself get destroyed
3851     if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3852     return;
3853     }
3854     }
3855     }
3856    
3857     // See jQuery.data for more information
3858     if ( !pvt ) {
3859     delete cache[ id ].data;
3860    
3861     // Don't destroy the parent cache unless the internal data object
3862     // had been the only thing left in it
3863     if ( !isEmptyDataObject( cache[ id ] ) ) {
3864     return;
3865     }
3866     }
3867    
3868     // Destroy the cache
3869     if ( isNode ) {
3870     jQuery.cleanData( [ elem ], true );
3871    
3872     // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3873     /* jshint eqeqeq: false */
3874     } else if ( support.deleteExpando || cache != cache.window ) {
3875     /* jshint eqeqeq: true */
3876     delete cache[ id ];
3877    
3878     // When all else fails, null
3879     } else {
3880     cache[ id ] = null;
3881     }
3882     }
3883    
3884     jQuery.extend({
3885     cache: {},
3886    
3887     // The following elements (space-suffixed to avoid Object.prototype collisions)
3888     // throw uncatchable exceptions if you attempt to set expando properties
3889     noData: {
3890     "applet ": true,
3891     "embed ": true,
3892     // ...but Flash objects (which have this classid) *can* handle expandos
3893     "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3894     },
3895    
3896     hasData: function( elem ) {
3897     elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3898     return !!elem && !isEmptyDataObject( elem );
3899     },
3900    
3901     data: function( elem, name, data ) {
3902     return internalData( elem, name, data );
3903     },
3904    
3905     removeData: function( elem, name ) {
3906     return internalRemoveData( elem, name );
3907     },
3908    
3909     // For internal use only.
3910     _data: function( elem, name, data ) {
3911     return internalData( elem, name, data, true );
3912     },
3913    
3914     _removeData: function( elem, name ) {
3915     return internalRemoveData( elem, name, true );
3916     }
3917     });
3918    
3919     jQuery.fn.extend({
3920     data: function( key, value ) {
3921     var i, name, data,
3922     elem = this[0],
3923     attrs = elem && elem.attributes;
3924    
3925     // Special expections of .data basically thwart jQuery.access,
3926     // so implement the relevant behavior ourselves
3927    
3928     // Gets all values
3929     if ( key === undefined ) {
3930     if ( this.length ) {
3931     data = jQuery.data( elem );
3932    
3933     if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3934     i = attrs.length;
3935     while ( i-- ) {
3936    
3937     // Support: IE11+
3938     // The attrs elements can be null (#14894)
3939     if ( attrs[ i ] ) {
3940     name = attrs[ i ].name;
3941     if ( name.indexOf( "data-" ) === 0 ) {
3942     name = jQuery.camelCase( name.slice(5) );
3943     dataAttr( elem, name, data[ name ] );
3944     }
3945     }
3946     }
3947     jQuery._data( elem, "parsedAttrs", true );
3948     }
3949     }
3950    
3951     return data;
3952     }
3953    
3954     // Sets multiple values
3955     if ( typeof key === "object" ) {
3956     return this.each(function() {
3957     jQuery.data( this, key );
3958     });
3959     }
3960    
3961     return arguments.length > 1 ?
3962    
3963     // Sets one value
3964     this.each(function() {
3965     jQuery.data( this, key, value );
3966     }) :
3967    
3968     // Gets one value
3969     // Try to fetch any internally stored data first
3970     elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
3971     },
3972    
3973     removeData: function( key ) {
3974     return this.each(function() {
3975     jQuery.removeData( this, key );
3976     });
3977     }
3978     });
3979    
3980    
3981     jQuery.extend({
3982     queue: function( elem, type, data ) {
3983     var queue;
3984    
3985     if ( elem ) {
3986     type = ( type || "fx" ) + "queue";
3987     queue = jQuery._data( elem, type );
3988    
3989     // Speed up dequeue by getting out quickly if this is just a lookup
3990     if ( data ) {
3991     if ( !queue || jQuery.isArray(data) ) {
3992     queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3993     } else {
3994     queue.push( data );
3995     }
3996     }
3997     return queue || [];
3998     }
3999     },
4000    
4001     dequeue: function( elem, type ) {
4002     type = type || "fx";
4003    
4004     var queue = jQuery.queue( elem, type ),
4005     startLength = queue.length,
4006     fn = queue.shift(),
4007     hooks = jQuery._queueHooks( elem, type ),
4008     next = function() {
4009     jQuery.dequeue( elem, type );
4010     };
4011    
4012     // If the fx queue is dequeued, always remove the progress sentinel
4013     if ( fn === "inprogress" ) {
4014     fn = queue.shift();
4015     startLength--;
4016     }
4017    
4018     if ( fn ) {
4019    
4020     // Add a progress sentinel to prevent the fx queue from being
4021     // automatically dequeued
4022     if ( type === "fx" ) {
4023     queue.unshift( "inprogress" );
4024     }
4025    
4026     // clear up the last queue stop function
4027     delete hooks.stop;
4028     fn.call( elem, next, hooks );
4029     }
4030    
4031     if ( !startLength && hooks ) {
4032     hooks.empty.fire();
4033     }
4034     },
4035    
4036     // not intended for public consumption - generates a queueHooks object, or returns the current one
4037     _queueHooks: function( elem, type ) {
4038     var key = type + "queueHooks";
4039     return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4040     empty: jQuery.Callbacks("once memory").add(function() {
4041     jQuery._removeData( elem, type + "queue" );
4042     jQuery._removeData( elem, key );
4043     })
4044     });
4045     }
4046     });
4047    
4048     jQuery.fn.extend({
4049     queue: function( type, data ) {
4050     var setter = 2;
4051    
4052     if ( typeof type !== "string" ) {
4053     data = type;
4054     type = "fx";
4055     setter--;
4056     }
4057    
4058     if ( arguments.length < setter ) {
4059     return jQuery.queue( this[0], type );
4060     }
4061    
4062     return data === undefined ?
4063     this :
4064     this.each(function() {
4065     var queue = jQuery.queue( this, type, data );
4066    
4067     // ensure a hooks for this queue
4068     jQuery._queueHooks( this, type );
4069    
4070     if ( type === "fx" && queue[0] !== "inprogress" ) {
4071     jQuery.dequeue( this, type );
4072     }
4073     });
4074     },
4075     dequeue: function( type ) {
4076     return this.each(function() {
4077     jQuery.dequeue( this, type );
4078     });
4079     },
4080     clearQueue: function( type ) {
4081     return this.queue( type || "fx", [] );
4082     },
4083     // Get a promise resolved when queues of a certain type
4084     // are emptied (fx is the type by default)
4085     promise: function( type, obj ) {
4086     var tmp,
4087     count = 1,
4088     defer = jQuery.Deferred(),
4089     elements = this,
4090     i = this.length,
4091     resolve = function() {
4092     if ( !( --count ) ) {
4093     defer.resolveWith( elements, [ elements ] );
4094     }
4095     };
4096    
4097     if ( typeof type !== "string" ) {
4098     obj = type;
4099     type = undefined;
4100     }
4101     type = type || "fx";
4102    
4103     while ( i-- ) {
4104     tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4105     if ( tmp && tmp.empty ) {
4106     count++;
4107     tmp.empty.add( resolve );
4108     }
4109     }
4110     resolve();
4111     return defer.promise( obj );
4112     }
4113     });
4114     var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
4115    
4116     var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4117    
4118     var isHidden = function( elem, el ) {
4119     // isHidden might be called from jQuery#filter function;
4120     // in that case, element will be second argument
4121     elem = el || elem;
4122     return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4123     };
4124    
4125    
4126    
4127     // Multifunctional method to get and set values of a collection
4128     // The value/s can optionally be executed if it's a function
4129     var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4130     var i = 0,
4131     length = elems.length,
4132     bulk = key == null;
4133    
4134     // Sets many values
4135     if ( jQuery.type( key ) === "object" ) {
4136     chainable = true;
4137     for ( i in key ) {
4138     jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4139     }
4140    
4141     // Sets one value
4142     } else if ( value !== undefined ) {
4143     chainable = true;
4144    
4145     if ( !jQuery.isFunction( value ) ) {
4146     raw = true;
4147     }
4148    
4149     if ( bulk ) {
4150     // Bulk operations run against the entire set
4151     if ( raw ) {
4152     fn.call( elems, value );
4153     fn = null;
4154    
4155     // ...except when executing function values
4156     } else {
4157     bulk = fn;
4158     fn = function( elem, key, value ) {
4159     return bulk.call( jQuery( elem ), value );
4160     };
4161     }
4162     }
4163    
4164     if ( fn ) {
4165     for ( ; i < length; i++ ) {
4166     fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4167     }
4168     }
4169     }
4170    
4171     return chainable ?
4172     elems :
4173    
4174     // Gets
4175     bulk ?
4176     fn.call( elems ) :
4177     length ? fn( elems[0], key ) : emptyGet;
4178     };
4179     var rcheckableType = (/^(?:checkbox|radio)$/i);
4180    
4181    
4182    
4183     (function() {
4184     // Minified: var a,b,c
4185     var input = document.createElement( "input" ),
4186     div = document.createElement( "div" ),
4187     fragment = document.createDocumentFragment();
4188    
4189     // Setup
4190     div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4191    
4192     // IE strips leading whitespace when .innerHTML is used
4193     support.leadingWhitespace = div.firstChild.nodeType === 3;
4194    
4195     // Make sure that tbody elements aren't automatically inserted
4196     // IE will insert them into empty tables
4197     support.tbody = !div.getElementsByTagName( "tbody" ).length;
4198    
4199     // Make sure that link elements get serialized correctly by innerHTML
4200     // This requires a wrapper element in IE
4201     support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4202    
4203     // Makes sure cloning an html5 element does not cause problems
4204     // Where outerHTML is undefined, this still works
4205     support.html5Clone =
4206     document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4207    
4208     // Check if a disconnected checkbox will retain its checked
4209     // value of true after appended to the DOM (IE6/7)
4210     input.type = "checkbox";
4211     input.checked = true;
4212     fragment.appendChild( input );
4213     support.appendChecked = input.checked;
4214    
4215     // Make sure textarea (and checkbox) defaultValue is properly cloned
4216     // Support: IE6-IE11+
4217     div.innerHTML = "<textarea>x</textarea>";
4218     support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4219    
4220     // #11217 - WebKit loses check when the name is after the checked attribute
4221     fragment.appendChild( div );
4222     div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
4223    
4224     // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4225     // old WebKit doesn't clone checked state correctly in fragments
4226     support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4227    
4228     // Support: IE<9
4229     // Opera does not clone events (and typeof div.attachEvent === undefined).
4230     // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4231     support.noCloneEvent = true;
4232     if ( div.attachEvent ) {
4233     div.attachEvent( "onclick", function() {
4234     support.noCloneEvent = false;
4235     });
4236    
4237     div.cloneNode( true ).click();
4238     }
4239    
4240     // Execute the test only if not already executed in another module.
4241     if (support.deleteExpando == null) {
4242     // Support: IE<9
4243     support.deleteExpando = true;
4244     try {
4245     delete div.test;
4246     } catch( e ) {
4247     support.deleteExpando = false;
4248     }
4249     }
4250     })();
4251    
4252    
4253     (function() {
4254     var i, eventName,
4255     div = document.createElement( "div" );
4256    
4257     // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
4258     for ( i in { submit: true, change: true, focusin: true }) {
4259     eventName = "on" + i;
4260    
4261     if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
4262     // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4263     div.setAttribute( eventName, "t" );
4264     support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
4265     }
4266     }
4267    
4268     // Null elements to avoid leaks in IE.
4269     div = null;
4270     })();
4271    
4272    
4273     var rformElems = /^(?:input|select|textarea)$/i,
4274     rkeyEvent = /^key/,
4275     rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
4276     rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4277     rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4278    
4279     function returnTrue() {
4280     return true;
4281     }
4282    
4283     function returnFalse() {
4284     return false;
4285     }
4286    
4287     function safeActiveElement() {
4288     try {
4289     return document.activeElement;
4290     } catch ( err ) { }
4291     }
4292    
4293     /*
4294     * Helper functions for managing events -- not part of the public interface.
4295     * Props to Dean Edwards' addEvent library for many of the ideas.
4296     */
4297     jQuery.event = {
4298    
4299     global: {},
4300    
4301     add: function( elem, types, handler, data, selector ) {
4302     var tmp, events, t, handleObjIn,
4303     special, eventHandle, handleObj,
4304     handlers, type, namespaces, origType,
4305     elemData = jQuery._data( elem );
4306    
4307     // Don't attach events to noData or text/comment nodes (but allow plain objects)
4308     if ( !elemData ) {
4309     return;
4310     }
4311    
4312     // Caller can pass in an object of custom data in lieu of the handler
4313     if ( handler.handler ) {
4314     handleObjIn = handler;
4315     handler = handleObjIn.handler;
4316     selector = handleObjIn.selector;
4317     }
4318    
4319     // Make sure that the handler has a unique ID, used to find/remove it later
4320     if ( !handler.guid ) {
4321     handler.guid = jQuery.guid++;
4322     }
4323    
4324     // Init the element's event structure and main handler, if this is the first
4325     if ( !(events = elemData.events) ) {
4326     events = elemData.events = {};
4327     }
4328     if ( !(eventHandle = elemData.handle) ) {
4329     eventHandle = elemData.handle = function( e ) {
4330     // Discard the second event of a jQuery.event.trigger() and
4331     // when an event is called after a page has unloaded
4332     return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
4333     jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4334     undefined;
4335     };
4336     // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4337     eventHandle.elem = elem;
4338     }
4339    
4340     // Handle multiple events separated by a space
4341     types = ( types || "" ).match( rnotwhite ) || [ "" ];
4342     t = types.length;
4343     while ( t-- ) {
4344     tmp = rtypenamespace.exec( types[t] ) || [];
4345     type = origType = tmp[1];
4346     namespaces = ( tmp[2] || "" ).split( "." ).sort();
4347    
4348     // There *must* be a type, no attaching namespace-only handlers
4349     if ( !type ) {
4350     continue;
4351     }
4352    
4353     // If event changes its type, use the special event handlers for the changed type
4354     special = jQuery.event.special[ type ] || {};
4355    
4356     // If selector defined, determine special event api type, otherwise given type
4357     type = ( selector ? special.delegateType : special.bindType ) || type;
4358    
4359     // Update special based on newly reset type
4360     special = jQuery.event.special[ type ] || {};
4361    
4362     // handleObj is passed to all event handlers
4363     handleObj = jQuery.extend({
4364     type: type,
4365     origType: origType,
4366     data: data,
4367     handler: handler,
4368     guid: handler.guid,
4369     selector: selector,
4370     needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4371     namespace: namespaces.join(".")
4372     }, handleObjIn );
4373    
4374     // Init the event handler queue if we're the first
4375     if ( !(handlers = events[ type ]) ) {
4376     handlers = events[ type ] = [];
4377     handlers.delegateCount = 0;
4378    
4379     // Only use addEventListener/attachEvent if the special events handler returns false
4380     if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4381     // Bind the global event handler to the element
4382     if ( elem.addEventListener ) {
4383     elem.addEventListener( type, eventHandle, false );
4384    
4385     } else if ( elem.attachEvent ) {
4386     elem.attachEvent( "on" + type, eventHandle );
4387     }
4388     }
4389     }
4390    
4391     if ( special.add ) {
4392     special.add.call( elem, handleObj );
4393    
4394     if ( !handleObj.handler.guid ) {
4395     handleObj.handler.guid = handler.guid;
4396     }
4397     }
4398    
4399     // Add to the element's handler list, delegates in front
4400     if ( selector ) {
4401     handlers.splice( handlers.delegateCount++, 0, handleObj );
4402     } else {
4403     handlers.push( handleObj );
4404     }
4405    
4406     // Keep track of which events have ever been used, for event optimization
4407     jQuery.event.global[ type ] = true;
4408     }
4409    
4410     // Nullify elem to prevent memory leaks in IE
4411     elem = null;
4412     },
4413    
4414     // Detach an event or set of events from an element
4415     remove: function( elem, types, handler, selector, mappedTypes ) {
4416     var j, handleObj, tmp,
4417     origCount, t, events,
4418     special, handlers, type,
4419     namespaces, origType,
4420     elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4421    
4422     if ( !elemData || !(events = elemData.events) ) {
4423     return;
4424     }
4425    
4426     // Once for each type.namespace in types; type may be omitted
4427     types = ( types || "" ).match( rnotwhite ) || [ "" ];
4428     t = types.length;
4429     while ( t-- ) {
4430     tmp = rtypenamespace.exec( types[t] ) || [];
4431     type = origType = tmp[1];
4432     namespaces = ( tmp[2] || "" ).split( "." ).sort();
4433    
4434     // Unbind all events (on this namespace, if provided) for the element
4435     if ( !type ) {
4436     for ( type in events ) {
4437     jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4438     }
4439     continue;
4440     }
4441    
4442     special = jQuery.event.special[ type ] || {};
4443     type = ( selector ? special.delegateType : special.bindType ) || type;
4444     handlers = events[ type ] || [];
4445     tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4446    
4447     // Remove matching events
4448     origCount = j = handlers.length;
4449     while ( j-- ) {
4450     handleObj = handlers[ j ];
4451    
4452     if ( ( mappedTypes || origType === handleObj.origType ) &&
4453     ( !handler || handler.guid === handleObj.guid ) &&
4454     ( !tmp || tmp.test( handleObj.namespace ) ) &&
4455     ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4456     handlers.splice( j, 1 );
4457    
4458     if ( handleObj.selector ) {
4459     handlers.delegateCount--;
4460     }
4461     if ( special.remove ) {
4462     special.remove.call( elem, handleObj );
4463     }
4464     }
4465     }
4466    
4467     // Remove generic event handler if we removed something and no more handlers exist
4468     // (avoids potential for endless recursion during removal of special event handlers)
4469     if ( origCount && !handlers.length ) {
4470     if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4471     jQuery.removeEvent( elem, type, elemData.handle );
4472     }
4473    
4474     delete events[ type ];
4475     }
4476     }
4477    
4478     // Remove the expando if it's no longer used
4479     if ( jQuery.isEmptyObject( events ) ) {
4480     delete elemData.handle;
4481    
4482     // removeData also checks for emptiness and clears the expando if empty
4483     // so use it instead of delete
4484     jQuery._removeData( elem, "events" );
4485     }
4486     },
4487    
4488     trigger: function( event, data, elem, onlyHandlers ) {
4489     var handle, ontype, cur,
4490     bubbleType, special, tmp, i,
4491     eventPath = [ elem || document ],
4492     type = hasOwn.call( event, "type" ) ? event.type : event,
4493     namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4494    
4495     cur = tmp = elem = elem || document;
4496    
4497     // Don't do events on text and comment nodes
4498     if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4499     return;
4500     }
4501    
4502     // focus/blur morphs to focusin/out; ensure we're not firing them right now
4503     if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4504     return;
4505     }
4506    
4507     if ( type.indexOf(".") >= 0 ) {
4508     // Namespaced trigger; create a regexp to match event type in handle()
4509     namespaces = type.split(".");
4510     type = namespaces.shift();
4511     namespaces.sort();
4512     }
4513     ontype = type.indexOf(":") < 0 && "on" + type;
4514    
4515     // Caller can pass in a jQuery.Event object, Object, or just an event type string
4516     event = event[ jQuery.expando ] ?
4517     event :
4518     new jQuery.Event( type, typeof event === "object" && event );
4519    
4520     // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4521     event.isTrigger = onlyHandlers ? 2 : 3;
4522     event.namespace = namespaces.join(".");
4523     event.namespace_re = event.namespace ?
4524     new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4525     null;
4526    
4527     // Clean up the event in case it is being reused
4528     event.result = undefined;
4529     if ( !event.target ) {
4530     event.target = elem;
4531     }
4532    
4533     // Clone any incoming data and prepend the event, creating the handler arg list
4534     data = data == null ?
4535     [ event ] :
4536     jQuery.makeArray( data, [ event ] );
4537    
4538     // Allow special events to draw outside the lines
4539     special = jQuery.event.special[ type ] || {};
4540     if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4541     return;
4542     }
4543    
4544     // Determine event propagation path in advance, per W3C events spec (#9951)
4545     // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4546     if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4547    
4548     bubbleType = special.delegateType || type;
4549     if ( !rfocusMorph.test( bubbleType + type ) ) {
4550     cur = cur.parentNode;
4551     }
4552     for ( ; cur; cur = cur.parentNode ) {
4553     eventPath.push( cur );
4554     tmp = cur;
4555     }
4556    
4557     // Only add window if we got to document (e.g., not plain obj or detached DOM)
4558     if ( tmp === (elem.ownerDocument || document) ) {
4559     eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4560     }
4561     }
4562    
4563     // Fire handlers on the event path
4564     i = 0;
4565     while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4566    
4567     event.type = i > 1 ?
4568     bubbleType :
4569     special.bindType || type;
4570    
4571     // jQuery handler
4572     handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4573     if ( handle ) {
4574     handle.apply( cur, data );
4575     }
4576    
4577     // Native handler
4578     handle = ontype && cur[ ontype ];
4579     if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4580     event.result = handle.apply( cur, data );
4581     if ( event.result === false ) {
4582     event.preventDefault();
4583     }
4584     }
4585     }
4586     event.type = type;
4587    
4588     // If nobody prevented the default action, do it now
4589     if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4590    
4591     if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4592     jQuery.acceptData( elem ) ) {
4593    
4594     // Call a native DOM method on the target with the same name name as the event.
4595     // Can't use an .isFunction() check here because IE6/7 fails that test.
4596     // Don't do default actions on window, that's where global variables be (#6170)
4597     if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4598    
4599     // Don't re-trigger an onFOO event when we call its FOO() method
4600     tmp = elem[ ontype ];
4601    
4602     if ( tmp ) {
4603     elem[ ontype ] = null;
4604     }
4605    
4606     // Prevent re-triggering of the same event, since we already bubbled it above
4607     jQuery.event.triggered = type;
4608     try {
4609     elem[ type ]();
4610     } catch ( e ) {
4611     // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4612     // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4613     }
4614     jQuery.event.triggered = undefined;
4615    
4616     if ( tmp ) {
4617     elem[ ontype ] = tmp;
4618     }
4619     }
4620     }
4621     }
4622    
4623     return event.result;
4624     },
4625    
4626     dispatch: function( event ) {
4627    
4628     // Make a writable jQuery.Event from the native event object
4629     event = jQuery.event.fix( event );
4630    
4631     var i, ret, handleObj, matched, j,
4632     handlerQueue = [],
4633     args = slice.call( arguments ),
4634     handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4635     special = jQuery.event.special[ event.type ] || {};
4636    
4637     // Use the fix-ed jQuery.Event rather than the (read-only) native event
4638     args[0] = event;
4639     event.delegateTarget = this;
4640    
4641     // Call the preDispatch hook for the mapped type, and let it bail if desired
4642     if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4643     return;
4644     }
4645    
4646     // Determine handlers
4647     handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4648    
4649     // Run delegates first; they may want to stop propagation beneath us
4650     i = 0;
4651     while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4652     event.currentTarget = matched.elem;
4653    
4654     j = 0;
4655     while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4656    
4657     // Triggered event must either 1) have no namespace, or
4658     // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4659     if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4660    
4661     event.handleObj = handleObj;
4662     event.data = handleObj.data;
4663    
4664     ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4665     .apply( matched.elem, args );
4666    
4667     if ( ret !== undefined ) {
4668     if ( (event.result = ret) === false ) {
4669     event.preventDefault();
4670     event.stopPropagation();
4671     }
4672     }
4673     }
4674     }
4675     }
4676    
4677     // Call the postDispatch hook for the mapped type
4678     if ( special.postDispatch ) {
4679     special.postDispatch.call( this, event );
4680     }
4681    
4682     return event.result;
4683     },
4684    
4685     handlers: function( event, handlers ) {
4686     var sel, handleObj, matches, i,
4687     handlerQueue = [],
4688     delegateCount = handlers.delegateCount,
4689     cur = event.target;
4690    
4691     // Find delegate handlers
4692     // Black-hole SVG <use> instance trees (#13180)
4693     // Avoid non-left-click bubbling in Firefox (#3861)
4694     if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4695    
4696     /* jshint eqeqeq: false */
4697     for ( ; cur != this; cur = cur.parentNode || this ) {
4698     /* jshint eqeqeq: true */
4699    
4700     // Don't check non-elements (#13208)
4701     // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4702     if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4703     matches = [];
4704     for ( i = 0; i < delegateCount; i++ ) {
4705     handleObj = handlers[ i ];
4706    
4707     // Don't conflict with Object.prototype properties (#13203)
4708     sel = handleObj.selector + " ";
4709    
4710     if ( matches[ sel ] === undefined ) {
4711     matches[ sel ] = handleObj.needsContext ?
4712     jQuery( sel, this ).index( cur ) >= 0 :
4713     jQuery.find( sel, this, null, [ cur ] ).length;
4714     }
4715     if ( matches[ sel ] ) {
4716     matches.push( handleObj );
4717     }
4718     }
4719     if ( matches.length ) {
4720     handlerQueue.push({ elem: cur, handlers: matches });
4721     }
4722     }
4723     }
4724     }
4725    
4726     // Add the remaining (directly-bound) handlers
4727     if ( delegateCount < handlers.length ) {
4728     handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4729     }
4730    
4731     return handlerQueue;
4732     },
4733    
4734     fix: function( event ) {
4735     if ( event[ jQuery.expando ] ) {
4736     return event;
4737     }
4738    
4739     // Create a writable copy of the event object and normalize some properties
4740     var i, prop, copy,
4741     type = event.type,
4742     originalEvent = event,
4743     fixHook = this.fixHooks[ type ];
4744    
4745     if ( !fixHook ) {
4746     this.fixHooks[ type ] = fixHook =
4747     rmouseEvent.test( type ) ? this.mouseHooks :
4748     rkeyEvent.test( type ) ? this.keyHooks :
4749     {};
4750     }
4751     copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4752    
4753     event = new jQuery.Event( originalEvent );
4754    
4755     i = copy.length;
4756     while ( i-- ) {
4757     prop = copy[ i ];
4758     event[ prop ] = originalEvent[ prop ];
4759     }
4760    
4761     // Support: IE<9
4762     // Fix target property (#1925)
4763     if ( !event.target ) {
4764     event.target = originalEvent.srcElement || document;
4765     }
4766    
4767     // Support: Chrome 23+, Safari?
4768     // Target should not be a text node (#504, #13143)
4769     if ( event.target.nodeType === 3 ) {
4770     event.target = event.target.parentNode;
4771     }
4772    
4773     // Support: IE<9
4774     // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4775     event.metaKey = !!event.metaKey;
4776    
4777     return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4778     },
4779    
4780     // Includes some event props shared by KeyEvent and MouseEvent
4781     props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4782    
4783     fixHooks: {},
4784    
4785     keyHooks: {
4786     props: "char charCode key keyCode".split(" "),
4787     filter: function( event, original ) {
4788    
4789     // Add which for key events
4790     if ( event.which == null ) {
4791     event.which = original.charCode != null ? original.charCode : original.keyCode;
4792     }
4793    
4794     return event;
4795     }
4796     },
4797    
4798     mouseHooks: {
4799     props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4800     filter: function( event, original ) {
4801     var body, eventDoc, doc,
4802     button = original.button,
4803     fromElement = original.fromElement;
4804    
4805     // Calculate pageX/Y if missing and clientX/Y available
4806     if ( event.pageX == null && original.clientX != null ) {
4807     eventDoc = event.target.ownerDocument || document;
4808     doc = eventDoc.documentElement;
4809     body = eventDoc.body;
4810    
4811     event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4812     event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4813     }
4814    
4815     // Add relatedTarget, if necessary
4816     if ( !event.relatedTarget && fromElement ) {
4817     event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4818     }
4819    
4820     // Add which for click: 1 === left; 2 === middle; 3 === right
4821     // Note: button is not normalized, so don't use it
4822     if ( !event.which && button !== undefined ) {
4823     event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4824     }
4825    
4826     return event;
4827     }
4828     },
4829    
4830     special: {
4831     load: {
4832     // Prevent triggered image.load events from bubbling to window.load
4833     noBubble: true
4834     },
4835     focus: {
4836     // Fire native event if possible so blur/focus sequence is correct
4837     trigger: function() {
4838     if ( this !== safeActiveElement() && this.focus ) {
4839     try {
4840     this.focus();
4841     return false;
4842     } catch ( e ) {
4843     // Support: IE<9
4844     // If we error on focus to hidden element (#1486, #12518),
4845     // let .trigger() run the handlers
4846     }
4847     }
4848     },
4849     delegateType: "focusin"
4850     },
4851     blur: {
4852     trigger: function() {
4853     if ( this === safeActiveElement() && this.blur ) {
4854     this.blur();
4855     return false;
4856     }
4857     },
4858     delegateType: "focusout"
4859     },
4860     click: {
4861     // For checkbox, fire native event so checked state will be right
4862     trigger: function() {
4863     if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4864     this.click();
4865     return false;
4866     }
4867     },
4868    
4869     // For cross-browser consistency, don't fire native .click() on links
4870     _default: function( event ) {
4871     return jQuery.nodeName( event.target, "a" );
4872     }
4873     },
4874    
4875     beforeunload: {
4876     postDispatch: function( event ) {
4877    
4878     // Support: Firefox 20+
4879     // Firefox doesn't alert if the returnValue field is not set.
4880     if ( event.result !== undefined && event.originalEvent ) {
4881     event.originalEvent.returnValue = event.result;
4882     }
4883     }
4884     }
4885     },
4886    
4887     simulate: function( type, elem, event, bubble ) {
4888     // Piggyback on a donor event to simulate a different one.
4889     // Fake originalEvent to avoid donor's stopPropagation, but if the
4890     // simulated event prevents default then we do the same on the donor.
4891     var e = jQuery.extend(
4892     new jQuery.Event(),
4893     event,
4894     {
4895     type: type,
4896     isSimulated: true,
4897     originalEvent: {}
4898     }
4899     );
4900     if ( bubble ) {
4901     jQuery.event.trigger( e, null, elem );
4902     } else {
4903     jQuery.event.dispatch.call( elem, e );
4904     }
4905     if ( e.isDefaultPrevented() ) {
4906     event.preventDefault();
4907     }
4908     }
4909     };
4910    
4911     jQuery.removeEvent = document.removeEventListener ?
4912     function( elem, type, handle ) {
4913     if ( elem.removeEventListener ) {
4914     elem.removeEventListener( type, handle, false );
4915     }
4916     } :
4917     function( elem, type, handle ) {
4918     var name = "on" + type;
4919    
4920     if ( elem.detachEvent ) {
4921    
4922     // #8545, #7054, preventing memory leaks for custom events in IE6-8
4923     // detachEvent needed property on element, by name of that event, to properly expose it to GC
4924     if ( typeof elem[ name ] === strundefined ) {
4925     elem[ name ] = null;
4926     }
4927    
4928     elem.detachEvent( name, handle );
4929     }
4930     };
4931    
4932     jQuery.Event = function( src, props ) {
4933     // Allow instantiation without the 'new' keyword
4934     if ( !(this instanceof jQuery.Event) ) {
4935     return new jQuery.Event( src, props );
4936     }
4937    
4938     // Event object
4939     if ( src && src.type ) {
4940     this.originalEvent = src;
4941     this.type = src.type;
4942    
4943     // Events bubbling up the document may have been marked as prevented
4944     // by a handler lower down the tree; reflect the correct value.
4945     this.isDefaultPrevented = src.defaultPrevented ||
4946     src.defaultPrevented === undefined &&
4947     // Support: IE < 9, Android < 4.0
4948     src.returnValue === false ?
4949     returnTrue :
4950     returnFalse;
4951    
4952     // Event type
4953     } else {
4954     this.type = src;
4955     }
4956    
4957     // Put explicitly provided properties onto the event object
4958     if ( props ) {
4959     jQuery.extend( this, props );
4960     }
4961    
4962     // Create a timestamp if incoming event doesn't have one
4963     this.timeStamp = src && src.timeStamp || jQuery.now();
4964    
4965     // Mark it as fixed
4966     this[ jQuery.expando ] = true;
4967     };
4968    
4969     // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4970     // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4971     jQuery.Event.prototype = {
4972     isDefaultPrevented: returnFalse,
4973     isPropagationStopped: returnFalse,
4974     isImmediatePropagationStopped: returnFalse,
4975    
4976     preventDefault: function() {
4977     var e = this.originalEvent;
4978    
4979     this.isDefaultPrevented = returnTrue;
4980     if ( !e ) {
4981     return;
4982     }
4983    
4984     // If preventDefault exists, run it on the original event
4985     if ( e.preventDefault ) {
4986     e.preventDefault();
4987    
4988     // Support: IE
4989     // Otherwise set the returnValue property of the original event to false
4990     } else {
4991     e.returnValue = false;
4992     }
4993     },
4994     stopPropagation: function() {
4995     var e = this.originalEvent;
4996    
4997     this.isPropagationStopped = returnTrue;
4998     if ( !e ) {
4999     return;
5000     }
5001     // If stopPropagation exists, run it on the original event
5002     if ( e.stopPropagation ) {
5003     e.stopPropagation();
5004     }
5005    
5006     // Support: IE
5007     // Set the cancelBubble property of the original event to true
5008     e.cancelBubble = true;
5009     },
5010     stopImmediatePropagation: function() {
5011     var e = this.originalEvent;
5012    
5013     this.isImmediatePropagationStopped = returnTrue;
5014    
5015     if ( e && e.stopImmediatePropagation ) {
5016     e.stopImmediatePropagation();
5017     }
5018    
5019     this.stopPropagation();
5020     }
5021     };
5022    
5023     // Create mouseenter/leave events using mouseover/out and event-time checks
5024     jQuery.each({
5025     mouseenter: "mouseover",
5026     mouseleave: "mouseout",
5027     pointerenter: "pointerover",
5028     pointerleave: "pointerout"
5029     }, function( orig, fix ) {
5030     jQuery.event.special[ orig ] = {
5031     delegateType: fix,
5032     bindType: fix,
5033    
5034     handle: function( event ) {
5035     var ret,
5036     target = this,
5037     related = event.relatedTarget,
5038     handleObj = event.handleObj;
5039    
5040     // For mousenter/leave call the handler if related is outside the target.
5041     // NB: No relatedTarget if the mouse left/entered the browser window
5042     if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5043     event.type = handleObj.origType;
5044     ret = handleObj.handler.apply( this, arguments );
5045     event.type = fix;
5046     }
5047     return ret;
5048     }
5049     };
5050     });
5051    
5052     // IE submit delegation
5053     if ( !support.submitBubbles ) {
5054    
5055     jQuery.event.special.submit = {
5056     setup: function() {
5057     // Only need this for delegated form submit events
5058     if ( jQuery.nodeName( this, "form" ) ) {
5059     return false;
5060     }
5061    
5062     // Lazy-add a submit handler when a descendant form may potentially be submitted
5063     jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5064     // Node name check avoids a VML-related crash in IE (#9807)
5065     var elem = e.target,
5066     form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5067     if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5068     jQuery.event.add( form, "submit._submit", function( event ) {
5069     event._submit_bubble = true;
5070     });
5071     jQuery._data( form, "submitBubbles", true );
5072     }
5073     });
5074     // return undefined since we don't need an event listener
5075     },
5076    
5077     postDispatch: function( event ) {
5078     // If form was submitted by the user, bubble the event up the tree
5079     if ( event._submit_bubble ) {
5080     delete event._submit_bubble;
5081     if ( this.parentNode && !event.isTrigger ) {
5082     jQuery.event.simulate( "submit", this.parentNode, event, true );
5083     }
5084     }
5085     },
5086    
5087     teardown: function() {
5088     // Only need this for delegated form submit events
5089     if ( jQuery.nodeName( this, "form" ) ) {
5090     return false;
5091     }
5092    
5093     // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5094     jQuery.event.remove( this, "._submit" );
5095     }
5096     };
5097     }
5098    
5099     // IE change delegation and checkbox/radio fix
5100     if ( !support.changeBubbles ) {
5101    
5102     jQuery.event.special.change = {
5103    
5104     setup: function() {
5105    
5106     if ( rformElems.test( this.nodeName ) ) {
5107     // IE doesn't fire change on a check/radio until blur; trigger it on click
5108     // after a propertychange. Eat the blur-change in special.change.handle.
5109     // This still fires onchange a second time for check/radio after blur.
5110     if ( this.type === "checkbox" || this.type === "radio" ) {
5111     jQuery.event.add( this, "propertychange._change", function( event ) {
5112     if ( event.originalEvent.propertyName === "checked" ) {
5113     this._just_changed = true;
5114     }
5115     });
5116     jQuery.event.add( this, "click._change", function( event ) {
5117     if ( this._just_changed && !event.isTrigger ) {
5118     this._just_changed = false;
5119     }
5120     // Allow triggered, simulated change events (#11500)
5121     jQuery.event.simulate( "change", this, event, true );
5122     });
5123     }
5124     return false;
5125     }
5126     // Delegated event; lazy-add a change handler on descendant inputs
5127     jQuery.event.add( this, "beforeactivate._change", function( e ) {
5128     var elem = e.target;
5129    
5130     if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5131     jQuery.event.add( elem, "change._change", function( event ) {
5132     if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5133     jQuery.event.simulate( "change", this.parentNode, event, true );
5134     }
5135     });
5136     jQuery._data( elem, "changeBubbles", true );
5137     }
5138     });
5139     },
5140    
5141     handle: function( event ) {
5142     var elem = event.target;
5143    
5144     // Swallow native change events from checkbox/radio, we already triggered them above
5145     if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5146     return event.handleObj.handler.apply( this, arguments );
5147     }
5148     },
5149    
5150     teardown: function() {
5151     jQuery.event.remove( this, "._change" );
5152    
5153     return !rformElems.test( this.nodeName );
5154     }
5155     };
5156     }
5157    
5158     // Create "bubbling" focus and blur events
5159     if ( !support.focusinBubbles ) {
5160     jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5161    
5162     // Attach a single capturing handler on the document while someone wants focusin/focusout
5163     var handler = function( event ) {
5164     jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5165     };
5166    
5167     jQuery.event.special[ fix ] = {
5168     setup: function() {
5169     var doc = this.ownerDocument || this,
5170     attaches = jQuery._data( doc, fix );
5171    
5172     if ( !attaches ) {
5173     doc.addEventListener( orig, handler, true );
5174     }
5175     jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5176     },
5177     teardown: function() {
5178     var doc = this.ownerDocument || this,
5179     attaches = jQuery._data( doc, fix ) - 1;
5180    
5181     if ( !attaches ) {
5182     doc.removeEventListener( orig, handler, true );
5183     jQuery._removeData( doc, fix );
5184     } else {
5185     jQuery._data( doc, fix, attaches );
5186     }
5187     }
5188     };
5189     });
5190     }
5191    
5192     jQuery.fn.extend({
5193    
5194     on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5195     var type, origFn;
5196    
5197     // Types can be a map of types/handlers
5198     if ( typeof types === "object" ) {
5199     // ( types-Object, selector, data )
5200     if ( typeof selector !== "string" ) {
5201     // ( types-Object, data )
5202     data = data || selector;
5203     selector = undefined;
5204     }
5205     for ( type in types ) {
5206     this.on( type, selector, data, types[ type ], one );
5207     }
5208     return this;
5209     }
5210    
5211     if ( data == null && fn == null ) {
5212     // ( types, fn )
5213     fn = selector;
5214     data = selector = undefined;
5215     } else if ( fn == null ) {
5216     if ( typeof selector === "string" ) {
5217     // ( types, selector, fn )
5218     fn = data;
5219     data = undefined;
5220     } else {
5221     // ( types, data, fn )
5222     fn = data;
5223     data = selector;
5224     selector = undefined;
5225     }
5226     }
5227     if ( fn === false ) {
5228     fn = returnFalse;
5229     } else if ( !fn ) {
5230     return this;
5231     }
5232    
5233     if ( one === 1 ) {
5234     origFn = fn;
5235     fn = function( event ) {
5236     // Can use an empty set, since event contains the info
5237     jQuery().off( event );
5238     return origFn.apply( this, arguments );
5239     };
5240     // Use same guid so caller can remove using origFn
5241     fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5242     }
5243     return this.each( function() {
5244     jQuery.event.add( this, types, fn, data, selector );
5245     });
5246     },
5247     one: function( types, selector, data, fn ) {
5248     return this.on( types, selector, data, fn, 1 );
5249     },
5250     off: function( types, selector, fn ) {
5251     var handleObj, type;
5252     if ( types && types.preventDefault && types.handleObj ) {
5253     // ( event ) dispatched jQuery.Event
5254     handleObj = types.handleObj;
5255     jQuery( types.delegateTarget ).off(
5256     handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5257     handleObj.selector,
5258     handleObj.handler
5259     );
5260     return this;
5261     }
5262     if ( typeof types === "object" ) {
5263     // ( types-object [, selector] )
5264     for ( type in types ) {
5265     this.off( type, selector, types[ type ] );
5266     }
5267     return this;
5268     }
5269     if ( selector === false || typeof selector === "function" ) {
5270     // ( types [, fn] )
5271     fn = selector;
5272     selector = undefined;
5273     }
5274     if ( fn === false ) {
5275     fn = returnFalse;
5276     }
5277     return this.each(function() {
5278     jQuery.event.remove( this, types, fn, selector );
5279     });
5280     },
5281    
5282     trigger: function( type, data ) {
5283     return this.each(function() {
5284     jQuery.event.trigger( type, data, this );
5285     });
5286     },
5287     triggerHandler: function( type, data ) {
5288     var elem = this[0];
5289     if ( elem ) {
5290     return jQuery.event.trigger( type, data, elem, true );
5291     }
5292     }
5293     });
5294    
5295    
5296     function createSafeFragment( document ) {
5297     var list = nodeNames.split( "|" ),
5298     safeFrag = document.createDocumentFragment();
5299    
5300     if ( safeFrag.createElement ) {
5301     while ( list.length ) {
5302     safeFrag.createElement(
5303     list.pop()
5304     );
5305     }
5306     }
5307     return safeFrag;
5308     }
5309    
5310     var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5311     "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5312     rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5313     rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5314     rleadingWhitespace = /^\s+/,
5315     rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5316     rtagName = /<([\w:]+)/,
5317     rtbody = /<tbody/i,
5318     rhtml = /<|&#?\w+;/,
5319     rnoInnerhtml = /<(?:script|style|link)/i,
5320     // checked="checked" or checked
5321     rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5322     rscriptType = /^$|\/(?:java|ecma)script/i,
5323     rscriptTypeMasked = /^true\/(.*)/,
5324     rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5325    
5326     // We have to close these tags to support XHTML (#13200)
5327     wrapMap = {
5328     option: [ 1, "<select multiple='multiple'>", "</select>" ],
5329     legend: [ 1, "<fieldset>", "</fieldset>" ],
5330     area: [ 1, "<map>", "</map>" ],
5331     param: [ 1, "<object>", "</object>" ],
5332     thead: [ 1, "<table>", "</table>" ],
5333     tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5334     col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5335     td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5336    
5337     // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5338     // unless wrapped in a div with non-breaking characters in front of it.
5339     _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5340     },
5341     safeFragment = createSafeFragment( document ),
5342     fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5343    
5344     wrapMap.optgroup = wrapMap.option;
5345     wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5346     wrapMap.th = wrapMap.td;
5347    
5348     function getAll( context, tag ) {
5349     var elems, elem,
5350     i = 0,
5351     found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
5352     typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
5353     undefined;
5354    
5355     if ( !found ) {
5356     for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5357     if ( !tag || jQuery.nodeName( elem, tag ) ) {
5358     found.push( elem );
5359     } else {
5360     jQuery.merge( found, getAll( elem, tag ) );
5361     }
5362     }
5363     }
5364    
5365     return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5366     jQuery.merge( [ context ], found ) :
5367     found;
5368     }
5369    
5370     // Used in buildFragment, fixes the defaultChecked property
5371     function fixDefaultChecked( elem ) {
5372     if ( rcheckableType.test( elem.type ) ) {
5373     elem.defaultChecked = elem.checked;
5374     }
5375     }
5376    
5377     // Support: IE<8
5378     // Manipulating tables requires a tbody
5379     function manipulationTarget( elem, content ) {
5380     return jQuery.nodeName( elem, "table" ) &&
5381     jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5382    
5383     elem.getElementsByTagName("tbody")[0] ||
5384     elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
5385     elem;
5386     }
5387    
5388     // Replace/restore the type attribute of script elements for safe DOM manipulation
5389     function disableScript( elem ) {
5390     elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
5391     return elem;
5392     }
5393     function restoreScript( elem ) {
5394     var match = rscriptTypeMasked.exec( elem.type );
5395     if ( match ) {
5396     elem.type = match[1];
5397     } else {
5398     elem.removeAttribute("type");
5399     }
5400     return elem;
5401     }
5402    
5403     // Mark scripts as having already been evaluated
5404     function setGlobalEval( elems, refElements ) {
5405     var elem,
5406     i = 0;
5407     for ( ; (elem = elems[i]) != null; i++ ) {
5408     jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5409     }
5410     }
5411    
5412     function cloneCopyEvent( src, dest ) {
5413    
5414     if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5415     return;
5416     }
5417    
5418     var type, i, l,
5419     oldData = jQuery._data( src ),
5420     curData = jQuery._data( dest, oldData ),
5421     events = oldData.events;
5422    
5423     if ( events ) {
5424     delete curData.handle;
5425     curData.events = {};
5426    
5427     for ( type in events ) {
5428     for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5429     jQuery.event.add( dest, type, events[ type ][ i ] );
5430     }
5431     }
5432     }
5433    
5434     // make the cloned public data object a copy from the original
5435     if ( curData.data ) {
5436     curData.data = jQuery.extend( {}, curData.data );
5437     }
5438     }
5439    
5440     function fixCloneNodeIssues( src, dest ) {
5441     var nodeName, e, data;
5442    
5443     // We do not need to do anything for non-Elements
5444     if ( dest.nodeType !== 1 ) {
5445     return;
5446     }
5447    
5448     nodeName = dest.nodeName.toLowerCase();
5449    
5450     // IE6-8 copies events bound via attachEvent when using cloneNode.
5451     if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5452     data = jQuery._data( dest );
5453    
5454     for ( e in data.events ) {
5455     jQuery.removeEvent( dest, e, data.handle );
5456     }
5457    
5458     // Event data gets referenced instead of copied if the expando gets copied too
5459     dest.removeAttribute( jQuery.expando );
5460     }
5461    
5462     // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5463     if ( nodeName === "script" && dest.text !== src.text ) {
5464     disableScript( dest ).text = src.text;
5465     restoreScript( dest );
5466    
5467     // IE6-10 improperly clones children of object elements using classid.
5468     // IE10 throws NoModificationAllowedError if parent is null, #12132.
5469     } else if ( nodeName === "object" ) {
5470     if ( dest.parentNode ) {
5471     dest.outerHTML = src.outerHTML;
5472     }
5473    
5474     // This path appears unavoidable for IE9. When cloning an object
5475     // element in IE9, the outerHTML strategy above is not sufficient.
5476     // If the src has innerHTML and the destination does not,
5477     // copy the src.innerHTML into the dest.innerHTML. #10324
5478     if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5479     dest.innerHTML = src.innerHTML;
5480     }
5481    
5482     } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5483     // IE6-8 fails to persist the checked state of a cloned checkbox
5484     // or radio button. Worse, IE6-7 fail to give the cloned element
5485     // a checked appearance if the defaultChecked value isn't also set
5486    
5487     dest.defaultChecked = dest.checked = src.checked;
5488    
5489     // IE6-7 get confused and end up setting the value of a cloned
5490     // checkbox/radio button to an empty string instead of "on"
5491     if ( dest.value !== src.value ) {
5492     dest.value = src.value;
5493     }
5494    
5495     // IE6-8 fails to return the selected option to the default selected
5496     // state when cloning options
5497     } else if ( nodeName === "option" ) {
5498     dest.defaultSelected = dest.selected = src.defaultSelected;
5499    
5500     // IE6-8 fails to set the defaultValue to the correct value when
5501     // cloning other types of input fields
5502     } else if ( nodeName === "input" || nodeName === "textarea" ) {
5503     dest.defaultValue = src.defaultValue;
5504     }
5505     }
5506    
5507     jQuery.extend({
5508     clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5509     var destElements, node, clone, i, srcElements,
5510     inPage = jQuery.contains( elem.ownerDocument, elem );
5511    
5512     if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5513     clone = elem.cloneNode( true );
5514    
5515     // IE<=8 does not properly clone detached, unknown element nodes
5516     } else {
5517     fragmentDiv.innerHTML = elem.outerHTML;
5518     fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5519     }
5520    
5521     if ( (!support.noCloneEvent || !support.noCloneChecked) &&
5522     (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5523    
5524     // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5525     destElements = getAll( clone );
5526     srcElements = getAll( elem );
5527    
5528     // Fix all IE cloning issues
5529     for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5530     // Ensure that the destination node is not null; Fixes #9587
5531     if ( destElements[i] ) {
5532     fixCloneNodeIssues( node, destElements[i] );
5533     }
5534     }
5535     }
5536    
5537     // Copy the events from the original to the clone
5538     if ( dataAndEvents ) {
5539     if ( deepDataAndEvents ) {
5540     srcElements = srcElements || getAll( elem );
5541     destElements = destElements || getAll( clone );
5542    
5543     for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5544     cloneCopyEvent( node, destElements[i] );
5545     }
5546     } else {
5547     cloneCopyEvent( elem, clone );
5548     }
5549     }
5550    
5551     // Preserve script evaluation history
5552     destElements = getAll( clone, "script" );
5553     if ( destElements.length > 0 ) {
5554     setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5555     }
5556    
5557     destElements = srcElements = node = null;
5558    
5559     // Return the cloned set
5560     return clone;
5561     },
5562    
5563     buildFragment: function( elems, context, scripts, selection ) {
5564     var j, elem, contains,
5565     tmp, tag, tbody, wrap,
5566     l = elems.length,
5567    
5568     // Ensure a safe fragment
5569     safe = createSafeFragment( context ),
5570    
5571     nodes = [],
5572     i = 0;
5573    
5574     for ( ; i < l; i++ ) {
5575     elem = elems[ i ];
5576    
5577     if ( elem || elem === 0 ) {
5578    
5579     // Add nodes directly
5580     if ( jQuery.type( elem ) === "object" ) {
5581     jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5582    
5583     // Convert non-html into a text node
5584     } else if ( !rhtml.test( elem ) ) {
5585     nodes.push( context.createTextNode( elem ) );
5586    
5587     // Convert html into DOM nodes
5588     } else {
5589     tmp = tmp || safe.appendChild( context.createElement("div") );
5590    
5591     // Deserialize a standard representation
5592     tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
5593     wrap = wrapMap[ tag ] || wrapMap._default;
5594    
5595     tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5596    
5597     // Descend through wrappers to the right content
5598     j = wrap[0];
5599     while ( j-- ) {
5600     tmp = tmp.lastChild;
5601     }
5602    
5603     // Manually add leading whitespace removed by IE
5604     if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5605     nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5606     }
5607    
5608     // Remove IE's autoinserted <tbody> from table fragments
5609     if ( !support.tbody ) {
5610    
5611     // String was a <table>, *may* have spurious <tbody>
5612     elem = tag === "table" && !rtbody.test( elem ) ?
5613     tmp.firstChild :
5614    
5615     // String was a bare <thead> or <tfoot>
5616     wrap[1] === "<table>" && !rtbody.test( elem ) ?
5617     tmp :
5618     0;
5619    
5620     j = elem && elem.childNodes.length;
5621     while ( j-- ) {
5622     if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5623     elem.removeChild( tbody );
5624     }
5625     }
5626     }
5627    
5628     jQuery.merge( nodes, tmp.childNodes );
5629    
5630     // Fix #12392 for WebKit and IE > 9
5631     tmp.textContent = "";
5632    
5633     // Fix #12392 for oldIE
5634     while ( tmp.firstChild ) {
5635     tmp.removeChild( tmp.firstChild );
5636     }
5637    
5638     // Remember the top-level container for proper cleanup
5639     tmp = safe.lastChild;
5640     }
5641     }
5642     }
5643    
5644     // Fix #11356: Clear elements from fragment
5645     if ( tmp ) {
5646     safe.removeChild( tmp );
5647     }
5648    
5649     // Reset defaultChecked for any radios and checkboxes
5650     // about to be appended to the DOM in IE 6/7 (#8060)
5651     if ( !support.appendChecked ) {
5652     jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5653     }
5654    
5655     i = 0;
5656     while ( (elem = nodes[ i++ ]) ) {
5657    
5658     // #4087 - If origin and destination elements are the same, and this is
5659     // that element, do not do anything
5660     if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5661     continue;
5662     }
5663    
5664     contains = jQuery.contains( elem.ownerDocument, elem );
5665    
5666     // Append to fragment
5667     tmp = getAll( safe.appendChild( elem ), "script" );
5668    
5669     // Preserve script evaluation history
5670     if ( contains ) {
5671     setGlobalEval( tmp );
5672     }
5673    
5674     // Capture executables
5675     if ( scripts ) {
5676     j = 0;
5677     while ( (elem = tmp[ j++ ]) ) {
5678     if ( rscriptType.test( elem.type || "" ) ) {
5679     scripts.push( elem );
5680     }
5681     }
5682     }
5683     }
5684    
5685     tmp = null;
5686    
5687     return safe;
5688     },
5689    
5690     cleanData: function( elems, /* internal */ acceptData ) {
5691     var elem, type, id, data,
5692     i = 0,
5693     internalKey = jQuery.expando,
5694     cache = jQuery.cache,
5695     deleteExpando = support.deleteExpando,
5696     special = jQuery.event.special;
5697    
5698     for ( ; (elem = elems[i]) != null; i++ ) {
5699     if ( acceptData || jQuery.acceptData( elem ) ) {
5700    
5701     id = elem[ internalKey ];
5702     data = id && cache[ id ];
5703    
5704     if ( data ) {
5705     if ( data.events ) {
5706     for ( type in data.events ) {
5707     if ( special[ type ] ) {
5708     jQuery.event.remove( elem, type );
5709    
5710     // This is a shortcut to avoid jQuery.event.remove's overhead
5711     } else {
5712     jQuery.removeEvent( elem, type, data.handle );
5713     }
5714     }
5715     }
5716    
5717     // Remove cache only if it was not already removed by jQuery.event.remove
5718     if ( cache[ id ] ) {
5719    
5720     delete cache[ id ];
5721    
5722     // IE does not allow us to delete expando properties from nodes,
5723     // nor does it have a removeAttribute function on Document nodes;
5724     // we must handle all of these cases
5725     if ( deleteExpando ) {
5726     delete elem[ internalKey ];
5727    
5728     } else if ( typeof elem.removeAttribute !== strundefined ) {
5729     elem.removeAttribute( internalKey );
5730    
5731     } else {
5732     elem[ internalKey ] = null;
5733     }
5734    
5735     deletedIds.push( id );
5736     }
5737     }
5738     }
5739     }
5740     }
5741     });
5742    
5743     jQuery.fn.extend({
5744     text: function( value ) {
5745     return access( this, function( value ) {
5746     return value === undefined ?
5747     jQuery.text( this ) :
5748     this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5749     }, null, value, arguments.length );
5750     },
5751    
5752     append: function() {
5753     return this.domManip( arguments, function( elem ) {
5754     if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5755     var target = manipulationTarget( this, elem );
5756     target.appendChild( elem );
5757     }
5758     });
5759     },
5760    
5761     prepend: function() {
5762     return this.domManip( arguments, function( elem ) {
5763     if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5764     var target = manipulationTarget( this, elem );
5765     target.insertBefore( elem, target.firstChild );
5766     }
5767     });
5768     },
5769    
5770     before: function() {
5771     return this.domManip( arguments, function( elem ) {
5772     if ( this.parentNode ) {
5773     this.parentNode.insertBefore( elem, this );
5774     }
5775     });
5776     },
5777    
5778     after: function() {
5779     return this.domManip( arguments, function( elem ) {
5780     if ( this.parentNode ) {
5781     this.parentNode.insertBefore( elem, this.nextSibling );
5782     }
5783     });
5784     },
5785    
5786     remove: function( selector, keepData /* Internal Use Only */ ) {
5787     var elem,
5788     elems = selector ? jQuery.filter( selector, this ) : this,
5789     i = 0;
5790    
5791     for ( ; (elem = elems[i]) != null; i++ ) {
5792    
5793     if ( !keepData && elem.nodeType === 1 ) {
5794     jQuery.cleanData( getAll( elem ) );
5795     }
5796    
5797     if ( elem.parentNode ) {
5798     if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5799     setGlobalEval( getAll( elem, "script" ) );
5800     }
5801     elem.parentNode.removeChild( elem );
5802     }
5803     }
5804    
5805     return this;
5806     },
5807    
5808     empty: function() {
5809     var elem,
5810     i = 0;
5811    
5812     for ( ; (elem = this[i]) != null; i++ ) {
5813     // Remove element nodes and prevent memory leaks
5814     if ( elem.nodeType === 1 ) {
5815     jQuery.cleanData( getAll( elem, false ) );
5816     }
5817    
5818     // Remove any remaining nodes
5819     while ( elem.firstChild ) {
5820     elem.removeChild( elem.firstChild );
5821     }
5822    
5823     // If this is a select, ensure that it displays empty (#12336)
5824     // Support: IE<9
5825     if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5826     elem.options.length = 0;
5827     }
5828     }
5829    
5830     return this;
5831     },
5832    
5833     clone: function( dataAndEvents, deepDataAndEvents ) {
5834     dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5835     deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5836    
5837     return this.map(function() {
5838     return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5839     });
5840     },
5841    
5842     html: function( value ) {
5843     return access( this, function( value ) {
5844     var elem = this[ 0 ] || {},
5845     i = 0,
5846     l = this.length;
5847    
5848     if ( value === undefined ) {
5849     return elem.nodeType === 1 ?
5850     elem.innerHTML.replace( rinlinejQuery, "" ) :
5851     undefined;
5852     }
5853    
5854     // See if we can take a shortcut and just use innerHTML
5855     if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5856     ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
5857     ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5858     !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
5859    
5860     value = value.replace( rxhtmlTag, "<$1></$2>" );
5861    
5862     try {
5863     for (; i < l; i++ ) {
5864     // Remove element nodes and prevent memory leaks
5865     elem = this[i] || {};
5866     if ( elem.nodeType === 1 ) {
5867     jQuery.cleanData( getAll( elem, false ) );
5868     elem.innerHTML = value;
5869     }
5870     }
5871    
5872     elem = 0;
5873    
5874     // If using innerHTML throws an exception, use the fallback method
5875     } catch(e) {}
5876     }
5877    
5878     if ( elem ) {
5879     this.empty().append( value );
5880     }
5881     }, null, value, arguments.length );
5882     },
5883    
5884     replaceWith: function() {
5885     var arg = arguments[ 0 ];
5886    
5887     // Make the changes, replacing each context element with the new content
5888     this.domManip( arguments, function( elem ) {
5889     arg = this.parentNode;
5890    
5891     jQuery.cleanData( getAll( this ) );
5892    
5893     if ( arg ) {
5894     arg.replaceChild( elem, this );
5895     }
5896     });
5897    
5898     // Force removal if there was no new content (e.g., from empty arguments)
5899     return arg && (arg.length || arg.nodeType) ? this : this.remove();
5900     },
5901    
5902     detach: function( selector ) {
5903     return this.remove( selector, true );
5904     },
5905    
5906     domManip: function( args, callback ) {
5907    
5908     // Flatten any nested arrays
5909     args = concat.apply( [], args );
5910    
5911     var first, node, hasScripts,
5912     scripts, doc, fragment,
5913     i = 0,
5914     l = this.length,
5915     set = this,
5916     iNoClone = l - 1,
5917     value = args[0],
5918     isFunction = jQuery.isFunction( value );
5919    
5920     // We can't cloneNode fragments that contain checked, in WebKit
5921     if ( isFunction ||
5922     ( l > 1 && typeof value === "string" &&
5923     !support.checkClone && rchecked.test( value ) ) ) {
5924     return this.each(function( index ) {
5925     var self = set.eq( index );
5926     if ( isFunction ) {
5927     args[0] = value.call( this, index, self.html() );
5928     }
5929     self.domManip( args, callback );
5930     });
5931     }
5932    
5933     if ( l ) {
5934     fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5935     first = fragment.firstChild;
5936    
5937     if ( fragment.childNodes.length === 1 ) {
5938     fragment = first;
5939     }
5940    
5941     if ( first ) {
5942     scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5943     hasScripts = scripts.length;
5944    
5945     // Use the original fragment for the last item instead of the first because it can end up
5946     // being emptied incorrectly in certain situations (#8070).
5947     for ( ; i < l; i++ ) {
5948     node = fragment;
5949    
5950     if ( i !== iNoClone ) {
5951     node = jQuery.clone( node, true, true );
5952    
5953     // Keep references to cloned scripts for later restoration
5954     if ( hasScripts ) {
5955     jQuery.merge( scripts, getAll( node, "script" ) );
5956     }
5957     }
5958    
5959     callback.call( this[i], node, i );
5960     }
5961    
5962     if ( hasScripts ) {
5963     doc = scripts[ scripts.length - 1 ].ownerDocument;
5964    
5965     // Reenable scripts
5966     jQuery.map( scripts, restoreScript );
5967    
5968     // Evaluate executable scripts on first document insertion
5969     for ( i = 0; i < hasScripts; i++ ) {
5970     node = scripts[ i ];
5971     if ( rscriptType.test( node.type || "" ) &&
5972     !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5973    
5974     if ( node.src ) {
5975     // Optional AJAX dependency, but won't run scripts if not present
5976     if ( jQuery._evalUrl ) {
5977     jQuery._evalUrl( node.src );
5978     }
5979     } else {
5980     jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5981     }
5982     }
5983     }
5984     }
5985    
5986     // Fix #11809: Avoid leaking memory
5987     fragment = first = null;
5988     }
5989     }
5990    
5991     return this;
5992     }
5993     });
5994    
5995     jQuery.each({
5996     appendTo: "append",
5997     prependTo: "prepend",
5998     insertBefore: "before",
5999     insertAfter: "after",
6000     replaceAll: "replaceWith"
6001     }, function( name, original ) {
6002     jQuery.fn[ name ] = function( selector ) {
6003     var elems,
6004     i = 0,
6005     ret = [],
6006     insert = jQuery( selector ),
6007     last = insert.length - 1;
6008    
6009     for ( ; i <= last; i++ ) {
6010     elems = i === last ? this : this.clone(true);
6011     jQuery( insert[i] )[ original ]( elems );
6012    
6013     // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6014     push.apply( ret, elems.get() );
6015     }
6016    
6017     return this.pushStack( ret );
6018     };
6019     });
6020    
6021    
6022     var iframe,
6023     elemdisplay = {};
6024    
6025     /**
6026     * Retrieve the actual display of a element
6027     * @param {String} name nodeName of the element
6028     * @param {Object} doc Document object
6029     */
6030     // Called only from within defaultDisplay
6031     function actualDisplay( name, doc ) {
6032     var style,
6033     elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6034    
6035     // getDefaultComputedStyle might be reliably used only on attached element
6036     display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
6037    
6038     // Use of this method is a temporary fix (more like optmization) until something better comes along,
6039     // since it was removed from specification and supported only in FF
6040     style.display : jQuery.css( elem[ 0 ], "display" );
6041    
6042     // We don't have any data stored on the element,
6043     // so use "detach" method as fast way to get rid of the element
6044     elem.detach();
6045    
6046     return display;
6047     }
6048    
6049     /**
6050     * Try to determine the default display value of an element
6051     * @param {String} nodeName
6052     */
6053     function defaultDisplay( nodeName ) {
6054     var doc = document,
6055     display = elemdisplay[ nodeName ];
6056    
6057     if ( !display ) {
6058     display = actualDisplay( nodeName, doc );
6059    
6060     // If the simple way fails, read from inside an iframe
6061     if ( display === "none" || !display ) {
6062    
6063     // Use the already-created iframe if possible
6064     iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6065    
6066     // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6067     doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6068    
6069     // Support: IE
6070     doc.write();
6071     doc.close();
6072    
6073     display = actualDisplay( nodeName, doc );
6074     iframe.detach();
6075     }
6076    
6077     // Store the correct default display
6078     elemdisplay[ nodeName ] = display;
6079     }
6080    
6081     return display;
6082     }
6083    
6084    
6085     (function() {
6086     var shrinkWrapBlocksVal;
6087    
6088     support.shrinkWrapBlocks = function() {
6089     if ( shrinkWrapBlocksVal != null ) {
6090     return shrinkWrapBlocksVal;
6091     }
6092    
6093     // Will be changed later if needed.
6094     shrinkWrapBlocksVal = false;
6095    
6096     // Minified: var b,c,d
6097     var div, body, container;
6098    
6099     body = document.getElementsByTagName( "body" )[ 0 ];
6100     if ( !body || !body.style ) {
6101     // Test fired too early or in an unsupported environment, exit.
6102     return;
6103     }
6104    
6105     // Setup
6106     div = document.createElement( "div" );
6107     container = document.createElement( "div" );
6108     container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6109     body.appendChild( container ).appendChild( div );
6110    
6111     // Support: IE6
6112     // Check if elements with layout shrink-wrap their children
6113     if ( typeof div.style.zoom !== strundefined ) {
6114     // Reset CSS: box-sizing; display; margin; border
6115     div.style.cssText =
6116     // Support: Firefox<29, Android 2.3
6117     // Vendor-prefix box-sizing
6118     "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6119     "box-sizing:content-box;display:block;margin:0;border:0;" +
6120     "padding:1px;width:1px;zoom:1";
6121     div.appendChild( document.createElement( "div" ) ).style.width = "5px";
6122     shrinkWrapBlocksVal = div.offsetWidth !== 3;
6123     }
6124    
6125     body.removeChild( container );
6126    
6127     return shrinkWrapBlocksVal;
6128     };
6129    
6130     })();
6131     var rmargin = (/^margin/);
6132    
6133     var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6134    
6135    
6136    
6137     var getStyles, curCSS,
6138     rposition = /^(top|right|bottom|left)$/;
6139    
6140     if ( window.getComputedStyle ) {
6141     getStyles = function( elem ) {
6142     // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
6143     // IE throws on elements created in popups
6144     // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6145     if ( elem.ownerDocument.defaultView.opener ) {
6146     return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
6147     }
6148    
6149     return window.getComputedStyle( elem, null );
6150     };
6151    
6152     curCSS = function( elem, name, computed ) {
6153     var width, minWidth, maxWidth, ret,
6154     style = elem.style;
6155    
6156     computed = computed || getStyles( elem );
6157    
6158     // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6159     ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6160    
6161     if ( computed ) {
6162    
6163     if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6164     ret = jQuery.style( elem, name );
6165     }
6166    
6167     // A tribute to the "awesome hack by Dean Edwards"
6168     // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6169     // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6170     // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6171     if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6172    
6173     // Remember the original values
6174     width = style.width;
6175     minWidth = style.minWidth;
6176     maxWidth = style.maxWidth;
6177    
6178     // Put in the new values to get a computed value out
6179     style.minWidth = style.maxWidth = style.width = ret;
6180     ret = computed.width;
6181    
6182     // Revert the changed values
6183     style.width = width;
6184     style.minWidth = minWidth;
6185     style.maxWidth = maxWidth;
6186     }
6187     }
6188    
6189     // Support: IE
6190     // IE returns zIndex value as an integer.
6191     return ret === undefined ?
6192     ret :
6193     ret + "";
6194     };
6195     } else if ( document.documentElement.currentStyle ) {
6196     getStyles = function( elem ) {
6197     return elem.currentStyle;
6198     };
6199    
6200     curCSS = function( elem, name, computed ) {
6201     var left, rs, rsLeft, ret,
6202     style = elem.style;
6203    
6204     computed = computed || getStyles( elem );
6205     ret = computed ? computed[ name ] : undefined;
6206    
6207     // Avoid setting ret to empty string here
6208     // so we don't default to auto
6209     if ( ret == null && style && style[ name ] ) {
6210     ret = style[ name ];
6211     }
6212    
6213     // From the awesome hack by Dean Edwards
6214     // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6215    
6216     // If we're not dealing with a regular pixel number
6217     // but a number that has a weird ending, we need to convert it to pixels
6218     // but not position css attributes, as those are proportional to the parent element instead
6219     // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6220     if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6221    
6222     // Remember the original values
6223     left = style.left;
6224     rs = elem.runtimeStyle;
6225     rsLeft = rs && rs.left;
6226    
6227     // Put in the new values to get a computed value out
6228     if ( rsLeft ) {
6229     rs.left = elem.currentStyle.left;
6230     }
6231     style.left = name === "fontSize" ? "1em" : ret;
6232     ret = style.pixelLeft + "px";
6233    
6234     // Revert the changed values
6235     style.left = left;
6236     if ( rsLeft ) {
6237     rs.left = rsLeft;
6238     }
6239     }
6240    
6241     // Support: IE
6242     // IE returns zIndex value as an integer.
6243     return ret === undefined ?
6244     ret :
6245     ret + "" || "auto";
6246     };
6247     }
6248    
6249    
6250    
6251    
6252     function addGetHookIf( conditionFn, hookFn ) {
6253     // Define the hook, we'll check on the first run if it's really needed.
6254     return {
6255     get: function() {
6256     var condition = conditionFn();
6257    
6258     if ( condition == null ) {
6259     // The test was not ready at this point; screw the hook this time
6260     // but check again when needed next time.
6261     return;
6262     }
6263    
6264     if ( condition ) {
6265     // Hook not needed (or it's not possible to use it due to missing dependency),
6266     // remove it.
6267     // Since there are no other hooks for marginRight, remove the whole object.
6268     delete this.get;
6269     return;
6270     }
6271    
6272     // Hook needed; redefine it so that the support test is not executed again.
6273    
6274     return (this.get = hookFn).apply( this, arguments );
6275     }
6276     };
6277     }
6278    
6279    
6280     (function() {
6281     // Minified: var b,c,d,e,f,g, h,i
6282     var div, style, a, pixelPositionVal, boxSizingReliableVal,
6283     reliableHiddenOffsetsVal, reliableMarginRightVal;
6284    
6285     // Setup
6286     div = document.createElement( "div" );
6287     div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6288     a = div.getElementsByTagName( "a" )[ 0 ];
6289     style = a && a.style;
6290    
6291     // Finish early in limited (non-browser) environments
6292     if ( !style ) {
6293     return;
6294     }
6295    
6296     style.cssText = "float:left;opacity:.5";
6297    
6298     // Support: IE<9
6299     // Make sure that element opacity exists (as opposed to filter)
6300     support.opacity = style.opacity === "0.5";
6301    
6302     // Verify style float existence
6303     // (IE uses styleFloat instead of cssFloat)
6304     support.cssFloat = !!style.cssFloat;
6305    
6306     div.style.backgroundClip = "content-box";
6307     div.cloneNode( true ).style.backgroundClip = "";
6308     support.clearCloneStyle = div.style.backgroundClip === "content-box";
6309    
6310     // Support: Firefox<29, Android 2.3
6311     // Vendor-prefix box-sizing
6312     support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
6313     style.WebkitBoxSizing === "";
6314    
6315     jQuery.extend(support, {
6316     reliableHiddenOffsets: function() {
6317     if ( reliableHiddenOffsetsVal == null ) {
6318     computeStyleTests();
6319     }
6320     return reliableHiddenOffsetsVal;
6321     },
6322    
6323     boxSizingReliable: function() {
6324     if ( boxSizingReliableVal == null ) {
6325     computeStyleTests();
6326     }
6327     return boxSizingReliableVal;
6328     },
6329    
6330     pixelPosition: function() {
6331     if ( pixelPositionVal == null ) {
6332     computeStyleTests();
6333     }
6334     return pixelPositionVal;
6335     },
6336    
6337     // Support: Android 2.3
6338     reliableMarginRight: function() {
6339     if ( reliableMarginRightVal == null ) {
6340     computeStyleTests();
6341     }
6342     return reliableMarginRightVal;
6343     }
6344     });
6345    
6346     function computeStyleTests() {
6347     // Minified: var b,c,d,j
6348     var div, body, container, contents;
6349    
6350     body = document.getElementsByTagName( "body" )[ 0 ];
6351     if ( !body || !body.style ) {
6352     // Test fired too early or in an unsupported environment, exit.
6353     return;
6354     }
6355    
6356     // Setup
6357     div = document.createElement( "div" );
6358     container = document.createElement( "div" );
6359     container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6360     body.appendChild( container ).appendChild( div );
6361    
6362     div.style.cssText =
6363     // Support: Firefox<29, Android 2.3
6364     // Vendor-prefix box-sizing
6365     "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
6366     "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
6367     "border:1px;padding:1px;width:4px;position:absolute";
6368    
6369     // Support: IE<9
6370     // Assume reasonable values in the absence of getComputedStyle
6371     pixelPositionVal = boxSizingReliableVal = false;
6372     reliableMarginRightVal = true;
6373    
6374     // Check for getComputedStyle so that this code is not run in IE<9.
6375     if ( window.getComputedStyle ) {
6376     pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
6377     boxSizingReliableVal =
6378     ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
6379    
6380     // Support: Android 2.3
6381     // Div with explicit width and no margin-right incorrectly
6382     // gets computed margin-right based on width of container (#3333)
6383     // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6384     contents = div.appendChild( document.createElement( "div" ) );
6385    
6386     // Reset CSS: box-sizing; display; margin; border; padding
6387     contents.style.cssText = div.style.cssText =
6388     // Support: Firefox<29, Android 2.3
6389     // Vendor-prefix box-sizing
6390     "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6391     "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
6392     contents.style.marginRight = contents.style.width = "0";
6393     div.style.width = "1px";
6394    
6395     reliableMarginRightVal =
6396     !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
6397    
6398     div.removeChild( contents );
6399     }
6400    
6401     // Support: IE8
6402     // Check if table cells still have offsetWidth/Height when they are set
6403     // to display:none and there are still other visible table cells in a
6404     // table row; if so, offsetWidth/Height are not reliable for use when
6405     // determining if an element has been hidden directly using
6406     // display:none (it is still safe to use offsets if a parent element is
6407     // hidden; don safety goggles and see bug #4512 for more information).
6408     div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6409     contents = div.getElementsByTagName( "td" );
6410     contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
6411     reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6412     if ( reliableHiddenOffsetsVal ) {
6413     contents[ 0 ].style.display = "";
6414     contents[ 1 ].style.display = "none";
6415     reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6416     }
6417    
6418     body.removeChild( container );
6419     }
6420    
6421     })();
6422    
6423    
6424     // A method for quickly swapping in/out CSS properties to get correct calculations.
6425     jQuery.swap = function( elem, options, callback, args ) {
6426     var ret, name,
6427     old = {};
6428    
6429     // Remember the old values, and insert the new ones
6430     for ( name in options ) {
6431     old[ name ] = elem.style[ name ];
6432     elem.style[ name ] = options[ name ];
6433     }
6434    
6435     ret = callback.apply( elem, args || [] );
6436    
6437     // Revert the old values
6438     for ( name in options ) {
6439     elem.style[ name ] = old[ name ];
6440     }
6441    
6442     return ret;
6443     };
6444    
6445    
6446     var
6447     ralpha = /alpha\([^)]*\)/i,
6448     ropacity = /opacity\s*=\s*([^)]*)/,
6449    
6450     // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6451     // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6452     rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6453     rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6454     rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
6455    
6456     cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6457     cssNormalTransform = {
6458     letterSpacing: "0",
6459     fontWeight: "400"
6460     },
6461    
6462     cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6463    
6464    
6465     // return a css property mapped to a potentially vendor prefixed property
6466     function vendorPropName( style, name ) {
6467    
6468     // shortcut for names that are not vendor prefixed
6469     if ( name in style ) {
6470     return name;
6471     }
6472    
6473     // check for vendor prefixed names
6474     var capName = name.charAt(0).toUpperCase() + name.slice(1),
6475     origName = name,
6476     i = cssPrefixes.length;
6477    
6478     while ( i-- ) {
6479     name = cssPrefixes[ i ] + capName;
6480     if ( name in style ) {
6481     return name;
6482     }
6483     }
6484    
6485     return origName;
6486     }
6487    
6488     function showHide( elements, show ) {
6489     var display, elem, hidden,
6490     values = [],
6491     index = 0,
6492     length = elements.length;
6493    
6494     for ( ; index < length; index++ ) {
6495     elem = elements[ index ];
6496     if ( !elem.style ) {
6497     continue;
6498     }
6499    
6500     values[ index ] = jQuery._data( elem, "olddisplay" );
6501     display = elem.style.display;
6502     if ( show ) {
6503     // Reset the inline display of this element to learn if it is
6504     // being hidden by cascaded rules or not
6505     if ( !values[ index ] && display === "none" ) {
6506     elem.style.display = "";
6507     }
6508    
6509     // Set elements which have been overridden with display: none
6510     // in a stylesheet to whatever the default browser style is
6511     // for such an element
6512     if ( elem.style.display === "" && isHidden( elem ) ) {
6513     values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
6514     }
6515     } else {
6516     hidden = isHidden( elem );
6517    
6518     if ( display && display !== "none" || !hidden ) {
6519     jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6520     }
6521     }
6522     }
6523    
6524     // Set the display of most of the elements in a second loop
6525     // to avoid the constant reflow
6526     for ( index = 0; index < length; index++ ) {
6527     elem = elements[ index ];
6528     if ( !elem.style ) {
6529     continue;
6530     }
6531     if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6532     elem.style.display = show ? values[ index ] || "" : "none";
6533     }
6534     }
6535    
6536     return elements;
6537     }
6538    
6539     function setPositiveNumber( elem, value, subtract ) {
6540     var matches = rnumsplit.exec( value );
6541     return matches ?
6542     // Guard against undefined "subtract", e.g., when used as in cssHooks
6543     Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6544     value;
6545     }
6546    
6547     function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6548     var i = extra === ( isBorderBox ? "border" : "content" ) ?
6549     // If we already have the right measurement, avoid augmentation
6550     4 :
6551     // Otherwise initialize for horizontal or vertical properties
6552     name === "width" ? 1 : 0,
6553    
6554     val = 0;
6555    
6556     for ( ; i < 4; i += 2 ) {
6557     // both box models exclude margin, so add it if we want it
6558     if ( extra === "margin" ) {
6559     val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6560     }
6561    
6562     if ( isBorderBox ) {
6563     // border-box includes padding, so remove it if we want content
6564     if ( extra === "content" ) {
6565     val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6566     }
6567    
6568     // at this point, extra isn't border nor margin, so remove border
6569     if ( extra !== "margin" ) {
6570     val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6571     }
6572     } else {
6573     // at this point, extra isn't content, so add padding
6574     val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6575    
6576     // at this point, extra isn't content nor padding, so add border
6577     if ( extra !== "padding" ) {
6578     val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6579     }
6580     }
6581     }
6582    
6583     return val;
6584     }
6585    
6586     function getWidthOrHeight( elem, name, extra ) {
6587    
6588     // Start with offset property, which is equivalent to the border-box value
6589     var valueIsBorderBox = true,
6590     val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6591     styles = getStyles( elem ),
6592     isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6593    
6594     // some non-html elements return undefined for offsetWidth, so check for null/undefined
6595     // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6596     // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6597     if ( val <= 0 || val == null ) {
6598 schoenebeck 3275 // HACK for a Safari bug (see rdar #32565741)
6599 schoenebeck 3276 if (name === "width") {
6600     if (elem.firstChild.offsetWidth > 0) {
6601     return elem.firstChild.offsetWidth;
6602     }
6603     } else {
6604     if (elem.firstChild.offsetHeight > 0) {
6605     return elem.firstChild.offsetHeight;
6606     }
6607 schoenebeck 3275 }
6608    
6609 schoenebeck 2732 // Fall back to computed then uncomputed css if necessary
6610     val = curCSS( elem, name, styles );
6611     if ( val < 0 || val == null ) {
6612     val = elem.style[ name ];
6613     }
6614    
6615     // Computed unit is not pixels. Stop here and return.
6616     if ( rnumnonpx.test(val) ) {
6617     return val;
6618     }
6619    
6620     // we need the check for style in case a browser which returns unreliable values
6621     // for getComputedStyle silently falls back to the reliable elem.style
6622     valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
6623    
6624     // Normalize "", auto, and prepare for extra
6625     val = parseFloat( val ) || 0;
6626     }
6627    
6628     // use the active box-sizing model to add/subtract irrelevant styles
6629     return ( val +
6630     augmentWidthOrHeight(
6631     elem,
6632     name,
6633     extra || ( isBorderBox ? "border" : "content" ),
6634     valueIsBorderBox,
6635     styles
6636     )
6637     ) + "px";
6638     }
6639    
6640     jQuery.extend({
6641     // Add in style property hooks for overriding the default
6642     // behavior of getting and setting a style property
6643     cssHooks: {
6644     opacity: {
6645     get: function( elem, computed ) {
6646     if ( computed ) {
6647     // We should always get a number back from opacity
6648     var ret = curCSS( elem, "opacity" );
6649     return ret === "" ? "1" : ret;
6650     }
6651     }
6652     }
6653     },
6654    
6655     // Don't automatically add "px" to these possibly-unitless properties
6656     cssNumber: {
6657     "columnCount": true,
6658     "fillOpacity": true,
6659     "flexGrow": true,
6660     "flexShrink": true,
6661     "fontWeight": true,
6662     "lineHeight": true,
6663     "opacity": true,
6664     "order": true,
6665     "orphans": true,
6666     "widows": true,
6667     "zIndex": true,
6668     "zoom": true
6669     },
6670    
6671     // Add in properties whose names you wish to fix before
6672     // setting or getting the value
6673     cssProps: {
6674     // normalize float css property
6675     "float": support.cssFloat ? "cssFloat" : "styleFloat"
6676     },
6677    
6678     // Get and set the style property on a DOM Node
6679     style: function( elem, name, value, extra ) {
6680     // Don't set styles on text and comment nodes
6681     if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6682     return;
6683     }
6684    
6685     // Make sure that we're working with the right name
6686     var ret, type, hooks,
6687     origName = jQuery.camelCase( name ),
6688     style = elem.style;
6689    
6690     name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6691    
6692     // gets hook for the prefixed version
6693     // followed by the unprefixed version
6694     hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6695    
6696     // Check if we're setting a value
6697     if ( value !== undefined ) {
6698     type = typeof value;
6699    
6700     // convert relative number strings (+= or -=) to relative numbers. #7345
6701     if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6702     value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6703     // Fixes bug #9237
6704     type = "number";
6705     }
6706    
6707     // Make sure that null and NaN values aren't set. See: #7116
6708     if ( value == null || value !== value ) {
6709     return;
6710     }
6711    
6712     // If a number was passed in, add 'px' to the (except for certain CSS properties)
6713     if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6714     value += "px";
6715     }
6716    
6717     // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6718     // but it would mean to define eight (for every problematic property) identical functions
6719     if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6720     style[ name ] = "inherit";
6721     }
6722    
6723     // If a hook was provided, use that value, otherwise just set the specified value
6724     if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6725    
6726     // Support: IE
6727     // Swallow errors from 'invalid' CSS values (#5509)
6728     try {
6729     style[ name ] = value;
6730     } catch(e) {}
6731     }
6732    
6733     } else {
6734     // If a hook was provided get the non-computed value from there
6735     if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6736     return ret;
6737     }
6738    
6739     // Otherwise just get the value from the style object
6740     return style[ name ];
6741     }
6742     },
6743    
6744     css: function( elem, name, extra, styles ) {
6745     var num, val, hooks,
6746     origName = jQuery.camelCase( name );
6747    
6748     // Make sure that we're working with the right name
6749     name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6750    
6751     // gets hook for the prefixed version
6752     // followed by the unprefixed version
6753     hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6754    
6755     // If a hook was provided get the computed value from there
6756     if ( hooks && "get" in hooks ) {
6757     val = hooks.get( elem, true, extra );
6758     }
6759    
6760     // Otherwise, if a way to get the computed value exists, use that
6761     if ( val === undefined ) {
6762     val = curCSS( elem, name, styles );
6763     }
6764    
6765     //convert "normal" to computed value
6766     if ( val === "normal" && name in cssNormalTransform ) {
6767     val = cssNormalTransform[ name ];
6768     }
6769    
6770     // Return, converting to number if forced or a qualifier was provided and val looks numeric
6771     if ( extra === "" || extra ) {
6772     num = parseFloat( val );
6773     return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6774     }
6775     return val;
6776     }
6777     });
6778    
6779     jQuery.each([ "height", "width" ], function( i, name ) {
6780     jQuery.cssHooks[ name ] = {
6781     get: function( elem, computed, extra ) {
6782     if ( computed ) {
6783     // certain elements can have dimension info if we invisibly show them
6784     // however, it must have a current display style that would benefit from this
6785     return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
6786     jQuery.swap( elem, cssShow, function() {
6787     return getWidthOrHeight( elem, name, extra );
6788     }) :
6789     getWidthOrHeight( elem, name, extra );
6790     }
6791     },
6792    
6793     set: function( elem, value, extra ) {
6794     var styles = extra && getStyles( elem );
6795     return setPositiveNumber( elem, value, extra ?
6796     augmentWidthOrHeight(
6797     elem,
6798     name,
6799     extra,
6800     support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6801     styles
6802     ) : 0
6803     );
6804     }
6805     };
6806     });
6807    
6808     if ( !support.opacity ) {
6809     jQuery.cssHooks.opacity = {
6810     get: function( elem, computed ) {
6811     // IE uses filters for opacity
6812     return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6813     ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6814     computed ? "1" : "";
6815     },
6816    
6817     set: function( elem, value ) {
6818     var style = elem.style,
6819     currentStyle = elem.currentStyle,
6820     opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6821     filter = currentStyle && currentStyle.filter || style.filter || "";
6822    
6823     // IE has trouble with opacity if it does not have layout
6824     // Force it by setting the zoom level
6825     style.zoom = 1;
6826    
6827     // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6828     // if value === "", then remove inline opacity #12685
6829     if ( ( value >= 1 || value === "" ) &&
6830     jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6831     style.removeAttribute ) {
6832    
6833     // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6834     // if "filter:" is present at all, clearType is disabled, we want to avoid this
6835     // style.removeAttribute is IE Only, but so apparently is this code path...
6836     style.removeAttribute( "filter" );
6837    
6838     // if there is no filter style applied in a css rule or unset inline opacity, we are done
6839     if ( value === "" || currentStyle && !currentStyle.filter ) {
6840     return;
6841     }
6842     }
6843    
6844     // otherwise, set new filter values
6845     style.filter = ralpha.test( filter ) ?
6846     filter.replace( ralpha, opacity ) :
6847     filter + " " + opacity;
6848     }
6849     };
6850     }
6851    
6852     jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6853     function( elem, computed ) {
6854     if ( computed ) {
6855     // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6856     // Work around by temporarily setting element display to inline-block
6857     return jQuery.swap( elem, { "display": "inline-block" },
6858     curCSS, [ elem, "marginRight" ] );
6859     }
6860     }
6861     );
6862    
6863     // These hooks are used by animate to expand properties
6864     jQuery.each({
6865     margin: "",
6866     padding: "",
6867     border: "Width"
6868     }, function( prefix, suffix ) {
6869     jQuery.cssHooks[ prefix + suffix ] = {
6870     expand: function( value ) {
6871     var i = 0,
6872     expanded = {},
6873    
6874     // assumes a single number if not a string
6875     parts = typeof value === "string" ? value.split(" ") : [ value ];
6876    
6877     for ( ; i < 4; i++ ) {
6878     expanded[ prefix + cssExpand[ i ] + suffix ] =
6879     parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6880     }
6881    
6882     return expanded;
6883     }
6884     };
6885    
6886     if ( !rmargin.test( prefix ) ) {
6887     jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6888     }
6889     });
6890    
6891     jQuery.fn.extend({
6892     css: function( name, value ) {
6893     return access( this, function( elem, name, value ) {
6894     var styles, len,
6895     map = {},
6896     i = 0;
6897    
6898     if ( jQuery.isArray( name ) ) {
6899     styles = getStyles( elem );
6900     len = name.length;
6901    
6902     for ( ; i < len; i++ ) {
6903     map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6904     }
6905    
6906     return map;
6907     }
6908    
6909     return value !== undefined ?
6910     jQuery.style( elem, name, value ) :
6911     jQuery.css( elem, name );
6912     }, name, value, arguments.length > 1 );
6913     },
6914     show: function() {
6915     return showHide( this, true );
6916     },
6917     hide: function() {
6918     return showHide( this );
6919     },
6920     toggle: function( state ) {
6921     if ( typeof state === "boolean" ) {
6922     return state ? this.show() : this.hide();
6923     }
6924    
6925     return this.each(function() {
6926     if ( isHidden( this ) ) {
6927     jQuery( this ).show();
6928     } else {
6929     jQuery( this ).hide();
6930     }
6931     });
6932     }
6933     });
6934    
6935    
6936     function Tween( elem, options, prop, end, easing ) {
6937     return new Tween.prototype.init( elem, options, prop, end, easing );
6938     }
6939     jQuery.Tween = Tween;
6940    
6941     Tween.prototype = {
6942     constructor: Tween,
6943     init: function( elem, options, prop, end, easing, unit ) {
6944     this.elem = elem;
6945     this.prop = prop;
6946     this.easing = easing || "swing";
6947     this.options = options;
6948     this.start = this.now = this.cur();
6949     this.end = end;
6950     this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6951     },
6952     cur: function() {
6953     var hooks = Tween.propHooks[ this.prop ];
6954    
6955     return hooks && hooks.get ?
6956     hooks.get( this ) :
6957     Tween.propHooks._default.get( this );
6958     },
6959     run: function( percent ) {
6960     var eased,
6961     hooks = Tween.propHooks[ this.prop ];
6962    
6963     if ( this.options.duration ) {
6964     this.pos = eased = jQuery.easing[ this.easing ](
6965     percent, this.options.duration * percent, 0, 1, this.options.duration
6966     );
6967     } else {
6968     this.pos = eased = percent;
6969     }
6970     this.now = ( this.end - this.start ) * eased + this.start;
6971    
6972     if ( this.options.step ) {
6973     this.options.step.call( this.elem, this.now, this );
6974     }
6975    
6976     if ( hooks && hooks.set ) {
6977     hooks.set( this );
6978     } else {
6979     Tween.propHooks._default.set( this );
6980     }
6981     return this;
6982     }
6983     };
6984    
6985     Tween.prototype.init.prototype = Tween.prototype;
6986    
6987     Tween.propHooks = {
6988     _default: {
6989     get: function( tween ) {
6990     var result;
6991    
6992     if ( tween.elem[ tween.prop ] != null &&
6993     (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6994     return tween.elem[ tween.prop ];
6995     }
6996    
6997     // passing an empty string as a 3rd parameter to .css will automatically
6998     // attempt a parseFloat and fallback to a string if the parse fails
6999     // so, simple values such as "10px" are parsed to Float.
7000     // complex values such as "rotate(1rad)" are returned as is.
7001     result = jQuery.css( tween.elem, tween.prop, "" );
7002     // Empty strings, null, undefined and "auto" are converted to 0.
7003     return !result || result === "auto" ? 0 : result;
7004     },
7005     set: function( tween ) {
7006     // use step hook for back compat - use cssHook if its there - use .style if its
7007     // available and use plain properties where available
7008     if ( jQuery.fx.step[ tween.prop ] ) {
7009     jQuery.fx.step[ tween.prop ]( tween );
7010     } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
7011     jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7012     } else {
7013     tween.elem[ tween.prop ] = tween.now;
7014     }
7015     }
7016     }
7017     };
7018    
7019     // Support: IE <=9
7020     // Panic based approach to setting things on disconnected nodes
7021    
7022     Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7023     set: function( tween ) {
7024     if ( tween.elem.nodeType && tween.elem.parentNode ) {
7025     tween.elem[ tween.prop ] = tween.now;
7026     }
7027     }
7028     };
7029    
7030     jQuery.easing = {
7031     linear: function( p ) {
7032     return p;
7033     },
7034     swing: function( p ) {
7035     return 0.5 - Math.cos( p * Math.PI ) / 2;
7036     }
7037     };
7038    
7039     jQuery.fx = Tween.prototype.init;
7040    
7041     // Back Compat <1.8 extension point
7042     jQuery.fx.step = {};
7043    
7044    
7045    
7046    
7047     var
7048     fxNow, timerId,
7049     rfxtypes = /^(?:toggle|show|hide)$/,
7050     rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
7051     rrun = /queueHooks$/,
7052     animationPrefilters = [ defaultPrefilter ],
7053     tweeners = {
7054     "*": [ function( prop, value ) {
7055     var tween = this.createTween( prop, value ),
7056     target = tween.cur(),
7057     parts = rfxnum.exec( value ),
7058     unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
7059    
7060     // Starting value computation is required for potential unit mismatches
7061     start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
7062     rfxnum.exec( jQuery.css( tween.elem, prop ) ),
7063     scale = 1,
7064     maxIterations = 20;
7065    
7066     if ( start && start[ 3 ] !== unit ) {
7067     // Trust units reported by jQuery.css
7068     unit = unit || start[ 3 ];
7069    
7070     // Make sure we update the tween properties later on
7071     parts = parts || [];
7072    
7073     // Iteratively approximate from a nonzero starting point
7074     start = +target || 1;
7075    
7076     do {
7077     // If previous iteration zeroed out, double until we get *something*
7078     // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7079     scale = scale || ".5";
7080    
7081     // Adjust and apply
7082     start = start / scale;
7083     jQuery.style( tween.elem, prop, start + unit );
7084    
7085     // Update scale, tolerating zero or NaN from tween.cur()
7086     // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7087     } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7088     }
7089    
7090     // Update tween properties
7091     if ( parts ) {
7092     start = tween.start = +start || +target || 0;
7093     tween.unit = unit;
7094     // If a +=/-= token was provided, we're doing a relative animation
7095     tween.end = parts[ 1 ] ?
7096     start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
7097     +parts[ 2 ];
7098     }
7099    
7100     return tween;
7101     } ]
7102     };
7103    
7104     // Animations created synchronously will run synchronously
7105     function createFxNow() {
7106     setTimeout(function() {
7107     fxNow = undefined;
7108     });
7109     return ( fxNow = jQuery.now() );
7110     }
7111    
7112     // Generate parameters to create a standard animation
7113     function genFx( type, includeWidth ) {
7114     var which,
7115     attrs = { height: type },
7116     i = 0;
7117    
7118     // if we include width, step value is 1 to do all cssExpand values,
7119     // if we don't include width, step value is 2 to skip over Left and Right
7120     includeWidth = includeWidth ? 1 : 0;
7121     for ( ; i < 4 ; i += 2 - includeWidth ) {
7122     which = cssExpand[ i ];
7123     attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7124     }
7125    
7126     if ( includeWidth ) {
7127     attrs.opacity = attrs.width = type;
7128     }
7129    
7130     return attrs;
7131     }
7132    
7133     function createTween( value, prop, animation ) {
7134     var tween,
7135     collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7136     index = 0,
7137     length = collection.length;
7138     for ( ; index < length; index++ ) {
7139     if ( (tween = collection[ index ].call( animation, prop, value )) ) {
7140    
7141     // we're done with this property
7142     return tween;
7143     }
7144     }
7145     }
7146    
7147     function defaultPrefilter( elem, props, opts ) {
7148     /* jshint validthis: true */
7149     var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7150     anim = this,
7151     orig = {},
7152     style = elem.style,
7153     hidden = elem.nodeType && isHidden( elem ),
7154     dataShow = jQuery._data( elem, "fxshow" );
7155    
7156     // handle queue: false promises
7157     if ( !opts.queue ) {
7158     hooks = jQuery._queueHooks( elem, "fx" );
7159     if ( hooks.unqueued == null ) {
7160     hooks.unqueued = 0;
7161     oldfire = hooks.empty.fire;
7162     hooks.empty.fire = function() {
7163     if ( !hooks.unqueued ) {
7164     oldfire();
7165     }
7166     };
7167     }
7168     hooks.unqueued++;
7169    
7170     anim.always(function() {
7171     // doing this makes sure that the complete handler will be called
7172     // before this completes
7173     anim.always(function() {
7174     hooks.unqueued--;
7175     if ( !jQuery.queue( elem, "fx" ).length ) {
7176     hooks.empty.fire();
7177     }
7178     });
7179     });
7180     }
7181    
7182     // height/width overflow pass
7183     if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7184     // Make sure that nothing sneaks out
7185     // Record all 3 overflow attributes because IE does not
7186     // change the overflow attribute when overflowX and
7187     // overflowY are set to the same value
7188     opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7189    
7190     // Set display property to inline-block for height/width
7191     // animations on inline elements that are having width/height animated
7192     display = jQuery.css( elem, "display" );
7193    
7194     // Test default display if display is currently "none"
7195     checkDisplay = display === "none" ?
7196     jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7197    
7198     if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7199    
7200     // inline-level elements accept inline-block;
7201     // block-level elements need to be inline with layout
7202     if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7203     style.display = "inline-block";
7204     } else {
7205     style.zoom = 1;
7206     }
7207     }
7208     }
7209    
7210     if ( opts.overflow ) {
7211     style.overflow = "hidden";
7212     if ( !support.shrinkWrapBlocks() ) {
7213     anim.always(function() {
7214     style.overflow = opts.overflow[ 0 ];
7215     style.overflowX = opts.overflow[ 1 ];
7216     style.overflowY = opts.overflow[ 2 ];
7217     });
7218     }
7219     }
7220    
7221     // show/hide pass
7222     for ( prop in props ) {
7223     value = props[ prop ];
7224     if ( rfxtypes.exec( value ) ) {
7225     delete props[ prop ];
7226     toggle = toggle || value === "toggle";
7227     if ( value === ( hidden ? "hide" : "show" ) ) {
7228    
7229     // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
7230     if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7231     hidden = true;
7232     } else {
7233     continue;
7234     }
7235     }
7236     orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7237    
7238     // Any non-fx value stops us from restoring the original display value
7239     } else {
7240     display = undefined;
7241     }
7242     }
7243    
7244     if ( !jQuery.isEmptyObject( orig ) ) {
7245     if ( dataShow ) {
7246     if ( "hidden" in dataShow ) {
7247     hidden = dataShow.hidden;
7248     }
7249     } else {
7250     dataShow = jQuery._data( elem, "fxshow", {} );
7251     }
7252    
7253     // store state if its toggle - enables .stop().toggle() to "reverse"
7254     if ( toggle ) {
7255     dataShow.hidden = !hidden;
7256     }
7257     if ( hidden ) {
7258     jQuery( elem ).show();
7259     } else {
7260     anim.done(function() {
7261     jQuery( elem ).hide();
7262     });
7263     }
7264     anim.done(function() {
7265     var prop;
7266     jQuery._removeData( elem, "fxshow" );
7267     for ( prop in orig ) {
7268     jQuery.style( elem, prop, orig[ prop ] );
7269     }
7270     });
7271     for ( prop in orig ) {
7272     tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7273    
7274     if ( !( prop in dataShow ) ) {
7275     dataShow[ prop ] = tween.start;
7276     if ( hidden ) {
7277     tween.end = tween.start;
7278     tween.start = prop === "width" || prop === "height" ? 1 : 0;
7279     }
7280     }
7281     }
7282    
7283     // If this is a noop like .hide().hide(), restore an overwritten display value
7284     } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
7285     style.display = display;
7286     }
7287     }
7288    
7289     function propFilter( props, specialEasing ) {
7290     var index, name, easing, value, hooks;
7291    
7292     // camelCase, specialEasing and expand cssHook pass
7293     for ( index in props ) {
7294     name = jQuery.camelCase( index );
7295     easing = specialEasing[ name ];
7296     value = props[ index ];
7297     if ( jQuery.isArray( value ) ) {
7298     easing = value[ 1 ];
7299     value = props[ index ] = value[ 0 ];
7300     }
7301    
7302     if ( index !== name ) {
7303     props[ name ] = value;
7304     delete props[ index ];
7305     }
7306    
7307     hooks = jQuery.cssHooks[ name ];
7308     if ( hooks && "expand" in hooks ) {
7309     value = hooks.expand( value );
7310     delete props[ name ];
7311    
7312     // not quite $.extend, this wont overwrite keys already present.
7313     // also - reusing 'index' from above because we have the correct "name"
7314     for ( index in value ) {
7315     if ( !( index in props ) ) {
7316     props[ index ] = value[ index ];
7317     specialEasing[ index ] = easing;
7318     }
7319     }
7320     } else {
7321     specialEasing[ name ] = easing;
7322     }
7323     }
7324     }
7325    
7326     function Animation( elem, properties, options ) {
7327     var result,
7328     stopped,
7329     index = 0,
7330     length = animationPrefilters.length,
7331     deferred = jQuery.Deferred().always( function() {
7332     // don't match elem in the :animated selector
7333     delete tick.elem;
7334     }),
7335     tick = function() {
7336     if ( stopped ) {
7337     return false;
7338     }
7339     var currentTime = fxNow || createFxNow(),
7340     remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7341     // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7342     temp = remaining / animation.duration || 0,
7343     percent = 1 - temp,
7344     index = 0,
7345     length = animation.tweens.length;
7346    
7347     for ( ; index < length ; index++ ) {
7348     animation.tweens[ index ].run( percent );
7349     }
7350    
7351     deferred.notifyWith( elem, [ animation, percent, remaining ]);
7352    
7353     if ( percent < 1 && length ) {
7354     return remaining;
7355     } else {
7356     deferred.resolveWith( elem, [ animation ] );
7357     return false;
7358     }
7359     },
7360     animation = deferred.promise({
7361     elem: elem,
7362     props: jQuery.extend( {}, properties ),
7363     opts: jQuery.extend( true, { specialEasing: {} }, options ),
7364     originalProperties: properties,
7365     originalOptions: options,
7366     startTime: fxNow || createFxNow(),
7367     duration: options.duration,
7368     tweens: [],
7369     createTween: function( prop, end ) {
7370     var tween = jQuery.Tween( elem, animation.opts, prop, end,
7371     animation.opts.specialEasing[ prop ] || animation.opts.easing );
7372     animation.tweens.push( tween );
7373     return tween;
7374     },
7375     stop: function( gotoEnd ) {
7376     var index = 0,
7377     // if we are going to the end, we want to run all the tweens
7378     // otherwise we skip this part
7379     length = gotoEnd ? animation.tweens.length : 0;
7380     if ( stopped ) {
7381     return this;
7382     }
7383     stopped = true;
7384     for ( ; index < length ; index++ ) {
7385     animation.tweens[ index ].run( 1 );
7386     }
7387    
7388     // resolve when we played the last frame
7389     // otherwise, reject
7390     if ( gotoEnd ) {
7391     deferred.resolveWith( elem, [ animation, gotoEnd ] );
7392     } else {
7393     deferred.rejectWith( elem, [ animation, gotoEnd ] );
7394     }
7395     return this;
7396     }
7397     }),
7398     props = animation.props;
7399    
7400     propFilter( props, animation.opts.specialEasing );
7401    
7402     for ( ; index < length ; index++ ) {
7403     result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7404     if ( result ) {
7405     return result;
7406     }
7407     }
7408    
7409     jQuery.map( props, createTween, animation );
7410    
7411     if ( jQuery.isFunction( animation.opts.start ) ) {
7412     animation.opts.start.call( elem, animation );
7413     }
7414    
7415     jQuery.fx.timer(
7416     jQuery.extend( tick, {
7417     elem: elem,
7418     anim: animation,
7419     queue: animation.opts.queue
7420     })
7421     );
7422    
7423     // attach callbacks from options
7424     return animation.progress( animation.opts.progress )
7425     .done( animation.opts.done, animation.opts.complete )
7426     .fail( animation.opts.fail )
7427     .always( animation.opts.always );
7428     }
7429    
7430     jQuery.Animation = jQuery.extend( Animation, {
7431     tweener: function( props, callback ) {
7432     if ( jQuery.isFunction( props ) ) {
7433     callback = props;
7434     props = [ "*" ];
7435     } else {
7436     props = props.split(" ");
7437     }
7438    
7439     var prop,
7440     index = 0,
7441     length = props.length;
7442    
7443     for ( ; index < length ; index++ ) {
7444     prop = props[ index ];
7445     tweeners[ prop ] = tweeners[ prop ] || [];
7446     tweeners[ prop ].unshift( callback );
7447     }
7448     },
7449    
7450     prefilter: function( callback, prepend ) {
7451     if ( prepend ) {
7452     animationPrefilters.unshift( callback );
7453     } else {
7454     animationPrefilters.push( callback );
7455     }
7456     }
7457     });
7458    
7459     jQuery.speed = function( speed, easing, fn ) {
7460     var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7461     complete: fn || !fn && easing ||
7462     jQuery.isFunction( speed ) && speed,
7463     duration: speed,
7464     easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7465     };
7466    
7467     opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7468     opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7469    
7470     // normalize opt.queue - true/undefined/null -> "fx"
7471     if ( opt.queue == null || opt.queue === true ) {
7472     opt.queue = "fx";
7473     }
7474    
7475     // Queueing
7476     opt.old = opt.complete;
7477    
7478     opt.complete = function() {
7479     if ( jQuery.isFunction( opt.old ) ) {
7480     opt.old.call( this );
7481     }
7482    
7483     if ( opt.queue ) {
7484     jQuery.dequeue( this, opt.queue );
7485     }
7486     };
7487    
7488     return opt;
7489     };
7490    
7491     jQuery.fn.extend({
7492     fadeTo: function( speed, to, easing, callback ) {
7493    
7494     // show any hidden elements after setting opacity to 0
7495     return this.filter( isHidden ).css( "opacity", 0 ).show()
7496    
7497     // animate to the value specified
7498     .end().animate({ opacity: to }, speed, easing, callback );
7499     },
7500     animate: function( prop, speed, easing, callback ) {
7501     var empty = jQuery.isEmptyObject( prop ),
7502     optall = jQuery.speed( speed, easing, callback ),
7503     doAnimation = function() {
7504     // Operate on a copy of prop so per-property easing won't be lost
7505     var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7506    
7507     // Empty animations, or finishing resolves immediately
7508     if ( empty || jQuery._data( this, "finish" ) ) {
7509     anim.stop( true );
7510     }
7511     };
7512     doAnimation.finish = doAnimation;
7513    
7514     return empty || optall.queue === false ?
7515     this.each( doAnimation ) :
7516     this.queue( optall.queue, doAnimation );
7517     },
7518     stop: function( type, clearQueue, gotoEnd ) {
7519     var stopQueue = function( hooks ) {
7520     var stop = hooks.stop;
7521     delete hooks.stop;
7522     stop( gotoEnd );
7523     };
7524    
7525     if ( typeof type !== "string" ) {
7526     gotoEnd = clearQueue;
7527     clearQueue = type;
7528     type = undefined;
7529     }
7530     if ( clearQueue && type !== false ) {
7531     this.queue( type || "fx", [] );
7532     }
7533    
7534     return this.each(function() {
7535     var dequeue = true,
7536     index = type != null && type + "queueHooks",
7537     timers = jQuery.timers,
7538     data = jQuery._data( this );
7539    
7540     if ( index ) {
7541     if ( data[ index ] && data[ index ].stop ) {
7542     stopQueue( data[ index ] );
7543     }
7544     } else {
7545     for ( index in data ) {
7546     if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7547     stopQueue( data[ index ] );
7548     }
7549     }
7550     }
7551    
7552     for ( index = timers.length; index--; ) {
7553     if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7554     timers[ index ].anim.stop( gotoEnd );
7555     dequeue = false;
7556     timers.splice( index, 1 );
7557     }
7558     }
7559    
7560     // start the next in the queue if the last step wasn't forced
7561     // timers currently will call their complete callbacks, which will dequeue
7562     // but only if they were gotoEnd
7563     if ( dequeue || !gotoEnd ) {
7564     jQuery.dequeue( this, type );
7565     }
7566     });
7567     },
7568     finish: function( type ) {
7569     if ( type !== false ) {
7570     type = type || "fx";
7571     }
7572     return this.each(function() {
7573     var index,
7574     data = jQuery._data( this ),
7575     queue = data[ type + "queue" ],
7576     hooks = data[ type + "queueHooks" ],
7577     timers = jQuery.timers,
7578     length = queue ? queue.length : 0;
7579    
7580     // enable finishing flag on private data
7581     data.finish = true;
7582    
7583     // empty the queue first
7584     jQuery.queue( this, type, [] );
7585    
7586     if ( hooks && hooks.stop ) {
7587     hooks.stop.call( this, true );
7588     }
7589    
7590     // look for any active animations, and finish them
7591     for ( index = timers.length; index--; ) {
7592     if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7593     timers[ index ].anim.stop( true );
7594     timers.splice( index, 1 );
7595     }
7596     }
7597    
7598     // look for any animations in the old queue and finish them
7599     for ( index = 0; index < length; index++ ) {
7600     if ( queue[ index ] && queue[ index ].finish ) {
7601     queue[ index ].finish.call( this );
7602     }
7603     }
7604    
7605     // turn off finishing flag
7606     delete data.finish;
7607     });
7608     }
7609     });
7610    
7611     jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7612     var cssFn = jQuery.fn[ name ];
7613     jQuery.fn[ name ] = function( speed, easing, callback ) {
7614     return speed == null || typeof speed === "boolean" ?
7615     cssFn.apply( this, arguments ) :
7616     this.animate( genFx( name, true ), speed, easing, callback );
7617     };
7618     });
7619    
7620     // Generate shortcuts for custom animations
7621     jQuery.each({
7622     slideDown: genFx("show"),
7623     slideUp: genFx("hide"),
7624     slideToggle: genFx("toggle"),
7625     fadeIn: { opacity: "show" },
7626     fadeOut: { opacity: "hide" },
7627     fadeToggle: { opacity: "toggle" }
7628     }, function( name, props ) {
7629     jQuery.fn[ name ] = function( speed, easing, callback ) {
7630     return this.animate( props, speed, easing, callback );
7631     };
7632     });
7633    
7634     jQuery.timers = [];
7635     jQuery.fx.tick = function() {
7636     var timer,
7637     timers = jQuery.timers,
7638     i = 0;
7639    
7640     fxNow = jQuery.now();
7641    
7642     for ( ; i < timers.length; i++ ) {
7643     timer = timers[ i ];
7644     // Checks the timer has not already been removed
7645     if ( !timer() && timers[ i ] === timer ) {
7646     timers.splice( i--, 1 );
7647     }
7648     }
7649    
7650     if ( !timers.length ) {
7651     jQuery.fx.stop();
7652     }
7653     fxNow = undefined;
7654     };
7655    
7656     jQuery.fx.timer = function( timer ) {
7657     jQuery.timers.push( timer );
7658     if ( timer() ) {
7659     jQuery.fx.start();
7660     } else {
7661     jQuery.timers.pop();
7662     }
7663     };
7664    
7665     jQuery.fx.interval = 13;
7666    
7667     jQuery.fx.start = function() {
7668     if ( !timerId ) {
7669     timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7670     }
7671     };
7672    
7673     jQuery.fx.stop = function() {
7674     clearInterval( timerId );
7675     timerId = null;
7676     };
7677    
7678     jQuery.fx.speeds = {
7679     slow: 600,
7680     fast: 200,
7681     // Default speed
7682     _default: 400
7683     };
7684    
7685    
7686     // Based off of the plugin by Clint Helfers, with permission.
7687     // http://blindsignals.com/index.php/2009/07/jquery-delay/
7688     jQuery.fn.delay = function( time, type ) {
7689     time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7690     type = type || "fx";
7691    
7692     return this.queue( type, function( next, hooks ) {
7693     var timeout = setTimeout( next, time );
7694     hooks.stop = function() {
7695     clearTimeout( timeout );
7696     };
7697     });
7698     };
7699    
7700    
7701     (function() {
7702     // Minified: var a,b,c,d,e
7703     var input, div, select, a, opt;
7704    
7705     // Setup
7706     div = document.createElement( "div" );
7707     div.setAttribute( "className", "t" );
7708     div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
7709     a = div.getElementsByTagName("a")[ 0 ];
7710    
7711     // First batch of tests.
7712     select = document.createElement("select");
7713     opt = select.appendChild( document.createElement("option") );
7714     input = div.getElementsByTagName("input")[ 0 ];
7715    
7716     a.style.cssText = "top:1px";
7717    
7718     // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
7719     support.getSetAttribute = div.className !== "t";
7720    
7721     // Get the style information from getAttribute
7722     // (IE uses .cssText instead)
7723     support.style = /top/.test( a.getAttribute("style") );
7724    
7725     // Make sure that URLs aren't manipulated
7726     // (IE normalizes it by default)
7727     support.hrefNormalized = a.getAttribute("href") === "/a";
7728    
7729     // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
7730     support.checkOn = !!input.value;
7731    
7732     // Make sure that a selected-by-default option has a working selected property.
7733     // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
7734     support.optSelected = opt.selected;
7735    
7736     // Tests for enctype support on a form (#6743)
7737     support.enctype = !!document.createElement("form").enctype;
7738    
7739     // Make sure that the options inside disabled selects aren't marked as disabled
7740     // (WebKit marks them as disabled)
7741     select.disabled = true;
7742     support.optDisabled = !opt.disabled;
7743    
7744     // Support: IE8 only
7745     // Check if we can trust getAttribute("value")
7746     input = document.createElement( "input" );
7747     input.setAttribute( "value", "" );
7748     support.input = input.getAttribute( "value" ) === "";
7749    
7750     // Check if an input maintains its value after becoming a radio
7751     input.value = "t";
7752     input.setAttribute( "type", "radio" );
7753     support.radioValue = input.value === "t";
7754     })();
7755    
7756    
7757     var rreturn = /\r/g;
7758    
7759     jQuery.fn.extend({
7760     val: function( value ) {
7761     var hooks, ret, isFunction,
7762     elem = this[0];
7763    
7764     if ( !arguments.length ) {
7765     if ( elem ) {
7766     hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7767    
7768     if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7769     return ret;
7770     }
7771    
7772     ret = elem.value;
7773    
7774     return typeof ret === "string" ?
7775     // handle most common string cases
7776     ret.replace(rreturn, "") :
7777     // handle cases where value is null/undef or number
7778     ret == null ? "" : ret;
7779     }
7780    
7781     return;
7782     }
7783    
7784     isFunction = jQuery.isFunction( value );
7785    
7786     return this.each(function( i ) {
7787     var val;
7788    
7789     if ( this.nodeType !== 1 ) {
7790     return;
7791     }
7792    
7793     if ( isFunction ) {
7794     val = value.call( this, i, jQuery( this ).val() );
7795     } else {
7796     val = value;
7797     }
7798    
7799     // Treat null/undefined as ""; convert numbers to string
7800     if ( val == null ) {
7801     val = "";
7802     } else if ( typeof val === "number" ) {
7803     val += "";
7804     } else if ( jQuery.isArray( val ) ) {
7805     val = jQuery.map( val, function( value ) {
7806     return value == null ? "" : value + "";
7807     });
7808     }
7809    
7810     hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7811    
7812     // If set returns undefined, fall back to normal setting
7813     if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7814     this.value = val;
7815     }
7816     });
7817     }
7818     });
7819    
7820     jQuery.extend({
7821     valHooks: {
7822     option: {
7823     get: function( elem ) {
7824     var val = jQuery.find.attr( elem, "value" );
7825     return val != null ?
7826     val :
7827     // Support: IE10-11+
7828     // option.text throws exceptions (#14686, #14858)
7829     jQuery.trim( jQuery.text( elem ) );
7830     }
7831     },
7832     select: {
7833     get: function( elem ) {
7834     var value, option,
7835     options = elem.options,
7836     index = elem.selectedIndex,
7837     one = elem.type === "select-one" || index < 0,
7838     values = one ? null : [],
7839     max = one ? index + 1 : options.length,
7840     i = index < 0 ?
7841     max :
7842     one ? index : 0;
7843    
7844     // Loop through all the selected options
7845     for ( ; i < max; i++ ) {
7846     option = options[ i ];
7847    
7848     // oldIE doesn't update selected after form reset (#2551)
7849     if ( ( option.selected || i === index ) &&
7850     // Don't return options that are disabled or in a disabled optgroup
7851     ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
7852     ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7853    
7854     // Get the specific value for the option
7855     value = jQuery( option ).val();
7856    
7857     // We don't need an array for one selects
7858     if ( one ) {
7859     return value;
7860     }
7861    
7862     // Multi-Selects return an array
7863     values.push( value );
7864     }
7865     }
7866    
7867     return values;
7868     },
7869    
7870     set: function( elem, value ) {
7871     var optionSet, option,
7872     options = elem.options,
7873     values = jQuery.makeArray( value ),
7874     i = options.length;
7875    
7876     while ( i-- ) {
7877     option = options[ i ];
7878    
7879     if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
7880    
7881     // Support: IE6
7882     // When new option element is added to select box we need to
7883     // force reflow of newly added node in order to workaround delay
7884     // of initialization properties
7885     try {
7886     option.selected = optionSet = true;
7887    
7888     } catch ( _ ) {
7889    
7890     // Will be executed only in IE6
7891     option.scrollHeight;
7892     }
7893    
7894     } else {
7895     option.selected = false;
7896     }
7897     }
7898    
7899     // Force browsers to behave consistently when non-matching value is set
7900     if ( !optionSet ) {
7901     elem.selectedIndex = -1;
7902     }
7903    
7904     return options;
7905     }
7906     }
7907     }
7908     });
7909    
7910     // Radios and checkboxes getter/setter
7911     jQuery.each([ "radio", "checkbox" ], function() {
7912     jQuery.valHooks[ this ] = {
7913     set: function( elem, value ) {
7914     if ( jQuery.isArray( value ) ) {
7915     return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7916     }
7917     }
7918     };
7919     if ( !support.checkOn ) {
7920     jQuery.valHooks[ this ].get = function( elem ) {
7921     // Support: Webkit
7922     // "" is returned instead of "on" if a value isn't specified
7923     return elem.getAttribute("value") === null ? "on" : elem.value;
7924     };
7925     }
7926     });
7927    
7928    
7929    
7930    
7931     var nodeHook, boolHook,
7932     attrHandle = jQuery.expr.attrHandle,
7933     ruseDefault = /^(?:checked|selected)$/i,
7934     getSetAttribute = support.getSetAttribute,
7935     getSetInput = support.input;
7936    
7937     jQuery.fn.extend({
7938     attr: function( name, value ) {
7939     return access( this, jQuery.attr, name, value, arguments.length > 1 );
7940     },
7941    
7942     removeAttr: function( name ) {
7943     return this.each(function() {
7944     jQuery.removeAttr( this, name );
7945     });
7946     }
7947     });
7948    
7949     jQuery.extend({
7950     attr: function( elem, name, value ) {
7951     var hooks, ret,
7952     nType = elem.nodeType;
7953    
7954     // don't get/set attributes on text, comment and attribute nodes
7955     if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
7956     return;
7957     }
7958    
7959     // Fallback to prop when attributes are not supported
7960     if ( typeof elem.getAttribute === strundefined ) {
7961     return jQuery.prop( elem, name, value );
7962     }
7963    
7964     // All attributes are lowercase
7965     // Grab necessary hook if one is defined
7966     if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7967     name = name.toLowerCase();
7968     hooks = jQuery.attrHooks[ name ] ||
7969     ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
7970     }
7971    
7972     if ( value !== undefined ) {
7973    
7974     if ( value === null ) {
7975     jQuery.removeAttr( elem, name );
7976    
7977     } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
7978     return ret;
7979    
7980     } else {
7981     elem.setAttribute( name, value + "" );
7982     return value;
7983     }
7984    
7985     } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
7986     return ret;
7987    
7988     } else {
7989     ret = jQuery.find.attr( elem, name );
7990    
7991     // Non-existent attributes return null, we normalize to undefined
7992     return ret == null ?
7993     undefined :
7994     ret;
7995     }
7996     },
7997    
7998     removeAttr: function( elem, value ) {
7999     var name, propName,
8000     i = 0,
8001     attrNames = value && value.match( rnotwhite );
8002    
8003     if ( attrNames && elem.nodeType === 1 ) {
8004     while ( (name = attrNames[i++]) ) {
8005     propName = jQuery.propFix[ name ] || name;
8006    
8007     // Boolean attributes get special treatment (#10870)
8008     if ( jQuery.expr.match.bool.test( name ) ) {
8009     // Set corresponding property to false
8010     if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8011     elem[ propName ] = false;
8012     // Support: IE<9
8013     // Also clear defaultChecked/defaultSelected (if appropriate)
8014     } else {
8015     elem[ jQuery.camelCase( "default-" + name ) ] =
8016     elem[ propName ] = false;
8017     }
8018    
8019     // See #9699 for explanation of this approach (setting first, then removal)
8020     } else {
8021     jQuery.attr( elem, name, "" );
8022     }
8023    
8024     elem.removeAttribute( getSetAttribute ? name : propName );
8025     }
8026     }
8027     },
8028    
8029     attrHooks: {
8030     type: {
8031     set: function( elem, value ) {
8032     if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
8033     // Setting the type on a radio button after the value resets the value in IE6-9
8034     // Reset value to default in case type is set after value during creation
8035     var val = elem.value;
8036     elem.setAttribute( "type", value );
8037     if ( val ) {
8038     elem.value = val;
8039     }
8040     return value;
8041     }
8042     }
8043     }
8044     }
8045     });
8046    
8047     // Hook for boolean attributes
8048     boolHook = {
8049     set: function( elem, value, name ) {
8050     if ( value === false ) {
8051     // Remove boolean attributes when set to false
8052     jQuery.removeAttr( elem, name );
8053     } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8054     // IE<8 needs the *property* name
8055     elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
8056    
8057     // Use defaultChecked and defaultSelected for oldIE
8058     } else {
8059     elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
8060     }
8061    
8062     return name;
8063     }
8064     };
8065    
8066     // Retrieve booleans specially
8067     jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8068    
8069     var getter = attrHandle[ name ] || jQuery.find.attr;
8070    
8071     attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
8072     function( elem, name, isXML ) {
8073     var ret, handle;
8074     if ( !isXML ) {
8075     // Avoid an infinite loop by temporarily removing this function from the getter
8076     handle = attrHandle[ name ];
8077     attrHandle[ name ] = ret;
8078     ret = getter( elem, name, isXML ) != null ?
8079     name.toLowerCase() :
8080     null;
8081     attrHandle[ name ] = handle;
8082     }
8083     return ret;
8084     } :
8085     function( elem, name, isXML ) {
8086     if ( !isXML ) {
8087     return elem[ jQuery.camelCase( "default-" + name ) ] ?
8088     name.toLowerCase() :
8089     null;
8090     }
8091     };
8092     });
8093    
8094     // fix oldIE attroperties
8095     if ( !getSetInput || !getSetAttribute ) {
8096     jQuery.attrHooks.value = {
8097     set: function( elem, value, name ) {
8098     if ( jQuery.nodeName( elem, "input" ) ) {
8099     // Does not return so that setAttribute is also used
8100     elem.defaultValue = value;
8101     } else {
8102     // Use nodeHook if defined (#1954); otherwise setAttribute is fine
8103     return nodeHook && nodeHook.set( elem, value, name );
8104     }
8105     }
8106     };
8107     }
8108    
8109     // IE6/7 do not support getting/setting some attributes with get/setAttribute
8110     if ( !getSetAttribute ) {
8111    
8112     // Use this for any attribute in IE6/7
8113     // This fixes almost every IE6/7 issue
8114     nodeHook = {
8115     set: function( elem, value, name ) {
8116     // Set the existing or create a new attribute node
8117     var ret = elem.getAttributeNode( name );
8118     if ( !ret ) {
8119     elem.setAttributeNode(
8120     (ret = elem.ownerDocument.createAttribute( name ))
8121     );
8122     }
8123    
8124     ret.value = value += "";
8125    
8126     // Break association with cloned elements by also using setAttribute (#9646)
8127     if ( name === "value" || value === elem.getAttribute( name ) ) {
8128     return value;
8129     }
8130     }
8131     };
8132    
8133     // Some attributes are constructed with empty-string values when not defined
8134     attrHandle.id = attrHandle.name = attrHandle.coords =
8135     function( elem, name, isXML ) {
8136     var ret;
8137     if ( !isXML ) {
8138     return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
8139     ret.value :
8140     null;
8141     }
8142     };
8143    
8144     // Fixing value retrieval on a button requires this module
8145     jQuery.valHooks.button = {
8146     get: function( elem, name ) {
8147     var ret = elem.getAttributeNode( name );
8148     if ( ret && ret.specified ) {
8149     return ret.value;
8150     }
8151     },
8152     set: nodeHook.set
8153     };
8154    
8155     // Set contenteditable to false on removals(#10429)
8156     // Setting to empty string throws an error as an invalid value
8157     jQuery.attrHooks.contenteditable = {
8158     set: function( elem, value, name ) {
8159     nodeHook.set( elem, value === "" ? false : value, name );
8160     }
8161     };
8162    
8163     // Set width and height to auto instead of 0 on empty string( Bug #8150 )
8164     // This is for removals
8165     jQuery.each([ "width", "height" ], function( i, name ) {
8166     jQuery.attrHooks[ name ] = {
8167     set: function( elem, value ) {
8168     if ( value === "" ) {
8169     elem.setAttribute( name, "auto" );
8170     return value;
8171     }
8172     }
8173     };
8174     });
8175     }
8176    
8177     if ( !support.style ) {
8178     jQuery.attrHooks.style = {
8179     get: function( elem ) {
8180     // Return undefined in the case of empty string
8181     // Note: IE uppercases css property names, but if we were to .toLowerCase()
8182     // .cssText, that would destroy case senstitivity in URL's, like in "background"
8183     return elem.style.cssText || undefined;
8184     },
8185     set: function( elem, value ) {
8186     return ( elem.style.cssText = value + "" );
8187     }
8188     };
8189     }
8190    
8191    
8192    
8193    
8194     var rfocusable = /^(?:input|select|textarea|button|object)$/i,
8195     rclickable = /^(?:a|area)$/i;
8196    
8197     jQuery.fn.extend({
8198     prop: function( name, value ) {
8199     return access( this, jQuery.prop, name, value, arguments.length > 1 );
8200     },
8201    
8202     removeProp: function( name ) {
8203     name = jQuery.propFix[ name ] || name;
8204     return this.each(function() {
8205     // try/catch handles cases where IE balks (such as removing a property on window)
8206     try {
8207     this[ name ] = undefined;
8208     delete this[ name ];
8209     } catch( e ) {}
8210     });
8211     }
8212     });
8213    
8214     jQuery.extend({
8215     propFix: {
8216     "for": "htmlFor",
8217     "class": "className"
8218     },
8219    
8220     prop: function( elem, name, value ) {
8221     var ret, hooks, notxml,
8222     nType = elem.nodeType;
8223    
8224     // don't get/set properties on text, comment and attribute nodes
8225     if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
8226     return;
8227     }
8228    
8229     notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
8230    
8231     if ( notxml ) {
8232     // Fix name and attach hooks
8233     name = jQuery.propFix[ name ] || name;
8234     hooks = jQuery.propHooks[ name ];
8235     }
8236    
8237     if ( value !== undefined ) {
8238     return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
8239     ret :
8240     ( elem[ name ] = value );
8241    
8242     } else {
8243     return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
8244     ret :
8245     elem[ name ];
8246     }
8247     },
8248    
8249     propHooks: {
8250     tabIndex: {
8251     get: function( elem ) {
8252     // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
8253     // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8254     // Use proper attribute retrieval(#12072)
8255     var tabindex = jQuery.find.attr( elem, "tabindex" );
8256    
8257     return tabindex ?
8258     parseInt( tabindex, 10 ) :
8259     rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
8260     0 :
8261     -1;
8262     }
8263     }
8264     }
8265     });
8266    
8267     // Some attributes require a special call on IE
8268     // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
8269     if ( !support.hrefNormalized ) {
8270     // href/src property should get the full normalized URL (#10299/#12915)
8271     jQuery.each([ "href", "src" ], function( i, name ) {
8272     jQuery.propHooks[ name ] = {
8273     get: function( elem ) {
8274     return elem.getAttribute( name, 4 );
8275     }
8276     };
8277     });
8278     }
8279    
8280     // Support: Safari, IE9+
8281     // mis-reports the default selected property of an option
8282     // Accessing the parent's selectedIndex property fixes it
8283     if ( !support.optSelected ) {
8284     jQuery.propHooks.selected = {
8285     get: function( elem ) {
8286     var parent = elem.parentNode;
8287    
8288     if ( parent ) {
8289     parent.selectedIndex;
8290    
8291     // Make sure that it also works with optgroups, see #5701
8292     if ( parent.parentNode ) {
8293     parent.parentNode.selectedIndex;
8294     }
8295     }
8296     return null;
8297     }
8298     };
8299     }
8300    
8301     jQuery.each([
8302     "tabIndex",
8303     "readOnly",
8304     "maxLength",
8305     "cellSpacing",
8306     "cellPadding",
8307     "rowSpan",
8308     "colSpan",
8309     "useMap",
8310     "frameBorder",
8311     "contentEditable"
8312     ], function() {
8313     jQuery.propFix[ this.toLowerCase() ] = this;
8314     });
8315    
8316     // IE6/7 call enctype encoding
8317     if ( !support.enctype ) {
8318     jQuery.propFix.enctype = "encoding";
8319     }
8320    
8321    
8322    
8323    
8324     var rclass = /[\t\r\n\f]/g;
8325    
8326     jQuery.fn.extend({
8327     addClass: function( value ) {
8328     var classes, elem, cur, clazz, j, finalValue,
8329     i = 0,
8330     len = this.length,
8331     proceed = typeof value === "string" && value;
8332    
8333     if ( jQuery.isFunction( value ) ) {
8334     return this.each(function( j ) {
8335     jQuery( this ).addClass( value.call( this, j, this.className ) );
8336     });
8337     }
8338    
8339     if ( proceed ) {
8340     // The disjunction here is for better compressibility (see removeClass)
8341     classes = ( value || "" ).match( rnotwhite ) || [];
8342    
8343     for ( ; i < len; i++ ) {
8344     elem = this[ i ];
8345     cur = elem.nodeType === 1 && ( elem.className ?
8346     ( " " + elem.className + " " ).replace( rclass, " " ) :
8347     " "
8348     );
8349    
8350     if ( cur ) {
8351     j = 0;
8352     while ( (clazz = classes[j++]) ) {
8353     if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8354     cur += clazz + " ";
8355     }
8356     }
8357    
8358     // only assign if different to avoid unneeded rendering.
8359     finalValue = jQuery.trim( cur );
8360     if ( elem.className !== finalValue ) {
8361     elem.className = finalValue;
8362     }
8363     }
8364     }
8365     }
8366    
8367     return this;
8368     },
8369    
8370     removeClass: function( value ) {
8371     var classes, elem, cur, clazz, j, finalValue,
8372     i = 0,
8373     len = this.length,
8374     proceed = arguments.length === 0 || typeof value === "string" && value;
8375    
8376     if ( jQuery.isFunction( value ) ) {
8377     return this.each(function( j ) {
8378     jQuery( this ).removeClass( value.call( this, j, this.className ) );
8379     });
8380     }
8381     if ( proceed ) {
8382     classes = ( value || "" ).match( rnotwhite ) || [];
8383    
8384     for ( ; i < len; i++ ) {
8385     elem = this[ i ];
8386     // This expression is here for better compressibility (see addClass)
8387     cur = elem.nodeType === 1 && ( elem.className ?
8388     ( " " + elem.className + " " ).replace( rclass, " " ) :
8389     ""
8390     );
8391    
8392     if ( cur ) {
8393     j = 0;
8394     while ( (clazz = classes[j++]) ) {
8395     // Remove *all* instances
8396     while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
8397     cur = cur.replace( " " + clazz + " ", " " );
8398     }
8399     }
8400    
8401     // only assign if different to avoid unneeded rendering.
8402     finalValue = value ? jQuery.trim( cur ) : "";
8403     if ( elem.className !== finalValue ) {
8404     elem.className = finalValue;
8405     }
8406     }
8407     }
8408     }
8409    
8410     return this;
8411     },
8412    
8413     toggleClass: function( value, stateVal ) {
8414     var type = typeof value;
8415    
8416     if ( typeof stateVal === "boolean" && type === "string" ) {
8417     return stateVal ? this.addClass( value ) : this.removeClass( value );
8418     }
8419    
8420     if ( jQuery.isFunction( value ) ) {
8421     return this.each(function( i ) {
8422     jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
8423     });
8424     }
8425    
8426     return this.each(function() {
8427     if ( type === "string" ) {
8428     // toggle individual class names
8429     var className,
8430     i = 0,
8431     self = jQuery( this ),
8432     classNames = value.match( rnotwhite ) || [];
8433    
8434     while ( (className = classNames[ i++ ]) ) {
8435     // check each className given, space separated list
8436     if ( self.hasClass( className ) ) {
8437     self.removeClass( className );
8438     } else {
8439     self.addClass( className );
8440     }
8441     }
8442    
8443     // Toggle whole class name
8444     } else if ( type === strundefined || type === "boolean" ) {
8445     if ( this.className ) {
8446     // store className if set
8447     jQuery._data( this, "__className__", this.className );
8448     }
8449    
8450     // If the element has a class name or if we're passed "false",
8451     // then remove the whole classname (if there was one, the above saved it).
8452     // Otherwise bring back whatever was previously saved (if anything),
8453     // falling back to the empty string if nothing was stored.
8454     this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
8455     }
8456     });
8457     },
8458    
8459     hasClass: function( selector ) {
8460     var className = " " + selector + " ",
8461     i = 0,
8462     l = this.length;
8463     for ( ; i < l; i++ ) {
8464     if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
8465     return true;
8466     }
8467     }
8468    
8469     return false;
8470     }
8471     });
8472    
8473    
8474    
8475    
8476     // Return jQuery for attributes-only inclusion
8477    
8478    
8479     jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
8480     "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8481     "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
8482    
8483     // Handle event binding
8484     jQuery.fn[ name ] = function( data, fn ) {
8485     return arguments.length > 0 ?
8486     this.on( name, null, data, fn ) :
8487     this.trigger( name );
8488     };
8489     });
8490    
8491     jQuery.fn.extend({
8492     hover: function( fnOver, fnOut ) {
8493     return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8494     },
8495    
8496     bind: function( types, data, fn ) {
8497     return this.on( types, null, data, fn );
8498     },
8499     unbind: function( types, fn ) {
8500     return this.off( types, null, fn );
8501     },
8502    
8503     delegate: function( selector, types, data, fn ) {
8504     return this.on( types, selector, data, fn );
8505     },
8506     undelegate: function( selector, types, fn ) {
8507     // ( namespace ) or ( selector, types [, fn] )
8508     return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
8509     }
8510     });
8511    
8512    
8513     var nonce = jQuery.now();
8514    
8515     var rquery = (/\?/);
8516    
8517    
8518    
8519     var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
8520    
8521     jQuery.parseJSON = function( data ) {
8522     // Attempt to parse using the native JSON parser first
8523     if ( window.JSON && window.JSON.parse ) {
8524     // Support: Android 2.3
8525     // Workaround failure to string-cast null input
8526     return window.JSON.parse( data + "" );
8527     }
8528    
8529     var requireNonComma,
8530     depth = null,
8531     str = jQuery.trim( data + "" );
8532    
8533     // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
8534     // after removing valid tokens
8535     return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
8536    
8537     // Force termination if we see a misplaced comma
8538     if ( requireNonComma && comma ) {
8539     depth = 0;
8540     }
8541    
8542     // Perform no more replacements after returning to outermost depth
8543     if ( depth === 0 ) {
8544     return token;
8545     }
8546    
8547     // Commas must not follow "[", "{", or ","
8548     requireNonComma = open || comma;
8549    
8550     // Determine new depth
8551     // array/object open ("[" or "{"): depth += true - false (increment)
8552     // array/object close ("]" or "}"): depth += false - true (decrement)
8553     // other cases ("," or primitive): depth += true - true (numeric cast)
8554     depth += !close - !open;
8555    
8556     // Remove this token
8557     return "";
8558     }) ) ?
8559     ( Function( "return " + str ) )() :
8560     jQuery.error( "Invalid JSON: " + data );
8561     };
8562    
8563    
8564     // Cross-browser xml parsing
8565     jQuery.parseXML = function( data ) {
8566     var xml, tmp;
8567     if ( !data || typeof data !== "string" ) {
8568     return null;
8569     }
8570     try {
8571     if ( window.DOMParser ) { // Standard
8572     tmp = new DOMParser();
8573     xml = tmp.parseFromString( data, "text/xml" );
8574     } else { // IE
8575     xml = new ActiveXObject( "Microsoft.XMLDOM" );
8576     xml.async = "false";
8577     xml.loadXML( data );
8578     }
8579     } catch( e ) {
8580     xml = undefined;
8581     }
8582     if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
8583     jQuery.error( "Invalid XML: " + data );
8584     }
8585     return xml;
8586     };
8587    
8588    
8589     var
8590     // Document location
8591     ajaxLocParts,
8592     ajaxLocation,
8593    
8594     rhash = /#.*$/,
8595     rts = /([?&])_=[^&]*/,
8596     rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
8597     // #7653, #8125, #8152: local protocol detection
8598     rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8599     rnoContent = /^(?:GET|HEAD)$/,
8600     rprotocol = /^\/\//,
8601     rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
8602    
8603     /* Prefilters
8604     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8605     * 2) These are called:
8606     * - BEFORE asking for a transport
8607     * - AFTER param serialization (s.data is a string if s.processData is true)
8608     * 3) key is the dataType
8609     * 4) the catchall symbol "*" can be used
8610     * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8611     */
8612     prefilters = {},
8613    
8614     /* Transports bindings
8615     * 1) key is the dataType
8616     * 2) the catchall symbol "*" can be used
8617     * 3) selection will start with transport dataType and THEN go to "*" if needed
8618     */
8619     transports = {},
8620    
8621     // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8622     allTypes = "*/".concat("*");
8623    
8624     // #8138, IE may throw an exception when accessing
8625     // a field from window.location if document.domain has been set
8626     try {
8627     ajaxLocation = location.href;
8628     } catch( e ) {
8629     // Use the href attribute of an A element
8630     // since IE will modify it given document.location
8631     ajaxLocation = document.createElement( "a" );
8632     ajaxLocation.href = "";
8633     ajaxLocation = ajaxLocation.href;
8634     }
8635    
8636     // Segment location into parts
8637     ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
8638    
8639     // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8640     function addToPrefiltersOrTransports( structure ) {
8641    
8642     // dataTypeExpression is optional and defaults to "*"
8643     return function( dataTypeExpression, func ) {
8644    
8645     if ( typeof dataTypeExpression !== "string" ) {
8646     func = dataTypeExpression;
8647     dataTypeExpression = "*";
8648     }
8649    
8650     var dataType,
8651     i = 0,
8652     dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8653    
8654     if ( jQuery.isFunction( func ) ) {
8655     // For each dataType in the dataTypeExpression
8656     while ( (dataType = dataTypes[i++]) ) {
8657     // Prepend if requested
8658     if ( dataType.charAt( 0 ) === "+" ) {
8659     dataType = dataType.slice( 1 ) || "*";
8660     (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
8661    
8662     // Otherwise append
8663     } else {
8664     (structure[ dataType ] = structure[ dataType ] || []).push( func );
8665     }
8666     }
8667     }
8668     };
8669     }
8670    
8671     // Base inspection function for prefilters and transports
8672     function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8673    
8674     var inspected = {},
8675     seekingTransport = ( structure === transports );
8676    
8677     function inspect( dataType ) {
8678     var selected;
8679     inspected[ dataType ] = true;
8680     jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8681     var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8682     if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8683     options.dataTypes.unshift( dataTypeOrTransport );
8684     inspect( dataTypeOrTransport );
8685     return false;
8686     } else if ( seekingTransport ) {
8687     return !( selected = dataTypeOrTransport );
8688     }
8689     });
8690     return selected;
8691     }
8692    
8693     return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8694     }
8695    
8696     // A special extend for ajax options
8697     // that takes "flat" options (not to be deep extended)
8698     // Fixes #9887
8699     function ajaxExtend( target, src ) {
8700     var deep, key,
8701     flatOptions = jQuery.ajaxSettings.flatOptions || {};
8702    
8703     for ( key in src ) {
8704     if ( src[ key ] !== undefined ) {
8705     ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
8706     }
8707     }
8708     if ( deep ) {
8709     jQuery.extend( true, target, deep );
8710     }
8711    
8712     return target;
8713     }
8714    
8715     /* Handles responses to an ajax request:
8716     * - finds the right dataType (mediates between content-type and expected dataType)
8717     * - returns the corresponding response
8718     */
8719     function ajaxHandleResponses( s, jqXHR, responses ) {
8720     var firstDataType, ct, finalDataType, type,
8721     contents = s.contents,
8722     dataTypes = s.dataTypes;
8723    
8724     // Remove auto dataType and get content-type in the process
8725     while ( dataTypes[ 0 ] === "*" ) {
8726     dataTypes.shift();
8727     if ( ct === undefined ) {
8728     ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8729     }
8730     }
8731    
8732     // Check if we're dealing with a known content-type
8733     if ( ct ) {
8734     for ( type in contents ) {
8735     if ( contents[ type ] && contents[ type ].test( ct ) ) {
8736     dataTypes.unshift( type );
8737     break;
8738     }
8739     }
8740     }
8741    
8742     // Check to see if we have a response for the expected dataType
8743     if ( dataTypes[ 0 ] in responses ) {
8744     finalDataType = dataTypes[ 0 ];
8745     } else {
8746     // Try convertible dataTypes
8747     for ( type in responses ) {
8748     if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8749     finalDataType = type;
8750     break;
8751     }
8752     if ( !firstDataType ) {
8753     firstDataType = type;
8754     }
8755     }
8756     // Or just use first one
8757     finalDataType = finalDataType || firstDataType;
8758     }
8759    
8760     // If we found a dataType
8761     // We add the dataType to the list if needed
8762     // and return the corresponding response
8763     if ( finalDataType ) {
8764     if ( finalDataType !== dataTypes[ 0 ] ) {
8765     dataTypes.unshift( finalDataType );
8766     }
8767     return responses[ finalDataType ];
8768     }
8769     }
8770    
8771     /* Chain conversions given the request and the original response
8772     * Also sets the responseXXX fields on the jqXHR instance
8773     */
8774     function ajaxConvert( s, response, jqXHR, isSuccess ) {
8775     var conv2, current, conv, tmp, prev,
8776     converters = {},
8777     // Work with a copy of dataTypes in case we need to modify it for conversion
8778     dataTypes = s.dataTypes.slice();
8779    
8780     // Create converters map with lowercased keys
8781     if ( dataTypes[ 1 ] ) {
8782     for ( conv in s.converters ) {
8783     converters[ conv.toLowerCase() ] = s.converters[ conv ];
8784     }
8785     }
8786    
8787     current = dataTypes.shift();
8788    
8789     // Convert to each sequential dataType
8790     while ( current ) {
8791    
8792     if ( s.responseFields[ current ] ) {
8793     jqXHR[ s.responseFields[ current ] ] = response;
8794     }
8795    
8796     // Apply the dataFilter if provided
8797     if ( !prev && isSuccess && s.dataFilter ) {
8798     response = s.dataFilter( response, s.dataType );
8799     }
8800    
8801     prev = current;
8802     current = dataTypes.shift();
8803    
8804     if ( current ) {
8805    
8806     // There's only work to do if current dataType is non-auto
8807     if ( current === "*" ) {
8808    
8809     current = prev;
8810    
8811     // Convert response if prev dataType is non-auto and differs from current
8812     } else if ( prev !== "*" && prev !== current ) {
8813    
8814     // Seek a direct converter
8815     conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8816    
8817     // If none found, seek a pair
8818     if ( !conv ) {
8819     for ( conv2 in converters ) {
8820    
8821     // If conv2 outputs current
8822     tmp = conv2.split( " " );
8823     if ( tmp[ 1 ] === current ) {
8824    
8825     // If prev can be converted to accepted input
8826     conv = converters[ prev + " " + tmp[ 0 ] ] ||
8827     converters[ "* " + tmp[ 0 ] ];
8828     if ( conv ) {
8829     // Condense equivalence converters
8830     if ( conv === true ) {
8831     conv = converters[ conv2 ];
8832    
8833     // Otherwise, insert the intermediate dataType
8834     } else if ( converters[ conv2 ] !== true ) {
8835     current = tmp[ 0 ];
8836     dataTypes.unshift( tmp[ 1 ] );
8837     }
8838     break;
8839     }
8840     }
8841     }
8842     }
8843    
8844     // Apply converter (if not an equivalence)
8845     if ( conv !== true ) {
8846    
8847     // Unless errors are allowed to bubble, catch and return them
8848     if ( conv && s[ "throws" ] ) {
8849     response = conv( response );
8850     } else {
8851     try {
8852     response = conv( response );
8853     } catch ( e ) {
8854     return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8855     }
8856     }
8857     }
8858     }
8859     }
8860     }
8861    
8862     return { state: "success", data: response };
8863     }
8864    
8865     jQuery.extend({
8866    
8867     // Counter for holding the number of active queries
8868     active: 0,
8869    
8870     // Last-Modified header cache for next request
8871     lastModified: {},
8872     etag: {},
8873    
8874     ajaxSettings: {
8875     url: ajaxLocation,
8876     type: "GET",
8877     isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
8878     global: true,
8879     processData: true,
8880     async: true,
8881     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8882     /*
8883     timeout: 0,
8884     data: null,
8885     dataType: null,
8886     username: null,
8887     password: null,
8888     cache: null,
8889     throws: false,
8890     traditional: false,
8891     headers: {},
8892     */
8893    
8894     accepts: {
8895     "*": allTypes,
8896     text: "text/plain",
8897     html: "text/html",
8898     xml: "application/xml, text/xml",
8899     json: "application/json, text/javascript"
8900     },
8901    
8902     contents: {
8903     xml: /xml/,
8904     html: /html/,
8905     json: /json/
8906     },
8907    
8908     responseFields: {
8909     xml: "responseXML",
8910     text: "responseText",
8911     json: "responseJSON"
8912     },
8913    
8914     // Data converters
8915     // Keys separate source (or catchall "*") and destination types with a single space
8916     converters: {
8917    
8918     // Convert anything to text
8919     "* text": String,
8920    
8921     // Text to html (true = no transformation)
8922     "text html": true,
8923    
8924     // Evaluate text as a json expression
8925     "text json": jQuery.parseJSON,
8926    
8927     // Parse text as xml
8928     "text xml": jQuery.parseXML
8929     },
8930    
8931     // For options that shouldn't be deep extended:
8932     // you can add your own custom options here if
8933     // and when you create one that shouldn't be
8934     // deep extended (see ajaxExtend)
8935     flatOptions: {
8936     url: true,
8937     context: true
8938     }
8939     },
8940    
8941     // Creates a full fledged settings object into target
8942     // with both ajaxSettings and settings fields.
8943     // If target is omitted, writes into ajaxSettings.
8944     ajaxSetup: function( target, settings ) {
8945     return settings ?
8946    
8947     // Building a settings object
8948     ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8949    
8950     // Extending ajaxSettings
8951     ajaxExtend( jQuery.ajaxSettings, target );
8952     },
8953    
8954     ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8955     ajaxTransport: addToPrefiltersOrTransports( transports ),
8956    
8957     // Main method
8958     ajax: function( url, options ) {
8959    
8960     // If url is an object, simulate pre-1.5 signature
8961     if ( typeof url === "object" ) {
8962     options = url;
8963     url = undefined;
8964     }
8965    
8966     // Force options to be an object
8967     options = options || {};
8968    
8969     var // Cross-domain detection vars
8970     parts,
8971     // Loop variable
8972     i,
8973     // URL without anti-cache param
8974     cacheURL,
8975     // Response headers as string
8976     responseHeadersString,
8977     // timeout handle
8978     timeoutTimer,
8979    
8980     // To know if global events are to be dispatched
8981     fireGlobals,
8982    
8983     transport,
8984     // Response headers
8985     responseHeaders,
8986     // Create the final options object
8987     s = jQuery.ajaxSetup( {}, options ),
8988     // Callbacks context
8989     callbackContext = s.context || s,
8990     // Context for global events is callbackContext if it is a DOM node or jQuery collection
8991     globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
8992     jQuery( callbackContext ) :
8993     jQuery.event,
8994     // Deferreds
8995     deferred = jQuery.Deferred(),
8996     completeDeferred = jQuery.Callbacks("once memory"),
8997     // Status-dependent callbacks
8998     statusCode = s.statusCode || {},
8999     // Headers (they are sent all at once)
9000     requestHeaders = {},
9001     requestHeadersNames = {},
9002     // The jqXHR state
9003     state = 0,
9004     // Default abort message
9005     strAbort = "canceled",
9006     // Fake xhr
9007     jqXHR = {
9008     readyState: 0,
9009    
9010     // Builds headers hashtable if needed
9011     getResponseHeader: function( key ) {
9012     var match;
9013     if ( state === 2 ) {
9014     if ( !responseHeaders ) {
9015     responseHeaders = {};
9016     while ( (match = rheaders.exec( responseHeadersString )) ) {
9017     responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
9018     }
9019     }
9020     match = responseHeaders[ key.toLowerCase() ];
9021     }
9022     return match == null ? null : match;
9023     },
9024    
9025     // Raw string
9026     getAllResponseHeaders: function() {
9027     return state === 2 ? responseHeadersString : null;
9028     },
9029    
9030     // Caches the header
9031     setRequestHeader: function( name, value ) {
9032     var lname = name.toLowerCase();
9033     if ( !state ) {
9034     name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
9035     requestHeaders[ name ] = value;
9036     }
9037     return this;
9038     },
9039    
9040     // Overrides response content-type header
9041     overrideMimeType: function( type ) {
9042     if ( !state ) {
9043     s.mimeType = type;
9044     }
9045     return this;
9046     },
9047    
9048     // Status-dependent callbacks
9049     statusCode: function( map ) {
9050     var code;
9051     if ( map ) {
9052     if ( state < 2 ) {
9053     for ( code in map ) {
9054     // Lazy-add the new callback in a way that preserves old ones
9055     statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9056     }
9057     } else {
9058     // Execute the appropriate callbacks
9059     jqXHR.always( map[ jqXHR.status ] );
9060     }
9061     }
9062     return this;
9063     },
9064    
9065     // Cancel the request
9066     abort: function( statusText ) {
9067     var finalText = statusText || strAbort;
9068     if ( transport ) {
9069     transport.abort( finalText );
9070     }
9071     done( 0, finalText );
9072     return this;
9073     }
9074     };
9075    
9076     // Attach deferreds
9077     deferred.promise( jqXHR ).complete = completeDeferred.add;
9078     jqXHR.success = jqXHR.done;
9079     jqXHR.error = jqXHR.fail;
9080    
9081     // Remove hash character (#7531: and string promotion)
9082     // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
9083     // Handle falsy url in the settings object (#10093: consistency with old signature)
9084     // We also use the url parameter if available
9085     s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
9086    
9087     // Alias method option to type as per ticket #12004
9088     s.type = options.method || options.type || s.method || s.type;
9089    
9090     // Extract dataTypes list
9091     s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
9092    
9093     // A cross-domain request is in order when we have a protocol:host:port mismatch
9094     if ( s.crossDomain == null ) {
9095     parts = rurl.exec( s.url.toLowerCase() );
9096     s.crossDomain = !!( parts &&
9097     ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
9098     ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
9099     ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
9100     );
9101     }
9102    
9103     // Convert data if not already a string
9104     if ( s.data && s.processData && typeof s.data !== "string" ) {
9105     s.data = jQuery.param( s.data, s.traditional );
9106     }
9107    
9108     // Apply prefilters
9109     inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9110    
9111     // If request was aborted inside a prefilter, stop there
9112     if ( state === 2 ) {
9113     return jqXHR;
9114     }
9115    
9116     // We can fire global events as of now if asked to
9117     // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9118     fireGlobals = jQuery.event && s.global;
9119    
9120     // Watch for a new set of requests
9121     if ( fireGlobals && jQuery.active++ === 0 ) {
9122     jQuery.event.trigger("ajaxStart");
9123     }
9124    
9125     // Uppercase the type
9126     s.type = s.type.toUpperCase();
9127    
9128     // Determine if request has content
9129     s.hasContent = !rnoContent.test( s.type );
9130    
9131     // Save the URL in case we're toying with the If-Modified-Since
9132     // and/or If-None-Match header later on
9133     cacheURL = s.url;
9134    
9135     // More options handling for requests with no content
9136     if ( !s.hasContent ) {
9137    
9138     // If data is available, append data to url
9139     if ( s.data ) {
9140     cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
9141     // #9682: remove data so that it's not used in an eventual retry
9142     delete s.data;
9143     }
9144    
9145     // Add anti-cache in url if needed
9146     if ( s.cache === false ) {
9147     s.url = rts.test( cacheURL ) ?
9148    
9149     // If there is already a '_' parameter, set its value
9150     cacheURL.replace( rts, "$1_=" + nonce++ ) :
9151    
9152     // Otherwise add one to the end
9153     cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
9154     }
9155     }
9156    
9157     // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9158     if ( s.ifModified ) {
9159     if ( jQuery.lastModified[ cacheURL ] ) {
9160     jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9161     }
9162     if ( jQuery.etag[ cacheURL ] ) {
9163     jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9164     }
9165     }
9166    
9167     // Set the correct header, if data is being sent
9168     if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9169     jqXHR.setRequestHeader( "Content-Type", s.contentType );
9170     }
9171    
9172     // Set the Accepts header for the server, depending on the dataType
9173     jqXHR.setRequestHeader(
9174     "Accept",
9175     s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
9176     s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9177     s.accepts[ "*" ]
9178     );
9179    
9180     // Check for headers option
9181     for ( i in s.headers ) {
9182     jqXHR.setRequestHeader( i, s.headers[ i ] );
9183     }
9184    
9185     // Allow custom headers/mimetypes and early abort
9186     if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
9187     // Abort if not done already and return
9188     return jqXHR.abort();
9189     }
9190    
9191     // aborting is no longer a cancellation
9192     strAbort = "abort";
9193    
9194     // Install callbacks on deferreds
9195     for ( i in { success: 1, error: 1, complete: 1 } ) {
9196     jqXHR[ i ]( s[ i ] );
9197     }
9198    
9199     // Get transport
9200     transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9201    
9202     // If no transport, we auto-abort
9203     if ( !transport ) {
9204     done( -1, "No Transport" );
9205     } else {
9206     jqXHR.readyState = 1;
9207    
9208     // Send global event
9209     if ( fireGlobals ) {
9210     globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9211     }
9212     // Timeout
9213     if ( s.async && s.timeout > 0 ) {
9214     timeoutTimer = setTimeout(function() {
9215     jqXHR.abort("timeout");
9216     }, s.timeout );
9217     }
9218    
9219     try {
9220     state = 1;
9221     transport.send( requestHeaders, done );
9222     } catch ( e ) {
9223     // Propagate exception as error if not done
9224     if ( state < 2 ) {
9225     done( -1, e );
9226     // Simply rethrow otherwise
9227     } else {
9228     throw e;
9229     }
9230     }
9231     }
9232    
9233     // Callback for when everything is done
9234     function done( status, nativeStatusText, responses, headers ) {
9235     var isSuccess, success, error, response, modified,
9236     statusText = nativeStatusText;
9237    
9238     // Called once
9239     if ( state === 2 ) {
9240     return;
9241     }
9242    
9243     // State is "done" now
9244     state = 2;
9245    
9246     // Clear timeout if it exists
9247     if ( timeoutTimer ) {
9248     clearTimeout( timeoutTimer );
9249     }
9250    
9251     // Dereference transport for early garbage collection
9252     // (no matter how long the jqXHR object will be used)
9253     transport = undefined;
9254    
9255     // Cache response headers
9256     responseHeadersString = headers || "";
9257    
9258     // Set readyState
9259     jqXHR.readyState = status > 0 ? 4 : 0;
9260    
9261     // Determine if successful
9262     isSuccess = status >= 200 && status < 300 || status === 304;
9263    
9264     // Get response data
9265     if ( responses ) {
9266     response = ajaxHandleResponses( s, jqXHR, responses );
9267     }
9268    
9269     // Convert no matter what (that way responseXXX fields are always set)
9270     response = ajaxConvert( s, response, jqXHR, isSuccess );
9271    
9272     // If successful, handle type chaining
9273     if ( isSuccess ) {
9274    
9275     // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9276     if ( s.ifModified ) {
9277     modified = jqXHR.getResponseHeader("Last-Modified");
9278     if ( modified ) {
9279     jQuery.lastModified[ cacheURL ] = modified;
9280     }
9281     modified = jqXHR.getResponseHeader("etag");
9282     if ( modified ) {
9283     jQuery.etag[ cacheURL ] = modified;
9284     }
9285     }
9286    
9287     // if no content
9288     if ( status === 204 || s.type === "HEAD" ) {
9289     statusText = "nocontent";
9290    
9291     // if not modified
9292     } else if ( status === 304 ) {
9293     statusText = "notmodified";
9294    
9295     // If we have data, let's convert it
9296     } else {
9297     statusText = response.state;
9298     success = response.data;
9299     error = response.error;
9300     isSuccess = !error;
9301     }
9302     } else {
9303     // We extract error from statusText
9304     // then normalize statusText and status for non-aborts
9305     error = statusText;
9306     if ( status || !statusText ) {
9307     statusText = "error";
9308     if ( status < 0 ) {
9309     status = 0;
9310     }
9311     }
9312     }
9313    
9314     // Set data for the fake xhr object
9315     jqXHR.status = status;
9316     jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9317    
9318     // Success/Error
9319     if ( isSuccess ) {
9320     deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9321     } else {
9322     deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9323     }
9324    
9325     // Status-dependent callbacks
9326     jqXHR.statusCode( statusCode );
9327     statusCode = undefined;
9328    
9329     if ( fireGlobals ) {
9330     globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9331     [ jqXHR, s, isSuccess ? success : error ] );
9332     }
9333    
9334     // Complete
9335     completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9336    
9337     if ( fireGlobals ) {
9338     globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9339     // Handle the global AJAX counter
9340     if ( !( --jQuery.active ) ) {
9341     jQuery.event.trigger("ajaxStop");
9342     }
9343     }
9344     }
9345    
9346     return jqXHR;
9347     },
9348    
9349     getJSON: function( url, data, callback ) {
9350     return jQuery.get( url, data, callback, "json" );
9351     },
9352    
9353     getScript: function( url, callback ) {
9354     return jQuery.get( url, undefined, callback, "script" );
9355     }
9356     });
9357    
9358     jQuery.each( [ "get", "post" ], function( i, method ) {
9359     jQuery[ method ] = function( url, data, callback, type ) {
9360     // shift arguments if data argument was omitted
9361     if ( jQuery.isFunction( data ) ) {
9362     type = type || callback;
9363     callback = data;
9364     data = undefined;
9365     }
9366    
9367     return jQuery.ajax({
9368     url: url,
9369     type: method,
9370     dataType: type,
9371     data: data,
9372     success: callback
9373     });
9374     };
9375     });
9376    
9377    
9378     jQuery._evalUrl = function( url ) {
9379     return jQuery.ajax({
9380     url: url,
9381     type: "GET",
9382     dataType: "script",
9383     async: false,
9384     global: false,
9385     "throws": true
9386     });
9387     };
9388    
9389    
9390     jQuery.fn.extend({
9391     wrapAll: function( html ) {
9392     if ( jQuery.isFunction( html ) ) {
9393     return this.each(function(i) {
9394     jQuery(this).wrapAll( html.call(this, i) );
9395     });
9396     }
9397    
9398     if ( this[0] ) {
9399     // The elements to wrap the target around
9400     var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
9401    
9402     if ( this[0].parentNode ) {
9403     wrap.insertBefore( this[0] );
9404     }
9405    
9406     wrap.map(function() {
9407     var elem = this;
9408    
9409     while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
9410     elem = elem.firstChild;
9411     }
9412    
9413     return elem;
9414     }).append( this );
9415     }
9416    
9417     return this;
9418     },
9419    
9420     wrapInner: function( html ) {
9421     if ( jQuery.isFunction( html ) ) {
9422     return this.each(function(i) {
9423     jQuery(this).wrapInner( html.call(this, i) );
9424     });
9425     }
9426    
9427     return this.each(function() {
9428     var self = jQuery( this ),
9429     contents = self.contents();
9430    
9431     if ( contents.length ) {
9432     contents.wrapAll( html );
9433    
9434     } else {
9435     self.append( html );
9436     }
9437     });
9438     },
9439    
9440     wrap: function( html ) {
9441     var isFunction = jQuery.isFunction( html );
9442    
9443     return this.each(function(i) {
9444     jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
9445     });
9446     },
9447    
9448     unwrap: function() {
9449     return this.parent().each(function() {
9450     if ( !jQuery.nodeName( this, "body" ) ) {
9451     jQuery( this ).replaceWith( this.childNodes );
9452     }
9453     }).end();
9454     }
9455     });
9456    
9457    
9458     jQuery.expr.filters.hidden = function( elem ) {
9459     // Support: Opera <= 12.12
9460     // Opera reports offsetWidths and offsetHeights less than zero on some elements
9461     return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
9462     (!support.reliableHiddenOffsets() &&
9463     ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
9464     };
9465    
9466     jQuery.expr.filters.visible = function( elem ) {
9467     return !jQuery.expr.filters.hidden( elem );
9468     };
9469    
9470    
9471    
9472    
9473     var r20 = /%20/g,
9474     rbracket = /\[\]$/,
9475     rCRLF = /\r?\n/g,
9476     rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
9477     rsubmittable = /^(?:input|select|textarea|keygen)/i;
9478    
9479     function buildParams( prefix, obj, traditional, add ) {
9480     var name;
9481    
9482     if ( jQuery.isArray( obj ) ) {
9483     // Serialize array item.
9484     jQuery.each( obj, function( i, v ) {
9485     if ( traditional || rbracket.test( prefix ) ) {
9486     // Treat each array item as a scalar.
9487     add( prefix, v );
9488    
9489     } else {
9490     // Item is non-scalar (array or object), encode its numeric index.
9491     buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
9492     }
9493     });
9494    
9495     } else if ( !traditional && jQuery.type( obj ) === "object" ) {
9496     // Serialize object item.
9497     for ( name in obj ) {
9498     buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
9499     }
9500    
9501     } else {
9502     // Serialize scalar item.
9503     add( prefix, obj );
9504     }
9505     }
9506    
9507     // Serialize an array of form elements or a set of
9508     // key/values into a query string
9509     jQuery.param = function( a, traditional ) {
9510     var prefix,
9511     s = [],
9512     add = function( key, value ) {
9513     // If value is a function, invoke it and return its value
9514     value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
9515     s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
9516     };
9517    
9518     // Set traditional to true for jQuery <= 1.3.2 behavior.
9519     if ( traditional === undefined ) {
9520     traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9521     }
9522    
9523     // If an array was passed in, assume that it is an array of form elements.
9524     if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9525     // Serialize the form elements
9526     jQuery.each( a, function() {
9527     add( this.name, this.value );
9528     });
9529    
9530     } else {
9531     // If traditional, encode the "old" way (the way 1.3.2 or older
9532     // did it), otherwise encode params recursively.
9533     for ( prefix in a ) {
9534     buildParams( prefix, a[ prefix ], traditional, add );
9535     }
9536     }
9537    
9538     // Return the resulting serialization
9539     return s.join( "&" ).replace( r20, "+" );
9540     };
9541    
9542     jQuery.fn.extend({
9543     serialize: function() {
9544     return jQuery.param( this.serializeArray() );
9545     },
9546     serializeArray: function() {
9547     return this.map(function() {
9548     // Can add propHook for "elements" to filter or add form elements
9549     var elements = jQuery.prop( this, "elements" );
9550     return elements ? jQuery.makeArray( elements ) : this;
9551     })
9552     .filter(function() {
9553     var type = this.type;
9554     // Use .is(":disabled") so that fieldset[disabled] works
9555     return this.name && !jQuery( this ).is( ":disabled" ) &&
9556     rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9557     ( this.checked || !rcheckableType.test( type ) );
9558     })
9559     .map(function( i, elem ) {
9560     var val = jQuery( this ).val();
9561    
9562     return val == null ?
9563     null :
9564     jQuery.isArray( val ) ?
9565     jQuery.map( val, function( val ) {
9566     return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9567     }) :
9568     { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9569     }).get();
9570     }
9571     });
9572    
9573    
9574     // Create the request object
9575     // (This is still attached to ajaxSettings for backward compatibility)
9576     jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
9577     // Support: IE6+
9578     function() {
9579    
9580     // XHR cannot access local files, always use ActiveX for that case
9581     return !this.isLocal &&
9582    
9583     // Support: IE7-8
9584     // oldIE XHR does not support non-RFC2616 methods (#13240)
9585     // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
9586     // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
9587     // Although this check for six methods instead of eight
9588     // since IE also does not support "trace" and "connect"
9589     /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
9590    
9591     createStandardXHR() || createActiveXHR();
9592     } :
9593     // For all other browsers, use the standard XMLHttpRequest object
9594     createStandardXHR;
9595    
9596     var xhrId = 0,
9597     xhrCallbacks = {},
9598     xhrSupported = jQuery.ajaxSettings.xhr();
9599    
9600     // Support: IE<10
9601     // Open requests must be manually aborted on unload (#5280)
9602     // See https://support.microsoft.com/kb/2856746 for more info
9603     if ( window.attachEvent ) {
9604     window.attachEvent( "onunload", function() {
9605     for ( var key in xhrCallbacks ) {
9606     xhrCallbacks[ key ]( undefined, true );
9607     }
9608     });
9609     }
9610    
9611     // Determine support properties
9612     support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9613     xhrSupported = support.ajax = !!xhrSupported;
9614    
9615     // Create transport if the browser can provide an xhr
9616     if ( xhrSupported ) {
9617    
9618     jQuery.ajaxTransport(function( options ) {
9619     // Cross domain only allowed if supported through XMLHttpRequest
9620     if ( !options.crossDomain || support.cors ) {
9621    
9622     var callback;
9623    
9624     return {
9625     send: function( headers, complete ) {
9626     var i,
9627     xhr = options.xhr(),
9628     id = ++xhrId;
9629    
9630     // Open the socket
9631     xhr.open( options.type, options.url, options.async, options.username, options.password );
9632    
9633     // Apply custom fields if provided
9634     if ( options.xhrFields ) {
9635     for ( i in options.xhrFields ) {
9636     xhr[ i ] = options.xhrFields[ i ];
9637     }
9638     }
9639    
9640     // Override mime type if needed
9641     if ( options.mimeType && xhr.overrideMimeType ) {
9642     xhr.overrideMimeType( options.mimeType );
9643     }
9644    
9645     // X-Requested-With header
9646     // For cross-domain requests, seeing as conditions for a preflight are
9647     // akin to a jigsaw puzzle, we simply never set it to be sure.
9648     // (it can always be set on a per-request basis or even using ajaxSetup)
9649     // For same-domain requests, won't change header if already provided.
9650     if ( !options.crossDomain && !headers["X-Requested-With"] ) {
9651     headers["X-Requested-With"] = "XMLHttpRequest";
9652     }
9653    
9654     // Set headers
9655     for ( i in headers ) {
9656     // Support: IE<9
9657     // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
9658     // request header to a null-value.
9659     //
9660     // To keep consistent with other XHR implementations, cast the value
9661     // to string and ignore `undefined`.
9662     if ( headers[ i ] !== undefined ) {
9663     xhr.setRequestHeader( i, headers[ i ] + "" );
9664     }
9665     }
9666    
9667     // Do send the request
9668     // This may raise an exception which is actually
9669     // handled in jQuery.ajax (so no try/catch here)
9670     xhr.send( ( options.hasContent && options.data ) || null );
9671    
9672     // Listener
9673     callback = function( _, isAbort ) {
9674     var status, statusText, responses;
9675    
9676     // Was never called and is aborted or complete
9677     if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
9678     // Clean up
9679     delete xhrCallbacks[ id ];
9680     callback = undefined;
9681     xhr.onreadystatechange = jQuery.noop;
9682    
9683     // Abort manually if needed
9684     if ( isAbort ) {
9685     if ( xhr.readyState !== 4 ) {
9686     xhr.abort();
9687     }
9688     } else {
9689     responses = {};
9690     status = xhr.status;
9691    
9692     // Support: IE<10
9693     // Accessing binary-data responseText throws an exception
9694     // (#11426)
9695     if ( typeof xhr.responseText === "string" ) {
9696     responses.text = xhr.responseText;
9697     }
9698    
9699     // Firefox throws an exception when accessing
9700     // statusText for faulty cross-domain requests
9701     try {
9702     statusText = xhr.statusText;
9703     } catch( e ) {
9704     // We normalize with Webkit giving an empty statusText
9705     statusText = "";
9706     }
9707    
9708     // Filter status for non standard behaviors
9709    
9710     // If the request is local and we have data: assume a success
9711     // (success with no data won't get notified, that's the best we
9712     // can do given current implementations)
9713     if ( !status && options.isLocal && !options.crossDomain ) {
9714     status = responses.text ? 200 : 404;
9715     // IE - #1450: sometimes returns 1223 when it should be 204
9716     } else if ( status === 1223 ) {
9717     status = 204;
9718     }
9719     }
9720     }
9721    
9722     // Call complete if needed
9723     if ( responses ) {
9724     complete( status, statusText, responses, xhr.getAllResponseHeaders() );
9725     }
9726     };
9727    
9728     if ( !options.async ) {
9729     // if we're in sync mode we fire the callback
9730     callback();
9731     } else if ( xhr.readyState === 4 ) {
9732     // (IE6 & IE7) if it's in cache and has been
9733     // retrieved directly we need to fire the callback
9734     setTimeout( callback );
9735     } else {
9736     // Add to the list of active xhr callbacks
9737     xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
9738     }
9739     },
9740    
9741     abort: function() {
9742     if ( callback ) {
9743     callback( undefined, true );
9744     }
9745     }
9746     };
9747     }
9748     });
9749     }
9750    
9751     // Functions to create xhrs
9752     function createStandardXHR() {
9753     try {
9754     return new window.XMLHttpRequest();
9755     } catch( e ) {}
9756     }
9757    
9758     function createActiveXHR() {
9759     try {
9760     return new window.ActiveXObject( "Microsoft.XMLHTTP" );
9761     } catch( e ) {}
9762     }
9763    
9764    
9765    
9766    
9767     // Install script dataType
9768     jQuery.ajaxSetup({
9769     accepts: {
9770     script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
9771     },
9772     contents: {
9773     script: /(?:java|ecma)script/
9774     },
9775     converters: {
9776     "text script": function( text ) {
9777     jQuery.globalEval( text );
9778     return text;
9779     }
9780     }
9781     });
9782    
9783     // Handle cache's special case and global
9784     jQuery.ajaxPrefilter( "script", function( s ) {
9785     if ( s.cache === undefined ) {
9786     s.cache = false;
9787     }
9788     if ( s.crossDomain ) {
9789     s.type = "GET";
9790     s.global = false;
9791     }
9792     });
9793    
9794     // Bind script tag hack transport
9795     jQuery.ajaxTransport( "script", function(s) {
9796    
9797     // This transport only deals with cross domain requests
9798     if ( s.crossDomain ) {
9799    
9800     var script,
9801     head = document.head || jQuery("head")[0] || document.documentElement;
9802    
9803     return {
9804    
9805     send: function( _, callback ) {
9806    
9807     script = document.createElement("script");
9808    
9809     script.async = true;
9810    
9811     if ( s.scriptCharset ) {
9812     script.charset = s.scriptCharset;
9813     }
9814    
9815     script.src = s.url;
9816    
9817     // Attach handlers for all browsers
9818     script.onload = script.onreadystatechange = function( _, isAbort ) {
9819    
9820     if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
9821    
9822     // Handle memory leak in IE
9823     script.onload = script.onreadystatechange = null;
9824    
9825     // Remove the script
9826     if ( script.parentNode ) {
9827     script.parentNode.removeChild( script );
9828     }
9829    
9830     // Dereference the script
9831     script = null;
9832    
9833     // Callback if not abort
9834     if ( !isAbort ) {
9835     callback( 200, "success" );
9836     }
9837     }
9838     };
9839    
9840     // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
9841     // Use native DOM manipulation to avoid our domManip AJAX trickery
9842     head.insertBefore( script, head.firstChild );
9843     },
9844    
9845     abort: function() {
9846     if ( script ) {
9847     script.onload( undefined, true );
9848     }
9849     }
9850     };
9851     }
9852     });
9853    
9854    
9855    
9856    
9857     var oldCallbacks = [],
9858     rjsonp = /(=)\?(?=&|$)|\?\?/;
9859    
9860     // Default jsonp settings
9861     jQuery.ajaxSetup({
9862     jsonp: "callback",
9863     jsonpCallback: function() {
9864     var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9865     this[ callback ] = true;
9866     return callback;
9867     }
9868     });
9869    
9870     // Detect, normalize options and install callbacks for jsonp requests
9871     jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9872    
9873     var callbackName, overwritten, responseContainer,
9874     jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9875     "url" :
9876     typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
9877     );
9878    
9879     // Handle iff the expected data type is "jsonp" or we have a parameter to set
9880     if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9881    
9882     // Get callback name, remembering preexisting value associated with it
9883     callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9884     s.jsonpCallback() :
9885     s.jsonpCallback;
9886    
9887     // Insert callback into url or form data
9888     if ( jsonProp ) {
9889     s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9890     } else if ( s.jsonp !== false ) {
9891     s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9892     }
9893    
9894     // Use data converter to retrieve json after script execution
9895     s.converters["script json"] = function() {
9896     if ( !responseContainer ) {
9897     jQuery.error( callbackName + " was not called" );
9898     }
9899     return responseContainer[ 0 ];
9900     };
9901    
9902     // force json dataType
9903     s.dataTypes[ 0 ] = "json";
9904    
9905     // Install callback
9906     overwritten = window[ callbackName ];
9907     window[ callbackName ] = function() {
9908     responseContainer = arguments;
9909     };
9910    
9911     // Clean-up function (fires after converters)
9912     jqXHR.always(function() {
9913     // Restore preexisting value
9914     window[ callbackName ] = overwritten;
9915    
9916     // Save back as free
9917     if ( s[ callbackName ] ) {
9918     // make sure that re-using the options doesn't screw things around
9919     s.jsonpCallback = originalSettings.jsonpCallback;
9920    
9921     // save the callback name for future use
9922     oldCallbacks.push( callbackName );
9923     }
9924    
9925     // Call if it was a function and we have a response
9926     if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9927     overwritten( responseContainer[ 0 ] );
9928     }
9929    
9930     responseContainer = overwritten = undefined;
9931     });
9932    
9933     // Delegate to script
9934     return "script";
9935     }
9936     });
9937    
9938    
9939    
9940    
9941     // data: string of html
9942     // context (optional): If specified, the fragment will be created in this context, defaults to document
9943     // keepScripts (optional): If true, will include scripts passed in the html string
9944     jQuery.parseHTML = function( data, context, keepScripts ) {
9945     if ( !data || typeof data !== "string" ) {
9946     return null;
9947     }
9948     if ( typeof context === "boolean" ) {
9949     keepScripts = context;
9950     context = false;
9951     }
9952     context = context || document;
9953    
9954     var parsed = rsingleTag.exec( data ),
9955     scripts = !keepScripts && [];
9956    
9957     // Single tag
9958     if ( parsed ) {
9959     return [ context.createElement( parsed[1] ) ];
9960     }
9961    
9962     parsed = jQuery.buildFragment( [ data ], context, scripts );
9963    
9964     if ( scripts && scripts.length ) {
9965     jQuery( scripts ).remove();
9966     }
9967    
9968     return jQuery.merge( [], parsed.childNodes );
9969     };
9970    
9971    
9972     // Keep a copy of the old load method
9973     var _load = jQuery.fn.load;
9974    
9975     /**
9976     * Load a url into a page
9977     */
9978     jQuery.fn.load = function( url, params, callback ) {
9979     if ( typeof url !== "string" && _load ) {
9980     return _load.apply( this, arguments );
9981     }
9982    
9983     var selector, response, type,
9984     self = this,
9985     off = url.indexOf(" ");
9986    
9987     if ( off >= 0 ) {
9988     selector = jQuery.trim( url.slice( off, url.length ) );
9989     url = url.slice( 0, off );
9990     }
9991    
9992     // If it's a function
9993     if ( jQuery.isFunction( params ) ) {
9994    
9995     // We assume that it's the callback
9996     callback = params;
9997     params = undefined;
9998    
9999     // Otherwise, build a param string
10000     } else if ( params && typeof params === "object" ) {
10001     type = "POST";
10002     }
10003    
10004     // If we have elements to modify, make the request
10005     if ( self.length > 0 ) {
10006     jQuery.ajax({
10007     url: url,
10008    
10009     // if "type" variable is undefined, then "GET" method will be used
10010     type: type,
10011     dataType: "html",
10012     data: params
10013     }).done(function( responseText ) {
10014    
10015     // Save response for use in complete callback
10016     response = arguments;
10017    
10018     self.html( selector ?
10019    
10020     // If a selector was specified, locate the right elements in a dummy div
10021     // Exclude scripts to avoid IE 'Permission Denied' errors
10022     jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
10023    
10024     // Otherwise use the full result
10025     responseText );
10026    
10027     }).complete( callback && function( jqXHR, status ) {
10028     self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
10029     });
10030     }
10031    
10032     return this;
10033     };
10034    
10035    
10036    
10037    
10038     // Attach a bunch of functions for handling common AJAX events
10039     jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
10040     jQuery.fn[ type ] = function( fn ) {
10041     return this.on( type, fn );
10042     };
10043     });
10044    
10045    
10046    
10047    
10048     jQuery.expr.filters.animated = function( elem ) {
10049     return jQuery.grep(jQuery.timers, function( fn ) {
10050     return elem === fn.elem;
10051     }).length;
10052     };
10053    
10054    
10055    
10056    
10057    
10058     var docElem = window.document.documentElement;
10059    
10060     /**
10061     * Gets a window from an element
10062     */
10063     function getWindow( elem ) {
10064     return jQuery.isWindow( elem ) ?
10065     elem :
10066     elem.nodeType === 9 ?
10067     elem.defaultView || elem.parentWindow :
10068     false;
10069     }
10070    
10071     jQuery.offset = {
10072     setOffset: function( elem, options, i ) {
10073     var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10074     position = jQuery.css( elem, "position" ),
10075     curElem = jQuery( elem ),
10076     props = {};
10077    
10078     // set position first, in-case top/left are set even on static elem
10079     if ( position === "static" ) {
10080     elem.style.position = "relative";
10081     }
10082    
10083     curOffset = curElem.offset();
10084     curCSSTop = jQuery.css( elem, "top" );
10085     curCSSLeft = jQuery.css( elem, "left" );
10086     calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10087     jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
10088    
10089     // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
10090     if ( calculatePosition ) {
10091     curPosition = curElem.position();
10092     curTop = curPosition.top;
10093     curLeft = curPosition.left;
10094     } else {
10095     curTop = parseFloat( curCSSTop ) || 0;
10096     curLeft = parseFloat( curCSSLeft ) || 0;
10097     }
10098    
10099     if ( jQuery.isFunction( options ) ) {
10100     options = options.call( elem, i, curOffset );
10101     }
10102    
10103     if ( options.top != null ) {
10104     props.top = ( options.top - curOffset.top ) + curTop;
10105     }
10106     if ( options.left != null ) {
10107     props.left = ( options.left - curOffset.left ) + curLeft;
10108     }
10109    
10110     if ( "using" in options ) {
10111     options.using.call( elem, props );
10112     } else {
10113     curElem.css( props );
10114     }
10115     }
10116     };
10117    
10118     jQuery.fn.extend({
10119     offset: function( options ) {
10120     if ( arguments.length ) {
10121     return options === undefined ?
10122     this :
10123     this.each(function( i ) {
10124     jQuery.offset.setOffset( this, options, i );
10125     });
10126     }
10127    
10128     var docElem, win,
10129     box = { top: 0, left: 0 },
10130     elem = this[ 0 ],
10131     doc = elem && elem.ownerDocument;
10132    
10133     if ( !doc ) {
10134     return;
10135     }
10136    
10137     docElem = doc.documentElement;
10138    
10139     // Make sure it's not a disconnected DOM node
10140     if ( !jQuery.contains( docElem, elem ) ) {
10141     return box;
10142     }
10143    
10144     // If we don't have gBCR, just use 0,0 rather than error
10145     // BlackBerry 5, iOS 3 (original iPhone)
10146     if ( typeof elem.getBoundingClientRect !== strundefined ) {
10147     box = elem.getBoundingClientRect();
10148     }
10149     win = getWindow( doc );
10150     return {
10151     top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
10152     left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10153     };
10154     },
10155    
10156     position: function() {
10157     if ( !this[ 0 ] ) {
10158     return;
10159     }
10160    
10161     var offsetParent, offset,
10162     parentOffset = { top: 0, left: 0 },
10163     elem = this[ 0 ];
10164    
10165     // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
10166     if ( jQuery.css( elem, "position" ) === "fixed" ) {
10167     // we assume that getBoundingClientRect is available when computed position is fixed
10168     offset = elem.getBoundingClientRect();
10169     } else {
10170     // Get *real* offsetParent
10171     offsetParent = this.offsetParent();
10172    
10173     // Get correct offsets
10174     offset = this.offset();
10175     if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10176     parentOffset = offsetParent.offset();
10177     }
10178    
10179     // Add offsetParent borders
10180     parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
10181     parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
10182     }
10183    
10184     // Subtract parent offsets and element margins
10185     // note: when an element has margin: auto the offsetLeft and marginLeft
10186     // are the same in Safari causing offset.left to incorrectly be 0
10187     return {
10188     top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10189     left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
10190     };
10191     },
10192    
10193     offsetParent: function() {
10194     return this.map(function() {
10195     var offsetParent = this.offsetParent || docElem;
10196    
10197     while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
10198     offsetParent = offsetParent.offsetParent;
10199     }
10200     return offsetParent || docElem;
10201     });
10202     }
10203     });
10204    
10205     // Create scrollLeft and scrollTop methods
10206     jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10207     var top = /Y/.test( prop );
10208    
10209     jQuery.fn[ method ] = function( val ) {
10210     return access( this, function( elem, method, val ) {
10211     var win = getWindow( elem );
10212    
10213     if ( val === undefined ) {
10214     return win ? (prop in win) ? win[ prop ] :
10215     win.document.documentElement[ method ] :
10216     elem[ method ];
10217     }
10218    
10219     if ( win ) {
10220     win.scrollTo(
10221     !top ? val : jQuery( win ).scrollLeft(),
10222     top ? val : jQuery( win ).scrollTop()
10223     );
10224    
10225     } else {
10226     elem[ method ] = val;
10227     }
10228     }, method, val, arguments.length, null );
10229     };
10230     });
10231    
10232     // Add the top/left cssHooks using jQuery.fn.position
10233     // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10234     // getComputedStyle returns percent when specified for top/left/bottom/right
10235     // rather than make the css module depend on the offset module, we just check for it here
10236     jQuery.each( [ "top", "left" ], function( i, prop ) {
10237     jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10238     function( elem, computed ) {
10239     if ( computed ) {
10240     computed = curCSS( elem, prop );
10241     // if curCSS returns percentage, fallback to offset
10242     return rnumnonpx.test( computed ) ?
10243     jQuery( elem ).position()[ prop ] + "px" :
10244     computed;
10245     }
10246     }
10247     );
10248     });
10249    
10250    
10251     // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10252     jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10253     jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
10254     // margin is only for outerHeight, outerWidth
10255     jQuery.fn[ funcName ] = function( margin, value ) {
10256     var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10257     extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10258    
10259     return access( this, function( elem, type, value ) {
10260     var doc;
10261    
10262     if ( jQuery.isWindow( elem ) ) {
10263     // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10264     // isn't a whole lot we can do. See pull request at this URL for discussion:
10265     // https://github.com/jquery/jquery/pull/764
10266     return elem.document.documentElement[ "client" + name ];
10267     }
10268    
10269     // Get document width or height
10270     if ( elem.nodeType === 9 ) {
10271     doc = elem.documentElement;
10272    
10273     // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
10274     // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
10275     return Math.max(
10276     elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10277     elem.body[ "offset" + name ], doc[ "offset" + name ],
10278     doc[ "client" + name ]
10279     );
10280     }
10281    
10282     return value === undefined ?
10283     // Get width or height on the element, requesting but not forcing parseFloat
10284     jQuery.css( elem, type, extra ) :
10285    
10286     // Set width or height on the element
10287     jQuery.style( elem, type, value, extra );
10288     }, type, chainable ? margin : undefined, chainable, null );
10289     };
10290     });
10291     });
10292    
10293    
10294     // The number of elements contained in the matched element set
10295     jQuery.fn.size = function() {
10296     return this.length;
10297     };
10298    
10299     jQuery.fn.andSelf = jQuery.fn.addBack;
10300    
10301    
10302    
10303    
10304     // Register as a named AMD module, since jQuery can be concatenated with other
10305     // files that may use define, but not via a proper concatenation script that
10306     // understands anonymous AMD modules. A named AMD is safest and most robust
10307     // way to register. Lowercase jquery is used because AMD module names are
10308     // derived from file names, and jQuery is normally delivered in a lowercase
10309     // file name. Do this after creating the global so that if an AMD module wants
10310     // to call noConflict to hide this version of jQuery, it will work.
10311    
10312     // Note that for maximum portability, libraries that are not jQuery should
10313     // declare themselves as anonymous modules, and avoid setting a global if an
10314     // AMD loader is present. jQuery is a special case. For more information, see
10315     // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10316    
10317     if ( typeof define === "function" && define.amd ) {
10318     define( "jquery", [], function() {
10319     return jQuery;
10320     });
10321     }
10322    
10323    
10324    
10325    
10326     var
10327     // Map over jQuery in case of overwrite
10328     _jQuery = window.jQuery,
10329    
10330     // Map over the $ in case of overwrite
10331     _$ = window.$;
10332    
10333     jQuery.noConflict = function( deep ) {
10334     if ( window.$ === jQuery ) {
10335     window.$ = _$;
10336     }
10337    
10338     if ( deep && window.jQuery === jQuery ) {
10339     window.jQuery = _jQuery;
10340     }
10341    
10342     return jQuery;
10343     };
10344    
10345     // Expose jQuery and $ identifiers, even in
10346     // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10347     // and CommonJS for browser emulators (#13566)
10348     if ( typeof noGlobal === strundefined ) {
10349     window.jQuery = window.$ = jQuery;
10350     }
10351    
10352    
10353    
10354    
10355     return jQuery;
10356    
10357     }));

  ViewVC Help
Powered by ViewVC