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