CLIENT GUI Framework
[vnfsdk/refrepo.git] / openo-portal / portal-common / src / main / webapp / common / thirdparty / jquery / jquery-1.11.2.js
1 /*!\r
2  * jQuery JavaScript Library v1.11.2\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-17T15:27Z\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 is present,\r
19                 // execute the factory and get jQuery\r
20                 // For environments that do not inherently posses a window with a document\r
21                 // (such as Node.js), expose a jQuery-making 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 // Can't do this because several apps including ASP.NET trace\r
41 // the stack via arguments.caller.callee and Firefox dies if\r
42 // you try to trace through "use strict" call chains. (#13335)\r
43 // Support: Firefox 18+\r
44 //\r
45 \r
46 var deletedIds = [];\r
47 \r
48 var slice = deletedIds.slice;\r
49 \r
50 var concat = deletedIds.concat;\r
51 \r
52 var push = deletedIds.push;\r
53 \r
54 var indexOf = deletedIds.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         version = "1.11.2",\r
68 \r
69         // Define a local copy of jQuery\r
70         jQuery = function( selector, context ) {\r
71                 // The jQuery object is actually just the init constructor 'enhanced'\r
72                 // Need init if jQuery is called (just allow error to be thrown if not included)\r
73                 return new jQuery.fn.init( selector, context );\r
74         },\r
75 \r
76         // Support: Android<4.1, IE<9\r
77         // Make sure we trim BOM and NBSP\r
78         rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,\r
79 \r
80         // Matches dashed string for camelizing\r
81         rmsPrefix = /^-ms-/,\r
82         rdashAlpha = /-([\da-z])/gi,\r
83 \r
84         // Used by jQuery.camelCase as callback to replace()\r
85         fcamelCase = function( all, letter ) {\r
86                 return letter.toUpperCase();\r
87         };\r
88 \r
89 jQuery.fn = jQuery.prototype = {\r
90         // The current version of jQuery being used\r
91         jquery: version,\r
92 \r
93         constructor: jQuery,\r
94 \r
95         // Start with an empty selector\r
96         selector: "",\r
97 \r
98         // The default length of a jQuery object is 0\r
99         length: 0,\r
100 \r
101         toArray: function() {\r
102                 return slice.call( this );\r
103         },\r
104 \r
105         // Get the Nth element in the matched element set OR\r
106         // Get the whole matched element set as a clean array\r
107         get: function( num ) {\r
108                 return num != null ?\r
109 \r
110                         // Return just the one element from the set\r
111                         ( num < 0 ? this[ num + this.length ] : this[ num ] ) :\r
112 \r
113                         // Return all the elements in a clean array\r
114                         slice.call( this );\r
115         },\r
116 \r
117         // Take an array of elements and push it onto the stack\r
118         // (returning the new matched element set)\r
119         pushStack: function( elems ) {\r
120 \r
121                 // Build a new jQuery matched element set\r
122                 var ret = jQuery.merge( this.constructor(), elems );\r
123 \r
124                 // Add the old object onto the stack (as a reference)\r
125                 ret.prevObject = this;\r
126                 ret.context = this.context;\r
127 \r
128                 // Return the newly-formed element set\r
129                 return ret;\r
130         },\r
131 \r
132         // Execute a callback for every element in the matched set.\r
133         // (You can seed the arguments with an array of args, but this is\r
134         // only used internally.)\r
135         each: function( callback, args ) {\r
136                 return jQuery.each( this, callback, args );\r
137         },\r
138 \r
139         map: function( callback ) {\r
140                 return this.pushStack( jQuery.map(this, function( elem, i ) {\r
141                         return callback.call( elem, i, elem );\r
142                 }));\r
143         },\r
144 \r
145         slice: function() {\r
146                 return this.pushStack( slice.apply( this, arguments ) );\r
147         },\r
148 \r
149         first: function() {\r
150                 return this.eq( 0 );\r
151         },\r
152 \r
153         last: function() {\r
154                 return this.eq( -1 );\r
155         },\r
156 \r
157         eq: function( i ) {\r
158                 var len = this.length,\r
159                         j = +i + ( i < 0 ? len : 0 );\r
160                 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\r
161         },\r
162 \r
163         end: function() {\r
164                 return this.prevObject || this.constructor(null);\r
165         },\r
166 \r
167         // For internal use only.\r
168         // Behaves like an Array's method, not like a jQuery method.\r
169         push: push,\r
170         sort: deletedIds.sort,\r
171         splice: deletedIds.splice\r
172 };\r
173 \r
174 jQuery.extend = jQuery.fn.extend = function() {\r
175         var src, copyIsArray, copy, name, options, clone,\r
176                 target = arguments[0] || {},\r
177                 i = 1,\r
178                 length = arguments.length,\r
179                 deep = false;\r
180 \r
181         // Handle a deep copy situation\r
182         if ( typeof target === "boolean" ) {\r
183                 deep = target;\r
184 \r
185                 // skip the boolean and the target\r
186                 target = arguments[ i ] || {};\r
187                 i++;\r
188         }\r
189 \r
190         // Handle case when target is a string or something (possible in deep copy)\r
191         if ( typeof target !== "object" && !jQuery.isFunction(target) ) {\r
192                 target = {};\r
193         }\r
194 \r
195         // extend jQuery itself if only one argument is passed\r
196         if ( i === length ) {\r
197                 target = this;\r
198                 i--;\r
199         }\r
200 \r
201         for ( ; i < length; i++ ) {\r
202                 // Only deal with non-null/undefined values\r
203                 if ( (options = arguments[ i ]) != null ) {\r
204                         // Extend the base object\r
205                         for ( name in options ) {\r
206                                 src = target[ name ];\r
207                                 copy = options[ name ];\r
208 \r
209                                 // Prevent never-ending loop\r
210                                 if ( target === copy ) {\r
211                                         continue;\r
212                                 }\r
213 \r
214                                 // Recurse if we're merging plain objects or arrays\r
215                                 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\r
216                                         if ( copyIsArray ) {\r
217                                                 copyIsArray = false;\r
218                                                 clone = src && jQuery.isArray(src) ? src : [];\r
219 \r
220                                         } else {\r
221                                                 clone = src && jQuery.isPlainObject(src) ? src : {};\r
222                                         }\r
223 \r
224                                         // Never move original objects, clone them\r
225                                         target[ name ] = jQuery.extend( deep, clone, copy );\r
226 \r
227                                 // Don't bring in undefined values\r
228                                 } else if ( copy !== undefined ) {\r
229                                         target[ name ] = copy;\r
230                                 }\r
231                         }\r
232                 }\r
233         }\r
234 \r
235         // Return the modified object\r
236         return target;\r
237 };\r
238 \r
239 jQuery.extend({\r
240         // Unique for each copy of jQuery on the page\r
241         expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),\r
242 \r
243         // Assume jQuery is ready without the ready module\r
244         isReady: true,\r
245 \r
246         error: function( msg ) {\r
247                 throw new Error( msg );\r
248         },\r
249 \r
250         noop: function() {},\r
251 \r
252         // See test/unit/core.js for details concerning isFunction.\r
253         // Since version 1.3, DOM methods and functions like alert\r
254         // aren't supported. They return false on IE (#2968).\r
255         isFunction: function( obj ) {\r
256                 return jQuery.type(obj) === "function";\r
257         },\r
258 \r
259         isArray: Array.isArray || function( obj ) {\r
260                 return jQuery.type(obj) === "array";\r
261         },\r
262 \r
263         isWindow: function( obj ) {\r
264                 /* jshint eqeqeq: false */\r
265                 return obj != null && obj == obj.window;\r
266         },\r
267 \r
268         isNumeric: function( obj ) {\r
269                 // parseFloat NaNs numeric-cast false positives (null|true|false|"")\r
270                 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")\r
271                 // subtraction forces infinities to NaN\r
272                 // adding 1 corrects loss of precision from parseFloat (#15100)\r
273                 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;\r
274         },\r
275 \r
276         isEmptyObject: function( obj ) {\r
277                 var name;\r
278                 for ( name in obj ) {\r
279                         return false;\r
280                 }\r
281                 return true;\r
282         },\r
283 \r
284         isPlainObject: function( obj ) {\r
285                 var key;\r
286 \r
287                 // Must be an Object.\r
288                 // Because of IE, we also have to check the presence of the constructor property.\r
289                 // Make sure that DOM nodes and window objects don't pass through, as well\r
290                 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {\r
291                         return false;\r
292                 }\r
293 \r
294                 try {\r
295                         // Not own constructor property must be Object\r
296                         if ( obj.constructor &&\r
297                                 !hasOwn.call(obj, "constructor") &&\r
298                                 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {\r
299                                 return false;\r
300                         }\r
301                 } catch ( e ) {\r
302                         // IE8,9 Will throw exceptions on certain host objects #9897\r
303                         return false;\r
304                 }\r
305 \r
306                 // Support: IE<9\r
307                 // Handle iteration over inherited properties before own properties.\r
308                 if ( support.ownLast ) {\r
309                         for ( key in obj ) {\r
310                                 return hasOwn.call( obj, key );\r
311                         }\r
312                 }\r
313 \r
314                 // Own properties are enumerated firstly, so to speed up,\r
315                 // if last one is own, then all properties are own.\r
316                 for ( key in obj ) {}\r
317 \r
318                 return key === undefined || hasOwn.call( obj, key );\r
319         },\r
320 \r
321         type: function( obj ) {\r
322                 if ( obj == null ) {\r
323                         return obj + "";\r
324                 }\r
325                 return typeof obj === "object" || typeof obj === "function" ?\r
326                         class2type[ toString.call(obj) ] || "object" :\r
327                         typeof obj;\r
328         },\r
329 \r
330         // Evaluates a script in a global context\r
331         // Workarounds based on findings by Jim Driscoll\r
332         // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context\r
333         globalEval: function( data ) {\r
334                 if ( data && jQuery.trim( data ) ) {\r
335                         // We use execScript on Internet Explorer\r
336                         // We use an anonymous function so that context is window\r
337                         // rather than jQuery in Firefox\r
338                         ( window.execScript || function( data ) {\r
339                                 window[ "eval" ].call( window, data );\r
340                         } )( data );\r
341                 }\r
342         },\r
343 \r
344         // Convert dashed to camelCase; used by the css and data modules\r
345         // Microsoft forgot to hump their vendor prefix (#9572)\r
346         camelCase: function( string ) {\r
347                 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );\r
348         },\r
349 \r
350         nodeName: function( elem, name ) {\r
351                 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\r
352         },\r
353 \r
354         // args is for internal usage only\r
355         each: function( obj, callback, args ) {\r
356                 var value,\r
357                         i = 0,\r
358                         length = obj.length,\r
359                         isArray = isArraylike( obj );\r
360 \r
361                 if ( args ) {\r
362                         if ( isArray ) {\r
363                                 for ( ; i < length; i++ ) {\r
364                                         value = callback.apply( obj[ i ], args );\r
365 \r
366                                         if ( value === false ) {\r
367                                                 break;\r
368                                         }\r
369                                 }\r
370                         } else {\r
371                                 for ( i in obj ) {\r
372                                         value = callback.apply( obj[ i ], args );\r
373 \r
374                                         if ( value === false ) {\r
375                                                 break;\r
376                                         }\r
377                                 }\r
378                         }\r
379 \r
380                 // A special, fast, case for the most common use of each\r
381                 } else {\r
382                         if ( isArray ) {\r
383                                 for ( ; i < length; i++ ) {\r
384                                         value = callback.call( obj[ i ], i, obj[ i ] );\r
385 \r
386                                         if ( value === false ) {\r
387                                                 break;\r
388                                         }\r
389                                 }\r
390                         } else {\r
391                                 for ( i in obj ) {\r
392                                         value = callback.call( obj[ i ], i, obj[ i ] );\r
393 \r
394                                         if ( value === false ) {\r
395                                                 break;\r
396                                         }\r
397                                 }\r
398                         }\r
399                 }\r
400 \r
401                 return obj;\r
402         },\r
403 \r
404         // Support: Android<4.1, IE<9\r
405         trim: function( text ) {\r
406                 return text == null ?\r
407                         "" :\r
408                         ( text + "" ).replace( rtrim, "" );\r
409         },\r
410 \r
411         // results is for internal usage only\r
412         makeArray: function( arr, results ) {\r
413                 var ret = results || [];\r
414 \r
415                 if ( arr != null ) {\r
416                         if ( isArraylike( Object(arr) ) ) {\r
417                                 jQuery.merge( ret,\r
418                                         typeof arr === "string" ?\r
419                                         [ arr ] : arr\r
420                                 );\r
421                         } else {\r
422                                 push.call( ret, arr );\r
423                         }\r
424                 }\r
425 \r
426                 return ret;\r
427         },\r
428 \r
429         inArray: function( elem, arr, i ) {\r
430                 var len;\r
431 \r
432                 if ( arr ) {\r
433                         if ( indexOf ) {\r
434                                 return indexOf.call( arr, elem, i );\r
435                         }\r
436 \r
437                         len = arr.length;\r
438                         i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;\r
439 \r
440                         for ( ; i < len; i++ ) {\r
441                                 // Skip accessing in sparse arrays\r
442                                 if ( i in arr && arr[ i ] === elem ) {\r
443                                         return i;\r
444                                 }\r
445                         }\r
446                 }\r
447 \r
448                 return -1;\r
449         },\r
450 \r
451         merge: function( first, second ) {\r
452                 var len = +second.length,\r
453                         j = 0,\r
454                         i = first.length;\r
455 \r
456                 while ( j < len ) {\r
457                         first[ i++ ] = second[ j++ ];\r
458                 }\r
459 \r
460                 // Support: IE<9\r
461                 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)\r
462                 if ( len !== len ) {\r
463                         while ( second[j] !== undefined ) {\r
464                                 first[ i++ ] = second[ j++ ];\r
465                         }\r
466                 }\r
467 \r
468                 first.length = i;\r
469 \r
470                 return first;\r
471         },\r
472 \r
473         grep: function( elems, callback, invert ) {\r
474                 var callbackInverse,\r
475                         matches = [],\r
476                         i = 0,\r
477                         length = elems.length,\r
478                         callbackExpect = !invert;\r
479 \r
480                 // Go through the array, only saving the items\r
481                 // that pass the validator function\r
482                 for ( ; i < length; i++ ) {\r
483                         callbackInverse = !callback( elems[ i ], i );\r
484                         if ( callbackInverse !== callbackExpect ) {\r
485                                 matches.push( elems[ i ] );\r
486                         }\r
487                 }\r
488 \r
489                 return matches;\r
490         },\r
491 \r
492         // arg is for internal usage only\r
493         map: function( elems, callback, arg ) {\r
494                 var value,\r
495                         i = 0,\r
496                         length = elems.length,\r
497                         isArray = isArraylike( elems ),\r
498                         ret = [];\r
499 \r
500                 // Go through the array, translating each of the items to their new values\r
501                 if ( isArray ) {\r
502                         for ( ; i < length; i++ ) {\r
503                                 value = callback( elems[ i ], i, arg );\r
504 \r
505                                 if ( value != null ) {\r
506                                         ret.push( value );\r
507                                 }\r
508                         }\r
509 \r
510                 // Go through every key on the object,\r
511                 } else {\r
512                         for ( i in elems ) {\r
513                                 value = callback( elems[ i ], i, arg );\r
514 \r
515                                 if ( value != null ) {\r
516                                         ret.push( value );\r
517                                 }\r
518                         }\r
519                 }\r
520 \r
521                 // Flatten any nested arrays\r
522                 return concat.apply( [], ret );\r
523         },\r
524 \r
525         // A global GUID counter for objects\r
526         guid: 1,\r
527 \r
528         // Bind a function to a context, optionally partially applying any\r
529         // arguments.\r
530         proxy: function( fn, context ) {\r
531                 var args, proxy, tmp;\r
532 \r
533                 if ( typeof context === "string" ) {\r
534                         tmp = fn[ context ];\r
535                         context = fn;\r
536                         fn = tmp;\r
537                 }\r
538 \r
539                 // Quick check to determine if target is callable, in the spec\r
540                 // this throws a TypeError, but we will just return undefined.\r
541                 if ( !jQuery.isFunction( fn ) ) {\r
542                         return undefined;\r
543                 }\r
544 \r
545                 // Simulated bind\r
546                 args = slice.call( arguments, 2 );\r
547                 proxy = function() {\r
548                         return fn.apply( context || this, args.concat( slice.call( arguments ) ) );\r
549                 };\r
550 \r
551                 // Set the guid of unique handler to the same of original handler, so it can be removed\r
552                 proxy.guid = fn.guid = fn.guid || jQuery.guid++;\r
553 \r
554                 return proxy;\r
555         },\r
556 \r
557         now: function() {\r
558                 return +( new Date() );\r
559         },\r
560 \r
561         // jQuery.support is not used in Core but other projects attach their\r
562         // properties to it so it needs to exist.\r
563         support: support\r
564 });\r
565 \r
566 // Populate the class2type map\r
567 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {\r
568         class2type[ "[object " + name + "]" ] = name.toLowerCase();\r
569 });\r
570 \r
571 function isArraylike( obj ) {\r
572         var length = obj.length,\r
573                 type = jQuery.type( obj );\r
574 \r
575         if ( type === "function" || jQuery.isWindow( obj ) ) {\r
576                 return false;\r
577         }\r
578 \r
579         if ( obj.nodeType === 1 && length ) {\r
580                 return true;\r
581         }\r
582 \r
583         return type === "array" || length === 0 ||\r
584                 typeof length === "number" && length > 0 && ( length - 1 ) in obj;\r
585 }\r
586 var Sizzle =\r
587 /*!\r
588  * Sizzle CSS Selector Engine v2.2.0-pre\r
589  * http://sizzlejs.com/\r
590  *\r
591  * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors\r
592  * Released under the MIT license\r
593  * http://jquery.org/license\r
594  *\r
595  * Date: 2014-12-16\r
596  */\r
597 (function( window ) {\r
598 \r
599 var i,\r
600         support,\r
601         Expr,\r
602         getText,\r
603         isXML,\r
604         tokenize,\r
605         compile,\r
606         select,\r
607         outermostContext,\r
608         sortInput,\r
609         hasDuplicate,\r
610 \r
611         // Local document vars\r
612         setDocument,\r
613         document,\r
614         docElem,\r
615         documentIsHTML,\r
616         rbuggyQSA,\r
617         rbuggyMatches,\r
618         matches,\r
619         contains,\r
620 \r
621         // Instance-specific data\r
622         expando = "sizzle" + 1 * new Date(),\r
623         preferredDoc = window.document,\r
624         dirruns = 0,\r
625         done = 0,\r
626         classCache = createCache(),\r
627         tokenCache = createCache(),\r
628         compilerCache = createCache(),\r
629         sortOrder = function( a, b ) {\r
630                 if ( a === b ) {\r
631                         hasDuplicate = true;\r
632                 }\r
633                 return 0;\r
634         },\r
635 \r
636         // General-purpose constants\r
637         MAX_NEGATIVE = 1 << 31,\r
638 \r
639         // Instance methods\r
640         hasOwn = ({}).hasOwnProperty,\r
641         arr = [],\r
642         pop = arr.pop,\r
643         push_native = arr.push,\r
644         push = arr.push,\r
645         slice = arr.slice,\r
646         // Use a stripped-down indexOf as it's faster than native\r
647         // http://jsperf.com/thor-indexof-vs-for/5\r
648         indexOf = function( list, elem ) {\r
649                 var i = 0,\r
650                         len = list.length;\r
651                 for ( ; i < len; i++ ) {\r
652                         if ( list[i] === elem ) {\r
653                                 return i;\r
654                         }\r
655                 }\r
656                 return -1;\r
657         },\r
658 \r
659         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",\r
660 \r
661         // Regular expressions\r
662 \r
663         // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\r
664         whitespace = "[\\x20\\t\\r\\n\\f]",\r
665         // http://www.w3.org/TR/css3-syntax/#characters\r
666         characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",\r
667 \r
668         // Loosely modeled on CSS identifier characters\r
669         // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\r
670         // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\r
671         identifier = characterEncoding.replace( "w", "w#" ),\r
672 \r
673         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\r
674         attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +\r
675                 // Operator (capture 2)\r
676                 "*([*^$|!~]?=)" + whitespace +\r
677                 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"\r
678                 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +\r
679                 "*\\]",\r
680 \r
681         pseudos = ":(" + characterEncoding + ")(?:\\((" +\r
682                 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\r
683                 // 1. quoted (capture 3; capture 4 or capture 5)\r
684                 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +\r
685                 // 2. simple (capture 6)\r
686                 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +\r
687                 // 3. anything else (capture 2)\r
688                 ".*" +\r
689                 ")\\)|)",\r
690 \r
691         // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
692         rwhitespace = new RegExp( whitespace + "+", "g" ),\r
693         rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),\r
694 \r
695         rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\r
696         rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),\r
697 \r
698         rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),\r
699 \r
700         rpseudo = new RegExp( pseudos ),\r
701         ridentifier = new RegExp( "^" + identifier + "$" ),\r
702 \r
703         matchExpr = {\r
704                 "ID": new RegExp( "^#(" + characterEncoding + ")" ),\r
705                 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),\r
706                 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),\r
707                 "ATTR": new RegExp( "^" + attributes ),\r
708                 "PSEUDO": new RegExp( "^" + pseudos ),\r
709                 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +\r
710                         "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +\r
711                         "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
712                 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),\r
713                 // For use in libraries implementing .is()\r
714                 // We use this for POS matching in `select`\r
715                 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +\r
716                         whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )\r
717         },\r
718 \r
719         rinputs = /^(?:input|select|textarea|button)$/i,\r
720         rheader = /^h\d$/i,\r
721 \r
722         rnative = /^[^{]+\{\s*\[native \w/,\r
723 \r
724         // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
725         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,\r
726 \r
727         rsibling = /[+~]/,\r
728         rescape = /'|\\/g,\r
729 \r
730         // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\r
731         runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),\r
732         funescape = function( _, escaped, escapedWhitespace ) {\r
733                 var high = "0x" + escaped - 0x10000;\r
734                 // NaN means non-codepoint\r
735                 // Support: Firefox<24\r
736                 // Workaround erroneous numeric interpretation of +"0x"\r
737                 return high !== high || escapedWhitespace ?\r
738                         escaped :\r
739                         high < 0 ?\r
740                                 // BMP codepoint\r
741                                 String.fromCharCode( high + 0x10000 ) :\r
742                                 // Supplemental Plane codepoint (surrogate pair)\r
743                                 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\r
744         },\r
745 \r
746         // Used for iframes\r
747         // See setDocument()\r
748         // Removing the function wrapper causes a "Permission Denied"\r
749         // error in IE\r
750         unloadHandler = function() {\r
751                 setDocument();\r
752         };\r
753 \r
754 // Optimize for push.apply( _, NodeList )\r
755 try {\r
756         push.apply(\r
757                 (arr = slice.call( preferredDoc.childNodes )),\r
758                 preferredDoc.childNodes\r
759         );\r
760         // Support: Android<4.0\r
761         // Detect silently failing push.apply\r
762         arr[ preferredDoc.childNodes.length ].nodeType;\r
763 } catch ( e ) {\r
764         push = { apply: arr.length ?\r
765 \r
766                 // Leverage slice if possible\r
767                 function( target, els ) {\r
768                         push_native.apply( target, slice.call(els) );\r
769                 } :\r
770 \r
771                 // Support: IE<9\r
772                 // Otherwise append directly\r
773                 function( target, els ) {\r
774                         var j = target.length,\r
775                                 i = 0;\r
776                         // Can't trust NodeList.length\r
777                         while ( (target[j++] = els[i++]) ) {}\r
778                         target.length = j - 1;\r
779                 }\r
780         };\r
781 }\r
782 \r
783 function Sizzle( selector, context, results, seed ) {\r
784         var match, elem, m, nodeType,\r
785                 // QSA vars\r
786                 i, groups, old, nid, newContext, newSelector;\r
787 \r
788         if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\r
789                 setDocument( context );\r
790         }\r
791 \r
792         context = context || document;\r
793         results = results || [];\r
794         nodeType = context.nodeType;\r
795 \r
796         if ( typeof selector !== "string" || !selector ||\r
797                 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\r
798 \r
799                 return results;\r
800         }\r
801 \r
802         if ( !seed && documentIsHTML ) {\r
803 \r
804                 // Try to shortcut find operations when possible (e.g., not under DocumentFragment)\r
805                 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\r
806                         // Speed-up: Sizzle("#ID")\r
807                         if ( (m = match[1]) ) {\r
808                                 if ( nodeType === 9 ) {\r
809                                         elem = context.getElementById( m );\r
810                                         // Check parentNode to catch when Blackberry 4.6 returns\r
811                                         // nodes that are no longer in the document (jQuery #6963)\r
812                                         if ( elem && elem.parentNode ) {\r
813                                                 // Handle the case where IE, Opera, and Webkit return items\r
814                                                 // by name instead of ID\r
815                                                 if ( elem.id === m ) {\r
816                                                         results.push( elem );\r
817                                                         return results;\r
818                                                 }\r
819                                         } else {\r
820                                                 return results;\r
821                                         }\r
822                                 } else {\r
823                                         // Context is not a document\r
824                                         if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\r
825                                                 contains( context, elem ) && elem.id === m ) {\r
826                                                 results.push( elem );\r
827                                                 return results;\r
828                                         }\r
829                                 }\r
830 \r
831                         // Speed-up: Sizzle("TAG")\r
832                         } else if ( match[2] ) {\r
833                                 push.apply( results, context.getElementsByTagName( selector ) );\r
834                                 return results;\r
835 \r
836                         // Speed-up: Sizzle(".CLASS")\r
837                         } else if ( (m = match[3]) && support.getElementsByClassName ) {\r
838                                 push.apply( results, context.getElementsByClassName( m ) );\r
839                                 return results;\r
840                         }\r
841                 }\r
842 \r
843                 // QSA path\r
844                 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\r
845                         nid = old = expando;\r
846                         newContext = context;\r
847                         newSelector = nodeType !== 1 && selector;\r
848 \r
849                         // qSA works strangely on Element-rooted queries\r
850                         // We can work around this by specifying an extra ID on the root\r
851                         // and working up from there (Thanks to Andrew Dupont for the technique)\r
852                         // IE 8 doesn't work on object elements\r
853                         if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
854                                 groups = tokenize( selector );\r
855 \r
856                                 if ( (old = context.getAttribute("id")) ) {\r
857                                         nid = old.replace( rescape, "\\$&" );\r
858                                 } else {\r
859                                         context.setAttribute( "id", nid );\r
860                                 }\r
861                                 nid = "[id='" + nid + "'] ";\r
862 \r
863                                 i = groups.length;\r
864                                 while ( i-- ) {\r
865                                         groups[i] = nid + toSelector( groups[i] );\r
866                                 }\r
867                                 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;\r
868                                 newSelector = groups.join(",");\r
869                         }\r
870 \r
871                         if ( newSelector ) {\r
872                                 try {\r
873                                         push.apply( results,\r
874                                                 newContext.querySelectorAll( newSelector )\r
875                                         );\r
876                                         return results;\r
877                                 } catch(qsaError) {\r
878                                 } finally {\r
879                                         if ( !old ) {\r
880                                                 context.removeAttribute("id");\r
881                                         }\r
882                                 }\r
883                         }\r
884                 }\r
885         }\r
886 \r
887         // All others\r
888         return select( selector.replace( rtrim, "$1" ), context, results, seed );\r
889 }\r
890 \r
891 /**\r
892  * Create key-value caches of limited size\r
893  * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\r
894  *      property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\r
895  *      deleting the oldest entry\r
896  */\r
897 function createCache() {\r
898         var keys = [];\r
899 \r
900         function cache( key, value ) {\r
901                 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)\r
902                 if ( keys.push( key + " " ) > Expr.cacheLength ) {\r
903                         // Only keep the most recent entries\r
904                         delete cache[ keys.shift() ];\r
905                 }\r
906                 return (cache[ key + " " ] = value);\r
907         }\r
908         return cache;\r
909 }\r
910 \r
911 /**\r
912  * Mark a function for special use by Sizzle\r
913  * @param {Function} fn The function to mark\r
914  */\r
915 function markFunction( fn ) {\r
916         fn[ expando ] = true;\r
917         return fn;\r
918 }\r
919 \r
920 /**\r
921  * Support testing using an element\r
922  * @param {Function} fn Passed the created div and expects a boolean result\r
923  */\r
924 function assert( fn ) {\r
925         var div = document.createElement("div");\r
926 \r
927         try {\r
928                 return !!fn( div );\r
929         } catch (e) {\r
930                 return false;\r
931         } finally {\r
932                 // Remove from its parent by default\r
933                 if ( div.parentNode ) {\r
934                         div.parentNode.removeChild( div );\r
935                 }\r
936                 // release memory in IE\r
937                 div = null;\r
938         }\r
939 }\r
940 \r
941 /**\r
942  * Adds the same handler for all of the specified attrs\r
943  * @param {String} attrs Pipe-separated list of attributes\r
944  * @param {Function} handler The method that will be applied\r
945  */\r
946 function addHandle( attrs, handler ) {\r
947         var arr = attrs.split("|"),\r
948                 i = attrs.length;\r
949 \r
950         while ( i-- ) {\r
951                 Expr.attrHandle[ arr[i] ] = handler;\r
952         }\r
953 }\r
954 \r
955 /**\r
956  * Checks document order of two siblings\r
957  * @param {Element} a\r
958  * @param {Element} b\r
959  * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\r
960  */\r
961 function siblingCheck( a, b ) {\r
962         var cur = b && a,\r
963                 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&\r
964                         ( ~b.sourceIndex || MAX_NEGATIVE ) -\r
965                         ( ~a.sourceIndex || MAX_NEGATIVE );\r
966 \r
967         // Use IE sourceIndex if available on both nodes\r
968         if ( diff ) {\r
969                 return diff;\r
970         }\r
971 \r
972         // Check if b follows a\r
973         if ( cur ) {\r
974                 while ( (cur = cur.nextSibling) ) {\r
975                         if ( cur === b ) {\r
976                                 return -1;\r
977                         }\r
978                 }\r
979         }\r
980 \r
981         return a ? 1 : -1;\r
982 }\r
983 \r
984 /**\r
985  * Returns a function to use in pseudos for input types\r
986  * @param {String} type\r
987  */\r
988 function createInputPseudo( type ) {\r
989         return function( elem ) {\r
990                 var name = elem.nodeName.toLowerCase();\r
991                 return name === "input" && elem.type === type;\r
992         };\r
993 }\r
994 \r
995 /**\r
996  * Returns a function to use in pseudos for buttons\r
997  * @param {String} type\r
998  */\r
999 function createButtonPseudo( type ) {\r
1000         return function( elem ) {\r
1001                 var name = elem.nodeName.toLowerCase();\r
1002                 return (name === "input" || name === "button") && elem.type === type;\r
1003         };\r
1004 }\r
1005 \r
1006 /**\r
1007  * Returns a function to use in pseudos for positionals\r
1008  * @param {Function} fn\r
1009  */\r
1010 function createPositionalPseudo( fn ) {\r
1011         return markFunction(function( argument ) {\r
1012                 argument = +argument;\r
1013                 return markFunction(function( seed, matches ) {\r
1014                         var j,\r
1015                                 matchIndexes = fn( [], seed.length, argument ),\r
1016                                 i = matchIndexes.length;\r
1017 \r
1018                         // Match elements found at the specified indexes\r
1019                         while ( i-- ) {\r
1020                                 if ( seed[ (j = matchIndexes[i]) ] ) {\r
1021                                         seed[j] = !(matches[j] = seed[j]);\r
1022                                 }\r
1023                         }\r
1024                 });\r
1025         });\r
1026 }\r
1027 \r
1028 /**\r
1029  * Checks a node for validity as a Sizzle context\r
1030  * @param {Element|Object=} context\r
1031  * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\r
1032  */\r
1033 function testContext( context ) {\r
1034         return context && typeof context.getElementsByTagName !== "undefined" && context;\r
1035 }\r
1036 \r
1037 // Expose support vars for convenience\r
1038 support = Sizzle.support = {};\r
1039 \r
1040 /**\r
1041  * Detects XML nodes\r
1042  * @param {Element|Object} elem An element or a document\r
1043  * @returns {Boolean} True iff elem is a non-HTML XML node\r
1044  */\r
1045 isXML = Sizzle.isXML = function( elem ) {\r
1046         // documentElement is verified for cases where it doesn't yet exist\r
1047         // (such as loading iframes in IE - #4833)\r
1048         var documentElement = elem && (elem.ownerDocument || elem).documentElement;\r
1049         return documentElement ? documentElement.nodeName !== "HTML" : false;\r
1050 };\r
1051 \r
1052 /**\r
1053  * Sets document-related variables once based on the current document\r
1054  * @param {Element|Object} [doc] An element or document object to use to set the document\r
1055  * @returns {Object} Returns the current document\r
1056  */\r
1057 setDocument = Sizzle.setDocument = function( node ) {\r
1058         var hasCompare, parent,\r
1059                 doc = node ? node.ownerDocument || node : preferredDoc;\r
1060 \r
1061         // If no document and documentElement is available, return\r
1062         if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\r
1063                 return document;\r
1064         }\r
1065 \r
1066         // Set our document\r
1067         document = doc;\r
1068         docElem = doc.documentElement;\r
1069         parent = doc.defaultView;\r
1070 \r
1071         // Support: IE>8\r
1072         // If iframe document is assigned to "document" variable and if iframe has been reloaded,\r
1073         // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936\r
1074         // IE6-8 do not support the defaultView property so parent will be undefined\r
1075         if ( parent && parent !== parent.top ) {\r
1076                 // IE11 does not have attachEvent, so all must suffer\r
1077                 if ( parent.addEventListener ) {\r
1078                         parent.addEventListener( "unload", unloadHandler, false );\r
1079                 } else if ( parent.attachEvent ) {\r
1080                         parent.attachEvent( "onunload", unloadHandler );\r
1081                 }\r
1082         }\r
1083 \r
1084         /* Support tests\r
1085         ---------------------------------------------------------------------- */\r
1086         documentIsHTML = !isXML( doc );\r
1087 \r
1088         /* Attributes\r
1089         ---------------------------------------------------------------------- */\r
1090 \r
1091         // Support: IE<8\r
1092         // Verify that getAttribute really returns attributes and not properties\r
1093         // (excepting IE8 booleans)\r
1094         support.attributes = assert(function( div ) {\r
1095                 div.className = "i";\r
1096                 return !div.getAttribute("className");\r
1097         });\r
1098 \r
1099         /* getElement(s)By*\r
1100         ---------------------------------------------------------------------- */\r
1101 \r
1102         // Check if getElementsByTagName("*") returns only elements\r
1103         support.getElementsByTagName = assert(function( div ) {\r
1104                 div.appendChild( doc.createComment("") );\r
1105                 return !div.getElementsByTagName("*").length;\r
1106         });\r
1107 \r
1108         // Support: IE<9\r
1109         support.getElementsByClassName = rnative.test( doc.getElementsByClassName );\r
1110 \r
1111         // Support: IE<10\r
1112         // Check if getElementById returns elements by name\r
1113         // The broken getElementById methods don't pick up programatically-set names,\r
1114         // so use a roundabout getElementsByName test\r
1115         support.getById = assert(function( div ) {\r
1116                 docElem.appendChild( div ).id = expando;\r
1117                 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;\r
1118         });\r
1119 \r
1120         // ID find and filter\r
1121         if ( support.getById ) {\r
1122                 Expr.find["ID"] = function( id, context ) {\r
1123                         if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\r
1124                                 var m = context.getElementById( id );\r
1125                                 // Check parentNode to catch when Blackberry 4.6 returns\r
1126                                 // nodes that are no longer in the document #6963\r
1127                                 return m && m.parentNode ? [ m ] : [];\r
1128                         }\r
1129                 };\r
1130                 Expr.filter["ID"] = function( id ) {\r
1131                         var attrId = id.replace( runescape, funescape );\r
1132                         return function( elem ) {\r
1133                                 return elem.getAttribute("id") === attrId;\r
1134                         };\r
1135                 };\r
1136         } else {\r
1137                 // Support: IE6/7\r
1138                 // getElementById is not reliable as a find shortcut\r
1139                 delete Expr.find["ID"];\r
1140 \r
1141                 Expr.filter["ID"] =  function( id ) {\r
1142                         var attrId = id.replace( runescape, funescape );\r
1143                         return function( elem ) {\r
1144                                 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");\r
1145                                 return node && node.value === attrId;\r
1146                         };\r
1147                 };\r
1148         }\r
1149 \r
1150         // Tag\r
1151         Expr.find["TAG"] = support.getElementsByTagName ?\r
1152                 function( tag, context ) {\r
1153                         if ( typeof context.getElementsByTagName !== "undefined" ) {\r
1154                                 return context.getElementsByTagName( tag );\r
1155 \r
1156                         // DocumentFragment nodes don't have gEBTN\r
1157                         } else if ( support.qsa ) {\r
1158                                 return context.querySelectorAll( tag );\r
1159                         }\r
1160                 } :\r
1161 \r
1162                 function( tag, context ) {\r
1163                         var elem,\r
1164                                 tmp = [],\r
1165                                 i = 0,\r
1166                                 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\r
1167                                 results = context.getElementsByTagName( tag );\r
1168 \r
1169                         // Filter out possible comments\r
1170                         if ( tag === "*" ) {\r
1171                                 while ( (elem = results[i++]) ) {\r
1172                                         if ( elem.nodeType === 1 ) {\r
1173                                                 tmp.push( elem );\r
1174                                         }\r
1175                                 }\r
1176 \r
1177                                 return tmp;\r
1178                         }\r
1179                         return results;\r
1180                 };\r
1181 \r
1182         // Class\r
1183         Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {\r
1184                 if ( documentIsHTML ) {\r
1185                         return context.getElementsByClassName( className );\r
1186                 }\r
1187         };\r
1188 \r
1189         /* QSA/matchesSelector\r
1190         ---------------------------------------------------------------------- */\r
1191 \r
1192         // QSA and matchesSelector support\r
1193 \r
1194         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
1195         rbuggyMatches = [];\r
1196 \r
1197         // qSa(:focus) reports false when true (Chrome 21)\r
1198         // We allow this because of a bug in IE8/9 that throws an error\r
1199         // whenever `document.activeElement` is accessed on an iframe\r
1200         // So, we allow :focus to pass through QSA all the time to avoid the IE error\r
1201         // See http://bugs.jquery.com/ticket/13378\r
1202         rbuggyQSA = [];\r
1203 \r
1204         if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {\r
1205                 // Build QSA regex\r
1206                 // Regex strategy adopted from Diego Perini\r
1207                 assert(function( div ) {\r
1208                         // Select is set to empty string on purpose\r
1209                         // This is to test IE's treatment of not explicitly\r
1210                         // setting a boolean content attribute,\r
1211                         // since its presence should be enough\r
1212                         // http://bugs.jquery.com/ticket/12359\r
1213                         docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +\r
1214                                 "<select id='" + expando + "-\f]' msallowcapture=''>" +\r
1215                                 "<option selected=''></option></select>";\r
1216 \r
1217                         // Support: IE8, Opera 11-12.16\r
1218                         // Nothing should be selected when empty strings follow ^= or $= or *=\r
1219                         // The test attribute must be unknown in Opera but "safe" for WinRT\r
1220                         // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\r
1221                         if ( div.querySelectorAll("[msallowcapture^='']").length ) {\r
1222                                 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );\r
1223                         }\r
1224 \r
1225                         // Support: IE8\r
1226                         // Boolean attributes and "value" are not treated correctly\r
1227                         if ( !div.querySelectorAll("[selected]").length ) {\r
1228                                 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );\r
1229                         }\r
1230 \r
1231                         // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+\r
1232                         if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {\r
1233                                 rbuggyQSA.push("~=");\r
1234                         }\r
1235 \r
1236                         // Webkit/Opera - :checked should return selected option elements\r
1237                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
1238                         // IE8 throws error here and will not see later tests\r
1239                         if ( !div.querySelectorAll(":checked").length ) {\r
1240                                 rbuggyQSA.push(":checked");\r
1241                         }\r
1242 \r
1243                         // Support: Safari 8+, iOS 8+\r
1244                         // https://bugs.webkit.org/show_bug.cgi?id=136851\r
1245                         // In-page `selector#id sibing-combinator selector` fails\r
1246                         if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {\r
1247                                 rbuggyQSA.push(".#.+[+~]");\r
1248                         }\r
1249                 });\r
1250 \r
1251                 assert(function( div ) {\r
1252                         // Support: Windows 8 Native Apps\r
1253                         // The type and name attributes are restricted during .innerHTML assignment\r
1254                         var input = doc.createElement("input");\r
1255                         input.setAttribute( "type", "hidden" );\r
1256                         div.appendChild( input ).setAttribute( "name", "D" );\r
1257 \r
1258                         // Support: IE8\r
1259                         // Enforce case-sensitivity of name attribute\r
1260                         if ( div.querySelectorAll("[name=d]").length ) {\r
1261                                 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );\r
1262                         }\r
1263 \r
1264                         // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
1265                         // IE8 throws error here and will not see later tests\r
1266                         if ( !div.querySelectorAll(":enabled").length ) {\r
1267                                 rbuggyQSA.push( ":enabled", ":disabled" );\r
1268                         }\r
1269 \r
1270                         // Opera 10-11 does not throw on post-comma invalid pseudos\r
1271                         div.querySelectorAll("*,:x");\r
1272                         rbuggyQSA.push(",.*:");\r
1273                 });\r
1274         }\r
1275 \r
1276         if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\r
1277                 docElem.webkitMatchesSelector ||\r
1278                 docElem.mozMatchesSelector ||\r
1279                 docElem.oMatchesSelector ||\r
1280                 docElem.msMatchesSelector) )) ) {\r
1281 \r
1282                 assert(function( div ) {\r
1283                         // Check to see if it's possible to do matchesSelector\r
1284                         // on a disconnected node (IE 9)\r
1285                         support.disconnectedMatch = matches.call( div, "div" );\r
1286 \r
1287                         // This should fail with an exception\r
1288                         // Gecko does not error, returns false instead\r
1289                         matches.call( div, "[s!='']:x" );\r
1290                         rbuggyMatches.push( "!=", pseudos );\r
1291                 });\r
1292         }\r
1293 \r
1294         rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );\r
1295         rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );\r
1296 \r
1297         /* Contains\r
1298         ---------------------------------------------------------------------- */\r
1299         hasCompare = rnative.test( docElem.compareDocumentPosition );\r
1300 \r
1301         // Element contains another\r
1302         // Purposefully does not implement inclusive descendent\r
1303         // As in, an element does not contain itself\r
1304         contains = hasCompare || rnative.test( docElem.contains ) ?\r
1305                 function( a, b ) {\r
1306                         var adown = a.nodeType === 9 ? a.documentElement : a,\r
1307                                 bup = b && b.parentNode;\r
1308                         return a === bup || !!( bup && bup.nodeType === 1 && (\r
1309                                 adown.contains ?\r
1310                                         adown.contains( bup ) :\r
1311                                         a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\r
1312                         ));\r
1313                 } :\r
1314                 function( a, b ) {\r
1315                         if ( b ) {\r
1316                                 while ( (b = b.parentNode) ) {\r
1317                                         if ( b === a ) {\r
1318                                                 return true;\r
1319                                         }\r
1320                                 }\r
1321                         }\r
1322                         return false;\r
1323                 };\r
1324 \r
1325         /* Sorting\r
1326         ---------------------------------------------------------------------- */\r
1327 \r
1328         // Document order sorting\r
1329         sortOrder = hasCompare ?\r
1330         function( a, b ) {\r
1331 \r
1332                 // Flag for duplicate removal\r
1333                 if ( a === b ) {\r
1334                         hasDuplicate = true;\r
1335                         return 0;\r
1336                 }\r
1337 \r
1338                 // Sort on method existence if only one input has compareDocumentPosition\r
1339                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\r
1340                 if ( compare ) {\r
1341                         return compare;\r
1342                 }\r
1343 \r
1344                 // Calculate position if both inputs belong to the same document\r
1345                 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\r
1346                         a.compareDocumentPosition( b ) :\r
1347 \r
1348                         // Otherwise we know they are disconnected\r
1349                         1;\r
1350 \r
1351                 // Disconnected nodes\r
1352                 if ( compare & 1 ||\r
1353                         (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\r
1354 \r
1355                         // Choose the first element that is related to our preferred document\r
1356                         if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\r
1357                                 return -1;\r
1358                         }\r
1359                         if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\r
1360                                 return 1;\r
1361                         }\r
1362 \r
1363                         // Maintain original order\r
1364                         return sortInput ?\r
1365                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\r
1366                                 0;\r
1367                 }\r
1368 \r
1369                 return compare & 4 ? -1 : 1;\r
1370         } :\r
1371         function( a, b ) {\r
1372                 // Exit early if the nodes are identical\r
1373                 if ( a === b ) {\r
1374                         hasDuplicate = true;\r
1375                         return 0;\r
1376                 }\r
1377 \r
1378                 var cur,\r
1379                         i = 0,\r
1380                         aup = a.parentNode,\r
1381                         bup = b.parentNode,\r
1382                         ap = [ a ],\r
1383                         bp = [ b ];\r
1384 \r
1385                 // Parentless nodes are either documents or disconnected\r
1386                 if ( !aup || !bup ) {\r
1387                         return a === doc ? -1 :\r
1388                                 b === doc ? 1 :\r
1389                                 aup ? -1 :\r
1390                                 bup ? 1 :\r
1391                                 sortInput ?\r
1392                                 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\r
1393                                 0;\r
1394 \r
1395                 // If the nodes are siblings, we can do a quick check\r
1396                 } else if ( aup === bup ) {\r
1397                         return siblingCheck( a, b );\r
1398                 }\r
1399 \r
1400                 // Otherwise we need full lists of their ancestors for comparison\r
1401                 cur = a;\r
1402                 while ( (cur = cur.parentNode) ) {\r
1403                         ap.unshift( cur );\r
1404                 }\r
1405                 cur = b;\r
1406                 while ( (cur = cur.parentNode) ) {\r
1407                         bp.unshift( cur );\r
1408                 }\r
1409 \r
1410                 // Walk down the tree looking for a discrepancy\r
1411                 while ( ap[i] === bp[i] ) {\r
1412                         i++;\r
1413                 }\r
1414 \r
1415                 return i ?\r
1416                         // Do a sibling check if the nodes have a common ancestor\r
1417                         siblingCheck( ap[i], bp[i] ) :\r
1418 \r
1419                         // Otherwise nodes in our document sort first\r
1420                         ap[i] === preferredDoc ? -1 :\r
1421                         bp[i] === preferredDoc ? 1 :\r
1422                         0;\r
1423         };\r
1424 \r
1425         return doc;\r
1426 };\r
1427 \r
1428 Sizzle.matches = function( expr, elements ) {\r
1429         return Sizzle( expr, null, null, elements );\r
1430 };\r
1431 \r
1432 Sizzle.matchesSelector = function( elem, expr ) {\r
1433         // Set document vars if needed\r
1434         if ( ( elem.ownerDocument || elem ) !== document ) {\r
1435                 setDocument( elem );\r
1436         }\r
1437 \r
1438         // Make sure that attribute selectors are quoted\r
1439         expr = expr.replace( rattributeQuotes, "='$1']" );\r
1440 \r
1441         if ( support.matchesSelector && documentIsHTML &&\r
1442                 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\r
1443                 ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\r
1444 \r
1445                 try {\r
1446                         var ret = matches.call( elem, expr );\r
1447 \r
1448                         // IE 9's matchesSelector returns false on disconnected nodes\r
1449                         if ( ret || support.disconnectedMatch ||\r
1450                                         // As well, disconnected nodes are said to be in a document\r
1451                                         // fragment in IE 9\r
1452                                         elem.document && elem.document.nodeType !== 11 ) {\r
1453                                 return ret;\r
1454                         }\r
1455                 } catch (e) {}\r
1456         }\r
1457 \r
1458         return Sizzle( expr, document, null, [ elem ] ).length > 0;\r
1459 };\r
1460 \r
1461 Sizzle.contains = function( context, elem ) {\r
1462         // Set document vars if needed\r
1463         if ( ( context.ownerDocument || context ) !== document ) {\r
1464                 setDocument( context );\r
1465         }\r
1466         return contains( context, elem );\r
1467 };\r
1468 \r
1469 Sizzle.attr = function( elem, name ) {\r
1470         // Set document vars if needed\r
1471         if ( ( elem.ownerDocument || elem ) !== document ) {\r
1472                 setDocument( elem );\r
1473         }\r
1474 \r
1475         var fn = Expr.attrHandle[ name.toLowerCase() ],\r
1476                 // Don't get fooled by Object.prototype properties (jQuery #13807)\r
1477                 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\r
1478                         fn( elem, name, !documentIsHTML ) :\r
1479                         undefined;\r
1480 \r
1481         return val !== undefined ?\r
1482                 val :\r
1483                 support.attributes || !documentIsHTML ?\r
1484                         elem.getAttribute( name ) :\r
1485                         (val = elem.getAttributeNode(name)) && val.specified ?\r
1486                                 val.value :\r
1487                                 null;\r
1488 };\r
1489 \r
1490 Sizzle.error = function( msg ) {\r
1491         throw new Error( "Syntax error, unrecognized expression: " + msg );\r
1492 };\r
1493 \r
1494 /**\r
1495  * Document sorting and removing duplicates\r
1496  * @param {ArrayLike} results\r
1497  */\r
1498 Sizzle.uniqueSort = function( results ) {\r
1499         var elem,\r
1500                 duplicates = [],\r
1501                 j = 0,\r
1502                 i = 0;\r
1503 \r
1504         // Unless we *know* we can detect duplicates, assume their presence\r
1505         hasDuplicate = !support.detectDuplicates;\r
1506         sortInput = !support.sortStable && results.slice( 0 );\r
1507         results.sort( sortOrder );\r
1508 \r
1509         if ( hasDuplicate ) {\r
1510                 while ( (elem = results[i++]) ) {\r
1511                         if ( elem === results[ i ] ) {\r
1512                                 j = duplicates.push( i );\r
1513                         }\r
1514                 }\r
1515                 while ( j-- ) {\r
1516                         results.splice( duplicates[ j ], 1 );\r
1517                 }\r
1518         }\r
1519 \r
1520         // Clear input after sorting to release objects\r
1521         // See https://github.com/jquery/sizzle/pull/225\r
1522         sortInput = null;\r
1523 \r
1524         return results;\r
1525 };\r
1526 \r
1527 /**\r
1528  * Utility function for retrieving the text value of an array of DOM nodes\r
1529  * @param {Array|Element} elem\r
1530  */\r
1531 getText = Sizzle.getText = function( elem ) {\r
1532         var node,\r
1533                 ret = "",\r
1534                 i = 0,\r
1535                 nodeType = elem.nodeType;\r
1536 \r
1537         if ( !nodeType ) {\r
1538                 // If no nodeType, this is expected to be an array\r
1539                 while ( (node = elem[i++]) ) {\r
1540                         // Do not traverse comment nodes\r
1541                         ret += getText( node );\r
1542                 }\r
1543         } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
1544                 // Use textContent for elements\r
1545                 // innerText usage removed for consistency of new lines (jQuery #11153)\r
1546                 if ( typeof elem.textContent === "string" ) {\r
1547                         return elem.textContent;\r
1548                 } else {\r
1549                         // Traverse its children\r
1550                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
1551                                 ret += getText( elem );\r
1552                         }\r
1553                 }\r
1554         } else if ( nodeType === 3 || nodeType === 4 ) {\r
1555                 return elem.nodeValue;\r
1556         }\r
1557         // Do not include comment or processing instruction nodes\r
1558 \r
1559         return ret;\r
1560 };\r
1561 \r
1562 Expr = Sizzle.selectors = {\r
1563 \r
1564         // Can be adjusted by the user\r
1565         cacheLength: 50,\r
1566 \r
1567         createPseudo: markFunction,\r
1568 \r
1569         match: matchExpr,\r
1570 \r
1571         attrHandle: {},\r
1572 \r
1573         find: {},\r
1574 \r
1575         relative: {\r
1576                 ">": { dir: "parentNode", first: true },\r
1577                 " ": { dir: "parentNode" },\r
1578                 "+": { dir: "previousSibling", first: true },\r
1579                 "~": { dir: "previousSibling" }\r
1580         },\r
1581 \r
1582         preFilter: {\r
1583                 "ATTR": function( match ) {\r
1584                         match[1] = match[1].replace( runescape, funescape );\r
1585 \r
1586                         // Move the given value to match[3] whether quoted or unquoted\r
1587                         match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );\r
1588 \r
1589                         if ( match[2] === "~=" ) {\r
1590                                 match[3] = " " + match[3] + " ";\r
1591                         }\r
1592 \r
1593                         return match.slice( 0, 4 );\r
1594                 },\r
1595 \r
1596                 "CHILD": function( match ) {\r
1597                         /* matches from matchExpr["CHILD"]\r
1598                                 1 type (only|nth|...)\r
1599                                 2 what (child|of-type)\r
1600                                 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
1601                                 4 xn-component of xn+y argument ([+-]?\d*n|)\r
1602                                 5 sign of xn-component\r
1603                                 6 x of xn-component\r
1604                                 7 sign of y-component\r
1605                                 8 y of y-component\r
1606                         */\r
1607                         match[1] = match[1].toLowerCase();\r
1608 \r
1609                         if ( match[1].slice( 0, 3 ) === "nth" ) {\r
1610                                 // nth-* requires argument\r
1611                                 if ( !match[3] ) {\r
1612                                         Sizzle.error( match[0] );\r
1613                                 }\r
1614 \r
1615                                 // numeric x and y parameters for Expr.filter.CHILD\r
1616                                 // remember that false/true cast respectively to 0/1\r
1617                                 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );\r
1618                                 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );\r
1619 \r
1620                         // other types prohibit arguments\r
1621                         } else if ( match[3] ) {\r
1622                                 Sizzle.error( match[0] );\r
1623                         }\r
1624 \r
1625                         return match;\r
1626                 },\r
1627 \r
1628                 "PSEUDO": function( match ) {\r
1629                         var excess,\r
1630                                 unquoted = !match[6] && match[2];\r
1631 \r
1632                         if ( matchExpr["CHILD"].test( match[0] ) ) {\r
1633                                 return null;\r
1634                         }\r
1635 \r
1636                         // Accept quoted arguments as-is\r
1637                         if ( match[3] ) {\r
1638                                 match[2] = match[4] || match[5] || "";\r
1639 \r
1640                         // Strip excess characters from unquoted arguments\r
1641                         } else if ( unquoted && rpseudo.test( unquoted ) &&\r
1642                                 // Get excess from tokenize (recursively)\r
1643                                 (excess = tokenize( unquoted, true )) &&\r
1644                                 // advance to the next closing parenthesis\r
1645                                 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {\r
1646 \r
1647                                 // excess is a negative index\r
1648                                 match[0] = match[0].slice( 0, excess );\r
1649                                 match[2] = unquoted.slice( 0, excess );\r
1650                         }\r
1651 \r
1652                         // Return only captures needed by the pseudo filter method (type and argument)\r
1653                         return match.slice( 0, 3 );\r
1654                 }\r
1655         },\r
1656 \r
1657         filter: {\r
1658 \r
1659                 "TAG": function( nodeNameSelector ) {\r
1660                         var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\r
1661                         return nodeNameSelector === "*" ?\r
1662                                 function() { return true; } :\r
1663                                 function( elem ) {\r
1664                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
1665                                 };\r
1666                 },\r
1667 \r
1668                 "CLASS": function( className ) {\r
1669                         var pattern = classCache[ className + " " ];\r
1670 \r
1671                         return pattern ||\r
1672                                 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&\r
1673                                 classCache( className, function( elem ) {\r
1674                                         return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );\r
1675                                 });\r
1676                 },\r
1677 \r
1678                 "ATTR": function( name, operator, check ) {\r
1679                         return function( elem ) {\r
1680                                 var result = Sizzle.attr( elem, name );\r
1681 \r
1682                                 if ( result == null ) {\r
1683                                         return operator === "!=";\r
1684                                 }\r
1685                                 if ( !operator ) {\r
1686                                         return true;\r
1687                                 }\r
1688 \r
1689                                 result += "";\r
1690 \r
1691                                 return operator === "=" ? result === check :\r
1692                                         operator === "!=" ? result !== check :\r
1693                                         operator === "^=" ? check && result.indexOf( check ) === 0 :\r
1694                                         operator === "*=" ? check && result.indexOf( check ) > -1 :\r
1695                                         operator === "$=" ? check && result.slice( -check.length ) === check :\r
1696                                         operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :\r
1697                                         operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :\r
1698                                         false;\r
1699                         };\r
1700                 },\r
1701 \r
1702                 "CHILD": function( type, what, argument, first, last ) {\r
1703                         var simple = type.slice( 0, 3 ) !== "nth",\r
1704                                 forward = type.slice( -4 ) !== "last",\r
1705                                 ofType = what === "of-type";\r
1706 \r
1707                         return first === 1 && last === 0 ?\r
1708 \r
1709                                 // Shortcut for :nth-*(n)\r
1710                                 function( elem ) {\r
1711                                         return !!elem.parentNode;\r
1712                                 } :\r
1713 \r
1714                                 function( elem, context, xml ) {\r
1715                                         var cache, outerCache, node, diff, nodeIndex, start,\r
1716                                                 dir = simple !== forward ? "nextSibling" : "previousSibling",\r
1717                                                 parent = elem.parentNode,\r
1718                                                 name = ofType && elem.nodeName.toLowerCase(),\r
1719                                                 useCache = !xml && !ofType;\r
1720 \r
1721                                         if ( parent ) {\r
1722 \r
1723                                                 // :(first|last|only)-(child|of-type)\r
1724                                                 if ( simple ) {\r
1725                                                         while ( dir ) {\r
1726                                                                 node = elem;\r
1727                                                                 while ( (node = node[ dir ]) ) {\r
1728                                                                         if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\r
1729                                                                                 return false;\r
1730                                                                         }\r
1731                                                                 }\r
1732                                                                 // Reverse direction for :only-* (if we haven't yet done so)\r
1733                                                                 start = dir = type === "only" && !start && "nextSibling";\r
1734                                                         }\r
1735                                                         return true;\r
1736                                                 }\r
1737 \r
1738                                                 start = [ forward ? parent.firstChild : parent.lastChild ];\r
1739 \r
1740                                                 // non-xml :nth-child(...) stores cache data on `parent`\r
1741                                                 if ( forward && useCache ) {\r
1742                                                         // Seek `elem` from a previously-cached index\r
1743                                                         outerCache = parent[ expando ] || (parent[ expando ] = {});\r
1744                                                         cache = outerCache[ type ] || [];\r
1745                                                         nodeIndex = cache[0] === dirruns && cache[1];\r
1746                                                         diff = cache[0] === dirruns && cache[2];\r
1747                                                         node = nodeIndex && parent.childNodes[ nodeIndex ];\r
1748 \r
1749                                                         while ( (node = ++nodeIndex && node && node[ dir ] ||\r
1750 \r
1751                                                                 // Fallback to seeking `elem` from the start\r
1752                                                                 (diff = nodeIndex = 0) || start.pop()) ) {\r
1753 \r
1754                                                                 // When found, cache indexes on `parent` and break\r
1755                                                                 if ( node.nodeType === 1 && ++diff && node === elem ) {\r
1756                                                                         outerCache[ type ] = [ dirruns, nodeIndex, diff ];\r
1757                                                                         break;\r
1758                                                                 }\r
1759                                                         }\r
1760 \r
1761                                                 // Use previously-cached element index if available\r
1762                                                 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\r
1763                                                         diff = cache[1];\r
1764 \r
1765                                                 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\r
1766                                                 } else {\r
1767                                                         // Use the same loop as above to seek `elem` from the start\r
1768                                                         while ( (node = ++nodeIndex && node && node[ dir ] ||\r
1769                                                                 (diff = nodeIndex = 0) || start.pop()) ) {\r
1770 \r
1771                                                                 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\r
1772                                                                         // Cache the index of each encountered element\r
1773                                                                         if ( useCache ) {\r
1774                                                                                 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\r
1775                                                                         }\r
1776 \r
1777                                                                         if ( node === elem ) {\r
1778                                                                                 break;\r
1779                                                                         }\r
1780                                                                 }\r
1781                                                         }\r
1782                                                 }\r
1783 \r
1784                                                 // Incorporate the offset, then check against cycle size\r
1785                                                 diff -= last;\r
1786                                                 return diff === first || ( diff % first === 0 && diff / first >= 0 );\r
1787                                         }\r
1788                                 };\r
1789                 },\r
1790 \r
1791                 "PSEUDO": function( pseudo, argument ) {\r
1792                         // pseudo-class names are case-insensitive\r
1793                         // http://www.w3.org/TR/selectors/#pseudo-classes\r
1794                         // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
1795                         // Remember that setFilters inherits from pseudos\r
1796                         var args,\r
1797                                 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\r
1798                                         Sizzle.error( "unsupported pseudo: " + pseudo );\r
1799 \r
1800                         // The user may use createPseudo to indicate that\r
1801                         // arguments are needed to create the filter function\r
1802                         // just as Sizzle does\r
1803                         if ( fn[ expando ] ) {\r
1804                                 return fn( argument );\r
1805                         }\r
1806 \r
1807                         // But maintain support for old signatures\r
1808                         if ( fn.length > 1 ) {\r
1809                                 args = [ pseudo, pseudo, "", argument ];\r
1810                                 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\r
1811                                         markFunction(function( seed, matches ) {\r
1812                                                 var idx,\r
1813                                                         matched = fn( seed, argument ),\r
1814                                                         i = matched.length;\r
1815                                                 while ( i-- ) {\r
1816                                                         idx = indexOf( seed, matched[i] );\r
1817                                                         seed[ idx ] = !( matches[ idx ] = matched[i] );\r
1818                                                 }\r
1819                                         }) :\r
1820                                         function( elem ) {\r
1821                                                 return fn( elem, 0, args );\r
1822                                         };\r
1823                         }\r
1824 \r
1825                         return fn;\r
1826                 }\r
1827         },\r
1828 \r
1829         pseudos: {\r
1830                 // Potentially complex pseudos\r
1831                 "not": markFunction(function( selector ) {\r
1832                         // Trim the selector passed to compile\r
1833                         // to avoid treating leading and trailing\r
1834                         // spaces as combinators\r
1835                         var input = [],\r
1836                                 results = [],\r
1837                                 matcher = compile( selector.replace( rtrim, "$1" ) );\r
1838 \r
1839                         return matcher[ expando ] ?\r
1840                                 markFunction(function( seed, matches, context, xml ) {\r
1841                                         var elem,\r
1842                                                 unmatched = matcher( seed, null, xml, [] ),\r
1843                                                 i = seed.length;\r
1844 \r
1845                                         // Match elements unmatched by `matcher`\r
1846                                         while ( i-- ) {\r
1847                                                 if ( (elem = unmatched[i]) ) {\r
1848                                                         seed[i] = !(matches[i] = elem);\r
1849                                                 }\r
1850                                         }\r
1851                                 }) :\r
1852                                 function( elem, context, xml ) {\r
1853                                         input[0] = elem;\r
1854                                         matcher( input, null, xml, results );\r
1855                                         // Don't keep the element (issue #299)\r
1856                                         input[0] = null;\r
1857                                         return !results.pop();\r
1858                                 };\r
1859                 }),\r
1860 \r
1861                 "has": markFunction(function( selector ) {\r
1862                         return function( elem ) {\r
1863                                 return Sizzle( selector, elem ).length > 0;\r
1864                         };\r
1865                 }),\r
1866 \r
1867                 "contains": markFunction(function( text ) {\r
1868                         text = text.replace( runescape, funescape );\r
1869                         return function( elem ) {\r
1870                                 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\r
1871                         };\r
1872                 }),\r
1873 \r
1874                 // "Whether an element is represented by a :lang() selector\r
1875                 // is based solely on the element's language value\r
1876                 // being equal to the identifier C,\r
1877                 // or beginning with the identifier C immediately followed by "-".\r
1878                 // The matching of C against the element's language value is performed case-insensitively.\r
1879                 // The identifier C does not have to be a valid language name."\r
1880                 // http://www.w3.org/TR/selectors/#lang-pseudo\r
1881                 "lang": markFunction( function( lang ) {\r
1882                         // lang value must be a valid identifier\r
1883                         if ( !ridentifier.test(lang || "") ) {\r
1884                                 Sizzle.error( "unsupported lang: " + lang );\r
1885                         }\r
1886                         lang = lang.replace( runescape, funescape ).toLowerCase();\r
1887                         return function( elem ) {\r
1888                                 var elemLang;\r
1889                                 do {\r
1890                                         if ( (elemLang = documentIsHTML ?\r
1891                                                 elem.lang :\r
1892                                                 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {\r
1893 \r
1894                                                 elemLang = elemLang.toLowerCase();\r
1895                                                 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;\r
1896                                         }\r
1897                                 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );\r
1898                                 return false;\r
1899                         };\r
1900                 }),\r
1901 \r
1902                 // Miscellaneous\r
1903                 "target": function( elem ) {\r
1904                         var hash = window.location && window.location.hash;\r
1905                         return hash && hash.slice( 1 ) === elem.id;\r
1906                 },\r
1907 \r
1908                 "root": function( elem ) {\r
1909                         return elem === docElem;\r
1910                 },\r
1911 \r
1912                 "focus": function( elem ) {\r
1913                         return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\r
1914                 },\r
1915 \r
1916                 // Boolean properties\r
1917                 "enabled": function( elem ) {\r
1918                         return elem.disabled === false;\r
1919                 },\r
1920 \r
1921                 "disabled": function( elem ) {\r
1922                         return elem.disabled === true;\r
1923                 },\r
1924 \r
1925                 "checked": function( elem ) {\r
1926                         // In CSS3, :checked should return both checked and selected elements\r
1927                         // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
1928                         var nodeName = elem.nodeName.toLowerCase();\r
1929                         return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);\r
1930                 },\r
1931 \r
1932                 "selected": function( elem ) {\r
1933                         // Accessing this property makes selected-by-default\r
1934                         // options in Safari work properly\r
1935                         if ( elem.parentNode ) {\r
1936                                 elem.parentNode.selectedIndex;\r
1937                         }\r
1938 \r
1939                         return elem.selected === true;\r
1940                 },\r
1941 \r
1942                 // Contents\r
1943                 "empty": function( elem ) {\r
1944                         // http://www.w3.org/TR/selectors/#empty-pseudo\r
1945                         // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\r
1946                         //   but not by others (comment: 8; processing instruction: 7; etc.)\r
1947                         // nodeType < 6 works because attributes (2) do not appear as children\r
1948                         for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
1949                                 if ( elem.nodeType < 6 ) {\r
1950                                         return false;\r
1951                                 }\r
1952                         }\r
1953                         return true;\r
1954                 },\r
1955 \r
1956                 "parent": function( elem ) {\r
1957                         return !Expr.pseudos["empty"]( elem );\r
1958                 },\r
1959 \r
1960                 // Element/input types\r
1961                 "header": function( elem ) {\r
1962                         return rheader.test( elem.nodeName );\r
1963                 },\r
1964 \r
1965                 "input": function( elem ) {\r
1966                         return rinputs.test( elem.nodeName );\r
1967                 },\r
1968 \r
1969                 "button": function( elem ) {\r
1970                         var name = elem.nodeName.toLowerCase();\r
1971                         return name === "input" && elem.type === "button" || name === "button";\r
1972                 },\r
1973 \r
1974                 "text": function( elem ) {\r
1975                         var attr;\r
1976                         return elem.nodeName.toLowerCase() === "input" &&\r
1977                                 elem.type === "text" &&\r
1978 \r
1979                                 // Support: IE<8\r
1980                                 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"\r
1981                                 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );\r
1982                 },\r
1983 \r
1984                 // Position-in-collection\r
1985                 "first": createPositionalPseudo(function() {\r
1986                         return [ 0 ];\r
1987                 }),\r
1988 \r
1989                 "last": createPositionalPseudo(function( matchIndexes, length ) {\r
1990                         return [ length - 1 ];\r
1991                 }),\r
1992 \r
1993                 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
1994                         return [ argument < 0 ? argument + length : argument ];\r
1995                 }),\r
1996 \r
1997                 "even": createPositionalPseudo(function( matchIndexes, length ) {\r
1998                         var i = 0;\r
1999                         for ( ; i < length; i += 2 ) {\r
2000                                 matchIndexes.push( i );\r
2001                         }\r
2002                         return matchIndexes;\r
2003                 }),\r
2004 \r
2005                 "odd": createPositionalPseudo(function( matchIndexes, length ) {\r
2006                         var i = 1;\r
2007                         for ( ; i < length; i += 2 ) {\r
2008                                 matchIndexes.push( i );\r
2009                         }\r
2010                         return matchIndexes;\r
2011                 }),\r
2012 \r
2013                 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
2014                         var i = argument < 0 ? argument + length : argument;\r
2015                         for ( ; --i >= 0; ) {\r
2016                                 matchIndexes.push( i );\r
2017                         }\r
2018                         return matchIndexes;\r
2019                 }),\r
2020 \r
2021                 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
2022                         var i = argument < 0 ? argument + length : argument;\r
2023                         for ( ; ++i < length; ) {\r
2024                                 matchIndexes.push( i );\r
2025                         }\r
2026                         return matchIndexes;\r
2027                 })\r
2028         }\r
2029 };\r
2030 \r
2031 Expr.pseudos["nth"] = Expr.pseudos["eq"];\r
2032 \r
2033 // Add button/input type pseudos\r
2034 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\r
2035         Expr.pseudos[ i ] = createInputPseudo( i );\r
2036 }\r
2037 for ( i in { submit: true, reset: true } ) {\r
2038         Expr.pseudos[ i ] = createButtonPseudo( i );\r
2039 }\r
2040 \r
2041 // Easy API for creating new setFilters\r
2042 function setFilters() {}\r
2043 setFilters.prototype = Expr.filters = Expr.pseudos;\r
2044 Expr.setFilters = new setFilters();\r
2045 \r
2046 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {\r
2047         var matched, match, tokens, type,\r
2048                 soFar, groups, preFilters,\r
2049                 cached = tokenCache[ selector + " " ];\r
2050 \r
2051         if ( cached ) {\r
2052                 return parseOnly ? 0 : cached.slice( 0 );\r
2053         }\r
2054 \r
2055         soFar = selector;\r
2056         groups = [];\r
2057         preFilters = Expr.preFilter;\r
2058 \r
2059         while ( soFar ) {\r
2060 \r
2061                 // Comma and first run\r
2062                 if ( !matched || (match = rcomma.exec( soFar )) ) {\r
2063                         if ( match ) {\r
2064                                 // Don't consume trailing commas as valid\r
2065                                 soFar = soFar.slice( match[0].length ) || soFar;\r
2066                         }\r
2067                         groups.push( (tokens = []) );\r
2068                 }\r
2069 \r
2070                 matched = false;\r
2071 \r
2072                 // Combinators\r
2073                 if ( (match = rcombinators.exec( soFar )) ) {\r
2074                         matched = match.shift();\r
2075                         tokens.push({\r
2076                                 value: matched,\r
2077                                 // Cast descendant combinators to space\r
2078                                 type: match[0].replace( rtrim, " " )\r
2079                         });\r
2080                         soFar = soFar.slice( matched.length );\r
2081                 }\r
2082 \r
2083                 // Filters\r
2084                 for ( type in Expr.filter ) {\r
2085                         if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\r
2086                                 (match = preFilters[ type ]( match ))) ) {\r
2087                                 matched = match.shift();\r
2088                                 tokens.push({\r
2089                                         value: matched,\r
2090                                         type: type,\r
2091                                         matches: match\r
2092                                 });\r
2093                                 soFar = soFar.slice( matched.length );\r
2094                         }\r
2095                 }\r
2096 \r
2097                 if ( !matched ) {\r
2098                         break;\r
2099                 }\r
2100         }\r
2101 \r
2102         // Return the length of the invalid excess\r
2103         // if we're just parsing\r
2104         // Otherwise, throw an error or return tokens\r
2105         return parseOnly ?\r
2106                 soFar.length :\r
2107                 soFar ?\r
2108                         Sizzle.error( selector ) :\r
2109                         // Cache the tokens\r
2110                         tokenCache( selector, groups ).slice( 0 );\r
2111 };\r
2112 \r
2113 function toSelector( tokens ) {\r
2114         var i = 0,\r
2115                 len = tokens.length,\r
2116                 selector = "";\r
2117         for ( ; i < len; i++ ) {\r
2118                 selector += tokens[i].value;\r
2119         }\r
2120         return selector;\r
2121 }\r
2122 \r
2123 function addCombinator( matcher, combinator, base ) {\r
2124         var dir = combinator.dir,\r
2125                 checkNonElements = base && dir === "parentNode",\r
2126                 doneName = done++;\r
2127 \r
2128         return combinator.first ?\r
2129                 // Check against closest ancestor/preceding element\r
2130                 function( elem, context, xml ) {\r
2131                         while ( (elem = elem[ dir ]) ) {\r
2132                                 if ( elem.nodeType === 1 || checkNonElements ) {\r
2133                                         return matcher( elem, context, xml );\r
2134                                 }\r
2135                         }\r
2136                 } :\r
2137 \r
2138                 // Check against all ancestor/preceding elements\r
2139                 function( elem, context, xml ) {\r
2140                         var oldCache, outerCache,\r
2141                                 newCache = [ dirruns, doneName ];\r
2142 \r
2143                         // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\r
2144                         if ( xml ) {\r
2145                                 while ( (elem = elem[ dir ]) ) {\r
2146                                         if ( elem.nodeType === 1 || checkNonElements ) {\r
2147                                                 if ( matcher( elem, context, xml ) ) {\r
2148                                                         return true;\r
2149                                                 }\r
2150                                         }\r
2151                                 }\r
2152                         } else {\r
2153                                 while ( (elem = elem[ dir ]) ) {\r
2154                                         if ( elem.nodeType === 1 || checkNonElements ) {\r
2155                                                 outerCache = elem[ expando ] || (elem[ expando ] = {});\r
2156                                                 if ( (oldCache = outerCache[ dir ]) &&\r
2157                                                         oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\r
2158 \r
2159                                                         // Assign to newCache so results back-propagate to previous elements\r
2160                                                         return (newCache[ 2 ] = oldCache[ 2 ]);\r
2161                                                 } else {\r
2162                                                         // Reuse newcache so results back-propagate to previous elements\r
2163                                                         outerCache[ dir ] = newCache;\r
2164 \r
2165                                                         // A match means we're done; a fail means we have to keep checking\r
2166                                                         if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\r
2167                                                                 return true;\r
2168                                                         }\r
2169                                                 }\r
2170                                         }\r
2171                                 }\r
2172                         }\r
2173                 };\r
2174 }\r
2175 \r
2176 function elementMatcher( matchers ) {\r
2177         return matchers.length > 1 ?\r
2178                 function( elem, context, xml ) {\r
2179                         var i = matchers.length;\r
2180                         while ( i-- ) {\r
2181                                 if ( !matchers[i]( elem, context, xml ) ) {\r
2182                                         return false;\r
2183                                 }\r
2184                         }\r
2185                         return true;\r
2186                 } :\r
2187                 matchers[0];\r
2188 }\r
2189 \r
2190 function multipleContexts( selector, contexts, results ) {\r
2191         var i = 0,\r
2192                 len = contexts.length;\r
2193         for ( ; i < len; i++ ) {\r
2194                 Sizzle( selector, contexts[i], results );\r
2195         }\r
2196         return results;\r
2197 }\r
2198 \r
2199 function condense( unmatched, map, filter, context, xml ) {\r
2200         var elem,\r
2201                 newUnmatched = [],\r
2202                 i = 0,\r
2203                 len = unmatched.length,\r
2204                 mapped = map != null;\r
2205 \r
2206         for ( ; i < len; i++ ) {\r
2207                 if ( (elem = unmatched[i]) ) {\r
2208                         if ( !filter || filter( elem, context, xml ) ) {\r
2209                                 newUnmatched.push( elem );\r
2210                                 if ( mapped ) {\r
2211                                         map.push( i );\r
2212                                 }\r
2213                         }\r
2214                 }\r
2215         }\r
2216 \r
2217         return newUnmatched;\r
2218 }\r
2219 \r
2220 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\r
2221         if ( postFilter && !postFilter[ expando ] ) {\r
2222                 postFilter = setMatcher( postFilter );\r
2223         }\r
2224         if ( postFinder && !postFinder[ expando ] ) {\r
2225                 postFinder = setMatcher( postFinder, postSelector );\r
2226         }\r
2227         return markFunction(function( seed, results, context, xml ) {\r
2228                 var temp, i, elem,\r
2229                         preMap = [],\r
2230                         postMap = [],\r
2231                         preexisting = results.length,\r
2232 \r
2233                         // Get initial elements from seed or context\r
2234                         elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),\r
2235 \r
2236                         // Prefilter to get matcher input, preserving a map for seed-results synchronization\r
2237                         matcherIn = preFilter && ( seed || !selector ) ?\r
2238                                 condense( elems, preMap, preFilter, context, xml ) :\r
2239                                 elems,\r
2240 \r
2241                         matcherOut = matcher ?\r
2242                                 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\r
2243                                 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\r
2244 \r
2245                                         // ...intermediate processing is necessary\r
2246                                         [] :\r
2247 \r
2248                                         // ...otherwise use results directly\r
2249                                         results :\r
2250                                 matcherIn;\r
2251 \r
2252                 // Find primary matches\r
2253                 if ( matcher ) {\r
2254                         matcher( matcherIn, matcherOut, context, xml );\r
2255                 }\r
2256 \r
2257                 // Apply postFilter\r
2258                 if ( postFilter ) {\r
2259                         temp = condense( matcherOut, postMap );\r
2260                         postFilter( temp, [], context, xml );\r
2261 \r
2262                         // Un-match failing elements by moving them back to matcherIn\r
2263                         i = temp.length;\r
2264                         while ( i-- ) {\r
2265                                 if ( (elem = temp[i]) ) {\r
2266                                         matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\r
2267                                 }\r
2268                         }\r
2269                 }\r
2270 \r
2271                 if ( seed ) {\r
2272                         if ( postFinder || preFilter ) {\r
2273                                 if ( postFinder ) {\r
2274                                         // Get the final matcherOut by condensing this intermediate into postFinder contexts\r
2275                                         temp = [];\r
2276                                         i = matcherOut.length;\r
2277                                         while ( i-- ) {\r
2278                                                 if ( (elem = matcherOut[i]) ) {\r
2279                                                         // Restore matcherIn since elem is not yet a final match\r
2280                                                         temp.push( (matcherIn[i] = elem) );\r
2281                                                 }\r
2282                                         }\r
2283                                         postFinder( null, (matcherOut = []), temp, xml );\r
2284                                 }\r
2285 \r
2286                                 // Move matched elements from seed to results to keep them synchronized\r
2287                                 i = matcherOut.length;\r
2288                                 while ( i-- ) {\r
2289                                         if ( (elem = matcherOut[i]) &&\r
2290                                                 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\r
2291 \r
2292                                                 seed[temp] = !(results[temp] = elem);\r
2293                                         }\r
2294                                 }\r
2295                         }\r
2296 \r
2297                 // Add elements to results, through postFinder if defined\r
2298                 } else {\r
2299                         matcherOut = condense(\r
2300                                 matcherOut === results ?\r
2301                                         matcherOut.splice( preexisting, matcherOut.length ) :\r
2302                                         matcherOut\r
2303                         );\r
2304                         if ( postFinder ) {\r
2305                                 postFinder( null, results, matcherOut, xml );\r
2306                         } else {\r
2307                                 push.apply( results, matcherOut );\r
2308                         }\r
2309                 }\r
2310         });\r
2311 }\r
2312 \r
2313 function matcherFromTokens( tokens ) {\r
2314         var checkContext, matcher, j,\r
2315                 len = tokens.length,\r
2316                 leadingRelative = Expr.relative[ tokens[0].type ],\r
2317                 implicitRelative = leadingRelative || Expr.relative[" "],\r
2318                 i = leadingRelative ? 1 : 0,\r
2319 \r
2320                 // The foundational matcher ensures that elements are reachable from top-level context(s)\r
2321                 matchContext = addCombinator( function( elem ) {\r
2322                         return elem === checkContext;\r
2323                 }, implicitRelative, true ),\r
2324                 matchAnyContext = addCombinator( function( elem ) {\r
2325                         return indexOf( checkContext, elem ) > -1;\r
2326                 }, implicitRelative, true ),\r
2327                 matchers = [ function( elem, context, xml ) {\r
2328                         var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\r
2329                                 (checkContext = context).nodeType ?\r
2330                                         matchContext( elem, context, xml ) :\r
2331                                         matchAnyContext( elem, context, xml ) );\r
2332                         // Avoid hanging onto element (issue #299)\r
2333                         checkContext = null;\r
2334                         return ret;\r
2335                 } ];\r
2336 \r
2337         for ( ; i < len; i++ ) {\r
2338                 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\r
2339                         matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\r
2340                 } else {\r
2341                         matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\r
2342 \r
2343                         // Return special upon seeing a positional matcher\r
2344                         if ( matcher[ expando ] ) {\r
2345                                 // Find the next relative operator (if any) for proper handling\r
2346                                 j = ++i;\r
2347                                 for ( ; j < len; j++ ) {\r
2348                                         if ( Expr.relative[ tokens[j].type ] ) {\r
2349                                                 break;\r
2350                                         }\r
2351                                 }\r
2352                                 return setMatcher(\r
2353                                         i > 1 && elementMatcher( matchers ),\r
2354                                         i > 1 && toSelector(\r
2355                                                 // If the preceding token was a descendant combinator, insert an implicit any-element `*`\r
2356                                                 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })\r
2357                                         ).replace( rtrim, "$1" ),\r
2358                                         matcher,\r
2359                                         i < j && matcherFromTokens( tokens.slice( i, j ) ),\r
2360                                         j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\r
2361                                         j < len && toSelector( tokens )\r
2362                                 );\r
2363                         }\r
2364                         matchers.push( matcher );\r
2365                 }\r
2366         }\r
2367 \r
2368         return elementMatcher( matchers );\r
2369 }\r
2370 \r
2371 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {\r
2372         var bySet = setMatchers.length > 0,\r
2373                 byElement = elementMatchers.length > 0,\r
2374                 superMatcher = function( seed, context, xml, results, outermost ) {\r
2375                         var elem, j, matcher,\r
2376                                 matchedCount = 0,\r
2377                                 i = "0",\r
2378                                 unmatched = seed && [],\r
2379                                 setMatched = [],\r
2380                                 contextBackup = outermostContext,\r
2381                                 // We must always have either seed elements or outermost context\r
2382                                 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),\r
2383                                 // Use integer dirruns iff this is the outermost matcher\r
2384                                 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\r
2385                                 len = elems.length;\r
2386 \r
2387                         if ( outermost ) {\r
2388                                 outermostContext = context !== document && context;\r
2389                         }\r
2390 \r
2391                         // Add elements passing elementMatchers directly to results\r
2392                         // Keep `i` a string if there are no elements so `matchedCount` will be "00" below\r
2393                         // Support: IE<9, Safari\r
2394                         // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id\r
2395                         for ( ; i !== len && (elem = elems[i]) != null; i++ ) {\r
2396                                 if ( byElement && elem ) {\r
2397                                         j = 0;\r
2398                                         while ( (matcher = elementMatchers[j++]) ) {\r
2399                                                 if ( matcher( elem, context, xml ) ) {\r
2400                                                         results.push( elem );\r
2401                                                         break;\r
2402                                                 }\r
2403                                         }\r
2404                                         if ( outermost ) {\r
2405                                                 dirruns = dirrunsUnique;\r
2406                                         }\r
2407                                 }\r
2408 \r
2409                                 // Track unmatched elements for set filters\r
2410                                 if ( bySet ) {\r
2411                                         // They will have gone through all possible matchers\r
2412                                         if ( (elem = !matcher && elem) ) {\r
2413                                                 matchedCount--;\r
2414                                         }\r
2415 \r
2416                                         // Lengthen the array for every element, matched or not\r
2417                                         if ( seed ) {\r
2418                                                 unmatched.push( elem );\r
2419                                         }\r
2420                                 }\r
2421                         }\r
2422 \r
2423                         // Apply set filters to unmatched elements\r
2424                         matchedCount += i;\r
2425                         if ( bySet && i !== matchedCount ) {\r
2426                                 j = 0;\r
2427                                 while ( (matcher = setMatchers[j++]) ) {\r
2428                                         matcher( unmatched, setMatched, context, xml );\r
2429                                 }\r
2430 \r
2431                                 if ( seed ) {\r
2432                                         // Reintegrate element matches to eliminate the need for sorting\r
2433                                         if ( matchedCount > 0 ) {\r
2434                                                 while ( i-- ) {\r
2435                                                         if ( !(unmatched[i] || setMatched[i]) ) {\r
2436                                                                 setMatched[i] = pop.call( results );\r
2437                                                         }\r
2438                                                 }\r
2439                                         }\r
2440 \r
2441                                         // Discard index placeholder values to get only actual matches\r
2442                                         setMatched = condense( setMatched );\r
2443                                 }\r
2444 \r
2445                                 // Add matches to results\r
2446                                 push.apply( results, setMatched );\r
2447 \r
2448                                 // Seedless set matches succeeding multiple successful matchers stipulate sorting\r
2449                                 if ( outermost && !seed && setMatched.length > 0 &&\r
2450                                         ( matchedCount + setMatchers.length ) > 1 ) {\r
2451 \r
2452                                         Sizzle.uniqueSort( results );\r
2453                                 }\r
2454                         }\r
2455 \r
2456                         // Override manipulation of globals by nested matchers\r
2457                         if ( outermost ) {\r
2458                                 dirruns = dirrunsUnique;\r
2459                                 outermostContext = contextBackup;\r
2460                         }\r
2461 \r
2462                         return unmatched;\r
2463                 };\r
2464 \r
2465         return bySet ?\r
2466                 markFunction( superMatcher ) :\r
2467                 superMatcher;\r
2468 }\r
2469 \r
2470 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\r
2471         var i,\r
2472                 setMatchers = [],\r
2473                 elementMatchers = [],\r
2474                 cached = compilerCache[ selector + " " ];\r
2475 \r
2476         if ( !cached ) {\r
2477                 // Generate a function of recursive functions that can be used to check each element\r
2478                 if ( !match ) {\r
2479                         match = tokenize( selector );\r
2480                 }\r
2481                 i = match.length;\r
2482                 while ( i-- ) {\r
2483                         cached = matcherFromTokens( match[i] );\r
2484                         if ( cached[ expando ] ) {\r
2485                                 setMatchers.push( cached );\r
2486                         } else {\r
2487                                 elementMatchers.push( cached );\r
2488                         }\r
2489                 }\r
2490 \r
2491                 // Cache the compiled function\r
2492                 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\r
2493 \r
2494                 // Save selector and tokenization\r
2495                 cached.selector = selector;\r
2496         }\r
2497         return cached;\r
2498 };\r
2499 \r
2500 /**\r
2501  * A low-level selection function that works with Sizzle's compiled\r
2502  *  selector functions\r
2503  * @param {String|Function} selector A selector or a pre-compiled\r
2504  *  selector function built with Sizzle.compile\r
2505  * @param {Element} context\r
2506  * @param {Array} [results]\r
2507  * @param {Array} [seed] A set of elements to match against\r
2508  */\r
2509 select = Sizzle.select = function( selector, context, results, seed ) {\r
2510         var i, tokens, token, type, find,\r
2511                 compiled = typeof selector === "function" && selector,\r
2512                 match = !seed && tokenize( (selector = compiled.selector || selector) );\r
2513 \r
2514         results = results || [];\r
2515 \r
2516         // Try to minimize operations if there is no seed and only one group\r
2517         if ( match.length === 1 ) {\r
2518 \r
2519                 // Take a shortcut and set the context if the root selector is an ID\r
2520                 tokens = match[0] = match[0].slice( 0 );\r
2521                 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&\r
2522                                 support.getById && context.nodeType === 9 && documentIsHTML &&\r
2523                                 Expr.relative[ tokens[1].type ] ) {\r
2524 \r
2525                         context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\r
2526                         if ( !context ) {\r
2527                                 return results;\r
2528 \r
2529                         // Precompiled matchers will still verify ancestry, so step up a level\r
2530                         } else if ( compiled ) {\r
2531                                 context = context.parentNode;\r
2532                         }\r
2533 \r
2534                         selector = selector.slice( tokens.shift().value.length );\r
2535                 }\r
2536 \r
2537                 // Fetch a seed set for right-to-left matching\r
2538                 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;\r
2539                 while ( i-- ) {\r
2540                         token = tokens[i];\r
2541 \r
2542                         // Abort if we hit a combinator\r
2543                         if ( Expr.relative[ (type = token.type) ] ) {\r
2544                                 break;\r
2545                         }\r
2546                         if ( (find = Expr.find[ type ]) ) {\r
2547                                 // Search, expanding context for leading sibling combinators\r
2548                                 if ( (seed = find(\r
2549                                         token.matches[0].replace( runescape, funescape ),\r
2550                                         rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\r
2551                                 )) ) {\r
2552 \r
2553                                         // If seed is empty or no tokens remain, we can return early\r
2554                                         tokens.splice( i, 1 );\r
2555                                         selector = seed.length && toSelector( tokens );\r
2556                                         if ( !selector ) {\r
2557                                                 push.apply( results, seed );\r
2558                                                 return results;\r
2559                                         }\r
2560 \r
2561                                         break;\r
2562                                 }\r
2563                         }\r
2564                 }\r
2565         }\r
2566 \r
2567         // Compile and execute a filtering function if one is not provided\r
2568         // Provide `match` to avoid retokenization if we modified the selector above\r
2569         ( compiled || compile( selector, match ) )(\r
2570                 seed,\r
2571                 context,\r
2572                 !documentIsHTML,\r
2573                 results,\r
2574                 rsibling.test( selector ) && testContext( context.parentNode ) || context\r
2575         );\r
2576         return results;\r
2577 };\r
2578 \r
2579 // One-time assignments\r
2580 \r
2581 // Sort stability\r
2582 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;\r
2583 \r
2584 // Support: Chrome 14-35+\r
2585 // Always assume duplicates if they aren't passed to the comparison function\r
2586 support.detectDuplicates = !!hasDuplicate;\r
2587 \r
2588 // Initialize against the default document\r
2589 setDocument();\r
2590 \r
2591 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\r
2592 // Detached nodes confoundingly follow *each other*\r
2593 support.sortDetached = assert(function( div1 ) {\r
2594         // Should return 1, but returns 4 (following)\r
2595         return div1.compareDocumentPosition( document.createElement("div") ) & 1;\r
2596 });\r
2597 \r
2598 // Support: IE<8\r
2599 // Prevent attribute/property "interpolation"\r
2600 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\r
2601 if ( !assert(function( div ) {\r
2602         div.innerHTML = "<a href='#'></a>";\r
2603         return div.firstChild.getAttribute("href") === "#" ;\r
2604 }) ) {\r
2605         addHandle( "type|href|height|width", function( elem, name, isXML ) {\r
2606                 if ( !isXML ) {\r
2607                         return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );\r
2608                 }\r
2609         });\r
2610 }\r
2611 \r
2612 // Support: IE<9\r
2613 // Use defaultValue in place of getAttribute("value")\r
2614 if ( !support.attributes || !assert(function( div ) {\r
2615         div.innerHTML = "<input/>";\r
2616         div.firstChild.setAttribute( "value", "" );\r
2617         return div.firstChild.getAttribute( "value" ) === "";\r
2618 }) ) {\r
2619         addHandle( "value", function( elem, name, isXML ) {\r
2620                 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {\r
2621                         return elem.defaultValue;\r
2622                 }\r
2623         });\r
2624 }\r
2625 \r
2626 // Support: IE<9\r
2627 // Use getAttributeNode to fetch booleans when getAttribute lies\r
2628 if ( !assert(function( div ) {\r
2629         return div.getAttribute("disabled") == null;\r
2630 }) ) {\r
2631         addHandle( booleans, function( elem, name, isXML ) {\r
2632                 var val;\r
2633                 if ( !isXML ) {\r
2634                         return elem[ name ] === true ? name.toLowerCase() :\r
2635                                         (val = elem.getAttributeNode( name )) && val.specified ?\r
2636                                         val.value :\r
2637                                 null;\r
2638                 }\r
2639         });\r
2640 }\r
2641 \r
2642 return Sizzle;\r
2643 \r
2644 })( window );\r
2645 \r
2646 \r
2647 \r
2648 jQuery.find = Sizzle;\r
2649 jQuery.expr = Sizzle.selectors;\r
2650 jQuery.expr[":"] = jQuery.expr.pseudos;\r
2651 jQuery.unique = Sizzle.uniqueSort;\r
2652 jQuery.text = Sizzle.getText;\r
2653 jQuery.isXMLDoc = Sizzle.isXML;\r
2654 jQuery.contains = Sizzle.contains;\r
2655 \r
2656 \r
2657 \r
2658 var rneedsContext = jQuery.expr.match.needsContext;\r
2659 \r
2660 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);\r
2661 \r
2662 \r
2663 \r
2664 var risSimple = /^.[^:#\[\.,]*$/;\r
2665 \r
2666 // Implement the identical functionality for filter and not\r
2667 function winnow( elements, qualifier, not ) {\r
2668         if ( jQuery.isFunction( qualifier ) ) {\r
2669                 return jQuery.grep( elements, function( elem, i ) {\r
2670                         /* jshint -W018 */\r
2671                         return !!qualifier.call( elem, i, elem ) !== not;\r
2672                 });\r
2673 \r
2674         }\r
2675 \r
2676         if ( qualifier.nodeType ) {\r
2677                 return jQuery.grep( elements, function( elem ) {\r
2678                         return ( elem === qualifier ) !== not;\r
2679                 });\r
2680 \r
2681         }\r
2682 \r
2683         if ( typeof qualifier === "string" ) {\r
2684                 if ( risSimple.test( qualifier ) ) {\r
2685                         return jQuery.filter( qualifier, elements, not );\r
2686                 }\r
2687 \r
2688                 qualifier = jQuery.filter( qualifier, elements );\r
2689         }\r
2690 \r
2691         return jQuery.grep( elements, function( elem ) {\r
2692                 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;\r
2693         });\r
2694 }\r
2695 \r
2696 jQuery.filter = function( expr, elems, not ) {\r
2697         var elem = elems[ 0 ];\r
2698 \r
2699         if ( not ) {\r
2700                 expr = ":not(" + expr + ")";\r
2701         }\r
2702 \r
2703         return elems.length === 1 && elem.nodeType === 1 ?\r
2704                 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\r
2705                 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\r
2706                         return elem.nodeType === 1;\r
2707                 }));\r
2708 };\r
2709 \r
2710 jQuery.fn.extend({\r
2711         find: function( selector ) {\r
2712                 var i,\r
2713                         ret = [],\r
2714                         self = this,\r
2715                         len = self.length;\r
2716 \r
2717                 if ( typeof selector !== "string" ) {\r
2718                         return this.pushStack( jQuery( selector ).filter(function() {\r
2719                                 for ( i = 0; i < len; i++ ) {\r
2720                                         if ( jQuery.contains( self[ i ], this ) ) {\r
2721                                                 return true;\r
2722                                         }\r
2723                                 }\r
2724                         }) );\r
2725                 }\r
2726 \r
2727                 for ( i = 0; i < len; i++ ) {\r
2728                         jQuery.find( selector, self[ i ], ret );\r
2729                 }\r
2730 \r
2731                 // Needed because $( selector, context ) becomes $( context ).find( selector )\r
2732                 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\r
2733                 ret.selector = this.selector ? this.selector + " " + selector : selector;\r
2734                 return ret;\r
2735         },\r
2736         filter: function( selector ) {\r
2737                 return this.pushStack( winnow(this, selector || [], false) );\r
2738         },\r
2739         not: function( selector ) {\r
2740                 return this.pushStack( winnow(this, selector || [], true) );\r
2741         },\r
2742         is: function( selector ) {\r
2743                 return !!winnow(\r
2744                         this,\r
2745 \r
2746                         // If this is a positional/relative selector, check membership in the returned set\r
2747                         // so $("p:first").is("p:last") won't return true for a doc with two "p".\r
2748                         typeof selector === "string" && rneedsContext.test( selector ) ?\r
2749                                 jQuery( selector ) :\r
2750                                 selector || [],\r
2751                         false\r
2752                 ).length;\r
2753         }\r
2754 });\r
2755 \r
2756 \r
2757 // Initialize a jQuery object\r
2758 \r
2759 \r
2760 // A central reference to the root jQuery(document)\r
2761 var rootjQuery,\r
2762 \r
2763         // Use the correct document accordingly with window argument (sandbox)\r
2764         document = window.document,\r
2765 \r
2766         // A simple way to check for HTML strings\r
2767         // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\r
2768         // Strict HTML recognition (#11290: must start with <)\r
2769         rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,\r
2770 \r
2771         init = jQuery.fn.init = function( selector, context ) {\r
2772                 var match, elem;\r
2773 \r
2774                 // HANDLE: $(""), $(null), $(undefined), $(false)\r
2775                 if ( !selector ) {\r
2776                         return this;\r
2777                 }\r
2778 \r
2779                 // Handle HTML strings\r
2780                 if ( typeof selector === "string" ) {\r
2781                         if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {\r
2782                                 // Assume that strings that start and end with <> are HTML and skip the regex check\r
2783                                 match = [ null, selector, null ];\r
2784 \r
2785                         } else {\r
2786                                 match = rquickExpr.exec( selector );\r
2787                         }\r
2788 \r
2789                         // Match html or make sure no context is specified for #id\r
2790                         if ( match && (match[1] || !context) ) {\r
2791 \r
2792                                 // HANDLE: $(html) -> $(array)\r
2793                                 if ( match[1] ) {\r
2794                                         context = context instanceof jQuery ? context[0] : context;\r
2795 \r
2796                                         // scripts is true for back-compat\r
2797                                         // Intentionally let the error be thrown if parseHTML is not present\r
2798                                         jQuery.merge( this, jQuery.parseHTML(\r
2799                                                 match[1],\r
2800                                                 context && context.nodeType ? context.ownerDocument || context : document,\r
2801                                                 true\r
2802                                         ) );\r
2803 \r
2804                                         // HANDLE: $(html, props)\r
2805                                         if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\r
2806                                                 for ( match in context ) {\r
2807                                                         // Properties of context are called as methods if possible\r
2808                                                         if ( jQuery.isFunction( this[ match ] ) ) {\r
2809                                                                 this[ match ]( context[ match ] );\r
2810 \r
2811                                                         // ...and otherwise set as attributes\r
2812                                                         } else {\r
2813                                                                 this.attr( match, context[ match ] );\r
2814                                                         }\r
2815                                                 }\r
2816                                         }\r
2817 \r
2818                                         return this;\r
2819 \r
2820                                 // HANDLE: $(#id)\r
2821                                 } else {\r
2822                                         elem = document.getElementById( match[2] );\r
2823 \r
2824                                         // Check parentNode to catch when Blackberry 4.6 returns\r
2825                                         // nodes that are no longer in the document #6963\r
2826                                         if ( elem && elem.parentNode ) {\r
2827                                                 // Handle the case where IE and Opera return items\r
2828                                                 // by name instead of ID\r
2829                                                 if ( elem.id !== match[2] ) {\r
2830                                                         return rootjQuery.find( selector );\r
2831                                                 }\r
2832 \r
2833                                                 // Otherwise, we inject the element directly into the jQuery object\r
2834                                                 this.length = 1;\r
2835                                                 this[0] = elem;\r
2836                                         }\r
2837 \r
2838                                         this.context = document;\r
2839                                         this.selector = selector;\r
2840                                         return this;\r
2841                                 }\r
2842 \r
2843                         // HANDLE: $(expr, $(...))\r
2844                         } else if ( !context || context.jquery ) {\r
2845                                 return ( context || rootjQuery ).find( selector );\r
2846 \r
2847                         // HANDLE: $(expr, context)\r
2848                         // (which is just equivalent to: $(context).find(expr)\r
2849                         } else {\r
2850                                 return this.constructor( context ).find( selector );\r
2851                         }\r
2852 \r
2853                 // HANDLE: $(DOMElement)\r
2854                 } else if ( selector.nodeType ) {\r
2855                         this.context = this[0] = selector;\r
2856                         this.length = 1;\r
2857                         return this;\r
2858 \r
2859                 // HANDLE: $(function)\r
2860                 // Shortcut for document ready\r
2861                 } else if ( jQuery.isFunction( selector ) ) {\r
2862                         return typeof rootjQuery.ready !== "undefined" ?\r
2863                                 rootjQuery.ready( selector ) :\r
2864                                 // Execute immediately if ready is not present\r
2865                                 selector( jQuery );\r
2866                 }\r
2867 \r
2868                 if ( selector.selector !== undefined ) {\r
2869                         this.selector = selector.selector;\r
2870                         this.context = selector.context;\r
2871                 }\r
2872 \r
2873                 return jQuery.makeArray( selector, this );\r
2874         };\r
2875 \r
2876 // Give the init function the jQuery prototype for later instantiation\r
2877 init.prototype = jQuery.fn;\r
2878 \r
2879 // Initialize central reference\r
2880 rootjQuery = jQuery( document );\r
2881 \r
2882 \r
2883 var rparentsprev = /^(?:parents|prev(?:Until|All))/,\r
2884         // methods guaranteed to produce a unique set when starting from a unique set\r
2885         guaranteedUnique = {\r
2886                 children: true,\r
2887                 contents: true,\r
2888                 next: true,\r
2889                 prev: true\r
2890         };\r
2891 \r
2892 jQuery.extend({\r
2893         dir: function( elem, dir, until ) {\r
2894                 var matched = [],\r
2895                         cur = elem[ dir ];\r
2896 \r
2897                 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {\r
2898                         if ( cur.nodeType === 1 ) {\r
2899                                 matched.push( cur );\r
2900                         }\r
2901                         cur = cur[dir];\r
2902                 }\r
2903                 return matched;\r
2904         },\r
2905 \r
2906         sibling: function( n, elem ) {\r
2907                 var r = [];\r
2908 \r
2909                 for ( ; n; n = n.nextSibling ) {\r
2910                         if ( n.nodeType === 1 && n !== elem ) {\r
2911                                 r.push( n );\r
2912                         }\r
2913                 }\r
2914 \r
2915                 return r;\r
2916         }\r
2917 });\r
2918 \r
2919 jQuery.fn.extend({\r
2920         has: function( target ) {\r
2921                 var i,\r
2922                         targets = jQuery( target, this ),\r
2923                         len = targets.length;\r
2924 \r
2925                 return this.filter(function() {\r
2926                         for ( i = 0; i < len; i++ ) {\r
2927                                 if ( jQuery.contains( this, targets[i] ) ) {\r
2928                                         return true;\r
2929                                 }\r
2930                         }\r
2931                 });\r
2932         },\r
2933 \r
2934         closest: function( selectors, context ) {\r
2935                 var cur,\r
2936                         i = 0,\r
2937                         l = this.length,\r
2938                         matched = [],\r
2939                         pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?\r
2940                                 jQuery( selectors, context || this.context ) :\r
2941                                 0;\r
2942 \r
2943                 for ( ; i < l; i++ ) {\r
2944                         for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {\r
2945                                 // Always skip document fragments\r
2946                                 if ( cur.nodeType < 11 && (pos ?\r
2947                                         pos.index(cur) > -1 :\r
2948 \r
2949                                         // Don't pass non-elements to Sizzle\r
2950                                         cur.nodeType === 1 &&\r
2951                                                 jQuery.find.matchesSelector(cur, selectors)) ) {\r
2952 \r
2953                                         matched.push( cur );\r
2954                                         break;\r
2955                                 }\r
2956                         }\r
2957                 }\r
2958 \r
2959                 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );\r
2960         },\r
2961 \r
2962         // Determine the position of an element within\r
2963         // the matched set of elements\r
2964         index: function( elem ) {\r
2965 \r
2966                 // No argument, return index in parent\r
2967                 if ( !elem ) {\r
2968                         return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;\r
2969                 }\r
2970 \r
2971                 // index in selector\r
2972                 if ( typeof elem === "string" ) {\r
2973                         return jQuery.inArray( this[0], jQuery( elem ) );\r
2974                 }\r
2975 \r
2976                 // Locate the position of the desired element\r
2977                 return jQuery.inArray(\r
2978                         // If it receives a jQuery object, the first element is used\r
2979                         elem.jquery ? elem[0] : elem, this );\r
2980         },\r
2981 \r
2982         add: function( selector, context ) {\r
2983                 return this.pushStack(\r
2984                         jQuery.unique(\r
2985                                 jQuery.merge( this.get(), jQuery( selector, context ) )\r
2986                         )\r
2987                 );\r
2988         },\r
2989 \r
2990         addBack: function( selector ) {\r
2991                 return this.add( selector == null ?\r
2992                         this.prevObject : this.prevObject.filter(selector)\r
2993                 );\r
2994         }\r
2995 });\r
2996 \r
2997 function sibling( cur, dir ) {\r
2998         do {\r
2999                 cur = cur[ dir ];\r
3000         } while ( cur && cur.nodeType !== 1 );\r
3001 \r
3002         return cur;\r
3003 }\r
3004 \r
3005 jQuery.each({\r
3006         parent: function( elem ) {\r
3007                 var parent = elem.parentNode;\r
3008                 return parent && parent.nodeType !== 11 ? parent : null;\r
3009         },\r
3010         parents: function( elem ) {\r
3011                 return jQuery.dir( elem, "parentNode" );\r
3012         },\r
3013         parentsUntil: function( elem, i, until ) {\r
3014                 return jQuery.dir( elem, "parentNode", until );\r
3015         },\r
3016         next: function( elem ) {\r
3017                 return sibling( elem, "nextSibling" );\r
3018         },\r
3019         prev: function( elem ) {\r
3020                 return sibling( elem, "previousSibling" );\r
3021         },\r
3022         nextAll: function( elem ) {\r
3023                 return jQuery.dir( elem, "nextSibling" );\r
3024         },\r
3025         prevAll: function( elem ) {\r
3026                 return jQuery.dir( elem, "previousSibling" );\r
3027         },\r
3028         nextUntil: function( elem, i, until ) {\r
3029                 return jQuery.dir( elem, "nextSibling", until );\r
3030         },\r
3031         prevUntil: function( elem, i, until ) {\r
3032                 return jQuery.dir( elem, "previousSibling", until );\r
3033         },\r
3034         siblings: function( elem ) {\r
3035                 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\r
3036         },\r
3037         children: function( elem ) {\r
3038                 return jQuery.sibling( elem.firstChild );\r
3039         },\r
3040         contents: function( elem ) {\r
3041                 return jQuery.nodeName( elem, "iframe" ) ?\r
3042                         elem.contentDocument || elem.contentWindow.document :\r
3043                         jQuery.merge( [], elem.childNodes );\r
3044         }\r
3045 }, function( name, fn ) {\r
3046         jQuery.fn[ name ] = function( until, selector ) {\r
3047                 var ret = jQuery.map( this, fn, until );\r
3048 \r
3049                 if ( name.slice( -5 ) !== "Until" ) {\r
3050                         selector = until;\r
3051                 }\r
3052 \r
3053                 if ( selector && typeof selector === "string" ) {\r
3054                         ret = jQuery.filter( selector, ret );\r
3055                 }\r
3056 \r
3057                 if ( this.length > 1 ) {\r
3058                         // Remove duplicates\r
3059                         if ( !guaranteedUnique[ name ] ) {\r
3060                                 ret = jQuery.unique( ret );\r
3061                         }\r
3062 \r
3063                         // Reverse order for parents* and prev-derivatives\r
3064                         if ( rparentsprev.test( name ) ) {\r
3065                                 ret = ret.reverse();\r
3066                         }\r
3067                 }\r
3068 \r
3069                 return this.pushStack( ret );\r
3070         };\r
3071 });\r
3072 var rnotwhite = (/\S+/g);\r
3073 \r
3074 \r
3075 \r
3076 // String to Object options format cache\r
3077 var optionsCache = {};\r
3078 \r
3079 // Convert String-formatted options into Object-formatted ones and store in cache\r
3080 function createOptions( options ) {\r
3081         var object = optionsCache[ options ] = {};\r
3082         jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\r
3083                 object[ flag ] = true;\r
3084         });\r
3085         return object;\r
3086 }\r
3087 \r
3088 /*\r
3089  * Create a callback list using the following parameters:\r
3090  *\r
3091  *      options: an optional list of space-separated options that will change how\r
3092  *                      the callback list behaves or a more traditional option object\r
3093  *\r
3094  * By default a callback list will act like an event callback list and can be\r
3095  * "fired" multiple times.\r
3096  *\r
3097  * Possible options:\r
3098  *\r
3099  *      once:                   will ensure the callback list can only be fired once (like a Deferred)\r
3100  *\r
3101  *      memory:                 will keep track of previous values and will call any callback added\r
3102  *                                      after the list has been fired right away with the latest "memorized"\r
3103  *                                      values (like a Deferred)\r
3104  *\r
3105  *      unique:                 will ensure a callback can only be added once (no duplicate in the list)\r
3106  *\r
3107  *      stopOnFalse:    interrupt callings when a callback returns false\r
3108  *\r
3109  */\r
3110 jQuery.Callbacks = function( options ) {\r
3111 \r
3112         // Convert options from String-formatted to Object-formatted if needed\r
3113         // (we check in cache first)\r
3114         options = typeof options === "string" ?\r
3115                 ( optionsCache[ options ] || createOptions( options ) ) :\r
3116                 jQuery.extend( {}, options );\r
3117 \r
3118         var // Flag to know if list is currently firing\r
3119                 firing,\r
3120                 // Last fire value (for non-forgettable lists)\r
3121                 memory,\r
3122                 // Flag to know if list was already fired\r
3123                 fired,\r
3124                 // End of the loop when firing\r
3125                 firingLength,\r
3126                 // Index of currently firing callback (modified by remove if needed)\r
3127                 firingIndex,\r
3128                 // First callback to fire (used internally by add and fireWith)\r
3129                 firingStart,\r
3130                 // Actual callback list\r
3131                 list = [],\r
3132                 // Stack of fire calls for repeatable lists\r
3133                 stack = !options.once && [],\r
3134                 // Fire callbacks\r
3135                 fire = function( data ) {\r
3136                         memory = options.memory && data;\r
3137                         fired = true;\r
3138                         firingIndex = firingStart || 0;\r
3139                         firingStart = 0;\r
3140                         firingLength = list.length;\r
3141                         firing = true;\r
3142                         for ( ; list && firingIndex < firingLength; firingIndex++ ) {\r
3143                                 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\r
3144                                         memory = false; // To prevent further calls using add\r
3145                                         break;\r
3146                                 }\r
3147                         }\r
3148                         firing = false;\r
3149                         if ( list ) {\r
3150                                 if ( stack ) {\r
3151                                         if ( stack.length ) {\r
3152                                                 fire( stack.shift() );\r
3153                                         }\r
3154                                 } else if ( memory ) {\r
3155                                         list = [];\r
3156                                 } else {\r
3157                                         self.disable();\r
3158                                 }\r
3159                         }\r
3160                 },\r
3161                 // Actual Callbacks object\r
3162                 self = {\r
3163                         // Add a callback or a collection of callbacks to the list\r
3164                         add: function() {\r
3165                                 if ( list ) {\r
3166                                         // First, we save the current length\r
3167                                         var start = list.length;\r
3168                                         (function add( args ) {\r
3169                                                 jQuery.each( args, function( _, arg ) {\r
3170                                                         var type = jQuery.type( arg );\r
3171                                                         if ( type === "function" ) {\r
3172                                                                 if ( !options.unique || !self.has( arg ) ) {\r
3173                                                                         list.push( arg );\r
3174                                                                 }\r
3175                                                         } else if ( arg && arg.length && type !== "string" ) {\r
3176                                                                 // Inspect recursively\r
3177                                                                 add( arg );\r
3178                                                         }\r
3179                                                 });\r
3180                                         })( arguments );\r
3181                                         // Do we need to add the callbacks to the\r
3182                                         // current firing batch?\r
3183                                         if ( firing ) {\r
3184                                                 firingLength = list.length;\r
3185                                         // With memory, if we're not firing then\r
3186                                         // we should call right away\r
3187                                         } else if ( memory ) {\r
3188                                                 firingStart = start;\r
3189                                                 fire( memory );\r
3190                                         }\r
3191                                 }\r
3192                                 return this;\r
3193                         },\r
3194                         // Remove a callback from the list\r
3195                         remove: function() {\r
3196                                 if ( list ) {\r
3197                                         jQuery.each( arguments, function( _, arg ) {\r
3198                                                 var index;\r
3199                                                 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\r
3200                                                         list.splice( index, 1 );\r
3201                                                         // Handle firing indexes\r
3202                                                         if ( firing ) {\r
3203                                                                 if ( index <= firingLength ) {\r
3204                                                                         firingLength--;\r
3205                                                                 }\r
3206                                                                 if ( index <= firingIndex ) {\r
3207                                                                         firingIndex--;\r
3208                                                                 }\r
3209                                                         }\r
3210                                                 }\r
3211                                         });\r
3212                                 }\r
3213                                 return this;\r
3214                         },\r
3215                         // Check if a given callback is in the list.\r
3216                         // If no argument is given, return whether or not list has callbacks attached.\r
3217                         has: function( fn ) {\r
3218                                 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\r
3219                         },\r
3220                         // Remove all callbacks from the list\r
3221                         empty: function() {\r
3222                                 list = [];\r
3223                                 firingLength = 0;\r
3224                                 return this;\r
3225                         },\r
3226                         // Have the list do nothing anymore\r
3227                         disable: function() {\r
3228                                 list = stack = memory = undefined;\r
3229                                 return this;\r
3230                         },\r
3231                         // Is it disabled?\r
3232                         disabled: function() {\r
3233                                 return !list;\r
3234                         },\r
3235                         // Lock the list in its current state\r
3236                         lock: function() {\r
3237                                 stack = undefined;\r
3238                                 if ( !memory ) {\r
3239                                         self.disable();\r
3240                                 }\r
3241                                 return this;\r
3242                         },\r
3243                         // Is it locked?\r
3244                         locked: function() {\r
3245                                 return !stack;\r
3246                         },\r
3247                         // Call all callbacks with the given context and arguments\r
3248                         fireWith: function( context, args ) {\r
3249                                 if ( list && ( !fired || stack ) ) {\r
3250                                         args = args || [];\r
3251                                         args = [ context, args.slice ? args.slice() : args ];\r
3252                                         if ( firing ) {\r
3253                                                 stack.push( args );\r
3254                                         } else {\r
3255                                                 fire( args );\r
3256                                         }\r
3257                                 }\r
3258                                 return this;\r
3259                         },\r
3260                         // Call all the callbacks with the given arguments\r
3261                         fire: function() {\r
3262                                 self.fireWith( this, arguments );\r
3263                                 return this;\r
3264                         },\r
3265                         // To know if the callbacks have already been called at least once\r
3266                         fired: function() {\r
3267                                 return !!fired;\r
3268                         }\r
3269                 };\r
3270 \r
3271         return self;\r
3272 };\r
3273 \r
3274 \r
3275 jQuery.extend({\r
3276 \r
3277         Deferred: function( func ) {\r
3278                 var tuples = [\r
3279                                 // action, add listener, listener list, final state\r
3280                                 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],\r
3281                                 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],\r
3282                                 [ "notify", "progress", jQuery.Callbacks("memory") ]\r
3283                         ],\r
3284                         state = "pending",\r
3285                         promise = {\r
3286                                 state: function() {\r
3287                                         return state;\r
3288                                 },\r
3289                                 always: function() {\r
3290                                         deferred.done( arguments ).fail( arguments );\r
3291                                         return this;\r
3292                                 },\r
3293                                 then: function( /* fnDone, fnFail, fnProgress */ ) {\r
3294                                         var fns = arguments;\r
3295                                         return jQuery.Deferred(function( newDefer ) {\r
3296                                                 jQuery.each( tuples, function( i, tuple ) {\r
3297                                                         var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\r
3298                                                         // deferred[ done | fail | progress ] for forwarding actions to newDefer\r
3299                                                         deferred[ tuple[1] ](function() {\r
3300                                                                 var returned = fn && fn.apply( this, arguments );\r
3301                                                                 if ( returned && jQuery.isFunction( returned.promise ) ) {\r
3302                                                                         returned.promise()\r
3303                                                                                 .done( newDefer.resolve )\r
3304                                                                                 .fail( newDefer.reject )\r
3305                                                                                 .progress( newDefer.notify );\r
3306                                                                 } else {\r
3307                                                                         newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\r
3308                                                                 }\r
3309                                                         });\r
3310                                                 });\r
3311                                                 fns = null;\r
3312                                         }).promise();\r
3313                                 },\r
3314                                 // Get a promise for this deferred\r
3315                                 // If obj is provided, the promise aspect is added to the object\r
3316                                 promise: function( obj ) {\r
3317                                         return obj != null ? jQuery.extend( obj, promise ) : promise;\r
3318                                 }\r
3319                         },\r
3320                         deferred = {};\r
3321 \r
3322                 // Keep pipe for back-compat\r
3323                 promise.pipe = promise.then;\r
3324 \r
3325                 // Add list-specific methods\r
3326                 jQuery.each( tuples, function( i, tuple ) {\r
3327                         var list = tuple[ 2 ],\r
3328                                 stateString = tuple[ 3 ];\r
3329 \r
3330                         // promise[ done | fail | progress ] = list.add\r
3331                         promise[ tuple[1] ] = list.add;\r
3332 \r
3333                         // Handle state\r
3334                         if ( stateString ) {\r
3335                                 list.add(function() {\r
3336                                         // state = [ resolved | rejected ]\r
3337                                         state = stateString;\r
3338 \r
3339                                 // [ reject_list | resolve_list ].disable; progress_list.lock\r
3340                                 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\r
3341                         }\r
3342 \r
3343                         // deferred[ resolve | reject | notify ]\r
3344                         deferred[ tuple[0] ] = function() {\r
3345                                 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );\r
3346                                 return this;\r
3347                         };\r
3348                         deferred[ tuple[0] + "With" ] = list.fireWith;\r
3349                 });\r
3350 \r
3351                 // Make the deferred a promise\r
3352                 promise.promise( deferred );\r
3353 \r
3354                 // Call given func if any\r
3355                 if ( func ) {\r
3356                         func.call( deferred, deferred );\r
3357                 }\r
3358 \r
3359                 // All done!\r
3360                 return deferred;\r
3361         },\r
3362 \r
3363         // Deferred helper\r
3364         when: function( subordinate /* , ..., subordinateN */ ) {\r
3365                 var i = 0,\r
3366                         resolveValues = slice.call( arguments ),\r
3367                         length = resolveValues.length,\r
3368 \r
3369                         // the count of uncompleted subordinates\r
3370                         remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\r
3371 \r
3372                         // the master Deferred. If resolveValues consist of only a single Deferred, just use that.\r
3373                         deferred = remaining === 1 ? subordinate : jQuery.Deferred(),\r
3374 \r
3375                         // Update function for both resolve and progress values\r
3376                         updateFunc = function( i, contexts, values ) {\r
3377                                 return function( value ) {\r
3378                                         contexts[ i ] = this;\r
3379                                         values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\r
3380                                         if ( values === progressValues ) {\r
3381                                                 deferred.notifyWith( contexts, values );\r
3382 \r
3383                                         } else if ( !(--remaining) ) {\r
3384                                                 deferred.resolveWith( contexts, values );\r
3385                                         }\r
3386                                 };\r
3387                         },\r
3388 \r
3389                         progressValues, progressContexts, resolveContexts;\r
3390 \r
3391                 // add listeners to Deferred subordinates; treat others as resolved\r
3392                 if ( length > 1 ) {\r
3393                         progressValues = new Array( length );\r
3394                         progressContexts = new Array( length );\r
3395                         resolveContexts = new Array( length );\r
3396                         for ( ; i < length; i++ ) {\r
3397                                 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\r
3398                                         resolveValues[ i ].promise()\r
3399                                                 .done( updateFunc( i, resolveContexts, resolveValues ) )\r
3400                                                 .fail( deferred.reject )\r
3401                                                 .progress( updateFunc( i, progressContexts, progressValues ) );\r
3402                                 } else {\r
3403                                         --remaining;\r
3404                                 }\r
3405                         }\r
3406                 }\r
3407 \r
3408                 // if we're not waiting on anything, resolve the master\r
3409                 if ( !remaining ) {\r
3410                         deferred.resolveWith( resolveContexts, resolveValues );\r
3411                 }\r
3412 \r
3413                 return deferred.promise();\r
3414         }\r
3415 });\r
3416 \r
3417 \r
3418 // The deferred used on DOM ready\r
3419 var readyList;\r
3420 \r
3421 jQuery.fn.ready = function( fn ) {\r
3422         // Add the callback\r
3423         jQuery.ready.promise().done( fn );\r
3424 \r
3425         return this;\r
3426 };\r
3427 \r
3428 jQuery.extend({\r
3429         // Is the DOM ready to be used? Set to true once it occurs.\r
3430         isReady: false,\r
3431 \r
3432         // A counter to track how many items to wait for before\r
3433         // the ready event fires. See #6781\r
3434         readyWait: 1,\r
3435 \r
3436         // Hold (or release) the ready event\r
3437         holdReady: function( hold ) {\r
3438                 if ( hold ) {\r
3439                         jQuery.readyWait++;\r
3440                 } else {\r
3441                         jQuery.ready( true );\r
3442                 }\r
3443         },\r
3444 \r
3445         // Handle when the DOM is ready\r
3446         ready: function( wait ) {\r
3447 \r
3448                 // Abort if there are pending holds or we're already ready\r
3449                 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\r
3450                         return;\r
3451                 }\r
3452 \r
3453                 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\r
3454                 if ( !document.body ) {\r
3455                         return setTimeout( jQuery.ready );\r
3456                 }\r
3457 \r
3458                 // Remember that the DOM is ready\r
3459                 jQuery.isReady = true;\r
3460 \r
3461                 // If a normal DOM Ready event fired, decrement, and wait if need be\r
3462                 if ( wait !== true && --jQuery.readyWait > 0 ) {\r
3463                         return;\r
3464                 }\r
3465 \r
3466                 // If there are functions bound, to execute\r
3467                 readyList.resolveWith( document, [ jQuery ] );\r
3468 \r
3469                 // Trigger any bound ready events\r
3470                 if ( jQuery.fn.triggerHandler ) {\r
3471                         jQuery( document ).triggerHandler( "ready" );\r
3472                         jQuery( document ).off( "ready" );\r
3473                 }\r
3474         }\r
3475 });\r
3476 \r
3477 /**\r
3478  * Clean-up method for dom ready events\r
3479  */\r
3480 function detach() {\r
3481         if ( document.addEventListener ) {\r
3482                 document.removeEventListener( "DOMContentLoaded", completed, false );\r
3483                 window.removeEventListener( "load", completed, false );\r
3484 \r
3485         } else {\r
3486                 document.detachEvent( "onreadystatechange", completed );\r
3487                 window.detachEvent( "onload", completed );\r
3488         }\r
3489 }\r
3490 \r
3491 /**\r
3492  * The ready event handler and self cleanup method\r
3493  */\r
3494 function completed() {\r
3495         // readyState === "complete" is good enough for us to call the dom ready in oldIE\r
3496         if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {\r
3497                 detach();\r
3498                 jQuery.ready();\r
3499         }\r
3500 }\r
3501 \r
3502 jQuery.ready.promise = function( obj ) {\r
3503         if ( !readyList ) {\r
3504 \r
3505                 readyList = jQuery.Deferred();\r
3506 \r
3507                 // Catch cases where $(document).ready() is called after the browser event has already occurred.\r
3508                 // we once tried to use readyState "interactive" here, but it caused issues like the one\r
3509                 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\r
3510                 if ( document.readyState === "complete" ) {\r
3511                         // Handle it asynchronously to allow scripts the opportunity to delay ready\r
3512                         setTimeout( jQuery.ready );\r
3513 \r
3514                 // Standards-based browsers support DOMContentLoaded\r
3515                 } else if ( document.addEventListener ) {\r
3516                         // Use the handy event callback\r
3517                         document.addEventListener( "DOMContentLoaded", completed, false );\r
3518 \r
3519                         // A fallback to window.onload, that will always work\r
3520                         window.addEventListener( "load", completed, false );\r
3521 \r
3522                 // If IE event model is used\r
3523                 } else {\r
3524                         // Ensure firing before onload, maybe late but safe also for iframes\r
3525                         document.attachEvent( "onreadystatechange", completed );\r
3526 \r
3527                         // A fallback to window.onload, that will always work\r
3528                         window.attachEvent( "onload", completed );\r
3529 \r
3530                         // If IE and not a frame\r
3531                         // continually check to see if the document is ready\r
3532                         var top = false;\r
3533 \r
3534                         try {\r
3535                                 top = window.frameElement == null && document.documentElement;\r
3536                         } catch(e) {}\r
3537 \r
3538                         if ( top && top.doScroll ) {\r
3539                                 (function doScrollCheck() {\r
3540                                         if ( !jQuery.isReady ) {\r
3541 \r
3542                                                 try {\r
3543                                                         // Use the trick by Diego Perini\r
3544                                                         // http://javascript.nwbox.com/IEContentLoaded/\r
3545                                                         top.doScroll("left");\r
3546                                                 } catch(e) {\r
3547                                                         return setTimeout( doScrollCheck, 50 );\r
3548                                                 }\r
3549 \r
3550                                                 // detach all dom ready events\r
3551                                                 detach();\r
3552 \r
3553                                                 // and execute any waiting functions\r
3554                                                 jQuery.ready();\r
3555                                         }\r
3556                                 })();\r
3557                         }\r
3558                 }\r
3559         }\r
3560         return readyList.promise( obj );\r
3561 };\r
3562 \r
3563 \r
3564 var strundefined = typeof undefined;\r
3565 \r
3566 \r
3567 \r
3568 // Support: IE<9\r
3569 // Iteration over object's inherited properties before its own\r
3570 var i;\r
3571 for ( i in jQuery( support ) ) {\r
3572         break;\r
3573 }\r
3574 support.ownLast = i !== "0";\r
3575 \r
3576 // Note: most support tests are defined in their respective modules.\r
3577 // false until the test is run\r
3578 support.inlineBlockNeedsLayout = false;\r
3579 \r
3580 // Execute ASAP in case we need to set body.style.zoom\r
3581 jQuery(function() {\r
3582         // Minified: var a,b,c,d\r
3583         var val, div, body, container;\r
3584 \r
3585         body = document.getElementsByTagName( "body" )[ 0 ];\r
3586         if ( !body || !body.style ) {\r
3587                 // Return for frameset docs that don't have a body\r
3588                 return;\r
3589         }\r
3590 \r
3591         // Setup\r
3592         div = document.createElement( "div" );\r
3593         container = document.createElement( "div" );\r
3594         container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";\r
3595         body.appendChild( container ).appendChild( div );\r
3596 \r
3597         if ( typeof div.style.zoom !== strundefined ) {\r
3598                 // Support: IE<8\r
3599                 // Check if natively block-level elements act like inline-block\r
3600                 // elements when setting their display to 'inline' and giving\r
3601                 // them layout\r
3602                 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";\r
3603 \r
3604                 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;\r
3605                 if ( val ) {\r
3606                         // Prevent IE 6 from affecting layout for positioned elements #11048\r
3607                         // Prevent IE from shrinking the body in IE 7 mode #12869\r
3608                         // Support: IE<8\r
3609                         body.style.zoom = 1;\r
3610                 }\r
3611         }\r
3612 \r
3613         body.removeChild( container );\r
3614 });\r
3615 \r
3616 \r
3617 \r
3618 \r
3619 (function() {\r
3620         var div = document.createElement( "div" );\r
3621 \r
3622         // Execute the test only if not already executed in another module.\r
3623         if (support.deleteExpando == null) {\r
3624                 // Support: IE<9\r
3625                 support.deleteExpando = true;\r
3626                 try {\r
3627                         delete div.test;\r
3628                 } catch( e ) {\r
3629                         support.deleteExpando = false;\r
3630                 }\r
3631         }\r
3632 \r
3633         // Null elements to avoid leaks in IE.\r
3634         div = null;\r
3635 })();\r
3636 \r
3637 \r
3638 /**\r
3639  * Determines whether an object can have data\r
3640  */\r
3641 jQuery.acceptData = function( elem ) {\r
3642         var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],\r
3643                 nodeType = +elem.nodeType || 1;\r
3644 \r
3645         // Do not set data on non-element DOM nodes because it will not be cleared (#8335).\r
3646         return nodeType !== 1 && nodeType !== 9 ?\r
3647                 false :\r
3648 \r
3649                 // Nodes accept data unless otherwise specified; rejection can be conditional\r
3650                 !noData || noData !== true && elem.getAttribute("classid") === noData;\r
3651 };\r
3652 \r
3653 \r
3654 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,\r
3655         rmultiDash = /([A-Z])/g;\r
3656 \r
3657 function dataAttr( elem, key, data ) {\r
3658         // If nothing was found internally, try to fetch any\r
3659         // data from the HTML5 data-* attribute\r
3660         if ( data === undefined && elem.nodeType === 1 ) {\r
3661 \r
3662                 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();\r
3663 \r
3664                 data = elem.getAttribute( name );\r
3665 \r
3666                 if ( typeof data === "string" ) {\r
3667                         try {\r
3668                                 data = data === "true" ? true :\r
3669                                         data === "false" ? false :\r
3670                                         data === "null" ? null :\r
3671                                         // Only convert to a number if it doesn't change the string\r
3672                                         +data + "" === data ? +data :\r
3673                                         rbrace.test( data ) ? jQuery.parseJSON( data ) :\r
3674                                         data;\r
3675                         } catch( e ) {}\r
3676 \r
3677                         // Make sure we set the data so it isn't changed later\r
3678                         jQuery.data( elem, key, data );\r
3679 \r
3680                 } else {\r
3681                         data = undefined;\r
3682                 }\r
3683         }\r
3684 \r
3685         return data;\r
3686 }\r
3687 \r
3688 // checks a cache object for emptiness\r
3689 function isEmptyDataObject( obj ) {\r
3690         var name;\r
3691         for ( name in obj ) {\r
3692 \r
3693                 // if the public data object is empty, the private is still empty\r
3694                 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {\r
3695                         continue;\r
3696                 }\r
3697                 if ( name !== "toJSON" ) {\r
3698                         return false;\r
3699                 }\r
3700         }\r
3701 \r
3702         return true;\r
3703 }\r
3704 \r
3705 function internalData( elem, name, data, pvt /* Internal Use Only */ ) {\r
3706         if ( !jQuery.acceptData( elem ) ) {\r
3707                 return;\r
3708         }\r
3709 \r
3710         var ret, thisCache,\r
3711                 internalKey = jQuery.expando,\r
3712 \r
3713                 // We have to handle DOM nodes and JS objects differently because IE6-7\r
3714                 // can't GC object references properly across the DOM-JS boundary\r
3715                 isNode = elem.nodeType,\r
3716 \r
3717                 // Only DOM nodes need the global jQuery cache; JS object data is\r
3718                 // attached directly to the object so GC can occur automatically\r
3719                 cache = isNode ? jQuery.cache : elem,\r
3720 \r
3721                 // Only defining an ID for JS objects if its cache already exists allows\r
3722                 // the code to shortcut on the same path as a DOM node with no cache\r
3723                 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;\r
3724 \r
3725         // Avoid doing any more work than we need to when trying to get data on an\r
3726         // object that has no data at all\r
3727         if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {\r
3728                 return;\r
3729         }\r
3730 \r
3731         if ( !id ) {\r
3732                 // Only DOM nodes need a new unique ID for each element since their data\r
3733                 // ends up in the global cache\r
3734                 if ( isNode ) {\r
3735                         id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;\r
3736                 } else {\r
3737                         id = internalKey;\r
3738                 }\r
3739         }\r
3740 \r
3741         if ( !cache[ id ] ) {\r
3742                 // Avoid exposing jQuery metadata on plain JS objects when the object\r
3743                 // is serialized using JSON.stringify\r
3744                 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };\r
3745         }\r
3746 \r
3747         // An object can be passed to jQuery.data instead of a key/value pair; this gets\r
3748         // shallow copied over onto the existing cache\r
3749         if ( typeof name === "object" || typeof name === "function" ) {\r
3750                 if ( pvt ) {\r
3751                         cache[ id ] = jQuery.extend( cache[ id ], name );\r
3752                 } else {\r
3753                         cache[ id ].data = jQuery.extend( cache[ id ].data, name );\r
3754                 }\r
3755         }\r
3756 \r
3757         thisCache = cache[ id ];\r
3758 \r
3759         // jQuery data() is stored in a separate object inside the object's internal data\r
3760         // cache in order to avoid key collisions between internal data and user-defined\r
3761         // data.\r
3762         if ( !pvt ) {\r
3763                 if ( !thisCache.data ) {\r
3764                         thisCache.data = {};\r
3765                 }\r
3766 \r
3767                 thisCache = thisCache.data;\r
3768         }\r
3769 \r
3770         if ( data !== undefined ) {\r
3771                 thisCache[ jQuery.camelCase( name ) ] = data;\r
3772         }\r
3773 \r
3774         // Check for both converted-to-camel and non-converted data property names\r
3775         // If a data property was specified\r
3776         if ( typeof name === "string" ) {\r
3777 \r
3778                 // First Try to find as-is property data\r
3779                 ret = thisCache[ name ];\r
3780 \r
3781                 // Test for null|undefined property data\r
3782                 if ( ret == null ) {\r
3783 \r
3784                         // Try to find the camelCased property\r
3785                         ret = thisCache[ jQuery.camelCase( name ) ];\r
3786                 }\r
3787         } else {\r
3788                 ret = thisCache;\r
3789         }\r
3790 \r
3791         return ret;\r
3792 }\r
3793 \r
3794 function internalRemoveData( elem, name, pvt ) {\r
3795         if ( !jQuery.acceptData( elem ) ) {\r
3796                 return;\r
3797         }\r
3798 \r
3799         var thisCache, i,\r
3800                 isNode = elem.nodeType,\r
3801 \r
3802                 // See jQuery.data for more information\r
3803                 cache = isNode ? jQuery.cache : elem,\r
3804                 id = isNode ? elem[ jQuery.expando ] : jQuery.expando;\r
3805 \r
3806         // If there is already no cache entry for this object, there is no\r
3807         // purpose in continuing\r
3808         if ( !cache[ id ] ) {\r
3809                 return;\r
3810         }\r
3811 \r
3812         if ( name ) {\r
3813 \r
3814                 thisCache = pvt ? cache[ id ] : cache[ id ].data;\r
3815 \r
3816                 if ( thisCache ) {\r
3817 \r
3818                         // Support array or space separated string names for data keys\r
3819                         if ( !jQuery.isArray( name ) ) {\r
3820 \r
3821                                 // try the string as a key before any manipulation\r
3822                                 if ( name in thisCache ) {\r
3823                                         name = [ name ];\r
3824                                 } else {\r
3825 \r
3826                                         // split the camel cased version by spaces unless a key with the spaces exists\r
3827                                         name = jQuery.camelCase( name );\r
3828                                         if ( name in thisCache ) {\r
3829                                                 name = [ name ];\r
3830                                         } else {\r
3831                                                 name = name.split(" ");\r
3832                                         }\r
3833                                 }\r
3834                         } else {\r
3835                                 // If "name" is an array of keys...\r
3836                                 // When data is initially created, via ("key", "val") signature,\r
3837                                 // keys will be converted to camelCase.\r
3838                                 // Since there is no way to tell _how_ a key was added, remove\r
3839                                 // both plain key and camelCase key. #12786\r
3840                                 // This will only penalize the array argument path.\r
3841                                 name = name.concat( jQuery.map( name, jQuery.camelCase ) );\r
3842                         }\r
3843 \r
3844                         i = name.length;\r
3845                         while ( i-- ) {\r
3846                                 delete thisCache[ name[i] ];\r
3847                         }\r
3848 \r
3849                         // If there is no data left in the cache, we want to continue\r
3850                         // and let the cache object itself get destroyed\r
3851                         if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {\r
3852                                 return;\r
3853                         }\r
3854                 }\r
3855         }\r
3856 \r
3857         // See jQuery.data for more information\r
3858         if ( !pvt ) {\r
3859                 delete cache[ id ].data;\r
3860 \r
3861                 // Don't destroy the parent cache unless the internal data object\r
3862                 // had been the only thing left in it\r
3863                 if ( !isEmptyDataObject( cache[ id ] ) ) {\r
3864                         return;\r
3865                 }\r
3866         }\r
3867 \r
3868         // Destroy the cache\r
3869         if ( isNode ) {\r
3870                 jQuery.cleanData( [ elem ], true );\r
3871 \r
3872         // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)\r
3873         /* jshint eqeqeq: false */\r
3874         } else if ( support.deleteExpando || cache != cache.window ) {\r
3875                 /* jshint eqeqeq: true */\r
3876                 delete cache[ id ];\r
3877 \r
3878         // When all else fails, null\r
3879         } else {\r
3880                 cache[ id ] = null;\r
3881         }\r
3882 }\r
3883 \r
3884 jQuery.extend({\r
3885         cache: {},\r
3886 \r
3887         // The following elements (space-suffixed to avoid Object.prototype collisions)\r
3888         // throw uncatchable exceptions if you attempt to set expando properties\r
3889         noData: {\r
3890                 "applet ": true,\r
3891                 "embed ": true,\r
3892                 // ...but Flash objects (which have this classid) *can* handle expandos\r
3893                 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r
3894         },\r
3895 \r
3896         hasData: function( elem ) {\r
3897                 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];\r
3898                 return !!elem && !isEmptyDataObject( elem );\r
3899         },\r
3900 \r
3901         data: function( elem, name, data ) {\r
3902                 return internalData( elem, name, data );\r
3903         },\r
3904 \r
3905         removeData: function( elem, name ) {\r
3906                 return internalRemoveData( elem, name );\r
3907         },\r
3908 \r
3909         // For internal use only.\r
3910         _data: function( elem, name, data ) {\r
3911                 return internalData( elem, name, data, true );\r
3912         },\r
3913 \r
3914         _removeData: function( elem, name ) {\r
3915                 return internalRemoveData( elem, name, true );\r
3916         }\r
3917 });\r
3918 \r
3919 jQuery.fn.extend({\r
3920         data: function( key, value ) {\r
3921                 var i, name, data,\r
3922                         elem = this[0],\r
3923                         attrs = elem && elem.attributes;\r
3924 \r
3925                 // Special expections of .data basically thwart jQuery.access,\r
3926                 // so implement the relevant behavior ourselves\r
3927 \r
3928                 // Gets all values\r
3929                 if ( key === undefined ) {\r
3930                         if ( this.length ) {\r
3931                                 data = jQuery.data( elem );\r
3932 \r
3933                                 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {\r
3934                                         i = attrs.length;\r
3935                                         while ( i-- ) {\r
3936 \r
3937                                                 // Support: IE11+\r
3938                                                 // The attrs elements can be null (#14894)\r
3939                                                 if ( attrs[ i ] ) {\r
3940                                                         name = attrs[ i ].name;\r
3941                                                         if ( name.indexOf( "data-" ) === 0 ) {\r
3942                                                                 name = jQuery.camelCase( name.slice(5) );\r
3943                                                                 dataAttr( elem, name, data[ name ] );\r
3944                                                         }\r
3945                                                 }\r
3946                                         }\r
3947                                         jQuery._data( elem, "parsedAttrs", true );\r
3948                                 }\r
3949                         }\r
3950 \r
3951                         return data;\r
3952                 }\r
3953 \r
3954                 // Sets multiple values\r
3955                 if ( typeof key === "object" ) {\r
3956                         return this.each(function() {\r
3957                                 jQuery.data( this, key );\r
3958                         });\r
3959                 }\r
3960 \r
3961                 return arguments.length > 1 ?\r
3962 \r
3963                         // Sets one value\r
3964                         this.each(function() {\r
3965                                 jQuery.data( this, key, value );\r
3966                         }) :\r
3967 \r
3968                         // Gets one value\r
3969                         // Try to fetch any internally stored data first\r
3970                         elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;\r
3971         },\r
3972 \r
3973         removeData: function( key ) {\r
3974                 return this.each(function() {\r
3975                         jQuery.removeData( this, key );\r
3976                 });\r
3977         }\r
3978 });\r
3979 \r
3980 \r
3981 jQuery.extend({\r
3982         queue: function( elem, type, data ) {\r
3983                 var queue;\r
3984 \r
3985                 if ( elem ) {\r
3986                         type = ( type || "fx" ) + "queue";\r
3987                         queue = jQuery._data( elem, type );\r
3988 \r
3989                         // Speed up dequeue by getting out quickly if this is just a lookup\r
3990                         if ( data ) {\r
3991                                 if ( !queue || jQuery.isArray(data) ) {\r
3992                                         queue = jQuery._data( elem, type, jQuery.makeArray(data) );\r
3993                                 } else {\r
3994                                         queue.push( data );\r
3995                                 }\r
3996                         }\r
3997                         return queue || [];\r
3998                 }\r
3999         },\r
4000 \r
4001         dequeue: function( elem, type ) {\r
4002                 type = type || "fx";\r
4003 \r
4004                 var queue = jQuery.queue( elem, type ),\r
4005                         startLength = queue.length,\r
4006                         fn = queue.shift(),\r
4007                         hooks = jQuery._queueHooks( elem, type ),\r
4008                         next = function() {\r
4009                                 jQuery.dequeue( elem, type );\r
4010                         };\r
4011 \r
4012                 // If the fx queue is dequeued, always remove the progress sentinel\r
4013                 if ( fn === "inprogress" ) {\r
4014                         fn = queue.shift();\r
4015                         startLength--;\r
4016                 }\r
4017 \r
4018                 if ( fn ) {\r
4019 \r
4020                         // Add a progress sentinel to prevent the fx queue from being\r
4021                         // automatically dequeued\r
4022                         if ( type === "fx" ) {\r
4023                                 queue.unshift( "inprogress" );\r
4024                         }\r
4025 \r
4026                         // clear up the last queue stop function\r
4027                         delete hooks.stop;\r
4028                         fn.call( elem, next, hooks );\r
4029                 }\r
4030 \r
4031                 if ( !startLength && hooks ) {\r
4032                         hooks.empty.fire();\r
4033                 }\r
4034         },\r
4035 \r
4036         // not intended for public consumption - generates a queueHooks object, or returns the current one\r
4037         _queueHooks: function( elem, type ) {\r
4038                 var key = type + "queueHooks";\r
4039                 return jQuery._data( elem, key ) || jQuery._data( elem, key, {\r
4040                         empty: jQuery.Callbacks("once memory").add(function() {\r
4041                                 jQuery._removeData( elem, type + "queue" );\r
4042                                 jQuery._removeData( elem, key );\r
4043                         })\r
4044                 });\r
4045         }\r
4046 });\r
4047 \r
4048 jQuery.fn.extend({\r
4049         queue: function( type, data ) {\r
4050                 var setter = 2;\r
4051 \r
4052                 if ( typeof type !== "string" ) {\r
4053                         data = type;\r
4054                         type = "fx";\r
4055                         setter--;\r
4056                 }\r
4057 \r
4058                 if ( arguments.length < setter ) {\r
4059                         return jQuery.queue( this[0], type );\r
4060                 }\r
4061 \r
4062                 return data === undefined ?\r
4063                         this :\r
4064                         this.each(function() {\r
4065                                 var queue = jQuery.queue( this, type, data );\r
4066 \r
4067                                 // ensure a hooks for this queue\r
4068                                 jQuery._queueHooks( this, type );\r
4069 \r
4070                                 if ( type === "fx" && queue[0] !== "inprogress" ) {\r
4071                                         jQuery.dequeue( this, type );\r
4072                                 }\r
4073                         });\r
4074         },\r
4075         dequeue: function( type ) {\r
4076                 return this.each(function() {\r
4077                         jQuery.dequeue( this, type );\r
4078                 });\r
4079         },\r
4080         clearQueue: function( type ) {\r
4081                 return this.queue( type || "fx", [] );\r
4082         },\r
4083         // Get a promise resolved when queues of a certain type\r
4084         // are emptied (fx is the type by default)\r
4085         promise: function( type, obj ) {\r
4086                 var tmp,\r
4087                         count = 1,\r
4088                         defer = jQuery.Deferred(),\r
4089                         elements = this,\r
4090                         i = this.length,\r
4091                         resolve = function() {\r
4092                                 if ( !( --count ) ) {\r
4093                                         defer.resolveWith( elements, [ elements ] );\r
4094                                 }\r
4095                         };\r
4096 \r
4097                 if ( typeof type !== "string" ) {\r
4098                         obj = type;\r
4099                         type = undefined;\r
4100                 }\r
4101                 type = type || "fx";\r
4102 \r
4103                 while ( i-- ) {\r
4104                         tmp = jQuery._data( elements[ i ], type + "queueHooks" );\r
4105                         if ( tmp && tmp.empty ) {\r
4106                                 count++;\r
4107                                 tmp.empty.add( resolve );\r
4108                         }\r
4109                 }\r
4110                 resolve();\r
4111                 return defer.promise( obj );\r
4112         }\r
4113 });\r
4114 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;\r
4115 \r
4116 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];\r
4117 \r
4118 var isHidden = function( elem, el ) {\r
4119                 // isHidden might be called from jQuery#filter function;\r
4120                 // in that case, element will be second argument\r
4121                 elem = el || elem;\r
4122                 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );\r
4123         };\r
4124 \r
4125 \r
4126 \r
4127 // Multifunctional method to get and set values of a collection\r
4128 // The value/s can optionally be executed if it's a function\r
4129 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\r
4130         var i = 0,\r
4131                 length = elems.length,\r
4132                 bulk = key == null;\r
4133 \r
4134         // Sets many values\r
4135         if ( jQuery.type( key ) === "object" ) {\r
4136                 chainable = true;\r
4137                 for ( i in key ) {\r
4138                         jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\r
4139                 }\r
4140 \r
4141         // Sets one value\r
4142         } else if ( value !== undefined ) {\r
4143                 chainable = true;\r
4144 \r
4145                 if ( !jQuery.isFunction( value ) ) {\r
4146                         raw = true;\r
4147                 }\r
4148 \r
4149                 if ( bulk ) {\r
4150                         // Bulk operations run against the entire set\r
4151                         if ( raw ) {\r
4152                                 fn.call( elems, value );\r
4153                                 fn = null;\r
4154 \r
4155                         // ...except when executing function values\r
4156                         } else {\r
4157                                 bulk = fn;\r
4158                                 fn = function( elem, key, value ) {\r
4159                                         return bulk.call( jQuery( elem ), value );\r
4160                                 };\r
4161                         }\r
4162                 }\r
4163 \r
4164                 if ( fn ) {\r
4165                         for ( ; i < length; i++ ) {\r
4166                                 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\r
4167                         }\r
4168                 }\r
4169         }\r
4170 \r
4171         return chainable ?\r
4172                 elems :\r
4173 \r
4174                 // Gets\r
4175                 bulk ?\r
4176                         fn.call( elems ) :\r
4177                         length ? fn( elems[0], key ) : emptyGet;\r
4178 };\r
4179 var rcheckableType = (/^(?:checkbox|radio)$/i);\r
4180 \r
4181 \r
4182 \r
4183 (function() {\r
4184         // Minified: var a,b,c\r
4185         var input = document.createElement( "input" ),\r
4186                 div = document.createElement( "div" ),\r
4187                 fragment = document.createDocumentFragment();\r
4188 \r
4189         // Setup\r
4190         div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";\r
4191 \r
4192         // IE strips leading whitespace when .innerHTML is used\r
4193         support.leadingWhitespace = div.firstChild.nodeType === 3;\r
4194 \r
4195         // Make sure that tbody elements aren't automatically inserted\r
4196         // IE will insert them into empty tables\r
4197         support.tbody = !div.getElementsByTagName( "tbody" ).length;\r
4198 \r
4199         // Make sure that link elements get serialized correctly by innerHTML\r
4200         // This requires a wrapper element in IE\r
4201         support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;\r
4202 \r
4203         // Makes sure cloning an html5 element does not cause problems\r
4204         // Where outerHTML is undefined, this still works\r
4205         support.html5Clone =\r
4206                 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";\r
4207 \r
4208         // Check if a disconnected checkbox will retain its checked\r
4209         // value of true after appended to the DOM (IE6/7)\r
4210         input.type = "checkbox";\r
4211         input.checked = true;\r
4212         fragment.appendChild( input );\r
4213         support.appendChecked = input.checked;\r
4214 \r
4215         // Make sure textarea (and checkbox) defaultValue is properly cloned\r
4216         // Support: IE6-IE11+\r
4217         div.innerHTML = "<textarea>x</textarea>";\r
4218         support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\r
4219 \r
4220         // #11217 - WebKit loses check when the name is after the checked attribute\r
4221         fragment.appendChild( div );\r
4222         div.innerHTML = "<input type='radio' checked='checked' name='t'/>";\r
4223 \r
4224         // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3\r
4225         // old WebKit doesn't clone checked state correctly in fragments\r
4226         support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\r
4227 \r
4228         // Support: IE<9\r
4229         // Opera does not clone events (and typeof div.attachEvent === undefined).\r
4230         // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()\r
4231         support.noCloneEvent = true;\r
4232         if ( div.attachEvent ) {\r
4233                 div.attachEvent( "onclick", function() {\r
4234                         support.noCloneEvent = false;\r
4235                 });\r
4236 \r
4237                 div.cloneNode( true ).click();\r
4238         }\r
4239 \r
4240         // Execute the test only if not already executed in another module.\r
4241         if (support.deleteExpando == null) {\r
4242                 // Support: IE<9\r
4243                 support.deleteExpando = true;\r
4244                 try {\r
4245                         delete div.test;\r
4246                 } catch( e ) {\r
4247                         support.deleteExpando = false;\r
4248                 }\r
4249         }\r
4250 })();\r
4251 \r
4252 \r
4253 (function() {\r
4254         var i, eventName,\r
4255                 div = document.createElement( "div" );\r
4256 \r
4257         // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)\r
4258         for ( i in { submit: true, change: true, focusin: true }) {\r
4259                 eventName = "on" + i;\r
4260 \r
4261                 if ( !(support[ i + "Bubbles" ] = eventName in window) ) {\r
4262                         // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)\r
4263                         div.setAttribute( eventName, "t" );\r
4264                         support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;\r
4265                 }\r
4266         }\r
4267 \r
4268         // Null elements to avoid leaks in IE.\r
4269         div = null;\r
4270 })();\r
4271 \r
4272 \r
4273 var rformElems = /^(?:input|select|textarea)$/i,\r
4274         rkeyEvent = /^key/,\r
4275         rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,\r
4276         rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\r
4277         rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;\r
4278 \r
4279 function returnTrue() {\r
4280         return true;\r
4281 }\r
4282 \r
4283 function returnFalse() {\r
4284         return false;\r
4285 }\r
4286 \r
4287 function safeActiveElement() {\r
4288         try {\r
4289                 return document.activeElement;\r
4290         } catch ( err ) { }\r
4291 }\r
4292 \r
4293 /*\r
4294  * Helper functions for managing events -- not part of the public interface.\r
4295  * Props to Dean Edwards' addEvent library for many of the ideas.\r
4296  */\r
4297 jQuery.event = {\r
4298 \r
4299         global: {},\r
4300 \r
4301         add: function( elem, types, handler, data, selector ) {\r
4302                 var tmp, events, t, handleObjIn,\r
4303                         special, eventHandle, handleObj,\r
4304                         handlers, type, namespaces, origType,\r
4305                         elemData = jQuery._data( elem );\r
4306 \r
4307                 // Don't attach events to noData or text/comment nodes (but allow plain objects)\r
4308                 if ( !elemData ) {\r
4309                         return;\r
4310                 }\r
4311 \r
4312                 // Caller can pass in an object of custom data in lieu of the handler\r
4313                 if ( handler.handler ) {\r
4314                         handleObjIn = handler;\r
4315                         handler = handleObjIn.handler;\r
4316                         selector = handleObjIn.selector;\r
4317                 }\r
4318 \r
4319                 // Make sure that the handler has a unique ID, used to find/remove it later\r
4320                 if ( !handler.guid ) {\r
4321                         handler.guid = jQuery.guid++;\r
4322                 }\r
4323 \r
4324                 // Init the element's event structure and main handler, if this is the first\r
4325                 if ( !(events = elemData.events) ) {\r
4326                         events = elemData.events = {};\r
4327                 }\r
4328                 if ( !(eventHandle = elemData.handle) ) {\r
4329                         eventHandle = elemData.handle = function( e ) {\r
4330                                 // Discard the second event of a jQuery.event.trigger() and\r
4331                                 // when an event is called after a page has unloaded\r
4332                                 return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?\r
4333                                         jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\r
4334                                         undefined;\r
4335                         };\r
4336                         // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\r
4337                         eventHandle.elem = elem;\r
4338                 }\r
4339 \r
4340                 // Handle multiple events separated by a space\r
4341                 types = ( types || "" ).match( rnotwhite ) || [ "" ];\r
4342                 t = types.length;\r
4343                 while ( t-- ) {\r
4344                         tmp = rtypenamespace.exec( types[t] ) || [];\r
4345                         type = origType = tmp[1];\r
4346                         namespaces = ( tmp[2] || "" ).split( "." ).sort();\r
4347 \r
4348                         // There *must* be a type, no attaching namespace-only handlers\r
4349                         if ( !type ) {\r
4350                                 continue;\r
4351                         }\r
4352 \r
4353                         // If event changes its type, use the special event handlers for the changed type\r
4354                         special = jQuery.event.special[ type ] || {};\r
4355 \r
4356                         // If selector defined, determine special event api type, otherwise given type\r
4357                         type = ( selector ? special.delegateType : special.bindType ) || type;\r
4358 \r
4359                         // Update special based on newly reset type\r
4360                         special = jQuery.event.special[ type ] || {};\r
4361 \r
4362                         // handleObj is passed to all event handlers\r
4363                         handleObj = jQuery.extend({\r
4364                                 type: type,\r
4365                                 origType: origType,\r
4366                                 data: data,\r
4367                                 handler: handler,\r
4368                                 guid: handler.guid,\r
4369                                 selector: selector,\r
4370                                 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),\r
4371                                 namespace: namespaces.join(".")\r
4372                         }, handleObjIn );\r
4373 \r
4374                         // Init the event handler queue if we're the first\r
4375                         if ( !(handlers = events[ type ]) ) {\r
4376                                 handlers = events[ type ] = [];\r
4377                                 handlers.delegateCount = 0;\r
4378 \r
4379                                 // Only use addEventListener/attachEvent if the special events handler returns false\r
4380                                 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\r
4381                                         // Bind the global event handler to the element\r
4382                                         if ( elem.addEventListener ) {\r
4383                                                 elem.addEventListener( type, eventHandle, false );\r
4384 \r
4385                                         } else if ( elem.attachEvent ) {\r
4386                                                 elem.attachEvent( "on" + type, eventHandle );\r
4387                                         }\r
4388                                 }\r
4389                         }\r
4390 \r
4391                         if ( special.add ) {\r
4392                                 special.add.call( elem, handleObj );\r
4393 \r
4394                                 if ( !handleObj.handler.guid ) {\r
4395                                         handleObj.handler.guid = handler.guid;\r
4396                                 }\r
4397                         }\r
4398 \r
4399                         // Add to the element's handler list, delegates in front\r
4400                         if ( selector ) {\r
4401                                 handlers.splice( handlers.delegateCount++, 0, handleObj );\r
4402                         } else {\r
4403                                 handlers.push( handleObj );\r
4404                         }\r
4405 \r
4406                         // Keep track of which events have ever been used, for event optimization\r
4407                         jQuery.event.global[ type ] = true;\r
4408                 }\r
4409 \r
4410                 // Nullify elem to prevent memory leaks in IE\r
4411                 elem = null;\r
4412         },\r
4413 \r
4414         // Detach an event or set of events from an element\r
4415         remove: function( elem, types, handler, selector, mappedTypes ) {\r
4416                 var j, handleObj, tmp,\r
4417                         origCount, t, events,\r
4418                         special, handlers, type,\r
4419                         namespaces, origType,\r
4420                         elemData = jQuery.hasData( elem ) && jQuery._data( elem );\r
4421 \r
4422                 if ( !elemData || !(events = elemData.events) ) {\r
4423                         return;\r
4424                 }\r
4425 \r
4426                 // Once for each type.namespace in types; type may be omitted\r
4427                 types = ( types || "" ).match( rnotwhite ) || [ "" ];\r
4428                 t = types.length;\r
4429                 while ( t-- ) {\r
4430                         tmp = rtypenamespace.exec( types[t] ) || [];\r
4431                         type = origType = tmp[1];\r
4432                         namespaces = ( tmp[2] || "" ).split( "." ).sort();\r
4433 \r
4434                         // Unbind all events (on this namespace, if provided) for the element\r
4435                         if ( !type ) {\r
4436                                 for ( type in events ) {\r
4437                                         jQuery.event.remove( elem, type + types[ t ], handler, selector, true );\r
4438                                 }\r
4439                                 continue;\r
4440                         }\r
4441 \r
4442                         special = jQuery.event.special[ type ] || {};\r
4443                         type = ( selector ? special.delegateType : special.bindType ) || type;\r
4444                         handlers = events[ type ] || [];\r
4445                         tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );\r
4446 \r
4447                         // Remove matching events\r
4448                         origCount = j = handlers.length;\r
4449                         while ( j-- ) {\r
4450                                 handleObj = handlers[ j ];\r
4451 \r
4452                                 if ( ( mappedTypes || origType === handleObj.origType ) &&\r
4453                                         ( !handler || handler.guid === handleObj.guid ) &&\r
4454                                         ( !tmp || tmp.test( handleObj.namespace ) ) &&\r
4455                                         ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {\r
4456                                         handlers.splice( j, 1 );\r
4457 \r
4458                                         if ( handleObj.selector ) {\r
4459                                                 handlers.delegateCount--;\r
4460                                         }\r
4461                                         if ( special.remove ) {\r
4462                                                 special.remove.call( elem, handleObj );\r
4463                                         }\r
4464                                 }\r
4465                         }\r
4466 \r
4467                         // Remove generic event handler if we removed something and no more handlers exist\r
4468                         // (avoids potential for endless recursion during removal of special event handlers)\r
4469                         if ( origCount && !handlers.length ) {\r
4470                                 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\r
4471                                         jQuery.removeEvent( elem, type, elemData.handle );\r
4472                                 }\r
4473 \r
4474                                 delete events[ type ];\r
4475                         }\r
4476                 }\r
4477 \r
4478                 // Remove the expando if it's no longer used\r
4479                 if ( jQuery.isEmptyObject( events ) ) {\r
4480                         delete elemData.handle;\r
4481 \r
4482                         // removeData also checks for emptiness and clears the expando if empty\r
4483                         // so use it instead of delete\r
4484                         jQuery._removeData( elem, "events" );\r
4485                 }\r
4486         },\r
4487 \r
4488         trigger: function( event, data, elem, onlyHandlers ) {\r
4489                 var handle, ontype, cur,\r
4490                         bubbleType, special, tmp, i,\r
4491                         eventPath = [ elem || document ],\r
4492                         type = hasOwn.call( event, "type" ) ? event.type : event,\r
4493                         namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];\r
4494 \r
4495                 cur = tmp = elem = elem || document;\r
4496 \r
4497                 // Don't do events on text and comment nodes\r
4498                 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {\r
4499                         return;\r
4500                 }\r
4501 \r
4502                 // focus/blur morphs to focusin/out; ensure we're not firing them right now\r
4503                 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\r
4504                         return;\r
4505                 }\r
4506 \r
4507                 if ( type.indexOf(".") >= 0 ) {\r
4508                         // Namespaced trigger; create a regexp to match event type in handle()\r
4509                         namespaces = type.split(".");\r
4510                         type = namespaces.shift();\r
4511                         namespaces.sort();\r
4512                 }\r
4513                 ontype = type.indexOf(":") < 0 && "on" + type;\r
4514 \r
4515                 // Caller can pass in a jQuery.Event object, Object, or just an event type string\r
4516                 event = event[ jQuery.expando ] ?\r
4517                         event :\r
4518                         new jQuery.Event( type, typeof event === "object" && event );\r
4519 \r
4520                 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\r
4521                 event.isTrigger = onlyHandlers ? 2 : 3;\r
4522                 event.namespace = namespaces.join(".");\r
4523                 event.namespace_re = event.namespace ?\r
4524                         new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :\r
4525                         null;\r
4526 \r
4527                 // Clean up the event in case it is being reused\r
4528                 event.result = undefined;\r
4529                 if ( !event.target ) {\r
4530                         event.target = elem;\r
4531                 }\r
4532 \r
4533                 // Clone any incoming data and prepend the event, creating the handler arg list\r
4534                 data = data == null ?\r
4535                         [ event ] :\r
4536                         jQuery.makeArray( data, [ event ] );\r
4537 \r
4538                 // Allow special events to draw outside the lines\r
4539                 special = jQuery.event.special[ type ] || {};\r
4540                 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\r
4541                         return;\r
4542                 }\r
4543 \r
4544                 // Determine event propagation path in advance, per W3C events spec (#9951)\r
4545                 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\r
4546                 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\r
4547 \r
4548                         bubbleType = special.delegateType || type;\r
4549                         if ( !rfocusMorph.test( bubbleType + type ) ) {\r
4550                                 cur = cur.parentNode;\r
4551                         }\r
4552                         for ( ; cur; cur = cur.parentNode ) {\r
4553                                 eventPath.push( cur );\r
4554                                 tmp = cur;\r
4555                         }\r
4556 \r
4557                         // Only add window if we got to document (e.g., not plain obj or detached DOM)\r
4558                         if ( tmp === (elem.ownerDocument || document) ) {\r
4559                                 eventPath.push( tmp.defaultView || tmp.parentWindow || window );\r
4560                         }\r
4561                 }\r
4562 \r
4563                 // Fire handlers on the event path\r
4564                 i = 0;\r
4565                 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\r
4566 \r
4567                         event.type = i > 1 ?\r
4568                                 bubbleType :\r
4569                                 special.bindType || type;\r
4570 \r
4571                         // jQuery handler\r
4572                         handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );\r
4573                         if ( handle ) {\r
4574                                 handle.apply( cur, data );\r
4575                         }\r
4576 \r
4577                         // Native handler\r
4578                         handle = ontype && cur[ ontype ];\r
4579                         if ( handle && handle.apply && jQuery.acceptData( cur ) ) {\r
4580                                 event.result = handle.apply( cur, data );\r
4581                                 if ( event.result === false ) {\r
4582                                         event.preventDefault();\r
4583                                 }\r
4584                         }\r
4585                 }\r
4586                 event.type = type;\r
4587 \r
4588                 // If nobody prevented the default action, do it now\r
4589                 if ( !onlyHandlers && !event.isDefaultPrevented() ) {\r
4590 \r
4591                         if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&\r
4592                                 jQuery.acceptData( elem ) ) {\r
4593 \r
4594                                 // Call a native DOM method on the target with the same name name as the event.\r
4595                                 // Can't use an .isFunction() check here because IE6/7 fails that test.\r
4596                                 // Don't do default actions on window, that's where global variables be (#6170)\r
4597                                 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {\r
4598 \r
4599                                         // Don't re-trigger an onFOO event when we call its FOO() method\r
4600                                         tmp = elem[ ontype ];\r
4601 \r
4602                                         if ( tmp ) {\r
4603                                                 elem[ ontype ] = null;\r
4604                                         }\r
4605 \r
4606                                         // Prevent re-triggering of the same event, since we already bubbled it above\r
4607                                         jQuery.event.triggered = type;\r
4608                                         try {\r
4609                                                 elem[ type ]();\r
4610                                         } catch ( e ) {\r
4611                                                 // IE<9 dies on focus/blur to hidden element (#1486,#12518)\r
4612                                                 // only reproducible on winXP IE8 native, not IE9 in IE8 mode\r
4613                                         }\r
4614                                         jQuery.event.triggered = undefined;\r
4615 \r
4616                                         if ( tmp ) {\r
4617                                                 elem[ ontype ] = tmp;\r
4618                                         }\r
4619                                 }\r
4620                         }\r
4621                 }\r
4622 \r
4623                 return event.result;\r
4624         },\r
4625 \r
4626         dispatch: function( event ) {\r
4627 \r
4628                 // Make a writable jQuery.Event from the native event object\r
4629                 event = jQuery.event.fix( event );\r
4630 \r
4631                 var i, ret, handleObj, matched, j,\r
4632                         handlerQueue = [],\r
4633                         args = slice.call( arguments ),\r
4634                         handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],\r
4635                         special = jQuery.event.special[ event.type ] || {};\r
4636 \r
4637                 // Use the fix-ed jQuery.Event rather than the (read-only) native event\r
4638                 args[0] = event;\r
4639                 event.delegateTarget = this;\r
4640 \r
4641                 // Call the preDispatch hook for the mapped type, and let it bail if desired\r
4642                 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\r
4643                         return;\r
4644                 }\r
4645 \r
4646                 // Determine handlers\r
4647                 handlerQueue = jQuery.event.handlers.call( this, event, handlers );\r
4648 \r
4649                 // Run delegates first; they may want to stop propagation beneath us\r
4650                 i = 0;\r
4651                 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\r
4652                         event.currentTarget = matched.elem;\r
4653 \r
4654                         j = 0;\r
4655                         while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\r
4656 \r
4657                                 // Triggered event must either 1) have no namespace, or\r
4658                                 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\r
4659                                 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\r
4660 \r
4661                                         event.handleObj = handleObj;\r
4662                                         event.data = handleObj.data;\r
4663 \r
4664                                         ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\r
4665                                                         .apply( matched.elem, args );\r
4666 \r
4667                                         if ( ret !== undefined ) {\r
4668                                                 if ( (event.result = ret) === false ) {\r
4669                                                         event.preventDefault();\r
4670                                                         event.stopPropagation();\r
4671                                                 }\r
4672                                         }\r
4673                                 }\r
4674                         }\r
4675                 }\r
4676 \r
4677                 // Call the postDispatch hook for the mapped type\r
4678                 if ( special.postDispatch ) {\r
4679                         special.postDispatch.call( this, event );\r
4680                 }\r
4681 \r
4682                 return event.result;\r
4683         },\r
4684 \r
4685         handlers: function( event, handlers ) {\r
4686                 var sel, handleObj, matches, i,\r
4687                         handlerQueue = [],\r
4688                         delegateCount = handlers.delegateCount,\r
4689                         cur = event.target;\r
4690 \r
4691                 // Find delegate handlers\r
4692                 // Black-hole SVG <use> instance trees (#13180)\r
4693                 // Avoid non-left-click bubbling in Firefox (#3861)\r
4694                 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {\r
4695 \r
4696                         /* jshint eqeqeq: false */\r
4697                         for ( ; cur != this; cur = cur.parentNode || this ) {\r
4698                                 /* jshint eqeqeq: true */\r
4699 \r
4700                                 // Don't check non-elements (#13208)\r
4701                                 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\r
4702                                 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {\r
4703                                         matches = [];\r
4704                                         for ( i = 0; i < delegateCount; i++ ) {\r
4705                                                 handleObj = handlers[ i ];\r
4706 \r
4707                                                 // Don't conflict with Object.prototype properties (#13203)\r
4708                                                 sel = handleObj.selector + " ";\r
4709 \r
4710                                                 if ( matches[ sel ] === undefined ) {\r
4711                                                         matches[ sel ] = handleObj.needsContext ?\r
4712                                                                 jQuery( sel, this ).index( cur ) >= 0 :\r
4713                                                                 jQuery.find( sel, this, null, [ cur ] ).length;\r
4714                                                 }\r
4715                                                 if ( matches[ sel ] ) {\r
4716                                                         matches.push( handleObj );\r
4717                                                 }\r
4718                                         }\r
4719                                         if ( matches.length ) {\r
4720                                                 handlerQueue.push({ elem: cur, handlers: matches });\r
4721                                         }\r
4722                                 }\r
4723                         }\r
4724                 }\r
4725 \r
4726                 // Add the remaining (directly-bound) handlers\r
4727                 if ( delegateCount < handlers.length ) {\r
4728                         handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\r
4729                 }\r
4730 \r
4731                 return handlerQueue;\r
4732         },\r
4733 \r
4734         fix: function( event ) {\r
4735                 if ( event[ jQuery.expando ] ) {\r
4736                         return event;\r
4737                 }\r
4738 \r
4739                 // Create a writable copy of the event object and normalize some properties\r
4740                 var i, prop, copy,\r
4741                         type = event.type,\r
4742                         originalEvent = event,\r
4743                         fixHook = this.fixHooks[ type ];\r
4744 \r
4745                 if ( !fixHook ) {\r
4746                         this.fixHooks[ type ] = fixHook =\r
4747                                 rmouseEvent.test( type ) ? this.mouseHooks :\r
4748                                 rkeyEvent.test( type ) ? this.keyHooks :\r
4749                                 {};\r
4750                 }\r
4751                 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\r
4752 \r
4753                 event = new jQuery.Event( originalEvent );\r
4754 \r
4755                 i = copy.length;\r
4756                 while ( i-- ) {\r
4757                         prop = copy[ i ];\r
4758                         event[ prop ] = originalEvent[ prop ];\r
4759                 }\r
4760 \r
4761                 // Support: IE<9\r
4762                 // Fix target property (#1925)\r
4763                 if ( !event.target ) {\r
4764                         event.target = originalEvent.srcElement || document;\r
4765                 }\r
4766 \r
4767                 // Support: Chrome 23+, Safari?\r
4768                 // Target should not be a text node (#504, #13143)\r
4769                 if ( event.target.nodeType === 3 ) {\r
4770                         event.target = event.target.parentNode;\r
4771                 }\r
4772 \r
4773                 // Support: IE<9\r
4774                 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)\r
4775                 event.metaKey = !!event.metaKey;\r
4776 \r
4777                 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;\r
4778         },\r
4779 \r
4780         // Includes some event props shared by KeyEvent and MouseEvent\r
4781         props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),\r
4782 \r
4783         fixHooks: {},\r
4784 \r
4785         keyHooks: {\r
4786                 props: "char charCode key keyCode".split(" "),\r
4787                 filter: function( event, original ) {\r
4788 \r
4789                         // Add which for key events\r
4790                         if ( event.which == null ) {\r
4791                                 event.which = original.charCode != null ? original.charCode : original.keyCode;\r
4792                         }\r
4793 \r
4794                         return event;\r
4795                 }\r
4796         },\r
4797 \r
4798         mouseHooks: {\r
4799                 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),\r
4800                 filter: function( event, original ) {\r
4801                         var body, eventDoc, doc,\r
4802                                 button = original.button,\r
4803                                 fromElement = original.fromElement;\r
4804 \r
4805                         // Calculate pageX/Y if missing and clientX/Y available\r
4806                         if ( event.pageX == null && original.clientX != null ) {\r
4807                                 eventDoc = event.target.ownerDocument || document;\r
4808                                 doc = eventDoc.documentElement;\r
4809                                 body = eventDoc.body;\r
4810 \r
4811                                 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\r
4812                                 event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );\r
4813                         }\r
4814 \r
4815                         // Add relatedTarget, if necessary\r
4816                         if ( !event.relatedTarget && fromElement ) {\r
4817                                 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;\r
4818                         }\r
4819 \r
4820                         // Add which for click: 1 === left; 2 === middle; 3 === right\r
4821                         // Note: button is not normalized, so don't use it\r
4822                         if ( !event.which && button !== undefined ) {\r
4823                                 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\r
4824                         }\r
4825 \r
4826                         return event;\r
4827                 }\r
4828         },\r
4829 \r
4830         special: {\r
4831                 load: {\r
4832                         // Prevent triggered image.load events from bubbling to window.load\r
4833                         noBubble: true\r
4834                 },\r
4835                 focus: {\r
4836                         // Fire native event if possible so blur/focus sequence is correct\r
4837                         trigger: function() {\r
4838                                 if ( this !== safeActiveElement() && this.focus ) {\r
4839                                         try {\r
4840                                                 this.focus();\r
4841                                                 return false;\r
4842                                         } catch ( e ) {\r
4843                                                 // Support: IE<9\r
4844                                                 // If we error on focus to hidden element (#1486, #12518),\r
4845                                                 // let .trigger() run the handlers\r
4846                                         }\r
4847                                 }\r
4848                         },\r
4849                         delegateType: "focusin"\r
4850                 },\r
4851                 blur: {\r
4852                         trigger: function() {\r
4853                                 if ( this === safeActiveElement() && this.blur ) {\r
4854                                         this.blur();\r
4855                                         return false;\r
4856                                 }\r
4857                         },\r
4858                         delegateType: "focusout"\r
4859                 },\r
4860                 click: {\r
4861                         // For checkbox, fire native event so checked state will be right\r
4862                         trigger: function() {\r
4863                                 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {\r
4864                                         this.click();\r
4865                                         return false;\r
4866                                 }\r
4867                         },\r
4868 \r
4869                         // For cross-browser consistency, don't fire native .click() on links\r
4870                         _default: function( event ) {\r
4871                                 return jQuery.nodeName( event.target, "a" );\r
4872                         }\r
4873                 },\r
4874 \r
4875                 beforeunload: {\r
4876                         postDispatch: function( event ) {\r
4877 \r
4878                                 // Support: Firefox 20+\r
4879                                 // Firefox doesn't alert if the returnValue field is not set.\r
4880                                 if ( event.result !== undefined && event.originalEvent ) {\r
4881                                         event.originalEvent.returnValue = event.result;\r
4882                                 }\r
4883                         }\r
4884                 }\r
4885         },\r
4886 \r
4887         simulate: function( type, elem, event, bubble ) {\r
4888                 // Piggyback on a donor event to simulate a different one.\r
4889                 // Fake originalEvent to avoid donor's stopPropagation, but if the\r
4890                 // simulated event prevents default then we do the same on the donor.\r
4891                 var e = jQuery.extend(\r
4892                         new jQuery.Event(),\r
4893                         event,\r
4894                         {\r
4895                                 type: type,\r
4896                                 isSimulated: true,\r
4897                                 originalEvent: {}\r
4898                         }\r
4899                 );\r
4900                 if ( bubble ) {\r
4901                         jQuery.event.trigger( e, null, elem );\r
4902                 } else {\r
4903                         jQuery.event.dispatch.call( elem, e );\r
4904                 }\r
4905                 if ( e.isDefaultPrevented() ) {\r
4906                         event.preventDefault();\r
4907                 }\r
4908         }\r
4909 };\r
4910 \r
4911 jQuery.removeEvent = document.removeEventListener ?\r
4912         function( elem, type, handle ) {\r
4913                 if ( elem.removeEventListener ) {\r
4914                         elem.removeEventListener( type, handle, false );\r
4915                 }\r
4916         } :\r
4917         function( elem, type, handle ) {\r
4918                 var name = "on" + type;\r
4919 \r
4920                 if ( elem.detachEvent ) {\r
4921 \r
4922                         // #8545, #7054, preventing memory leaks for custom events in IE6-8\r
4923                         // detachEvent needed property on element, by name of that event, to properly expose it to GC\r
4924                         if ( typeof elem[ name ] === strundefined ) {\r
4925                                 elem[ name ] = null;\r
4926                         }\r
4927 \r
4928                         elem.detachEvent( name, handle );\r
4929                 }\r
4930         };\r
4931 \r
4932 jQuery.Event = function( src, props ) {\r
4933         // Allow instantiation without the 'new' keyword\r
4934         if ( !(this instanceof jQuery.Event) ) {\r
4935                 return new jQuery.Event( src, props );\r
4936         }\r
4937 \r
4938         // Event object\r
4939         if ( src && src.type ) {\r
4940                 this.originalEvent = src;\r
4941                 this.type = src.type;\r
4942 \r
4943                 // Events bubbling up the document may have been marked as prevented\r
4944                 // by a handler lower down the tree; reflect the correct value.\r
4945                 this.isDefaultPrevented = src.defaultPrevented ||\r
4946                                 src.defaultPrevented === undefined &&\r
4947                                 // Support: IE < 9, Android < 4.0\r
4948                                 src.returnValue === false ?\r
4949                         returnTrue :\r
4950                         returnFalse;\r
4951 \r
4952         // Event type\r
4953         } else {\r
4954                 this.type = src;\r
4955         }\r
4956 \r
4957         // Put explicitly provided properties onto the event object\r
4958         if ( props ) {\r
4959                 jQuery.extend( this, props );\r
4960         }\r
4961 \r
4962         // Create a timestamp if incoming event doesn't have one\r
4963         this.timeStamp = src && src.timeStamp || jQuery.now();\r
4964 \r
4965         // Mark it as fixed\r
4966         this[ jQuery.expando ] = true;\r
4967 };\r
4968 \r
4969 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\r
4970 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\r
4971 jQuery.Event.prototype = {\r
4972         isDefaultPrevented: returnFalse,\r
4973         isPropagationStopped: returnFalse,\r
4974         isImmediatePropagationStopped: returnFalse,\r
4975 \r
4976         preventDefault: function() {\r
4977                 var e = this.originalEvent;\r
4978 \r
4979                 this.isDefaultPrevented = returnTrue;\r
4980                 if ( !e ) {\r
4981                         return;\r
4982                 }\r
4983 \r
4984                 // If preventDefault exists, run it on the original event\r
4985                 if ( e.preventDefault ) {\r
4986                         e.preventDefault();\r
4987 \r
4988                 // Support: IE\r
4989                 // Otherwise set the returnValue property of the original event to false\r
4990                 } else {\r
4991                         e.returnValue = false;\r
4992                 }\r
4993         },\r
4994         stopPropagation: function() {\r
4995                 var e = this.originalEvent;\r
4996 \r
4997                 this.isPropagationStopped = returnTrue;\r
4998                 if ( !e ) {\r
4999                         return;\r
5000                 }\r
5001                 // If stopPropagation exists, run it on the original event\r
5002                 if ( e.stopPropagation ) {\r
5003                         e.stopPropagation();\r
5004                 }\r
5005 \r
5006                 // Support: IE\r
5007                 // Set the cancelBubble property of the original event to true\r
5008                 e.cancelBubble = true;\r
5009         },\r
5010         stopImmediatePropagation: function() {\r
5011                 var e = this.originalEvent;\r
5012 \r
5013                 this.isImmediatePropagationStopped = returnTrue;\r
5014 \r
5015                 if ( e && e.stopImmediatePropagation ) {\r
5016                         e.stopImmediatePropagation();\r
5017                 }\r
5018 \r
5019                 this.stopPropagation();\r
5020         }\r
5021 };\r
5022 \r
5023 // Create mouseenter/leave events using mouseover/out and event-time checks\r
5024 jQuery.each({\r
5025         mouseenter: "mouseover",\r
5026         mouseleave: "mouseout",\r
5027         pointerenter: "pointerover",\r
5028         pointerleave: "pointerout"\r
5029 }, function( orig, fix ) {\r
5030         jQuery.event.special[ orig ] = {\r
5031                 delegateType: fix,\r
5032                 bindType: fix,\r
5033 \r
5034                 handle: function( event ) {\r
5035                         var ret,\r
5036                                 target = this,\r
5037                                 related = event.relatedTarget,\r
5038                                 handleObj = event.handleObj;\r
5039 \r
5040                         // For mousenter/leave call the handler if related is outside the target.\r
5041                         // NB: No relatedTarget if the mouse left/entered the browser window\r
5042                         if ( !related || (related !== target && !jQuery.contains( target, related )) ) {\r
5043                                 event.type = handleObj.origType;\r
5044                                 ret = handleObj.handler.apply( this, arguments );\r
5045                                 event.type = fix;\r
5046                         }\r
5047                         return ret;\r
5048                 }\r
5049         };\r
5050 });\r
5051 \r
5052 // IE submit delegation\r
5053 if ( !support.submitBubbles ) {\r
5054 \r
5055         jQuery.event.special.submit = {\r
5056                 setup: function() {\r
5057                         // Only need this for delegated form submit events\r
5058                         if ( jQuery.nodeName( this, "form" ) ) {\r
5059                                 return false;\r
5060                         }\r
5061 \r
5062                         // Lazy-add a submit handler when a descendant form may potentially be submitted\r
5063                         jQuery.event.add( this, "click._submit keypress._submit", function( e ) {\r
5064                                 // Node name check avoids a VML-related crash in IE (#9807)\r
5065                                 var elem = e.target,\r
5066                                         form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;\r
5067                                 if ( form && !jQuery._data( form, "submitBubbles" ) ) {\r
5068                                         jQuery.event.add( form, "submit._submit", function( event ) {\r
5069                                                 event._submit_bubble = true;\r
5070                                         });\r
5071                                         jQuery._data( form, "submitBubbles", true );\r
5072                                 }\r
5073                         });\r
5074                         // return undefined since we don't need an event listener\r
5075                 },\r
5076 \r
5077                 postDispatch: function( event ) {\r
5078                         // If form was submitted by the user, bubble the event up the tree\r
5079                         if ( event._submit_bubble ) {\r
5080                                 delete event._submit_bubble;\r
5081                                 if ( this.parentNode && !event.isTrigger ) {\r
5082                                         jQuery.event.simulate( "submit", this.parentNode, event, true );\r
5083                                 }\r
5084                         }\r
5085                 },\r
5086 \r
5087                 teardown: function() {\r
5088                         // Only need this for delegated form submit events\r
5089                         if ( jQuery.nodeName( this, "form" ) ) {\r
5090                                 return false;\r
5091                         }\r
5092 \r
5093                         // Remove delegated handlers; cleanData eventually reaps submit handlers attached above\r
5094                         jQuery.event.remove( this, "._submit" );\r
5095                 }\r
5096         };\r
5097 }\r
5098 \r
5099 // IE change delegation and checkbox/radio fix\r
5100 if ( !support.changeBubbles ) {\r
5101 \r
5102         jQuery.event.special.change = {\r
5103 \r
5104                 setup: function() {\r
5105 \r
5106                         if ( rformElems.test( this.nodeName ) ) {\r
5107                                 // IE doesn't fire change on a check/radio until blur; trigger it on click\r
5108                                 // after a propertychange. Eat the blur-change in special.change.handle.\r
5109                                 // This still fires onchange a second time for check/radio after blur.\r
5110                                 if ( this.type === "checkbox" || this.type === "radio" ) {\r
5111                                         jQuery.event.add( this, "propertychange._change", function( event ) {\r
5112                                                 if ( event.originalEvent.propertyName === "checked" ) {\r
5113                                                         this._just_changed = true;\r
5114                                                 }\r
5115                                         });\r
5116                                         jQuery.event.add( this, "click._change", function( event ) {\r
5117                                                 if ( this._just_changed && !event.isTrigger ) {\r
5118                                                         this._just_changed = false;\r
5119                                                 }\r
5120                                                 // Allow triggered, simulated change events (#11500)\r
5121                                                 jQuery.event.simulate( "change", this, event, true );\r
5122                                         });\r
5123                                 }\r
5124                                 return false;\r
5125                         }\r
5126                         // Delegated event; lazy-add a change handler on descendant inputs\r
5127                         jQuery.event.add( this, "beforeactivate._change", function( e ) {\r
5128                                 var elem = e.target;\r
5129 \r
5130                                 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {\r
5131                                         jQuery.event.add( elem, "change._change", function( event ) {\r
5132                                                 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {\r
5133                                                         jQuery.event.simulate( "change", this.parentNode, event, true );\r
5134                                                 }\r
5135                                         });\r
5136                                         jQuery._data( elem, "changeBubbles", true );\r
5137                                 }\r
5138                         });\r
5139                 },\r
5140 \r
5141                 handle: function( event ) {\r
5142                         var elem = event.target;\r
5143 \r
5144                         // Swallow native change events from checkbox/radio, we already triggered them above\r
5145                         if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {\r
5146                                 return event.handleObj.handler.apply( this, arguments );\r
5147                         }\r
5148                 },\r
5149 \r
5150                 teardown: function() {\r
5151                         jQuery.event.remove( this, "._change" );\r
5152 \r
5153                         return !rformElems.test( this.nodeName );\r
5154                 }\r
5155         };\r
5156 }\r
5157 \r
5158 // Create "bubbling" focus and blur events\r
5159 if ( !support.focusinBubbles ) {\r
5160         jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {\r
5161 \r
5162                 // Attach a single capturing handler on the document while someone wants focusin/focusout\r
5163                 var handler = function( event ) {\r
5164                                 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\r
5165                         };\r
5166 \r
5167                 jQuery.event.special[ fix ] = {\r
5168                         setup: function() {\r
5169                                 var doc = this.ownerDocument || this,\r
5170                                         attaches = jQuery._data( doc, fix );\r
5171 \r
5172                                 if ( !attaches ) {\r
5173                                         doc.addEventListener( orig, handler, true );\r
5174                                 }\r
5175                                 jQuery._data( doc, fix, ( attaches || 0 ) + 1 );\r
5176                         },\r
5177                         teardown: function() {\r
5178                                 var doc = this.ownerDocument || this,\r
5179                                         attaches = jQuery._data( doc, fix ) - 1;\r
5180 \r
5181                                 if ( !attaches ) {\r
5182                                         doc.removeEventListener( orig, handler, true );\r
5183                                         jQuery._removeData( doc, fix );\r
5184                                 } else {\r
5185                                         jQuery._data( doc, fix, attaches );\r
5186                                 }\r
5187                         }\r
5188                 };\r
5189         });\r
5190 }\r
5191 \r
5192 jQuery.fn.extend({\r
5193 \r
5194         on: function( types, selector, data, fn, /*INTERNAL*/ one ) {\r
5195                 var type, origFn;\r
5196 \r
5197                 // Types can be a map of types/handlers\r
5198                 if ( typeof types === "object" ) {\r
5199                         // ( types-Object, selector, data )\r
5200                         if ( typeof selector !== "string" ) {\r
5201                                 // ( types-Object, data )\r
5202                                 data = data || selector;\r
5203                                 selector = undefined;\r
5204                         }\r
5205                         for ( type in types ) {\r
5206                                 this.on( type, selector, data, types[ type ], one );\r
5207                         }\r
5208                         return this;\r
5209                 }\r
5210 \r
5211                 if ( data == null && fn == null ) {\r
5212                         // ( types, fn )\r
5213                         fn = selector;\r
5214                         data = selector = undefined;\r
5215                 } else if ( fn == null ) {\r
5216                         if ( typeof selector === "string" ) {\r
5217                                 // ( types, selector, fn )\r
5218                                 fn = data;\r
5219                                 data = undefined;\r
5220                         } else {\r
5221                                 // ( types, data, fn )\r
5222                                 fn = data;\r
5223                                 data = selector;\r
5224                                 selector = undefined;\r
5225                         }\r
5226                 }\r
5227                 if ( fn === false ) {\r
5228                         fn = returnFalse;\r
5229                 } else if ( !fn ) {\r
5230                         return this;\r
5231                 }\r
5232 \r
5233                 if ( one === 1 ) {\r
5234                         origFn = fn;\r
5235                         fn = function( event ) {\r
5236                                 // Can use an empty set, since event contains the info\r
5237                                 jQuery().off( event );\r
5238                                 return origFn.apply( this, arguments );\r
5239                         };\r
5240                         // Use same guid so caller can remove using origFn\r
5241                         fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\r
5242                 }\r
5243                 return this.each( function() {\r
5244                         jQuery.event.add( this, types, fn, data, selector );\r
5245                 });\r
5246         },\r
5247         one: function( types, selector, data, fn ) {\r
5248                 return this.on( types, selector, data, fn, 1 );\r
5249         },\r
5250         off: function( types, selector, fn ) {\r
5251                 var handleObj, type;\r
5252                 if ( types && types.preventDefault && types.handleObj ) {\r
5253                         // ( event )  dispatched jQuery.Event\r
5254                         handleObj = types.handleObj;\r
5255                         jQuery( types.delegateTarget ).off(\r
5256                                 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,\r
5257                                 handleObj.selector,\r
5258                                 handleObj.handler\r
5259                         );\r
5260                         return this;\r
5261                 }\r
5262                 if ( typeof types === "object" ) {\r
5263                         // ( types-object [, selector] )\r
5264                         for ( type in types ) {\r
5265                                 this.off( type, selector, types[ type ] );\r
5266                         }\r
5267                         return this;\r
5268                 }\r
5269                 if ( selector === false || typeof selector === "function" ) {\r
5270                         // ( types [, fn] )\r
5271                         fn = selector;\r
5272                         selector = undefined;\r
5273                 }\r
5274                 if ( fn === false ) {\r
5275                         fn = returnFalse;\r
5276                 }\r
5277                 return this.each(function() {\r
5278                         jQuery.event.remove( this, types, fn, selector );\r
5279                 });\r
5280         },\r
5281 \r
5282         trigger: function( type, data ) {\r
5283                 return this.each(function() {\r
5284                         jQuery.event.trigger( type, data, this );\r
5285                 });\r
5286         },\r
5287         triggerHandler: function( type, data ) {\r
5288                 var elem = this[0];\r
5289                 if ( elem ) {\r
5290                         return jQuery.event.trigger( type, data, elem, true );\r
5291                 }\r
5292         }\r
5293 });\r
5294 \r
5295 \r
5296 function createSafeFragment( document ) {\r
5297         var list = nodeNames.split( "|" ),\r
5298                 safeFrag = document.createDocumentFragment();\r
5299 \r
5300         if ( safeFrag.createElement ) {\r
5301                 while ( list.length ) {\r
5302                         safeFrag.createElement(\r
5303                                 list.pop()\r
5304                         );\r
5305                 }\r
5306         }\r
5307         return safeFrag;\r
5308 }\r
5309 \r
5310 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +\r
5311                 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",\r
5312         rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,\r
5313         rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),\r
5314         rleadingWhitespace = /^\s+/,\r
5315         rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,\r
5316         rtagName = /<([\w:]+)/,\r
5317         rtbody = /<tbody/i,\r
5318         rhtml = /<|&#?\w+;/,\r
5319         rnoInnerhtml = /<(?:script|style|link)/i,\r
5320         // checked="checked" or checked\r
5321         rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,\r
5322         rscriptType = /^$|\/(?:java|ecma)script/i,\r
5323         rscriptTypeMasked = /^true\/(.*)/,\r
5324         rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,\r
5325 \r
5326         // We have to close these tags to support XHTML (#13200)\r
5327         wrapMap = {\r
5328                 option: [ 1, "<select multiple='multiple'>", "</select>" ],\r
5329                 legend: [ 1, "<fieldset>", "</fieldset>" ],\r
5330                 area: [ 1, "<map>", "</map>" ],\r
5331                 param: [ 1, "<object>", "</object>" ],\r
5332                 thead: [ 1, "<table>", "</table>" ],\r
5333                 tr: [ 2, "<table><tbody>", "</tbody></table>" ],\r
5334                 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],\r
5335                 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],\r
5336 \r
5337                 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,\r
5338                 // unless wrapped in a div with non-breaking characters in front of it.\r
5339                 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]\r
5340         },\r
5341         safeFragment = createSafeFragment( document ),\r
5342         fragmentDiv = safeFragment.appendChild( document.createElement("div") );\r
5343 \r
5344 wrapMap.optgroup = wrapMap.option;\r
5345 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\r
5346 wrapMap.th = wrapMap.td;\r
5347 \r
5348 function getAll( context, tag ) {\r
5349         var elems, elem,\r
5350                 i = 0,\r
5351                 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :\r
5352                         typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :\r
5353                         undefined;\r
5354 \r
5355         if ( !found ) {\r
5356                 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {\r
5357                         if ( !tag || jQuery.nodeName( elem, tag ) ) {\r
5358                                 found.push( elem );\r
5359                         } else {\r
5360                                 jQuery.merge( found, getAll( elem, tag ) );\r
5361                         }\r
5362                 }\r
5363         }\r
5364 \r
5365         return tag === undefined || tag && jQuery.nodeName( context, tag ) ?\r
5366                 jQuery.merge( [ context ], found ) :\r
5367                 found;\r
5368 }\r
5369 \r
5370 // Used in buildFragment, fixes the defaultChecked property\r
5371 function fixDefaultChecked( elem ) {\r
5372         if ( rcheckableType.test( elem.type ) ) {\r
5373                 elem.defaultChecked = elem.checked;\r
5374         }\r
5375 }\r
5376 \r
5377 // Support: IE<8\r
5378 // Manipulating tables requires a tbody\r
5379 function manipulationTarget( elem, content ) {\r
5380         return jQuery.nodeName( elem, "table" ) &&\r
5381                 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?\r
5382 \r
5383                 elem.getElementsByTagName("tbody")[0] ||\r
5384                         elem.appendChild( elem.ownerDocument.createElement("tbody") ) :\r
5385                 elem;\r
5386 }\r
5387 \r
5388 // Replace/restore the type attribute of script elements for safe DOM manipulation\r
5389 function disableScript( elem ) {\r
5390         elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;\r
5391         return elem;\r
5392 }\r
5393 function restoreScript( elem ) {\r
5394         var match = rscriptTypeMasked.exec( elem.type );\r
5395         if ( match ) {\r
5396                 elem.type = match[1];\r
5397         } else {\r
5398                 elem.removeAttribute("type");\r
5399         }\r
5400         return elem;\r
5401 }\r
5402 \r
5403 // Mark scripts as having already been evaluated\r
5404 function setGlobalEval( elems, refElements ) {\r
5405         var elem,\r
5406                 i = 0;\r
5407         for ( ; (elem = elems[i]) != null; i++ ) {\r
5408                 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );\r
5409         }\r
5410 }\r
5411 \r
5412 function cloneCopyEvent( src, dest ) {\r
5413 \r
5414         if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {\r
5415                 return;\r
5416         }\r
5417 \r
5418         var type, i, l,\r
5419                 oldData = jQuery._data( src ),\r
5420                 curData = jQuery._data( dest, oldData ),\r
5421                 events = oldData.events;\r
5422 \r
5423         if ( events ) {\r
5424                 delete curData.handle;\r
5425                 curData.events = {};\r
5426 \r
5427                 for ( type in events ) {\r
5428                         for ( i = 0, l = events[ type ].length; i < l; i++ ) {\r
5429                                 jQuery.event.add( dest, type, events[ type ][ i ] );\r
5430                         }\r
5431                 }\r
5432         }\r
5433 \r
5434         // make the cloned public data object a copy from the original\r
5435         if ( curData.data ) {\r
5436                 curData.data = jQuery.extend( {}, curData.data );\r
5437         }\r
5438 }\r
5439 \r
5440 function fixCloneNodeIssues( src, dest ) {\r
5441         var nodeName, e, data;\r
5442 \r
5443         // We do not need to do anything for non-Elements\r
5444         if ( dest.nodeType !== 1 ) {\r
5445                 return;\r
5446         }\r
5447 \r
5448         nodeName = dest.nodeName.toLowerCase();\r
5449 \r
5450         // IE6-8 copies events bound via attachEvent when using cloneNode.\r
5451         if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {\r
5452                 data = jQuery._data( dest );\r
5453 \r
5454                 for ( e in data.events ) {\r
5455                         jQuery.removeEvent( dest, e, data.handle );\r
5456                 }\r
5457 \r
5458                 // Event data gets referenced instead of copied if the expando gets copied too\r
5459                 dest.removeAttribute( jQuery.expando );\r
5460         }\r
5461 \r
5462         // IE blanks contents when cloning scripts, and tries to evaluate newly-set text\r
5463         if ( nodeName === "script" && dest.text !== src.text ) {\r
5464                 disableScript( dest ).text = src.text;\r
5465                 restoreScript( dest );\r
5466 \r
5467         // IE6-10 improperly clones children of object elements using classid.\r
5468         // IE10 throws NoModificationAllowedError if parent is null, #12132.\r
5469         } else if ( nodeName === "object" ) {\r
5470                 if ( dest.parentNode ) {\r
5471                         dest.outerHTML = src.outerHTML;\r
5472                 }\r
5473 \r
5474                 // This path appears unavoidable for IE9. When cloning an object\r
5475                 // element in IE9, the outerHTML strategy above is not sufficient.\r
5476                 // If the src has innerHTML and the destination does not,\r
5477                 // copy the src.innerHTML into the dest.innerHTML. #10324\r
5478                 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {\r
5479                         dest.innerHTML = src.innerHTML;\r
5480                 }\r
5481 \r
5482         } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {\r
5483                 // IE6-8 fails to persist the checked state of a cloned checkbox\r
5484                 // or radio button. Worse, IE6-7 fail to give the cloned element\r
5485                 // a checked appearance if the defaultChecked value isn't also set\r
5486 \r
5487                 dest.defaultChecked = dest.checked = src.checked;\r
5488 \r
5489                 // IE6-7 get confused and end up setting the value of a cloned\r
5490                 // checkbox/radio button to an empty string instead of "on"\r
5491                 if ( dest.value !== src.value ) {\r
5492                         dest.value = src.value;\r
5493                 }\r
5494 \r
5495         // IE6-8 fails to return the selected option to the default selected\r
5496         // state when cloning options\r
5497         } else if ( nodeName === "option" ) {\r
5498                 dest.defaultSelected = dest.selected = src.defaultSelected;\r
5499 \r
5500         // IE6-8 fails to set the defaultValue to the correct value when\r
5501         // cloning other types of input fields\r
5502         } else if ( nodeName === "input" || nodeName === "textarea" ) {\r
5503                 dest.defaultValue = src.defaultValue;\r
5504         }\r
5505 }\r
5506 \r
5507 jQuery.extend({\r
5508         clone: function( elem, dataAndEvents, deepDataAndEvents ) {\r
5509                 var destElements, node, clone, i, srcElements,\r
5510                         inPage = jQuery.contains( elem.ownerDocument, elem );\r
5511 \r
5512                 if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {\r
5513                         clone = elem.cloneNode( true );\r
5514 \r
5515                 // IE<=8 does not properly clone detached, unknown element nodes\r
5516                 } else {\r
5517                         fragmentDiv.innerHTML = elem.outerHTML;\r
5518                         fragmentDiv.removeChild( clone = fragmentDiv.firstChild );\r
5519                 }\r
5520 \r
5521                 if ( (!support.noCloneEvent || !support.noCloneChecked) &&\r
5522                                 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {\r
5523 \r
5524                         // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\r
5525                         destElements = getAll( clone );\r
5526                         srcElements = getAll( elem );\r
5527 \r
5528                         // Fix all IE cloning issues\r
5529                         for ( i = 0; (node = srcElements[i]) != null; ++i ) {\r
5530                                 // Ensure that the destination node is not null; Fixes #9587\r
5531                                 if ( destElements[i] ) {\r
5532                                         fixCloneNodeIssues( node, destElements[i] );\r
5533                                 }\r
5534                         }\r
5535                 }\r
5536 \r
5537                 // Copy the events from the original to the clone\r
5538                 if ( dataAndEvents ) {\r
5539                         if ( deepDataAndEvents ) {\r
5540                                 srcElements = srcElements || getAll( elem );\r
5541                                 destElements = destElements || getAll( clone );\r
5542 \r
5543                                 for ( i = 0; (node = srcElements[i]) != null; i++ ) {\r
5544                                         cloneCopyEvent( node, destElements[i] );\r
5545                                 }\r
5546                         } else {\r
5547                                 cloneCopyEvent( elem, clone );\r
5548                         }\r
5549                 }\r
5550 \r
5551                 // Preserve script evaluation history\r
5552                 destElements = getAll( clone, "script" );\r
5553                 if ( destElements.length > 0 ) {\r
5554                         setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );\r
5555                 }\r
5556 \r
5557                 destElements = srcElements = node = null;\r
5558 \r
5559                 // Return the cloned set\r
5560                 return clone;\r
5561         },\r
5562 \r
5563         buildFragment: function( elems, context, scripts, selection ) {\r
5564                 var j, elem, contains,\r
5565                         tmp, tag, tbody, wrap,\r
5566                         l = elems.length,\r
5567 \r
5568                         // Ensure a safe fragment\r
5569                         safe = createSafeFragment( context ),\r
5570 \r
5571                         nodes = [],\r
5572                         i = 0;\r
5573 \r
5574                 for ( ; i < l; i++ ) {\r
5575                         elem = elems[ i ];\r
5576 \r
5577                         if ( elem || elem === 0 ) {\r
5578 \r
5579                                 // Add nodes directly\r
5580                                 if ( jQuery.type( elem ) === "object" ) {\r
5581                                         jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\r
5582 \r
5583                                 // Convert non-html into a text node\r
5584                                 } else if ( !rhtml.test( elem ) ) {\r
5585                                         nodes.push( context.createTextNode( elem ) );\r
5586 \r
5587                                 // Convert html into DOM nodes\r
5588                                 } else {\r
5589                                         tmp = tmp || safe.appendChild( context.createElement("div") );\r
5590 \r
5591                                         // Deserialize a standard representation\r
5592                                         tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();\r
5593                                         wrap = wrapMap[ tag ] || wrapMap._default;\r
5594 \r
5595                                         tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];\r
5596 \r
5597                                         // Descend through wrappers to the right content\r
5598                                         j = wrap[0];\r
5599                                         while ( j-- ) {\r
5600                                                 tmp = tmp.lastChild;\r
5601                                         }\r
5602 \r
5603                                         // Manually add leading whitespace removed by IE\r
5604                                         if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {\r
5605                                                 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );\r
5606                                         }\r
5607 \r
5608                                         // Remove IE's autoinserted <tbody> from table fragments\r
5609                                         if ( !support.tbody ) {\r
5610 \r
5611                                                 // String was a <table>, *may* have spurious <tbody>\r
5612                                                 elem = tag === "table" && !rtbody.test( elem ) ?\r
5613                                                         tmp.firstChild :\r
5614 \r
5615                                                         // String was a bare <thead> or <tfoot>\r
5616                                                         wrap[1] === "<table>" && !rtbody.test( elem ) ?\r
5617                                                                 tmp :\r
5618                                                                 0;\r
5619 \r
5620                                                 j = elem && elem.childNodes.length;\r
5621                                                 while ( j-- ) {\r
5622                                                         if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {\r
5623                                                                 elem.removeChild( tbody );\r
5624                                                         }\r
5625                                                 }\r
5626                                         }\r
5627 \r
5628                                         jQuery.merge( nodes, tmp.childNodes );\r
5629 \r
5630                                         // Fix #12392 for WebKit and IE > 9\r
5631                                         tmp.textContent = "";\r
5632 \r
5633                                         // Fix #12392 for oldIE\r
5634                                         while ( tmp.firstChild ) {\r
5635                                                 tmp.removeChild( tmp.firstChild );\r
5636                                         }\r
5637 \r
5638                                         // Remember the top-level container for proper cleanup\r
5639                                         tmp = safe.lastChild;\r
5640                                 }\r
5641                         }\r
5642                 }\r
5643 \r
5644                 // Fix #11356: Clear elements from fragment\r
5645                 if ( tmp ) {\r
5646                         safe.removeChild( tmp );\r
5647                 }\r
5648 \r
5649                 // Reset defaultChecked for any radios and checkboxes\r
5650                 // about to be appended to the DOM in IE 6/7 (#8060)\r
5651                 if ( !support.appendChecked ) {\r
5652                         jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );\r
5653                 }\r
5654 \r
5655                 i = 0;\r
5656                 while ( (elem = nodes[ i++ ]) ) {\r
5657 \r
5658                         // #4087 - If origin and destination elements are the same, and this is\r
5659                         // that element, do not do anything\r
5660                         if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\r
5661                                 continue;\r
5662                         }\r
5663 \r
5664                         contains = jQuery.contains( elem.ownerDocument, elem );\r
5665 \r
5666                         // Append to fragment\r
5667                         tmp = getAll( safe.appendChild( elem ), "script" );\r
5668 \r
5669                         // Preserve script evaluation history\r
5670                         if ( contains ) {\r
5671                                 setGlobalEval( tmp );\r
5672                         }\r
5673 \r
5674                         // Capture executables\r
5675                         if ( scripts ) {\r
5676                                 j = 0;\r
5677                                 while ( (elem = tmp[ j++ ]) ) {\r
5678                                         if ( rscriptType.test( elem.type || "" ) ) {\r
5679                                                 scripts.push( elem );\r
5680                                         }\r
5681                                 }\r
5682                         }\r
5683                 }\r
5684 \r
5685                 tmp = null;\r
5686 \r
5687                 return safe;\r
5688         },\r
5689 \r
5690         cleanData: function( elems, /* internal */ acceptData ) {\r
5691                 var elem, type, id, data,\r
5692                         i = 0,\r
5693                         internalKey = jQuery.expando,\r
5694                         cache = jQuery.cache,\r
5695                         deleteExpando = support.deleteExpando,\r
5696                         special = jQuery.event.special;\r
5697 \r
5698                 for ( ; (elem = elems[i]) != null; i++ ) {\r
5699                         if ( acceptData || jQuery.acceptData( elem ) ) {\r
5700 \r
5701                                 id = elem[ internalKey ];\r
5702                                 data = id && cache[ id ];\r
5703 \r
5704                                 if ( data ) {\r
5705                                         if ( data.events ) {\r
5706                                                 for ( type in data.events ) {\r
5707                                                         if ( special[ type ] ) {\r
5708                                                                 jQuery.event.remove( elem, type );\r
5709 \r
5710                                                         // This is a shortcut to avoid jQuery.event.remove's overhead\r
5711                                                         } else {\r
5712                                                                 jQuery.removeEvent( elem, type, data.handle );\r
5713                                                         }\r
5714                                                 }\r
5715                                         }\r
5716 \r
5717                                         // Remove cache only if it was not already removed by jQuery.event.remove\r
5718                                         if ( cache[ id ] ) {\r
5719 \r
5720                                                 delete cache[ id ];\r
5721 \r
5722                                                 // IE does not allow us to delete expando properties from nodes,\r
5723                                                 // nor does it have a removeAttribute function on Document nodes;\r
5724                                                 // we must handle all of these cases\r
5725                                                 if ( deleteExpando ) {\r
5726                                                         delete elem[ internalKey ];\r
5727 \r
5728                                                 } else if ( typeof elem.removeAttribute !== strundefined ) {\r
5729                                                         elem.removeAttribute( internalKey );\r
5730 \r
5731                                                 } else {\r
5732                                                         elem[ internalKey ] = null;\r
5733                                                 }\r
5734 \r
5735                                                 deletedIds.push( id );\r
5736                                         }\r
5737                                 }\r
5738                         }\r
5739                 }\r
5740         }\r
5741 });\r
5742 \r
5743 jQuery.fn.extend({\r
5744         text: function( value ) {\r
5745                 return access( this, function( value ) {\r
5746                         return value === undefined ?\r
5747                                 jQuery.text( this ) :\r
5748                                 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );\r
5749                 }, null, value, arguments.length );\r
5750         },\r
5751 \r
5752         append: function() {\r
5753                 return this.domManip( arguments, function( elem ) {\r
5754                         if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\r
5755                                 var target = manipulationTarget( this, elem );\r
5756                                 target.appendChild( elem );\r
5757                         }\r
5758                 });\r
5759         },\r
5760 \r
5761         prepend: function() {\r
5762                 return this.domManip( arguments, function( elem ) {\r
5763                         if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\r
5764                                 var target = manipulationTarget( this, elem );\r
5765                                 target.insertBefore( elem, target.firstChild );\r
5766                         }\r
5767                 });\r
5768         },\r
5769 \r
5770         before: function() {\r
5771                 return this.domManip( arguments, function( elem ) {\r
5772                         if ( this.parentNode ) {\r
5773                                 this.parentNode.insertBefore( elem, this );\r
5774                         }\r
5775                 });\r
5776         },\r
5777 \r
5778         after: function() {\r
5779                 return this.domManip( arguments, function( elem ) {\r
5780                         if ( this.parentNode ) {\r
5781                                 this.parentNode.insertBefore( elem, this.nextSibling );\r
5782                         }\r
5783                 });\r
5784         },\r
5785 \r
5786         remove: function( selector, keepData /* Internal Use Only */ ) {\r
5787                 var elem,\r
5788                         elems = selector ? jQuery.filter( selector, this ) : this,\r
5789                         i = 0;\r
5790 \r
5791                 for ( ; (elem = elems[i]) != null; i++ ) {\r
5792 \r
5793                         if ( !keepData && elem.nodeType === 1 ) {\r
5794                                 jQuery.cleanData( getAll( elem ) );\r
5795                         }\r
5796 \r
5797                         if ( elem.parentNode ) {\r
5798                                 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\r
5799                                         setGlobalEval( getAll( elem, "script" ) );\r
5800                                 }\r
5801                                 elem.parentNode.removeChild( elem );\r
5802                         }\r
5803                 }\r
5804 \r
5805                 return this;\r
5806         },\r
5807 \r
5808         empty: function() {\r
5809                 var elem,\r
5810                         i = 0;\r
5811 \r
5812                 for ( ; (elem = this[i]) != null; i++ ) {\r
5813                         // Remove element nodes and prevent memory leaks\r
5814                         if ( elem.nodeType === 1 ) {\r
5815                                 jQuery.cleanData( getAll( elem, false ) );\r
5816                         }\r
5817 \r
5818                         // Remove any remaining nodes\r
5819                         while ( elem.firstChild ) {\r
5820                                 elem.removeChild( elem.firstChild );\r
5821                         }\r
5822 \r
5823                         // If this is a select, ensure that it displays empty (#12336)\r
5824                         // Support: IE<9\r
5825                         if ( elem.options && jQuery.nodeName( elem, "select" ) ) {\r
5826                                 elem.options.length = 0;\r
5827                         }\r
5828                 }\r
5829 \r
5830                 return this;\r
5831         },\r
5832 \r
5833         clone: function( dataAndEvents, deepDataAndEvents ) {\r
5834                 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\r
5835                 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\r
5836 \r
5837                 return this.map(function() {\r
5838                         return jQuery.clone( this, dataAndEvents, deepDataAndEvents );\r
5839                 });\r
5840         },\r
5841 \r
5842         html: function( value ) {\r
5843                 return access( this, function( value ) {\r
5844                         var elem = this[ 0 ] || {},\r
5845                                 i = 0,\r
5846                                 l = this.length;\r
5847 \r
5848                         if ( value === undefined ) {\r
5849                                 return elem.nodeType === 1 ?\r
5850                                         elem.innerHTML.replace( rinlinejQuery, "" ) :\r
5851                                         undefined;\r
5852                         }\r
5853 \r
5854                         // See if we can take a shortcut and just use innerHTML\r
5855                         if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&\r
5856                                 ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&\r
5857                                 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&\r
5858                                 !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {\r
5859 \r
5860                                 value = value.replace( rxhtmlTag, "<$1></$2>" );\r
5861 \r
5862                                 try {\r
5863                                         for (; i < l; i++ ) {\r
5864                                                 // Remove element nodes and prevent memory leaks\r
5865                                                 elem = this[i] || {};\r
5866                                                 if ( elem.nodeType === 1 ) {\r
5867                                                         jQuery.cleanData( getAll( elem, false ) );\r
5868                                                         elem.innerHTML = value;\r
5869                                                 }\r
5870                                         }\r
5871 \r
5872                                         elem = 0;\r
5873 \r
5874                                 // If using innerHTML throws an exception, use the fallback method\r
5875                                 } catch(e) {}\r
5876                         }\r
5877 \r
5878                         if ( elem ) {\r
5879                                 this.empty().append( value );\r
5880                         }\r
5881                 }, null, value, arguments.length );\r
5882         },\r
5883 \r
5884         replaceWith: function() {\r
5885                 var arg = arguments[ 0 ];\r
5886 \r
5887                 // Make the changes, replacing each context element with the new content\r
5888                 this.domManip( arguments, function( elem ) {\r
5889                         arg = this.parentNode;\r
5890 \r
5891                         jQuery.cleanData( getAll( this ) );\r
5892 \r
5893                         if ( arg ) {\r
5894                                 arg.replaceChild( elem, this );\r
5895                         }\r
5896                 });\r
5897 \r
5898                 // Force removal if there was no new content (e.g., from empty arguments)\r
5899                 return arg && (arg.length || arg.nodeType) ? this : this.remove();\r
5900         },\r
5901 \r
5902         detach: function( selector ) {\r
5903                 return this.remove( selector, true );\r
5904         },\r
5905 \r
5906         domManip: function( args, callback ) {\r
5907 \r
5908                 // Flatten any nested arrays\r
5909                 args = concat.apply( [], args );\r
5910 \r
5911                 var first, node, hasScripts,\r
5912                         scripts, doc, fragment,\r
5913                         i = 0,\r
5914                         l = this.length,\r
5915                         set = this,\r
5916                         iNoClone = l - 1,\r
5917                         value = args[0],\r
5918                         isFunction = jQuery.isFunction( value );\r
5919 \r
5920                 // We can't cloneNode fragments that contain checked, in WebKit\r
5921                 if ( isFunction ||\r
5922                                 ( l > 1 && typeof value === "string" &&\r
5923                                         !support.checkClone && rchecked.test( value ) ) ) {\r
5924                         return this.each(function( index ) {\r
5925                                 var self = set.eq( index );\r
5926                                 if ( isFunction ) {\r
5927                                         args[0] = value.call( this, index, self.html() );\r
5928                                 }\r
5929                                 self.domManip( args, callback );\r
5930                         });\r
5931                 }\r
5932 \r
5933                 if ( l ) {\r
5934                         fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );\r
5935                         first = fragment.firstChild;\r
5936 \r
5937                         if ( fragment.childNodes.length === 1 ) {\r
5938                                 fragment = first;\r
5939                         }\r
5940 \r
5941                         if ( first ) {\r
5942                                 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );\r
5943                                 hasScripts = scripts.length;\r
5944 \r
5945                                 // Use the original fragment for the last item instead of the first because it can end up\r
5946                                 // being emptied incorrectly in certain situations (#8070).\r
5947                                 for ( ; i < l; i++ ) {\r
5948                                         node = fragment;\r
5949 \r
5950                                         if ( i !== iNoClone ) {\r
5951                                                 node = jQuery.clone( node, true, true );\r
5952 \r
5953                                                 // Keep references to cloned scripts for later restoration\r
5954                                                 if ( hasScripts ) {\r
5955                                                         jQuery.merge( scripts, getAll( node, "script" ) );\r
5956                                                 }\r
5957                                         }\r
5958 \r
5959                                         callback.call( this[i], node, i );\r
5960                                 }\r
5961 \r
5962                                 if ( hasScripts ) {\r
5963                                         doc = scripts[ scripts.length - 1 ].ownerDocument;\r
5964 \r
5965                                         // Reenable scripts\r
5966                                         jQuery.map( scripts, restoreScript );\r
5967 \r
5968                                         // Evaluate executable scripts on first document insertion\r
5969                                         for ( i = 0; i < hasScripts; i++ ) {\r
5970                                                 node = scripts[ i ];\r
5971                                                 if ( rscriptType.test( node.type || "" ) &&\r
5972                                                         !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {\r
5973 \r
5974                                                         if ( node.src ) {\r
5975                                                                 // Optional AJAX dependency, but won't run scripts if not present\r
5976                                                                 if ( jQuery._evalUrl ) {\r
5977                                                                         jQuery._evalUrl( node.src );\r
5978                                                                 }\r
5979                                                         } else {\r
5980                                                                 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );\r
5981                                                         }\r
5982                                                 }\r
5983                                         }\r
5984                                 }\r
5985 \r
5986                                 // Fix #11809: Avoid leaking memory\r
5987                                 fragment = first = null;\r
5988                         }\r
5989                 }\r
5990 \r
5991                 return this;\r
5992         }\r
5993 });\r
5994 \r
5995 jQuery.each({\r
5996         appendTo: "append",\r
5997         prependTo: "prepend",\r
5998         insertBefore: "before",\r
5999         insertAfter: "after",\r
6000         replaceAll: "replaceWith"\r
6001 }, function( name, original ) {\r
6002         jQuery.fn[ name ] = function( selector ) {\r
6003                 var elems,\r
6004                         i = 0,\r
6005                         ret = [],\r
6006                         insert = jQuery( selector ),\r
6007                         last = insert.length - 1;\r
6008 \r
6009                 for ( ; i <= last; i++ ) {\r
6010                         elems = i === last ? this : this.clone(true);\r
6011                         jQuery( insert[i] )[ original ]( elems );\r
6012 \r
6013                         // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()\r
6014                         push.apply( ret, elems.get() );\r
6015                 }\r
6016 \r
6017                 return this.pushStack( ret );\r
6018         };\r
6019 });\r
6020 \r
6021 \r
6022 var iframe,\r
6023         elemdisplay = {};\r
6024 \r
6025 /**\r
6026  * Retrieve the actual display of a element\r
6027  * @param {String} name nodeName of the element\r
6028  * @param {Object} doc Document object\r
6029  */\r
6030 // Called only from within defaultDisplay\r
6031 function actualDisplay( name, doc ) {\r
6032         var style,\r
6033                 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\r
6034 \r
6035                 // getDefaultComputedStyle might be reliably used only on attached element\r
6036                 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?\r
6037 \r
6038                         // Use of this method is a temporary fix (more like optmization) until something better comes along,\r
6039                         // since it was removed from specification and supported only in FF\r
6040                         style.display : jQuery.css( elem[ 0 ], "display" );\r
6041 \r
6042         // We don't have any data stored on the element,\r
6043         // so use "detach" method as fast way to get rid of the element\r
6044         elem.detach();\r
6045 \r
6046         return display;\r
6047 }\r
6048 \r
6049 /**\r
6050  * Try to determine the default display value of an element\r
6051  * @param {String} nodeName\r
6052  */\r
6053 function defaultDisplay( nodeName ) {\r
6054         var doc = document,\r
6055                 display = elemdisplay[ nodeName ];\r
6056 \r
6057         if ( !display ) {\r
6058                 display = actualDisplay( nodeName, doc );\r
6059 \r
6060                 // If the simple way fails, read from inside an iframe\r
6061                 if ( display === "none" || !display ) {\r
6062 \r
6063                         // Use the already-created iframe if possible\r
6064                         iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );\r
6065 \r
6066                         // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\r
6067                         doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;\r
6068 \r
6069                         // Support: IE\r
6070                         doc.write();\r
6071                         doc.close();\r
6072 \r
6073                         display = actualDisplay( nodeName, doc );\r
6074                         iframe.detach();\r
6075                 }\r
6076 \r
6077                 // Store the correct default display\r
6078                 elemdisplay[ nodeName ] = display;\r
6079         }\r
6080 \r
6081         return display;\r
6082 }\r
6083 \r
6084 \r
6085 (function() {\r
6086         var shrinkWrapBlocksVal;\r
6087 \r
6088         support.shrinkWrapBlocks = function() {\r
6089                 if ( shrinkWrapBlocksVal != null ) {\r
6090                         return shrinkWrapBlocksVal;\r
6091                 }\r
6092 \r
6093                 // Will be changed later if needed.\r
6094                 shrinkWrapBlocksVal = false;\r
6095 \r
6096                 // Minified: var b,c,d\r
6097                 var div, body, container;\r
6098 \r
6099                 body = document.getElementsByTagName( "body" )[ 0 ];\r
6100                 if ( !body || !body.style ) {\r
6101                         // Test fired too early or in an unsupported environment, exit.\r
6102                         return;\r
6103                 }\r
6104 \r
6105                 // Setup\r
6106                 div = document.createElement( "div" );\r
6107                 container = document.createElement( "div" );\r
6108                 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";\r
6109                 body.appendChild( container ).appendChild( div );\r
6110 \r
6111                 // Support: IE6\r
6112                 // Check if elements with layout shrink-wrap their children\r
6113                 if ( typeof div.style.zoom !== strundefined ) {\r
6114                         // Reset CSS: box-sizing; display; margin; border\r
6115                         div.style.cssText =\r
6116                                 // Support: Firefox<29, Android 2.3\r
6117                                 // Vendor-prefix box-sizing\r
6118                                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +\r
6119                                 "box-sizing:content-box;display:block;margin:0;border:0;" +\r
6120                                 "padding:1px;width:1px;zoom:1";\r
6121                         div.appendChild( document.createElement( "div" ) ).style.width = "5px";\r
6122                         shrinkWrapBlocksVal = div.offsetWidth !== 3;\r
6123                 }\r
6124 \r
6125                 body.removeChild( container );\r
6126 \r
6127                 return shrinkWrapBlocksVal;\r
6128         };\r
6129 \r
6130 })();\r
6131 var rmargin = (/^margin/);\r
6132 \r
6133 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );\r
6134 \r
6135 \r
6136 \r
6137 var getStyles, curCSS,\r
6138         rposition = /^(top|right|bottom|left)$/;\r
6139 \r
6140 if ( window.getComputedStyle ) {\r
6141         getStyles = function( elem ) {\r
6142                 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)\r
6143                 // IE throws on elements created in popups\r
6144                 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"\r
6145                 if ( elem.ownerDocument.defaultView.opener ) {\r
6146                         return elem.ownerDocument.defaultView.getComputedStyle( elem, null );\r
6147                 }\r
6148 \r
6149                 return window.getComputedStyle( elem, null );\r
6150         };\r
6151 \r
6152         curCSS = function( elem, name, computed ) {\r
6153                 var width, minWidth, maxWidth, ret,\r
6154                         style = elem.style;\r
6155 \r
6156                 computed = computed || getStyles( elem );\r
6157 \r
6158                 // getPropertyValue is only needed for .css('filter') in IE9, see #12537\r
6159                 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;\r
6160 \r
6161                 if ( computed ) {\r
6162 \r
6163                         if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {\r
6164                                 ret = jQuery.style( elem, name );\r
6165                         }\r
6166 \r
6167                         // A tribute to the "awesome hack by Dean Edwards"\r
6168                         // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right\r
6169                         // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\r
6170                         // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\r
6171                         if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\r
6172 \r
6173                                 // Remember the original values\r
6174                                 width = style.width;\r
6175                                 minWidth = style.minWidth;\r
6176                                 maxWidth = style.maxWidth;\r
6177 \r
6178                                 // Put in the new values to get a computed value out\r
6179                                 style.minWidth = style.maxWidth = style.width = ret;\r
6180                                 ret = computed.width;\r
6181 \r
6182                                 // Revert the changed values\r
6183                                 style.width = width;\r
6184                                 style.minWidth = minWidth;\r
6185                                 style.maxWidth = maxWidth;\r
6186                         }\r
6187                 }\r
6188 \r
6189                 // Support: IE\r
6190                 // IE returns zIndex value as an integer.\r
6191                 return ret === undefined ?\r
6192                         ret :\r
6193                         ret + "";\r
6194         };\r
6195 } else if ( document.documentElement.currentStyle ) {\r
6196         getStyles = function( elem ) {\r
6197                 return elem.currentStyle;\r
6198         };\r
6199 \r
6200         curCSS = function( elem, name, computed ) {\r
6201                 var left, rs, rsLeft, ret,\r
6202                         style = elem.style;\r
6203 \r
6204                 computed = computed || getStyles( elem );\r
6205                 ret = computed ? computed[ name ] : undefined;\r
6206 \r
6207                 // Avoid setting ret to empty string here\r
6208                 // so we don't default to auto\r
6209                 if ( ret == null && style && style[ name ] ) {\r
6210                         ret = style[ name ];\r
6211                 }\r
6212 \r
6213                 // From the awesome hack by Dean Edwards\r
6214                 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\r
6215 \r
6216                 // If we're not dealing with a regular pixel number\r
6217                 // but a number that has a weird ending, we need to convert it to pixels\r
6218                 // but not position css attributes, as those are proportional to the parent element instead\r
6219                 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem\r
6220                 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {\r
6221 \r
6222                         // Remember the original values\r
6223                         left = style.left;\r
6224                         rs = elem.runtimeStyle;\r
6225                         rsLeft = rs && rs.left;\r
6226 \r
6227                         // Put in the new values to get a computed value out\r
6228                         if ( rsLeft ) {\r
6229                                 rs.left = elem.currentStyle.left;\r
6230                         }\r
6231                         style.left = name === "fontSize" ? "1em" : ret;\r
6232                         ret = style.pixelLeft + "px";\r
6233 \r
6234                         // Revert the changed values\r
6235                         style.left = left;\r
6236                         if ( rsLeft ) {\r
6237                                 rs.left = rsLeft;\r
6238                         }\r
6239                 }\r
6240 \r
6241                 // Support: IE\r
6242                 // IE returns zIndex value as an integer.\r
6243                 return ret === undefined ?\r
6244                         ret :\r
6245                         ret + "" || "auto";\r
6246         };\r
6247 }\r
6248 \r
6249 \r
6250 \r
6251 \r
6252 function addGetHookIf( conditionFn, hookFn ) {\r
6253         // Define the hook, we'll check on the first run if it's really needed.\r
6254         return {\r
6255                 get: function() {\r
6256                         var condition = conditionFn();\r
6257 \r
6258                         if ( condition == null ) {\r
6259                                 // The test was not ready at this point; screw the hook this time\r
6260                                 // but check again when needed next time.\r
6261                                 return;\r
6262                         }\r
6263 \r
6264                         if ( condition ) {\r
6265                                 // Hook not needed (or it's not possible to use it due to missing dependency),\r
6266                                 // remove it.\r
6267                                 // Since there are no other hooks for marginRight, remove the whole object.\r
6268                                 delete this.get;\r
6269                                 return;\r
6270                         }\r
6271 \r
6272                         // Hook needed; redefine it so that the support test is not executed again.\r
6273 \r
6274                         return (this.get = hookFn).apply( this, arguments );\r
6275                 }\r
6276         };\r
6277 }\r
6278 \r
6279 \r
6280 (function() {\r
6281         // Minified: var b,c,d,e,f,g, h,i\r
6282         var div, style, a, pixelPositionVal, boxSizingReliableVal,\r
6283                 reliableHiddenOffsetsVal, reliableMarginRightVal;\r
6284 \r
6285         // Setup\r
6286         div = document.createElement( "div" );\r
6287         div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";\r
6288         a = div.getElementsByTagName( "a" )[ 0 ];\r
6289         style = a && a.style;\r
6290 \r
6291         // Finish early in limited (non-browser) environments\r
6292         if ( !style ) {\r
6293                 return;\r
6294         }\r
6295 \r
6296         style.cssText = "float:left;opacity:.5";\r
6297 \r
6298         // Support: IE<9\r
6299         // Make sure that element opacity exists (as opposed to filter)\r
6300         support.opacity = style.opacity === "0.5";\r
6301 \r
6302         // Verify style float existence\r
6303         // (IE uses styleFloat instead of cssFloat)\r
6304         support.cssFloat = !!style.cssFloat;\r
6305 \r
6306         div.style.backgroundClip = "content-box";\r
6307         div.cloneNode( true ).style.backgroundClip = "";\r
6308         support.clearCloneStyle = div.style.backgroundClip === "content-box";\r
6309 \r
6310         // Support: Firefox<29, Android 2.3\r
6311         // Vendor-prefix box-sizing\r
6312         support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||\r
6313                 style.WebkitBoxSizing === "";\r
6314 \r
6315         jQuery.extend(support, {\r
6316                 reliableHiddenOffsets: function() {\r
6317                         if ( reliableHiddenOffsetsVal == null ) {\r
6318                                 computeStyleTests();\r
6319                         }\r
6320                         return reliableHiddenOffsetsVal;\r
6321                 },\r
6322 \r
6323                 boxSizingReliable: function() {\r
6324                         if ( boxSizingReliableVal == null ) {\r
6325                                 computeStyleTests();\r
6326                         }\r
6327                         return boxSizingReliableVal;\r
6328                 },\r
6329 \r
6330                 pixelPosition: function() {\r
6331                         if ( pixelPositionVal == null ) {\r
6332                                 computeStyleTests();\r
6333                         }\r
6334                         return pixelPositionVal;\r
6335                 },\r
6336 \r
6337                 // Support: Android 2.3\r
6338                 reliableMarginRight: function() {\r
6339                         if ( reliableMarginRightVal == null ) {\r
6340                                 computeStyleTests();\r
6341                         }\r
6342                         return reliableMarginRightVal;\r
6343                 }\r
6344         });\r
6345 \r
6346         function computeStyleTests() {\r
6347                 // Minified: var b,c,d,j\r
6348                 var div, body, container, contents;\r
6349 \r
6350                 body = document.getElementsByTagName( "body" )[ 0 ];\r
6351                 if ( !body || !body.style ) {\r
6352                         // Test fired too early or in an unsupported environment, exit.\r
6353                         return;\r
6354                 }\r
6355 \r
6356                 // Setup\r
6357                 div = document.createElement( "div" );\r
6358                 container = document.createElement( "div" );\r
6359                 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";\r
6360                 body.appendChild( container ).appendChild( div );\r
6361 \r
6362                 div.style.cssText =\r
6363                         // Support: Firefox<29, Android 2.3\r
6364                         // Vendor-prefix box-sizing\r
6365                         "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +\r
6366                         "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +\r
6367                         "border:1px;padding:1px;width:4px;position:absolute";\r
6368 \r
6369                 // Support: IE<9\r
6370                 // Assume reasonable values in the absence of getComputedStyle\r
6371                 pixelPositionVal = boxSizingReliableVal = false;\r
6372                 reliableMarginRightVal = true;\r
6373 \r
6374                 // Check for getComputedStyle so that this code is not run in IE<9.\r
6375                 if ( window.getComputedStyle ) {\r
6376                         pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";\r
6377                         boxSizingReliableVal =\r
6378                                 ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";\r
6379 \r
6380                         // Support: Android 2.3\r
6381                         // Div with explicit width and no margin-right incorrectly\r
6382                         // gets computed margin-right based on width of container (#3333)\r
6383                         // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\r
6384                         contents = div.appendChild( document.createElement( "div" ) );\r
6385 \r
6386                         // Reset CSS: box-sizing; display; margin; border; padding\r
6387                         contents.style.cssText = div.style.cssText =\r
6388                                 // Support: Firefox<29, Android 2.3\r
6389                                 // Vendor-prefix box-sizing\r
6390                                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +\r
6391                                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";\r
6392                         contents.style.marginRight = contents.style.width = "0";\r
6393                         div.style.width = "1px";\r
6394 \r
6395                         reliableMarginRightVal =\r
6396                                 !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );\r
6397 \r
6398                         div.removeChild( contents );\r
6399                 }\r
6400 \r
6401                 // Support: IE8\r
6402                 // Check if table cells still have offsetWidth/Height when they are set\r
6403                 // to display:none and there are still other visible table cells in a\r
6404                 // table row; if so, offsetWidth/Height are not reliable for use when\r
6405                 // determining if an element has been hidden directly using\r
6406                 // display:none (it is still safe to use offsets if a parent element is\r
6407                 // hidden; don safety goggles and see bug #4512 for more information).\r
6408                 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";\r
6409                 contents = div.getElementsByTagName( "td" );\r
6410                 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";\r
6411                 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;\r
6412                 if ( reliableHiddenOffsetsVal ) {\r
6413                         contents[ 0 ].style.display = "";\r
6414                         contents[ 1 ].style.display = "none";\r
6415                         reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;\r
6416                 }\r
6417 \r
6418                 body.removeChild( container );\r
6419         }\r
6420 \r
6421 })();\r
6422 \r
6423 \r
6424 // A method for quickly swapping in/out CSS properties to get correct calculations.\r
6425 jQuery.swap = function( elem, options, callback, args ) {\r
6426         var ret, name,\r
6427                 old = {};\r
6428 \r
6429         // Remember the old values, and insert the new ones\r
6430         for ( name in options ) {\r
6431                 old[ name ] = elem.style[ name ];\r
6432                 elem.style[ name ] = options[ name ];\r
6433         }\r
6434 \r
6435         ret = callback.apply( elem, args || [] );\r
6436 \r
6437         // Revert the old values\r
6438         for ( name in options ) {\r
6439                 elem.style[ name ] = old[ name ];\r
6440         }\r
6441 \r
6442         return ret;\r
6443 };\r
6444 \r
6445 \r
6446 var\r
6447                 ralpha = /alpha\([^)]*\)/i,\r
6448         ropacity = /opacity\s*=\s*([^)]*)/,\r
6449 \r
6450         // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"\r
6451         // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\r
6452         rdisplayswap = /^(none|table(?!-c[ea]).+)/,\r
6453         rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),\r
6454         rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),\r
6455 \r
6456         cssShow = { position: "absolute", visibility: "hidden", display: "block" },\r
6457         cssNormalTransform = {\r
6458                 letterSpacing: "0",\r
6459                 fontWeight: "400"\r
6460         },\r
6461 \r
6462         cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];\r
6463 \r
6464 \r
6465 // return a css property mapped to a potentially vendor prefixed property\r
6466 function vendorPropName( style, name ) {\r
6467 \r
6468         // shortcut for names that are not vendor prefixed\r
6469         if ( name in style ) {\r
6470                 return name;\r
6471         }\r
6472 \r
6473         // check for vendor prefixed names\r
6474         var capName = name.charAt(0).toUpperCase() + name.slice(1),\r
6475                 origName = name,\r
6476                 i = cssPrefixes.length;\r
6477 \r
6478         while ( i-- ) {\r
6479                 name = cssPrefixes[ i ] + capName;\r
6480                 if ( name in style ) {\r
6481                         return name;\r
6482                 }\r
6483         }\r
6484 \r
6485         return origName;\r
6486 }\r
6487 \r
6488 function showHide( elements, show ) {\r
6489         var display, elem, hidden,\r
6490                 values = [],\r
6491                 index = 0,\r
6492                 length = elements.length;\r
6493 \r
6494         for ( ; index < length; index++ ) {\r
6495                 elem = elements[ index ];\r
6496                 if ( !elem.style ) {\r
6497                         continue;\r
6498                 }\r
6499 \r
6500                 values[ index ] = jQuery._data( elem, "olddisplay" );\r
6501                 display = elem.style.display;\r
6502                 if ( show ) {\r
6503                         // Reset the inline display of this element to learn if it is\r
6504                         // being hidden by cascaded rules or not\r
6505                         if ( !values[ index ] && display === "none" ) {\r
6506                                 elem.style.display = "";\r
6507                         }\r
6508 \r
6509                         // Set elements which have been overridden with display: none\r
6510                         // in a stylesheet to whatever the default browser style is\r
6511                         // for such an element\r
6512                         if ( elem.style.display === "" && isHidden( elem ) ) {\r
6513                                 values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );\r
6514                         }\r
6515                 } else {\r
6516                         hidden = isHidden( elem );\r
6517 \r
6518                         if ( display && display !== "none" || !hidden ) {\r
6519                                 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );\r
6520                         }\r
6521                 }\r
6522         }\r
6523 \r
6524         // Set the display of most of the elements in a second loop\r
6525         // to avoid the constant reflow\r
6526         for ( index = 0; index < length; index++ ) {\r
6527                 elem = elements[ index ];\r
6528                 if ( !elem.style ) {\r
6529                         continue;\r
6530                 }\r
6531                 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {\r
6532                         elem.style.display = show ? values[ index ] || "" : "none";\r
6533                 }\r
6534         }\r
6535 \r
6536         return elements;\r
6537 }\r
6538 \r
6539 function setPositiveNumber( elem, value, subtract ) {\r
6540         var matches = rnumsplit.exec( value );\r
6541         return matches ?\r
6542                 // Guard against undefined "subtract", e.g., when used as in cssHooks\r
6543                 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :\r
6544                 value;\r
6545 }\r
6546 \r
6547 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\r
6548         var i = extra === ( isBorderBox ? "border" : "content" ) ?\r
6549                 // If we already have the right measurement, avoid augmentation\r
6550                 4 :\r
6551                 // Otherwise initialize for horizontal or vertical properties\r
6552                 name === "width" ? 1 : 0,\r
6553 \r
6554                 val = 0;\r
6555 \r
6556         for ( ; i < 4; i += 2 ) {\r
6557                 // both box models exclude margin, so add it if we want it\r
6558                 if ( extra === "margin" ) {\r
6559                         val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\r
6560                 }\r
6561 \r
6562                 if ( isBorderBox ) {\r
6563                         // border-box includes padding, so remove it if we want content\r
6564                         if ( extra === "content" ) {\r
6565                                 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\r
6566                         }\r
6567 \r
6568                         // at this point, extra isn't border nor margin, so remove border\r
6569                         if ( extra !== "margin" ) {\r
6570                                 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\r
6571                         }\r
6572                 } else {\r
6573                         // at this point, extra isn't content, so add padding\r
6574                         val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\r
6575 \r
6576                         // at this point, extra isn't content nor padding, so add border\r
6577                         if ( extra !== "padding" ) {\r
6578                                 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\r
6579                         }\r
6580                 }\r
6581         }\r
6582 \r
6583         return val;\r
6584 }\r
6585 \r
6586 function getWidthOrHeight( elem, name, extra ) {\r
6587 \r
6588         // Start with offset property, which is equivalent to the border-box value\r
6589         var valueIsBorderBox = true,\r
6590                 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,\r
6591                 styles = getStyles( elem ),\r
6592                 isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";\r
6593 \r
6594         // some non-html elements return undefined for offsetWidth, so check for null/undefined\r
6595         // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\r
6596         // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\r
6597         if ( val <= 0 || val == null ) {\r
6598                 // Fall back to computed then uncomputed css if necessary\r
6599                 val = curCSS( elem, name, styles );\r
6600                 if ( val < 0 || val == null ) {\r
6601                         val = elem.style[ name ];\r
6602                 }\r
6603 \r
6604                 // Computed unit is not pixels. Stop here and return.\r
6605                 if ( rnumnonpx.test(val) ) {\r
6606                         return val;\r
6607                 }\r
6608 \r
6609                 // we need the check for style in case a browser which returns unreliable values\r
6610                 // for getComputedStyle silently falls back to the reliable elem.style\r
6611                 valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );\r
6612 \r
6613                 // Normalize "", auto, and prepare for extra\r
6614                 val = parseFloat( val ) || 0;\r
6615         }\r
6616 \r
6617         // use the active box-sizing model to add/subtract irrelevant styles\r
6618         return ( val +\r
6619                 augmentWidthOrHeight(\r
6620                         elem,\r
6621                         name,\r
6622                         extra || ( isBorderBox ? "border" : "content" ),\r
6623                         valueIsBorderBox,\r
6624                         styles\r
6625                 )\r
6626         ) + "px";\r
6627 }\r
6628 \r
6629 jQuery.extend({\r
6630         // Add in style property hooks for overriding the default\r
6631         // behavior of getting and setting a style property\r
6632         cssHooks: {\r
6633                 opacity: {\r
6634                         get: function( elem, computed ) {\r
6635                                 if ( computed ) {\r
6636                                         // We should always get a number back from opacity\r
6637                                         var ret = curCSS( elem, "opacity" );\r
6638                                         return ret === "" ? "1" : ret;\r
6639                                 }\r
6640                         }\r
6641                 }\r
6642         },\r
6643 \r
6644         // Don't automatically add "px" to these possibly-unitless properties\r
6645         cssNumber: {\r
6646                 "columnCount": true,\r
6647                 "fillOpacity": true,\r
6648                 "flexGrow": true,\r
6649                 "flexShrink": true,\r
6650                 "fontWeight": true,\r
6651                 "lineHeight": true,\r
6652                 "opacity": true,\r
6653                 "order": true,\r
6654                 "orphans": true,\r
6655                 "widows": true,\r
6656                 "zIndex": true,\r
6657                 "zoom": true\r
6658         },\r
6659 \r
6660         // Add in properties whose names you wish to fix before\r
6661         // setting or getting the value\r
6662         cssProps: {\r
6663                 // normalize float css property\r
6664                 "float": support.cssFloat ? "cssFloat" : "styleFloat"\r
6665         },\r
6666 \r
6667         // Get and set the style property on a DOM Node\r
6668         style: function( elem, name, value, extra ) {\r
6669                 // Don't set styles on text and comment nodes\r
6670                 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\r
6671                         return;\r
6672                 }\r
6673 \r
6674                 // Make sure that we're working with the right name\r
6675                 var ret, type, hooks,\r
6676                         origName = jQuery.camelCase( name ),\r
6677                         style = elem.style;\r
6678 \r
6679                 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\r
6680 \r
6681                 // gets hook for the prefixed version\r
6682                 // followed by the unprefixed version\r
6683                 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\r
6684 \r
6685                 // Check if we're setting a value\r
6686                 if ( value !== undefined ) {\r
6687                         type = typeof value;\r
6688 \r
6689                         // convert relative number strings (+= or -=) to relative numbers. #7345\r
6690                         if ( type === "string" && (ret = rrelNum.exec( value )) ) {\r
6691                                 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\r
6692                                 // Fixes bug #9237\r
6693                                 type = "number";\r
6694                         }\r
6695 \r
6696                         // Make sure that null and NaN values aren't set. See: #7116\r
6697                         if ( value == null || value !== value ) {\r
6698                                 return;\r
6699                         }\r
6700 \r
6701                         // If a number was passed in, add 'px' to the (except for certain CSS properties)\r
6702                         if ( type === "number" && !jQuery.cssNumber[ origName ] ) {\r
6703                                 value += "px";\r
6704                         }\r
6705 \r
6706                         // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,\r
6707                         // but it would mean to define eight (for every problematic property) identical functions\r
6708                         if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {\r
6709                                 style[ name ] = "inherit";\r
6710                         }\r
6711 \r
6712                         // If a hook was provided, use that value, otherwise just set the specified value\r
6713                         if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\r
6714 \r
6715                                 // Support: IE\r
6716                                 // Swallow errors from 'invalid' CSS values (#5509)\r
6717                                 try {\r
6718                                         style[ name ] = value;\r
6719                                 } catch(e) {}\r
6720                         }\r
6721 \r
6722                 } else {\r
6723                         // If a hook was provided get the non-computed value from there\r
6724                         if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\r
6725                                 return ret;\r
6726                         }\r
6727 \r
6728                         // Otherwise just get the value from the style object\r
6729                         return style[ name ];\r
6730                 }\r
6731         },\r
6732 \r
6733         css: function( elem, name, extra, styles ) {\r
6734                 var num, val, hooks,\r
6735                         origName = jQuery.camelCase( name );\r
6736 \r
6737                 // Make sure that we're working with the right name\r
6738                 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\r
6739 \r
6740                 // gets hook for the prefixed version\r
6741                 // followed by the unprefixed version\r
6742                 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\r
6743 \r
6744                 // If a hook was provided get the computed value from there\r
6745                 if ( hooks && "get" in hooks ) {\r
6746                         val = hooks.get( elem, true, extra );\r
6747                 }\r
6748 \r
6749                 // Otherwise, if a way to get the computed value exists, use that\r
6750                 if ( val === undefined ) {\r
6751                         val = curCSS( elem, name, styles );\r
6752                 }\r
6753 \r
6754                 //convert "normal" to computed value\r
6755                 if ( val === "normal" && name in cssNormalTransform ) {\r
6756                         val = cssNormalTransform[ name ];\r
6757                 }\r
6758 \r
6759                 // Return, converting to number if forced or a qualifier was provided and val looks numeric\r
6760                 if ( extra === "" || extra ) {\r
6761                         num = parseFloat( val );\r
6762                         return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\r
6763                 }\r
6764                 return val;\r
6765         }\r
6766 });\r
6767 \r
6768 jQuery.each([ "height", "width" ], function( i, name ) {\r
6769         jQuery.cssHooks[ name ] = {\r
6770                 get: function( elem, computed, extra ) {\r
6771                         if ( computed ) {\r
6772                                 // certain elements can have dimension info if we invisibly show them\r
6773                                 // however, it must have a current display style that would benefit from this\r
6774                                 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?\r
6775                                         jQuery.swap( elem, cssShow, function() {\r
6776                                                 return getWidthOrHeight( elem, name, extra );\r
6777                                         }) :\r
6778                                         getWidthOrHeight( elem, name, extra );\r
6779                         }\r
6780                 },\r
6781 \r
6782                 set: function( elem, value, extra ) {\r
6783                         var styles = extra && getStyles( elem );\r
6784                         return setPositiveNumber( elem, value, extra ?\r
6785                                 augmentWidthOrHeight(\r
6786                                         elem,\r
6787                                         name,\r
6788                                         extra,\r
6789                                         support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",\r
6790                                         styles\r
6791                                 ) : 0\r
6792                         );\r
6793                 }\r
6794         };\r
6795 });\r
6796 \r
6797 if ( !support.opacity ) {\r
6798         jQuery.cssHooks.opacity = {\r
6799                 get: function( elem, computed ) {\r
6800                         // IE uses filters for opacity\r
6801                         return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?\r
6802                                 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :\r
6803                                 computed ? "1" : "";\r
6804                 },\r
6805 \r
6806                 set: function( elem, value ) {\r
6807                         var style = elem.style,\r
6808                                 currentStyle = elem.currentStyle,\r
6809                                 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",\r
6810                                 filter = currentStyle && currentStyle.filter || style.filter || "";\r
6811 \r
6812                         // IE has trouble with opacity if it does not have layout\r
6813                         // Force it by setting the zoom level\r
6814                         style.zoom = 1;\r
6815 \r
6816                         // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652\r
6817                         // if value === "", then remove inline opacity #12685\r
6818                         if ( ( value >= 1 || value === "" ) &&\r
6819                                         jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&\r
6820                                         style.removeAttribute ) {\r
6821 \r
6822                                 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText\r
6823                                 // if "filter:" is present at all, clearType is disabled, we want to avoid this\r
6824                                 // style.removeAttribute is IE Only, but so apparently is this code path...\r
6825                                 style.removeAttribute( "filter" );\r
6826 \r
6827                                 // if there is no filter style applied in a css rule or unset inline opacity, we are done\r
6828                                 if ( value === "" || currentStyle && !currentStyle.filter ) {\r
6829                                         return;\r
6830                                 }\r
6831                         }\r
6832 \r
6833                         // otherwise, set new filter values\r
6834                         style.filter = ralpha.test( filter ) ?\r
6835                                 filter.replace( ralpha, opacity ) :\r
6836                                 filter + " " + opacity;\r
6837                 }\r
6838         };\r
6839 }\r
6840 \r
6841 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,\r
6842         function( elem, computed ) {\r
6843                 if ( computed ) {\r
6844                         // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\r
6845                         // Work around by temporarily setting element display to inline-block\r
6846                         return jQuery.swap( elem, { "display": "inline-block" },\r
6847                                 curCSS, [ elem, "marginRight" ] );\r
6848                 }\r
6849         }\r
6850 );\r
6851 \r
6852 // These hooks are used by animate to expand properties\r
6853 jQuery.each({\r
6854         margin: "",\r
6855         padding: "",\r
6856         border: "Width"\r
6857 }, function( prefix, suffix ) {\r
6858         jQuery.cssHooks[ prefix + suffix ] = {\r
6859                 expand: function( value ) {\r
6860                         var i = 0,\r
6861                                 expanded = {},\r
6862 \r
6863                                 // assumes a single number if not a string\r
6864                                 parts = typeof value === "string" ? value.split(" ") : [ value ];\r
6865 \r
6866                         for ( ; i < 4; i++ ) {\r
6867                                 expanded[ prefix + cssExpand[ i ] + suffix ] =\r
6868                                         parts[ i ] || parts[ i - 2 ] || parts[ 0 ];\r
6869                         }\r
6870 \r
6871                         return expanded;\r
6872                 }\r
6873         };\r
6874 \r
6875         if ( !rmargin.test( prefix ) ) {\r
6876                 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\r
6877         }\r
6878 });\r
6879 \r
6880 jQuery.fn.extend({\r
6881         css: function( name, value ) {\r
6882                 return access( this, function( elem, name, value ) {\r
6883                         var styles, len,\r
6884                                 map = {},\r
6885                                 i = 0;\r
6886 \r
6887                         if ( jQuery.isArray( name ) ) {\r
6888                                 styles = getStyles( elem );\r
6889                                 len = name.length;\r
6890 \r
6891                                 for ( ; i < len; i++ ) {\r
6892                                         map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\r
6893                                 }\r
6894 \r
6895                                 return map;\r
6896                         }\r
6897 \r
6898                         return value !== undefined ?\r
6899                                 jQuery.style( elem, name, value ) :\r
6900                                 jQuery.css( elem, name );\r
6901                 }, name, value, arguments.length > 1 );\r
6902         },\r
6903         show: function() {\r
6904                 return showHide( this, true );\r
6905         },\r
6906         hide: function() {\r
6907                 return showHide( this );\r
6908         },\r
6909         toggle: function( state ) {\r
6910                 if ( typeof state === "boolean" ) {\r
6911                         return state ? this.show() : this.hide();\r
6912                 }\r
6913 \r
6914                 return this.each(function() {\r
6915                         if ( isHidden( this ) ) {\r
6916                                 jQuery( this ).show();\r
6917                         } else {\r
6918                                 jQuery( this ).hide();\r
6919                         }\r
6920                 });\r
6921         }\r
6922 });\r
6923 \r
6924 \r
6925 function Tween( elem, options, prop, end, easing ) {\r
6926         return new Tween.prototype.init( elem, options, prop, end, easing );\r
6927 }\r
6928 jQuery.Tween = Tween;\r
6929 \r
6930 Tween.prototype = {\r
6931         constructor: Tween,\r
6932         init: function( elem, options, prop, end, easing, unit ) {\r
6933                 this.elem = elem;\r
6934                 this.prop = prop;\r
6935                 this.easing = easing || "swing";\r
6936                 this.options = options;\r
6937                 this.start = this.now = this.cur();\r
6938                 this.end = end;\r
6939                 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );\r
6940         },\r
6941         cur: function() {\r
6942                 var hooks = Tween.propHooks[ this.prop ];\r
6943 \r
6944                 return hooks && hooks.get ?\r
6945                         hooks.get( this ) :\r
6946                         Tween.propHooks._default.get( this );\r
6947         },\r
6948         run: function( percent ) {\r
6949                 var eased,\r
6950                         hooks = Tween.propHooks[ this.prop ];\r
6951 \r
6952                 if ( this.options.duration ) {\r
6953                         this.pos = eased = jQuery.easing[ this.easing ](\r
6954                                 percent, this.options.duration * percent, 0, 1, this.options.duration\r
6955                         );\r
6956                 } else {\r
6957                         this.pos = eased = percent;\r
6958                 }\r
6959                 this.now = ( this.end - this.start ) * eased + this.start;\r
6960 \r
6961                 if ( this.options.step ) {\r
6962                         this.options.step.call( this.elem, this.now, this );\r
6963                 }\r
6964 \r
6965                 if ( hooks && hooks.set ) {\r
6966                         hooks.set( this );\r
6967                 } else {\r
6968                         Tween.propHooks._default.set( this );\r
6969                 }\r
6970                 return this;\r
6971         }\r
6972 };\r
6973 \r
6974 Tween.prototype.init.prototype = Tween.prototype;\r
6975 \r
6976 Tween.propHooks = {\r
6977         _default: {\r
6978                 get: function( tween ) {\r
6979                         var result;\r
6980 \r
6981                         if ( tween.elem[ tween.prop ] != null &&\r
6982                                 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\r
6983                                 return tween.elem[ tween.prop ];\r
6984                         }\r
6985 \r
6986                         // passing an empty string as a 3rd parameter to .css will automatically\r
6987                         // attempt a parseFloat and fallback to a string if the parse fails\r
6988                         // so, simple values such as "10px" are parsed to Float.\r
6989                         // complex values such as "rotate(1rad)" are returned as is.\r
6990                         result = jQuery.css( tween.elem, tween.prop, "" );\r
6991                         // Empty strings, null, undefined and "auto" are converted to 0.\r
6992                         return !result || result === "auto" ? 0 : result;\r
6993                 },\r
6994                 set: function( tween ) {\r
6995                         // use step hook for back compat - use cssHook if its there - use .style if its\r
6996                         // available and use plain properties where available\r
6997                         if ( jQuery.fx.step[ tween.prop ] ) {\r
6998                                 jQuery.fx.step[ tween.prop ]( tween );\r
6999                         } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\r
7000                                 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\r
7001                         } else {\r
7002                                 tween.elem[ tween.prop ] = tween.now;\r
7003                         }\r
7004                 }\r
7005         }\r
7006 };\r
7007 \r
7008 // Support: IE <=9\r
7009 // Panic based approach to setting things on disconnected nodes\r
7010 \r
7011 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\r
7012         set: function( tween ) {\r
7013                 if ( tween.elem.nodeType && tween.elem.parentNode ) {\r
7014                         tween.elem[ tween.prop ] = tween.now;\r
7015                 }\r
7016         }\r
7017 };\r
7018 \r
7019 jQuery.easing = {\r
7020         linear: function( p ) {\r
7021                 return p;\r
7022         },\r
7023         swing: function( p ) {\r
7024                 return 0.5 - Math.cos( p * Math.PI ) / 2;\r
7025         }\r
7026 };\r
7027 \r
7028 jQuery.fx = Tween.prototype.init;\r
7029 \r
7030 // Back Compat <1.8 extension point\r
7031 jQuery.fx.step = {};\r
7032 \r
7033 \r
7034 \r
7035 \r
7036 var\r
7037         fxNow, timerId,\r
7038         rfxtypes = /^(?:toggle|show|hide)$/,\r
7039         rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),\r
7040         rrun = /queueHooks$/,\r
7041         animationPrefilters = [ defaultPrefilter ],\r
7042         tweeners = {\r
7043                 "*": [ function( prop, value ) {\r
7044                         var tween = this.createTween( prop, value ),\r
7045                                 target = tween.cur(),\r
7046                                 parts = rfxnum.exec( value ),\r
7047                                 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),\r
7048 \r
7049                                 // Starting value computation is required for potential unit mismatches\r
7050                                 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&\r
7051                                         rfxnum.exec( jQuery.css( tween.elem, prop ) ),\r
7052                                 scale = 1,\r
7053                                 maxIterations = 20;\r
7054 \r
7055                         if ( start && start[ 3 ] !== unit ) {\r
7056                                 // Trust units reported by jQuery.css\r
7057                                 unit = unit || start[ 3 ];\r
7058 \r
7059                                 // Make sure we update the tween properties later on\r
7060                                 parts = parts || [];\r
7061 \r
7062                                 // Iteratively approximate from a nonzero starting point\r
7063                                 start = +target || 1;\r
7064 \r
7065                                 do {\r
7066                                         // If previous iteration zeroed out, double until we get *something*\r
7067                                         // Use a string for doubling factor so we don't accidentally see scale as unchanged below\r
7068                                         scale = scale || ".5";\r
7069 \r
7070                                         // Adjust and apply\r
7071                                         start = start / scale;\r
7072                                         jQuery.style( tween.elem, prop, start + unit );\r
7073 \r
7074                                 // Update scale, tolerating zero or NaN from tween.cur()\r
7075                                 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough\r
7076                                 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\r
7077                         }\r
7078 \r
7079                         // Update tween properties\r
7080                         if ( parts ) {\r
7081                                 start = tween.start = +start || +target || 0;\r
7082                                 tween.unit = unit;\r
7083                                 // If a +=/-= token was provided, we're doing a relative animation\r
7084                                 tween.end = parts[ 1 ] ?\r
7085                                         start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :\r
7086                                         +parts[ 2 ];\r
7087                         }\r
7088 \r
7089                         return tween;\r
7090                 } ]\r
7091         };\r
7092 \r
7093 // Animations created synchronously will run synchronously\r
7094 function createFxNow() {\r
7095         setTimeout(function() {\r
7096                 fxNow = undefined;\r
7097         });\r
7098         return ( fxNow = jQuery.now() );\r
7099 }\r
7100 \r
7101 // Generate parameters to create a standard animation\r
7102 function genFx( type, includeWidth ) {\r
7103         var which,\r
7104                 attrs = { height: type },\r
7105                 i = 0;\r
7106 \r
7107         // if we include width, step value is 1 to do all cssExpand values,\r
7108         // if we don't include width, step value is 2 to skip over Left and Right\r
7109         includeWidth = includeWidth ? 1 : 0;\r
7110         for ( ; i < 4 ; i += 2 - includeWidth ) {\r
7111                 which = cssExpand[ i ];\r
7112                 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;\r
7113         }\r
7114 \r
7115         if ( includeWidth ) {\r
7116                 attrs.opacity = attrs.width = type;\r
7117         }\r
7118 \r
7119         return attrs;\r
7120 }\r
7121 \r
7122 function createTween( value, prop, animation ) {\r
7123         var tween,\r
7124                 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),\r
7125                 index = 0,\r
7126                 length = collection.length;\r
7127         for ( ; index < length; index++ ) {\r
7128                 if ( (tween = collection[ index ].call( animation, prop, value )) ) {\r
7129 \r
7130                         // we're done with this property\r
7131                         return tween;\r
7132                 }\r
7133         }\r
7134 }\r
7135 \r
7136 function defaultPrefilter( elem, props, opts ) {\r
7137         /* jshint validthis: true */\r
7138         var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,\r
7139                 anim = this,\r
7140                 orig = {},\r
7141                 style = elem.style,\r
7142                 hidden = elem.nodeType && isHidden( elem ),\r
7143                 dataShow = jQuery._data( elem, "fxshow" );\r
7144 \r
7145         // handle queue: false promises\r
7146         if ( !opts.queue ) {\r
7147                 hooks = jQuery._queueHooks( elem, "fx" );\r
7148                 if ( hooks.unqueued == null ) {\r
7149                         hooks.unqueued = 0;\r
7150                         oldfire = hooks.empty.fire;\r
7151                         hooks.empty.fire = function() {\r
7152                                 if ( !hooks.unqueued ) {\r
7153                                         oldfire();\r
7154                                 }\r
7155                         };\r
7156                 }\r
7157                 hooks.unqueued++;\r
7158 \r
7159                 anim.always(function() {\r
7160                         // doing this makes sure that the complete handler will be called\r
7161                         // before this completes\r
7162                         anim.always(function() {\r
7163                                 hooks.unqueued--;\r
7164                                 if ( !jQuery.queue( elem, "fx" ).length ) {\r
7165                                         hooks.empty.fire();\r
7166                                 }\r
7167                         });\r
7168                 });\r
7169         }\r
7170 \r
7171         // height/width overflow pass\r
7172         if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {\r
7173                 // Make sure that nothing sneaks out\r
7174                 // Record all 3 overflow attributes because IE does not\r
7175                 // change the overflow attribute when overflowX and\r
7176                 // overflowY are set to the same value\r
7177                 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\r
7178 \r
7179                 // Set display property to inline-block for height/width\r
7180                 // animations on inline elements that are having width/height animated\r
7181                 display = jQuery.css( elem, "display" );\r
7182 \r
7183                 // Test default display if display is currently "none"\r
7184                 checkDisplay = display === "none" ?\r
7185                         jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;\r
7186 \r
7187                 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {\r
7188 \r
7189                         // inline-level elements accept inline-block;\r
7190                         // block-level elements need to be inline with layout\r
7191                         if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {\r
7192                                 style.display = "inline-block";\r
7193                         } else {\r
7194                                 style.zoom = 1;\r
7195                         }\r
7196                 }\r
7197         }\r
7198 \r
7199         if ( opts.overflow ) {\r
7200                 style.overflow = "hidden";\r
7201                 if ( !support.shrinkWrapBlocks() ) {\r
7202                         anim.always(function() {\r
7203                                 style.overflow = opts.overflow[ 0 ];\r
7204                                 style.overflowX = opts.overflow[ 1 ];\r
7205                                 style.overflowY = opts.overflow[ 2 ];\r
7206                         });\r
7207                 }\r
7208         }\r
7209 \r
7210         // show/hide pass\r
7211         for ( prop in props ) {\r
7212                 value = props[ prop ];\r
7213                 if ( rfxtypes.exec( value ) ) {\r
7214                         delete props[ prop ];\r
7215                         toggle = toggle || value === "toggle";\r
7216                         if ( value === ( hidden ? "hide" : "show" ) ) {\r
7217 \r
7218                                 // 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
7219                                 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {\r
7220                                         hidden = true;\r
7221                                 } else {\r
7222                                         continue;\r
7223                                 }\r
7224                         }\r
7225                         orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\r
7226 \r
7227                 // Any non-fx value stops us from restoring the original display value\r
7228                 } else {\r
7229                         display = undefined;\r
7230                 }\r
7231         }\r
7232 \r
7233         if ( !jQuery.isEmptyObject( orig ) ) {\r
7234                 if ( dataShow ) {\r
7235                         if ( "hidden" in dataShow ) {\r
7236                                 hidden = dataShow.hidden;\r
7237                         }\r
7238                 } else {\r
7239                         dataShow = jQuery._data( elem, "fxshow", {} );\r
7240                 }\r
7241 \r
7242                 // store state if its toggle - enables .stop().toggle() to "reverse"\r
7243                 if ( toggle ) {\r
7244                         dataShow.hidden = !hidden;\r
7245                 }\r
7246                 if ( hidden ) {\r
7247                         jQuery( elem ).show();\r
7248                 } else {\r
7249                         anim.done(function() {\r
7250                                 jQuery( elem ).hide();\r
7251                         });\r
7252                 }\r
7253                 anim.done(function() {\r
7254                         var prop;\r
7255                         jQuery._removeData( elem, "fxshow" );\r
7256                         for ( prop in orig ) {\r
7257                                 jQuery.style( elem, prop, orig[ prop ] );\r
7258                         }\r
7259                 });\r
7260                 for ( prop in orig ) {\r
7261                         tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\r
7262 \r
7263                         if ( !( prop in dataShow ) ) {\r
7264                                 dataShow[ prop ] = tween.start;\r
7265                                 if ( hidden ) {\r
7266                                         tween.end = tween.start;\r
7267                                         tween.start = prop === "width" || prop === "height" ? 1 : 0;\r
7268                                 }\r
7269                         }\r
7270                 }\r
7271 \r
7272         // If this is a noop like .hide().hide(), restore an overwritten display value\r
7273         } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {\r
7274                 style.display = display;\r
7275         }\r
7276 }\r
7277 \r
7278 function propFilter( props, specialEasing ) {\r
7279         var index, name, easing, value, hooks;\r
7280 \r
7281         // camelCase, specialEasing and expand cssHook pass\r
7282         for ( index in props ) {\r
7283                 name = jQuery.camelCase( index );\r
7284                 easing = specialEasing[ name ];\r
7285                 value = props[ index ];\r
7286                 if ( jQuery.isArray( value ) ) {\r
7287                         easing = value[ 1 ];\r
7288                         value = props[ index ] = value[ 0 ];\r
7289                 }\r
7290 \r
7291                 if ( index !== name ) {\r
7292                         props[ name ] = value;\r
7293                         delete props[ index ];\r
7294                 }\r
7295 \r
7296                 hooks = jQuery.cssHooks[ name ];\r
7297                 if ( hooks && "expand" in hooks ) {\r
7298                         value = hooks.expand( value );\r
7299                         delete props[ name ];\r
7300 \r
7301                         // not quite $.extend, this wont overwrite keys already present.\r
7302                         // also - reusing 'index' from above because we have the correct "name"\r
7303                         for ( index in value ) {\r
7304                                 if ( !( index in props ) ) {\r
7305                                         props[ index ] = value[ index ];\r
7306                                         specialEasing[ index ] = easing;\r
7307                                 }\r
7308                         }\r
7309                 } else {\r
7310                         specialEasing[ name ] = easing;\r
7311                 }\r
7312         }\r
7313 }\r
7314 \r
7315 function Animation( elem, properties, options ) {\r
7316         var result,\r
7317                 stopped,\r
7318                 index = 0,\r
7319                 length = animationPrefilters.length,\r
7320                 deferred = jQuery.Deferred().always( function() {\r
7321                         // don't match elem in the :animated selector\r
7322                         delete tick.elem;\r
7323                 }),\r
7324                 tick = function() {\r
7325                         if ( stopped ) {\r
7326                                 return false;\r
7327                         }\r
7328                         var currentTime = fxNow || createFxNow(),\r
7329                                 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\r
7330                                 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)\r
7331                                 temp = remaining / animation.duration || 0,\r
7332                                 percent = 1 - temp,\r
7333                                 index = 0,\r
7334                                 length = animation.tweens.length;\r
7335 \r
7336                         for ( ; index < length ; index++ ) {\r
7337                                 animation.tweens[ index ].run( percent );\r
7338                         }\r
7339 \r
7340                         deferred.notifyWith( elem, [ animation, percent, remaining ]);\r
7341 \r
7342                         if ( percent < 1 && length ) {\r
7343                                 return remaining;\r
7344                         } else {\r
7345                                 deferred.resolveWith( elem, [ animation ] );\r
7346                                 return false;\r
7347                         }\r
7348                 },\r
7349                 animation = deferred.promise({\r
7350                         elem: elem,\r
7351                         props: jQuery.extend( {}, properties ),\r
7352                         opts: jQuery.extend( true, { specialEasing: {} }, options ),\r
7353                         originalProperties: properties,\r
7354                         originalOptions: options,\r
7355                         startTime: fxNow || createFxNow(),\r
7356                         duration: options.duration,\r
7357                         tweens: [],\r
7358                         createTween: function( prop, end ) {\r
7359                                 var tween = jQuery.Tween( elem, animation.opts, prop, end,\r
7360                                                 animation.opts.specialEasing[ prop ] || animation.opts.easing );\r
7361                                 animation.tweens.push( tween );\r
7362                                 return tween;\r
7363                         },\r
7364                         stop: function( gotoEnd ) {\r
7365                                 var index = 0,\r
7366                                         // if we are going to the end, we want to run all the tweens\r
7367                                         // otherwise we skip this part\r
7368                                         length = gotoEnd ? animation.tweens.length : 0;\r
7369                                 if ( stopped ) {\r
7370                                         return this;\r
7371                                 }\r
7372                                 stopped = true;\r
7373                                 for ( ; index < length ; index++ ) {\r
7374                                         animation.tweens[ index ].run( 1 );\r
7375                                 }\r
7376 \r
7377                                 // resolve when we played the last frame\r
7378                                 // otherwise, reject\r
7379                                 if ( gotoEnd ) {\r
7380                                         deferred.resolveWith( elem, [ animation, gotoEnd ] );\r
7381                                 } else {\r
7382                                         deferred.rejectWith( elem, [ animation, gotoEnd ] );\r
7383                                 }\r
7384                                 return this;\r
7385                         }\r
7386                 }),\r
7387                 props = animation.props;\r
7388 \r
7389         propFilter( props, animation.opts.specialEasing );\r
7390 \r
7391         for ( ; index < length ; index++ ) {\r
7392                 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\r
7393                 if ( result ) {\r
7394                         return result;\r
7395                 }\r
7396         }\r
7397 \r
7398         jQuery.map( props, createTween, animation );\r
7399 \r
7400         if ( jQuery.isFunction( animation.opts.start ) ) {\r
7401                 animation.opts.start.call( elem, animation );\r
7402         }\r
7403 \r
7404         jQuery.fx.timer(\r
7405                 jQuery.extend( tick, {\r
7406                         elem: elem,\r
7407                         anim: animation,\r
7408                         queue: animation.opts.queue\r
7409                 })\r
7410         );\r
7411 \r
7412         // attach callbacks from options\r
7413         return animation.progress( animation.opts.progress )\r
7414                 .done( animation.opts.done, animation.opts.complete )\r
7415                 .fail( animation.opts.fail )\r
7416                 .always( animation.opts.always );\r
7417 }\r
7418 \r
7419 jQuery.Animation = jQuery.extend( Animation, {\r
7420         tweener: function( props, callback ) {\r
7421                 if ( jQuery.isFunction( props ) ) {\r
7422                         callback = props;\r
7423                         props = [ "*" ];\r
7424                 } else {\r
7425                         props = props.split(" ");\r
7426                 }\r
7427 \r
7428                 var prop,\r
7429                         index = 0,\r
7430                         length = props.length;\r
7431 \r
7432                 for ( ; index < length ; index++ ) {\r
7433                         prop = props[ index ];\r
7434                         tweeners[ prop ] = tweeners[ prop ] || [];\r
7435                         tweeners[ prop ].unshift( callback );\r
7436                 }\r
7437         },\r
7438 \r
7439         prefilter: function( callback, prepend ) {\r
7440                 if ( prepend ) {\r
7441                         animationPrefilters.unshift( callback );\r
7442                 } else {\r
7443                         animationPrefilters.push( callback );\r
7444                 }\r
7445         }\r
7446 });\r
7447 \r
7448 jQuery.speed = function( speed, easing, fn ) {\r
7449         var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {\r
7450                 complete: fn || !fn && easing ||\r
7451                         jQuery.isFunction( speed ) && speed,\r
7452                 duration: speed,\r
7453                 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\r
7454         };\r
7455 \r
7456         opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :\r
7457                 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\r
7458 \r
7459         // normalize opt.queue - true/undefined/null -> "fx"\r
7460         if ( opt.queue == null || opt.queue === true ) {\r
7461                 opt.queue = "fx";\r
7462         }\r
7463 \r
7464         // Queueing\r
7465         opt.old = opt.complete;\r
7466 \r
7467         opt.complete = function() {\r
7468                 if ( jQuery.isFunction( opt.old ) ) {\r
7469                         opt.old.call( this );\r
7470                 }\r
7471 \r
7472                 if ( opt.queue ) {\r
7473                         jQuery.dequeue( this, opt.queue );\r
7474                 }\r
7475         };\r
7476 \r
7477         return opt;\r
7478 };\r
7479 \r
7480 jQuery.fn.extend({\r
7481         fadeTo: function( speed, to, easing, callback ) {\r
7482 \r
7483                 // show any hidden elements after setting opacity to 0\r
7484                 return this.filter( isHidden ).css( "opacity", 0 ).show()\r
7485 \r
7486                         // animate to the value specified\r
7487                         .end().animate({ opacity: to }, speed, easing, callback );\r
7488         },\r
7489         animate: function( prop, speed, easing, callback ) {\r
7490                 var empty = jQuery.isEmptyObject( prop ),\r
7491                         optall = jQuery.speed( speed, easing, callback ),\r
7492                         doAnimation = function() {\r
7493                                 // Operate on a copy of prop so per-property easing won't be lost\r
7494                                 var anim = Animation( this, jQuery.extend( {}, prop ), optall );\r
7495 \r
7496                                 // Empty animations, or finishing resolves immediately\r
7497                                 if ( empty || jQuery._data( this, "finish" ) ) {\r
7498                                         anim.stop( true );\r
7499                                 }\r
7500                         };\r
7501                         doAnimation.finish = doAnimation;\r
7502 \r
7503                 return empty || optall.queue === false ?\r
7504                         this.each( doAnimation ) :\r
7505                         this.queue( optall.queue, doAnimation );\r
7506         },\r
7507         stop: function( type, clearQueue, gotoEnd ) {\r
7508                 var stopQueue = function( hooks ) {\r
7509                         var stop = hooks.stop;\r
7510                         delete hooks.stop;\r
7511                         stop( gotoEnd );\r
7512                 };\r
7513 \r
7514                 if ( typeof type !== "string" ) {\r
7515                         gotoEnd = clearQueue;\r
7516                         clearQueue = type;\r
7517                         type = undefined;\r
7518                 }\r
7519                 if ( clearQueue && type !== false ) {\r
7520                         this.queue( type || "fx", [] );\r
7521                 }\r
7522 \r
7523                 return this.each(function() {\r
7524                         var dequeue = true,\r
7525                                 index = type != null && type + "queueHooks",\r
7526                                 timers = jQuery.timers,\r
7527                                 data = jQuery._data( this );\r
7528 \r
7529                         if ( index ) {\r
7530                                 if ( data[ index ] && data[ index ].stop ) {\r
7531                                         stopQueue( data[ index ] );\r
7532                                 }\r
7533                         } else {\r
7534                                 for ( index in data ) {\r
7535                                         if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\r
7536                                                 stopQueue( data[ index ] );\r
7537                                         }\r
7538                                 }\r
7539                         }\r
7540 \r
7541                         for ( index = timers.length; index--; ) {\r
7542                                 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\r
7543                                         timers[ index ].anim.stop( gotoEnd );\r
7544                                         dequeue = false;\r
7545                                         timers.splice( index, 1 );\r
7546                                 }\r
7547                         }\r
7548 \r
7549                         // start the next in the queue if the last step wasn't forced\r
7550                         // timers currently will call their complete callbacks, which will dequeue\r
7551                         // but only if they were gotoEnd\r
7552                         if ( dequeue || !gotoEnd ) {\r
7553                                 jQuery.dequeue( this, type );\r
7554                         }\r
7555                 });\r
7556         },\r
7557         finish: function( type ) {\r
7558                 if ( type !== false ) {\r
7559                         type = type || "fx";\r
7560                 }\r
7561                 return this.each(function() {\r
7562                         var index,\r
7563                                 data = jQuery._data( this ),\r
7564                                 queue = data[ type + "queue" ],\r
7565                                 hooks = data[ type + "queueHooks" ],\r
7566                                 timers = jQuery.timers,\r
7567                                 length = queue ? queue.length : 0;\r
7568 \r
7569                         // enable finishing flag on private data\r
7570                         data.finish = true;\r
7571 \r
7572                         // empty the queue first\r
7573                         jQuery.queue( this, type, [] );\r
7574 \r
7575                         if ( hooks && hooks.stop ) {\r
7576                                 hooks.stop.call( this, true );\r
7577                         }\r
7578 \r
7579                         // look for any active animations, and finish them\r
7580                         for ( index = timers.length; index--; ) {\r
7581                                 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {\r
7582                                         timers[ index ].anim.stop( true );\r
7583                                         timers.splice( index, 1 );\r
7584                                 }\r
7585                         }\r
7586 \r
7587                         // look for any animations in the old queue and finish them\r
7588                         for ( index = 0; index < length; index++ ) {\r
7589                                 if ( queue[ index ] && queue[ index ].finish ) {\r
7590                                         queue[ index ].finish.call( this );\r
7591                                 }\r
7592                         }\r
7593 \r
7594                         // turn off finishing flag\r
7595                         delete data.finish;\r
7596                 });\r
7597         }\r
7598 });\r
7599 \r
7600 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {\r
7601         var cssFn = jQuery.fn[ name ];\r
7602         jQuery.fn[ name ] = function( speed, easing, callback ) {\r
7603                 return speed == null || typeof speed === "boolean" ?\r
7604                         cssFn.apply( this, arguments ) :\r
7605                         this.animate( genFx( name, true ), speed, easing, callback );\r
7606         };\r
7607 });\r
7608 \r
7609 // Generate shortcuts for custom animations\r
7610 jQuery.each({\r
7611         slideDown: genFx("show"),\r
7612         slideUp: genFx("hide"),\r
7613         slideToggle: genFx("toggle"),\r
7614         fadeIn: { opacity: "show" },\r
7615         fadeOut: { opacity: "hide" },\r
7616         fadeToggle: { opacity: "toggle" }\r
7617 }, function( name, props ) {\r
7618         jQuery.fn[ name ] = function( speed, easing, callback ) {\r
7619                 return this.animate( props, speed, easing, callback );\r
7620         };\r
7621 });\r
7622 \r
7623 jQuery.timers = [];\r
7624 jQuery.fx.tick = function() {\r
7625         var timer,\r
7626                 timers = jQuery.timers,\r
7627                 i = 0;\r
7628 \r
7629         fxNow = jQuery.now();\r
7630 \r
7631         for ( ; i < timers.length; i++ ) {\r
7632                 timer = timers[ i ];\r
7633                 // Checks the timer has not already been removed\r
7634                 if ( !timer() && timers[ i ] === timer ) {\r
7635                         timers.splice( i--, 1 );\r
7636                 }\r
7637         }\r
7638 \r
7639         if ( !timers.length ) {\r
7640                 jQuery.fx.stop();\r
7641         }\r
7642         fxNow = undefined;\r
7643 };\r
7644 \r
7645 jQuery.fx.timer = function( timer ) {\r
7646         jQuery.timers.push( timer );\r
7647         if ( timer() ) {\r
7648                 jQuery.fx.start();\r
7649         } else {\r
7650                 jQuery.timers.pop();\r
7651         }\r
7652 };\r
7653 \r
7654 jQuery.fx.interval = 13;\r
7655 \r
7656 jQuery.fx.start = function() {\r
7657         if ( !timerId ) {\r
7658                 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\r
7659         }\r
7660 };\r
7661 \r
7662 jQuery.fx.stop = function() {\r
7663         clearInterval( timerId );\r
7664         timerId = null;\r
7665 };\r
7666 \r
7667 jQuery.fx.speeds = {\r
7668         slow: 600,\r
7669         fast: 200,\r
7670         // Default speed\r
7671         _default: 400\r
7672 };\r
7673 \r
7674 \r
7675 // Based off of the plugin by Clint Helfers, with permission.\r
7676 // http://blindsignals.com/index.php/2009/07/jquery-delay/\r
7677 jQuery.fn.delay = function( time, type ) {\r
7678         time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\r
7679         type = type || "fx";\r
7680 \r
7681         return this.queue( type, function( next, hooks ) {\r
7682                 var timeout = setTimeout( next, time );\r
7683                 hooks.stop = function() {\r
7684                         clearTimeout( timeout );\r
7685                 };\r
7686         });\r
7687 };\r
7688 \r
7689 \r
7690 (function() {\r
7691         // Minified: var a,b,c,d,e\r
7692         var input, div, select, a, opt;\r
7693 \r
7694         // Setup\r
7695         div = document.createElement( "div" );\r
7696         div.setAttribute( "className", "t" );\r
7697         div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";\r
7698         a = div.getElementsByTagName("a")[ 0 ];\r
7699 \r
7700         // First batch of tests.\r
7701         select = document.createElement("select");\r
7702         opt = select.appendChild( document.createElement("option") );\r
7703         input = div.getElementsByTagName("input")[ 0 ];\r
7704 \r
7705         a.style.cssText = "top:1px";\r
7706 \r
7707         // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)\r
7708         support.getSetAttribute = div.className !== "t";\r
7709 \r
7710         // Get the style information from getAttribute\r
7711         // (IE uses .cssText instead)\r
7712         support.style = /top/.test( a.getAttribute("style") );\r
7713 \r
7714         // Make sure that URLs aren't manipulated\r
7715         // (IE normalizes it by default)\r
7716         support.hrefNormalized = a.getAttribute("href") === "/a";\r
7717 \r
7718         // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)\r
7719         support.checkOn = !!input.value;\r
7720 \r
7721         // Make sure that a selected-by-default option has a working selected property.\r
7722         // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)\r
7723         support.optSelected = opt.selected;\r
7724 \r
7725         // Tests for enctype support on a form (#6743)\r
7726         support.enctype = !!document.createElement("form").enctype;\r
7727 \r
7728         // Make sure that the options inside disabled selects aren't marked as disabled\r
7729         // (WebKit marks them as disabled)\r
7730         select.disabled = true;\r
7731         support.optDisabled = !opt.disabled;\r
7732 \r
7733         // Support: IE8 only\r
7734         // Check if we can trust getAttribute("value")\r
7735         input = document.createElement( "input" );\r
7736         input.setAttribute( "value", "" );\r
7737         support.input = input.getAttribute( "value" ) === "";\r
7738 \r
7739         // Check if an input maintains its value after becoming a radio\r
7740         input.value = "t";\r
7741         input.setAttribute( "type", "radio" );\r
7742         support.radioValue = input.value === "t";\r
7743 })();\r
7744 \r
7745 \r
7746 var rreturn = /\r/g;\r
7747 \r
7748 jQuery.fn.extend({\r
7749         val: function( value ) {\r
7750                 var hooks, ret, isFunction,\r
7751                         elem = this[0];\r
7752 \r
7753                 if ( !arguments.length ) {\r
7754                         if ( elem ) {\r
7755                                 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\r
7756 \r
7757                                 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {\r
7758                                         return ret;\r
7759                                 }\r
7760 \r
7761                                 ret = elem.value;\r
7762 \r
7763                                 return typeof ret === "string" ?\r
7764                                         // handle most common string cases\r
7765                                         ret.replace(rreturn, "") :\r
7766                                         // handle cases where value is null/undef or number\r
7767                                         ret == null ? "" : ret;\r
7768                         }\r
7769 \r
7770                         return;\r
7771                 }\r
7772 \r
7773                 isFunction = jQuery.isFunction( value );\r
7774 \r
7775                 return this.each(function( i ) {\r
7776                         var val;\r
7777 \r
7778                         if ( this.nodeType !== 1 ) {\r
7779                                 return;\r
7780                         }\r
7781 \r
7782                         if ( isFunction ) {\r
7783                                 val = value.call( this, i, jQuery( this ).val() );\r
7784                         } else {\r
7785                                 val = value;\r
7786                         }\r
7787 \r
7788                         // Treat null/undefined as ""; convert numbers to string\r
7789                         if ( val == null ) {\r
7790                                 val = "";\r
7791                         } else if ( typeof val === "number" ) {\r
7792                                 val += "";\r
7793                         } else if ( jQuery.isArray( val ) ) {\r
7794                                 val = jQuery.map( val, function( value ) {\r
7795                                         return value == null ? "" : value + "";\r
7796                                 });\r
7797                         }\r
7798 \r
7799                         hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\r
7800 \r
7801                         // If set returns undefined, fall back to normal setting\r
7802                         if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {\r
7803                                 this.value = val;\r
7804                         }\r
7805                 });\r
7806         }\r
7807 });\r
7808 \r
7809 jQuery.extend({\r
7810         valHooks: {\r
7811                 option: {\r
7812                         get: function( elem ) {\r
7813                                 var val = jQuery.find.attr( elem, "value" );\r
7814                                 return val != null ?\r
7815                                         val :\r
7816                                         // Support: IE10-11+\r
7817                                         // option.text throws exceptions (#14686, #14858)\r
7818                                         jQuery.trim( jQuery.text( elem ) );\r
7819                         }\r
7820                 },\r
7821                 select: {\r
7822                         get: function( elem ) {\r
7823                                 var value, option,\r
7824                                         options = elem.options,\r
7825                                         index = elem.selectedIndex,\r
7826                                         one = elem.type === "select-one" || index < 0,\r
7827                                         values = one ? null : [],\r
7828                                         max = one ? index + 1 : options.length,\r
7829                                         i = index < 0 ?\r
7830                                                 max :\r
7831                                                 one ? index : 0;\r
7832 \r
7833                                 // Loop through all the selected options\r
7834                                 for ( ; i < max; i++ ) {\r
7835                                         option = options[ i ];\r
7836 \r
7837                                         // oldIE doesn't update selected after form reset (#2551)\r
7838                                         if ( ( option.selected || i === index ) &&\r
7839                                                         // Don't return options that are disabled or in a disabled optgroup\r
7840                                                         ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&\r
7841                                                         ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {\r
7842 \r
7843                                                 // Get the specific value for the option\r
7844                                                 value = jQuery( option ).val();\r
7845 \r
7846                                                 // We don't need an array for one selects\r
7847                                                 if ( one ) {\r
7848                                                         return value;\r
7849                                                 }\r
7850 \r
7851                                                 // Multi-Selects return an array\r
7852                                                 values.push( value );\r
7853                                         }\r
7854                                 }\r
7855 \r
7856                                 return values;\r
7857                         },\r
7858 \r
7859                         set: function( elem, value ) {\r
7860                                 var optionSet, option,\r
7861                                         options = elem.options,\r
7862                                         values = jQuery.makeArray( value ),\r
7863                                         i = options.length;\r
7864 \r
7865                                 while ( i-- ) {\r
7866                                         option = options[ i ];\r
7867 \r
7868                                         if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {\r
7869 \r
7870                                                 // Support: IE6\r
7871                                                 // When new option element is added to select box we need to\r
7872                                                 // force reflow of newly added node in order to workaround delay\r
7873                                                 // of initialization properties\r
7874                                                 try {\r
7875                                                         option.selected = optionSet = true;\r
7876 \r
7877                                                 } catch ( _ ) {\r
7878 \r
7879                                                         // Will be executed only in IE6\r
7880                                                         option.scrollHeight;\r
7881                                                 }\r
7882 \r
7883                                         } else {\r
7884                                                 option.selected = false;\r
7885                                         }\r
7886                                 }\r
7887 \r
7888                                 // Force browsers to behave consistently when non-matching value is set\r
7889                                 if ( !optionSet ) {\r
7890                                         elem.selectedIndex = -1;\r
7891                                 }\r
7892 \r
7893                                 return options;\r
7894                         }\r
7895                 }\r
7896         }\r
7897 });\r
7898 \r
7899 // Radios and checkboxes getter/setter\r
7900 jQuery.each([ "radio", "checkbox" ], function() {\r
7901         jQuery.valHooks[ this ] = {\r
7902                 set: function( elem, value ) {\r
7903                         if ( jQuery.isArray( value ) ) {\r
7904                                 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\r
7905                         }\r
7906                 }\r
7907         };\r
7908         if ( !support.checkOn ) {\r
7909                 jQuery.valHooks[ this ].get = function( elem ) {\r
7910                         // Support: Webkit\r
7911                         // "" is returned instead of "on" if a value isn't specified\r
7912                         return elem.getAttribute("value") === null ? "on" : elem.value;\r
7913                 };\r
7914         }\r
7915 });\r
7916 \r
7917 \r
7918 \r
7919 \r
7920 var nodeHook, boolHook,\r
7921         attrHandle = jQuery.expr.attrHandle,\r
7922         ruseDefault = /^(?:checked|selected)$/i,\r
7923         getSetAttribute = support.getSetAttribute,\r
7924         getSetInput = support.input;\r
7925 \r
7926 jQuery.fn.extend({\r
7927         attr: function( name, value ) {\r
7928                 return access( this, jQuery.attr, name, value, arguments.length > 1 );\r
7929         },\r
7930 \r
7931         removeAttr: function( name ) {\r
7932                 return this.each(function() {\r
7933                         jQuery.removeAttr( this, name );\r
7934                 });\r
7935         }\r
7936 });\r
7937 \r
7938 jQuery.extend({\r
7939         attr: function( elem, name, value ) {\r
7940                 var hooks, ret,\r
7941                         nType = elem.nodeType;\r
7942 \r
7943                 // don't get/set attributes on text, comment and attribute nodes\r
7944                 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\r
7945                         return;\r
7946                 }\r
7947 \r
7948                 // Fallback to prop when attributes are not supported\r
7949                 if ( typeof elem.getAttribute === strundefined ) {\r
7950                         return jQuery.prop( elem, name, value );\r
7951                 }\r
7952 \r
7953                 // All attributes are lowercase\r
7954                 // Grab necessary hook if one is defined\r
7955                 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\r
7956                         name = name.toLowerCase();\r
7957                         hooks = jQuery.attrHooks[ name ] ||\r
7958                                 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );\r
7959                 }\r
7960 \r
7961                 if ( value !== undefined ) {\r
7962 \r
7963                         if ( value === null ) {\r
7964                                 jQuery.removeAttr( elem, name );\r
7965 \r
7966                         } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\r
7967                                 return ret;\r
7968 \r
7969                         } else {\r
7970                                 elem.setAttribute( name, value + "" );\r
7971                                 return value;\r
7972                         }\r
7973 \r
7974                 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {\r
7975                         return ret;\r
7976 \r
7977                 } else {\r
7978                         ret = jQuery.find.attr( elem, name );\r
7979 \r
7980                         // Non-existent attributes return null, we normalize to undefined\r
7981                         return ret == null ?\r
7982                                 undefined :\r
7983                                 ret;\r
7984                 }\r
7985         },\r
7986 \r
7987         removeAttr: function( elem, value ) {\r
7988                 var name, propName,\r
7989                         i = 0,\r
7990                         attrNames = value && value.match( rnotwhite );\r
7991 \r
7992                 if ( attrNames && elem.nodeType === 1 ) {\r
7993                         while ( (name = attrNames[i++]) ) {\r
7994                                 propName = jQuery.propFix[ name ] || name;\r
7995 \r
7996                                 // Boolean attributes get special treatment (#10870)\r
7997                                 if ( jQuery.expr.match.bool.test( name ) ) {\r
7998                                         // Set corresponding property to false\r
7999                                         if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {\r
8000                                                 elem[ propName ] = false;\r
8001                                         // Support: IE<9\r
8002                                         // Also clear defaultChecked/defaultSelected (if appropriate)\r
8003                                         } else {\r
8004                                                 elem[ jQuery.camelCase( "default-" + name ) ] =\r
8005                                                         elem[ propName ] = false;\r
8006                                         }\r
8007 \r
8008                                 // See #9699 for explanation of this approach (setting first, then removal)\r
8009                                 } else {\r
8010                                         jQuery.attr( elem, name, "" );\r
8011                                 }\r
8012 \r
8013                                 elem.removeAttribute( getSetAttribute ? name : propName );\r
8014                         }\r
8015                 }\r
8016         },\r
8017 \r
8018         attrHooks: {\r
8019                 type: {\r
8020                         set: function( elem, value ) {\r
8021                                 if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {\r
8022                                         // Setting the type on a radio button after the value resets the value in IE6-9\r
8023                                         // Reset value to default in case type is set after value during creation\r
8024                                         var val = elem.value;\r
8025                                         elem.setAttribute( "type", value );\r
8026                                         if ( val ) {\r
8027                                                 elem.value = val;\r
8028                                         }\r
8029                                         return value;\r
8030                                 }\r
8031                         }\r
8032                 }\r
8033         }\r
8034 });\r
8035 \r
8036 // Hook for boolean attributes\r
8037 boolHook = {\r
8038         set: function( elem, value, name ) {\r
8039                 if ( value === false ) {\r
8040                         // Remove boolean attributes when set to false\r
8041                         jQuery.removeAttr( elem, name );\r
8042                 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {\r
8043                         // IE<8 needs the *property* name\r
8044                         elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );\r
8045 \r
8046                 // Use defaultChecked and defaultSelected for oldIE\r
8047                 } else {\r
8048                         elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;\r
8049                 }\r
8050 \r
8051                 return name;\r
8052         }\r
8053 };\r
8054 \r
8055 // Retrieve booleans specially\r
8056 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {\r
8057 \r
8058         var getter = attrHandle[ name ] || jQuery.find.attr;\r
8059 \r
8060         attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?\r
8061                 function( elem, name, isXML ) {\r
8062                         var ret, handle;\r
8063                         if ( !isXML ) {\r
8064                                 // Avoid an infinite loop by temporarily removing this function from the getter\r
8065                                 handle = attrHandle[ name ];\r
8066                                 attrHandle[ name ] = ret;\r
8067                                 ret = getter( elem, name, isXML ) != null ?\r
8068                                         name.toLowerCase() :\r
8069                                         null;\r
8070                                 attrHandle[ name ] = handle;\r
8071                         }\r
8072                         return ret;\r
8073                 } :\r
8074                 function( elem, name, isXML ) {\r
8075                         if ( !isXML ) {\r
8076                                 return elem[ jQuery.camelCase( "default-" + name ) ] ?\r
8077                                         name.toLowerCase() :\r
8078                                         null;\r
8079                         }\r
8080                 };\r
8081 });\r
8082 \r
8083 // fix oldIE attroperties\r
8084 if ( !getSetInput || !getSetAttribute ) {\r
8085         jQuery.attrHooks.value = {\r
8086                 set: function( elem, value, name ) {\r
8087                         if ( jQuery.nodeName( elem, "input" ) ) {\r
8088                                 // Does not return so that setAttribute is also used\r
8089                                 elem.defaultValue = value;\r
8090                         } else {\r
8091                                 // Use nodeHook if defined (#1954); otherwise setAttribute is fine\r
8092                                 return nodeHook && nodeHook.set( elem, value, name );\r
8093                         }\r
8094                 }\r
8095         };\r
8096 }\r
8097 \r
8098 // IE6/7 do not support getting/setting some attributes with get/setAttribute\r
8099 if ( !getSetAttribute ) {\r
8100 \r
8101         // Use this for any attribute in IE6/7\r
8102         // This fixes almost every IE6/7 issue\r
8103         nodeHook = {\r
8104                 set: function( elem, value, name ) {\r
8105                         // Set the existing or create a new attribute node\r
8106                         var ret = elem.getAttributeNode( name );\r
8107                         if ( !ret ) {\r
8108                                 elem.setAttributeNode(\r
8109                                         (ret = elem.ownerDocument.createAttribute( name ))\r
8110                                 );\r
8111                         }\r
8112 \r
8113                         ret.value = value += "";\r
8114 \r
8115                         // Break association with cloned elements by also using setAttribute (#9646)\r
8116                         if ( name === "value" || value === elem.getAttribute( name ) ) {\r
8117                                 return value;\r
8118                         }\r
8119                 }\r
8120         };\r
8121 \r
8122         // Some attributes are constructed with empty-string values when not defined\r
8123         attrHandle.id = attrHandle.name = attrHandle.coords =\r
8124                 function( elem, name, isXML ) {\r
8125                         var ret;\r
8126                         if ( !isXML ) {\r
8127                                 return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?\r
8128                                         ret.value :\r
8129                                         null;\r
8130                         }\r
8131                 };\r
8132 \r
8133         // Fixing value retrieval on a button requires this module\r
8134         jQuery.valHooks.button = {\r
8135                 get: function( elem, name ) {\r
8136                         var ret = elem.getAttributeNode( name );\r
8137                         if ( ret && ret.specified ) {\r
8138                                 return ret.value;\r
8139                         }\r
8140                 },\r
8141                 set: nodeHook.set\r
8142         };\r
8143 \r
8144         // Set contenteditable to false on removals(#10429)\r
8145         // Setting to empty string throws an error as an invalid value\r
8146         jQuery.attrHooks.contenteditable = {\r
8147                 set: function( elem, value, name ) {\r
8148                         nodeHook.set( elem, value === "" ? false : value, name );\r
8149                 }\r
8150         };\r
8151 \r
8152         // Set width and height to auto instead of 0 on empty string( Bug #8150 )\r
8153         // This is for removals\r
8154         jQuery.each([ "width", "height" ], function( i, name ) {\r
8155                 jQuery.attrHooks[ name ] = {\r
8156                         set: function( elem, value ) {\r
8157                                 if ( value === "" ) {\r
8158                                         elem.setAttribute( name, "auto" );\r
8159                                         return value;\r
8160                                 }\r
8161                         }\r
8162                 };\r
8163         });\r
8164 }\r
8165 \r
8166 if ( !support.style ) {\r
8167         jQuery.attrHooks.style = {\r
8168                 get: function( elem ) {\r
8169                         // Return undefined in the case of empty string\r
8170                         // Note: IE uppercases css property names, but if we were to .toLowerCase()\r
8171                         // .cssText, that would destroy case senstitivity in URL's, like in "background"\r
8172                         return elem.style.cssText || undefined;\r
8173                 },\r
8174                 set: function( elem, value ) {\r
8175                         return ( elem.style.cssText = value + "" );\r
8176                 }\r
8177         };\r
8178 }\r
8179 \r
8180 \r
8181 \r
8182 \r
8183 var rfocusable = /^(?:input|select|textarea|button|object)$/i,\r
8184         rclickable = /^(?:a|area)$/i;\r
8185 \r
8186 jQuery.fn.extend({\r
8187         prop: function( name, value ) {\r
8188                 return access( this, jQuery.prop, name, value, arguments.length > 1 );\r
8189         },\r
8190 \r
8191         removeProp: function( name ) {\r
8192                 name = jQuery.propFix[ name ] || name;\r
8193                 return this.each(function() {\r
8194                         // try/catch handles cases where IE balks (such as removing a property on window)\r
8195                         try {\r
8196                                 this[ name ] = undefined;\r
8197                                 delete this[ name ];\r
8198                         } catch( e ) {}\r
8199                 });\r
8200         }\r
8201 });\r
8202 \r
8203 jQuery.extend({\r
8204         propFix: {\r
8205                 "for": "htmlFor",\r
8206                 "class": "className"\r
8207         },\r
8208 \r
8209         prop: function( elem, name, value ) {\r
8210                 var ret, hooks, notxml,\r
8211                         nType = elem.nodeType;\r
8212 \r
8213                 // don't get/set properties on text, comment and attribute nodes\r
8214                 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\r
8215                         return;\r
8216                 }\r
8217 \r
8218                 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );\r
8219 \r
8220                 if ( notxml ) {\r
8221                         // Fix name and attach hooks\r
8222                         name = jQuery.propFix[ name ] || name;\r
8223                         hooks = jQuery.propHooks[ name ];\r
8224                 }\r
8225 \r
8226                 if ( value !== undefined ) {\r
8227                         return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?\r
8228                                 ret :\r
8229                                 ( elem[ name ] = value );\r
8230 \r
8231                 } else {\r
8232                         return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?\r
8233                                 ret :\r
8234                                 elem[ name ];\r
8235                 }\r
8236         },\r
8237 \r
8238         propHooks: {\r
8239                 tabIndex: {\r
8240                         get: function( elem ) {\r
8241                                 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set\r
8242                                 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\r
8243                                 // Use proper attribute retrieval(#12072)\r
8244                                 var tabindex = jQuery.find.attr( elem, "tabindex" );\r
8245 \r
8246                                 return tabindex ?\r
8247                                         parseInt( tabindex, 10 ) :\r
8248                                         rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?\r
8249                                                 0 :\r
8250                                                 -1;\r
8251                         }\r
8252                 }\r
8253         }\r
8254 });\r
8255 \r
8256 // Some attributes require a special call on IE\r
8257 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\r
8258 if ( !support.hrefNormalized ) {\r
8259         // href/src property should get the full normalized URL (#10299/#12915)\r
8260         jQuery.each([ "href", "src" ], function( i, name ) {\r
8261                 jQuery.propHooks[ name ] = {\r
8262                         get: function( elem ) {\r
8263                                 return elem.getAttribute( name, 4 );\r
8264                         }\r
8265                 };\r
8266         });\r
8267 }\r
8268 \r
8269 // Support: Safari, IE9+\r
8270 // mis-reports the default selected property of an option\r
8271 // Accessing the parent's selectedIndex property fixes it\r
8272 if ( !support.optSelected ) {\r
8273         jQuery.propHooks.selected = {\r
8274                 get: function( elem ) {\r
8275                         var parent = elem.parentNode;\r
8276 \r
8277                         if ( parent ) {\r
8278                                 parent.selectedIndex;\r
8279 \r
8280                                 // Make sure that it also works with optgroups, see #5701\r
8281                                 if ( parent.parentNode ) {\r
8282                                         parent.parentNode.selectedIndex;\r
8283                                 }\r
8284                         }\r
8285                         return null;\r
8286                 }\r
8287         };\r
8288 }\r
8289 \r
8290 jQuery.each([\r
8291         "tabIndex",\r
8292         "readOnly",\r
8293         "maxLength",\r
8294         "cellSpacing",\r
8295         "cellPadding",\r
8296         "rowSpan",\r
8297         "colSpan",\r
8298         "useMap",\r
8299         "frameBorder",\r
8300         "contentEditable"\r
8301 ], function() {\r
8302         jQuery.propFix[ this.toLowerCase() ] = this;\r
8303 });\r
8304 \r
8305 // IE6/7 call enctype encoding\r
8306 if ( !support.enctype ) {\r
8307         jQuery.propFix.enctype = "encoding";\r
8308 }\r
8309 \r
8310 \r
8311 \r
8312 \r
8313 var rclass = /[\t\r\n\f]/g;\r
8314 \r
8315 jQuery.fn.extend({\r
8316         addClass: function( value ) {\r
8317                 var classes, elem, cur, clazz, j, finalValue,\r
8318                         i = 0,\r
8319                         len = this.length,\r
8320                         proceed = typeof value === "string" && value;\r
8321 \r
8322                 if ( jQuery.isFunction( value ) ) {\r
8323                         return this.each(function( j ) {\r
8324                                 jQuery( this ).addClass( value.call( this, j, this.className ) );\r
8325                         });\r
8326                 }\r
8327 \r
8328                 if ( proceed ) {\r
8329                         // The disjunction here is for better compressibility (see removeClass)\r
8330                         classes = ( value || "" ).match( rnotwhite ) || [];\r
8331 \r
8332                         for ( ; i < len; i++ ) {\r
8333                                 elem = this[ i ];\r
8334                                 cur = elem.nodeType === 1 && ( elem.className ?\r
8335                                         ( " " + elem.className + " " ).replace( rclass, " " ) :\r
8336                                         " "\r
8337                                 );\r
8338 \r
8339                                 if ( cur ) {\r
8340                                         j = 0;\r
8341                                         while ( (clazz = classes[j++]) ) {\r
8342                                                 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {\r
8343                                                         cur += clazz + " ";\r
8344                                                 }\r
8345                                         }\r
8346 \r
8347                                         // only assign if different to avoid unneeded rendering.\r
8348                                         finalValue = jQuery.trim( cur );\r
8349                                         if ( elem.className !== finalValue ) {\r
8350                                                 elem.className = finalValue;\r
8351                                         }\r
8352                                 }\r
8353                         }\r
8354                 }\r
8355 \r
8356                 return this;\r
8357         },\r
8358 \r
8359         removeClass: function( value ) {\r
8360                 var classes, elem, cur, clazz, j, finalValue,\r
8361                         i = 0,\r
8362                         len = this.length,\r
8363                         proceed = arguments.length === 0 || typeof value === "string" && value;\r
8364 \r
8365                 if ( jQuery.isFunction( value ) ) {\r
8366                         return this.each(function( j ) {\r
8367                                 jQuery( this ).removeClass( value.call( this, j, this.className ) );\r
8368                         });\r
8369                 }\r
8370                 if ( proceed ) {\r
8371                         classes = ( value || "" ).match( rnotwhite ) || [];\r
8372 \r
8373                         for ( ; i < len; i++ ) {\r
8374                                 elem = this[ i ];\r
8375                                 // This expression is here for better compressibility (see addClass)\r
8376                                 cur = elem.nodeType === 1 && ( elem.className ?\r
8377                                         ( " " + elem.className + " " ).replace( rclass, " " ) :\r
8378                                         ""\r
8379                                 );\r
8380 \r
8381                                 if ( cur ) {\r
8382                                         j = 0;\r
8383                                         while ( (clazz = classes[j++]) ) {\r
8384                                                 // Remove *all* instances\r
8385                                                 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {\r
8386                                                         cur = cur.replace( " " + clazz + " ", " " );\r
8387                                                 }\r
8388                                         }\r
8389 \r
8390                                         // only assign if different to avoid unneeded rendering.\r
8391                                         finalValue = value ? jQuery.trim( cur ) : "";\r
8392                                         if ( elem.className !== finalValue ) {\r
8393                                                 elem.className = finalValue;\r
8394                                         }\r
8395                                 }\r
8396                         }\r
8397                 }\r
8398 \r
8399                 return this;\r
8400         },\r
8401 \r
8402         toggleClass: function( value, stateVal ) {\r
8403                 var type = typeof value;\r
8404 \r
8405                 if ( typeof stateVal === "boolean" && type === "string" ) {\r
8406                         return stateVal ? this.addClass( value ) : this.removeClass( value );\r
8407                 }\r
8408 \r
8409                 if ( jQuery.isFunction( value ) ) {\r
8410                         return this.each(function( i ) {\r
8411                                 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\r
8412                         });\r
8413                 }\r
8414 \r
8415                 return this.each(function() {\r
8416                         if ( type === "string" ) {\r
8417                                 // toggle individual class names\r
8418                                 var className,\r
8419                                         i = 0,\r
8420                                         self = jQuery( this ),\r
8421                                         classNames = value.match( rnotwhite ) || [];\r
8422 \r
8423                                 while ( (className = classNames[ i++ ]) ) {\r
8424                                         // check each className given, space separated list\r
8425                                         if ( self.hasClass( className ) ) {\r
8426                                                 self.removeClass( className );\r
8427                                         } else {\r
8428                                                 self.addClass( className );\r
8429                                         }\r
8430                                 }\r
8431 \r
8432                         // Toggle whole class name\r
8433                         } else if ( type === strundefined || type === "boolean" ) {\r
8434                                 if ( this.className ) {\r
8435                                         // store className if set\r
8436                                         jQuery._data( this, "__className__", this.className );\r
8437                                 }\r
8438 \r
8439                                 // If the element has a class name or if we're passed "false",\r
8440                                 // then remove the whole classname (if there was one, the above saved it).\r
8441                                 // Otherwise bring back whatever was previously saved (if anything),\r
8442                                 // falling back to the empty string if nothing was stored.\r
8443                                 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";\r
8444                         }\r
8445                 });\r
8446         },\r
8447 \r
8448         hasClass: function( selector ) {\r
8449                 var className = " " + selector + " ",\r
8450                         i = 0,\r
8451                         l = this.length;\r
8452                 for ( ; i < l; i++ ) {\r
8453                         if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {\r
8454                                 return true;\r
8455                         }\r
8456                 }\r
8457 \r
8458                 return false;\r
8459         }\r
8460 });\r
8461 \r
8462 \r
8463 \r
8464 \r
8465 // Return jQuery for attributes-only inclusion\r
8466 \r
8467 \r
8468 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +\r
8469         "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +\r
8470         "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {\r
8471 \r
8472         // Handle event binding\r
8473         jQuery.fn[ name ] = function( data, fn ) {\r
8474                 return arguments.length > 0 ?\r
8475                         this.on( name, null, data, fn ) :\r
8476                         this.trigger( name );\r
8477         };\r
8478 });\r
8479 \r
8480 jQuery.fn.extend({\r
8481         hover: function( fnOver, fnOut ) {\r
8482                 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\r
8483         },\r
8484 \r
8485         bind: function( types, data, fn ) {\r
8486                 return this.on( types, null, data, fn );\r
8487         },\r
8488         unbind: function( types, fn ) {\r
8489                 return this.off( types, null, fn );\r
8490         },\r
8491 \r
8492         delegate: function( selector, types, data, fn ) {\r
8493                 return this.on( types, selector, data, fn );\r
8494         },\r
8495         undelegate: function( selector, types, fn ) {\r
8496                 // ( namespace ) or ( selector, types [, fn] )\r
8497                 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );\r
8498         }\r
8499 });\r
8500 \r
8501 \r
8502 var nonce = jQuery.now();\r
8503 \r
8504 var rquery = (/\?/);\r
8505 \r
8506 \r
8507 \r
8508 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;\r
8509 \r
8510 jQuery.parseJSON = function( data ) {\r
8511         // Attempt to parse using the native JSON parser first\r
8512         if ( window.JSON && window.JSON.parse ) {\r
8513                 // Support: Android 2.3\r
8514                 // Workaround failure to string-cast null input\r
8515                 return window.JSON.parse( data + "" );\r
8516         }\r
8517 \r
8518         var requireNonComma,\r
8519                 depth = null,\r
8520                 str = jQuery.trim( data + "" );\r
8521 \r
8522         // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains\r
8523         // after removing valid tokens\r
8524         return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {\r
8525 \r
8526                 // Force termination if we see a misplaced comma\r
8527                 if ( requireNonComma && comma ) {\r
8528                         depth = 0;\r
8529                 }\r
8530 \r
8531                 // Perform no more replacements after returning to outermost depth\r
8532                 if ( depth === 0 ) {\r
8533                         return token;\r
8534                 }\r
8535 \r
8536                 // Commas must not follow "[", "{", or ","\r
8537                 requireNonComma = open || comma;\r
8538 \r
8539                 // Determine new depth\r
8540                 // array/object open ("[" or "{"): depth += true - false (increment)\r
8541                 // array/object close ("]" or "}"): depth += false - true (decrement)\r
8542                 // other cases ("," or primitive): depth += true - true (numeric cast)\r
8543                 depth += !close - !open;\r
8544 \r
8545                 // Remove this token\r
8546                 return "";\r
8547         }) ) ?\r
8548                 ( Function( "return " + str ) )() :\r
8549                 jQuery.error( "Invalid JSON: " + data );\r
8550 };\r
8551 \r
8552 \r
8553 // Cross-browser xml parsing\r
8554 jQuery.parseXML = function( data ) {\r
8555         var xml, tmp;\r
8556         if ( !data || typeof data !== "string" ) {\r
8557                 return null;\r
8558         }\r
8559         try {\r
8560                 if ( window.DOMParser ) { // Standard\r
8561                         tmp = new DOMParser();\r
8562                         xml = tmp.parseFromString( data, "text/xml" );\r
8563                 } else { // IE\r
8564                         xml = new ActiveXObject( "Microsoft.XMLDOM" );\r
8565                         xml.async = "false";\r
8566                         xml.loadXML( data );\r
8567                 }\r
8568         } catch( e ) {\r
8569                 xml = undefined;\r
8570         }\r
8571         if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {\r
8572                 jQuery.error( "Invalid XML: " + data );\r
8573         }\r
8574         return xml;\r
8575 };\r
8576 \r
8577 \r
8578 var\r
8579         // Document location\r
8580         ajaxLocParts,\r
8581         ajaxLocation,\r
8582 \r
8583         rhash = /#.*$/,\r
8584         rts = /([?&])_=[^&]*/,\r
8585         rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL\r
8586         // #7653, #8125, #8152: local protocol detection\r
8587         rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\r
8588         rnoContent = /^(?:GET|HEAD)$/,\r
8589         rprotocol = /^\/\//,\r
8590         rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,\r
8591 \r
8592         /* Prefilters\r
8593          * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\r
8594          * 2) These are called:\r
8595          *    - BEFORE asking for a transport\r
8596          *    - AFTER param serialization (s.data is a string if s.processData is true)\r
8597          * 3) key is the dataType\r
8598          * 4) the catchall symbol "*" can be used\r
8599          * 5) execution will start with transport dataType and THEN continue down to "*" if needed\r
8600          */\r
8601         prefilters = {},\r
8602 \r
8603         /* Transports bindings\r
8604          * 1) key is the dataType\r
8605          * 2) the catchall symbol "*" can be used\r
8606          * 3) selection will start with transport dataType and THEN go to "*" if needed\r
8607          */\r
8608         transports = {},\r
8609 \r
8610         // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\r
8611         allTypes = "*/".concat("*");\r
8612 \r
8613 // #8138, IE may throw an exception when accessing\r
8614 // a field from window.location if document.domain has been set\r
8615 try {\r
8616         ajaxLocation = location.href;\r
8617 } catch( e ) {\r
8618         // Use the href attribute of an A element\r
8619         // since IE will modify it given document.location\r
8620         ajaxLocation = document.createElement( "a" );\r
8621         ajaxLocation.href = "";\r
8622         ajaxLocation = ajaxLocation.href;\r
8623 }\r
8624 \r
8625 // Segment location into parts\r
8626 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\r
8627 \r
8628 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\r
8629 function addToPrefiltersOrTransports( structure ) {\r
8630 \r
8631         // dataTypeExpression is optional and defaults to "*"\r
8632         return function( dataTypeExpression, func ) {\r
8633 \r
8634                 if ( typeof dataTypeExpression !== "string" ) {\r
8635                         func = dataTypeExpression;\r
8636                         dataTypeExpression = "*";\r
8637                 }\r
8638 \r
8639                 var dataType,\r
8640                         i = 0,\r
8641                         dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];\r
8642 \r
8643                 if ( jQuery.isFunction( func ) ) {\r
8644                         // For each dataType in the dataTypeExpression\r
8645                         while ( (dataType = dataTypes[i++]) ) {\r
8646                                 // Prepend if requested\r
8647                                 if ( dataType.charAt( 0 ) === "+" ) {\r
8648                                         dataType = dataType.slice( 1 ) || "*";\r
8649                                         (structure[ dataType ] = structure[ dataType ] || []).unshift( func );\r
8650 \r
8651                                 // Otherwise append\r
8652                                 } else {\r
8653                                         (structure[ dataType ] = structure[ dataType ] || []).push( func );\r
8654                                 }\r
8655                         }\r
8656                 }\r
8657         };\r
8658 }\r
8659 \r
8660 // Base inspection function for prefilters and transports\r
8661 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r
8662 \r
8663         var inspected = {},\r
8664                 seekingTransport = ( structure === transports );\r
8665 \r
8666         function inspect( dataType ) {\r
8667                 var selected;\r
8668                 inspected[ dataType ] = true;\r
8669                 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r
8670                         var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r
8671                         if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r
8672                                 options.dataTypes.unshift( dataTypeOrTransport );\r
8673                                 inspect( dataTypeOrTransport );\r
8674                                 return false;\r
8675                         } else if ( seekingTransport ) {\r
8676                                 return !( selected = dataTypeOrTransport );\r
8677                         }\r
8678                 });\r
8679                 return selected;\r
8680         }\r
8681 \r
8682         return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );\r
8683 }\r
8684 \r
8685 // A special extend for ajax options\r
8686 // that takes "flat" options (not to be deep extended)\r
8687 // Fixes #9887\r
8688 function ajaxExtend( target, src ) {\r
8689         var deep, key,\r
8690                 flatOptions = jQuery.ajaxSettings.flatOptions || {};\r
8691 \r
8692         for ( key in src ) {\r
8693                 if ( src[ key ] !== undefined ) {\r
8694                         ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r
8695                 }\r
8696         }\r
8697         if ( deep ) {\r
8698                 jQuery.extend( true, target, deep );\r
8699         }\r
8700 \r
8701         return target;\r
8702 }\r
8703 \r
8704 /* Handles responses to an ajax request:\r
8705  * - finds the right dataType (mediates between content-type and expected dataType)\r
8706  * - returns the corresponding response\r
8707  */\r
8708 function ajaxHandleResponses( s, jqXHR, responses ) {\r
8709         var firstDataType, ct, finalDataType, type,\r
8710                 contents = s.contents,\r
8711                 dataTypes = s.dataTypes;\r
8712 \r
8713         // Remove auto dataType and get content-type in the process\r
8714         while ( dataTypes[ 0 ] === "*" ) {\r
8715                 dataTypes.shift();\r
8716                 if ( ct === undefined ) {\r
8717                         ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");\r
8718                 }\r
8719         }\r
8720 \r
8721         // Check if we're dealing with a known content-type\r
8722         if ( ct ) {\r
8723                 for ( type in contents ) {\r
8724                         if ( contents[ type ] && contents[ type ].test( ct ) ) {\r
8725                                 dataTypes.unshift( type );\r
8726                                 break;\r
8727                         }\r
8728                 }\r
8729         }\r
8730 \r
8731         // Check to see if we have a response for the expected dataType\r
8732         if ( dataTypes[ 0 ] in responses ) {\r
8733                 finalDataType = dataTypes[ 0 ];\r
8734         } else {\r
8735                 // Try convertible dataTypes\r
8736                 for ( type in responses ) {\r
8737                         if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {\r
8738                                 finalDataType = type;\r
8739                                 break;\r
8740                         }\r
8741                         if ( !firstDataType ) {\r
8742                                 firstDataType = type;\r
8743                         }\r
8744                 }\r
8745                 // Or just use first one\r
8746                 finalDataType = finalDataType || firstDataType;\r
8747         }\r
8748 \r
8749         // If we found a dataType\r
8750         // We add the dataType to the list if needed\r
8751         // and return the corresponding response\r
8752         if ( finalDataType ) {\r
8753                 if ( finalDataType !== dataTypes[ 0 ] ) {\r
8754                         dataTypes.unshift( finalDataType );\r
8755                 }\r
8756                 return responses[ finalDataType ];\r
8757         }\r
8758 }\r
8759 \r
8760 /* Chain conversions given the request and the original response\r
8761  * Also sets the responseXXX fields on the jqXHR instance\r
8762  */\r
8763 function ajaxConvert( s, response, jqXHR, isSuccess ) {\r
8764         var conv2, current, conv, tmp, prev,\r
8765                 converters = {},\r
8766                 // Work with a copy of dataTypes in case we need to modify it for conversion\r
8767                 dataTypes = s.dataTypes.slice();\r
8768 \r
8769         // Create converters map with lowercased keys\r
8770         if ( dataTypes[ 1 ] ) {\r
8771                 for ( conv in s.converters ) {\r
8772                         converters[ conv.toLowerCase() ] = s.converters[ conv ];\r
8773                 }\r
8774         }\r
8775 \r
8776         current = dataTypes.shift();\r
8777 \r
8778         // Convert to each sequential dataType\r
8779         while ( current ) {\r
8780 \r
8781                 if ( s.responseFields[ current ] ) {\r
8782                         jqXHR[ s.responseFields[ current ] ] = response;\r
8783                 }\r
8784 \r
8785                 // Apply the dataFilter if provided\r
8786                 if ( !prev && isSuccess && s.dataFilter ) {\r
8787                         response = s.dataFilter( response, s.dataType );\r
8788                 }\r
8789 \r
8790                 prev = current;\r
8791                 current = dataTypes.shift();\r
8792 \r
8793                 if ( current ) {\r
8794 \r
8795                         // There's only work to do if current dataType is non-auto\r
8796                         if ( current === "*" ) {\r
8797 \r
8798                                 current = prev;\r
8799 \r
8800                         // Convert response if prev dataType is non-auto and differs from current\r
8801                         } else if ( prev !== "*" && prev !== current ) {\r
8802 \r
8803                                 // Seek a direct converter\r
8804                                 conv = converters[ prev + " " + current ] || converters[ "* " + current ];\r
8805 \r
8806                                 // If none found, seek a pair\r
8807                                 if ( !conv ) {\r
8808                                         for ( conv2 in converters ) {\r
8809 \r
8810                                                 // If conv2 outputs current\r
8811                                                 tmp = conv2.split( " " );\r
8812                                                 if ( tmp[ 1 ] === current ) {\r
8813 \r
8814                                                         // If prev can be converted to accepted input\r
8815                                                         conv = converters[ prev + " " + tmp[ 0 ] ] ||\r
8816                                                                 converters[ "* " + tmp[ 0 ] ];\r
8817                                                         if ( conv ) {\r
8818                                                                 // Condense equivalence converters\r
8819                                                                 if ( conv === true ) {\r
8820                                                                         conv = converters[ conv2 ];\r
8821 \r
8822                                                                 // Otherwise, insert the intermediate dataType\r
8823                                                                 } else if ( converters[ conv2 ] !== true ) {\r
8824                                                                         current = tmp[ 0 ];\r
8825                                                                         dataTypes.unshift( tmp[ 1 ] );\r
8826                                                                 }\r
8827                                                                 break;\r
8828                                                         }\r
8829                                                 }\r
8830                                         }\r
8831                                 }\r
8832 \r
8833                                 // Apply converter (if not an equivalence)\r
8834                                 if ( conv !== true ) {\r
8835 \r
8836                                         // Unless errors are allowed to bubble, catch and return them\r
8837                                         if ( conv && s[ "throws" ] ) {\r
8838                                                 response = conv( response );\r
8839                                         } else {\r
8840                                                 try {\r
8841                                                         response = conv( response );\r
8842                                                 } catch ( e ) {\r
8843                                                         return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };\r
8844                                                 }\r
8845                                         }\r
8846                                 }\r
8847                         }\r
8848                 }\r
8849         }\r
8850 \r
8851         return { state: "success", data: response };\r
8852 }\r
8853 \r
8854 jQuery.extend({\r
8855 \r
8856         // Counter for holding the number of active queries\r
8857         active: 0,\r
8858 \r
8859         // Last-Modified header cache for next request\r
8860         lastModified: {},\r
8861         etag: {},\r
8862 \r
8863         ajaxSettings: {\r
8864                 url: ajaxLocation,\r
8865                 type: "GET",\r
8866                 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\r
8867                 global: true,\r
8868                 processData: true,\r
8869                 async: true,\r
8870                 contentType: "application/x-www-form-urlencoded; charset=UTF-8",\r
8871                 /*\r
8872                 timeout: 0,\r
8873                 data: null,\r
8874                 dataType: null,\r
8875                 username: null,\r
8876                 password: null,\r
8877                 cache: null,\r
8878                 throws: false,\r
8879                 traditional: false,\r
8880                 headers: {},\r
8881                 */\r
8882 \r
8883                 accepts: {\r
8884                         "*": allTypes,\r
8885                         text: "text/plain",\r
8886                         html: "text/html",\r
8887                         xml: "application/xml, text/xml",\r
8888                         json: "application/json, text/javascript"\r
8889                 },\r
8890 \r
8891                 contents: {\r
8892                         xml: /xml/,\r
8893                         html: /html/,\r
8894                         json: /json/\r
8895                 },\r
8896 \r
8897                 responseFields: {\r
8898                         xml: "responseXML",\r
8899                         text: "responseText",\r
8900                         json: "responseJSON"\r
8901                 },\r
8902 \r
8903                 // Data converters\r
8904                 // Keys separate source (or catchall "*") and destination types with a single space\r
8905                 converters: {\r
8906 \r
8907                         // Convert anything to text\r
8908                         "* text": String,\r
8909 \r
8910                         // Text to html (true = no transformation)\r
8911                         "text html": true,\r
8912 \r
8913                         // Evaluate text as a json expression\r
8914                         "text json": jQuery.parseJSON,\r
8915 \r
8916                         // Parse text as xml\r
8917                         "text xml": jQuery.parseXML\r
8918                 },\r
8919 \r
8920                 // For options that shouldn't be deep extended:\r
8921                 // you can add your own custom options here if\r
8922                 // and when you create one that shouldn't be\r
8923                 // deep extended (see ajaxExtend)\r
8924                 flatOptions: {\r
8925                         url: true,\r
8926                         context: true\r
8927                 }\r
8928         },\r
8929 \r
8930         // Creates a full fledged settings object into target\r
8931         // with both ajaxSettings and settings fields.\r
8932         // If target is omitted, writes into ajaxSettings.\r
8933         ajaxSetup: function( target, settings ) {\r
8934                 return settings ?\r
8935 \r
8936                         // Building a settings object\r
8937                         ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\r
8938 \r
8939                         // Extending ajaxSettings\r
8940                         ajaxExtend( jQuery.ajaxSettings, target );\r
8941         },\r
8942 \r
8943         ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\r
8944         ajaxTransport: addToPrefiltersOrTransports( transports ),\r
8945 \r
8946         // Main method\r
8947         ajax: function( url, options ) {\r
8948 \r
8949                 // If url is an object, simulate pre-1.5 signature\r
8950                 if ( typeof url === "object" ) {\r
8951                         options = url;\r
8952                         url = undefined;\r
8953                 }\r
8954 \r
8955                 // Force options to be an object\r
8956                 options = options || {};\r
8957 \r
8958                 var // Cross-domain detection vars\r
8959                         parts,\r
8960                         // Loop variable\r
8961                         i,\r
8962                         // URL without anti-cache param\r
8963                         cacheURL,\r
8964                         // Response headers as string\r
8965                         responseHeadersString,\r
8966                         // timeout handle\r
8967                         timeoutTimer,\r
8968 \r
8969                         // To know if global events are to be dispatched\r
8970                         fireGlobals,\r
8971 \r
8972                         transport,\r
8973                         // Response headers\r
8974                         responseHeaders,\r
8975                         // Create the final options object\r
8976                         s = jQuery.ajaxSetup( {}, options ),\r
8977                         // Callbacks context\r
8978                         callbackContext = s.context || s,\r
8979                         // Context for global events is callbackContext if it is a DOM node or jQuery collection\r
8980                         globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\r
8981                                 jQuery( callbackContext ) :\r
8982                                 jQuery.event,\r
8983                         // Deferreds\r
8984                         deferred = jQuery.Deferred(),\r
8985                         completeDeferred = jQuery.Callbacks("once memory"),\r
8986                         // Status-dependent callbacks\r
8987                         statusCode = s.statusCode || {},\r
8988                         // Headers (they are sent all at once)\r
8989                         requestHeaders = {},\r
8990                         requestHeadersNames = {},\r
8991                         // The jqXHR state\r
8992                         state = 0,\r
8993                         // Default abort message\r
8994                         strAbort = "canceled",\r
8995                         // Fake xhr\r
8996                         jqXHR = {\r
8997                                 readyState: 0,\r
8998 \r
8999                                 // Builds headers hashtable if needed\r
9000                                 getResponseHeader: function( key ) {\r
9001                                         var match;\r
9002                                         if ( state === 2 ) {\r
9003                                                 if ( !responseHeaders ) {\r
9004                                                         responseHeaders = {};\r
9005                                                         while ( (match = rheaders.exec( responseHeadersString )) ) {\r
9006                                                                 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\r
9007                                                         }\r
9008                                                 }\r
9009                                                 match = responseHeaders[ key.toLowerCase() ];\r
9010                                         }\r
9011                                         return match == null ? null : match;\r
9012                                 },\r
9013 \r
9014                                 // Raw string\r
9015                                 getAllResponseHeaders: function() {\r
9016                                         return state === 2 ? responseHeadersString : null;\r
9017                                 },\r
9018 \r
9019                                 // Caches the header\r
9020                                 setRequestHeader: function( name, value ) {\r
9021                                         var lname = name.toLowerCase();\r
9022                                         if ( !state ) {\r
9023                                                 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\r
9024                                                 requestHeaders[ name ] = value;\r
9025                                         }\r
9026                                         return this;\r
9027                                 },\r
9028 \r
9029                                 // Overrides response content-type header\r
9030                                 overrideMimeType: function( type ) {\r
9031                                         if ( !state ) {\r
9032                                                 s.mimeType = type;\r
9033                                         }\r
9034                                         return this;\r
9035                                 },\r
9036 \r
9037                                 // Status-dependent callbacks\r
9038                                 statusCode: function( map ) {\r
9039                                         var code;\r
9040                                         if ( map ) {\r
9041                                                 if ( state < 2 ) {\r
9042                                                         for ( code in map ) {\r
9043                                                                 // Lazy-add the new callback in a way that preserves old ones\r
9044                                                                 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];\r
9045                                                         }\r
9046                                                 } else {\r
9047                                                         // Execute the appropriate callbacks\r
9048                                                         jqXHR.always( map[ jqXHR.status ] );\r
9049                                                 }\r
9050                                         }\r
9051                                         return this;\r
9052                                 },\r
9053 \r
9054                                 // Cancel the request\r
9055                                 abort: function( statusText ) {\r
9056                                         var finalText = statusText || strAbort;\r
9057                                         if ( transport ) {\r
9058                                                 transport.abort( finalText );\r
9059                                         }\r
9060                                         done( 0, finalText );\r
9061                                         return this;\r
9062                                 }\r
9063                         };\r
9064 \r
9065                 // Attach deferreds\r
9066                 deferred.promise( jqXHR ).complete = completeDeferred.add;\r
9067                 jqXHR.success = jqXHR.done;\r
9068                 jqXHR.error = jqXHR.fail;\r
9069 \r
9070                 // Remove hash character (#7531: and string promotion)\r
9071                 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)\r
9072                 // Handle falsy url in the settings object (#10093: consistency with old signature)\r
9073                 // We also use the url parameter if available\r
9074                 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );\r
9075 \r
9076                 // Alias method option to type as per ticket #12004\r
9077                 s.type = options.method || options.type || s.method || s.type;\r
9078 \r
9079                 // Extract dataTypes list\r
9080                 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];\r
9081 \r
9082                 // A cross-domain request is in order when we have a protocol:host:port mismatch\r
9083                 if ( s.crossDomain == null ) {\r
9084                         parts = rurl.exec( s.url.toLowerCase() );\r
9085                         s.crossDomain = !!( parts &&\r
9086                                 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\r
9087                                         ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==\r
9088                                                 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )\r
9089                         );\r
9090                 }\r
9091 \r
9092                 // Convert data if not already a string\r
9093                 if ( s.data && s.processData && typeof s.data !== "string" ) {\r
9094                         s.data = jQuery.param( s.data, s.traditional );\r
9095                 }\r
9096 \r
9097                 // Apply prefilters\r
9098                 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\r
9099 \r
9100                 // If request was aborted inside a prefilter, stop there\r
9101                 if ( state === 2 ) {\r
9102                         return jqXHR;\r
9103                 }\r
9104 \r
9105                 // We can fire global events as of now if asked to\r
9106                 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\r
9107                 fireGlobals = jQuery.event && s.global;\r
9108 \r
9109                 // Watch for a new set of requests\r
9110                 if ( fireGlobals && jQuery.active++ === 0 ) {\r
9111                         jQuery.event.trigger("ajaxStart");\r
9112                 }\r
9113 \r
9114                 // Uppercase the type\r
9115                 s.type = s.type.toUpperCase();\r
9116 \r
9117                 // Determine if request has content\r
9118                 s.hasContent = !rnoContent.test( s.type );\r
9119 \r
9120                 // Save the URL in case we're toying with the If-Modified-Since\r
9121                 // and/or If-None-Match header later on\r
9122                 cacheURL = s.url;\r
9123 \r
9124                 // More options handling for requests with no content\r
9125                 if ( !s.hasContent ) {\r
9126 \r
9127                         // If data is available, append data to url\r
9128                         if ( s.data ) {\r
9129                                 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );\r
9130                                 // #9682: remove data so that it's not used in an eventual retry\r
9131                                 delete s.data;\r
9132                         }\r
9133 \r
9134                         // Add anti-cache in url if needed\r
9135                         if ( s.cache === false ) {\r
9136                                 s.url = rts.test( cacheURL ) ?\r
9137 \r
9138                                         // If there is already a '_' parameter, set its value\r
9139                                         cacheURL.replace( rts, "$1_=" + nonce++ ) :\r
9140 \r
9141                                         // Otherwise add one to the end\r
9142                                         cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;\r
9143                         }\r
9144                 }\r
9145 \r
9146                 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r
9147                 if ( s.ifModified ) {\r
9148                         if ( jQuery.lastModified[ cacheURL ] ) {\r
9149                                 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );\r
9150                         }\r
9151                         if ( jQuery.etag[ cacheURL ] ) {\r
9152                                 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );\r
9153                         }\r
9154                 }\r
9155 \r
9156                 // Set the correct header, if data is being sent\r
9157                 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\r
9158                         jqXHR.setRequestHeader( "Content-Type", s.contentType );\r
9159                 }\r
9160 \r
9161                 // Set the Accepts header for the server, depending on the dataType\r
9162                 jqXHR.setRequestHeader(\r
9163                         "Accept",\r
9164                         s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\r
9165                                 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :\r
9166                                 s.accepts[ "*" ]\r
9167                 );\r
9168 \r
9169                 // Check for headers option\r
9170                 for ( i in s.headers ) {\r
9171                         jqXHR.setRequestHeader( i, s.headers[ i ] );\r
9172                 }\r
9173 \r
9174                 // Allow custom headers/mimetypes and early abort\r
9175                 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\r
9176                         // Abort if not done already and return\r
9177                         return jqXHR.abort();\r
9178                 }\r
9179 \r
9180                 // aborting is no longer a cancellation\r
9181                 strAbort = "abort";\r
9182 \r
9183                 // Install callbacks on deferreds\r
9184                 for ( i in { success: 1, error: 1, complete: 1 } ) {\r
9185                         jqXHR[ i ]( s[ i ] );\r
9186                 }\r
9187 \r
9188                 // Get transport\r
9189                 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\r
9190 \r
9191                 // If no transport, we auto-abort\r
9192                 if ( !transport ) {\r
9193                         done( -1, "No Transport" );\r
9194                 } else {\r
9195                         jqXHR.readyState = 1;\r
9196 \r
9197                         // Send global event\r
9198                         if ( fireGlobals ) {\r
9199                                 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );\r
9200                         }\r
9201                         // Timeout\r
9202                         if ( s.async && s.timeout > 0 ) {\r
9203                                 timeoutTimer = setTimeout(function() {\r
9204                                         jqXHR.abort("timeout");\r
9205                                 }, s.timeout );\r
9206                         }\r
9207 \r
9208                         try {\r
9209                                 state = 1;\r
9210                                 transport.send( requestHeaders, done );\r
9211                         } catch ( e ) {\r
9212                                 // Propagate exception as error if not done\r
9213                                 if ( state < 2 ) {\r
9214                                         done( -1, e );\r
9215                                 // Simply rethrow otherwise\r
9216                                 } else {\r
9217                                         throw e;\r
9218                                 }\r
9219                         }\r
9220                 }\r
9221 \r
9222                 // Callback for when everything is done\r
9223                 function done( status, nativeStatusText, responses, headers ) {\r
9224                         var isSuccess, success, error, response, modified,\r
9225                                 statusText = nativeStatusText;\r
9226 \r
9227                         // Called once\r
9228                         if ( state === 2 ) {\r
9229                                 return;\r
9230                         }\r
9231 \r
9232                         // State is "done" now\r
9233                         state = 2;\r
9234 \r
9235                         // Clear timeout if it exists\r
9236                         if ( timeoutTimer ) {\r
9237                                 clearTimeout( timeoutTimer );\r
9238                         }\r
9239 \r
9240                         // Dereference transport for early garbage collection\r
9241                         // (no matter how long the jqXHR object will be used)\r
9242                         transport = undefined;\r
9243 \r
9244                         // Cache response headers\r
9245                         responseHeadersString = headers || "";\r
9246 \r
9247                         // Set readyState\r
9248                         jqXHR.readyState = status > 0 ? 4 : 0;\r
9249 \r
9250                         // Determine if successful\r
9251                         isSuccess = status >= 200 && status < 300 || status === 304;\r
9252 \r
9253                         // Get response data\r
9254                         if ( responses ) {\r
9255                                 response = ajaxHandleResponses( s, jqXHR, responses );\r
9256                         }\r
9257 \r
9258                         // Convert no matter what (that way responseXXX fields are always set)\r
9259                         response = ajaxConvert( s, response, jqXHR, isSuccess );\r
9260 \r
9261                         // If successful, handle type chaining\r
9262                         if ( isSuccess ) {\r
9263 \r
9264                                 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r
9265                                 if ( s.ifModified ) {\r
9266                                         modified = jqXHR.getResponseHeader("Last-Modified");\r
9267                                         if ( modified ) {\r
9268                                                 jQuery.lastModified[ cacheURL ] = modified;\r
9269                                         }\r
9270                                         modified = jqXHR.getResponseHeader("etag");\r
9271                                         if ( modified ) {\r
9272                                                 jQuery.etag[ cacheURL ] = modified;\r
9273                                         }\r
9274                                 }\r
9275 \r
9276                                 // if no content\r
9277                                 if ( status === 204 || s.type === "HEAD" ) {\r
9278                                         statusText = "nocontent";\r
9279 \r
9280                                 // if not modified\r
9281                                 } else if ( status === 304 ) {\r
9282                                         statusText = "notmodified";\r
9283 \r
9284                                 // If we have data, let's convert it\r
9285                                 } else {\r
9286                                         statusText = response.state;\r
9287                                         success = response.data;\r
9288                                         error = response.error;\r
9289                                         isSuccess = !error;\r
9290                                 }\r
9291                         } else {\r
9292                                 // We extract error from statusText\r
9293                                 // then normalize statusText and status for non-aborts\r
9294                                 error = statusText;\r
9295                                 if ( status || !statusText ) {\r
9296                                         statusText = "error";\r
9297                                         if ( status < 0 ) {\r
9298                                                 status = 0;\r
9299                                         }\r
9300                                 }\r
9301                         }\r
9302 \r
9303                         // Set data for the fake xhr object\r
9304                         jqXHR.status = status;\r
9305                         jqXHR.statusText = ( nativeStatusText || statusText ) + "";\r
9306 \r
9307                         // Success/Error\r
9308                         if ( isSuccess ) {\r
9309                                 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\r
9310                         } else {\r
9311                                 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\r
9312                         }\r
9313 \r
9314                         // Status-dependent callbacks\r
9315                         jqXHR.statusCode( statusCode );\r
9316                         statusCode = undefined;\r
9317 \r
9318                         if ( fireGlobals ) {\r
9319                                 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",\r
9320                                         [ jqXHR, s, isSuccess ? success : error ] );\r
9321                         }\r
9322 \r
9323                         // Complete\r
9324                         completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\r
9325 \r
9326                         if ( fireGlobals ) {\r
9327                                 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );\r
9328                                 // Handle the global AJAX counter\r
9329                                 if ( !( --jQuery.active ) ) {\r
9330                                         jQuery.event.trigger("ajaxStop");\r
9331                                 }\r
9332                         }\r
9333                 }\r
9334 \r
9335                 return jqXHR;\r
9336         },\r
9337 \r
9338         getJSON: function( url, data, callback ) {\r
9339                 return jQuery.get( url, data, callback, "json" );\r
9340         },\r
9341 \r
9342         getScript: function( url, callback ) {\r
9343                 return jQuery.get( url, undefined, callback, "script" );\r
9344         }\r
9345 });\r
9346 \r
9347 jQuery.each( [ "get", "post" ], function( i, method ) {\r
9348         jQuery[ method ] = function( url, data, callback, type ) {\r
9349                 // shift arguments if data argument was omitted\r
9350                 if ( jQuery.isFunction( data ) ) {\r
9351                         type = type || callback;\r
9352                         callback = data;\r
9353                         data = undefined;\r
9354                 }\r
9355 \r
9356                 return jQuery.ajax({\r
9357                         url: url,\r
9358                         type: method,\r
9359                         dataType: type,\r
9360                         data: data,\r
9361                         success: callback\r
9362                 });\r
9363         };\r
9364 });\r
9365 \r
9366 \r
9367 jQuery._evalUrl = function( url ) {\r
9368         return jQuery.ajax({\r
9369                 url: url,\r
9370                 type: "GET",\r
9371                 dataType: "script",\r
9372                 async: false,\r
9373                 global: false,\r
9374                 "throws": true\r
9375         });\r
9376 };\r
9377 \r
9378 \r
9379 jQuery.fn.extend({\r
9380         wrapAll: function( html ) {\r
9381                 if ( jQuery.isFunction( html ) ) {\r
9382                         return this.each(function(i) {\r
9383                                 jQuery(this).wrapAll( html.call(this, i) );\r
9384                         });\r
9385                 }\r
9386 \r
9387                 if ( this[0] ) {\r
9388                         // The elements to wrap the target around\r
9389                         var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);\r
9390 \r
9391                         if ( this[0].parentNode ) {\r
9392                                 wrap.insertBefore( this[0] );\r
9393                         }\r
9394 \r
9395                         wrap.map(function() {\r
9396                                 var elem = this;\r
9397 \r
9398                                 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {\r
9399                                         elem = elem.firstChild;\r
9400                                 }\r
9401 \r
9402                                 return elem;\r
9403                         }).append( this );\r
9404                 }\r
9405 \r
9406                 return this;\r
9407         },\r
9408 \r
9409         wrapInner: function( html ) {\r
9410                 if ( jQuery.isFunction( html ) ) {\r
9411                         return this.each(function(i) {\r
9412                                 jQuery(this).wrapInner( html.call(this, i) );\r
9413                         });\r
9414                 }\r
9415 \r
9416                 return this.each(function() {\r
9417                         var self = jQuery( this ),\r
9418                                 contents = self.contents();\r
9419 \r
9420                         if ( contents.length ) {\r
9421                                 contents.wrapAll( html );\r
9422 \r
9423                         } else {\r
9424                                 self.append( html );\r
9425                         }\r
9426                 });\r
9427         },\r
9428 \r
9429         wrap: function( html ) {\r
9430                 var isFunction = jQuery.isFunction( html );\r
9431 \r
9432                 return this.each(function(i) {\r
9433                         jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\r
9434                 });\r
9435         },\r
9436 \r
9437         unwrap: function() {\r
9438                 return this.parent().each(function() {\r
9439                         if ( !jQuery.nodeName( this, "body" ) ) {\r
9440                                 jQuery( this ).replaceWith( this.childNodes );\r
9441                         }\r
9442                 }).end();\r
9443         }\r
9444 });\r
9445 \r
9446 \r
9447 jQuery.expr.filters.hidden = function( elem ) {\r
9448         // Support: Opera <= 12.12\r
9449         // Opera reports offsetWidths and offsetHeights less than zero on some elements\r
9450         return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||\r
9451                 (!support.reliableHiddenOffsets() &&\r
9452                         ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");\r
9453 };\r
9454 \r
9455 jQuery.expr.filters.visible = function( elem ) {\r
9456         return !jQuery.expr.filters.hidden( elem );\r
9457 };\r
9458 \r
9459 \r
9460 \r
9461 \r
9462 var r20 = /%20/g,\r
9463         rbracket = /\[\]$/,\r
9464         rCRLF = /\r?\n/g,\r
9465         rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\r
9466         rsubmittable = /^(?:input|select|textarea|keygen)/i;\r
9467 \r
9468 function buildParams( prefix, obj, traditional, add ) {\r
9469         var name;\r
9470 \r
9471         if ( jQuery.isArray( obj ) ) {\r
9472                 // Serialize array item.\r
9473                 jQuery.each( obj, function( i, v ) {\r
9474                         if ( traditional || rbracket.test( prefix ) ) {\r
9475                                 // Treat each array item as a scalar.\r
9476                                 add( prefix, v );\r
9477 \r
9478                         } else {\r
9479                                 // Item is non-scalar (array or object), encode its numeric index.\r
9480                                 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );\r
9481                         }\r
9482                 });\r
9483 \r
9484         } else if ( !traditional && jQuery.type( obj ) === "object" ) {\r
9485                 // Serialize object item.\r
9486                 for ( name in obj ) {\r
9487                         buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );\r
9488                 }\r
9489 \r
9490         } else {\r
9491                 // Serialize scalar item.\r
9492                 add( prefix, obj );\r
9493         }\r
9494 }\r
9495 \r
9496 // Serialize an array of form elements or a set of\r
9497 // key/values into a query string\r
9498 jQuery.param = function( a, traditional ) {\r
9499         var prefix,\r
9500                 s = [],\r
9501                 add = function( key, value ) {\r
9502                         // If value is a function, invoke it and return its value\r
9503                         value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );\r
9504                         s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );\r
9505                 };\r
9506 \r
9507         // Set traditional to true for jQuery <= 1.3.2 behavior.\r
9508         if ( traditional === undefined ) {\r
9509                 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\r
9510         }\r
9511 \r
9512         // If an array was passed in, assume that it is an array of form elements.\r
9513         if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\r
9514                 // Serialize the form elements\r
9515                 jQuery.each( a, function() {\r
9516                         add( this.name, this.value );\r
9517                 });\r
9518 \r
9519         } else {\r
9520                 // If traditional, encode the "old" way (the way 1.3.2 or older\r
9521                 // did it), otherwise encode params recursively.\r
9522                 for ( prefix in a ) {\r
9523                         buildParams( prefix, a[ prefix ], traditional, add );\r
9524                 }\r
9525         }\r
9526 \r
9527         // Return the resulting serialization\r
9528         return s.join( "&" ).replace( r20, "+" );\r
9529 };\r
9530 \r
9531 jQuery.fn.extend({\r
9532         serialize: function() {\r
9533                 return jQuery.param( this.serializeArray() );\r
9534         },\r
9535         serializeArray: function() {\r
9536                 return this.map(function() {\r
9537                         // Can add propHook for "elements" to filter or add form elements\r
9538                         var elements = jQuery.prop( this, "elements" );\r
9539                         return elements ? jQuery.makeArray( elements ) : this;\r
9540                 })\r
9541                 .filter(function() {\r
9542                         var type = this.type;\r
9543                         // Use .is(":disabled") so that fieldset[disabled] works\r
9544                         return this.name && !jQuery( this ).is( ":disabled" ) &&\r
9545                                 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\r
9546                                 ( this.checked || !rcheckableType.test( type ) );\r
9547                 })\r
9548                 .map(function( i, elem ) {\r
9549                         var val = jQuery( this ).val();\r
9550 \r
9551                         return val == null ?\r
9552                                 null :\r
9553                                 jQuery.isArray( val ) ?\r
9554                                         jQuery.map( val, function( val ) {\r
9555                                                 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };\r
9556                                         }) :\r
9557                                         { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };\r
9558                 }).get();\r
9559         }\r
9560 });\r
9561 \r
9562 \r
9563 // Create the request object\r
9564 // (This is still attached to ajaxSettings for backward compatibility)\r
9565 jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?\r
9566         // Support: IE6+\r
9567         function() {\r
9568 \r
9569                 // XHR cannot access local files, always use ActiveX for that case\r
9570                 return !this.isLocal &&\r
9571 \r
9572                         // Support: IE7-8\r
9573                         // oldIE XHR does not support non-RFC2616 methods (#13240)\r
9574                         // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx\r
9575                         // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9\r
9576                         // Although this check for six methods instead of eight\r
9577                         // since IE also does not support "trace" and "connect"\r
9578                         /^(get|post|head|put|delete|options)$/i.test( this.type ) &&\r
9579 \r
9580                         createStandardXHR() || createActiveXHR();\r
9581         } :\r
9582         // For all other browsers, use the standard XMLHttpRequest object\r
9583         createStandardXHR;\r
9584 \r
9585 var xhrId = 0,\r
9586         xhrCallbacks = {},\r
9587         xhrSupported = jQuery.ajaxSettings.xhr();\r
9588 \r
9589 // Support: IE<10\r
9590 // Open requests must be manually aborted on unload (#5280)\r
9591 // See https://support.microsoft.com/kb/2856746 for more info\r
9592 if ( window.attachEvent ) {\r
9593         window.attachEvent( "onunload", function() {\r
9594                 for ( var key in xhrCallbacks ) {\r
9595                         xhrCallbacks[ key ]( undefined, true );\r
9596                 }\r
9597         });\r
9598 }\r
9599 \r
9600 // Determine support properties\r
9601 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );\r
9602 xhrSupported = support.ajax = !!xhrSupported;\r
9603 \r
9604 // Create transport if the browser can provide an xhr\r
9605 if ( xhrSupported ) {\r
9606 \r
9607         jQuery.ajaxTransport(function( options ) {\r
9608                 // Cross domain only allowed if supported through XMLHttpRequest\r
9609                 if ( !options.crossDomain || support.cors ) {\r
9610 \r
9611                         var callback;\r
9612 \r
9613                         return {\r
9614                                 send: function( headers, complete ) {\r
9615                                         var i,\r
9616                                                 xhr = options.xhr(),\r
9617                                                 id = ++xhrId;\r
9618 \r
9619                                         // Open the socket\r
9620                                         xhr.open( options.type, options.url, options.async, options.username, options.password );\r
9621 \r
9622                                         // Apply custom fields if provided\r
9623                                         if ( options.xhrFields ) {\r
9624                                                 for ( i in options.xhrFields ) {\r
9625                                                         xhr[ i ] = options.xhrFields[ i ];\r
9626                                                 }\r
9627                                         }\r
9628 \r
9629                                         // Override mime type if needed\r
9630                                         if ( options.mimeType && xhr.overrideMimeType ) {\r
9631                                                 xhr.overrideMimeType( options.mimeType );\r
9632                                         }\r
9633 \r
9634                                         // X-Requested-With header\r
9635                                         // For cross-domain requests, seeing as conditions for a preflight are\r
9636                                         // akin to a jigsaw puzzle, we simply never set it to be sure.\r
9637                                         // (it can always be set on a per-request basis or even using ajaxSetup)\r
9638                                         // For same-domain requests, won't change header if already provided.\r
9639                                         if ( !options.crossDomain && !headers["X-Requested-With"] ) {\r
9640                                                 headers["X-Requested-With"] = "XMLHttpRequest";\r
9641                                         }\r
9642 \r
9643                                         // Set headers\r
9644                                         for ( i in headers ) {\r
9645                                                 // Support: IE<9\r
9646                                                 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting\r
9647                                                 // request header to a null-value.\r
9648                                                 //\r
9649                                                 // To keep consistent with other XHR implementations, cast the value\r
9650                                                 // to string and ignore `undefined`.\r
9651                                                 if ( headers[ i ] !== undefined ) {\r
9652                                                         xhr.setRequestHeader( i, headers[ i ] + "" );\r
9653                                                 }\r
9654                                         }\r
9655 \r
9656                                         // Do send the request\r
9657                                         // This may raise an exception which is actually\r
9658                                         // handled in jQuery.ajax (so no try/catch here)\r
9659                                         xhr.send( ( options.hasContent && options.data ) || null );\r
9660 \r
9661                                         // Listener\r
9662                                         callback = function( _, isAbort ) {\r
9663                                                 var status, statusText, responses;\r
9664 \r
9665                                                 // Was never called and is aborted or complete\r
9666                                                 if ( callback && ( isAbort || xhr.readyState === 4 ) ) {\r
9667                                                         // Clean up\r
9668                                                         delete xhrCallbacks[ id ];\r
9669                                                         callback = undefined;\r
9670                                                         xhr.onreadystatechange = jQuery.noop;\r
9671 \r
9672                                                         // Abort manually if needed\r
9673                                                         if ( isAbort ) {\r
9674                                                                 if ( xhr.readyState !== 4 ) {\r
9675                                                                         xhr.abort();\r
9676                                                                 }\r
9677                                                         } else {\r
9678                                                                 responses = {};\r
9679                                                                 status = xhr.status;\r
9680 \r
9681                                                                 // Support: IE<10\r
9682                                                                 // Accessing binary-data responseText throws an exception\r
9683                                                                 // (#11426)\r
9684                                                                 if ( typeof xhr.responseText === "string" ) {\r
9685                                                                         responses.text = xhr.responseText;\r
9686                                                                 }\r
9687 \r
9688                                                                 // Firefox throws an exception when accessing\r
9689                                                                 // statusText for faulty cross-domain requests\r
9690                                                                 try {\r
9691                                                                         statusText = xhr.statusText;\r
9692                                                                 } catch( e ) {\r
9693                                                                         // We normalize with Webkit giving an empty statusText\r
9694                                                                         statusText = "";\r
9695                                                                 }\r
9696 \r
9697                                                                 // Filter status for non standard behaviors\r
9698 \r
9699                                                                 // If the request is local and we have data: assume a success\r
9700                                                                 // (success with no data won't get notified, that's the best we\r
9701                                                                 // can do given current implementations)\r
9702                                                                 if ( !status && options.isLocal && !options.crossDomain ) {\r
9703                                                                         status = responses.text ? 200 : 404;\r
9704                                                                 // IE - #1450: sometimes returns 1223 when it should be 204\r
9705                                                                 } else if ( status === 1223 ) {\r
9706                                                                         status = 204;\r
9707                                                                 }\r
9708                                                         }\r
9709                                                 }\r
9710 \r
9711                                                 // Call complete if needed\r
9712                                                 if ( responses ) {\r
9713                                                         complete( status, statusText, responses, xhr.getAllResponseHeaders() );\r
9714                                                 }\r
9715                                         };\r
9716 \r
9717                                         if ( !options.async ) {\r
9718                                                 // if we're in sync mode we fire the callback\r
9719                                                 callback();\r
9720                                         } else if ( xhr.readyState === 4 ) {\r
9721                                                 // (IE6 & IE7) if it's in cache and has been\r
9722                                                 // retrieved directly we need to fire the callback\r
9723                                                 setTimeout( callback );\r
9724                                         } else {\r
9725                                                 // Add to the list of active xhr callbacks\r
9726                                                 xhr.onreadystatechange = xhrCallbacks[ id ] = callback;\r
9727                                         }\r
9728                                 },\r
9729 \r
9730                                 abort: function() {\r
9731                                         if ( callback ) {\r
9732                                                 callback( undefined, true );\r
9733                                         }\r
9734                                 }\r
9735                         };\r
9736                 }\r
9737         });\r
9738 }\r
9739 \r
9740 // Functions to create xhrs\r
9741 function createStandardXHR() {\r
9742         try {\r
9743                 return new window.XMLHttpRequest();\r
9744         } catch( e ) {}\r
9745 }\r
9746 \r
9747 function createActiveXHR() {\r
9748         try {\r
9749                 return new window.ActiveXObject( "Microsoft.XMLHTTP" );\r
9750         } catch( e ) {}\r
9751 }\r
9752 \r
9753 \r
9754 \r
9755 \r
9756 // Install script dataType\r
9757 jQuery.ajaxSetup({\r
9758         accepts: {\r
9759                 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"\r
9760         },\r
9761         contents: {\r
9762                 script: /(?:java|ecma)script/\r
9763         },\r
9764         converters: {\r
9765                 "text script": function( text ) {\r
9766                         jQuery.globalEval( text );\r
9767                         return text;\r
9768                 }\r
9769         }\r
9770 });\r
9771 \r
9772 // Handle cache's special case and global\r
9773 jQuery.ajaxPrefilter( "script", function( s ) {\r
9774         if ( s.cache === undefined ) {\r
9775                 s.cache = false;\r
9776         }\r
9777         if ( s.crossDomain ) {\r
9778                 s.type = "GET";\r
9779                 s.global = false;\r
9780         }\r
9781 });\r
9782 \r
9783 // Bind script tag hack transport\r
9784 jQuery.ajaxTransport( "script", function(s) {\r
9785 \r
9786         // This transport only deals with cross domain requests\r
9787         if ( s.crossDomain ) {\r
9788 \r
9789                 var script,\r
9790                         head = document.head || jQuery("head")[0] || document.documentElement;\r
9791 \r
9792                 return {\r
9793 \r
9794                         send: function( _, callback ) {\r
9795 \r
9796                                 script = document.createElement("script");\r
9797 \r
9798                                 script.async = true;\r
9799 \r
9800                                 if ( s.scriptCharset ) {\r
9801                                         script.charset = s.scriptCharset;\r
9802                                 }\r
9803 \r
9804                                 script.src = s.url;\r
9805 \r
9806                                 // Attach handlers for all browsers\r
9807                                 script.onload = script.onreadystatechange = function( _, isAbort ) {\r
9808 \r
9809                                         if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {\r
9810 \r
9811                                                 // Handle memory leak in IE\r
9812                                                 script.onload = script.onreadystatechange = null;\r
9813 \r
9814                                                 // Remove the script\r
9815                                                 if ( script.parentNode ) {\r
9816                                                         script.parentNode.removeChild( script );\r
9817                                                 }\r
9818 \r
9819                                                 // Dereference the script\r
9820                                                 script = null;\r
9821 \r
9822                                                 // Callback if not abort\r
9823                                                 if ( !isAbort ) {\r
9824                                                         callback( 200, "success" );\r
9825                                                 }\r
9826                                         }\r
9827                                 };\r
9828 \r
9829                                 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending\r
9830                                 // Use native DOM manipulation to avoid our domManip AJAX trickery\r
9831                                 head.insertBefore( script, head.firstChild );\r
9832                         },\r
9833 \r
9834                         abort: function() {\r
9835                                 if ( script ) {\r
9836                                         script.onload( undefined, true );\r
9837                                 }\r
9838                         }\r
9839                 };\r
9840         }\r
9841 });\r
9842 \r
9843 \r
9844 \r
9845 \r
9846 var oldCallbacks = [],\r
9847         rjsonp = /(=)\?(?=&|$)|\?\?/;\r
9848 \r
9849 // Default jsonp settings\r
9850 jQuery.ajaxSetup({\r
9851         jsonp: "callback",\r
9852         jsonpCallback: function() {\r
9853                 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );\r
9854                 this[ callback ] = true;\r
9855                 return callback;\r
9856         }\r
9857 });\r
9858 \r
9859 // Detect, normalize options and install callbacks for jsonp requests\r
9860 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {\r
9861 \r
9862         var callbackName, overwritten, responseContainer,\r
9863                 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\r
9864                         "url" :\r
9865                         typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"\r
9866                 );\r
9867 \r
9868         // Handle iff the expected data type is "jsonp" or we have a parameter to set\r
9869         if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {\r
9870 \r
9871                 // Get callback name, remembering preexisting value associated with it\r
9872                 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\r
9873                         s.jsonpCallback() :\r
9874                         s.jsonpCallback;\r
9875 \r
9876                 // Insert callback into url or form data\r
9877                 if ( jsonProp ) {\r
9878                         s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );\r
9879                 } else if ( s.jsonp !== false ) {\r
9880                         s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;\r
9881                 }\r
9882 \r
9883                 // Use data converter to retrieve json after script execution\r
9884                 s.converters["script json"] = function() {\r
9885                         if ( !responseContainer ) {\r
9886                                 jQuery.error( callbackName + " was not called" );\r
9887                         }\r
9888                         return responseContainer[ 0 ];\r
9889                 };\r
9890 \r
9891                 // force json dataType\r
9892                 s.dataTypes[ 0 ] = "json";\r
9893 \r
9894                 // Install callback\r
9895                 overwritten = window[ callbackName ];\r
9896                 window[ callbackName ] = function() {\r
9897                         responseContainer = arguments;\r
9898                 };\r
9899 \r
9900                 // Clean-up function (fires after converters)\r
9901                 jqXHR.always(function() {\r
9902                         // Restore preexisting value\r
9903                         window[ callbackName ] = overwritten;\r
9904 \r
9905                         // Save back as free\r
9906                         if ( s[ callbackName ] ) {\r
9907                                 // make sure that re-using the options doesn't screw things around\r
9908                                 s.jsonpCallback = originalSettings.jsonpCallback;\r
9909 \r
9910                                 // save the callback name for future use\r
9911                                 oldCallbacks.push( callbackName );\r
9912                         }\r
9913 \r
9914                         // Call if it was a function and we have a response\r
9915                         if ( responseContainer && jQuery.isFunction( overwritten ) ) {\r
9916                                 overwritten( responseContainer[ 0 ] );\r
9917                         }\r
9918 \r
9919                         responseContainer = overwritten = undefined;\r
9920                 });\r
9921 \r
9922                 // Delegate to script\r
9923                 return "script";\r
9924         }\r
9925 });\r
9926 \r
9927 \r
9928 \r
9929 \r
9930 // data: string of html\r
9931 // context (optional): If specified, the fragment will be created in this context, defaults to document\r
9932 // keepScripts (optional): If true, will include scripts passed in the html string\r
9933 jQuery.parseHTML = function( data, context, keepScripts ) {\r
9934         if ( !data || typeof data !== "string" ) {\r
9935                 return null;\r
9936         }\r
9937         if ( typeof context === "boolean" ) {\r
9938                 keepScripts = context;\r
9939                 context = false;\r
9940         }\r
9941         context = context || document;\r
9942 \r
9943         var parsed = rsingleTag.exec( data ),\r
9944                 scripts = !keepScripts && [];\r
9945 \r
9946         // Single tag\r
9947         if ( parsed ) {\r
9948                 return [ context.createElement( parsed[1] ) ];\r
9949         }\r
9950 \r
9951         parsed = jQuery.buildFragment( [ data ], context, scripts );\r
9952 \r
9953         if ( scripts && scripts.length ) {\r
9954                 jQuery( scripts ).remove();\r
9955         }\r
9956 \r
9957         return jQuery.merge( [], parsed.childNodes );\r
9958 };\r
9959 \r
9960 \r
9961 // Keep a copy of the old load method\r
9962 var _load = jQuery.fn.load;\r
9963 \r
9964 /**\r
9965  * Load a url into a page\r
9966  */\r
9967 jQuery.fn.load = function( url, params, callback ) {\r
9968         if ( typeof url !== "string" && _load ) {\r
9969                 return _load.apply( this, arguments );\r
9970         }\r
9971 \r
9972         var selector, response, type,\r
9973                 self = this,\r
9974                 off = url.indexOf(" ");\r
9975 \r
9976         if ( off >= 0 ) {\r
9977                 selector = jQuery.trim( url.slice( off, url.length ) );\r
9978                 url = url.slice( 0, off );\r
9979         }\r
9980 \r
9981         // If it's a function\r
9982         if ( jQuery.isFunction( params ) ) {\r
9983 \r
9984                 // We assume that it's the callback\r
9985                 callback = params;\r
9986                 params = undefined;\r
9987 \r
9988         // Otherwise, build a param string\r
9989         } else if ( params && typeof params === "object" ) {\r
9990                 type = "POST";\r
9991         }\r
9992 \r
9993         // If we have elements to modify, make the request\r
9994         if ( self.length > 0 ) {\r
9995                 jQuery.ajax({\r
9996                         url: url,\r
9997 \r
9998                         // if "type" variable is undefined, then "GET" method will be used\r
9999                         type: type,\r
10000                         dataType: "html",\r
10001                         data: params\r
10002                 }).done(function( responseText ) {\r
10003 \r
10004                         // Save response for use in complete callback\r
10005                         response = arguments;\r
10006 \r
10007                         self.html( selector ?\r
10008 \r
10009                                 // If a selector was specified, locate the right elements in a dummy div\r
10010                                 // Exclude scripts to avoid IE 'Permission Denied' errors\r
10011                                 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :\r
10012 \r
10013                                 // Otherwise use the full result\r
10014                                 responseText );\r
10015 \r
10016                 }).complete( callback && function( jqXHR, status ) {\r
10017                         self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\r
10018                 });\r
10019         }\r
10020 \r
10021         return this;\r
10022 };\r
10023 \r
10024 \r
10025 \r
10026 \r
10027 // Attach a bunch of functions for handling common AJAX events\r
10028 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {\r
10029         jQuery.fn[ type ] = function( fn ) {\r
10030                 return this.on( type, fn );\r
10031         };\r
10032 });\r
10033 \r
10034 \r
10035 \r
10036 \r
10037 jQuery.expr.filters.animated = function( elem ) {\r
10038         return jQuery.grep(jQuery.timers, function( fn ) {\r
10039                 return elem === fn.elem;\r
10040         }).length;\r
10041 };\r
10042 \r
10043 \r
10044 \r
10045 \r
10046 \r
10047 var docElem = window.document.documentElement;\r
10048 \r
10049 /**\r
10050  * Gets a window from an element\r
10051  */\r
10052 function getWindow( elem ) {\r
10053         return jQuery.isWindow( elem ) ?\r
10054                 elem :\r
10055                 elem.nodeType === 9 ?\r
10056                         elem.defaultView || elem.parentWindow :\r
10057                         false;\r
10058 }\r
10059 \r
10060 jQuery.offset = {\r
10061         setOffset: function( elem, options, i ) {\r
10062                 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\r
10063                         position = jQuery.css( elem, "position" ),\r
10064                         curElem = jQuery( elem ),\r
10065                         props = {};\r
10066 \r
10067                 // set position first, in-case top/left are set even on static elem\r
10068                 if ( position === "static" ) {\r
10069                         elem.style.position = "relative";\r
10070                 }\r
10071 \r
10072                 curOffset = curElem.offset();\r
10073                 curCSSTop = jQuery.css( elem, "top" );\r
10074                 curCSSLeft = jQuery.css( elem, "left" );\r
10075                 calculatePosition = ( position === "absolute" || position === "fixed" ) &&\r
10076                         jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;\r
10077 \r
10078                 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed\r
10079                 if ( calculatePosition ) {\r
10080                         curPosition = curElem.position();\r
10081                         curTop = curPosition.top;\r
10082                         curLeft = curPosition.left;\r
10083                 } else {\r
10084                         curTop = parseFloat( curCSSTop ) || 0;\r
10085                         curLeft = parseFloat( curCSSLeft ) || 0;\r
10086                 }\r
10087 \r
10088                 if ( jQuery.isFunction( options ) ) {\r
10089                         options = options.call( elem, i, curOffset );\r
10090                 }\r
10091 \r
10092                 if ( options.top != null ) {\r
10093                         props.top = ( options.top - curOffset.top ) + curTop;\r
10094                 }\r
10095                 if ( options.left != null ) {\r
10096                         props.left = ( options.left - curOffset.left ) + curLeft;\r
10097                 }\r
10098 \r
10099                 if ( "using" in options ) {\r
10100                         options.using.call( elem, props );\r
10101                 } else {\r
10102                         curElem.css( props );\r
10103                 }\r
10104         }\r
10105 };\r
10106 \r
10107 jQuery.fn.extend({\r
10108         offset: function( options ) {\r
10109                 if ( arguments.length ) {\r
10110                         return options === undefined ?\r
10111                                 this :\r
10112                                 this.each(function( i ) {\r
10113                                         jQuery.offset.setOffset( this, options, i );\r
10114                                 });\r
10115                 }\r
10116 \r
10117                 var docElem, win,\r
10118                         box = { top: 0, left: 0 },\r
10119                         elem = this[ 0 ],\r
10120                         doc = elem && elem.ownerDocument;\r
10121 \r
10122                 if ( !doc ) {\r
10123                         return;\r
10124                 }\r
10125 \r
10126                 docElem = doc.documentElement;\r
10127 \r
10128                 // Make sure it's not a disconnected DOM node\r
10129                 if ( !jQuery.contains( docElem, elem ) ) {\r
10130                         return box;\r
10131                 }\r
10132 \r
10133                 // If we don't have gBCR, just use 0,0 rather than error\r
10134                 // BlackBerry 5, iOS 3 (original iPhone)\r
10135                 if ( typeof elem.getBoundingClientRect !== strundefined ) {\r
10136                         box = elem.getBoundingClientRect();\r
10137                 }\r
10138                 win = getWindow( doc );\r
10139                 return {\r
10140                         top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),\r
10141                         left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )\r
10142                 };\r
10143         },\r
10144 \r
10145         position: function() {\r
10146                 if ( !this[ 0 ] ) {\r
10147                         return;\r
10148                 }\r
10149 \r
10150                 var offsetParent, offset,\r
10151                         parentOffset = { top: 0, left: 0 },\r
10152                         elem = this[ 0 ];\r
10153 \r
10154                 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent\r
10155                 if ( jQuery.css( elem, "position" ) === "fixed" ) {\r
10156                         // we assume that getBoundingClientRect is available when computed position is fixed\r
10157                         offset = elem.getBoundingClientRect();\r
10158                 } else {\r
10159                         // Get *real* offsetParent\r
10160                         offsetParent = this.offsetParent();\r
10161 \r
10162                         // Get correct offsets\r
10163                         offset = this.offset();\r
10164                         if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {\r
10165                                 parentOffset = offsetParent.offset();\r
10166                         }\r
10167 \r
10168                         // Add offsetParent borders\r
10169                         parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );\r
10170                         parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );\r
10171                 }\r
10172 \r
10173                 // Subtract parent offsets and element margins\r
10174                 // note: when an element has margin: auto the offsetLeft and marginLeft\r
10175                 // are the same in Safari causing offset.left to incorrectly be 0\r
10176                 return {\r
10177                         top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),\r
10178                         left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)\r
10179                 };\r
10180         },\r
10181 \r
10182         offsetParent: function() {\r
10183                 return this.map(function() {\r
10184                         var offsetParent = this.offsetParent || docElem;\r
10185 \r
10186                         while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {\r
10187                                 offsetParent = offsetParent.offsetParent;\r
10188                         }\r
10189                         return offsetParent || docElem;\r
10190                 });\r
10191         }\r
10192 });\r
10193 \r
10194 // Create scrollLeft and scrollTop methods\r
10195 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {\r
10196         var top = /Y/.test( prop );\r
10197 \r
10198         jQuery.fn[ method ] = function( val ) {\r
10199                 return access( this, function( elem, method, val ) {\r
10200                         var win = getWindow( elem );\r
10201 \r
10202                         if ( val === undefined ) {\r
10203                                 return win ? (prop in win) ? win[ prop ] :\r
10204                                         win.document.documentElement[ method ] :\r
10205                                         elem[ method ];\r
10206                         }\r
10207 \r
10208                         if ( win ) {\r
10209                                 win.scrollTo(\r
10210                                         !top ? val : jQuery( win ).scrollLeft(),\r
10211                                         top ? val : jQuery( win ).scrollTop()\r
10212                                 );\r
10213 \r
10214                         } else {\r
10215                                 elem[ method ] = val;\r
10216                         }\r
10217                 }, method, val, arguments.length, null );\r
10218         };\r
10219 });\r
10220 \r
10221 // Add the top/left cssHooks using jQuery.fn.position\r
10222 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\r
10223 // getComputedStyle returns percent when specified for top/left/bottom/right\r
10224 // rather than make the css module depend on the offset module, we just check for it here\r
10225 jQuery.each( [ "top", "left" ], function( i, prop ) {\r
10226         jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\r
10227                 function( elem, computed ) {\r
10228                         if ( computed ) {\r
10229                                 computed = curCSS( elem, prop );\r
10230                                 // if curCSS returns percentage, fallback to offset\r
10231                                 return rnumnonpx.test( computed ) ?\r
10232                                         jQuery( elem ).position()[ prop ] + "px" :\r
10233                                         computed;\r
10234                         }\r
10235                 }\r
10236         );\r
10237 });\r
10238 \r
10239 \r
10240 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\r
10241 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {\r
10242         jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {\r
10243                 // margin is only for outerHeight, outerWidth\r
10244                 jQuery.fn[ funcName ] = function( margin, value ) {\r
10245                         var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),\r
10246                                 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );\r
10247 \r
10248                         return access( this, function( elem, type, value ) {\r
10249                                 var doc;\r
10250 \r
10251                                 if ( jQuery.isWindow( elem ) ) {\r
10252                                         // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\r
10253                                         // isn't a whole lot we can do. See pull request at this URL for discussion:\r
10254                                         // https://github.com/jquery/jquery/pull/764\r
10255                                         return elem.document.documentElement[ "client" + name ];\r
10256                                 }\r
10257 \r
10258                                 // Get document width or height\r
10259                                 if ( elem.nodeType === 9 ) {\r
10260                                         doc = elem.documentElement;\r
10261 \r
10262                                         // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest\r
10263                                         // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.\r
10264                                         return Math.max(\r
10265                                                 elem.body[ "scroll" + name ], doc[ "scroll" + name ],\r
10266                                                 elem.body[ "offset" + name ], doc[ "offset" + name ],\r
10267                                                 doc[ "client" + name ]\r
10268                                         );\r
10269                                 }\r
10270 \r
10271                                 return value === undefined ?\r
10272                                         // Get width or height on the element, requesting but not forcing parseFloat\r
10273                                         jQuery.css( elem, type, extra ) :\r
10274 \r
10275                                         // Set width or height on the element\r
10276                                         jQuery.style( elem, type, value, extra );\r
10277                         }, type, chainable ? margin : undefined, chainable, null );\r
10278                 };\r
10279         });\r
10280 });\r
10281 \r
10282 \r
10283 // The number of elements contained in the matched element set\r
10284 jQuery.fn.size = function() {\r
10285         return this.length;\r
10286 };\r
10287 \r
10288 jQuery.fn.andSelf = jQuery.fn.addBack;\r
10289 \r
10290 \r
10291 \r
10292 \r
10293 // Register as a named AMD module, since jQuery can be concatenated with other\r
10294 // files that may use define, but not via a proper concatenation script that\r
10295 // understands anonymous AMD modules. A named AMD is safest and most robust\r
10296 // way to register. Lowercase jquery is used because AMD module names are\r
10297 // derived from file names, and jQuery is normally delivered in a lowercase\r
10298 // file name. Do this after creating the global so that if an AMD module wants\r
10299 // to call noConflict to hide this version of jQuery, it will work.\r
10300 \r
10301 // Note that for maximum portability, libraries that are not jQuery should\r
10302 // declare themselves as anonymous modules, and avoid setting a global if an\r
10303 // AMD loader is present. jQuery is a special case. For more information, see\r
10304 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\r
10305 \r
10306 if ( typeof define === "function" && define.amd ) {\r
10307         define( "jquery", [], function() {\r
10308                 return jQuery;\r
10309         });\r
10310 }\r
10311 \r
10312 \r
10313 \r
10314 \r
10315 var\r
10316         // Map over jQuery in case of overwrite\r
10317         _jQuery = window.jQuery,\r
10318 \r
10319         // Map over the $ in case of overwrite\r
10320         _$ = window.$;\r
10321 \r
10322 jQuery.noConflict = function( deep ) {\r
10323         if ( window.$ === jQuery ) {\r
10324                 window.$ = _$;\r
10325         }\r
10326 \r
10327         if ( deep && window.jQuery === jQuery ) {\r
10328                 window.jQuery = _jQuery;\r
10329         }\r
10330 \r
10331         return jQuery;\r
10332 };\r
10333 \r
10334 // Expose jQuery and $ identifiers, even in\r
10335 // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\r
10336 // and CommonJS for browser emulators (#13566)\r
10337 if ( typeof noGlobal === strundefined ) {\r
10338         window.jQuery = window.$ = jQuery;\r
10339 }\r
10340 \r
10341 \r
10342 \r
10343 \r
10344 return jQuery;\r
10345 \r
10346 }));\r