Path: blob/main/public/games/files/algaes-escapade/js/jquery-1.8.2.js
1036 views
/*!1* jQuery JavaScript Library v1.8.22* http://jquery.com/3*4* Includes Sizzle.js5* http://sizzlejs.com/6*7* Copyright 2012 jQuery Foundation and other contributors8* Released under the MIT license9* http://jquery.org/license10*11* Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)12*/13(function( window, undefined ) {14var15// A central reference to the root jQuery(document)16rootjQuery,1718// The deferred used on DOM ready19readyList,2021// Use the correct document accordingly with window argument (sandbox)22document = window.document,23location = window.location,24navigator = window.navigator,2526// Map over jQuery in case of overwrite27_jQuery = window.jQuery,2829// Map over the $ in case of overwrite30_$ = window.$,3132// Save a reference to some core methods33core_push = Array.prototype.push,34core_slice = Array.prototype.slice,35core_indexOf = Array.prototype.indexOf,36core_toString = Object.prototype.toString,37core_hasOwn = Object.prototype.hasOwnProperty,38core_trim = String.prototype.trim,3940// Define a local copy of jQuery41jQuery = function( selector, context ) {42// The jQuery object is actually just the init constructor 'enhanced'43return new jQuery.fn.init( selector, context, rootjQuery );44},4546// Used for matching numbers47core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,4849// Used for detecting and trimming whitespace50core_rnotwhite = /\S/,51core_rspace = /\s+/,5253// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)54rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,5556// A simple way to check for HTML strings57// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)58rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,5960// Match a standalone tag61rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,6263// JSON RegExp64rvalidchars = /^[\],:{}\s]*$/,65rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,66rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,67rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,6869// Matches dashed string for camelizing70rmsPrefix = /^-ms-/,71rdashAlpha = /-([\da-z])/gi,7273// Used by jQuery.camelCase as callback to replace()74fcamelCase = function( all, letter ) {75return ( letter + "" ).toUpperCase();76},7778// The ready event handler and self cleanup method79DOMContentLoaded = function() {80if ( document.addEventListener ) {81document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );82jQuery.ready();83} else if ( document.readyState === "complete" ) {84// we're here because readyState === "complete" in oldIE85// which is good enough for us to call the dom ready!86document.detachEvent( "onreadystatechange", DOMContentLoaded );87jQuery.ready();88}89},9091// [[Class]] -> type pairs92class2type = {};9394jQuery.fn = jQuery.prototype = {95constructor: jQuery,96init: function( selector, context, rootjQuery ) {97var match, elem, ret, doc;9899// Handle $(""), $(null), $(undefined), $(false)100if ( !selector ) {101return this;102}103104// Handle $(DOMElement)105if ( selector.nodeType ) {106this.context = this[0] = selector;107this.length = 1;108return this;109}110111// Handle HTML strings112if ( typeof selector === "string" ) {113if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {114// Assume that strings that start and end with <> are HTML and skip the regex check115match = [ null, selector, null ];116117} else {118match = rquickExpr.exec( selector );119}120121// Match html or make sure no context is specified for #id122if ( match && (match[1] || !context) ) {123124// HANDLE: $(html) -> $(array)125if ( match[1] ) {126context = context instanceof jQuery ? context[0] : context;127doc = ( context && context.nodeType ? context.ownerDocument || context : document );128129// scripts is true for back-compat130selector = jQuery.parseHTML( match[1], doc, true );131if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {132this.attr.call( selector, context, true );133}134135return jQuery.merge( this, selector );136137// HANDLE: $(#id)138} else {139elem = document.getElementById( match[2] );140141// Check parentNode to catch when Blackberry 4.6 returns142// nodes that are no longer in the document #6963143if ( elem && elem.parentNode ) {144// Handle the case where IE and Opera return items145// by name instead of ID146if ( elem.id !== match[2] ) {147return rootjQuery.find( selector );148}149150// Otherwise, we inject the element directly into the jQuery object151this.length = 1;152this[0] = elem;153}154155this.context = document;156this.selector = selector;157return this;158}159160// HANDLE: $(expr, $(...))161} else if ( !context || context.jquery ) {162return ( context || rootjQuery ).find( selector );163164// HANDLE: $(expr, context)165// (which is just equivalent to: $(context).find(expr)166} else {167return this.constructor( context ).find( selector );168}169170// HANDLE: $(function)171// Shortcut for document ready172} else if ( jQuery.isFunction( selector ) ) {173return rootjQuery.ready( selector );174}175176if ( selector.selector !== undefined ) {177this.selector = selector.selector;178this.context = selector.context;179}180181return jQuery.makeArray( selector, this );182},183184// Start with an empty selector185selector: "",186187// The current version of jQuery being used188jquery: "1.8.2",189190// The default length of a jQuery object is 0191length: 0,192193// The number of elements contained in the matched element set194size: function() {195return this.length;196},197198toArray: function() {199return core_slice.call( this );200},201202// Get the Nth element in the matched element set OR203// Get the whole matched element set as a clean array204get: function( num ) {205return num == null ?206207// Return a 'clean' array208this.toArray() :209210// Return just the object211( num < 0 ? this[ this.length + num ] : this[ num ] );212},213214// Take an array of elements and push it onto the stack215// (returning the new matched element set)216pushStack: function( elems, name, selector ) {217218// Build a new jQuery matched element set219var ret = jQuery.merge( this.constructor(), elems );220221// Add the old object onto the stack (as a reference)222ret.prevObject = this;223224ret.context = this.context;225226if ( name === "find" ) {227ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;228} else if ( name ) {229ret.selector = this.selector + "." + name + "(" + selector + ")";230}231232// Return the newly-formed element set233return ret;234},235236// Execute a callback for every element in the matched set.237// (You can seed the arguments with an array of args, but this is238// only used internally.)239each: function( callback, args ) {240return jQuery.each( this, callback, args );241},242243ready: function( fn ) {244// Add the callback245jQuery.ready.promise().done( fn );246247return this;248},249250eq: function( i ) {251i = +i;252return i === -1 ?253this.slice( i ) :254this.slice( i, i + 1 );255},256257first: function() {258return this.eq( 0 );259},260261last: function() {262return this.eq( -1 );263},264265slice: function() {266return this.pushStack( core_slice.apply( this, arguments ),267"slice", core_slice.call(arguments).join(",") );268},269270map: function( callback ) {271return this.pushStack( jQuery.map(this, function( elem, i ) {272return callback.call( elem, i, elem );273}));274},275276end: function() {277return this.prevObject || this.constructor(null);278},279280// For internal use only.281// Behaves like an Array's method, not like a jQuery method.282push: core_push,283sort: [].sort,284splice: [].splice285};286287// Give the init function the jQuery prototype for later instantiation288jQuery.fn.init.prototype = jQuery.fn;289290jQuery.extend = jQuery.fn.extend = function() {291var options, name, src, copy, copyIsArray, clone,292target = arguments[0] || {},293i = 1,294length = arguments.length,295deep = false;296297// Handle a deep copy situation298if ( typeof target === "boolean" ) {299deep = target;300target = arguments[1] || {};301// skip the boolean and the target302i = 2;303}304305// Handle case when target is a string or something (possible in deep copy)306if ( typeof target !== "object" && !jQuery.isFunction(target) ) {307target = {};308}309310// extend jQuery itself if only one argument is passed311if ( length === i ) {312target = this;313--i;314}315316for ( ; i < length; i++ ) {317// Only deal with non-null/undefined values318if ( (options = arguments[ i ]) != null ) {319// Extend the base object320for ( name in options ) {321src = target[ name ];322copy = options[ name ];323324// Prevent never-ending loop325if ( target === copy ) {326continue;327}328329// Recurse if we're merging plain objects or arrays330if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {331if ( copyIsArray ) {332copyIsArray = false;333clone = src && jQuery.isArray(src) ? src : [];334335} else {336clone = src && jQuery.isPlainObject(src) ? src : {};337}338339// Never move original objects, clone them340target[ name ] = jQuery.extend( deep, clone, copy );341342// Don't bring in undefined values343} else if ( copy !== undefined ) {344target[ name ] = copy;345}346}347}348}349350// Return the modified object351return target;352};353354jQuery.extend({355noConflict: function( deep ) {356if ( window.$ === jQuery ) {357window.$ = _$;358}359360if ( deep && window.jQuery === jQuery ) {361window.jQuery = _jQuery;362}363364return jQuery;365},366367// Is the DOM ready to be used? Set to true once it occurs.368isReady: false,369370// A counter to track how many items to wait for before371// the ready event fires. See #6781372readyWait: 1,373374// Hold (or release) the ready event375holdReady: function( hold ) {376if ( hold ) {377jQuery.readyWait++;378} else {379jQuery.ready( true );380}381},382383// Handle when the DOM is ready384ready: function( wait ) {385386// Abort if there are pending holds or we're already ready387if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {388return;389}390391// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).392if ( !document.body ) {393return setTimeout( jQuery.ready, 1 );394}395396// Remember that the DOM is ready397jQuery.isReady = true;398399// If a normal DOM Ready event fired, decrement, and wait if need be400if ( wait !== true && --jQuery.readyWait > 0 ) {401return;402}403404// If there are functions bound, to execute405readyList.resolveWith( document, [ jQuery ] );406407// Trigger any bound ready events408if ( jQuery.fn.trigger ) {409jQuery( document ).trigger("ready").off("ready");410}411},412413// See test/unit/core.js for details concerning isFunction.414// Since version 1.3, DOM methods and functions like alert415// aren't supported. They return false on IE (#2968).416isFunction: function( obj ) {417return jQuery.type(obj) === "function";418},419420isArray: Array.isArray || function( obj ) {421return jQuery.type(obj) === "array";422},423424isWindow: function( obj ) {425return obj != null && obj == obj.window;426},427428isNumeric: function( obj ) {429return !isNaN( parseFloat(obj) ) && isFinite( obj );430},431432type: function( obj ) {433return obj == null ?434String( obj ) :435class2type[ core_toString.call(obj) ] || "object";436},437438isPlainObject: function( obj ) {439// Must be an Object.440// Because of IE, we also have to check the presence of the constructor property.441// Make sure that DOM nodes and window objects don't pass through, as well442if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {443return false;444}445446try {447// Not own constructor property must be Object448if ( obj.constructor &&449!core_hasOwn.call(obj, "constructor") &&450!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {451return false;452}453} catch ( e ) {454// IE8,9 Will throw exceptions on certain host objects #9897455return false;456}457458// Own properties are enumerated firstly, so to speed up,459// if last one is own, then all properties are own.460461var key;462for ( key in obj ) {}463464return key === undefined || core_hasOwn.call( obj, key );465},466467isEmptyObject: function( obj ) {468var name;469for ( name in obj ) {470return false;471}472return true;473},474475error: function( msg ) {476throw new Error( msg );477},478479// data: string of html480// context (optional): If specified, the fragment will be created in this context, defaults to document481// scripts (optional): If true, will include scripts passed in the html string482parseHTML: function( data, context, scripts ) {483var parsed;484if ( !data || typeof data !== "string" ) {485return null;486}487if ( typeof context === "boolean" ) {488scripts = context;489context = 0;490}491context = context || document;492493// Single tag494if ( (parsed = rsingleTag.exec( data )) ) {495return [ context.createElement( parsed[1] ) ];496}497498parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );499return jQuery.merge( [],500(parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );501},502503parseJSON: function( data ) {504if ( !data || typeof data !== "string") {505return null;506}507508// Make sure leading/trailing whitespace is removed (IE can't handle it)509data = jQuery.trim( data );510511// Attempt to parse using the native JSON parser first512if ( window.JSON && window.JSON.parse ) {513return window.JSON.parse( data );514}515516// Make sure the incoming data is actual JSON517// Logic borrowed from http://json.org/json2.js518if ( rvalidchars.test( data.replace( rvalidescape, "@" )519.replace( rvalidtokens, "]" )520.replace( rvalidbraces, "")) ) {521522return ( new Function( "return " + data ) )();523524}525jQuery.error( "Invalid JSON: " + data );526},527528// Cross-browser xml parsing529parseXML: function( data ) {530var xml, tmp;531if ( !data || typeof data !== "string" ) {532return null;533}534try {535if ( window.DOMParser ) { // Standard536tmp = new DOMParser();537xml = tmp.parseFromString( data , "text/xml" );538} else { // IE539xml = new ActiveXObject( "Microsoft.XMLDOM" );540xml.async = "false";541xml.loadXML( data );542}543} catch( e ) {544xml = undefined;545}546if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {547jQuery.error( "Invalid XML: " + data );548}549return xml;550},551552noop: function() {},553554// Evaluates a script in a global context555// Workarounds based on findings by Jim Driscoll556// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context557globalEval: function( data ) {558if ( data && core_rnotwhite.test( data ) ) {559// We use execScript on Internet Explorer560// We use an anonymous function so that context is window561// rather than jQuery in Firefox562( window.execScript || function( data ) {563window[ "eval" ].call( window, data );564} )( data );565}566},567568// Convert dashed to camelCase; used by the css and data modules569// Microsoft forgot to hump their vendor prefix (#9572)570camelCase: function( string ) {571return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );572},573574nodeName: function( elem, name ) {575return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();576},577578// args is for internal usage only579each: function( obj, callback, args ) {580var name,581i = 0,582length = obj.length,583isObj = length === undefined || jQuery.isFunction( obj );584585if ( args ) {586if ( isObj ) {587for ( name in obj ) {588if ( callback.apply( obj[ name ], args ) === false ) {589break;590}591}592} else {593for ( ; i < length; ) {594if ( callback.apply( obj[ i++ ], args ) === false ) {595break;596}597}598}599600// A special, fast, case for the most common use of each601} else {602if ( isObj ) {603for ( name in obj ) {604if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {605break;606}607}608} else {609for ( ; i < length; ) {610if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {611break;612}613}614}615}616617return obj;618},619620// Use native String.trim function wherever possible621trim: core_trim && !core_trim.call("\uFEFF\xA0") ?622function( text ) {623return text == null ?624"" :625core_trim.call( text );626} :627628// Otherwise use our own trimming functionality629function( text ) {630return text == null ?631"" :632( text + "" ).replace( rtrim, "" );633},634635// results is for internal usage only636makeArray: function( arr, results ) {637var type,638ret = results || [];639640if ( arr != null ) {641// The window, strings (and functions) also have 'length'642// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930643type = jQuery.type( arr );644645if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {646core_push.call( ret, arr );647} else {648jQuery.merge( ret, arr );649}650}651652return ret;653},654655inArray: function( elem, arr, i ) {656var len;657658if ( arr ) {659if ( core_indexOf ) {660return core_indexOf.call( arr, elem, i );661}662663len = arr.length;664i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;665666for ( ; i < len; i++ ) {667// Skip accessing in sparse arrays668if ( i in arr && arr[ i ] === elem ) {669return i;670}671}672}673674return -1;675},676677merge: function( first, second ) {678var l = second.length,679i = first.length,680j = 0;681682if ( typeof l === "number" ) {683for ( ; j < l; j++ ) {684first[ i++ ] = second[ j ];685}686687} else {688while ( second[j] !== undefined ) {689first[ i++ ] = second[ j++ ];690}691}692693first.length = i;694695return first;696},697698grep: function( elems, callback, inv ) {699var retVal,700ret = [],701i = 0,702length = elems.length;703inv = !!inv;704705// Go through the array, only saving the items706// that pass the validator function707for ( ; i < length; i++ ) {708retVal = !!callback( elems[ i ], i );709if ( inv !== retVal ) {710ret.push( elems[ i ] );711}712}713714return ret;715},716717// arg is for internal usage only718map: function( elems, callback, arg ) {719var value, key,720ret = [],721i = 0,722length = elems.length,723// jquery objects are treated as arrays724isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;725726// Go through the array, translating each of the items to their727if ( isArray ) {728for ( ; i < length; i++ ) {729value = callback( elems[ i ], i, arg );730731if ( value != null ) {732ret[ ret.length ] = value;733}734}735736// Go through every key on the object,737} else {738for ( key in elems ) {739value = callback( elems[ key ], key, arg );740741if ( value != null ) {742ret[ ret.length ] = value;743}744}745}746747// Flatten any nested arrays748return ret.concat.apply( [], ret );749},750751// A global GUID counter for objects752guid: 1,753754// Bind a function to a context, optionally partially applying any755// arguments.756proxy: function( fn, context ) {757var tmp, args, proxy;758759if ( typeof context === "string" ) {760tmp = fn[ context ];761context = fn;762fn = tmp;763}764765// Quick check to determine if target is callable, in the spec766// this throws a TypeError, but we will just return undefined.767if ( !jQuery.isFunction( fn ) ) {768return undefined;769}770771// Simulated bind772args = core_slice.call( arguments, 2 );773proxy = function() {774return fn.apply( context, args.concat( core_slice.call( arguments ) ) );775};776777// Set the guid of unique handler to the same of original handler, so it can be removed778proxy.guid = fn.guid = fn.guid || jQuery.guid++;779780return proxy;781},782783// Multifunctional method to get and set values of a collection784// The value/s can optionally be executed if it's a function785access: function( elems, fn, key, value, chainable, emptyGet, pass ) {786var exec,787bulk = key == null,788i = 0,789length = elems.length;790791// Sets many values792if ( key && typeof key === "object" ) {793for ( i in key ) {794jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );795}796chainable = 1;797798// Sets one value799} else if ( value !== undefined ) {800// Optionally, function values get executed if exec is true801exec = pass === undefined && jQuery.isFunction( value );802803if ( bulk ) {804// Bulk operations only iterate when executing function values805if ( exec ) {806exec = fn;807fn = function( elem, key, value ) {808return exec.call( jQuery( elem ), value );809};810811// Otherwise they run against the entire set812} else {813fn.call( elems, value );814fn = null;815}816}817818if ( fn ) {819for (; i < length; i++ ) {820fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );821}822}823824chainable = 1;825}826827return chainable ?828elems :829830// Gets831bulk ?832fn.call( elems ) :833length ? fn( elems[0], key ) : emptyGet;834},835836now: function() {837return ( new Date() ).getTime();838}839});840841jQuery.ready.promise = function( obj ) {842if ( !readyList ) {843844readyList = jQuery.Deferred();845846// Catch cases where $(document).ready() is called after the browser event has already occurred.847// we once tried to use readyState "interactive" here, but it caused issues like the one848// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15849if ( document.readyState === "complete" ) {850// Handle it asynchronously to allow scripts the opportunity to delay ready851setTimeout( jQuery.ready, 1 );852853// Standards-based browsers support DOMContentLoaded854} else if ( document.addEventListener ) {855// Use the handy event callback856document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );857858// A fallback to window.onload, that will always work859window.addEventListener( "load", jQuery.ready, false );860861// If IE event model is used862} else {863// Ensure firing before onload, maybe late but safe also for iframes864document.attachEvent( "onreadystatechange", DOMContentLoaded );865866// A fallback to window.onload, that will always work867window.attachEvent( "onload", jQuery.ready );868869// If IE and not a frame870// continually check to see if the document is ready871var top = false;872873try {874top = window.frameElement == null && document.documentElement;875} catch(e) {}876877if ( top && top.doScroll ) {878(function doScrollCheck() {879if ( !jQuery.isReady ) {880881try {882// Use the trick by Diego Perini883// http://javascript.nwbox.com/IEContentLoaded/884top.doScroll("left");885} catch(e) {886return setTimeout( doScrollCheck, 50 );887}888889// and execute any waiting functions890jQuery.ready();891}892})();893}894}895}896return readyList.promise( obj );897};898899// Populate the class2type map900jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {901class2type[ "[object " + name + "]" ] = name.toLowerCase();902});903904// All jQuery objects should point back to these905rootjQuery = jQuery(document);906// String to Object options format cache907var optionsCache = {};908909// Convert String-formatted options into Object-formatted ones and store in cache910function createOptions( options ) {911var object = optionsCache[ options ] = {};912jQuery.each( options.split( core_rspace ), function( _, flag ) {913object[ flag ] = true;914});915return object;916}917918/*919* Create a callback list using the following parameters:920*921* options: an optional list of space-separated options that will change how922* the callback list behaves or a more traditional option object923*924* By default a callback list will act like an event callback list and can be925* "fired" multiple times.926*927* Possible options:928*929* once: will ensure the callback list can only be fired once (like a Deferred)930*931* memory: will keep track of previous values and will call any callback added932* after the list has been fired right away with the latest "memorized"933* values (like a Deferred)934*935* unique: will ensure a callback can only be added once (no duplicate in the list)936*937* stopOnFalse: interrupt callings when a callback returns false938*939*/940jQuery.Callbacks = function( options ) {941942// Convert options from String-formatted to Object-formatted if needed943// (we check in cache first)944options = typeof options === "string" ?945( optionsCache[ options ] || createOptions( options ) ) :946jQuery.extend( {}, options );947948var // Last fire value (for non-forgettable lists)949memory,950// Flag to know if list was already fired951fired,952// Flag to know if list is currently firing953firing,954// First callback to fire (used internally by add and fireWith)955firingStart,956// End of the loop when firing957firingLength,958// Index of currently firing callback (modified by remove if needed)959firingIndex,960// Actual callback list961list = [],962// Stack of fire calls for repeatable lists963stack = !options.once && [],964// Fire callbacks965fire = function( data ) {966memory = options.memory && data;967fired = true;968firingIndex = firingStart || 0;969firingStart = 0;970firingLength = list.length;971firing = true;972for ( ; list && firingIndex < firingLength; firingIndex++ ) {973if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {974memory = false; // To prevent further calls using add975break;976}977}978firing = false;979if ( list ) {980if ( stack ) {981if ( stack.length ) {982fire( stack.shift() );983}984} else if ( memory ) {985list = [];986} else {987self.disable();988}989}990},991// Actual Callbacks object992self = {993// Add a callback or a collection of callbacks to the list994add: function() {995if ( list ) {996// First, we save the current length997var start = list.length;998(function add( args ) {999jQuery.each( args, function( _, arg ) {1000var type = jQuery.type( arg );1001if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {1002list.push( arg );1003} else if ( arg && arg.length && type !== "string" ) {1004// Inspect recursively1005add( arg );1006}1007});1008})( arguments );1009// Do we need to add the callbacks to the1010// current firing batch?1011if ( firing ) {1012firingLength = list.length;1013// With memory, if we're not firing then1014// we should call right away1015} else if ( memory ) {1016firingStart = start;1017fire( memory );1018}1019}1020return this;1021},1022// Remove a callback from the list1023remove: function() {1024if ( list ) {1025jQuery.each( arguments, function( _, arg ) {1026var index;1027while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {1028list.splice( index, 1 );1029// Handle firing indexes1030if ( firing ) {1031if ( index <= firingLength ) {1032firingLength--;1033}1034if ( index <= firingIndex ) {1035firingIndex--;1036}1037}1038}1039});1040}1041return this;1042},1043// Control if a given callback is in the list1044has: function( fn ) {1045return jQuery.inArray( fn, list ) > -1;1046},1047// Remove all callbacks from the list1048empty: function() {1049list = [];1050return this;1051},1052// Have the list do nothing anymore1053disable: function() {1054list = stack = memory = undefined;1055return this;1056},1057// Is it disabled?1058disabled: function() {1059return !list;1060},1061// Lock the list in its current state1062lock: function() {1063stack = undefined;1064if ( !memory ) {1065self.disable();1066}1067return this;1068},1069// Is it locked?1070locked: function() {1071return !stack;1072},1073// Call all callbacks with the given context and arguments1074fireWith: function( context, args ) {1075args = args || [];1076args = [ context, args.slice ? args.slice() : args ];1077if ( list && ( !fired || stack ) ) {1078if ( firing ) {1079stack.push( args );1080} else {1081fire( args );1082}1083}1084return this;1085},1086// Call all the callbacks with the given arguments1087fire: function() {1088self.fireWith( this, arguments );1089return this;1090},1091// To know if the callbacks have already been called at least once1092fired: function() {1093return !!fired;1094}1095};10961097return self;1098};1099jQuery.extend({11001101Deferred: function( func ) {1102var tuples = [1103// action, add listener, listener list, final state1104[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],1105[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],1106[ "notify", "progress", jQuery.Callbacks("memory") ]1107],1108state = "pending",1109promise = {1110state: function() {1111return state;1112},1113always: function() {1114deferred.done( arguments ).fail( arguments );1115return this;1116},1117then: function( /* fnDone, fnFail, fnProgress */ ) {1118var fns = arguments;1119return jQuery.Deferred(function( newDefer ) {1120jQuery.each( tuples, function( i, tuple ) {1121var action = tuple[ 0 ],1122fn = fns[ i ];1123// deferred[ done | fail | progress ] for forwarding actions to newDefer1124deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?1125function() {1126var returned = fn.apply( this, arguments );1127if ( returned && jQuery.isFunction( returned.promise ) ) {1128returned.promise()1129.done( newDefer.resolve )1130.fail( newDefer.reject )1131.progress( newDefer.notify );1132} else {1133newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );1134}1135} :1136newDefer[ action ]1137);1138});1139fns = null;1140}).promise();1141},1142// Get a promise for this deferred1143// If obj is provided, the promise aspect is added to the object1144promise: function( obj ) {1145return obj != null ? jQuery.extend( obj, promise ) : promise;1146}1147},1148deferred = {};11491150// Keep pipe for back-compat1151promise.pipe = promise.then;11521153// Add list-specific methods1154jQuery.each( tuples, function( i, tuple ) {1155var list = tuple[ 2 ],1156stateString = tuple[ 3 ];11571158// promise[ done | fail | progress ] = list.add1159promise[ tuple[1] ] = list.add;11601161// Handle state1162if ( stateString ) {1163list.add(function() {1164// state = [ resolved | rejected ]1165state = stateString;11661167// [ reject_list | resolve_list ].disable; progress_list.lock1168}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );1169}11701171// deferred[ resolve | reject | notify ] = list.fire1172deferred[ tuple[0] ] = list.fire;1173deferred[ tuple[0] + "With" ] = list.fireWith;1174});11751176// Make the deferred a promise1177promise.promise( deferred );11781179// Call given func if any1180if ( func ) {1181func.call( deferred, deferred );1182}11831184// All done!1185return deferred;1186},11871188// Deferred helper1189when: function( subordinate /* , ..., subordinateN */ ) {1190var i = 0,1191resolveValues = core_slice.call( arguments ),1192length = resolveValues.length,11931194// the count of uncompleted subordinates1195remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,11961197// the master Deferred. If resolveValues consist of only a single Deferred, just use that.1198deferred = remaining === 1 ? subordinate : jQuery.Deferred(),11991200// Update function for both resolve and progress values1201updateFunc = function( i, contexts, values ) {1202return function( value ) {1203contexts[ i ] = this;1204values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;1205if( values === progressValues ) {1206deferred.notifyWith( contexts, values );1207} else if ( !( --remaining ) ) {1208deferred.resolveWith( contexts, values );1209}1210};1211},12121213progressValues, progressContexts, resolveContexts;12141215// add listeners to Deferred subordinates; treat others as resolved1216if ( length > 1 ) {1217progressValues = new Array( length );1218progressContexts = new Array( length );1219resolveContexts = new Array( length );1220for ( ; i < length; i++ ) {1221if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {1222resolveValues[ i ].promise()1223.done( updateFunc( i, resolveContexts, resolveValues ) )1224.fail( deferred.reject )1225.progress( updateFunc( i, progressContexts, progressValues ) );1226} else {1227--remaining;1228}1229}1230}12311232// if we're not waiting on anything, resolve the master1233if ( !remaining ) {1234deferred.resolveWith( resolveContexts, resolveValues );1235}12361237return deferred.promise();1238}1239});1240jQuery.support = (function() {12411242var support,1243all,1244a,1245select,1246opt,1247input,1248fragment,1249eventName,1250i,1251isSupported,1252clickFn,1253div = document.createElement("div");12541255// Preliminary tests1256div.setAttribute( "className", "t" );1257div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";12581259all = div.getElementsByTagName("*");1260a = div.getElementsByTagName("a")[ 0 ];1261a.style.cssText = "top:1px;float:left;opacity:.5";12621263// Can't get basic test support1264if ( !all || !all.length ) {1265return {};1266}12671268// First batch of supports tests1269select = document.createElement("select");1270opt = select.appendChild( document.createElement("option") );1271input = div.getElementsByTagName("input")[ 0 ];12721273support = {1274// IE strips leading whitespace when .innerHTML is used1275leadingWhitespace: ( div.firstChild.nodeType === 3 ),12761277// Make sure that tbody elements aren't automatically inserted1278// IE will insert them into empty tables1279tbody: !div.getElementsByTagName("tbody").length,12801281// Make sure that link elements get serialized correctly by innerHTML1282// This requires a wrapper element in IE1283htmlSerialize: !!div.getElementsByTagName("link").length,12841285// Get the style information from getAttribute1286// (IE uses .cssText instead)1287style: /top/.test( a.getAttribute("style") ),12881289// Make sure that URLs aren't manipulated1290// (IE normalizes it by default)1291hrefNormalized: ( a.getAttribute("href") === "/a" ),12921293// Make sure that element opacity exists1294// (IE uses filter instead)1295// Use a regex to work around a WebKit issue. See #51451296opacity: /^0.5/.test( a.style.opacity ),12971298// Verify style float existence1299// (IE uses styleFloat instead of cssFloat)1300cssFloat: !!a.style.cssFloat,13011302// Make sure that if no value is specified for a checkbox1303// that it defaults to "on".1304// (WebKit defaults to "" instead)1305checkOn: ( input.value === "on" ),13061307// Make sure that a selected-by-default option has a working selected property.1308// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)1309optSelected: opt.selected,13101311// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)1312getSetAttribute: div.className !== "t",13131314// Tests for enctype support on a form(#6743)1315enctype: !!document.createElement("form").enctype,13161317// Makes sure cloning an html5 element does not cause problems1318// Where outerHTML is undefined, this still works1319html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",13201321// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode1322boxModel: ( document.compatMode === "CSS1Compat" ),13231324// Will be defined later1325submitBubbles: true,1326changeBubbles: true,1327focusinBubbles: false,1328deleteExpando: true,1329noCloneEvent: true,1330inlineBlockNeedsLayout: false,1331shrinkWrapBlocks: false,1332reliableMarginRight: true,1333boxSizingReliable: true,1334pixelPosition: false1335};13361337// Make sure checked status is properly cloned1338input.checked = true;1339support.noCloneChecked = input.cloneNode( true ).checked;13401341// Make sure that the options inside disabled selects aren't marked as disabled1342// (WebKit marks them as disabled)1343select.disabled = true;1344support.optDisabled = !opt.disabled;13451346// Test to see if it's possible to delete an expando from an element1347// Fails in Internet Explorer1348try {1349delete div.test;1350} catch( e ) {1351support.deleteExpando = false;1352}13531354if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {1355div.attachEvent( "onclick", clickFn = function() {1356// Cloning a node shouldn't copy over any1357// bound event handlers (IE does this)1358support.noCloneEvent = false;1359});1360div.cloneNode( true ).fireEvent("onclick");1361div.detachEvent( "onclick", clickFn );1362}13631364// Check if a radio maintains its value1365// after being appended to the DOM1366input = document.createElement("input");1367input.value = "t";1368input.setAttribute( "type", "radio" );1369support.radioValue = input.value === "t";13701371input.setAttribute( "checked", "checked" );13721373// #11217 - WebKit loses check when the name is after the checked attribute1374input.setAttribute( "name", "t" );13751376div.appendChild( input );1377fragment = document.createDocumentFragment();1378fragment.appendChild( div.lastChild );13791380// WebKit doesn't clone checked state correctly in fragments1381support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;13821383// Check if a disconnected checkbox will retain its checked1384// value of true after appended to the DOM (IE6/7)1385support.appendChecked = input.checked;13861387fragment.removeChild( input );1388fragment.appendChild( div );13891390// Technique from Juriy Zaytsev1391// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/1392// We only care about the case where non-standard event systems1393// are used, namely in IE. Short-circuiting here helps us to1394// avoid an eval call (in setAttribute) which can cause CSP1395// to go haywire. See: https://developer.mozilla.org/en/Security/CSP1396if ( div.attachEvent ) {1397for ( i in {1398submit: true,1399change: true,1400focusin: true1401}) {1402eventName = "on" + i;1403isSupported = ( eventName in div );1404if ( !isSupported ) {1405div.setAttribute( eventName, "return;" );1406isSupported = ( typeof div[ eventName ] === "function" );1407}1408support[ i + "Bubbles" ] = isSupported;1409}1410}14111412// Run tests that need a body at doc ready1413jQuery(function() {1414var container, div, tds, marginDiv,1415divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",1416body = document.getElementsByTagName("body")[0];14171418if ( !body ) {1419// Return for frameset docs that don't have a body1420return;1421}14221423container = document.createElement("div");1424container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";1425body.insertBefore( container, body.firstChild );14261427// Construct the test element1428div = document.createElement("div");1429container.appendChild( div );14301431// Check if table cells still have offsetWidth/Height when they are set1432// to display:none and there are still other visible table cells in a1433// table row; if so, offsetWidth/Height are not reliable for use when1434// determining if an element has been hidden directly using1435// display:none (it is still safe to use offsets if a parent element is1436// hidden; don safety goggles and see bug #4512 for more information).1437// (only IE 8 fails this test)1438div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";1439tds = div.getElementsByTagName("td");1440tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";1441isSupported = ( tds[ 0 ].offsetHeight === 0 );14421443tds[ 0 ].style.display = "";1444tds[ 1 ].style.display = "none";14451446// Check if empty table cells still have offsetWidth/Height1447// (IE <= 8 fail this test)1448support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );14491450// Check box-sizing and margin behavior1451div.innerHTML = "";1452div.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%;";1453support.boxSizing = ( div.offsetWidth === 4 );1454support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );14551456// NOTE: To any future maintainer, we've window.getComputedStyle1457// because jsdom on node.js will break without it.1458if ( window.getComputedStyle ) {1459support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";1460support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";14611462// Check if div with explicit width and no margin-right incorrectly1463// gets computed margin-right based on width of container. For more1464// info see bug #33331465// Fails in WebKit before Feb 2011 nightlies1466// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right1467marginDiv = document.createElement("div");1468marginDiv.style.cssText = div.style.cssText = divReset;1469marginDiv.style.marginRight = marginDiv.style.width = "0";1470div.style.width = "1px";1471div.appendChild( marginDiv );1472support.reliableMarginRight =1473!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );1474}14751476if ( typeof div.style.zoom !== "undefined" ) {1477// Check if natively block-level elements act like inline-block1478// elements when setting their display to 'inline' and giving1479// them layout1480// (IE < 8 does this)1481div.innerHTML = "";1482div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";1483support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );14841485// Check if elements with layout shrink-wrap their children1486// (IE 6 does this)1487div.style.display = "block";1488div.style.overflow = "visible";1489div.innerHTML = "<div></div>";1490div.firstChild.style.width = "5px";1491support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );14921493container.style.zoom = 1;1494}14951496// Null elements to avoid leaks in IE1497body.removeChild( container );1498container = div = tds = marginDiv = null;1499});15001501// Null elements to avoid leaks in IE1502fragment.removeChild( div );1503all = a = select = opt = input = fragment = div = null;15041505return support;1506})();1507var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,1508rmultiDash = /([A-Z])/g;15091510jQuery.extend({1511cache: {},15121513deletedIds: [],15141515// Remove at next major release (1.9/2.0)1516uuid: 0,15171518// Unique for each copy of jQuery on the page1519// Non-digits removed to match rinlinejQuery1520expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),15211522// The following elements throw uncatchable exceptions if you1523// attempt to add expando properties to them.1524noData: {1525"embed": true,1526// Ban all objects except for Flash (which handle expandos)1527"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",1528"applet": true1529},15301531hasData: function( elem ) {1532elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];1533return !!elem && !isEmptyDataObject( elem );1534},15351536data: function( elem, name, data, pvt /* Internal Use Only */ ) {1537if ( !jQuery.acceptData( elem ) ) {1538return;1539}15401541var thisCache, ret,1542internalKey = jQuery.expando,1543getByName = typeof name === "string",15441545// We have to handle DOM nodes and JS objects differently because IE6-71546// can't GC object references properly across the DOM-JS boundary1547isNode = elem.nodeType,15481549// Only DOM nodes need the global jQuery cache; JS object data is1550// attached directly to the object so GC can occur automatically1551cache = isNode ? jQuery.cache : elem,15521553// Only defining an ID for JS objects if its cache already exists allows1554// the code to shortcut on the same path as a DOM node with no cache1555id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;15561557// Avoid doing any more work than we need to when trying to get data on an1558// object that has no data at all1559if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {1560return;1561}15621563if ( !id ) {1564// Only DOM nodes need a new unique ID for each element since their data1565// ends up in the global cache1566if ( isNode ) {1567elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;1568} else {1569id = internalKey;1570}1571}15721573if ( !cache[ id ] ) {1574cache[ id ] = {};15751576// Avoids exposing jQuery metadata on plain JS objects when the object1577// is serialized using JSON.stringify1578if ( !isNode ) {1579cache[ id ].toJSON = jQuery.noop;1580}1581}15821583// An object can be passed to jQuery.data instead of a key/value pair; this gets1584// shallow copied over onto the existing cache1585if ( typeof name === "object" || typeof name === "function" ) {1586if ( pvt ) {1587cache[ id ] = jQuery.extend( cache[ id ], name );1588} else {1589cache[ id ].data = jQuery.extend( cache[ id ].data, name );1590}1591}15921593thisCache = cache[ id ];15941595// jQuery data() is stored in a separate object inside the object's internal data1596// cache in order to avoid key collisions between internal data and user-defined1597// data.1598if ( !pvt ) {1599if ( !thisCache.data ) {1600thisCache.data = {};1601}16021603thisCache = thisCache.data;1604}16051606if ( data !== undefined ) {1607thisCache[ jQuery.camelCase( name ) ] = data;1608}16091610// Check for both converted-to-camel and non-converted data property names1611// If a data property was specified1612if ( getByName ) {16131614// First Try to find as-is property data1615ret = thisCache[ name ];16161617// Test for null|undefined property data1618if ( ret == null ) {16191620// Try to find the camelCased property1621ret = thisCache[ jQuery.camelCase( name ) ];1622}1623} else {1624ret = thisCache;1625}16261627return ret;1628},16291630removeData: function( elem, name, pvt /* Internal Use Only */ ) {1631if ( !jQuery.acceptData( elem ) ) {1632return;1633}16341635var thisCache, i, l,16361637isNode = elem.nodeType,16381639// See jQuery.data for more information1640cache = isNode ? jQuery.cache : elem,1641id = isNode ? elem[ jQuery.expando ] : jQuery.expando;16421643// If there is already no cache entry for this object, there is no1644// purpose in continuing1645if ( !cache[ id ] ) {1646return;1647}16481649if ( name ) {16501651thisCache = pvt ? cache[ id ] : cache[ id ].data;16521653if ( thisCache ) {16541655// Support array or space separated string names for data keys1656if ( !jQuery.isArray( name ) ) {16571658// try the string as a key before any manipulation1659if ( name in thisCache ) {1660name = [ name ];1661} else {16621663// split the camel cased version by spaces unless a key with the spaces exists1664name = jQuery.camelCase( name );1665if ( name in thisCache ) {1666name = [ name ];1667} else {1668name = name.split(" ");1669}1670}1671}16721673for ( i = 0, l = name.length; i < l; i++ ) {1674delete thisCache[ name[i] ];1675}16761677// If there is no data left in the cache, we want to continue1678// and let the cache object itself get destroyed1679if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {1680return;1681}1682}1683}16841685// See jQuery.data for more information1686if ( !pvt ) {1687delete cache[ id ].data;16881689// Don't destroy the parent cache unless the internal data object1690// had been the only thing left in it1691if ( !isEmptyDataObject( cache[ id ] ) ) {1692return;1693}1694}16951696// Destroy the cache1697if ( isNode ) {1698jQuery.cleanData( [ elem ], true );16991700// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)1701} else if ( jQuery.support.deleteExpando || cache != cache.window ) {1702delete cache[ id ];17031704// When all else fails, null1705} else {1706cache[ id ] = null;1707}1708},17091710// For internal use only.1711_data: function( elem, name, data ) {1712return jQuery.data( elem, name, data, true );1713},17141715// A method for determining if a DOM node can handle the data expando1716acceptData: function( elem ) {1717var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];17181719// nodes accept data unless otherwise specified; rejection can be conditional1720return !noData || noData !== true && elem.getAttribute("classid") === noData;1721}1722});17231724jQuery.fn.extend({1725data: function( key, value ) {1726var parts, part, attr, name, l,1727elem = this[0],1728i = 0,1729data = null;17301731// Gets all values1732if ( key === undefined ) {1733if ( this.length ) {1734data = jQuery.data( elem );17351736if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {1737attr = elem.attributes;1738for ( l = attr.length; i < l; i++ ) {1739name = attr[i].name;17401741if ( !name.indexOf( "data-" ) ) {1742name = jQuery.camelCase( name.substring(5) );17431744dataAttr( elem, name, data[ name ] );1745}1746}1747jQuery._data( elem, "parsedAttrs", true );1748}1749}17501751return data;1752}17531754// Sets multiple values1755if ( typeof key === "object" ) {1756return this.each(function() {1757jQuery.data( this, key );1758});1759}17601761parts = key.split( ".", 2 );1762parts[1] = parts[1] ? "." + parts[1] : "";1763part = parts[1] + "!";17641765return jQuery.access( this, function( value ) {17661767if ( value === undefined ) {1768data = this.triggerHandler( "getData" + part, [ parts[0] ] );17691770// Try to fetch any internally stored data first1771if ( data === undefined && elem ) {1772data = jQuery.data( elem, key );1773data = dataAttr( elem, key, data );1774}17751776return data === undefined && parts[1] ?1777this.data( parts[0] ) :1778data;1779}17801781parts[1] = value;1782this.each(function() {1783var self = jQuery( this );17841785self.triggerHandler( "setData" + part, parts );1786jQuery.data( this, key, value );1787self.triggerHandler( "changeData" + part, parts );1788});1789}, null, value, arguments.length > 1, null, false );1790},17911792removeData: function( key ) {1793return this.each(function() {1794jQuery.removeData( this, key );1795});1796}1797});17981799function dataAttr( elem, key, data ) {1800// If nothing was found internally, try to fetch any1801// data from the HTML5 data-* attribute1802if ( data === undefined && elem.nodeType === 1 ) {18031804var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();18051806data = elem.getAttribute( name );18071808if ( typeof data === "string" ) {1809try {1810data = data === "true" ? true :1811data === "false" ? false :1812data === "null" ? null :1813// Only convert to a number if it doesn't change the string1814+data + "" === data ? +data :1815rbrace.test( data ) ? jQuery.parseJSON( data ) :1816data;1817} catch( e ) {}18181819// Make sure we set the data so it isn't changed later1820jQuery.data( elem, key, data );18211822} else {1823data = undefined;1824}1825}18261827return data;1828}18291830// checks a cache object for emptiness1831function isEmptyDataObject( obj ) {1832var name;1833for ( name in obj ) {18341835// if the public data object is empty, the private is still empty1836if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {1837continue;1838}1839if ( name !== "toJSON" ) {1840return false;1841}1842}18431844return true;1845}1846jQuery.extend({1847queue: function( elem, type, data ) {1848var queue;18491850if ( elem ) {1851type = ( type || "fx" ) + "queue";1852queue = jQuery._data( elem, type );18531854// Speed up dequeue by getting out quickly if this is just a lookup1855if ( data ) {1856if ( !queue || jQuery.isArray(data) ) {1857queue = jQuery._data( elem, type, jQuery.makeArray(data) );1858} else {1859queue.push( data );1860}1861}1862return queue || [];1863}1864},18651866dequeue: function( elem, type ) {1867type = type || "fx";18681869var queue = jQuery.queue( elem, type ),1870startLength = queue.length,1871fn = queue.shift(),1872hooks = jQuery._queueHooks( elem, type ),1873next = function() {1874jQuery.dequeue( elem, type );1875};18761877// If the fx queue is dequeued, always remove the progress sentinel1878if ( fn === "inprogress" ) {1879fn = queue.shift();1880startLength--;1881}18821883if ( fn ) {18841885// Add a progress sentinel to prevent the fx queue from being1886// automatically dequeued1887if ( type === "fx" ) {1888queue.unshift( "inprogress" );1889}18901891// clear up the last queue stop function1892delete hooks.stop;1893fn.call( elem, next, hooks );1894}18951896if ( !startLength && hooks ) {1897hooks.empty.fire();1898}1899},19001901// not intended for public consumption - generates a queueHooks object, or returns the current one1902_queueHooks: function( elem, type ) {1903var key = type + "queueHooks";1904return jQuery._data( elem, key ) || jQuery._data( elem, key, {1905empty: jQuery.Callbacks("once memory").add(function() {1906jQuery.removeData( elem, type + "queue", true );1907jQuery.removeData( elem, key, true );1908})1909});1910}1911});19121913jQuery.fn.extend({1914queue: function( type, data ) {1915var setter = 2;19161917if ( typeof type !== "string" ) {1918data = type;1919type = "fx";1920setter--;1921}19221923if ( arguments.length < setter ) {1924return jQuery.queue( this[0], type );1925}19261927return data === undefined ?1928this :1929this.each(function() {1930var queue = jQuery.queue( this, type, data );19311932// ensure a hooks for this queue1933jQuery._queueHooks( this, type );19341935if ( type === "fx" && queue[0] !== "inprogress" ) {1936jQuery.dequeue( this, type );1937}1938});1939},1940dequeue: function( type ) {1941return this.each(function() {1942jQuery.dequeue( this, type );1943});1944},1945// Based off of the plugin by Clint Helfers, with permission.1946// http://blindsignals.com/index.php/2009/07/jquery-delay/1947delay: function( time, type ) {1948time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;1949type = type || "fx";19501951return this.queue( type, function( next, hooks ) {1952var timeout = setTimeout( next, time );1953hooks.stop = function() {1954clearTimeout( timeout );1955};1956});1957},1958clearQueue: function( type ) {1959return this.queue( type || "fx", [] );1960},1961// Get a promise resolved when queues of a certain type1962// are emptied (fx is the type by default)1963promise: function( type, obj ) {1964var tmp,1965count = 1,1966defer = jQuery.Deferred(),1967elements = this,1968i = this.length,1969resolve = function() {1970if ( !( --count ) ) {1971defer.resolveWith( elements, [ elements ] );1972}1973};19741975if ( typeof type !== "string" ) {1976obj = type;1977type = undefined;1978}1979type = type || "fx";19801981while( i-- ) {1982tmp = jQuery._data( elements[ i ], type + "queueHooks" );1983if ( tmp && tmp.empty ) {1984count++;1985tmp.empty.add( resolve );1986}1987}1988resolve();1989return defer.promise( obj );1990}1991});1992var nodeHook, boolHook, fixSpecified,1993rclass = /[\t\r\n]/g,1994rreturn = /\r/g,1995rtype = /^(?:button|input)$/i,1996rfocusable = /^(?:button|input|object|select|textarea)$/i,1997rclickable = /^a(?:rea|)$/i,1998rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,1999getSetAttribute = jQuery.support.getSetAttribute;20002001jQuery.fn.extend({2002attr: function( name, value ) {2003return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );2004},20052006removeAttr: function( name ) {2007return this.each(function() {2008jQuery.removeAttr( this, name );2009});2010},20112012prop: function( name, value ) {2013return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );2014},20152016removeProp: function( name ) {2017name = jQuery.propFix[ name ] || name;2018return this.each(function() {2019// try/catch handles cases where IE balks (such as removing a property on window)2020try {2021this[ name ] = undefined;2022delete this[ name ];2023} catch( e ) {}2024});2025},20262027addClass: function( value ) {2028var classNames, i, l, elem,2029setClass, c, cl;20302031if ( jQuery.isFunction( value ) ) {2032return this.each(function( j ) {2033jQuery( this ).addClass( value.call(this, j, this.className) );2034});2035}20362037if ( value && typeof value === "string" ) {2038classNames = value.split( core_rspace );20392040for ( i = 0, l = this.length; i < l; i++ ) {2041elem = this[ i ];20422043if ( elem.nodeType === 1 ) {2044if ( !elem.className && classNames.length === 1 ) {2045elem.className = value;20462047} else {2048setClass = " " + elem.className + " ";20492050for ( c = 0, cl = classNames.length; c < cl; c++ ) {2051if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {2052setClass += classNames[ c ] + " ";2053}2054}2055elem.className = jQuery.trim( setClass );2056}2057}2058}2059}20602061return this;2062},20632064removeClass: function( value ) {2065var removes, className, elem, c, cl, i, l;20662067if ( jQuery.isFunction( value ) ) {2068return this.each(function( j ) {2069jQuery( this ).removeClass( value.call(this, j, this.className) );2070});2071}2072if ( (value && typeof value === "string") || value === undefined ) {2073removes = ( value || "" ).split( core_rspace );20742075for ( i = 0, l = this.length; i < l; i++ ) {2076elem = this[ i ];2077if ( elem.nodeType === 1 && elem.className ) {20782079className = (" " + elem.className + " ").replace( rclass, " " );20802081// loop over each item in the removal list2082for ( c = 0, cl = removes.length; c < cl; c++ ) {2083// Remove until there is nothing to remove,2084while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {2085className = className.replace( " " + removes[ c ] + " " , " " );2086}2087}2088elem.className = value ? jQuery.trim( className ) : "";2089}2090}2091}20922093return this;2094},20952096toggleClass: function( value, stateVal ) {2097var type = typeof value,2098isBool = typeof stateVal === "boolean";20992100if ( jQuery.isFunction( value ) ) {2101return this.each(function( i ) {2102jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );2103});2104}21052106return this.each(function() {2107if ( type === "string" ) {2108// toggle individual class names2109var className,2110i = 0,2111self = jQuery( this ),2112state = stateVal,2113classNames = value.split( core_rspace );21142115while ( (className = classNames[ i++ ]) ) {2116// check each className given, space separated list2117state = isBool ? state : !self.hasClass( className );2118self[ state ? "addClass" : "removeClass" ]( className );2119}21202121} else if ( type === "undefined" || type === "boolean" ) {2122if ( this.className ) {2123// store className if set2124jQuery._data( this, "__className__", this.className );2125}21262127// toggle whole className2128this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";2129}2130});2131},21322133hasClass: function( selector ) {2134var className = " " + selector + " ",2135i = 0,2136l = this.length;2137for ( ; i < l; i++ ) {2138if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {2139return true;2140}2141}21422143return false;2144},21452146val: function( value ) {2147var hooks, ret, isFunction,2148elem = this[0];21492150if ( !arguments.length ) {2151if ( elem ) {2152hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];21532154if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {2155return ret;2156}21572158ret = elem.value;21592160return typeof ret === "string" ?2161// handle most common string cases2162ret.replace(rreturn, "") :2163// handle cases where value is null/undef or number2164ret == null ? "" : ret;2165}21662167return;2168}21692170isFunction = jQuery.isFunction( value );21712172return this.each(function( i ) {2173var val,2174self = jQuery(this);21752176if ( this.nodeType !== 1 ) {2177return;2178}21792180if ( isFunction ) {2181val = value.call( this, i, self.val() );2182} else {2183val = value;2184}21852186// Treat null/undefined as ""; convert numbers to string2187if ( val == null ) {2188val = "";2189} else if ( typeof val === "number" ) {2190val += "";2191} else if ( jQuery.isArray( val ) ) {2192val = jQuery.map(val, function ( value ) {2193return value == null ? "" : value + "";2194});2195}21962197hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];21982199// If set returns undefined, fall back to normal setting2200if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {2201this.value = val;2202}2203});2204}2205});22062207jQuery.extend({2208valHooks: {2209option: {2210get: function( elem ) {2211// attributes.value is undefined in Blackberry 4.7 but2212// uses .value. See #69322213var val = elem.attributes.value;2214return !val || val.specified ? elem.value : elem.text;2215}2216},2217select: {2218get: function( elem ) {2219var value, i, max, option,2220index = elem.selectedIndex,2221values = [],2222options = elem.options,2223one = elem.type === "select-one";22242225// Nothing was selected2226if ( index < 0 ) {2227return null;2228}22292230// Loop through all the selected options2231i = one ? index : 0;2232max = one ? index + 1 : options.length;2233for ( ; i < max; i++ ) {2234option = options[ i ];22352236// Don't return options that are disabled or in a disabled optgroup2237if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&2238(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {22392240// Get the specific value for the option2241value = jQuery( option ).val();22422243// We don't need an array for one selects2244if ( one ) {2245return value;2246}22472248// Multi-Selects return an array2249values.push( value );2250}2251}22522253// Fixes Bug #2551 -- select.val() broken in IE after form.reset()2254if ( one && !values.length && options.length ) {2255return jQuery( options[ index ] ).val();2256}22572258return values;2259},22602261set: function( elem, value ) {2262var values = jQuery.makeArray( value );22632264jQuery(elem).find("option").each(function() {2265this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;2266});22672268if ( !values.length ) {2269elem.selectedIndex = -1;2270}2271return values;2272}2273}2274},22752276// Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.92277attrFn: {},22782279attr: function( elem, name, value, pass ) {2280var ret, hooks, notxml,2281nType = elem.nodeType;22822283// don't get/set attributes on text, comment and attribute nodes2284if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2285return;2286}22872288if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {2289return jQuery( elem )[ name ]( value );2290}22912292// Fallback to prop when attributes are not supported2293if ( typeof elem.getAttribute === "undefined" ) {2294return jQuery.prop( elem, name, value );2295}22962297notxml = nType !== 1 || !jQuery.isXMLDoc( elem );22982299// All attributes are lowercase2300// Grab necessary hook if one is defined2301if ( notxml ) {2302name = name.toLowerCase();2303hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );2304}23052306if ( value !== undefined ) {23072308if ( value === null ) {2309jQuery.removeAttr( elem, name );2310return;23112312} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {2313return ret;23142315} else {2316elem.setAttribute( name, value + "" );2317return value;2318}23192320} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {2321return ret;23222323} else {23242325ret = elem.getAttribute( name );23262327// Non-existent attributes return null, we normalize to undefined2328return ret === null ?2329undefined :2330ret;2331}2332},23332334removeAttr: function( elem, value ) {2335var propName, attrNames, name, isBool,2336i = 0;23372338if ( value && elem.nodeType === 1 ) {23392340attrNames = value.split( core_rspace );23412342for ( ; i < attrNames.length; i++ ) {2343name = attrNames[ i ];23442345if ( name ) {2346propName = jQuery.propFix[ name ] || name;2347isBool = rboolean.test( name );23482349// See #9699 for explanation of this approach (setting first, then removal)2350// Do not do this for boolean attributes (see #10870)2351if ( !isBool ) {2352jQuery.attr( elem, name, "" );2353}2354elem.removeAttribute( getSetAttribute ? name : propName );23552356// Set corresponding property to false for boolean attributes2357if ( isBool && propName in elem ) {2358elem[ propName ] = false;2359}2360}2361}2362}2363},23642365attrHooks: {2366type: {2367set: function( elem, value ) {2368// We can't allow the type property to be changed (since it causes problems in IE)2369if ( rtype.test( elem.nodeName ) && elem.parentNode ) {2370jQuery.error( "type property can't be changed" );2371} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {2372// Setting the type on a radio button after the value resets the value in IE6-92373// Reset value to it's default in case type is set after value2374// This is for element creation2375var val = elem.value;2376elem.setAttribute( "type", value );2377if ( val ) {2378elem.value = val;2379}2380return value;2381}2382}2383},2384// Use the value property for back compat2385// Use the nodeHook for button elements in IE6/7 (#1954)2386value: {2387get: function( elem, name ) {2388if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {2389return nodeHook.get( elem, name );2390}2391return name in elem ?2392elem.value :2393null;2394},2395set: function( elem, value, name ) {2396if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {2397return nodeHook.set( elem, value, name );2398}2399// Does not return so that setAttribute is also used2400elem.value = value;2401}2402}2403},24042405propFix: {2406tabindex: "tabIndex",2407readonly: "readOnly",2408"for": "htmlFor",2409"class": "className",2410maxlength: "maxLength",2411cellspacing: "cellSpacing",2412cellpadding: "cellPadding",2413rowspan: "rowSpan",2414colspan: "colSpan",2415usemap: "useMap",2416frameborder: "frameBorder",2417contenteditable: "contentEditable"2418},24192420prop: function( elem, name, value ) {2421var ret, hooks, notxml,2422nType = elem.nodeType;24232424// don't get/set properties on text, comment and attribute nodes2425if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2426return;2427}24282429notxml = nType !== 1 || !jQuery.isXMLDoc( elem );24302431if ( notxml ) {2432// Fix name and attach hooks2433name = jQuery.propFix[ name ] || name;2434hooks = jQuery.propHooks[ name ];2435}24362437if ( value !== undefined ) {2438if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {2439return ret;24402441} else {2442return ( elem[ name ] = value );2443}24442445} else {2446if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {2447return ret;24482449} else {2450return elem[ name ];2451}2452}2453},24542455propHooks: {2456tabIndex: {2457get: function( elem ) {2458// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set2459// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/2460var attributeNode = elem.getAttributeNode("tabindex");24612462return attributeNode && attributeNode.specified ?2463parseInt( attributeNode.value, 10 ) :2464rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?24650 :2466undefined;2467}2468}2469}2470});24712472// Hook for boolean attributes2473boolHook = {2474get: function( elem, name ) {2475// Align boolean attributes with corresponding properties2476// Fall back to attribute presence where some booleans are not supported2477var attrNode,2478property = jQuery.prop( elem, name );2479return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?2480name.toLowerCase() :2481undefined;2482},2483set: function( elem, value, name ) {2484var propName;2485if ( value === false ) {2486// Remove boolean attributes when set to false2487jQuery.removeAttr( elem, name );2488} else {2489// value is true since we know at this point it's type boolean and not false2490// Set boolean attributes to the same name and set the DOM property2491propName = jQuery.propFix[ name ] || name;2492if ( propName in elem ) {2493// Only set the IDL specifically if it already exists on the element2494elem[ propName ] = true;2495}24962497elem.setAttribute( name, name.toLowerCase() );2498}2499return name;2500}2501};25022503// IE6/7 do not support getting/setting some attributes with get/setAttribute2504if ( !getSetAttribute ) {25052506fixSpecified = {2507name: true,2508id: true,2509coords: true2510};25112512// Use this for any attribute in IE6/72513// This fixes almost every IE6/7 issue2514nodeHook = jQuery.valHooks.button = {2515get: function( elem, name ) {2516var ret;2517ret = elem.getAttributeNode( name );2518return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?2519ret.value :2520undefined;2521},2522set: function( elem, value, name ) {2523// Set the existing or create a new attribute node2524var ret = elem.getAttributeNode( name );2525if ( !ret ) {2526ret = document.createAttribute( name );2527elem.setAttributeNode( ret );2528}2529return ( ret.value = value + "" );2530}2531};25322533// Set width and height to auto instead of 0 on empty string( Bug #8150 )2534// This is for removals2535jQuery.each([ "width", "height" ], function( i, name ) {2536jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2537set: function( elem, value ) {2538if ( value === "" ) {2539elem.setAttribute( name, "auto" );2540return value;2541}2542}2543});2544});25452546// Set contenteditable to false on removals(#10429)2547// Setting to empty string throws an error as an invalid value2548jQuery.attrHooks.contenteditable = {2549get: nodeHook.get,2550set: function( elem, value, name ) {2551if ( value === "" ) {2552value = "false";2553}2554nodeHook.set( elem, value, name );2555}2556};2557}255825592560// Some attributes require a special call on IE2561if ( !jQuery.support.hrefNormalized ) {2562jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {2563jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2564get: function( elem ) {2565var ret = elem.getAttribute( name, 2 );2566return ret === null ? undefined : ret;2567}2568});2569});2570}25712572if ( !jQuery.support.style ) {2573jQuery.attrHooks.style = {2574get: function( elem ) {2575// Return undefined in the case of empty string2576// Normalize to lowercase since IE uppercases css property names2577return elem.style.cssText.toLowerCase() || undefined;2578},2579set: function( elem, value ) {2580return ( elem.style.cssText = value + "" );2581}2582};2583}25842585// Safari mis-reports the default selected property of an option2586// Accessing the parent's selectedIndex property fixes it2587if ( !jQuery.support.optSelected ) {2588jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {2589get: function( elem ) {2590var parent = elem.parentNode;25912592if ( parent ) {2593parent.selectedIndex;25942595// Make sure that it also works with optgroups, see #57012596if ( parent.parentNode ) {2597parent.parentNode.selectedIndex;2598}2599}2600return null;2601}2602});2603}26042605// IE6/7 call enctype encoding2606if ( !jQuery.support.enctype ) {2607jQuery.propFix.enctype = "encoding";2608}26092610// Radios and checkboxes getter/setter2611if ( !jQuery.support.checkOn ) {2612jQuery.each([ "radio", "checkbox" ], function() {2613jQuery.valHooks[ this ] = {2614get: function( elem ) {2615// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified2616return elem.getAttribute("value") === null ? "on" : elem.value;2617}2618};2619});2620}2621jQuery.each([ "radio", "checkbox" ], function() {2622jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {2623set: function( elem, value ) {2624if ( jQuery.isArray( value ) ) {2625return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );2626}2627}2628});2629});2630var rformElems = /^(?:textarea|input|select)$/i,2631rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,2632rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,2633rkeyEvent = /^key/,2634rmouseEvent = /^(?:mouse|contextmenu)|click/,2635rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,2636hoverHack = function( events ) {2637return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );2638};26392640/*2641* Helper functions for managing events -- not part of the public interface.2642* Props to Dean Edwards' addEvent library for many of the ideas.2643*/2644jQuery.event = {26452646add: function( elem, types, handler, data, selector ) {26472648var elemData, eventHandle, events,2649t, tns, type, namespaces, handleObj,2650handleObjIn, handlers, special;26512652// Don't attach events to noData or text/comment nodes (allow plain objects tho)2653if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {2654return;2655}26562657// Caller can pass in an object of custom data in lieu of the handler2658if ( handler.handler ) {2659handleObjIn = handler;2660handler = handleObjIn.handler;2661selector = handleObjIn.selector;2662}26632664// Make sure that the handler has a unique ID, used to find/remove it later2665if ( !handler.guid ) {2666handler.guid = jQuery.guid++;2667}26682669// Init the element's event structure and main handler, if this is the first2670events = elemData.events;2671if ( !events ) {2672elemData.events = events = {};2673}2674eventHandle = elemData.handle;2675if ( !eventHandle ) {2676elemData.handle = eventHandle = function( e ) {2677// Discard the second event of a jQuery.event.trigger() and2678// when an event is called after a page has unloaded2679return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?2680jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :2681undefined;2682};2683// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events2684eventHandle.elem = elem;2685}26862687// Handle multiple events separated by a space2688// jQuery(...).bind("mouseover mouseout", fn);2689types = jQuery.trim( hoverHack(types) ).split( " " );2690for ( t = 0; t < types.length; t++ ) {26912692tns = rtypenamespace.exec( types[t] ) || [];2693type = tns[1];2694namespaces = ( tns[2] || "" ).split( "." ).sort();26952696// If event changes its type, use the special event handlers for the changed type2697special = jQuery.event.special[ type ] || {};26982699// If selector defined, determine special event api type, otherwise given type2700type = ( selector ? special.delegateType : special.bindType ) || type;27012702// Update special based on newly reset type2703special = jQuery.event.special[ type ] || {};27042705// handleObj is passed to all event handlers2706handleObj = jQuery.extend({2707type: type,2708origType: tns[1],2709data: data,2710handler: handler,2711guid: handler.guid,2712selector: selector,2713needsContext: selector && jQuery.expr.match.needsContext.test( selector ),2714namespace: namespaces.join(".")2715}, handleObjIn );27162717// Init the event handler queue if we're the first2718handlers = events[ type ];2719if ( !handlers ) {2720handlers = events[ type ] = [];2721handlers.delegateCount = 0;27222723// Only use addEventListener/attachEvent if the special events handler returns false2724if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {2725// Bind the global event handler to the element2726if ( elem.addEventListener ) {2727elem.addEventListener( type, eventHandle, false );27282729} else if ( elem.attachEvent ) {2730elem.attachEvent( "on" + type, eventHandle );2731}2732}2733}27342735if ( special.add ) {2736special.add.call( elem, handleObj );27372738if ( !handleObj.handler.guid ) {2739handleObj.handler.guid = handler.guid;2740}2741}27422743// Add to the element's handler list, delegates in front2744if ( selector ) {2745handlers.splice( handlers.delegateCount++, 0, handleObj );2746} else {2747handlers.push( handleObj );2748}27492750// Keep track of which events have ever been used, for event optimization2751jQuery.event.global[ type ] = true;2752}27532754// Nullify elem to prevent memory leaks in IE2755elem = null;2756},27572758global: {},27592760// Detach an event or set of events from an element2761remove: function( elem, types, handler, selector, mappedTypes ) {27622763var t, tns, type, origType, namespaces, origCount,2764j, events, special, eventType, handleObj,2765elemData = jQuery.hasData( elem ) && jQuery._data( elem );27662767if ( !elemData || !(events = elemData.events) ) {2768return;2769}27702771// Once for each type.namespace in types; type may be omitted2772types = jQuery.trim( hoverHack( types || "" ) ).split(" ");2773for ( t = 0; t < types.length; t++ ) {2774tns = rtypenamespace.exec( types[t] ) || [];2775type = origType = tns[1];2776namespaces = tns[2];27772778// Unbind all events (on this namespace, if provided) for the element2779if ( !type ) {2780for ( type in events ) {2781jQuery.event.remove( elem, type + types[ t ], handler, selector, true );2782}2783continue;2784}27852786special = jQuery.event.special[ type ] || {};2787type = ( selector? special.delegateType : special.bindType ) || type;2788eventType = events[ type ] || [];2789origCount = eventType.length;2790namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;27912792// Remove matching events2793for ( j = 0; j < eventType.length; j++ ) {2794handleObj = eventType[ j ];27952796if ( ( mappedTypes || origType === handleObj.origType ) &&2797( !handler || handler.guid === handleObj.guid ) &&2798( !namespaces || namespaces.test( handleObj.namespace ) ) &&2799( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {2800eventType.splice( j--, 1 );28012802if ( handleObj.selector ) {2803eventType.delegateCount--;2804}2805if ( special.remove ) {2806special.remove.call( elem, handleObj );2807}2808}2809}28102811// Remove generic event handler if we removed something and no more handlers exist2812// (avoids potential for endless recursion during removal of special event handlers)2813if ( eventType.length === 0 && origCount !== eventType.length ) {2814if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {2815jQuery.removeEvent( elem, type, elemData.handle );2816}28172818delete events[ type ];2819}2820}28212822// Remove the expando if it's no longer used2823if ( jQuery.isEmptyObject( events ) ) {2824delete elemData.handle;28252826// removeData also checks for emptiness and clears the expando if empty2827// so use it instead of delete2828jQuery.removeData( elem, "events", true );2829}2830},28312832// Events that are safe to short-circuit if no handlers are attached.2833// Native DOM events should not be added, they may have inline handlers.2834customEvent: {2835"getData": true,2836"setData": true,2837"changeData": true2838},28392840trigger: function( event, data, elem, onlyHandlers ) {2841// Don't do events on text and comment nodes2842if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {2843return;2844}28452846// Event object or event type2847var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,2848type = event.type || event,2849namespaces = [];28502851// focus/blur morphs to focusin/out; ensure we're not firing them right now2852if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {2853return;2854}28552856if ( type.indexOf( "!" ) >= 0 ) {2857// Exclusive events trigger only for the exact event (no namespaces)2858type = type.slice(0, -1);2859exclusive = true;2860}28612862if ( type.indexOf( "." ) >= 0 ) {2863// Namespaced trigger; create a regexp to match event type in handle()2864namespaces = type.split(".");2865type = namespaces.shift();2866namespaces.sort();2867}28682869if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {2870// No jQuery handlers for this event type, and it can't have inline handlers2871return;2872}28732874// Caller can pass in an Event, Object, or just an event type string2875event = typeof event === "object" ?2876// jQuery.Event object2877event[ jQuery.expando ] ? event :2878// Object literal2879new jQuery.Event( type, event ) :2880// Just the event type (string)2881new jQuery.Event( type );28822883event.type = type;2884event.isTrigger = true;2885event.exclusive = exclusive;2886event.namespace = namespaces.join( "." );2887event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;2888ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";28892890// Handle a global trigger2891if ( !elem ) {28922893// TODO: Stop taunting the data cache; remove global events and always attach to document2894cache = jQuery.cache;2895for ( i in cache ) {2896if ( cache[ i ].events && cache[ i ].events[ type ] ) {2897jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );2898}2899}2900return;2901}29022903// Clean up the event in case it is being reused2904event.result = undefined;2905if ( !event.target ) {2906event.target = elem;2907}29082909// Clone any incoming data and prepend the event, creating the handler arg list2910data = data != null ? jQuery.makeArray( data ) : [];2911data.unshift( event );29122913// Allow special events to draw outside the lines2914special = jQuery.event.special[ type ] || {};2915if ( special.trigger && special.trigger.apply( elem, data ) === false ) {2916return;2917}29182919// Determine event propagation path in advance, per W3C events spec (#9951)2920// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)2921eventPath = [[ elem, special.bindType || type ]];2922if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {29232924bubbleType = special.delegateType || type;2925cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;2926for ( old = elem; cur; cur = cur.parentNode ) {2927eventPath.push([ cur, bubbleType ]);2928old = cur;2929}29302931// Only add window if we got to document (e.g., not plain obj or detached DOM)2932if ( old === (elem.ownerDocument || document) ) {2933eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);2934}2935}29362937// Fire handlers on the event path2938for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {29392940cur = eventPath[i][0];2941event.type = eventPath[i][1];29422943handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );2944if ( handle ) {2945handle.apply( cur, data );2946}2947// Note that this is a bare JS function and not a jQuery handler2948handle = ontype && cur[ ontype ];2949if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {2950event.preventDefault();2951}2952}2953event.type = type;29542955// If nobody prevented the default action, do it now2956if ( !onlyHandlers && !event.isDefaultPrevented() ) {29572958if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&2959!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {29602961// Call a native DOM method on the target with the same name name as the event.2962// Can't use an .isFunction() check here because IE6/7 fails that test.2963// Don't do default actions on window, that's where global variables be (#6170)2964// IE<9 dies on focus/blur to hidden element (#1486)2965if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {29662967// Don't re-trigger an onFOO event when we call its FOO() method2968old = elem[ ontype ];29692970if ( old ) {2971elem[ ontype ] = null;2972}29732974// Prevent re-triggering of the same event, since we already bubbled it above2975jQuery.event.triggered = type;2976elem[ type ]();2977jQuery.event.triggered = undefined;29782979if ( old ) {2980elem[ ontype ] = old;2981}2982}2983}2984}29852986return event.result;2987},29882989dispatch: function( event ) {29902991// Make a writable jQuery.Event from the native event object2992event = jQuery.event.fix( event || window.event );29932994var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,2995handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),2996delegateCount = handlers.delegateCount,2997args = core_slice.call( arguments ),2998run_all = !event.exclusive && !event.namespace,2999special = jQuery.event.special[ event.type ] || {},3000handlerQueue = [];30013002// Use the fix-ed jQuery.Event rather than the (read-only) native event3003args[0] = event;3004event.delegateTarget = this;30053006// Call the preDispatch hook for the mapped type, and let it bail if desired3007if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {3008return;3009}30103011// Determine handlers that should run if there are delegated events3012// Avoid non-left-click bubbling in Firefox (#3861)3013if ( delegateCount && !(event.button && event.type === "click") ) {30143015for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {30163017// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)3018if ( cur.disabled !== true || event.type !== "click" ) {3019selMatch = {};3020matches = [];3021for ( i = 0; i < delegateCount; i++ ) {3022handleObj = handlers[ i ];3023sel = handleObj.selector;30243025if ( selMatch[ sel ] === undefined ) {3026selMatch[ sel ] = handleObj.needsContext ?3027jQuery( sel, this ).index( cur ) >= 0 :3028jQuery.find( sel, this, null, [ cur ] ).length;3029}3030if ( selMatch[ sel ] ) {3031matches.push( handleObj );3032}3033}3034if ( matches.length ) {3035handlerQueue.push({ elem: cur, matches: matches });3036}3037}3038}3039}30403041// Add the remaining (directly-bound) handlers3042if ( handlers.length > delegateCount ) {3043handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });3044}30453046// Run delegates first; they may want to stop propagation beneath us3047for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {3048matched = handlerQueue[ i ];3049event.currentTarget = matched.elem;30503051for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {3052handleObj = matched.matches[ j ];30533054// Triggered event must either 1) be non-exclusive and have no namespace, or3055// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).3056if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {30573058event.data = handleObj.data;3059event.handleObj = handleObj;30603061ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )3062.apply( matched.elem, args );30633064if ( ret !== undefined ) {3065event.result = ret;3066if ( ret === false ) {3067event.preventDefault();3068event.stopPropagation();3069}3070}3071}3072}3073}30743075// Call the postDispatch hook for the mapped type3076if ( special.postDispatch ) {3077special.postDispatch.call( this, event );3078}30793080return event.result;3081},30823083// Includes some event props shared by KeyEvent and MouseEvent3084// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***3085props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),30863087fixHooks: {},30883089keyHooks: {3090props: "char charCode key keyCode".split(" "),3091filter: function( event, original ) {30923093// Add which for key events3094if ( event.which == null ) {3095event.which = original.charCode != null ? original.charCode : original.keyCode;3096}30973098return event;3099}3100},31013102mouseHooks: {3103props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),3104filter: function( event, original ) {3105var eventDoc, doc, body,3106button = original.button,3107fromElement = original.fromElement;31083109// Calculate pageX/Y if missing and clientX/Y available3110if ( event.pageX == null && original.clientX != null ) {3111eventDoc = event.target.ownerDocument || document;3112doc = eventDoc.documentElement;3113body = eventDoc.body;31143115event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );3116event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );3117}31183119// Add relatedTarget, if necessary3120if ( !event.relatedTarget && fromElement ) {3121event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;3122}31233124// Add which for click: 1 === left; 2 === middle; 3 === right3125// Note: button is not normalized, so don't use it3126if ( !event.which && button !== undefined ) {3127event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );3128}31293130return event;3131}3132},31333134fix: function( event ) {3135if ( event[ jQuery.expando ] ) {3136return event;3137}31383139// Create a writable copy of the event object and normalize some properties3140var i, prop,3141originalEvent = event,3142fixHook = jQuery.event.fixHooks[ event.type ] || {},3143copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;31443145event = jQuery.Event( originalEvent );31463147for ( i = copy.length; i; ) {3148prop = copy[ --i ];3149event[ prop ] = originalEvent[ prop ];3150}31513152// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)3153if ( !event.target ) {3154event.target = originalEvent.srcElement || document;3155}31563157// Target should not be a text node (#504, Safari)3158if ( event.target.nodeType === 3 ) {3159event.target = event.target.parentNode;3160}31613162// For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)3163event.metaKey = !!event.metaKey;31643165return fixHook.filter? fixHook.filter( event, originalEvent ) : event;3166},31673168special: {3169load: {3170// Prevent triggered image.load events from bubbling to window.load3171noBubble: true3172},31733174focus: {3175delegateType: "focusin"3176},3177blur: {3178delegateType: "focusout"3179},31803181beforeunload: {3182setup: function( data, namespaces, eventHandle ) {3183// We only want to do this special case on windows3184if ( jQuery.isWindow( this ) ) {3185this.onbeforeunload = eventHandle;3186}3187},31883189teardown: function( namespaces, eventHandle ) {3190if ( this.onbeforeunload === eventHandle ) {3191this.onbeforeunload = null;3192}3193}3194}3195},31963197simulate: function( type, elem, event, bubble ) {3198// Piggyback on a donor event to simulate a different one.3199// Fake originalEvent to avoid donor's stopPropagation, but if the3200// simulated event prevents default then we do the same on the donor.3201var e = jQuery.extend(3202new jQuery.Event(),3203event,3204{ type: type,3205isSimulated: true,3206originalEvent: {}3207}3208);3209if ( bubble ) {3210jQuery.event.trigger( e, null, elem );3211} else {3212jQuery.event.dispatch.call( elem, e );3213}3214if ( e.isDefaultPrevented() ) {3215event.preventDefault();3216}3217}3218};32193220// Some plugins are using, but it's undocumented/deprecated and will be removed.3221// The 1.7 special event interface should provide all the hooks needed now.3222jQuery.event.handle = jQuery.event.dispatch;32233224jQuery.removeEvent = document.removeEventListener ?3225function( elem, type, handle ) {3226if ( elem.removeEventListener ) {3227elem.removeEventListener( type, handle, false );3228}3229} :3230function( elem, type, handle ) {3231var name = "on" + type;32323233if ( elem.detachEvent ) {32343235// #8545, #7054, preventing memory leaks for custom events in IE6-8 –3236// detachEvent needed property on element, by name of that event, to properly expose it to GC3237if ( typeof elem[ name ] === "undefined" ) {3238elem[ name ] = null;3239}32403241elem.detachEvent( name, handle );3242}3243};32443245jQuery.Event = function( src, props ) {3246// Allow instantiation without the 'new' keyword3247if ( !(this instanceof jQuery.Event) ) {3248return new jQuery.Event( src, props );3249}32503251// Event object3252if ( src && src.type ) {3253this.originalEvent = src;3254this.type = src.type;32553256// Events bubbling up the document may have been marked as prevented3257// by a handler lower down the tree; reflect the correct value.3258this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||3259src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;32603261// Event type3262} else {3263this.type = src;3264}32653266// Put explicitly provided properties onto the event object3267if ( props ) {3268jQuery.extend( this, props );3269}32703271// Create a timestamp if incoming event doesn't have one3272this.timeStamp = src && src.timeStamp || jQuery.now();32733274// Mark it as fixed3275this[ jQuery.expando ] = true;3276};32773278function returnFalse() {3279return false;3280}3281function returnTrue() {3282return true;3283}32843285// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding3286// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html3287jQuery.Event.prototype = {3288preventDefault: function() {3289this.isDefaultPrevented = returnTrue;32903291var e = this.originalEvent;3292if ( !e ) {3293return;3294}32953296// if preventDefault exists run it on the original event3297if ( e.preventDefault ) {3298e.preventDefault();32993300// otherwise set the returnValue property of the original event to false (IE)3301} else {3302e.returnValue = false;3303}3304},3305stopPropagation: function() {3306this.isPropagationStopped = returnTrue;33073308var e = this.originalEvent;3309if ( !e ) {3310return;3311}3312// if stopPropagation exists run it on the original event3313if ( e.stopPropagation ) {3314e.stopPropagation();3315}3316// otherwise set the cancelBubble property of the original event to true (IE)3317e.cancelBubble = true;3318},3319stopImmediatePropagation: function() {3320this.isImmediatePropagationStopped = returnTrue;3321this.stopPropagation();3322},3323isDefaultPrevented: returnFalse,3324isPropagationStopped: returnFalse,3325isImmediatePropagationStopped: returnFalse3326};33273328// Create mouseenter/leave events using mouseover/out and event-time checks3329jQuery.each({3330mouseenter: "mouseover",3331mouseleave: "mouseout"3332}, function( orig, fix ) {3333jQuery.event.special[ orig ] = {3334delegateType: fix,3335bindType: fix,33363337handle: function( event ) {3338var ret,3339target = this,3340related = event.relatedTarget,3341handleObj = event.handleObj,3342selector = handleObj.selector;33433344// For mousenter/leave call the handler if related is outside the target.3345// NB: No relatedTarget if the mouse left/entered the browser window3346if ( !related || (related !== target && !jQuery.contains( target, related )) ) {3347event.type = handleObj.origType;3348ret = handleObj.handler.apply( this, arguments );3349event.type = fix;3350}3351return ret;3352}3353};3354});33553356// IE submit delegation3357if ( !jQuery.support.submitBubbles ) {33583359jQuery.event.special.submit = {3360setup: function() {3361// Only need this for delegated form submit events3362if ( jQuery.nodeName( this, "form" ) ) {3363return false;3364}33653366// Lazy-add a submit handler when a descendant form may potentially be submitted3367jQuery.event.add( this, "click._submit keypress._submit", function( e ) {3368// Node name check avoids a VML-related crash in IE (#9807)3369var elem = e.target,3370form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;3371if ( form && !jQuery._data( form, "_submit_attached" ) ) {3372jQuery.event.add( form, "submit._submit", function( event ) {3373event._submit_bubble = true;3374});3375jQuery._data( form, "_submit_attached", true );3376}3377});3378// return undefined since we don't need an event listener3379},33803381postDispatch: function( event ) {3382// If form was submitted by the user, bubble the event up the tree3383if ( event._submit_bubble ) {3384delete event._submit_bubble;3385if ( this.parentNode && !event.isTrigger ) {3386jQuery.event.simulate( "submit", this.parentNode, event, true );3387}3388}3389},33903391teardown: function() {3392// Only need this for delegated form submit events3393if ( jQuery.nodeName( this, "form" ) ) {3394return false;3395}33963397// Remove delegated handlers; cleanData eventually reaps submit handlers attached above3398jQuery.event.remove( this, "._submit" );3399}3400};3401}34023403// IE change delegation and checkbox/radio fix3404if ( !jQuery.support.changeBubbles ) {34053406jQuery.event.special.change = {34073408setup: function() {34093410if ( rformElems.test( this.nodeName ) ) {3411// IE doesn't fire change on a check/radio until blur; trigger it on click3412// after a propertychange. Eat the blur-change in special.change.handle.3413// This still fires onchange a second time for check/radio after blur.3414if ( this.type === "checkbox" || this.type === "radio" ) {3415jQuery.event.add( this, "propertychange._change", function( event ) {3416if ( event.originalEvent.propertyName === "checked" ) {3417this._just_changed = true;3418}3419});3420jQuery.event.add( this, "click._change", function( event ) {3421if ( this._just_changed && !event.isTrigger ) {3422this._just_changed = false;3423}3424// Allow triggered, simulated change events (#11500)3425jQuery.event.simulate( "change", this, event, true );3426});3427}3428return false;3429}3430// Delegated event; lazy-add a change handler on descendant inputs3431jQuery.event.add( this, "beforeactivate._change", function( e ) {3432var elem = e.target;34333434if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {3435jQuery.event.add( elem, "change._change", function( event ) {3436if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {3437jQuery.event.simulate( "change", this.parentNode, event, true );3438}3439});3440jQuery._data( elem, "_change_attached", true );3441}3442});3443},34443445handle: function( event ) {3446var elem = event.target;34473448// Swallow native change events from checkbox/radio, we already triggered them above3449if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {3450return event.handleObj.handler.apply( this, arguments );3451}3452},34533454teardown: function() {3455jQuery.event.remove( this, "._change" );34563457return !rformElems.test( this.nodeName );3458}3459};3460}34613462// Create "bubbling" focus and blur events3463if ( !jQuery.support.focusinBubbles ) {3464jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {34653466// Attach a single capturing handler while someone wants focusin/focusout3467var attaches = 0,3468handler = function( event ) {3469jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );3470};34713472jQuery.event.special[ fix ] = {3473setup: function() {3474if ( attaches++ === 0 ) {3475document.addEventListener( orig, handler, true );3476}3477},3478teardown: function() {3479if ( --attaches === 0 ) {3480document.removeEventListener( orig, handler, true );3481}3482}3483};3484});3485}34863487jQuery.fn.extend({34883489on: function( types, selector, data, fn, /*INTERNAL*/ one ) {3490var origFn, type;34913492// Types can be a map of types/handlers3493if ( typeof types === "object" ) {3494// ( types-Object, selector, data )3495if ( typeof selector !== "string" ) { // && selector != null3496// ( types-Object, data )3497data = data || selector;3498selector = undefined;3499}3500for ( type in types ) {3501this.on( type, selector, data, types[ type ], one );3502}3503return this;3504}35053506if ( data == null && fn == null ) {3507// ( types, fn )3508fn = selector;3509data = selector = undefined;3510} else if ( fn == null ) {3511if ( typeof selector === "string" ) {3512// ( types, selector, fn )3513fn = data;3514data = undefined;3515} else {3516// ( types, data, fn )3517fn = data;3518data = selector;3519selector = undefined;3520}3521}3522if ( fn === false ) {3523fn = returnFalse;3524} else if ( !fn ) {3525return this;3526}35273528if ( one === 1 ) {3529origFn = fn;3530fn = function( event ) {3531// Can use an empty set, since event contains the info3532jQuery().off( event );3533return origFn.apply( this, arguments );3534};3535// Use same guid so caller can remove using origFn3536fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );3537}3538return this.each( function() {3539jQuery.event.add( this, types, fn, data, selector );3540});3541},3542one: function( types, selector, data, fn ) {3543return this.on( types, selector, data, fn, 1 );3544},3545off: function( types, selector, fn ) {3546var handleObj, type;3547if ( types && types.preventDefault && types.handleObj ) {3548// ( event ) dispatched jQuery.Event3549handleObj = types.handleObj;3550jQuery( types.delegateTarget ).off(3551handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,3552handleObj.selector,3553handleObj.handler3554);3555return this;3556}3557if ( typeof types === "object" ) {3558// ( types-object [, selector] )3559for ( type in types ) {3560this.off( type, selector, types[ type ] );3561}3562return this;3563}3564if ( selector === false || typeof selector === "function" ) {3565// ( types [, fn] )3566fn = selector;3567selector = undefined;3568}3569if ( fn === false ) {3570fn = returnFalse;3571}3572return this.each(function() {3573jQuery.event.remove( this, types, fn, selector );3574});3575},35763577bind: function( types, data, fn ) {3578return this.on( types, null, data, fn );3579},3580unbind: function( types, fn ) {3581return this.off( types, null, fn );3582},35833584live: function( types, data, fn ) {3585jQuery( this.context ).on( types, this.selector, data, fn );3586return this;3587},3588die: function( types, fn ) {3589jQuery( this.context ).off( types, this.selector || "**", fn );3590return this;3591},35923593delegate: function( selector, types, data, fn ) {3594return this.on( types, selector, data, fn );3595},3596undelegate: function( selector, types, fn ) {3597// ( namespace ) or ( selector, types [, fn] )3598return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );3599},36003601trigger: function( type, data ) {3602return this.each(function() {3603jQuery.event.trigger( type, data, this );3604});3605},3606triggerHandler: function( type, data ) {3607if ( this[0] ) {3608return jQuery.event.trigger( type, data, this[0], true );3609}3610},36113612toggle: function( fn ) {3613// Save reference to arguments for access in closure3614var args = arguments,3615guid = fn.guid || jQuery.guid++,3616i = 0,3617toggler = function( event ) {3618// Figure out which function to execute3619var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;3620jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );36213622// Make sure that clicks stop3623event.preventDefault();36243625// and execute the function3626return args[ lastToggle ].apply( this, arguments ) || false;3627};36283629// link all the functions, so any of them can unbind this click handler3630toggler.guid = guid;3631while ( i < args.length ) {3632args[ i++ ].guid = guid;3633}36343635return this.click( toggler );3636},36373638hover: function( fnOver, fnOut ) {3639return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );3640}3641});36423643jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +3644"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +3645"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {36463647// Handle event binding3648jQuery.fn[ name ] = function( data, fn ) {3649if ( fn == null ) {3650fn = data;3651data = null;3652}36533654return arguments.length > 0 ?3655this.on( name, null, data, fn ) :3656this.trigger( name );3657};36583659if ( rkeyEvent.test( name ) ) {3660jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;3661}36623663if ( rmouseEvent.test( name ) ) {3664jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;3665}3666});3667/*!3668* Sizzle CSS Selector Engine3669* Copyright 2012 jQuery Foundation and other contributors3670* Released under the MIT license3671* http://sizzlejs.com/3672*/3673(function( window, undefined ) {36743675var cachedruns,3676assertGetIdNotName,3677Expr,3678getText,3679isXML,3680contains,3681compile,3682sortOrder,3683hasDuplicate,3684outermostContext,36853686baseHasDuplicate = true,3687strundefined = "undefined",36883689expando = ( "sizcache" + Math.random() ).replace( ".", "" ),36903691Token = String,3692document = window.document,3693docElem = document.documentElement,3694dirruns = 0,3695done = 0,3696pop = [].pop,3697push = [].push,3698slice = [].slice,3699// Use a stripped-down indexOf if a native one is unavailable3700indexOf = [].indexOf || function( elem ) {3701var i = 0,3702len = this.length;3703for ( ; i < len; i++ ) {3704if ( this[i] === elem ) {3705return i;3706}3707}3708return -1;3709},37103711// Augment a function for special use by Sizzle3712markFunction = function( fn, value ) {3713fn[ expando ] = value == null || value;3714return fn;3715},37163717createCache = function() {3718var cache = {},3719keys = [];37203721return markFunction(function( key, value ) {3722// Only keep the most recent entries3723if ( keys.push( key ) > Expr.cacheLength ) {3724delete cache[ keys.shift() ];3725}37263727return (cache[ key ] = value);3728}, cache );3729},37303731classCache = createCache(),3732tokenCache = createCache(),3733compilerCache = createCache(),37343735// Regex37363737// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace3738whitespace = "[\\x20\\t\\r\\n\\f]",3739// http://www.w3.org/TR/css3-syntax/#characters3740characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",37413742// Loosely modeled on CSS identifier characters3743// An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)3744// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier3745identifier = characterEncoding.replace( "w", "w#" ),37463747// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors3748operators = "([*^$|!~]?=)",3749attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +3750"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",37513752// Prefer arguments not in parens/brackets,3753// then attribute selectors and non-pseudos (denoted by :),3754// then anything else3755// These preferences are here to reduce the number of selectors3756// needing tokenize in the PSEUDO preFilter3757pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",37583759// For matchExpr.POS and matchExpr.needsContext3760pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +3761"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",37623763// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter3764rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),37653766rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),3767rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),3768rpseudo = new RegExp( pseudos ),37693770// Easily-parseable/retrievable ID or TAG or CLASS selectors3771rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,37723773rnot = /^:not/,3774rsibling = /[\x20\t\r\n\f]*[+~]/,3775rendsWithNot = /:not\($/,37763777rheader = /h\d/i,3778rinputs = /input|select|textarea|button/i,37793780rbackslash = /\\(?!\\)/g,37813782matchExpr = {3783"ID": new RegExp( "^#(" + characterEncoding + ")" ),3784"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),3785"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),3786"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),3787"ATTR": new RegExp( "^" + attributes ),3788"PSEUDO": new RegExp( "^" + pseudos ),3789"POS": new RegExp( pos, "i" ),3790"CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +3791"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +3792"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),3793// For use in libraries implementing .is()3794"needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )3795},37963797// Support37983799// Used for testing something on an element3800assert = function( fn ) {3801var div = document.createElement("div");38023803try {3804return fn( div );3805} catch (e) {3806return false;3807} finally {3808// release memory in IE3809div = null;3810}3811},38123813// Check if getElementsByTagName("*") returns only elements3814assertTagNameNoComments = assert(function( div ) {3815div.appendChild( document.createComment("") );3816return !div.getElementsByTagName("*").length;3817}),38183819// Check if getAttribute returns normalized href attributes3820assertHrefNotNormalized = assert(function( div ) {3821div.innerHTML = "<a href='#'></a>";3822return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&3823div.firstChild.getAttribute("href") === "#";3824}),38253826// Check if attributes should be retrieved by attribute nodes3827assertAttributes = assert(function( div ) {3828div.innerHTML = "<select></select>";3829var type = typeof div.lastChild.getAttribute("multiple");3830// IE8 returns a string for some attributes even when not present3831return type !== "boolean" && type !== "string";3832}),38333834// Check if getElementsByClassName can be trusted3835assertUsableClassName = assert(function( div ) {3836// Opera can't find a second classname (in 9.6)3837div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";3838if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {3839return false;3840}38413842// Safari 3.2 caches class attributes and doesn't catch changes3843div.lastChild.className = "e";3844return div.getElementsByClassName("e").length === 2;3845}),38463847// Check if getElementById returns elements by name3848// Check if getElementsByName privileges form controls or returns elements by ID3849assertUsableName = assert(function( div ) {3850// Inject content3851div.id = expando + 0;3852div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";3853docElem.insertBefore( div, docElem.firstChild );38543855// Test3856var pass = document.getElementsByName &&3857// buggy browsers will return fewer than the correct 23858document.getElementsByName( expando ).length === 2 +3859// buggy browsers will return more than the correct 03860document.getElementsByName( expando + 0 ).length;3861assertGetIdNotName = !document.getElementById( expando );38623863// Cleanup3864docElem.removeChild( div );38653866return pass;3867});38683869// If slice is not available, provide a backup3870try {3871slice.call( docElem.childNodes, 0 )[0].nodeType;3872} catch ( e ) {3873slice = function( i ) {3874var elem,3875results = [];3876for ( ; (elem = this[i]); i++ ) {3877results.push( elem );3878}3879return results;3880};3881}38823883function Sizzle( selector, context, results, seed ) {3884results = results || [];3885context = context || document;3886var match, elem, xml, m,3887nodeType = context.nodeType;38883889if ( !selector || typeof selector !== "string" ) {3890return results;3891}38923893if ( nodeType !== 1 && nodeType !== 9 ) {3894return [];3895}38963897xml = isXML( context );38983899if ( !xml && !seed ) {3900if ( (match = rquickExpr.exec( selector )) ) {3901// Speed-up: Sizzle("#ID")3902if ( (m = match[1]) ) {3903if ( nodeType === 9 ) {3904elem = context.getElementById( m );3905// Check parentNode to catch when Blackberry 4.6 returns3906// nodes that are no longer in the document #69633907if ( elem && elem.parentNode ) {3908// Handle the case where IE, Opera, and Webkit return items3909// by name instead of ID3910if ( elem.id === m ) {3911results.push( elem );3912return results;3913}3914} else {3915return results;3916}3917} else {3918// Context is not a document3919if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&3920contains( context, elem ) && elem.id === m ) {3921results.push( elem );3922return results;3923}3924}39253926// Speed-up: Sizzle("TAG")3927} else if ( match[2] ) {3928push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );3929return results;39303931// Speed-up: Sizzle(".CLASS")3932} else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {3933push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );3934return results;3935}3936}3937}39383939// All others3940return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );3941}39423943Sizzle.matches = function( expr, elements ) {3944return Sizzle( expr, null, null, elements );3945};39463947Sizzle.matchesSelector = function( elem, expr ) {3948return Sizzle( expr, null, null, [ elem ] ).length > 0;3949};39503951// Returns a function to use in pseudos for input types3952function createInputPseudo( type ) {3953return function( elem ) {3954var name = elem.nodeName.toLowerCase();3955return name === "input" && elem.type === type;3956};3957}39583959// Returns a function to use in pseudos for buttons3960function createButtonPseudo( type ) {3961return function( elem ) {3962var name = elem.nodeName.toLowerCase();3963return (name === "input" || name === "button") && elem.type === type;3964};3965}39663967// Returns a function to use in pseudos for positionals3968function createPositionalPseudo( fn ) {3969return markFunction(function( argument ) {3970argument = +argument;3971return markFunction(function( seed, matches ) {3972var j,3973matchIndexes = fn( [], seed.length, argument ),3974i = matchIndexes.length;39753976// Match elements found at the specified indexes3977while ( i-- ) {3978if ( seed[ (j = matchIndexes[i]) ] ) {3979seed[j] = !(matches[j] = seed[j]);3980}3981}3982});3983});3984}39853986/**3987* Utility function for retrieving the text value of an array of DOM nodes3988* @param {Array|Element} elem3989*/3990getText = Sizzle.getText = function( elem ) {3991var node,3992ret = "",3993i = 0,3994nodeType = elem.nodeType;39953996if ( nodeType ) {3997if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {3998// Use textContent for elements3999// innerText usage removed for consistency of new lines (see #11153)4000if ( typeof elem.textContent === "string" ) {4001return elem.textContent;4002} else {4003// Traverse its children4004for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {4005ret += getText( elem );4006}4007}4008} else if ( nodeType === 3 || nodeType === 4 ) {4009return elem.nodeValue;4010}4011// Do not include comment or processing instruction nodes4012} else {40134014// If no nodeType, this is expected to be an array4015for ( ; (node = elem[i]); i++ ) {4016// Do not traverse comment nodes4017ret += getText( node );4018}4019}4020return ret;4021};40224023isXML = Sizzle.isXML = function( elem ) {4024// documentElement is verified for cases where it doesn't yet exist4025// (such as loading iframes in IE - #4833)4026var documentElement = elem && (elem.ownerDocument || elem).documentElement;4027return documentElement ? documentElement.nodeName !== "HTML" : false;4028};40294030// Element contains another4031contains = Sizzle.contains = docElem.contains ?4032function( a, b ) {4033var adown = a.nodeType === 9 ? a.documentElement : a,4034bup = b && b.parentNode;4035return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );4036} :4037docElem.compareDocumentPosition ?4038function( a, b ) {4039return b && !!( a.compareDocumentPosition( b ) & 16 );4040} :4041function( a, b ) {4042while ( (b = b.parentNode) ) {4043if ( b === a ) {4044return true;4045}4046}4047return false;4048};40494050Sizzle.attr = function( elem, name ) {4051var val,4052xml = isXML( elem );40534054if ( !xml ) {4055name = name.toLowerCase();4056}4057if ( (val = Expr.attrHandle[ name ]) ) {4058return val( elem );4059}4060if ( xml || assertAttributes ) {4061return elem.getAttribute( name );4062}4063val = elem.getAttributeNode( name );4064return val ?4065typeof elem[ name ] === "boolean" ?4066elem[ name ] ? name : null :4067val.specified ? val.value : null :4068null;4069};40704071Expr = Sizzle.selectors = {40724073// Can be adjusted by the user4074cacheLength: 50,40754076createPseudo: markFunction,40774078match: matchExpr,40794080// IE6/7 return a modified href4081attrHandle: assertHrefNotNormalized ?4082{} :4083{4084"href": function( elem ) {4085return elem.getAttribute( "href", 2 );4086},4087"type": function( elem ) {4088return elem.getAttribute("type");4089}4090},40914092find: {4093"ID": assertGetIdNotName ?4094function( id, context, xml ) {4095if ( typeof context.getElementById !== strundefined && !xml ) {4096var m = context.getElementById( id );4097// Check parentNode to catch when Blackberry 4.6 returns4098// nodes that are no longer in the document #69634099return m && m.parentNode ? [m] : [];4100}4101} :4102function( id, context, xml ) {4103if ( typeof context.getElementById !== strundefined && !xml ) {4104var m = context.getElementById( id );41054106return m ?4107m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?4108[m] :4109undefined :4110[];4111}4112},41134114"TAG": assertTagNameNoComments ?4115function( tag, context ) {4116if ( typeof context.getElementsByTagName !== strundefined ) {4117return context.getElementsByTagName( tag );4118}4119} :4120function( tag, context ) {4121var results = context.getElementsByTagName( tag );41224123// Filter out possible comments4124if ( tag === "*" ) {4125var elem,4126tmp = [],4127i = 0;41284129for ( ; (elem = results[i]); i++ ) {4130if ( elem.nodeType === 1 ) {4131tmp.push( elem );4132}4133}41344135return tmp;4136}4137return results;4138},41394140"NAME": assertUsableName && function( tag, context ) {4141if ( typeof context.getElementsByName !== strundefined ) {4142return context.getElementsByName( name );4143}4144},41454146"CLASS": assertUsableClassName && function( className, context, xml ) {4147if ( typeof context.getElementsByClassName !== strundefined && !xml ) {4148return context.getElementsByClassName( className );4149}4150}4151},41524153relative: {4154">": { dir: "parentNode", first: true },4155" ": { dir: "parentNode" },4156"+": { dir: "previousSibling", first: true },4157"~": { dir: "previousSibling" }4158},41594160preFilter: {4161"ATTR": function( match ) {4162match[1] = match[1].replace( rbackslash, "" );41634164// Move the given value to match[3] whether quoted or unquoted4165match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );41664167if ( match[2] === "~=" ) {4168match[3] = " " + match[3] + " ";4169}41704171return match.slice( 0, 4 );4172},41734174"CHILD": function( match ) {4175/* matches from matchExpr["CHILD"]41761 type (only|nth|...)41772 argument (even|odd|\d*|\d*n([+-]\d+)?|...)41783 xn-component of xn+y argument ([+-]?\d*n|)41794 sign of xn-component41805 x of xn-component41816 sign of y-component41827 y of y-component4183*/4184match[1] = match[1].toLowerCase();41854186if ( match[1] === "nth" ) {4187// nth-child requires argument4188if ( !match[2] ) {4189Sizzle.error( match[0] );4190}41914192// numeric x and y parameters for Expr.filter.CHILD4193// remember that false/true cast respectively to 0/14194match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );4195match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );41964197// other types prohibit arguments4198} else if ( match[2] ) {4199Sizzle.error( match[0] );4200}42014202return match;4203},42044205"PSEUDO": function( match ) {4206var unquoted, excess;4207if ( matchExpr["CHILD"].test( match[0] ) ) {4208return null;4209}42104211if ( match[3] ) {4212match[2] = match[3];4213} else if ( (unquoted = match[4]) ) {4214// Only check arguments that contain a pseudo4215if ( rpseudo.test(unquoted) &&4216// Get excess from tokenize (recursively)4217(excess = tokenize( unquoted, true )) &&4218// advance to the next closing parenthesis4219(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {42204221// excess is a negative index4222unquoted = unquoted.slice( 0, excess );4223match[0] = match[0].slice( 0, excess );4224}4225match[2] = unquoted;4226}42274228// Return only captures needed by the pseudo filter method (type and argument)4229return match.slice( 0, 3 );4230}4231},42324233filter: {4234"ID": assertGetIdNotName ?4235function( id ) {4236id = id.replace( rbackslash, "" );4237return function( elem ) {4238return elem.getAttribute("id") === id;4239};4240} :4241function( id ) {4242id = id.replace( rbackslash, "" );4243return function( elem ) {4244var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");4245return node && node.value === id;4246};4247},42484249"TAG": function( nodeName ) {4250if ( nodeName === "*" ) {4251return function() { return true; };4252}4253nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();42544255return function( elem ) {4256return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;4257};4258},42594260"CLASS": function( className ) {4261var pattern = classCache[ expando ][ className ];4262if ( !pattern ) {4263pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );4264}4265return function( elem ) {4266return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );4267};4268},42694270"ATTR": function( name, operator, check ) {4271return function( elem, context ) {4272var result = Sizzle.attr( elem, name );42734274if ( result == null ) {4275return operator === "!=";4276}4277if ( !operator ) {4278return true;4279}42804281result += "";42824283return operator === "=" ? result === check :4284operator === "!=" ? result !== check :4285operator === "^=" ? check && result.indexOf( check ) === 0 :4286operator === "*=" ? check && result.indexOf( check ) > -1 :4287operator === "$=" ? check && result.substr( result.length - check.length ) === check :4288operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :4289operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :4290false;4291};4292},42934294"CHILD": function( type, argument, first, last ) {42954296if ( type === "nth" ) {4297return function( elem ) {4298var node, diff,4299parent = elem.parentNode;43004301if ( first === 1 && last === 0 ) {4302return true;4303}43044305if ( parent ) {4306diff = 0;4307for ( node = parent.firstChild; node; node = node.nextSibling ) {4308if ( node.nodeType === 1 ) {4309diff++;4310if ( elem === node ) {4311break;4312}4313}4314}4315}43164317// Incorporate the offset (or cast to NaN), then check against cycle size4318diff -= last;4319return diff === first || ( diff % first === 0 && diff / first >= 0 );4320};4321}43224323return function( elem ) {4324var node = elem;43254326switch ( type ) {4327case "only":4328case "first":4329while ( (node = node.previousSibling) ) {4330if ( node.nodeType === 1 ) {4331return false;4332}4333}43344335if ( type === "first" ) {4336return true;4337}43384339node = elem;43404341/* falls through */4342case "last":4343while ( (node = node.nextSibling) ) {4344if ( node.nodeType === 1 ) {4345return false;4346}4347}43484349return true;4350}4351};4352},43534354"PSEUDO": function( pseudo, argument ) {4355// pseudo-class names are case-insensitive4356// http://www.w3.org/TR/selectors/#pseudo-classes4357// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters4358// Remember that setFilters inherits from pseudos4359var args,4360fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||4361Sizzle.error( "unsupported pseudo: " + pseudo );43624363// The user may use createPseudo to indicate that4364// arguments are needed to create the filter function4365// just as Sizzle does4366if ( fn[ expando ] ) {4367return fn( argument );4368}43694370// But maintain support for old signatures4371if ( fn.length > 1 ) {4372args = [ pseudo, pseudo, "", argument ];4373return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?4374markFunction(function( seed, matches ) {4375var idx,4376matched = fn( seed, argument ),4377i = matched.length;4378while ( i-- ) {4379idx = indexOf.call( seed, matched[i] );4380seed[ idx ] = !( matches[ idx ] = matched[i] );4381}4382}) :4383function( elem ) {4384return fn( elem, 0, args );4385};4386}43874388return fn;4389}4390},43914392pseudos: {4393"not": markFunction(function( selector ) {4394// Trim the selector passed to compile4395// to avoid treating leading and trailing4396// spaces as combinators4397var input = [],4398results = [],4399matcher = compile( selector.replace( rtrim, "$1" ) );44004401return matcher[ expando ] ?4402markFunction(function( seed, matches, context, xml ) {4403var elem,4404unmatched = matcher( seed, null, xml, [] ),4405i = seed.length;44064407// Match elements unmatched by `matcher`4408while ( i-- ) {4409if ( (elem = unmatched[i]) ) {4410seed[i] = !(matches[i] = elem);4411}4412}4413}) :4414function( elem, context, xml ) {4415input[0] = elem;4416matcher( input, null, xml, results );4417return !results.pop();4418};4419}),44204421"has": markFunction(function( selector ) {4422return function( elem ) {4423return Sizzle( selector, elem ).length > 0;4424};4425}),44264427"contains": markFunction(function( text ) {4428return function( elem ) {4429return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;4430};4431}),44324433"enabled": function( elem ) {4434return elem.disabled === false;4435},44364437"disabled": function( elem ) {4438return elem.disabled === true;4439},44404441"checked": function( elem ) {4442// In CSS3, :checked should return both checked and selected elements4443// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked4444var nodeName = elem.nodeName.toLowerCase();4445return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);4446},44474448"selected": function( elem ) {4449// Accessing this property makes selected-by-default4450// options in Safari work properly4451if ( elem.parentNode ) {4452elem.parentNode.selectedIndex;4453}44544455return elem.selected === true;4456},44574458"parent": function( elem ) {4459return !Expr.pseudos["empty"]( elem );4460},44614462"empty": function( elem ) {4463// http://www.w3.org/TR/selectors/#empty-pseudo4464// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),4465// not comment, processing instructions, or others4466// Thanks to Diego Perini for the nodeName shortcut4467// Greater than "@" means alpha characters (specifically not starting with "#" or "?")4468var nodeType;4469elem = elem.firstChild;4470while ( elem ) {4471if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {4472return false;4473}4474elem = elem.nextSibling;4475}4476return true;4477},44784479"header": function( elem ) {4480return rheader.test( elem.nodeName );4481},44824483"text": function( elem ) {4484var type, attr;4485// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)4486// use getAttribute instead to test this case4487return elem.nodeName.toLowerCase() === "input" &&4488(type = elem.type) === "text" &&4489( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );4490},44914492// Input types4493"radio": createInputPseudo("radio"),4494"checkbox": createInputPseudo("checkbox"),4495"file": createInputPseudo("file"),4496"password": createInputPseudo("password"),4497"image": createInputPseudo("image"),44984499"submit": createButtonPseudo("submit"),4500"reset": createButtonPseudo("reset"),45014502"button": function( elem ) {4503var name = elem.nodeName.toLowerCase();4504return name === "input" && elem.type === "button" || name === "button";4505},45064507"input": function( elem ) {4508return rinputs.test( elem.nodeName );4509},45104511"focus": function( elem ) {4512var doc = elem.ownerDocument;4513return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);4514},45154516"active": function( elem ) {4517return elem === elem.ownerDocument.activeElement;4518},45194520// Positional types4521"first": createPositionalPseudo(function( matchIndexes, length, argument ) {4522return [ 0 ];4523}),45244525"last": createPositionalPseudo(function( matchIndexes, length, argument ) {4526return [ length - 1 ];4527}),45284529"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {4530return [ argument < 0 ? argument + length : argument ];4531}),45324533"even": createPositionalPseudo(function( matchIndexes, length, argument ) {4534for ( var i = 0; i < length; i += 2 ) {4535matchIndexes.push( i );4536}4537return matchIndexes;4538}),45394540"odd": createPositionalPseudo(function( matchIndexes, length, argument ) {4541for ( var i = 1; i < length; i += 2 ) {4542matchIndexes.push( i );4543}4544return matchIndexes;4545}),45464547"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {4548for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {4549matchIndexes.push( i );4550}4551return matchIndexes;4552}),45534554"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {4555for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {4556matchIndexes.push( i );4557}4558return matchIndexes;4559})4560}4561};45624563function siblingCheck( a, b, ret ) {4564if ( a === b ) {4565return ret;4566}45674568var cur = a.nextSibling;45694570while ( cur ) {4571if ( cur === b ) {4572return -1;4573}45744575cur = cur.nextSibling;4576}45774578return 1;4579}45804581sortOrder = docElem.compareDocumentPosition ?4582function( a, b ) {4583if ( a === b ) {4584hasDuplicate = true;4585return 0;4586}45874588return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?4589a.compareDocumentPosition :4590a.compareDocumentPosition(b) & 44591) ? -1 : 1;4592} :4593function( a, b ) {4594// The nodes are identical, we can exit early4595if ( a === b ) {4596hasDuplicate = true;4597return 0;45984599// Fallback to using sourceIndex (in IE) if it's available on both nodes4600} else if ( a.sourceIndex && b.sourceIndex ) {4601return a.sourceIndex - b.sourceIndex;4602}46034604var al, bl,4605ap = [],4606bp = [],4607aup = a.parentNode,4608bup = b.parentNode,4609cur = aup;46104611// If the nodes are siblings (or identical) we can do a quick check4612if ( aup === bup ) {4613return siblingCheck( a, b );46144615// If no parents were found then the nodes are disconnected4616} else if ( !aup ) {4617return -1;46184619} else if ( !bup ) {4620return 1;4621}46224623// Otherwise they're somewhere else in the tree so we need4624// to build up a full list of the parentNodes for comparison4625while ( cur ) {4626ap.unshift( cur );4627cur = cur.parentNode;4628}46294630cur = bup;46314632while ( cur ) {4633bp.unshift( cur );4634cur = cur.parentNode;4635}46364637al = ap.length;4638bl = bp.length;46394640// Start walking down the tree looking for a discrepancy4641for ( var i = 0; i < al && i < bl; i++ ) {4642if ( ap[i] !== bp[i] ) {4643return siblingCheck( ap[i], bp[i] );4644}4645}46464647// We ended someplace up the tree so do a sibling check4648return i === al ?4649siblingCheck( a, bp[i], -1 ) :4650siblingCheck( ap[i], b, 1 );4651};46524653// Always assume the presence of duplicates if sort doesn't4654// pass them to our comparison function (as in Google Chrome).4655[0, 0].sort( sortOrder );4656baseHasDuplicate = !hasDuplicate;46574658// Document sorting and removing duplicates4659Sizzle.uniqueSort = function( results ) {4660var elem,4661i = 1;46624663hasDuplicate = baseHasDuplicate;4664results.sort( sortOrder );46654666if ( hasDuplicate ) {4667for ( ; (elem = results[i]); i++ ) {4668if ( elem === results[ i - 1 ] ) {4669results.splice( i--, 1 );4670}4671}4672}46734674return results;4675};46764677Sizzle.error = function( msg ) {4678throw new Error( "Syntax error, unrecognized expression: " + msg );4679};46804681function tokenize( selector, parseOnly ) {4682var matched, match, tokens, type, soFar, groups, preFilters,4683cached = tokenCache[ expando ][ selector ];46844685if ( cached ) {4686return parseOnly ? 0 : cached.slice( 0 );4687}46884689soFar = selector;4690groups = [];4691preFilters = Expr.preFilter;46924693while ( soFar ) {46944695// Comma and first run4696if ( !matched || (match = rcomma.exec( soFar )) ) {4697if ( match ) {4698soFar = soFar.slice( match[0].length );4699}4700groups.push( tokens = [] );4701}47024703matched = false;47044705// Combinators4706if ( (match = rcombinators.exec( soFar )) ) {4707tokens.push( matched = new Token( match.shift() ) );4708soFar = soFar.slice( matched.length );47094710// Cast descendant combinators to space4711matched.type = match[0].replace( rtrim, " " );4712}47134714// Filters4715for ( type in Expr.filter ) {4716if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||4717// The last two arguments here are (context, xml) for backCompat4718(match = preFilters[ type ]( match, document, true ))) ) {47194720tokens.push( matched = new Token( match.shift() ) );4721soFar = soFar.slice( matched.length );4722matched.type = type;4723matched.matches = match;4724}4725}47264727if ( !matched ) {4728break;4729}4730}47314732// Return the length of the invalid excess4733// if we're just parsing4734// Otherwise, throw an error or return tokens4735return parseOnly ?4736soFar.length :4737soFar ?4738Sizzle.error( selector ) :4739// Cache the tokens4740tokenCache( selector, groups ).slice( 0 );4741}47424743function addCombinator( matcher, combinator, base ) {4744var dir = combinator.dir,4745checkNonElements = base && combinator.dir === "parentNode",4746doneName = done++;47474748return combinator.first ?4749// Check against closest ancestor/preceding element4750function( elem, context, xml ) {4751while ( (elem = elem[ dir ]) ) {4752if ( checkNonElements || elem.nodeType === 1 ) {4753return matcher( elem, context, xml );4754}4755}4756} :47574758// Check against all ancestor/preceding elements4759function( elem, context, xml ) {4760// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching4761if ( !xml ) {4762var cache,4763dirkey = dirruns + " " + doneName + " ",4764cachedkey = dirkey + cachedruns;4765while ( (elem = elem[ dir ]) ) {4766if ( checkNonElements || elem.nodeType === 1 ) {4767if ( (cache = elem[ expando ]) === cachedkey ) {4768return elem.sizset;4769} else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {4770if ( elem.sizset ) {4771return elem;4772}4773} else {4774elem[ expando ] = cachedkey;4775if ( matcher( elem, context, xml ) ) {4776elem.sizset = true;4777return elem;4778}4779elem.sizset = false;4780}4781}4782}4783} else {4784while ( (elem = elem[ dir ]) ) {4785if ( checkNonElements || elem.nodeType === 1 ) {4786if ( matcher( elem, context, xml ) ) {4787return elem;4788}4789}4790}4791}4792};4793}47944795function elementMatcher( matchers ) {4796return matchers.length > 1 ?4797function( elem, context, xml ) {4798var i = matchers.length;4799while ( i-- ) {4800if ( !matchers[i]( elem, context, xml ) ) {4801return false;4802}4803}4804return true;4805} :4806matchers[0];4807}48084809function condense( unmatched, map, filter, context, xml ) {4810var elem,4811newUnmatched = [],4812i = 0,4813len = unmatched.length,4814mapped = map != null;48154816for ( ; i < len; i++ ) {4817if ( (elem = unmatched[i]) ) {4818if ( !filter || filter( elem, context, xml ) ) {4819newUnmatched.push( elem );4820if ( mapped ) {4821map.push( i );4822}4823}4824}4825}48264827return newUnmatched;4828}48294830function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {4831if ( postFilter && !postFilter[ expando ] ) {4832postFilter = setMatcher( postFilter );4833}4834if ( postFinder && !postFinder[ expando ] ) {4835postFinder = setMatcher( postFinder, postSelector );4836}4837return markFunction(function( seed, results, context, xml ) {4838// Positional selectors apply to seed elements, so it is invalid to follow them with relative ones4839if ( seed && postFinder ) {4840return;4841}48424843var i, elem, postFilterIn,4844preMap = [],4845postMap = [],4846preexisting = results.length,48474848// Get initial elements from seed or context4849elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),48504851// Prefilter to get matcher input, preserving a map for seed-results synchronization4852matcherIn = preFilter && ( seed || !selector ) ?4853condense( elems, preMap, preFilter, context, xml ) :4854elems,48554856matcherOut = matcher ?4857// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,4858postFinder || ( seed ? preFilter : preexisting || postFilter ) ?48594860// ...intermediate processing is necessary4861[] :48624863// ...otherwise use results directly4864results :4865matcherIn;48664867// Find primary matches4868if ( matcher ) {4869matcher( matcherIn, matcherOut, context, xml );4870}48714872// Apply postFilter4873if ( postFilter ) {4874postFilterIn = condense( matcherOut, postMap );4875postFilter( postFilterIn, [], context, xml );48764877// Un-match failing elements by moving them back to matcherIn4878i = postFilterIn.length;4879while ( i-- ) {4880if ( (elem = postFilterIn[i]) ) {4881matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);4882}4883}4884}48854886// Keep seed and results synchronized4887if ( seed ) {4888// Ignore postFinder because it can't coexist with seed4889i = preFilter && matcherOut.length;4890while ( i-- ) {4891if ( (elem = matcherOut[i]) ) {4892seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);4893}4894}4895} else {4896matcherOut = condense(4897matcherOut === results ?4898matcherOut.splice( preexisting, matcherOut.length ) :4899matcherOut4900);4901if ( postFinder ) {4902postFinder( null, results, matcherOut, xml );4903} else {4904push.apply( results, matcherOut );4905}4906}4907});4908}49094910function matcherFromTokens( tokens ) {4911var checkContext, matcher, j,4912len = tokens.length,4913leadingRelative = Expr.relative[ tokens[0].type ],4914implicitRelative = leadingRelative || Expr.relative[" "],4915i = leadingRelative ? 1 : 0,49164917// The foundational matcher ensures that elements are reachable from top-level context(s)4918matchContext = addCombinator( function( elem ) {4919return elem === checkContext;4920}, implicitRelative, true ),4921matchAnyContext = addCombinator( function( elem ) {4922return indexOf.call( checkContext, elem ) > -1;4923}, implicitRelative, true ),4924matchers = [ function( elem, context, xml ) {4925return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (4926(checkContext = context).nodeType ?4927matchContext( elem, context, xml ) :4928matchAnyContext( elem, context, xml ) );4929} ];49304931for ( ; i < len; i++ ) {4932if ( (matcher = Expr.relative[ tokens[i].type ]) ) {4933matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];4934} else {4935// The concatenated values are (context, xml) for backCompat4936matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );49374938// Return special upon seeing a positional matcher4939if ( matcher[ expando ] ) {4940// Find the next relative operator (if any) for proper handling4941j = ++i;4942for ( ; j < len; j++ ) {4943if ( Expr.relative[ tokens[j].type ] ) {4944break;4945}4946}4947return setMatcher(4948i > 1 && elementMatcher( matchers ),4949i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),4950matcher,4951i < j && matcherFromTokens( tokens.slice( i, j ) ),4952j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),4953j < len && tokens.join("")4954);4955}4956matchers.push( matcher );4957}4958}49594960return elementMatcher( matchers );4961}49624963function matcherFromGroupMatchers( elementMatchers, setMatchers ) {4964var bySet = setMatchers.length > 0,4965byElement = elementMatchers.length > 0,4966superMatcher = function( seed, context, xml, results, expandContext ) {4967var elem, j, matcher,4968setMatched = [],4969matchedCount = 0,4970i = "0",4971unmatched = seed && [],4972outermost = expandContext != null,4973contextBackup = outermostContext,4974// We must always have either seed elements or context4975elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),4976// Nested matchers should use non-integer dirruns4977dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);49784979if ( outermost ) {4980outermostContext = context !== document && context;4981cachedruns = superMatcher.el;4982}49834984// Add elements passing elementMatchers directly to results4985for ( ; (elem = elems[i]) != null; i++ ) {4986if ( byElement && elem ) {4987for ( j = 0; (matcher = elementMatchers[j]); j++ ) {4988if ( matcher( elem, context, xml ) ) {4989results.push( elem );4990break;4991}4992}4993if ( outermost ) {4994dirruns = dirrunsUnique;4995cachedruns = ++superMatcher.el;4996}4997}49984999// Track unmatched elements for set filters5000if ( bySet ) {5001// They will have gone through all possible matchers5002if ( (elem = !matcher && elem) ) {5003matchedCount--;5004}50055006// Lengthen the array for every element, matched or not5007if ( seed ) {5008unmatched.push( elem );5009}5010}5011}50125013// Apply set filters to unmatched elements5014matchedCount += i;5015if ( bySet && i !== matchedCount ) {5016for ( j = 0; (matcher = setMatchers[j]); j++ ) {5017matcher( unmatched, setMatched, context, xml );5018}50195020if ( seed ) {5021// Reintegrate element matches to eliminate the need for sorting5022if ( matchedCount > 0 ) {5023while ( i-- ) {5024if ( !(unmatched[i] || setMatched[i]) ) {5025setMatched[i] = pop.call( results );5026}5027}5028}50295030// Discard index placeholder values to get only actual matches5031setMatched = condense( setMatched );5032}50335034// Add matches to results5035push.apply( results, setMatched );50365037// Seedless set matches succeeding multiple successful matchers stipulate sorting5038if ( outermost && !seed && setMatched.length > 0 &&5039( matchedCount + setMatchers.length ) > 1 ) {50405041Sizzle.uniqueSort( results );5042}5043}50445045// Override manipulation of globals by nested matchers5046if ( outermost ) {5047dirruns = dirrunsUnique;5048outermostContext = contextBackup;5049}50505051return unmatched;5052};50535054superMatcher.el = 0;5055return bySet ?5056markFunction( superMatcher ) :5057superMatcher;5058}50595060compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {5061var i,5062setMatchers = [],5063elementMatchers = [],5064cached = compilerCache[ expando ][ selector ];50655066if ( !cached ) {5067// Generate a function of recursive functions that can be used to check each element5068if ( !group ) {5069group = tokenize( selector );5070}5071i = group.length;5072while ( i-- ) {5073cached = matcherFromTokens( group[i] );5074if ( cached[ expando ] ) {5075setMatchers.push( cached );5076} else {5077elementMatchers.push( cached );5078}5079}50805081// Cache the compiled function5082cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );5083}5084return cached;5085};50865087function multipleContexts( selector, contexts, results, seed ) {5088var i = 0,5089len = contexts.length;5090for ( ; i < len; i++ ) {5091Sizzle( selector, contexts[i], results, seed );5092}5093return results;5094}50955096function select( selector, context, results, seed, xml ) {5097var i, tokens, token, type, find,5098match = tokenize( selector ),5099j = match.length;51005101if ( !seed ) {5102// Try to minimize operations if there is only one group5103if ( match.length === 1 ) {51045105// Take a shortcut and set the context if the root selector is an ID5106tokens = match[0] = match[0].slice( 0 );5107if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&5108context.nodeType === 9 && !xml &&5109Expr.relative[ tokens[1].type ] ) {51105111context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];5112if ( !context ) {5113return results;5114}51155116selector = selector.slice( tokens.shift().length );5117}51185119// Fetch a seed set for right-to-left matching5120for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {5121token = tokens[i];51225123// Abort if we hit a combinator5124if ( Expr.relative[ (type = token.type) ] ) {5125break;5126}5127if ( (find = Expr.find[ type ]) ) {5128// Search, expanding context for leading sibling combinators5129if ( (seed = find(5130token.matches[0].replace( rbackslash, "" ),5131rsibling.test( tokens[0].type ) && context.parentNode || context,5132xml5133)) ) {51345135// If seed is empty or no tokens remain, we can return early5136tokens.splice( i, 1 );5137selector = seed.length && tokens.join("");5138if ( !selector ) {5139push.apply( results, slice.call( seed, 0 ) );5140return results;5141}51425143break;5144}5145}5146}5147}5148}51495150// Compile and execute a filtering function5151// Provide `match` to avoid retokenization if we modified the selector above5152compile( selector, match )(5153seed,5154context,5155xml,5156results,5157rsibling.test( selector )5158);5159return results;5160}51615162if ( document.querySelectorAll ) {5163(function() {5164var disconnectedMatch,5165oldSelect = select,5166rescape = /'|\\/g,5167rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,51685169// qSa(:focus) reports false when true (Chrome 21),5170// A support test would require too much code (would include document ready)5171rbuggyQSA = [":focus"],51725173// matchesSelector(:focus) reports false when true (Chrome 21),5174// matchesSelector(:active) reports false when true (IE9/Opera 11.5)5175// A support test would require too much code (would include document ready)5176// just skip matchesSelector for :active5177rbuggyMatches = [ ":active", ":focus" ],5178matches = docElem.matchesSelector ||5179docElem.mozMatchesSelector ||5180docElem.webkitMatchesSelector ||5181docElem.oMatchesSelector ||5182docElem.msMatchesSelector;51835184// Build QSA regex5185// Regex strategy adopted from Diego Perini5186assert(function( div ) {5187// Select is set to empty string on purpose5188// This is to test IE's treatment of not explictly5189// setting a boolean content attribute,5190// since its presence should be enough5191// http://bugs.jquery.com/ticket/123595192div.innerHTML = "<select><option selected=''></option></select>";51935194// IE8 - Some boolean attributes are not treated correctly5195if ( !div.querySelectorAll("[selected]").length ) {5196rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );5197}51985199// Webkit/Opera - :checked should return selected option elements5200// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked5201// IE8 throws error here (do not put tests after this one)5202if ( !div.querySelectorAll(":checked").length ) {5203rbuggyQSA.push(":checked");5204}5205});52065207assert(function( div ) {52085209// Opera 10-12/IE9 - ^= $= *= and empty values5210// Should not select anything5211div.innerHTML = "<p test=''></p>";5212if ( div.querySelectorAll("[test^='']").length ) {5213rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );5214}52155216// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)5217// IE8 throws error here (do not put tests after this one)5218div.innerHTML = "<input type='hidden'/>";5219if ( !div.querySelectorAll(":enabled").length ) {5220rbuggyQSA.push(":enabled", ":disabled");5221}5222});52235224// rbuggyQSA always contains :focus, so no need for a length check5225rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );52265227select = function( selector, context, results, seed, xml ) {5228// Only use querySelectorAll when not filtering,5229// when this is not xml,5230// and when no QSA bugs apply5231if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {5232var groups, i,5233old = true,5234nid = expando,5235newContext = context,5236newSelector = context.nodeType === 9 && selector;52375238// qSA works strangely on Element-rooted queries5239// We can work around this by specifying an extra ID on the root5240// and working up from there (Thanks to Andrew Dupont for the technique)5241// IE 8 doesn't work on object elements5242if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {5243groups = tokenize( selector );52445245if ( (old = context.getAttribute("id")) ) {5246nid = old.replace( rescape, "\\$&" );5247} else {5248context.setAttribute( "id", nid );5249}5250nid = "[id='" + nid + "'] ";52515252i = groups.length;5253while ( i-- ) {5254groups[i] = nid + groups[i].join("");5255}5256newContext = rsibling.test( selector ) && context.parentNode || context;5257newSelector = groups.join(",");5258}52595260if ( newSelector ) {5261try {5262push.apply( results, slice.call( newContext.querySelectorAll(5263newSelector5264), 0 ) );5265return results;5266} catch(qsaError) {5267} finally {5268if ( !old ) {5269context.removeAttribute("id");5270}5271}5272}5273}52745275return oldSelect( selector, context, results, seed, xml );5276};52775278if ( matches ) {5279assert(function( div ) {5280// Check to see if it's possible to do matchesSelector5281// on a disconnected node (IE 9)5282disconnectedMatch = matches.call( div, "div" );52835284// This should fail with an exception5285// Gecko does not error, returns false instead5286try {5287matches.call( div, "[test!='']:sizzle" );5288rbuggyMatches.push( "!=", pseudos );5289} catch ( e ) {}5290});52915292// rbuggyMatches always contains :active and :focus, so no need for a length check5293rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );52945295Sizzle.matchesSelector = function( elem, expr ) {5296// Make sure that attribute selectors are quoted5297expr = expr.replace( rattributeQuotes, "='$1']" );52985299// rbuggyMatches always contains :active, so no need for an existence check5300if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {5301try {5302var ret = matches.call( elem, expr );53035304// IE 9's matchesSelector returns false on disconnected nodes5305if ( ret || disconnectedMatch ||5306// As well, disconnected nodes are said to be in a document5307// fragment in IE 95308elem.document && elem.document.nodeType !== 11 ) {5309return ret;5310}5311} catch(e) {}5312}53135314return Sizzle( expr, null, null, [ elem ] ).length > 0;5315};5316}5317})();5318}53195320// Deprecated5321Expr.pseudos["nth"] = Expr.pseudos["eq"];53225323// Back-compat5324function setFilters() {}5325Expr.filters = setFilters.prototype = Expr.pseudos;5326Expr.setFilters = new setFilters();53275328// Override sizzle attribute retrieval5329Sizzle.attr = jQuery.attr;5330jQuery.find = Sizzle;5331jQuery.expr = Sizzle.selectors;5332jQuery.expr[":"] = jQuery.expr.pseudos;5333jQuery.unique = Sizzle.uniqueSort;5334jQuery.text = Sizzle.getText;5335jQuery.isXMLDoc = Sizzle.isXML;5336jQuery.contains = Sizzle.contains;533753385339})( window );5340var runtil = /Until$/,5341rparentsprev = /^(?:parents|prev(?:Until|All))/,5342isSimple = /^.[^:#\[\.,]*$/,5343rneedsContext = jQuery.expr.match.needsContext,5344// methods guaranteed to produce a unique set when starting from a unique set5345guaranteedUnique = {5346children: true,5347contents: true,5348next: true,5349prev: true5350};53515352jQuery.fn.extend({5353find: function( selector ) {5354var i, l, length, n, r, ret,5355self = this;53565357if ( typeof selector !== "string" ) {5358return jQuery( selector ).filter(function() {5359for ( i = 0, l = self.length; i < l; i++ ) {5360if ( jQuery.contains( self[ i ], this ) ) {5361return true;5362}5363}5364});5365}53665367ret = this.pushStack( "", "find", selector );53685369for ( i = 0, l = this.length; i < l; i++ ) {5370length = ret.length;5371jQuery.find( selector, this[i], ret );53725373if ( i > 0 ) {5374// Make sure that the results are unique5375for ( n = length; n < ret.length; n++ ) {5376for ( r = 0; r < length; r++ ) {5377if ( ret[r] === ret[n] ) {5378ret.splice(n--, 1);5379break;5380}5381}5382}5383}5384}53855386return ret;5387},53885389has: function( target ) {5390var i,5391targets = jQuery( target, this ),5392len = targets.length;53935394return this.filter(function() {5395for ( i = 0; i < len; i++ ) {5396if ( jQuery.contains( this, targets[i] ) ) {5397return true;5398}5399}5400});5401},54025403not: function( selector ) {5404return this.pushStack( winnow(this, selector, false), "not", selector);5405},54065407filter: function( selector ) {5408return this.pushStack( winnow(this, selector, true), "filter", selector );5409},54105411is: function( selector ) {5412return !!selector && (5413typeof selector === "string" ?5414// If this is a positional/relative selector, check membership in the returned set5415// so $("p:first").is("p:last") won't return true for a doc with two "p".5416rneedsContext.test( selector ) ?5417jQuery( selector, this.context ).index( this[0] ) >= 0 :5418jQuery.filter( selector, this ).length > 0 :5419this.filter( selector ).length > 0 );5420},54215422closest: function( selectors, context ) {5423var cur,5424i = 0,5425l = this.length,5426ret = [],5427pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?5428jQuery( selectors, context || this.context ) :54290;54305431for ( ; i < l; i++ ) {5432cur = this[i];54335434while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {5435if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {5436ret.push( cur );5437break;5438}5439cur = cur.parentNode;5440}5441}54425443ret = ret.length > 1 ? jQuery.unique( ret ) : ret;54445445return this.pushStack( ret, "closest", selectors );5446},54475448// Determine the position of an element within5449// the matched set of elements5450index: function( elem ) {54515452// No argument, return index in parent5453if ( !elem ) {5454return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;5455}54565457// index in selector5458if ( typeof elem === "string" ) {5459return jQuery.inArray( this[0], jQuery( elem ) );5460}54615462// Locate the position of the desired element5463return jQuery.inArray(5464// If it receives a jQuery object, the first element is used5465elem.jquery ? elem[0] : elem, this );5466},54675468add: function( selector, context ) {5469var set = typeof selector === "string" ?5470jQuery( selector, context ) :5471jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),5472all = jQuery.merge( this.get(), set );54735474return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?5475all :5476jQuery.unique( all ) );5477},54785479addBack: function( selector ) {5480return this.add( selector == null ?5481this.prevObject : this.prevObject.filter(selector)5482);5483}5484});54855486jQuery.fn.andSelf = jQuery.fn.addBack;54875488// A painfully simple check to see if an element is disconnected5489// from a document (should be improved, where feasible).5490function isDisconnected( node ) {5491return !node || !node.parentNode || node.parentNode.nodeType === 11;5492}54935494function sibling( cur, dir ) {5495do {5496cur = cur[ dir ];5497} while ( cur && cur.nodeType !== 1 );54985499return cur;5500}55015502jQuery.each({5503parent: function( elem ) {5504var parent = elem.parentNode;5505return parent && parent.nodeType !== 11 ? parent : null;5506},5507parents: function( elem ) {5508return jQuery.dir( elem, "parentNode" );5509},5510parentsUntil: function( elem, i, until ) {5511return jQuery.dir( elem, "parentNode", until );5512},5513next: function( elem ) {5514return sibling( elem, "nextSibling" );5515},5516prev: function( elem ) {5517return sibling( elem, "previousSibling" );5518},5519nextAll: function( elem ) {5520return jQuery.dir( elem, "nextSibling" );5521},5522prevAll: function( elem ) {5523return jQuery.dir( elem, "previousSibling" );5524},5525nextUntil: function( elem, i, until ) {5526return jQuery.dir( elem, "nextSibling", until );5527},5528prevUntil: function( elem, i, until ) {5529return jQuery.dir( elem, "previousSibling", until );5530},5531siblings: function( elem ) {5532return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );5533},5534children: function( elem ) {5535return jQuery.sibling( elem.firstChild );5536},5537contents: function( elem ) {5538return jQuery.nodeName( elem, "iframe" ) ?5539elem.contentDocument || elem.contentWindow.document :5540jQuery.merge( [], elem.childNodes );5541}5542}, function( name, fn ) {5543jQuery.fn[ name ] = function( until, selector ) {5544var ret = jQuery.map( this, fn, until );55455546if ( !runtil.test( name ) ) {5547selector = until;5548}55495550if ( selector && typeof selector === "string" ) {5551ret = jQuery.filter( selector, ret );5552}55535554ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;55555556if ( this.length > 1 && rparentsprev.test( name ) ) {5557ret = ret.reverse();5558}55595560return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );5561};5562});55635564jQuery.extend({5565filter: function( expr, elems, not ) {5566if ( not ) {5567expr = ":not(" + expr + ")";5568}55695570return elems.length === 1 ?5571jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :5572jQuery.find.matches(expr, elems);5573},55745575dir: function( elem, dir, until ) {5576var matched = [],5577cur = elem[ dir ];55785579while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {5580if ( cur.nodeType === 1 ) {5581matched.push( cur );5582}5583cur = cur[dir];5584}5585return matched;5586},55875588sibling: function( n, elem ) {5589var r = [];55905591for ( ; n; n = n.nextSibling ) {5592if ( n.nodeType === 1 && n !== elem ) {5593r.push( n );5594}5595}55965597return r;5598}5599});56005601// Implement the identical functionality for filter and not5602function winnow( elements, qualifier, keep ) {56035604// Can't pass null or undefined to indexOf in Firefox 45605// Set to 0 to skip string check5606qualifier = qualifier || 0;56075608if ( jQuery.isFunction( qualifier ) ) {5609return jQuery.grep(elements, function( elem, i ) {5610var retVal = !!qualifier.call( elem, i, elem );5611return retVal === keep;5612});56135614} else if ( qualifier.nodeType ) {5615return jQuery.grep(elements, function( elem, i ) {5616return ( elem === qualifier ) === keep;5617});56185619} else if ( typeof qualifier === "string" ) {5620var filtered = jQuery.grep(elements, function( elem ) {5621return elem.nodeType === 1;5622});56235624if ( isSimple.test( qualifier ) ) {5625return jQuery.filter(qualifier, filtered, !keep);5626} else {5627qualifier = jQuery.filter( qualifier, filtered );5628}5629}56305631return jQuery.grep(elements, function( elem, i ) {5632return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;5633});5634}5635function createSafeFragment( document ) {5636var list = nodeNames.split( "|" ),5637safeFrag = document.createDocumentFragment();56385639if ( safeFrag.createElement ) {5640while ( list.length ) {5641safeFrag.createElement(5642list.pop()5643);5644}5645}5646return safeFrag;5647}56485649var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +5650"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",5651rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,5652rleadingWhitespace = /^\s+/,5653rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,5654rtagName = /<([\w:]+)/,5655rtbody = /<tbody/i,5656rhtml = /<|&#?\w+;/,5657rnoInnerhtml = /<(?:script|style|link)/i,5658rnocache = /<(?:script|object|embed|option|style)/i,5659rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),5660rcheckableType = /^(?:checkbox|radio)$/,5661// checked="checked" or checked5662rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,5663rscriptType = /\/(java|ecma)script/i,5664rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,5665wrapMap = {5666option: [ 1, "<select multiple='multiple'>", "</select>" ],5667legend: [ 1, "<fieldset>", "</fieldset>" ],5668thead: [ 1, "<table>", "</table>" ],5669tr: [ 2, "<table><tbody>", "</tbody></table>" ],5670td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],5671col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],5672area: [ 1, "<map>", "</map>" ],5673_default: [ 0, "", "" ]5674},5675safeFragment = createSafeFragment( document ),5676fragmentDiv = safeFragment.appendChild( document.createElement("div") );56775678wrapMap.optgroup = wrapMap.option;5679wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;5680wrapMap.th = wrapMap.td;56815682// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,5683// unless wrapped in a div with non-breaking characters in front of it.5684if ( !jQuery.support.htmlSerialize ) {5685wrapMap._default = [ 1, "X<div>", "</div>" ];5686}56875688jQuery.fn.extend({5689text: function( value ) {5690return jQuery.access( this, function( value ) {5691return value === undefined ?5692jQuery.text( this ) :5693this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );5694}, null, value, arguments.length );5695},56965697wrapAll: function( html ) {5698if ( jQuery.isFunction( html ) ) {5699return this.each(function(i) {5700jQuery(this).wrapAll( html.call(this, i) );5701});5702}57035704if ( this[0] ) {5705// The elements to wrap the target around5706var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);57075708if ( this[0].parentNode ) {5709wrap.insertBefore( this[0] );5710}57115712wrap.map(function() {5713var elem = this;57145715while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {5716elem = elem.firstChild;5717}57185719return elem;5720}).append( this );5721}57225723return this;5724},57255726wrapInner: function( html ) {5727if ( jQuery.isFunction( html ) ) {5728return this.each(function(i) {5729jQuery(this).wrapInner( html.call(this, i) );5730});5731}57325733return this.each(function() {5734var self = jQuery( this ),5735contents = self.contents();57365737if ( contents.length ) {5738contents.wrapAll( html );57395740} else {5741self.append( html );5742}5743});5744},57455746wrap: function( html ) {5747var isFunction = jQuery.isFunction( html );57485749return this.each(function(i) {5750jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );5751});5752},57535754unwrap: function() {5755return this.parent().each(function() {5756if ( !jQuery.nodeName( this, "body" ) ) {5757jQuery( this ).replaceWith( this.childNodes );5758}5759}).end();5760},57615762append: function() {5763return this.domManip(arguments, true, function( elem ) {5764if ( this.nodeType === 1 || this.nodeType === 11 ) {5765this.appendChild( elem );5766}5767});5768},57695770prepend: function() {5771return this.domManip(arguments, true, function( elem ) {5772if ( this.nodeType === 1 || this.nodeType === 11 ) {5773this.insertBefore( elem, this.firstChild );5774}5775});5776},57775778before: function() {5779if ( !isDisconnected( this[0] ) ) {5780return this.domManip(arguments, false, function( elem ) {5781this.parentNode.insertBefore( elem, this );5782});5783}57845785if ( arguments.length ) {5786var set = jQuery.clean( arguments );5787return this.pushStack( jQuery.merge( set, this ), "before", this.selector );5788}5789},57905791after: function() {5792if ( !isDisconnected( this[0] ) ) {5793return this.domManip(arguments, false, function( elem ) {5794this.parentNode.insertBefore( elem, this.nextSibling );5795});5796}57975798if ( arguments.length ) {5799var set = jQuery.clean( arguments );5800return this.pushStack( jQuery.merge( this, set ), "after", this.selector );5801}5802},58035804// keepData is for internal use only--do not document5805remove: function( selector, keepData ) {5806var elem,5807i = 0;58085809for ( ; (elem = this[i]) != null; i++ ) {5810if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {5811if ( !keepData && elem.nodeType === 1 ) {5812jQuery.cleanData( elem.getElementsByTagName("*") );5813jQuery.cleanData( [ elem ] );5814}58155816if ( elem.parentNode ) {5817elem.parentNode.removeChild( elem );5818}5819}5820}58215822return this;5823},58245825empty: function() {5826var elem,5827i = 0;58285829for ( ; (elem = this[i]) != null; i++ ) {5830// Remove element nodes and prevent memory leaks5831if ( elem.nodeType === 1 ) {5832jQuery.cleanData( elem.getElementsByTagName("*") );5833}58345835// Remove any remaining nodes5836while ( elem.firstChild ) {5837elem.removeChild( elem.firstChild );5838}5839}58405841return this;5842},58435844clone: function( dataAndEvents, deepDataAndEvents ) {5845dataAndEvents = dataAndEvents == null ? false : dataAndEvents;5846deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;58475848return this.map( function () {5849return jQuery.clone( this, dataAndEvents, deepDataAndEvents );5850});5851},58525853html: function( value ) {5854return jQuery.access( this, function( value ) {5855var elem = this[0] || {},5856i = 0,5857l = this.length;58585859if ( value === undefined ) {5860return elem.nodeType === 1 ?5861elem.innerHTML.replace( rinlinejQuery, "" ) :5862undefined;5863}58645865// See if we can take a shortcut and just use innerHTML5866if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&5867( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&5868( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&5869!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {58705871value = value.replace( rxhtmlTag, "<$1></$2>" );58725873try {5874for (; i < l; i++ ) {5875// Remove element nodes and prevent memory leaks5876elem = this[i] || {};5877if ( elem.nodeType === 1 ) {5878jQuery.cleanData( elem.getElementsByTagName( "*" ) );5879elem.innerHTML = value;5880}5881}58825883elem = 0;58845885// If using innerHTML throws an exception, use the fallback method5886} catch(e) {}5887}58885889if ( elem ) {5890this.empty().append( value );5891}5892}, null, value, arguments.length );5893},58945895replaceWith: function( value ) {5896if ( !isDisconnected( this[0] ) ) {5897// Make sure that the elements are removed from the DOM before they are inserted5898// this can help fix replacing a parent with child elements5899if ( jQuery.isFunction( value ) ) {5900return this.each(function(i) {5901var self = jQuery(this), old = self.html();5902self.replaceWith( value.call( this, i, old ) );5903});5904}59055906if ( typeof value !== "string" ) {5907value = jQuery( value ).detach();5908}59095910return this.each(function() {5911var next = this.nextSibling,5912parent = this.parentNode;59135914jQuery( this ).remove();59155916if ( next ) {5917jQuery(next).before( value );5918} else {5919jQuery(parent).append( value );5920}5921});5922}59235924return this.length ?5925this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :5926this;5927},59285929detach: function( selector ) {5930return this.remove( selector, true );5931},59325933domManip: function( args, table, callback ) {59345935// Flatten any nested arrays5936args = [].concat.apply( [], args );59375938var results, first, fragment, iNoClone,5939i = 0,5940value = args[0],5941scripts = [],5942l = this.length;59435944// We can't cloneNode fragments that contain checked, in WebKit5945if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {5946return this.each(function() {5947jQuery(this).domManip( args, table, callback );5948});5949}59505951if ( jQuery.isFunction(value) ) {5952return this.each(function(i) {5953var self = jQuery(this);5954args[0] = value.call( this, i, table ? self.html() : undefined );5955self.domManip( args, table, callback );5956});5957}59585959if ( this[0] ) {5960results = jQuery.buildFragment( args, this, scripts );5961fragment = results.fragment;5962first = fragment.firstChild;59635964if ( fragment.childNodes.length === 1 ) {5965fragment = first;5966}59675968if ( first ) {5969table = table && jQuery.nodeName( first, "tr" );59705971// Use the original fragment for the last item instead of the first because it can end up5972// being emptied incorrectly in certain situations (#8070).5973// Fragments from the fragment cache must always be cloned and never used in place.5974for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {5975callback.call(5976table && jQuery.nodeName( this[i], "table" ) ?5977findOrAppend( this[i], "tbody" ) :5978this[i],5979i === iNoClone ?5980fragment :5981jQuery.clone( fragment, true, true )5982);5983}5984}59855986// Fix #11809: Avoid leaking memory5987fragment = first = null;59885989if ( scripts.length ) {5990jQuery.each( scripts, function( i, elem ) {5991if ( elem.src ) {5992if ( jQuery.ajax ) {5993jQuery.ajax({5994url: elem.src,5995type: "GET",5996dataType: "script",5997async: false,5998global: false,5999"throws": true6000});6001} else {6002jQuery.error("no ajax");6003}6004} else {6005jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );6006}60076008if ( elem.parentNode ) {6009elem.parentNode.removeChild( elem );6010}6011});6012}6013}60146015return this;6016}6017});60186019function findOrAppend( elem, tag ) {6020return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );6021}60226023function cloneCopyEvent( src, dest ) {60246025if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {6026return;6027}60286029var type, i, l,6030oldData = jQuery._data( src ),6031curData = jQuery._data( dest, oldData ),6032events = oldData.events;60336034if ( events ) {6035delete curData.handle;6036curData.events = {};60376038for ( type in events ) {6039for ( i = 0, l = events[ type ].length; i < l; i++ ) {6040jQuery.event.add( dest, type, events[ type ][ i ] );6041}6042}6043}60446045// make the cloned public data object a copy from the original6046if ( curData.data ) {6047curData.data = jQuery.extend( {}, curData.data );6048}6049}60506051function cloneFixAttributes( src, dest ) {6052var nodeName;60536054// We do not need to do anything for non-Elements6055if ( dest.nodeType !== 1 ) {6056return;6057}60586059// clearAttributes removes the attributes, which we don't want,6060// but also removes the attachEvent events, which we *do* want6061if ( dest.clearAttributes ) {6062dest.clearAttributes();6063}60646065// mergeAttributes, in contrast, only merges back on the6066// original attributes, not the events6067if ( dest.mergeAttributes ) {6068dest.mergeAttributes( src );6069}60706071nodeName = dest.nodeName.toLowerCase();60726073if ( nodeName === "object" ) {6074// IE6-10 improperly clones children of object elements using classid.6075// IE10 throws NoModificationAllowedError if parent is null, #12132.6076if ( dest.parentNode ) {6077dest.outerHTML = src.outerHTML;6078}60796080// This path appears unavoidable for IE9. When cloning an object6081// element in IE9, the outerHTML strategy above is not sufficient.6082// If the src has innerHTML and the destination does not,6083// copy the src.innerHTML into the dest.innerHTML. #103246084if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {6085dest.innerHTML = src.innerHTML;6086}60876088} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {6089// IE6-8 fails to persist the checked state of a cloned checkbox6090// or radio button. Worse, IE6-7 fail to give the cloned element6091// a checked appearance if the defaultChecked value isn't also set60926093dest.defaultChecked = dest.checked = src.checked;60946095// IE6-7 get confused and end up setting the value of a cloned6096// checkbox/radio button to an empty string instead of "on"6097if ( dest.value !== src.value ) {6098dest.value = src.value;6099}61006101// IE6-8 fails to return the selected option to the default selected6102// state when cloning options6103} else if ( nodeName === "option" ) {6104dest.selected = src.defaultSelected;61056106// IE6-8 fails to set the defaultValue to the correct value when6107// cloning other types of input fields6108} else if ( nodeName === "input" || nodeName === "textarea" ) {6109dest.defaultValue = src.defaultValue;61106111// IE blanks contents when cloning scripts6112} else if ( nodeName === "script" && dest.text !== src.text ) {6113dest.text = src.text;6114}61156116// Event data gets referenced instead of copied if the expando6117// gets copied too6118dest.removeAttribute( jQuery.expando );6119}61206121jQuery.buildFragment = function( args, context, scripts ) {6122var fragment, cacheable, cachehit,6123first = args[ 0 ];61246125// Set context from what may come in as undefined or a jQuery collection or a node6126// Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &6127// also doubles as fix for #8950 where plain objects caused createDocumentFragment exception6128context = context || document;6129context = !context.nodeType && context[0] || context;6130context = context.ownerDocument || context;61316132// Only cache "small" (1/2 KB) HTML strings that are associated with the main document6133// Cloning options loses the selected state, so don't cache them6134// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment6135// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache6136// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #105016137if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&6138first.charAt(0) === "<" && !rnocache.test( first ) &&6139(jQuery.support.checkClone || !rchecked.test( first )) &&6140(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {61416142// Mark cacheable and look for a hit6143cacheable = true;6144fragment = jQuery.fragments[ first ];6145cachehit = fragment !== undefined;6146}61476148if ( !fragment ) {6149fragment = context.createDocumentFragment();6150jQuery.clean( args, context, fragment, scripts );61516152// Update the cache, but only store false6153// unless this is a second parsing of the same content6154if ( cacheable ) {6155jQuery.fragments[ first ] = cachehit && fragment;6156}6157}61586159return { fragment: fragment, cacheable: cacheable };6160};61616162jQuery.fragments = {};61636164jQuery.each({6165appendTo: "append",6166prependTo: "prepend",6167insertBefore: "before",6168insertAfter: "after",6169replaceAll: "replaceWith"6170}, function( name, original ) {6171jQuery.fn[ name ] = function( selector ) {6172var elems,6173i = 0,6174ret = [],6175insert = jQuery( selector ),6176l = insert.length,6177parent = this.length === 1 && this[0].parentNode;61786179if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {6180insert[ original ]( this[0] );6181return this;6182} else {6183for ( ; i < l; i++ ) {6184elems = ( i > 0 ? this.clone(true) : this ).get();6185jQuery( insert[i] )[ original ]( elems );6186ret = ret.concat( elems );6187}61886189return this.pushStack( ret, name, insert.selector );6190}6191};6192});61936194function getAll( elem ) {6195if ( typeof elem.getElementsByTagName !== "undefined" ) {6196return elem.getElementsByTagName( "*" );61976198} else if ( typeof elem.querySelectorAll !== "undefined" ) {6199return elem.querySelectorAll( "*" );62006201} else {6202return [];6203}6204}62056206// Used in clean, fixes the defaultChecked property6207function fixDefaultChecked( elem ) {6208if ( rcheckableType.test( elem.type ) ) {6209elem.defaultChecked = elem.checked;6210}6211}62126213jQuery.extend({6214clone: function( elem, dataAndEvents, deepDataAndEvents ) {6215var srcElements,6216destElements,6217i,6218clone;62196220if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {6221clone = elem.cloneNode( true );62226223// IE<=8 does not properly clone detached, unknown element nodes6224} else {6225fragmentDiv.innerHTML = elem.outerHTML;6226fragmentDiv.removeChild( clone = fragmentDiv.firstChild );6227}62286229if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&6230(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {6231// IE copies events bound via attachEvent when using cloneNode.6232// Calling detachEvent on the clone will also remove the events6233// from the original. In order to get around this, we use some6234// proprietary methods to clear the events. Thanks to MooTools6235// guys for this hotness.62366237cloneFixAttributes( elem, clone );62386239// Using Sizzle here is crazy slow, so we use getElementsByTagName instead6240srcElements = getAll( elem );6241destElements = getAll( clone );62426243// Weird iteration because IE will replace the length property6244// with an element if you are cloning the body and one of the6245// elements on the page has a name or id of "length"6246for ( i = 0; srcElements[i]; ++i ) {6247// Ensure that the destination node is not null; Fixes #95876248if ( destElements[i] ) {6249cloneFixAttributes( srcElements[i], destElements[i] );6250}6251}6252}62536254// Copy the events from the original to the clone6255if ( dataAndEvents ) {6256cloneCopyEvent( elem, clone );62576258if ( deepDataAndEvents ) {6259srcElements = getAll( elem );6260destElements = getAll( clone );62616262for ( i = 0; srcElements[i]; ++i ) {6263cloneCopyEvent( srcElements[i], destElements[i] );6264}6265}6266}62676268srcElements = destElements = null;62696270// Return the cloned set6271return clone;6272},62736274clean: function( elems, context, fragment, scripts ) {6275var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,6276safe = context === document && safeFragment,6277ret = [];62786279// Ensure that context is a document6280if ( !context || typeof context.createDocumentFragment === "undefined" ) {6281context = document;6282}62836284// Use the already-created safe fragment if context permits6285for ( i = 0; (elem = elems[i]) != null; i++ ) {6286if ( typeof elem === "number" ) {6287elem += "";6288}62896290if ( !elem ) {6291continue;6292}62936294// Convert html string into DOM nodes6295if ( typeof elem === "string" ) {6296if ( !rhtml.test( elem ) ) {6297elem = context.createTextNode( elem );6298} else {6299// Ensure a safe container in which to render the html6300safe = safe || createSafeFragment( context );6301div = context.createElement("div");6302safe.appendChild( div );63036304// Fix "XHTML"-style tags in all browsers6305elem = elem.replace(rxhtmlTag, "<$1></$2>");63066307// Go to html and back, then peel off extra wrappers6308tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();6309wrap = wrapMap[ tag ] || wrapMap._default;6310depth = wrap[0];6311div.innerHTML = wrap[1] + elem + wrap[2];63126313// Move to the right depth6314while ( depth-- ) {6315div = div.lastChild;6316}63176318// Remove IE's autoinserted <tbody> from table fragments6319if ( !jQuery.support.tbody ) {63206321// String was a <table>, *may* have spurious <tbody>6322hasBody = rtbody.test(elem);6323tbody = tag === "table" && !hasBody ?6324div.firstChild && div.firstChild.childNodes :63256326// String was a bare <thead> or <tfoot>6327wrap[1] === "<table>" && !hasBody ?6328div.childNodes :6329[];63306331for ( j = tbody.length - 1; j >= 0 ; --j ) {6332if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {6333tbody[ j ].parentNode.removeChild( tbody[ j ] );6334}6335}6336}63376338// IE completely kills leading whitespace when innerHTML is used6339if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {6340div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );6341}63426343elem = div.childNodes;63446345// Take out of fragment container (we need a fresh div each time)6346div.parentNode.removeChild( div );6347}6348}63496350if ( elem.nodeType ) {6351ret.push( elem );6352} else {6353jQuery.merge( ret, elem );6354}6355}63566357// Fix #11356: Clear elements from safeFragment6358if ( div ) {6359elem = div = safe = null;6360}63616362// Reset defaultChecked for any radios and checkboxes6363// about to be appended to the DOM in IE 6/7 (#8060)6364if ( !jQuery.support.appendChecked ) {6365for ( i = 0; (elem = ret[i]) != null; i++ ) {6366if ( jQuery.nodeName( elem, "input" ) ) {6367fixDefaultChecked( elem );6368} else if ( typeof elem.getElementsByTagName !== "undefined" ) {6369jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );6370}6371}6372}63736374// Append elements to a provided document fragment6375if ( fragment ) {6376// Special handling of each script element6377handleScript = function( elem ) {6378// Check if we consider it executable6379if ( !elem.type || rscriptType.test( elem.type ) ) {6380// Detach the script and store it in the scripts array (if provided) or the fragment6381// Return truthy to indicate that it has been handled6382return scripts ?6383scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :6384fragment.appendChild( elem );6385}6386};63876388for ( i = 0; (elem = ret[i]) != null; i++ ) {6389// Check if we're done after handling an executable script6390if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {6391// Append to fragment and handle embedded scripts6392fragment.appendChild( elem );6393if ( typeof elem.getElementsByTagName !== "undefined" ) {6394// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration6395jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );63966397// Splice the scripts into ret after their former ancestor and advance our index beyond them6398ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );6399i += jsTags.length;6400}6401}6402}6403}64046405return ret;6406},64076408cleanData: function( elems, /* internal */ acceptData ) {6409var data, id, elem, type,6410i = 0,6411internalKey = jQuery.expando,6412cache = jQuery.cache,6413deleteExpando = jQuery.support.deleteExpando,6414special = jQuery.event.special;64156416for ( ; (elem = elems[i]) != null; i++ ) {64176418if ( acceptData || jQuery.acceptData( elem ) ) {64196420id = elem[ internalKey ];6421data = id && cache[ id ];64226423if ( data ) {6424if ( data.events ) {6425for ( type in data.events ) {6426if ( special[ type ] ) {6427jQuery.event.remove( elem, type );64286429// This is a shortcut to avoid jQuery.event.remove's overhead6430} else {6431jQuery.removeEvent( elem, type, data.handle );6432}6433}6434}64356436// Remove cache only if it was not already removed by jQuery.event.remove6437if ( cache[ id ] ) {64386439delete cache[ id ];64406441// IE does not allow us to delete expando properties from nodes,6442// nor does it have a removeAttribute function on Document nodes;6443// we must handle all of these cases6444if ( deleteExpando ) {6445delete elem[ internalKey ];64466447} else if ( elem.removeAttribute ) {6448elem.removeAttribute( internalKey );64496450} else {6451elem[ internalKey ] = null;6452}64536454jQuery.deletedIds.push( id );6455}6456}6457}6458}6459}6460});6461// Limit scope pollution from any deprecated API6462(function() {64636464var matched, browser;64656466// Use of jQuery.browser is frowned upon.6467// More details: http://api.jquery.com/jQuery.browser6468// jQuery.uaMatch maintained for back-compat6469jQuery.uaMatch = function( ua ) {6470ua = ua.toLowerCase();64716472var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||6473/(webkit)[ \/]([\w.]+)/.exec( ua ) ||6474/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||6475/(msie) ([\w.]+)/.exec( ua ) ||6476ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||6477[];64786479return {6480browser: match[ 1 ] || "",6481version: match[ 2 ] || "0"6482};6483};64846485matched = jQuery.uaMatch( navigator.userAgent );6486browser = {};64876488if ( matched.browser ) {6489browser[ matched.browser ] = true;6490browser.version = matched.version;6491}64926493// Chrome is Webkit, but Webkit is also Safari.6494if ( browser.chrome ) {6495browser.webkit = true;6496} else if ( browser.webkit ) {6497browser.safari = true;6498}64996500jQuery.browser = browser;65016502jQuery.sub = function() {6503function jQuerySub( selector, context ) {6504return new jQuerySub.fn.init( selector, context );6505}6506jQuery.extend( true, jQuerySub, this );6507jQuerySub.superclass = this;6508jQuerySub.fn = jQuerySub.prototype = this();6509jQuerySub.fn.constructor = jQuerySub;6510jQuerySub.sub = this.sub;6511jQuerySub.fn.init = function init( selector, context ) {6512if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {6513context = jQuerySub( context );6514}65156516return jQuery.fn.init.call( this, selector, context, rootjQuerySub );6517};6518jQuerySub.fn.init.prototype = jQuerySub.fn;6519var rootjQuerySub = jQuerySub(document);6520return jQuerySub;6521};65226523})();6524var curCSS, iframe, iframeDoc,6525ralpha = /alpha\([^)]*\)/i,6526ropacity = /opacity=([^)]*)/,6527rposition = /^(top|right|bottom|left)$/,6528// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"6529// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display6530rdisplayswap = /^(none|table(?!-c[ea]).+)/,6531rmargin = /^margin/,6532rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),6533rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),6534rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),6535elemdisplay = {},65366537cssShow = { position: "absolute", visibility: "hidden", display: "block" },6538cssNormalTransform = {6539letterSpacing: 0,6540fontWeight: 4006541},65426543cssExpand = [ "Top", "Right", "Bottom", "Left" ],6544cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],65456546eventsToggle = jQuery.fn.toggle;65476548// return a css property mapped to a potentially vendor prefixed property6549function vendorPropName( style, name ) {65506551// shortcut for names that are not vendor prefixed6552if ( name in style ) {6553return name;6554}65556556// check for vendor prefixed names6557var capName = name.charAt(0).toUpperCase() + name.slice(1),6558origName = name,6559i = cssPrefixes.length;65606561while ( i-- ) {6562name = cssPrefixes[ i ] + capName;6563if ( name in style ) {6564return name;6565}6566}65676568return origName;6569}65706571function isHidden( elem, el ) {6572elem = el || elem;6573return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );6574}65756576function showHide( elements, show ) {6577var elem, display,6578values = [],6579index = 0,6580length = elements.length;65816582for ( ; index < length; index++ ) {6583elem = elements[ index ];6584if ( !elem.style ) {6585continue;6586}6587values[ index ] = jQuery._data( elem, "olddisplay" );6588if ( show ) {6589// Reset the inline display of this element to learn if it is6590// being hidden by cascaded rules or not6591if ( !values[ index ] && elem.style.display === "none" ) {6592elem.style.display = "";6593}65946595// Set elements which have been overridden with display: none6596// in a stylesheet to whatever the default browser style is6597// for such an element6598if ( elem.style.display === "" && isHidden( elem ) ) {6599values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );6600}6601} else {6602display = curCSS( elem, "display" );66036604if ( !values[ index ] && display !== "none" ) {6605jQuery._data( elem, "olddisplay", display );6606}6607}6608}66096610// Set the display of most of the elements in a second loop6611// to avoid the constant reflow6612for ( index = 0; index < length; index++ ) {6613elem = elements[ index ];6614if ( !elem.style ) {6615continue;6616}6617if ( !show || elem.style.display === "none" || elem.style.display === "" ) {6618elem.style.display = show ? values[ index ] || "" : "none";6619}6620}66216622return elements;6623}66246625jQuery.fn.extend({6626css: function( name, value ) {6627return jQuery.access( this, function( elem, name, value ) {6628return value !== undefined ?6629jQuery.style( elem, name, value ) :6630jQuery.css( elem, name );6631}, name, value, arguments.length > 1 );6632},6633show: function() {6634return showHide( this, true );6635},6636hide: function() {6637return showHide( this );6638},6639toggle: function( state, fn2 ) {6640var bool = typeof state === "boolean";66416642if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {6643return eventsToggle.apply( this, arguments );6644}66456646return this.each(function() {6647if ( bool ? state : isHidden( this ) ) {6648jQuery( this ).show();6649} else {6650jQuery( this ).hide();6651}6652});6653}6654});66556656jQuery.extend({6657// Add in style property hooks for overriding the default6658// behavior of getting and setting a style property6659cssHooks: {6660opacity: {6661get: function( elem, computed ) {6662if ( computed ) {6663// We should always get a number back from opacity6664var ret = curCSS( elem, "opacity" );6665return ret === "" ? "1" : ret;66666667}6668}6669}6670},66716672// Exclude the following css properties to add px6673cssNumber: {6674"fillOpacity": true,6675"fontWeight": true,6676"lineHeight": true,6677"opacity": true,6678"orphans": true,6679"widows": true,6680"zIndex": true,6681"zoom": true6682},66836684// Add in properties whose names you wish to fix before6685// setting or getting the value6686cssProps: {6687// normalize float css property6688"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"6689},66906691// Get and set the style property on a DOM Node6692style: function( elem, name, value, extra ) {6693// Don't set styles on text and comment nodes6694if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {6695return;6696}66976698// Make sure that we're working with the right name6699var ret, type, hooks,6700origName = jQuery.camelCase( name ),6701style = elem.style;67026703name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );67046705// gets hook for the prefixed version6706// followed by the unprefixed version6707hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];67086709// Check if we're setting a value6710if ( value !== undefined ) {6711type = typeof value;67126713// convert relative number strings (+= or -=) to relative numbers. #73456714if ( type === "string" && (ret = rrelNum.exec( value )) ) {6715value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );6716// Fixes bug #92376717type = "number";6718}67196720// Make sure that NaN and null values aren't set. See: #71166721if ( value == null || type === "number" && isNaN( value ) ) {6722return;6723}67246725// If a number was passed in, add 'px' to the (except for certain CSS properties)6726if ( type === "number" && !jQuery.cssNumber[ origName ] ) {6727value += "px";6728}67296730// If a hook was provided, use that value, otherwise just set the specified value6731if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {6732// Wrapped to prevent IE from throwing errors when 'invalid' values are provided6733// Fixes bug #55096734try {6735style[ name ] = value;6736} catch(e) {}6737}67386739} else {6740// If a hook was provided get the non-computed value from there6741if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {6742return ret;6743}67446745// Otherwise just get the value from the style object6746return style[ name ];6747}6748},67496750css: function( elem, name, numeric, extra ) {6751var val, num, hooks,6752origName = jQuery.camelCase( name );67536754// Make sure that we're working with the right name6755name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );67566757// gets hook for the prefixed version6758// followed by the unprefixed version6759hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];67606761// If a hook was provided get the computed value from there6762if ( hooks && "get" in hooks ) {6763val = hooks.get( elem, true, extra );6764}67656766// Otherwise, if a way to get the computed value exists, use that6767if ( val === undefined ) {6768val = curCSS( elem, name );6769}67706771//convert "normal" to computed value6772if ( val === "normal" && name in cssNormalTransform ) {6773val = cssNormalTransform[ name ];6774}67756776// Return, converting to number if forced or a qualifier was provided and val looks numeric6777if ( numeric || extra !== undefined ) {6778num = parseFloat( val );6779return numeric || jQuery.isNumeric( num ) ? num || 0 : val;6780}6781return val;6782},67836784// A method for quickly swapping in/out CSS properties to get correct calculations6785swap: function( elem, options, callback ) {6786var ret, name,6787old = {};67886789// Remember the old values, and insert the new ones6790for ( name in options ) {6791old[ name ] = elem.style[ name ];6792elem.style[ name ] = options[ name ];6793}67946795ret = callback.call( elem );67966797// Revert the old values6798for ( name in options ) {6799elem.style[ name ] = old[ name ];6800}68016802return ret;6803}6804});68056806// NOTE: To any future maintainer, we've window.getComputedStyle6807// because jsdom on node.js will break without it.6808if ( window.getComputedStyle ) {6809curCSS = function( elem, name ) {6810var ret, width, minWidth, maxWidth,6811computed = window.getComputedStyle( elem, null ),6812style = elem.style;68136814if ( computed ) {68156816ret = computed[ name ];6817if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {6818ret = jQuery.style( elem, name );6819}68206821// A tribute to the "awesome hack by Dean Edwards"6822// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right6823// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels6824// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values6825if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {6826width = style.width;6827minWidth = style.minWidth;6828maxWidth = style.maxWidth;68296830style.minWidth = style.maxWidth = style.width = ret;6831ret = computed.width;68326833style.width = width;6834style.minWidth = minWidth;6835style.maxWidth = maxWidth;6836}6837}68386839return ret;6840};6841} else if ( document.documentElement.currentStyle ) {6842curCSS = function( elem, name ) {6843var left, rsLeft,6844ret = elem.currentStyle && elem.currentStyle[ name ],6845style = elem.style;68466847// Avoid setting ret to empty string here6848// so we don't default to auto6849if ( ret == null && style && style[ name ] ) {6850ret = style[ name ];6851}68526853// From the awesome hack by Dean Edwards6854// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-10229168556856// If we're not dealing with a regular pixel number6857// but a number that has a weird ending, we need to convert it to pixels6858// but not position css attributes, as those are proportional to the parent element instead6859// and we can't measure the parent instead because it might trigger a "stacking dolls" problem6860if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {68616862// Remember the original values6863left = style.left;6864rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;68656866// Put in the new values to get a computed value out6867if ( rsLeft ) {6868elem.runtimeStyle.left = elem.currentStyle.left;6869}6870style.left = name === "fontSize" ? "1em" : ret;6871ret = style.pixelLeft + "px";68726873// Revert the changed values6874style.left = left;6875if ( rsLeft ) {6876elem.runtimeStyle.left = rsLeft;6877}6878}68796880return ret === "" ? "auto" : ret;6881};6882}68836884function setPositiveNumber( elem, value, subtract ) {6885var matches = rnumsplit.exec( value );6886return matches ?6887Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :6888value;6889}68906891function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {6892var i = extra === ( isBorderBox ? "border" : "content" ) ?6893// If we already have the right measurement, avoid augmentation68944 :6895// Otherwise initialize for horizontal or vertical properties6896name === "width" ? 1 : 0,68976898val = 0;68996900for ( ; i < 4; i += 2 ) {6901// both box models exclude margin, so add it if we want it6902if ( extra === "margin" ) {6903// we use jQuery.css instead of curCSS here6904// because of the reliableMarginRight CSS hook!6905val += jQuery.css( elem, extra + cssExpand[ i ], true );6906}69076908// From this point on we use curCSS for maximum performance (relevant in animations)6909if ( isBorderBox ) {6910// border-box includes padding, so remove it if we want content6911if ( extra === "content" ) {6912val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;6913}69146915// at this point, extra isn't border nor margin, so remove border6916if ( extra !== "margin" ) {6917val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;6918}6919} else {6920// at this point, extra isn't content, so add padding6921val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;69226923// at this point, extra isn't content nor padding, so add border6924if ( extra !== "padding" ) {6925val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;6926}6927}6928}69296930return val;6931}69326933function getWidthOrHeight( elem, name, extra ) {69346935// Start with offset property, which is equivalent to the border-box value6936var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,6937valueIsBorderBox = true,6938isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";69396940// some non-html elements return undefined for offsetWidth, so check for null/undefined6941// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492856942// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=4916686943if ( val <= 0 || val == null ) {6944// Fall back to computed then uncomputed css if necessary6945val = curCSS( elem, name );6946if ( val < 0 || val == null ) {6947val = elem.style[ name ];6948}69496950// Computed unit is not pixels. Stop here and return.6951if ( rnumnonpx.test(val) ) {6952return val;6953}69546955// we need the check for style in case a browser which returns unreliable values6956// for getComputedStyle silently falls back to the reliable elem.style6957valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );69586959// Normalize "", auto, and prepare for extra6960val = parseFloat( val ) || 0;6961}69626963// use the active box-sizing model to add/subtract irrelevant styles6964return ( val +6965augmentWidthOrHeight(6966elem,6967name,6968extra || ( isBorderBox ? "border" : "content" ),6969valueIsBorderBox6970)6971) + "px";6972}697369746975// Try to determine the default display value of an element6976function css_defaultDisplay( nodeName ) {6977if ( elemdisplay[ nodeName ] ) {6978return elemdisplay[ nodeName ];6979}69806981var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),6982display = elem.css("display");6983elem.remove();69846985// If the simple way fails,6986// get element's real default display by attaching it to a temp iframe6987if ( display === "none" || display === "" ) {6988// Use the already-created iframe if possible6989iframe = document.body.appendChild(6990iframe || jQuery.extend( document.createElement("iframe"), {6991frameBorder: 0,6992width: 0,6993height: 06994})6995);69966997// Create a cacheable copy of the iframe document on first call.6998// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML6999// document to it; WebKit & Firefox won't allow reusing the iframe document.7000if ( !iframeDoc || !iframe.createElement ) {7001iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;7002iframeDoc.write("<!doctype html><html><body>");7003iframeDoc.close();7004}70057006elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );70077008display = curCSS( elem, "display" );7009document.body.removeChild( iframe );7010}70117012// Store the correct default display7013elemdisplay[ nodeName ] = display;70147015return display;7016}70177018jQuery.each([ "height", "width" ], function( i, name ) {7019jQuery.cssHooks[ name ] = {7020get: function( elem, computed, extra ) {7021if ( computed ) {7022// certain elements can have dimension info if we invisibly show them7023// however, it must have a current display style that would benefit from this7024if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {7025return jQuery.swap( elem, cssShow, function() {7026return getWidthOrHeight( elem, name, extra );7027});7028} else {7029return getWidthOrHeight( elem, name, extra );7030}7031}7032},70337034set: function( elem, value, extra ) {7035return setPositiveNumber( elem, value, extra ?7036augmentWidthOrHeight(7037elem,7038name,7039extra,7040jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"7041) : 07042);7043}7044};7045});70467047if ( !jQuery.support.opacity ) {7048jQuery.cssHooks.opacity = {7049get: function( elem, computed ) {7050// IE uses filters for opacity7051return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?7052( 0.01 * parseFloat( RegExp.$1 ) ) + "" :7053computed ? "1" : "";7054},70557056set: function( elem, value ) {7057var style = elem.style,7058currentStyle = elem.currentStyle,7059opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",7060filter = currentStyle && currentStyle.filter || style.filter || "";70617062// IE has trouble with opacity if it does not have layout7063// Force it by setting the zoom level7064style.zoom = 1;70657066// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #66527067if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&7068style.removeAttribute ) {70697070// Setting style.filter to null, "" & " " still leave "filter:" in the cssText7071// if "filter:" is present at all, clearType is disabled, we want to avoid this7072// style.removeAttribute is IE Only, but so apparently is this code path...7073style.removeAttribute( "filter" );70747075// if there there is no filter style applied in a css rule, we are done7076if ( currentStyle && !currentStyle.filter ) {7077return;7078}7079}70807081// otherwise, set new filter values7082style.filter = ralpha.test( filter ) ?7083filter.replace( ralpha, opacity ) :7084filter + " " + opacity;7085}7086};7087}70887089// These hooks cannot be added until DOM ready because the support test7090// for it is not run until after DOM ready7091jQuery(function() {7092if ( !jQuery.support.reliableMarginRight ) {7093jQuery.cssHooks.marginRight = {7094get: function( elem, computed ) {7095// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right7096// Work around by temporarily setting element display to inline-block7097return jQuery.swap( elem, { "display": "inline-block" }, function() {7098if ( computed ) {7099return curCSS( elem, "marginRight" );7100}7101});7102}7103};7104}71057106// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=290847107// getComputedStyle returns percent when specified for top/left/bottom/right7108// rather than make the css module depend on the offset module, we just check for it here7109if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {7110jQuery.each( [ "top", "left" ], function( i, prop ) {7111jQuery.cssHooks[ prop ] = {7112get: function( elem, computed ) {7113if ( computed ) {7114var ret = curCSS( elem, prop );7115// if curCSS returns percentage, fallback to offset7116return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;7117}7118}7119};7120});7121}71227123});71247125if ( jQuery.expr && jQuery.expr.filters ) {7126jQuery.expr.filters.hidden = function( elem ) {7127return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");7128};71297130jQuery.expr.filters.visible = function( elem ) {7131return !jQuery.expr.filters.hidden( elem );7132};7133}71347135// These hooks are used by animate to expand properties7136jQuery.each({7137margin: "",7138padding: "",7139border: "Width"7140}, function( prefix, suffix ) {7141jQuery.cssHooks[ prefix + suffix ] = {7142expand: function( value ) {7143var i,71447145// assumes a single number if not a string7146parts = typeof value === "string" ? value.split(" ") : [ value ],7147expanded = {};71487149for ( i = 0; i < 4; i++ ) {7150expanded[ prefix + cssExpand[ i ] + suffix ] =7151parts[ i ] || parts[ i - 2 ] || parts[ 0 ];7152}71537154return expanded;7155}7156};71577158if ( !rmargin.test( prefix ) ) {7159jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;7160}7161});7162var r20 = /%20/g,7163rbracket = /\[\]$/,7164rCRLF = /\r?\n/g,7165rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,7166rselectTextarea = /^(?:select|textarea)/i;71677168jQuery.fn.extend({7169serialize: function() {7170return jQuery.param( this.serializeArray() );7171},7172serializeArray: function() {7173return this.map(function(){7174return this.elements ? jQuery.makeArray( this.elements ) : this;7175})7176.filter(function(){7177return this.name && !this.disabled &&7178( this.checked || rselectTextarea.test( this.nodeName ) ||7179rinput.test( this.type ) );7180})7181.map(function( i, elem ){7182var val = jQuery( this ).val();71837184return val == null ?7185null :7186jQuery.isArray( val ) ?7187jQuery.map( val, function( val, i ){7188return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7189}) :7190{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7191}).get();7192}7193});71947195//Serialize an array of form elements or a set of7196//key/values into a query string7197jQuery.param = function( a, traditional ) {7198var prefix,7199s = [],7200add = function( key, value ) {7201// If value is a function, invoke it and return its value7202value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );7203s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );7204};72057206// Set traditional to true for jQuery <= 1.3.2 behavior.7207if ( traditional === undefined ) {7208traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;7209}72107211// If an array was passed in, assume that it is an array of form elements.7212if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {7213// Serialize the form elements7214jQuery.each( a, function() {7215add( this.name, this.value );7216});72177218} else {7219// If traditional, encode the "old" way (the way 1.3.2 or older7220// did it), otherwise encode params recursively.7221for ( prefix in a ) {7222buildParams( prefix, a[ prefix ], traditional, add );7223}7224}72257226// Return the resulting serialization7227return s.join( "&" ).replace( r20, "+" );7228};72297230function buildParams( prefix, obj, traditional, add ) {7231var name;72327233if ( jQuery.isArray( obj ) ) {7234// Serialize array item.7235jQuery.each( obj, function( i, v ) {7236if ( traditional || rbracket.test( prefix ) ) {7237// Treat each array item as a scalar.7238add( prefix, v );72397240} else {7241// If array item is non-scalar (array or object), encode its7242// numeric index to resolve deserialization ambiguity issues.7243// Note that rack (as of 1.0.0) can't currently deserialize7244// nested arrays properly, and attempting to do so may cause7245// a server error. Possible fixes are to modify rack's7246// deserialization algorithm or to provide an option or flag7247// to force array serialization to be shallow.7248buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );7249}7250});72517252} else if ( !traditional && jQuery.type( obj ) === "object" ) {7253// Serialize object item.7254for ( name in obj ) {7255buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );7256}72577258} else {7259// Serialize scalar item.7260add( prefix, obj );7261}7262}7263var7264// Document location7265ajaxLocParts,7266ajaxLocation,72677268rhash = /#.*$/,7269rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL7270// #7653, #8125, #8152: local protocol detection7271rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,7272rnoContent = /^(?:GET|HEAD)$/,7273rprotocol = /^\/\//,7274rquery = /\?/,7275rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,7276rts = /([?&])_=[^&]*/,7277rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,72787279// Keep a copy of the old load method7280_load = jQuery.fn.load,72817282/* Prefilters7283* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)7284* 2) These are called:7285* - BEFORE asking for a transport7286* - AFTER param serialization (s.data is a string if s.processData is true)7287* 3) key is the dataType7288* 4) the catchall symbol "*" can be used7289* 5) execution will start with transport dataType and THEN continue down to "*" if needed7290*/7291prefilters = {},72927293/* Transports bindings7294* 1) key is the dataType7295* 2) the catchall symbol "*" can be used7296* 3) selection will start with transport dataType and THEN go to "*" if needed7297*/7298transports = {},72997300// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression7301allTypes = ["*/"] + ["*"];73027303// #8138, IE may throw an exception when accessing7304// a field from window.location if document.domain has been set7305try {7306ajaxLocation = location.href;7307} catch( e ) {7308// Use the href attribute of an A element7309// since IE will modify it given document.location7310ajaxLocation = document.createElement( "a" );7311ajaxLocation.href = "";7312ajaxLocation = ajaxLocation.href;7313}73147315// Segment location into parts7316ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];73177318// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport7319function addToPrefiltersOrTransports( structure ) {73207321// dataTypeExpression is optional and defaults to "*"7322return function( dataTypeExpression, func ) {73237324if ( typeof dataTypeExpression !== "string" ) {7325func = dataTypeExpression;7326dataTypeExpression = "*";7327}73287329var dataType, list, placeBefore,7330dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),7331i = 0,7332length = dataTypes.length;73337334if ( jQuery.isFunction( func ) ) {7335// For each dataType in the dataTypeExpression7336for ( ; i < length; i++ ) {7337dataType = dataTypes[ i ];7338// We control if we're asked to add before7339// any existing element7340placeBefore = /^\+/.test( dataType );7341if ( placeBefore ) {7342dataType = dataType.substr( 1 ) || "*";7343}7344list = structure[ dataType ] = structure[ dataType ] || [];7345// then we add to the structure accordingly7346list[ placeBefore ? "unshift" : "push" ]( func );7347}7348}7349};7350}73517352// Base inspection function for prefilters and transports7353function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,7354dataType /* internal */, inspected /* internal */ ) {73557356dataType = dataType || options.dataTypes[ 0 ];7357inspected = inspected || {};73587359inspected[ dataType ] = true;73607361var selection,7362list = structure[ dataType ],7363i = 0,7364length = list ? list.length : 0,7365executeOnly = ( structure === prefilters );73667367for ( ; i < length && ( executeOnly || !selection ); i++ ) {7368selection = list[ i ]( options, originalOptions, jqXHR );7369// If we got redirected to another dataType7370// we try there if executing only and not done already7371if ( typeof selection === "string" ) {7372if ( !executeOnly || inspected[ selection ] ) {7373selection = undefined;7374} else {7375options.dataTypes.unshift( selection );7376selection = inspectPrefiltersOrTransports(7377structure, options, originalOptions, jqXHR, selection, inspected );7378}7379}7380}7381// If we're only executing or nothing was selected7382// we try the catchall dataType if not done already7383if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {7384selection = inspectPrefiltersOrTransports(7385structure, options, originalOptions, jqXHR, "*", inspected );7386}7387// unnecessary when only executing (prefilters)7388// but it'll be ignored by the caller in that case7389return selection;7390}73917392// A special extend for ajax options7393// that takes "flat" options (not to be deep extended)7394// Fixes #98877395function ajaxExtend( target, src ) {7396var key, deep,7397flatOptions = jQuery.ajaxSettings.flatOptions || {};7398for ( key in src ) {7399if ( src[ key ] !== undefined ) {7400( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];7401}7402}7403if ( deep ) {7404jQuery.extend( true, target, deep );7405}7406}74077408jQuery.fn.load = function( url, params, callback ) {7409if ( typeof url !== "string" && _load ) {7410return _load.apply( this, arguments );7411}74127413// Don't do a request if no elements are being requested7414if ( !this.length ) {7415return this;7416}74177418var selector, type, response,7419self = this,7420off = url.indexOf(" ");74217422if ( off >= 0 ) {7423selector = url.slice( off, url.length );7424url = url.slice( 0, off );7425}74267427// If it's a function7428if ( jQuery.isFunction( params ) ) {74297430// We assume that it's the callback7431callback = params;7432params = undefined;74337434// Otherwise, build a param string7435} else if ( params && typeof params === "object" ) {7436type = "POST";7437}74387439// Request the remote document7440jQuery.ajax({7441url: url,74427443// if "type" variable is undefined, then "GET" method will be used7444type: type,7445dataType: "html",7446data: params,7447complete: function( jqXHR, status ) {7448if ( callback ) {7449self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );7450}7451}7452}).done(function( responseText ) {74537454// Save response for use in complete callback7455response = arguments;74567457// See if a selector was specified7458self.html( selector ?74597460// Create a dummy div to hold the results7461jQuery("<div>")74627463// inject the contents of the document in, removing the scripts7464// to avoid any 'Permission Denied' errors in IE7465.append( responseText.replace( rscript, "" ) )74667467// Locate the specified elements7468.find( selector ) :74697470// If not, just inject the full result7471responseText );74727473});74747475return this;7476};74777478// Attach a bunch of functions for handling common AJAX events7479jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){7480jQuery.fn[ o ] = function( f ){7481return this.on( o, f );7482};7483});74847485jQuery.each( [ "get", "post" ], function( i, method ) {7486jQuery[ method ] = function( url, data, callback, type ) {7487// shift arguments if data argument was omitted7488if ( jQuery.isFunction( data ) ) {7489type = type || callback;7490callback = data;7491data = undefined;7492}74937494return jQuery.ajax({7495type: method,7496url: url,7497data: data,7498success: callback,7499dataType: type7500});7501};7502});75037504jQuery.extend({75057506getScript: function( url, callback ) {7507return jQuery.get( url, undefined, callback, "script" );7508},75097510getJSON: function( url, data, callback ) {7511return jQuery.get( url, data, callback, "json" );7512},75137514// Creates a full fledged settings object into target7515// with both ajaxSettings and settings fields.7516// If target is omitted, writes into ajaxSettings.7517ajaxSetup: function( target, settings ) {7518if ( settings ) {7519// Building a settings object7520ajaxExtend( target, jQuery.ajaxSettings );7521} else {7522// Extending ajaxSettings7523settings = target;7524target = jQuery.ajaxSettings;7525}7526ajaxExtend( target, settings );7527return target;7528},75297530ajaxSettings: {7531url: ajaxLocation,7532isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),7533global: true,7534type: "GET",7535contentType: "application/x-www-form-urlencoded; charset=UTF-8",7536processData: true,7537async: true,7538/*7539timeout: 0,7540data: null,7541dataType: null,7542username: null,7543password: null,7544cache: null,7545throws: false,7546traditional: false,7547headers: {},7548*/75497550accepts: {7551xml: "application/xml, text/xml",7552html: "text/html",7553text: "text/plain",7554json: "application/json, text/javascript",7555"*": allTypes7556},75577558contents: {7559xml: /xml/,7560html: /html/,7561json: /json/7562},75637564responseFields: {7565xml: "responseXML",7566text: "responseText"7567},75687569// List of data converters7570// 1) key format is "source_type destination_type" (a single space in-between)7571// 2) the catchall symbol "*" can be used for source_type7572converters: {75737574// Convert anything to text7575"* text": window.String,75767577// Text to html (true = no transformation)7578"text html": true,75797580// Evaluate text as a json expression7581"text json": jQuery.parseJSON,75827583// Parse text as xml7584"text xml": jQuery.parseXML7585},75867587// For options that shouldn't be deep extended:7588// you can add your own custom options here if7589// and when you create one that shouldn't be7590// deep extended (see ajaxExtend)7591flatOptions: {7592context: true,7593url: true7594}7595},75967597ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),7598ajaxTransport: addToPrefiltersOrTransports( transports ),75997600// Main method7601ajax: function( url, options ) {76027603// If url is an object, simulate pre-1.5 signature7604if ( typeof url === "object" ) {7605options = url;7606url = undefined;7607}76087609// Force options to be an object7610options = options || {};76117612var // ifModified key7613ifModifiedKey,7614// Response headers7615responseHeadersString,7616responseHeaders,7617// transport7618transport,7619// timeout handle7620timeoutTimer,7621// Cross-domain detection vars7622parts,7623// To know if global events are to be dispatched7624fireGlobals,7625// Loop variable7626i,7627// Create the final options object7628s = jQuery.ajaxSetup( {}, options ),7629// Callbacks context7630callbackContext = s.context || s,7631// Context for global events7632// It's the callbackContext if one was provided in the options7633// and if it's a DOM node or a jQuery collection7634globalEventContext = callbackContext !== s &&7635( callbackContext.nodeType || callbackContext instanceof jQuery ) ?7636jQuery( callbackContext ) : jQuery.event,7637// Deferreds7638deferred = jQuery.Deferred(),7639completeDeferred = jQuery.Callbacks( "once memory" ),7640// Status-dependent callbacks7641statusCode = s.statusCode || {},7642// Headers (they are sent all at once)7643requestHeaders = {},7644requestHeadersNames = {},7645// The jqXHR state7646state = 0,7647// Default abort message7648strAbort = "canceled",7649// Fake xhr7650jqXHR = {76517652readyState: 0,76537654// Caches the header7655setRequestHeader: function( name, value ) {7656if ( !state ) {7657var lname = name.toLowerCase();7658name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;7659requestHeaders[ name ] = value;7660}7661return this;7662},76637664// Raw string7665getAllResponseHeaders: function() {7666return state === 2 ? responseHeadersString : null;7667},76687669// Builds headers hashtable if needed7670getResponseHeader: function( key ) {7671var match;7672if ( state === 2 ) {7673if ( !responseHeaders ) {7674responseHeaders = {};7675while( ( match = rheaders.exec( responseHeadersString ) ) ) {7676responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];7677}7678}7679match = responseHeaders[ key.toLowerCase() ];7680}7681return match === undefined ? null : match;7682},76837684// Overrides response content-type header7685overrideMimeType: function( type ) {7686if ( !state ) {7687s.mimeType = type;7688}7689return this;7690},76917692// Cancel the request7693abort: function( statusText ) {7694statusText = statusText || strAbort;7695if ( transport ) {7696transport.abort( statusText );7697}7698done( 0, statusText );7699return this;7700}7701};77027703// Callback for when everything is done7704// It is defined here because jslint complains if it is declared7705// at the end of the function (which would be more logical and readable)7706function done( status, nativeStatusText, responses, headers ) {7707var isSuccess, success, error, response, modified,7708statusText = nativeStatusText;77097710// Called once7711if ( state === 2 ) {7712return;7713}77147715// State is "done" now7716state = 2;77177718// Clear timeout if it exists7719if ( timeoutTimer ) {7720clearTimeout( timeoutTimer );7721}77227723// Dereference transport for early garbage collection7724// (no matter how long the jqXHR object will be used)7725transport = undefined;77267727// Cache response headers7728responseHeadersString = headers || "";77297730// Set readyState7731jqXHR.readyState = status > 0 ? 4 : 0;77327733// Get response data7734if ( responses ) {7735response = ajaxHandleResponses( s, jqXHR, responses );7736}77377738// If successful, handle type chaining7739if ( status >= 200 && status < 300 || status === 304 ) {77407741// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.7742if ( s.ifModified ) {77437744modified = jqXHR.getResponseHeader("Last-Modified");7745if ( modified ) {7746jQuery.lastModified[ ifModifiedKey ] = modified;7747}7748modified = jqXHR.getResponseHeader("Etag");7749if ( modified ) {7750jQuery.etag[ ifModifiedKey ] = modified;7751}7752}77537754// If not modified7755if ( status === 304 ) {77567757statusText = "notmodified";7758isSuccess = true;77597760// If we have data7761} else {77627763isSuccess = ajaxConvert( s, response );7764statusText = isSuccess.state;7765success = isSuccess.data;7766error = isSuccess.error;7767isSuccess = !error;7768}7769} else {7770// We extract error from statusText7771// then normalize statusText and status for non-aborts7772error = statusText;7773if ( !statusText || status ) {7774statusText = "error";7775if ( status < 0 ) {7776status = 0;7777}7778}7779}77807781// Set data for the fake xhr object7782jqXHR.status = status;7783jqXHR.statusText = ( nativeStatusText || statusText ) + "";77847785// Success/Error7786if ( isSuccess ) {7787deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );7788} else {7789deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );7790}77917792// Status-dependent callbacks7793jqXHR.statusCode( statusCode );7794statusCode = undefined;77957796if ( fireGlobals ) {7797globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),7798[ jqXHR, s, isSuccess ? success : error ] );7799}78007801// Complete7802completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );78037804if ( fireGlobals ) {7805globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );7806// Handle the global AJAX counter7807if ( !( --jQuery.active ) ) {7808jQuery.event.trigger( "ajaxStop" );7809}7810}7811}78127813// Attach deferreds7814deferred.promise( jqXHR );7815jqXHR.success = jqXHR.done;7816jqXHR.error = jqXHR.fail;7817jqXHR.complete = completeDeferred.add;78187819// Status-dependent callbacks7820jqXHR.statusCode = function( map ) {7821if ( map ) {7822var tmp;7823if ( state < 2 ) {7824for ( tmp in map ) {7825statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];7826}7827} else {7828tmp = map[ jqXHR.status ];7829jqXHR.always( tmp );7830}7831}7832return this;7833};78347835// Remove hash character (#7531: and string promotion)7836// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)7837// We also use the url parameter if available7838s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );78397840// Extract dataTypes list7841s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );78427843// A cross-domain request is in order when we have a protocol:host:port mismatch7844if ( s.crossDomain == null ) {7845parts = rurl.exec( s.url.toLowerCase() ) || false;7846s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==7847( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );7848}78497850// Convert data if not already a string7851if ( s.data && s.processData && typeof s.data !== "string" ) {7852s.data = jQuery.param( s.data, s.traditional );7853}78547855// Apply prefilters7856inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );78577858// If request was aborted inside a prefilter, stop there7859if ( state === 2 ) {7860return jqXHR;7861}78627863// We can fire global events as of now if asked to7864fireGlobals = s.global;78657866// Uppercase the type7867s.type = s.type.toUpperCase();78687869// Determine if request has content7870s.hasContent = !rnoContent.test( s.type );78717872// Watch for a new set of requests7873if ( fireGlobals && jQuery.active++ === 0 ) {7874jQuery.event.trigger( "ajaxStart" );7875}78767877// More options handling for requests with no content7878if ( !s.hasContent ) {78797880// If data is available, append data to url7881if ( s.data ) {7882s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;7883// #9682: remove data so that it's not used in an eventual retry7884delete s.data;7885}78867887// Get ifModifiedKey before adding the anti-cache parameter7888ifModifiedKey = s.url;78897890// Add anti-cache in url if needed7891if ( s.cache === false ) {78927893var ts = jQuery.now(),7894// try replacing _= if it is there7895ret = s.url.replace( rts, "$1_=" + ts );78967897// if nothing was replaced, add timestamp to the end7898s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );7899}7900}79017902// Set the correct header, if data is being sent7903if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {7904jqXHR.setRequestHeader( "Content-Type", s.contentType );7905}79067907// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.7908if ( s.ifModified ) {7909ifModifiedKey = ifModifiedKey || s.url;7910if ( jQuery.lastModified[ ifModifiedKey ] ) {7911jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );7912}7913if ( jQuery.etag[ ifModifiedKey ] ) {7914jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );7915}7916}79177918// Set the Accepts header for the server, depending on the dataType7919jqXHR.setRequestHeader(7920"Accept",7921s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?7922s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :7923s.accepts[ "*" ]7924);79257926// Check for headers option7927for ( i in s.headers ) {7928jqXHR.setRequestHeader( i, s.headers[ i ] );7929}79307931// Allow custom headers/mimetypes and early abort7932if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {7933// Abort if not done already and return7934return jqXHR.abort();79357936}79377938// aborting is no longer a cancellation7939strAbort = "abort";79407941// Install callbacks on deferreds7942for ( i in { success: 1, error: 1, complete: 1 } ) {7943jqXHR[ i ]( s[ i ] );7944}79457946// Get transport7947transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );79487949// If no transport, we auto-abort7950if ( !transport ) {7951done( -1, "No Transport" );7952} else {7953jqXHR.readyState = 1;7954// Send global event7955if ( fireGlobals ) {7956globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );7957}7958// Timeout7959if ( s.async && s.timeout > 0 ) {7960timeoutTimer = setTimeout( function(){7961jqXHR.abort( "timeout" );7962}, s.timeout );7963}79647965try {7966state = 1;7967transport.send( requestHeaders, done );7968} catch (e) {7969// Propagate exception as error if not done7970if ( state < 2 ) {7971done( -1, e );7972// Simply rethrow otherwise7973} else {7974throw e;7975}7976}7977}79787979return jqXHR;7980},79817982// Counter for holding the number of active queries7983active: 0,79847985// Last-Modified header cache for next request7986lastModified: {},7987etag: {}79887989});79907991/* Handles responses to an ajax request:7992* - sets all responseXXX fields accordingly7993* - finds the right dataType (mediates between content-type and expected dataType)7994* - returns the corresponding response7995*/7996function ajaxHandleResponses( s, jqXHR, responses ) {79977998var ct, type, finalDataType, firstDataType,7999contents = s.contents,8000dataTypes = s.dataTypes,8001responseFields = s.responseFields;80028003// Fill responseXXX fields8004for ( type in responseFields ) {8005if ( type in responses ) {8006jqXHR[ responseFields[type] ] = responses[ type ];8007}8008}80098010// Remove auto dataType and get content-type in the process8011while( dataTypes[ 0 ] === "*" ) {8012dataTypes.shift();8013if ( ct === undefined ) {8014ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );8015}8016}80178018// Check if we're dealing with a known content-type8019if ( ct ) {8020for ( type in contents ) {8021if ( contents[ type ] && contents[ type ].test( ct ) ) {8022dataTypes.unshift( type );8023break;8024}8025}8026}80278028// Check to see if we have a response for the expected dataType8029if ( dataTypes[ 0 ] in responses ) {8030finalDataType = dataTypes[ 0 ];8031} else {8032// Try convertible dataTypes8033for ( type in responses ) {8034if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {8035finalDataType = type;8036break;8037}8038if ( !firstDataType ) {8039firstDataType = type;8040}8041}8042// Or just use first one8043finalDataType = finalDataType || firstDataType;8044}80458046// If we found a dataType8047// We add the dataType to the list if needed8048// and return the corresponding response8049if ( finalDataType ) {8050if ( finalDataType !== dataTypes[ 0 ] ) {8051dataTypes.unshift( finalDataType );8052}8053return responses[ finalDataType ];8054}8055}80568057// Chain conversions given the request and the original response8058function ajaxConvert( s, response ) {80598060var conv, conv2, current, tmp,8061// Work with a copy of dataTypes in case we need to modify it for conversion8062dataTypes = s.dataTypes.slice(),8063prev = dataTypes[ 0 ],8064converters = {},8065i = 0;80668067// Apply the dataFilter if provided8068if ( s.dataFilter ) {8069response = s.dataFilter( response, s.dataType );8070}80718072// Create converters map with lowercased keys8073if ( dataTypes[ 1 ] ) {8074for ( conv in s.converters ) {8075converters[ conv.toLowerCase() ] = s.converters[ conv ];8076}8077}80788079// Convert to each sequential dataType, tolerating list modification8080for ( ; (current = dataTypes[++i]); ) {80818082// There's only work to do if current dataType is non-auto8083if ( current !== "*" ) {80848085// Convert response if prev dataType is non-auto and differs from current8086if ( prev !== "*" && prev !== current ) {80878088// Seek a direct converter8089conv = converters[ prev + " " + current ] || converters[ "* " + current ];80908091// If none found, seek a pair8092if ( !conv ) {8093for ( conv2 in converters ) {80948095// If conv2 outputs current8096tmp = conv2.split(" ");8097if ( tmp[ 1 ] === current ) {80988099// If prev can be converted to accepted input8100conv = converters[ prev + " " + tmp[ 0 ] ] ||8101converters[ "* " + tmp[ 0 ] ];8102if ( conv ) {8103// Condense equivalence converters8104if ( conv === true ) {8105conv = converters[ conv2 ];81068107// Otherwise, insert the intermediate dataType8108} else if ( converters[ conv2 ] !== true ) {8109current = tmp[ 0 ];8110dataTypes.splice( i--, 0, current );8111}81128113break;8114}8115}8116}8117}81188119// Apply converter (if not an equivalence)8120if ( conv !== true ) {81218122// Unless errors are allowed to bubble, catch and return them8123if ( conv && s["throws"] ) {8124response = conv( response );8125} else {8126try {8127response = conv( response );8128} catch ( e ) {8129return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };8130}8131}8132}8133}81348135// Update prev for next iteration8136prev = current;8137}8138}81398140return { state: "success", data: response };8141}8142var oldCallbacks = [],8143rquestion = /\?/,8144rjsonp = /(=)\?(?=&|$)|\?\?/,8145nonce = jQuery.now();81468147// Default jsonp settings8148jQuery.ajaxSetup({8149jsonp: "callback",8150jsonpCallback: function() {8151var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );8152this[ callback ] = true;8153return callback;8154}8155});81568157// Detect, normalize options and install callbacks for jsonp requests8158jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {81598160var callbackName, overwritten, responseContainer,8161data = s.data,8162url = s.url,8163hasCallback = s.jsonp !== false,8164replaceInUrl = hasCallback && rjsonp.test( url ),8165replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&8166!( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&8167rjsonp.test( data );81688169// Handle iff the expected data type is "jsonp" or we have a parameter to set8170if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {81718172// Get callback name, remembering preexisting value associated with it8173callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?8174s.jsonpCallback() :8175s.jsonpCallback;8176overwritten = window[ callbackName ];81778178// Insert callback into url or form data8179if ( replaceInUrl ) {8180s.url = url.replace( rjsonp, "$1" + callbackName );8181} else if ( replaceInData ) {8182s.data = data.replace( rjsonp, "$1" + callbackName );8183} else if ( hasCallback ) {8184s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;8185}81868187// Use data converter to retrieve json after script execution8188s.converters["script json"] = function() {8189if ( !responseContainer ) {8190jQuery.error( callbackName + " was not called" );8191}8192return responseContainer[ 0 ];8193};81948195// force json dataType8196s.dataTypes[ 0 ] = "json";81978198// Install callback8199window[ callbackName ] = function() {8200responseContainer = arguments;8201};82028203// Clean-up function (fires after converters)8204jqXHR.always(function() {8205// Restore preexisting value8206window[ callbackName ] = overwritten;82078208// Save back as free8209if ( s[ callbackName ] ) {8210// make sure that re-using the options doesn't screw things around8211s.jsonpCallback = originalSettings.jsonpCallback;82128213// save the callback name for future use8214oldCallbacks.push( callbackName );8215}82168217// Call if it was a function and we have a response8218if ( responseContainer && jQuery.isFunction( overwritten ) ) {8219overwritten( responseContainer[ 0 ] );8220}82218222responseContainer = overwritten = undefined;8223});82248225// Delegate to script8226return "script";8227}8228});8229// Install script dataType8230jQuery.ajaxSetup({8231accepts: {8232script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"8233},8234contents: {8235script: /javascript|ecmascript/8236},8237converters: {8238"text script": function( text ) {8239jQuery.globalEval( text );8240return text;8241}8242}8243});82448245// Handle cache's special case and global8246jQuery.ajaxPrefilter( "script", function( s ) {8247if ( s.cache === undefined ) {8248s.cache = false;8249}8250if ( s.crossDomain ) {8251s.type = "GET";8252s.global = false;8253}8254});82558256// Bind script tag hack transport8257jQuery.ajaxTransport( "script", function(s) {82588259// This transport only deals with cross domain requests8260if ( s.crossDomain ) {82618262var script,8263head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;82648265return {82668267send: function( _, callback ) {82688269script = document.createElement( "script" );82708271script.async = "async";82728273if ( s.scriptCharset ) {8274script.charset = s.scriptCharset;8275}82768277script.src = s.url;82788279// Attach handlers for all browsers8280script.onload = script.onreadystatechange = function( _, isAbort ) {82818282if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {82838284// Handle memory leak in IE8285script.onload = script.onreadystatechange = null;82868287// Remove the script8288if ( head && script.parentNode ) {8289head.removeChild( script );8290}82918292// Dereference the script8293script = undefined;82948295// Callback if not abort8296if ( !isAbort ) {8297callback( 200, "success" );8298}8299}8300};8301// Use insertBefore instead of appendChild to circumvent an IE6 bug.8302// This arises when a base node is used (#2709 and #4378).8303head.insertBefore( script, head.firstChild );8304},83058306abort: function() {8307if ( script ) {8308script.onload( 0, 1 );8309}8310}8311};8312}8313});8314var xhrCallbacks,8315// #5280: Internet Explorer will keep connections alive if we don't abort on unload8316xhrOnUnloadAbort = window.ActiveXObject ? function() {8317// Abort all pending requests8318for ( var key in xhrCallbacks ) {8319xhrCallbacks[ key ]( 0, 1 );8320}8321} : false,8322xhrId = 0;83238324// Functions to create xhrs8325function createStandardXHR() {8326try {8327return new window.XMLHttpRequest();8328} catch( e ) {}8329}83308331function createActiveXHR() {8332try {8333return new window.ActiveXObject( "Microsoft.XMLHTTP" );8334} catch( e ) {}8335}83368337// Create the request object8338// (This is still attached to ajaxSettings for backward compatibility)8339jQuery.ajaxSettings.xhr = window.ActiveXObject ?8340/* Microsoft failed to properly8341* implement the XMLHttpRequest in IE7 (can't request local files),8342* so we use the ActiveXObject when it is available8343* Additionally XMLHttpRequest can be disabled in IE7/IE8 so8344* we need a fallback.8345*/8346function() {8347return !this.isLocal && createStandardXHR() || createActiveXHR();8348} :8349// For all other browsers, use the standard XMLHttpRequest object8350createStandardXHR;83518352// Determine support properties8353(function( xhr ) {8354jQuery.extend( jQuery.support, {8355ajax: !!xhr,8356cors: !!xhr && ( "withCredentials" in xhr )8357});8358})( jQuery.ajaxSettings.xhr() );83598360// Create transport if the browser can provide an xhr8361if ( jQuery.support.ajax ) {83628363jQuery.ajaxTransport(function( s ) {8364// Cross domain only allowed if supported through XMLHttpRequest8365if ( !s.crossDomain || jQuery.support.cors ) {83668367var callback;83688369return {8370send: function( headers, complete ) {83718372// Get a new xhr8373var handle, i,8374xhr = s.xhr();83758376// Open the socket8377// Passing null username, generates a login popup on Opera (#2865)8378if ( s.username ) {8379xhr.open( s.type, s.url, s.async, s.username, s.password );8380} else {8381xhr.open( s.type, s.url, s.async );8382}83838384// Apply custom fields if provided8385if ( s.xhrFields ) {8386for ( i in s.xhrFields ) {8387xhr[ i ] = s.xhrFields[ i ];8388}8389}83908391// Override mime type if needed8392if ( s.mimeType && xhr.overrideMimeType ) {8393xhr.overrideMimeType( s.mimeType );8394}83958396// X-Requested-With header8397// For cross-domain requests, seeing as conditions for a preflight are8398// akin to a jigsaw puzzle, we simply never set it to be sure.8399// (it can always be set on a per-request basis or even using ajaxSetup)8400// For same-domain requests, won't change header if already provided.8401if ( !s.crossDomain && !headers["X-Requested-With"] ) {8402headers[ "X-Requested-With" ] = "XMLHttpRequest";8403}84048405// Need an extra try/catch for cross domain requests in Firefox 38406try {8407for ( i in headers ) {8408xhr.setRequestHeader( i, headers[ i ] );8409}8410} catch( _ ) {}84118412// Do send the request8413// This may raise an exception which is actually8414// handled in jQuery.ajax (so no try/catch here)8415xhr.send( ( s.hasContent && s.data ) || null );84168417// Listener8418callback = function( _, isAbort ) {84198420var status,8421statusText,8422responseHeaders,8423responses,8424xml;84258426// Firefox throws exceptions when accessing properties8427// of an xhr when a network error occurred8428// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)8429try {84308431// Was never called and is aborted or complete8432if ( callback && ( isAbort || xhr.readyState === 4 ) ) {84338434// Only called once8435callback = undefined;84368437// Do not keep as active anymore8438if ( handle ) {8439xhr.onreadystatechange = jQuery.noop;8440if ( xhrOnUnloadAbort ) {8441delete xhrCallbacks[ handle ];8442}8443}84448445// If it's an abort8446if ( isAbort ) {8447// Abort it manually if needed8448if ( xhr.readyState !== 4 ) {8449xhr.abort();8450}8451} else {8452status = xhr.status;8453responseHeaders = xhr.getAllResponseHeaders();8454responses = {};8455xml = xhr.responseXML;84568457// Construct response list8458if ( xml && xml.documentElement /* #4958 */ ) {8459responses.xml = xml;8460}84618462// When requesting binary data, IE6-9 will throw an exception8463// on any attempt to access responseText (#11426)8464try {8465responses.text = xhr.responseText;8466} catch( _ ) {8467}84688469// Firefox throws an exception when accessing8470// statusText for faulty cross-domain requests8471try {8472statusText = xhr.statusText;8473} catch( e ) {8474// We normalize with Webkit giving an empty statusText8475statusText = "";8476}84778478// Filter status for non standard behaviors84798480// If the request is local and we have data: assume a success8481// (success with no data won't get notified, that's the best we8482// can do given current implementations)8483if ( !status && s.isLocal && !s.crossDomain ) {8484status = responses.text ? 200 : 404;8485// IE - #1450: sometimes returns 1223 when it should be 2048486} else if ( status === 1223 ) {8487status = 204;8488}8489}8490}8491} catch( firefoxAccessException ) {8492if ( !isAbort ) {8493complete( -1, firefoxAccessException );8494}8495}84968497// Call complete if needed8498if ( responses ) {8499complete( status, statusText, responses, responseHeaders );8500}8501};85028503if ( !s.async ) {8504// if we're in sync mode we fire the callback8505callback();8506} else if ( xhr.readyState === 4 ) {8507// (IE6 & IE7) if it's in cache and has been8508// retrieved directly we need to fire the callback8509setTimeout( callback, 0 );8510} else {8511handle = ++xhrId;8512if ( xhrOnUnloadAbort ) {8513// Create the active xhrs callbacks list if needed8514// and attach the unload handler8515if ( !xhrCallbacks ) {8516xhrCallbacks = {};8517jQuery( window ).unload( xhrOnUnloadAbort );8518}8519// Add to list of active xhrs callbacks8520xhrCallbacks[ handle ] = callback;8521}8522xhr.onreadystatechange = callback;8523}8524},85258526abort: function() {8527if ( callback ) {8528callback(0,1);8529}8530}8531};8532}8533});8534}8535var fxNow, timerId,8536rfxtypes = /^(?:toggle|show|hide)$/,8537rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),8538rrun = /queueHooks$/,8539animationPrefilters = [ defaultPrefilter ],8540tweeners = {8541"*": [function( prop, value ) {8542var end, unit,8543tween = this.createTween( prop, value ),8544parts = rfxnum.exec( value ),8545target = tween.cur(),8546start = +target || 0,8547scale = 1,8548maxIterations = 20;85498550if ( parts ) {8551end = +parts[2];8552unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );85538554// We need to compute starting value8555if ( unit !== "px" && start ) {8556// Iteratively approximate from a nonzero starting point8557// Prefer the current property, because this process will be trivial if it uses the same units8558// Fallback to end or a simple constant8559start = jQuery.css( tween.elem, prop, true ) || end || 1;85608561do {8562// If previous iteration zeroed out, double until we get *something*8563// Use a string for doubling factor so we don't accidentally see scale as unchanged below8564scale = scale || ".5";85658566// Adjust and apply8567start = start / scale;8568jQuery.style( tween.elem, prop, start + unit );85698570// Update scale, tolerating zero or NaN from tween.cur()8571// And breaking the loop if scale is unchanged or perfect, or if we've just had enough8572} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );8573}85748575tween.unit = unit;8576tween.start = start;8577// If a +=/-= token was provided, we're doing a relative animation8578tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;8579}8580return tween;8581}]8582};85838584// Animations created synchronously will run synchronously8585function createFxNow() {8586setTimeout(function() {8587fxNow = undefined;8588}, 0 );8589return ( fxNow = jQuery.now() );8590}85918592function createTweens( animation, props ) {8593jQuery.each( props, function( prop, value ) {8594var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),8595index = 0,8596length = collection.length;8597for ( ; index < length; index++ ) {8598if ( collection[ index ].call( animation, prop, value ) ) {85998600// we're done with this property8601return;8602}8603}8604});8605}86068607function Animation( elem, properties, options ) {8608var result,8609index = 0,8610tweenerIndex = 0,8611length = animationPrefilters.length,8612deferred = jQuery.Deferred().always( function() {8613// don't match elem in the :animated selector8614delete tick.elem;8615}),8616tick = function() {8617var currentTime = fxNow || createFxNow(),8618remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),8619percent = 1 - ( remaining / animation.duration || 0 ),8620index = 0,8621length = animation.tweens.length;86228623for ( ; index < length ; index++ ) {8624animation.tweens[ index ].run( percent );8625}86268627deferred.notifyWith( elem, [ animation, percent, remaining ]);86288629if ( percent < 1 && length ) {8630return remaining;8631} else {8632deferred.resolveWith( elem, [ animation ] );8633return false;8634}8635},8636animation = deferred.promise({8637elem: elem,8638props: jQuery.extend( {}, properties ),8639opts: jQuery.extend( true, { specialEasing: {} }, options ),8640originalProperties: properties,8641originalOptions: options,8642startTime: fxNow || createFxNow(),8643duration: options.duration,8644tweens: [],8645createTween: function( prop, end, easing ) {8646var tween = jQuery.Tween( elem, animation.opts, prop, end,8647animation.opts.specialEasing[ prop ] || animation.opts.easing );8648animation.tweens.push( tween );8649return tween;8650},8651stop: function( gotoEnd ) {8652var index = 0,8653// if we are going to the end, we want to run all the tweens8654// otherwise we skip this part8655length = gotoEnd ? animation.tweens.length : 0;86568657for ( ; index < length ; index++ ) {8658animation.tweens[ index ].run( 1 );8659}86608661// resolve when we played the last frame8662// otherwise, reject8663if ( gotoEnd ) {8664deferred.resolveWith( elem, [ animation, gotoEnd ] );8665} else {8666deferred.rejectWith( elem, [ animation, gotoEnd ] );8667}8668return this;8669}8670}),8671props = animation.props;86728673propFilter( props, animation.opts.specialEasing );86748675for ( ; index < length ; index++ ) {8676result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );8677if ( result ) {8678return result;8679}8680}86818682createTweens( animation, props );86838684if ( jQuery.isFunction( animation.opts.start ) ) {8685animation.opts.start.call( elem, animation );8686}86878688jQuery.fx.timer(8689jQuery.extend( tick, {8690anim: animation,8691queue: animation.opts.queue,8692elem: elem8693})8694);86958696// attach callbacks from options8697return animation.progress( animation.opts.progress )8698.done( animation.opts.done, animation.opts.complete )8699.fail( animation.opts.fail )8700.always( animation.opts.always );8701}87028703function propFilter( props, specialEasing ) {8704var index, name, easing, value, hooks;87058706// camelCase, specialEasing and expand cssHook pass8707for ( index in props ) {8708name = jQuery.camelCase( index );8709easing = specialEasing[ name ];8710value = props[ index ];8711if ( jQuery.isArray( value ) ) {8712easing = value[ 1 ];8713value = props[ index ] = value[ 0 ];8714}87158716if ( index !== name ) {8717props[ name ] = value;8718delete props[ index ];8719}87208721hooks = jQuery.cssHooks[ name ];8722if ( hooks && "expand" in hooks ) {8723value = hooks.expand( value );8724delete props[ name ];87258726// not quite $.extend, this wont overwrite keys already present.8727// also - reusing 'index' from above because we have the correct "name"8728for ( index in value ) {8729if ( !( index in props ) ) {8730props[ index ] = value[ index ];8731specialEasing[ index ] = easing;8732}8733}8734} else {8735specialEasing[ name ] = easing;8736}8737}8738}87398740jQuery.Animation = jQuery.extend( Animation, {87418742tweener: function( props, callback ) {8743if ( jQuery.isFunction( props ) ) {8744callback = props;8745props = [ "*" ];8746} else {8747props = props.split(" ");8748}87498750var prop,8751index = 0,8752length = props.length;87538754for ( ; index < length ; index++ ) {8755prop = props[ index ];8756tweeners[ prop ] = tweeners[ prop ] || [];8757tweeners[ prop ].unshift( callback );8758}8759},87608761prefilter: function( callback, prepend ) {8762if ( prepend ) {8763animationPrefilters.unshift( callback );8764} else {8765animationPrefilters.push( callback );8766}8767}8768});87698770function defaultPrefilter( elem, props, opts ) {8771var index, prop, value, length, dataShow, tween, hooks, oldfire,8772anim = this,8773style = elem.style,8774orig = {},8775handled = [],8776hidden = elem.nodeType && isHidden( elem );87778778// handle queue: false promises8779if ( !opts.queue ) {8780hooks = jQuery._queueHooks( elem, "fx" );8781if ( hooks.unqueued == null ) {8782hooks.unqueued = 0;8783oldfire = hooks.empty.fire;8784hooks.empty.fire = function() {8785if ( !hooks.unqueued ) {8786oldfire();8787}8788};8789}8790hooks.unqueued++;87918792anim.always(function() {8793// doing this makes sure that the complete handler will be called8794// before this completes8795anim.always(function() {8796hooks.unqueued--;8797if ( !jQuery.queue( elem, "fx" ).length ) {8798hooks.empty.fire();8799}8800});8801});8802}88038804// height/width overflow pass8805if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {8806// Make sure that nothing sneaks out8807// Record all 3 overflow attributes because IE does not8808// change the overflow attribute when overflowX and8809// overflowY are set to the same value8810opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];88118812// Set display property to inline-block for height/width8813// animations on inline elements that are having width/height animated8814if ( jQuery.css( elem, "display" ) === "inline" &&8815jQuery.css( elem, "float" ) === "none" ) {88168817// inline-level elements accept inline-block;8818// block-level elements need to be inline with layout8819if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {8820style.display = "inline-block";88218822} else {8823style.zoom = 1;8824}8825}8826}88278828if ( opts.overflow ) {8829style.overflow = "hidden";8830if ( !jQuery.support.shrinkWrapBlocks ) {8831anim.done(function() {8832style.overflow = opts.overflow[ 0 ];8833style.overflowX = opts.overflow[ 1 ];8834style.overflowY = opts.overflow[ 2 ];8835});8836}8837}883888398840// show/hide pass8841for ( index in props ) {8842value = props[ index ];8843if ( rfxtypes.exec( value ) ) {8844delete props[ index ];8845if ( value === ( hidden ? "hide" : "show" ) ) {8846continue;8847}8848handled.push( index );8849}8850}88518852length = handled.length;8853if ( length ) {8854dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );8855if ( hidden ) {8856jQuery( elem ).show();8857} else {8858anim.done(function() {8859jQuery( elem ).hide();8860});8861}8862anim.done(function() {8863var prop;8864jQuery.removeData( elem, "fxshow", true );8865for ( prop in orig ) {8866jQuery.style( elem, prop, orig[ prop ] );8867}8868});8869for ( index = 0 ; index < length ; index++ ) {8870prop = handled[ index ];8871tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );8872orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );88738874if ( !( prop in dataShow ) ) {8875dataShow[ prop ] = tween.start;8876if ( hidden ) {8877tween.end = tween.start;8878tween.start = prop === "width" || prop === "height" ? 1 : 0;8879}8880}8881}8882}8883}88848885function Tween( elem, options, prop, end, easing ) {8886return new Tween.prototype.init( elem, options, prop, end, easing );8887}8888jQuery.Tween = Tween;88898890Tween.prototype = {8891constructor: Tween,8892init: function( elem, options, prop, end, easing, unit ) {8893this.elem = elem;8894this.prop = prop;8895this.easing = easing || "swing";8896this.options = options;8897this.start = this.now = this.cur();8898this.end = end;8899this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );8900},8901cur: function() {8902var hooks = Tween.propHooks[ this.prop ];89038904return hooks && hooks.get ?8905hooks.get( this ) :8906Tween.propHooks._default.get( this );8907},8908run: function( percent ) {8909var eased,8910hooks = Tween.propHooks[ this.prop ];89118912if ( this.options.duration ) {8913this.pos = eased = jQuery.easing[ this.easing ](8914percent, this.options.duration * percent, 0, 1, this.options.duration8915);8916} else {8917this.pos = eased = percent;8918}8919this.now = ( this.end - this.start ) * eased + this.start;89208921if ( this.options.step ) {8922this.options.step.call( this.elem, this.now, this );8923}89248925if ( hooks && hooks.set ) {8926hooks.set( this );8927} else {8928Tween.propHooks._default.set( this );8929}8930return this;8931}8932};89338934Tween.prototype.init.prototype = Tween.prototype;89358936Tween.propHooks = {8937_default: {8938get: function( tween ) {8939var result;89408941if ( tween.elem[ tween.prop ] != null &&8942(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {8943return tween.elem[ tween.prop ];8944}89458946// passing any value as a 4th parameter to .css will automatically8947// attempt a parseFloat and fallback to a string if the parse fails8948// so, simple values such as "10px" are parsed to Float.8949// complex values such as "rotate(1rad)" are returned as is.8950result = jQuery.css( tween.elem, tween.prop, false, "" );8951// Empty strings, null, undefined and "auto" are converted to 0.8952return !result || result === "auto" ? 0 : result;8953},8954set: function( tween ) {8955// use step hook for back compat - use cssHook if its there - use .style if its8956// available and use plain properties where available8957if ( jQuery.fx.step[ tween.prop ] ) {8958jQuery.fx.step[ tween.prop ]( tween );8959} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {8960jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );8961} else {8962tween.elem[ tween.prop ] = tween.now;8963}8964}8965}8966};89678968// Remove in 2.0 - this supports IE8's panic based approach8969// to setting things on disconnected nodes89708971Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {8972set: function( tween ) {8973if ( tween.elem.nodeType && tween.elem.parentNode ) {8974tween.elem[ tween.prop ] = tween.now;8975}8976}8977};89788979jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {8980var cssFn = jQuery.fn[ name ];8981jQuery.fn[ name ] = function( speed, easing, callback ) {8982return speed == null || typeof speed === "boolean" ||8983// special check for .toggle( handler, handler, ... )8984( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?8985cssFn.apply( this, arguments ) :8986this.animate( genFx( name, true ), speed, easing, callback );8987};8988});89898990jQuery.fn.extend({8991fadeTo: function( speed, to, easing, callback ) {89928993// show any hidden elements after setting opacity to 08994return this.filter( isHidden ).css( "opacity", 0 ).show()89958996// animate to the value specified8997.end().animate({ opacity: to }, speed, easing, callback );8998},8999animate: function( prop, speed, easing, callback ) {9000var empty = jQuery.isEmptyObject( prop ),9001optall = jQuery.speed( speed, easing, callback ),9002doAnimation = function() {9003// Operate on a copy of prop so per-property easing won't be lost9004var anim = Animation( this, jQuery.extend( {}, prop ), optall );90059006// Empty animations resolve immediately9007if ( empty ) {9008anim.stop( true );9009}9010};90119012return empty || optall.queue === false ?9013this.each( doAnimation ) :9014this.queue( optall.queue, doAnimation );9015},9016stop: function( type, clearQueue, gotoEnd ) {9017var stopQueue = function( hooks ) {9018var stop = hooks.stop;9019delete hooks.stop;9020stop( gotoEnd );9021};90229023if ( typeof type !== "string" ) {9024gotoEnd = clearQueue;9025clearQueue = type;9026type = undefined;9027}9028if ( clearQueue && type !== false ) {9029this.queue( type || "fx", [] );9030}90319032return this.each(function() {9033var dequeue = true,9034index = type != null && type + "queueHooks",9035timers = jQuery.timers,9036data = jQuery._data( this );90379038if ( index ) {9039if ( data[ index ] && data[ index ].stop ) {9040stopQueue( data[ index ] );9041}9042} else {9043for ( index in data ) {9044if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {9045stopQueue( data[ index ] );9046}9047}9048}90499050for ( index = timers.length; index--; ) {9051if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {9052timers[ index ].anim.stop( gotoEnd );9053dequeue = false;9054timers.splice( index, 1 );9055}9056}90579058// start the next in the queue if the last step wasn't forced9059// timers currently will call their complete callbacks, which will dequeue9060// but only if they were gotoEnd9061if ( dequeue || !gotoEnd ) {9062jQuery.dequeue( this, type );9063}9064});9065}9066});90679068// Generate parameters to create a standard animation9069function genFx( type, includeWidth ) {9070var which,9071attrs = { height: type },9072i = 0;90739074// if we include width, step value is 1 to do all cssExpand values,9075// if we don't include width, step value is 2 to skip over Left and Right9076includeWidth = includeWidth? 1 : 0;9077for( ; i < 4 ; i += 2 - includeWidth ) {9078which = cssExpand[ i ];9079attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;9080}90819082if ( includeWidth ) {9083attrs.opacity = attrs.width = type;9084}90859086return attrs;9087}90889089// Generate shortcuts for custom animations9090jQuery.each({9091slideDown: genFx("show"),9092slideUp: genFx("hide"),9093slideToggle: genFx("toggle"),9094fadeIn: { opacity: "show" },9095fadeOut: { opacity: "hide" },9096fadeToggle: { opacity: "toggle" }9097}, function( name, props ) {9098jQuery.fn[ name ] = function( speed, easing, callback ) {9099return this.animate( props, speed, easing, callback );9100};9101});91029103jQuery.speed = function( speed, easing, fn ) {9104var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {9105complete: fn || !fn && easing ||9106jQuery.isFunction( speed ) && speed,9107duration: speed,9108easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing9109};91109111opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :9112opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;91139114// normalize opt.queue - true/undefined/null -> "fx"9115if ( opt.queue == null || opt.queue === true ) {9116opt.queue = "fx";9117}91189119// Queueing9120opt.old = opt.complete;91219122opt.complete = function() {9123if ( jQuery.isFunction( opt.old ) ) {9124opt.old.call( this );9125}91269127if ( opt.queue ) {9128jQuery.dequeue( this, opt.queue );9129}9130};91319132return opt;9133};91349135jQuery.easing = {9136linear: function( p ) {9137return p;9138},9139swing: function( p ) {9140return 0.5 - Math.cos( p*Math.PI ) / 2;9141}9142};91439144jQuery.timers = [];9145jQuery.fx = Tween.prototype.init;9146jQuery.fx.tick = function() {9147var timer,9148timers = jQuery.timers,9149i = 0;91509151for ( ; i < timers.length; i++ ) {9152timer = timers[ i ];9153// Checks the timer has not already been removed9154if ( !timer() && timers[ i ] === timer ) {9155timers.splice( i--, 1 );9156}9157}91589159if ( !timers.length ) {9160jQuery.fx.stop();9161}9162};91639164jQuery.fx.timer = function( timer ) {9165if ( timer() && jQuery.timers.push( timer ) && !timerId ) {9166timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );9167}9168};91699170jQuery.fx.interval = 13;91719172jQuery.fx.stop = function() {9173clearInterval( timerId );9174timerId = null;9175};91769177jQuery.fx.speeds = {9178slow: 600,9179fast: 200,9180// Default speed9181_default: 4009182};91839184// Back Compat <1.8 extension point9185jQuery.fx.step = {};91869187if ( jQuery.expr && jQuery.expr.filters ) {9188jQuery.expr.filters.animated = function( elem ) {9189return jQuery.grep(jQuery.timers, function( fn ) {9190return elem === fn.elem;9191}).length;9192};9193}9194var rroot = /^(?:body|html)$/i;91959196jQuery.fn.offset = function( options ) {9197if ( arguments.length ) {9198return options === undefined ?9199this :9200this.each(function( i ) {9201jQuery.offset.setOffset( this, options, i );9202});9203}92049205var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,9206box = { top: 0, left: 0 },9207elem = this[ 0 ],9208doc = elem && elem.ownerDocument;92099210if ( !doc ) {9211return;9212}92139214if ( (body = doc.body) === elem ) {9215return jQuery.offset.bodyOffset( elem );9216}92179218docElem = doc.documentElement;92199220// Make sure it's not a disconnected DOM node9221if ( !jQuery.contains( docElem, elem ) ) {9222return box;9223}92249225// If we don't have gBCR, just use 0,0 rather than error9226// BlackBerry 5, iOS 3 (original iPhone)9227if ( typeof elem.getBoundingClientRect !== "undefined" ) {9228box = elem.getBoundingClientRect();9229}9230win = getWindow( doc );9231clientTop = docElem.clientTop || body.clientTop || 0;9232clientLeft = docElem.clientLeft || body.clientLeft || 0;9233scrollTop = win.pageYOffset || docElem.scrollTop;9234scrollLeft = win.pageXOffset || docElem.scrollLeft;9235return {9236top: box.top + scrollTop - clientTop,9237left: box.left + scrollLeft - clientLeft9238};9239};92409241jQuery.offset = {92429243bodyOffset: function( body ) {9244var top = body.offsetTop,9245left = body.offsetLeft;92469247if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {9248top += parseFloat( jQuery.css(body, "marginTop") ) || 0;9249left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;9250}92519252return { top: top, left: left };9253},92549255setOffset: function( elem, options, i ) {9256var position = jQuery.css( elem, "position" );92579258// set position first, in-case top/left are set even on static elem9259if ( position === "static" ) {9260elem.style.position = "relative";9261}92629263var curElem = jQuery( elem ),9264curOffset = curElem.offset(),9265curCSSTop = jQuery.css( elem, "top" ),9266curCSSLeft = jQuery.css( elem, "left" ),9267calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,9268props = {}, curPosition = {}, curTop, curLeft;92699270// need to be able to calculate position if either top or left is auto and position is either absolute or fixed9271if ( calculatePosition ) {9272curPosition = curElem.position();9273curTop = curPosition.top;9274curLeft = curPosition.left;9275} else {9276curTop = parseFloat( curCSSTop ) || 0;9277curLeft = parseFloat( curCSSLeft ) || 0;9278}92799280if ( jQuery.isFunction( options ) ) {9281options = options.call( elem, i, curOffset );9282}92839284if ( options.top != null ) {9285props.top = ( options.top - curOffset.top ) + curTop;9286}9287if ( options.left != null ) {9288props.left = ( options.left - curOffset.left ) + curLeft;9289}92909291if ( "using" in options ) {9292options.using.call( elem, props );9293} else {9294curElem.css( props );9295}9296}9297};929892999300jQuery.fn.extend({93019302position: function() {9303if ( !this[0] ) {9304return;9305}93069307var elem = this[0],93089309// Get *real* offsetParent9310offsetParent = this.offsetParent(),93119312// Get correct offsets9313offset = this.offset(),9314parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();93159316// Subtract element margins9317// note: when an element has margin: auto the offsetLeft and marginLeft9318// are the same in Safari causing offset.left to incorrectly be 09319offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;9320offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;93219322// Add offsetParent borders9323parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;9324parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;93259326// Subtract the two offsets9327return {9328top: offset.top - parentOffset.top,9329left: offset.left - parentOffset.left9330};9331},93329333offsetParent: function() {9334return this.map(function() {9335var offsetParent = this.offsetParent || document.body;9336while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {9337offsetParent = offsetParent.offsetParent;9338}9339return offsetParent || document.body;9340});9341}9342});934393449345// Create scrollLeft and scrollTop methods9346jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {9347var top = /Y/.test( prop );93489349jQuery.fn[ method ] = function( val ) {9350return jQuery.access( this, function( elem, method, val ) {9351var win = getWindow( elem );93529353if ( val === undefined ) {9354return win ? (prop in win) ? win[ prop ] :9355win.document.documentElement[ method ] :9356elem[ method ];9357}93589359if ( win ) {9360win.scrollTo(9361!top ? val : jQuery( win ).scrollLeft(),9362top ? val : jQuery( win ).scrollTop()9363);93649365} else {9366elem[ method ] = val;9367}9368}, method, val, arguments.length, null );9369};9370});93719372function getWindow( elem ) {9373return jQuery.isWindow( elem ) ?9374elem :9375elem.nodeType === 9 ?9376elem.defaultView || elem.parentWindow :9377false;9378}9379// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods9380jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {9381jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {9382// margin is only for outerHeight, outerWidth9383jQuery.fn[ funcName ] = function( margin, value ) {9384var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),9385extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );93869387return jQuery.access( this, function( elem, type, value ) {9388var doc;93899390if ( jQuery.isWindow( elem ) ) {9391// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there9392// isn't a whole lot we can do. See pull request at this URL for discussion:9393// https://github.com/jquery/jquery/pull/7649394return elem.document.documentElement[ "client" + name ];9395}93969397// Get document width or height9398if ( elem.nodeType === 9 ) {9399doc = elem.documentElement;94009401// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest9402// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.9403return Math.max(9404elem.body[ "scroll" + name ], doc[ "scroll" + name ],9405elem.body[ "offset" + name ], doc[ "offset" + name ],9406doc[ "client" + name ]9407);9408}94099410return value === undefined ?9411// Get width or height on the element, requesting but not forcing parseFloat9412jQuery.css( elem, type, value, extra ) :94139414// Set width or height on the element9415jQuery.style( elem, type, value, extra );9416}, type, chainable ? margin : undefined, chainable, null );9417};9418});9419});9420// Expose jQuery to the global object9421window.jQuery = window.$ = jQuery;94229423// Expose jQuery as an AMD module, but only for AMD loaders that9424// understand the issues with loading multiple versions of jQuery9425// in a page that all might call define(). The loader will indicate9426// they have special allowances for multiple jQuery versions by9427// specifying define.amd.jQuery = true. Register as a named module,9428// since jQuery can be concatenated with other files that may use define,9429// but not use a proper concatenation script that understands anonymous9430// AMD modules. A named AMD is safest and most robust way to register.9431// Lowercase jquery is used because AMD module names are derived from9432// file names, and jQuery is normally delivered in a lowercase file name.9433// Do this after creating the global so that if an AMD module wants to call9434// noConflict to hide this version of jQuery, it will work.9435if ( typeof define === "function" && define.amd && define.amd.jQuery ) {9436define( "jquery", [], function () { return jQuery; } );9437}94389439})( window );9440944194429443