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